agentleFS
GitHubKnown publishergithub/copilot-billing-preview/.github/skills/git-workflow/SKILL.md

git-workflow

Skill32 starsChanged 7 months agoMITView on GitHub

Handles git workflow: creating branches, atomic commits with conventional prefixes, PR creation with structured summaries, keeping PR descriptions updated on follow-up pushes, and post-merge cleanup. Use when the user asks to commit, create or update a PR, push changes, address PR feedback, or says a PR was merged.

  • Deletes or force-pushes
  • Commits and pushes

118 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use squad-commands, typescript-patterns and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    squad-commands

    Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.

    Also in 3 projects that use this

  • cohen-lielSkill

    typescript-patterns

    TypeScript best practices and patterns. Use when writing TypeScript code, defining types, working with generics, or converting JavaScript to TypeScript.

    Also in 4 projects that use this

  • martinholovskySkill

    llm-integration

    Expert skill for integrating local Large Language Models using llama.cpp and Ollama. Covers secure model loading, inference optimization, prompt handling, and protection against LLM-specific vulnerabilities including prompt injection, model theft, and denial of service attacks.

    Also in 4 projects that use this

  • MicrosoftSkill

    cost-optimization

    Optimize existing Azure resources and analyze Reservations or Savings Plans. WHEN: \"optimize Azure costs\", \"reduce cloud spending\", \"rightsize resources\", \"find idle resources\", \"orphaned disk\", \"deleted VM still charged\", \"public IP still charging\", \"reservation utilization\", \"Savings Plan coverage\", \"commitment recommendation\", \"why is pay-as-you-go still charged\". DO NOT USE FOR: cost spikes, forecasts, pricing estimates, budgets, or governance.

    Also in 5 projects that use this

  • YepAPISkill

    background-jobs

    Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

    Also in 3 projects that use this

  • Vimalk0703Skill

    dependency-management

    Vet packages before adoption, audit for vulnerabilities, pin versions, and prevent dependency bloat.

    Also in 3 projects that use this

  • +1 more from microsoft

The file

Show its rules and text

We split this skill into the rules it gives an agent

31 rules. 0 are common, 24 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 101 edited versions we read keep these.

  • 24

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create descriptive branch names using category prefixes:

    line 17
  2. Very specific:

    Commit message format: prefix: short imperative description

    line 31
  3. Very specific:

    Use feat!: or fix!: for breaking changes.

    line 35
  4. Distinctive:

    Keep the subject line under 72 characters

    line 40
  5. Distinctive:

    No period at the end of the subject line

    line 41
  6. Very specific:

    Always include this trailer at the end of every commit message: Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

    line 42
  7. Distinctive:

    Before creating any commit, review staged changes with git diff --cached to ensure only intended changes are included.

    line 45
  8. Distinctive:

    Do not treat "atomic commits" as a preference.

    line 49
  9. Distinctive:

    Before creating any commit:

    line 51
  10. Distinctive:

    Create a brief internal commit plan such as:

    line 55
  11. Distinctive:

    After each staged unit, run git diff --cached and verify the staged diff matches exactly one logical change.

    line 60
  12. Distinctive:

    If the current working tree cannot be cleanly split into atomic commits without risky manual surgery, stop and tell the caller that the …

    line 61
  13. Distinctive:

    Never create a single catch-all commit when the diff spans multiple concerns, such as:

    line 63
  14. Distinctive:

    If the user asks to create a PR and the branch contains uncommitted work spanning multiple logical changes, the skill must split that work …

    line 70
  15. Distinctive:

    If the user asks to address PR feedback, keep the fixes in one commit only when they all serve the same review-driven purpose.

    line 72
  16. Distinctive:

    After all commits are ready and pushed:

    line 76
  17. Very specific:

    Create a PR with gh pr create

    line 79
  18. Distinctive:

    When reporting success back to the user, include the branch name, relevant commit SHA(s), and PR URL.

    line 89
  19. Distinctive:

    When a branch already has an open PR and you push additional commits:

    line 93
  20. Very specific:

    Read the current PR body with gh pr view --json body -q .body and use that exact content as the base for your update.

    line 95
  21. Distinctive:

    Treat the PR body as a surgical update, not a full rewrite:

    line 98
  22. Distinctive:

    update the summary table to include new commits

    line 100
  23. Distinctive:

    remove or rewrite outdated entries when the implementation changed

    line 101
  24. Distinctive:

    If the PR body does not already contain a summary table, add one without removing the rest of the description.

    line 103
  25. Very specific:

    Before running gh pr edit, verify the updated body still contains the important sections from the original PR description.

    line 104
  26. Distinctive:

    Never leave the PR description stale after pushing fixes to an existing PR.

    line 106
  27. Distinctive:

    If the user explicitly asks to redo commits, split a monolithic commit, or force-push a corrected branch:

    line 110
  28. Distinctive:

    Use git push --force-with-lease only when the user explicitly requested rewriting remote history.

    line 113
  29. Distinctive:

    After the push, make sure the PR description still matches the new commit set.

    line 114
  30. Distinctive:

    When told a PR is merged:

    line 118
  31. Very specific:

    Delete the merged branch locally: git branch -d <branch-name>

    line 122

