agentleFS
Baba01hacker666Baba01hacker666/dummyskills/skills/git/git-commit-stager/SKILL.md

git-commit-stager

Skill0 starsChanged 2 months agoMITView on GitHub

Guides agents through staging surgical, atomic git commits using Conventional Commits format.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create clean, bisectable git histories with focused commits.

    line 11
  2. Distinctive:

    Use this skill when:

    line 14
  3. Very specific:

    Do not use to draft PR descriptions.

    line 20
  4. Very specific:

    If type is omitted: infer from diff (fix for bug fixes, feat for new functionality, test for test additions).

    line 27
  5. Very specific:

    Never commit with vague messages like update or wip.

    line 28
  6. Distinctive:

    Follow these numbered actions:

    line 31
  7. Distinctive:

    Commit message subject must be imperative: "add feature", not "added feature".

    line 44
  8. Very specific:

    If breaking change: append !

    line 45
  9. Distinctive:

    Stop and ask the user when:

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 Commit Stager

Stages atomic changes and writes precise commit messages adhering to the Conventional Commits specification (feat, fix, docs, refactor, test, chore).

1. Purpose

Create clean, bisectable git histories with focused commits.

2. When to Use

Use this skill when:

  • Staging and committing code changes after completing a task step.
  • Writing structured commit messages (feat(parser): add unicode support).
  • Separating unrelated edits into distinct commits.

3. When Not to Use

  • Do not use to draft PR descriptions; use github-pr-creator.

4. Required Inputs

  • commit_type: feat, fix, docs, refactor, test, chore.
  • description: Imperative summary (e.g. add rate limit middleware).

5. Missing-Input Behavior

  1. If type is omitted: infer from diff (fix for bug fixes, feat for new functionality, test for test additions).
  2. Never commit with vague messages like update or wip.

6. Procedure

Follow these numbered actions:

  1. Action 1: Review Staged Diff
    • Execute: git diff --cached (or git status).
  2. Action 2: Stage Only Intended Files
    • Execute: git add <files> (avoid git add . if untracked junk exists).
  3. Action 3: Format Commit Message
    • <type>(<scope>): <subject>
  4. Action 4: Execute Commit
    • Execute: git commit -m "<message>"
  5. Action 5: Emit Commit Summary
    • Format per Section 8.

7. Decision Rules

  • Commit message subject must be imperative: "add feature", not "added feature".
  • If breaking change: append ! after type (feat!: remove v1 auth).

8. Output Format

Emit the report using this template:

### Git Commit Report

- **Commit SHA**: `[hash]`
- **Message**: `[type(scope): subject]`
- **Files Committed**: [Count]

#### Commit Diff Summary
```text
[git log -n 1 --stat output]

## 9. Verification Checklist
- [ ] Commit message follows Conventional Commits.
- [ ] No unwanted files staged (`.env`, `.DS_Store`, build logs).
- [ ] Commit succeeded with exit code 0.

## 10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
| :--- | :--- | :--- |
| Accidental staging of .env | Ran `git add .` | Run `git reset HEAD .env`. |

## 11. Stop or Escalation Conditions
Stop and ask the user when:
- Git user name or email is not configured in git environment.

## 12. Examples

### Example 1: Successful Execution
**Input:**
```text
Type: fix
Scope: auth
Subject: handle null token in header
Files: src/auth.ts

Output:

### Git Commit Report

- **Commit SHA**: `a1b2c3d`
- **Message**: `fix(auth): handle null token in header`
- **Files Committed**: 1

#### Commit Diff Summary
```text
 src/auth.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

### Example 2: Ambiguous or Missing Input
**Input:**
```text
Commit it.

Output:

### Git Commit Report: Checking Staged Changes

Reviewing `git status` to determine affected files and appropriate Conventional Commit type.

Example 3: Expected Final Output

Output:

### Git Commit Report

- **Commit SHA**: `e4f5a6b`
- **Message**: `test(cart): add zero discount regression test`
- **Files Committed**: 1

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.