Przejdź do treści
Biblioteka skilli
Programowanie · Konwersja i formaty

generating-patches

/generating-patches

Generuje pliki łatek git ze zmian w kodzie do lokalnego zastosowania, przy eksporcie zmian po edycji wgranych baz kodu.

Repozytorium
claude-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
25.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 25.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Generuje pliki łatek git ze zmian w kodzie do lokalnego zastosowania, przy eksporcie zmian po edycji wgranych baz kodu.

Oryginalny opis (EN)

Generates git patch files from codebase modifications for local application. Use when user mentions patch, diff, export changes, bring changes back, apply locally, or after editing uploaded codebases.

Jak działa

  1. When to Use
  2. Prerequisites
  3. Generating the Patch
  4. Handling Edge Cases
  5. Output Requirements
  6. User Instructions
  7. Optional: PR Description
Sekcje z nagłówków SKILL.md, w oryginale · 124 linii, 460 słów
Podgląd SKILL.md
---
name: generating-patches
description: Generates git patch files from codebase modifications for local application. Use when user mentions patch, diff, export changes, bring changes back, apply locally, or after editing uploaded codebases.
metadata:
  version: 0.1.0
---

# Generating Patches

Generate portable git patch files from codebase modifications, enabling users to apply Claude's edits to their local repositories.

## When to Use

Activate after modifying files in an uploaded codebase when the user needs to transfer changes back to their local environment. Typical workflow: user uploads zip → Claude edits files → this skill exports changes as a patch.

## Prerequisites

Verify git is available and the working directory is a git repository (or can be initialized as one):

```bash
git status 2>/dev/null || git init
```

If working with an uploaded codebase that lacks git history, initialize and create a baseline commit before making edits:

```bash
git init
git add -A
git commit -m "Baseline: original uploaded state"
```

## Generating the Patch

After completing edits, generate a unified diff:

```bash
# For uncommitted changes (working tree modifications)
git diff > /mnt/user-data/outputs/changes.patch

# If changes are staged but not committed
git diff --cached > /mnt/user-data/outputs/changes.patch

# For both staged and unstaged
git diff HEAD > /mnt/user-data/outputs/changes.patch
```

For committed changes (preserves commit messages and metadata):

```bash
# All commits since baseline
git format-patch --stdout baseline..HEAD > /mnt/user-data/outputs/changes.patch

# Or specify number of commits
git format-patch --stdout -n 3 > /mnt/user-data/outputs/changes.patch
```

## Handling Edge Cases

**Binary files**: Git diff excludes binaries by default. Warn the user if binary files were modified:

```bash
git diff --name-only --diff-filter=M | xargs file | grep -v "ASCII\|UTF-8\|empty"
```

**Large patches**: For extensive changes, consider splitting by directory or file type:

```bash
git diff -- "*.py" > /mnt/user-data/outputs/python-changes.patch
git diff -- src/ > /mnt/user-data/outputs/src-changes.patch
```

**No changes detected**: Verify files were actually modified. Common issues:
- Edits made to copies outside the git tree
- Files not tracked by git (need `git add` first)

## Output Requirements

Always output to `/mnt/user-data/outputs/` with a descriptive filename. Provide the download link:

```markdown
[Download changes.patch](computer:///mnt/user-data/outputs/changes.patch)
```

## User Instructions

Include these instructions with every patch delivery:

---

**To apply this patch locally:**

```bash
cd /path/to/your/repo

# Preview changes (dry run)
git apply --check changes.patch

# Apply to working tree
git apply changes.patch
```

**If using format-patch output (includes commit metadata):**

```bash
git am changes.patch
```

**Troubleshooting:**

- `git apply --reject changes.patch` — applies what it can, writes `.rej` files for conflicts
- `git apply -R changes.patch` — reverses a previously applied patch
- `git apply --3way changes.patch` — enables three-way merge for conflicts

---

## Optional: PR Description

When requested, generate a pull request description from the patch:

```bash
# Extract summary of changes
echo "## Summary"
git diff --stat
echo ""
echo "## Changes"
git diff --name-only | while read f; do echo "- \`$f\`"; done
```

Combine with a brief description of what was changed and why, suitable for GitHub PR body.
Pliki w paczce (2)
  • README.md 1 KB
  • SKILL.md 3 KB

Wersje

W bazie nie ma innych skilli o nazwie generating-patches.

Identyczna treść występuje jeszcze w 2 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 28.10.2026 · wersja paczki 772b3820df2b (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90evo-patch-generate-apply
    Generuje łatki w formacie unified diff z oryginalnej i zmodyfikowanej treści plików, zapisuje je do numerowanych plików i stosuje w repozytorium przez git apply lub GNU patch.
  • 100patch-anatomy
    Wyjaśnia, jak pisać łatki do Morphe: DSL bytecodePatch, zgodność, rozszerzenia, opcje i finalizacja, przy tworzeniu nowych łatek lub poznawaniu ich struktury.
  • 100composer-patch-generator
    Generuje i utrzymuje łatki do pakietów instalowanych przez Composera (moduły Drupal, pakiety WordPress, biblioteki PHP) z cweagans/composer-patches, w tym łatki diff -ruN działające w CI.
  • 95change-log-generator
    Generuje changelogi z commitów git, łatek i pull requestów, w tym conventional commits, w kategoriach Features, Bug Fixes i Breaking Changes, do notatek wydania i plików CHANGELOG.md.
  • 100security-patch-workflow
    Opisuje, jak tworzyć, stosować i weryfikować łatki bezpieczeństwa w repozytoriach git oraz sprawdzać, czy łatki rzeczywiście usuwają podatności.
  • 90real-patch-examples
    Podaje wzorce łatek Morphe z oficjalnego repozytorium: nadpisywanie metod, filtrowanie list i łańcuchy klas.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.