“Common” is measured: kept by at least 6 in 10 of the 101 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Workflow

Manage the git workflow for this project. Follow these conventions strictly.

Branch Naming

Create descriptive branch names using category prefixes:

  • feat/short-description — new features
  • fix/short-description — bug fixes
  • refactor/short-description — code restructuring
  • chore/short-description — maintenance, deps, config
  • security/short-description — security fixes
  • ui/short-description — UI/UX changes
  • improve/short-description — improvements and optimizations

Commit Conventions

Each commit must be atomic — one logical change per commit.

Commit message format: prefix: short imperative description

Prefixes: fix:, feat:, refactor:, chore:, ci:, docs:, test:

Use feat!: or fix!: for breaking changes.

Rules:

  • If this is the first commit in a batch, inspect package.json and run only the validation scripts that actually exist among build, lint, and test. If any existing required script fails, abort immediately and return the failure to the caller. Do not attempt to fix unrelated issues from inside this skill.
  • One logical change per commit — do not bundle unrelated changes
  • Keep the subject line under 72 characters
  • No period at the end of the subject line
  • Always include this trailer at the end of every commit message: Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Before creating any commit, review staged changes with git diff --cached to ensure only intended changes are included.

Enforcing Atomic Commits

Do not treat "atomic commits" as a preference. Treat it as a required workflow.

Before creating any commit:

  1. Inspect the full working tree with git status --short and git diff --stat.
  2. Identify the logical change units before staging anything.
  3. Create a brief internal commit plan such as:
    • feat: add parser support for new field
    • feat: add reusable chart component
    • ui: refresh dashboard layout
  4. Stage and commit one logical unit at a time. Prefer file-based staging when a file belongs entirely to one change; use partial staging such as git add -p when multiple logical changes share a file.
  5. After each staged unit, run git diff --cached and verify the staged diff matches exactly one logical change.
  6. If the current working tree cannot be cleanly split into atomic commits without risky manual surgery, stop and tell the caller that the changes need to be reorganized before committing.

Never create a single catch-all commit when the diff spans multiple concerns, such as:

  • parser or data-shape changes mixed with UI changes
  • new reusable components mixed with feature wiring
  • layout/styling changes mixed with behavior changes
  • review feedback fixes mixed with unrelated cleanup

If the user asks to create a PR and the branch contains uncommitted work spanning multiple logical changes, the skill must split that work into multiple commits before pushing.

If the user asks to address PR feedback, keep the fixes in one commit only when they all serve the same review-driven purpose. If feedback touches separate concerns, split it into multiple commits.

PR Creation and Updates

After all commits are ready and pushed:

  1. Push the branch: git push -u origin <branch-name>
  2. Create a PR with gh pr create
  3. PR body must include a summary table of all commits:
| Commit | Change |
|--------|--------|
| `fix:` description | What was fixed and why |
| `feat:` description | What was added |

When reporting success back to the user, include the branch name, relevant commit SHA(s), and PR URL.

PR Follow-Up Pushes

When a branch already has an open PR and you push additional commits:

  1. Read the current PR body with gh pr view --json body -q .body and use that exact content as the base for your update. Do not generate a fresh PR description from scratch.
  2. Push the branch updates.
  3. Refresh the PR description with gh pr edit so it reflects the latest state of the branch.
  4. Treat the PR body as a surgical update, not a full rewrite:
    • preserve existing sections such as summary prose, validation steps, and other reviewer context
    • update the summary table to include new commits
    • remove or rewrite outdated entries when the implementation changed
    • mention review feedback fixes in the description when the new commits address PR comments
  5. If the PR body does not already contain a summary table, add one without removing the rest of the description.
  6. Before running gh pr edit, verify the updated body still contains the important sections from the original PR description.

Never leave the PR description stale after pushing fixes to an existing PR.

History Rewrites

If the user explicitly asks to redo commits, split a monolithic commit, or force-push a corrected branch:

  1. Rebuild the branch history into atomic commits that match the conventions above.
  2. Use git push --force-with-lease only when the user explicitly requested rewriting remote history.
  3. After the push, make sure the PR description still matches the new commit set.

Post-Merge Cleanup

When told a PR is merged:

  1. git checkout main
  2. git pull origin main
  3. Delete the merged branch locally: git branch -d <branch-name>
  4. Confirm the local main is up to date

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.