agentleFS
sjain-stanfordsjain-stanford/claude-workspace/skills/stage-and-commit/SKILL.md

stage-and-commit

Skill2 starsChanged 21 days agoApache-2.0View on GitHub

Stage and commit changes to the current branch with Signed-off-by trailers. Use when asked to commit, save changes, or create a commit.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Sign-off: Always use git commit -s to include a Signed-off-by trailer.

    line 23
  2. Distinctive:

    No push: NEVER push to remote. Only commit locally.

    line 27
  3. Distinctive:

    Specific staging: Prefer staging specific files by name over git add -A or git add .

    line 28
  4. Distinctive:

    Run git commands from the target repository directory.

    line 32
  5. Distinctive:

    Run these commands in parallel to understand the current state:

    line 36
  6. Distinctive:

    Use appropriate verbs: "add" for new features, "update" for enhancements, "fix" for bugs

    line 53
  7. Distinctive:

    Keep the first line under 72 characters

    line 54
  8. Distinctive:

    Use 2-3 short body lines to explain both why the change is needed and what behavior, workflow, or contract it changes.

    line 57
  9. Distinctive:

    If the user provides only a terse phrase, expand it into a clear subject and body based on the staged diff while preserving the user's …

    line 59
  10. Distinctive:

    Follow the commit message style observed in recent commits

    line 62
  11. Distinctive:

    Use HEREDOC format to ensure proper formatting of multi-line commit messages:

    line 77
  12. Distinctive:

    Run git status after commit to confirm success.

    line 88
  13. Distinctive:

    Only omit the body for a truly tiny mechanical commit, such as a typo fix or single-value metadata bump, and only when that matches the …

    line 100
  14. Very specific:

    Do not add a type prefix such as feat:, fix:, docs:, or chore: unless the user explicitly asks for one or the repository's recent history …

    line 104

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Stage and Commit Skill

Stages and commits changes with the workspace's required Signed-off-by trailer.

Usage

/stage-and-commit [message]
  • message (optional): Commit message. If not provided, the active agent will analyze changes and draft an appropriate message.

Commit Rules

CRITICAL: These rules must always be followed:

  1. Sign-off: Always use git commit -s to include a Signed-off-by trailer. This is distinct from cryptographic signing with -S; preserve configured signing and follow any additional repository or user signing requirement.
  2. No agent attribution: Omit agent attribution footers from commit messages.
  3. No push: NEVER push to remote. Only commit locally. User must explicitly request push separately.
  4. Specific staging: Prefer staging specific files by name over git add -A or git add .

Process

Run git commands from the target repository directory.

1. Gather Information

Run these commands in parallel to understand the current state:

# See all changes (never use -uall flag)
git status

# See staged and unstaged changes
git diff
git diff --cached

# See recent commit messages for style reference
git log --oneline -5

2. Analyze and Draft Commit Message

  • Summarize the nature of changes (new feature, enhancement, bug fix, refactor, test, docs, etc.)
  • Use appropriate verbs: "add" for new features, "update" for enhancements, "fix" for bugs
  • Keep the first line under 72 characters
  • Include a concise body for every non-trivial commit. Do not leave the message as just a subject line plus sign-off.
  • Use 2-3 short body lines to explain both why the change is needed and what behavior, workflow, or contract it changes.
  • If the user provides only a terse phrase, expand it into a clear subject and body based on the staged diff while preserving the user's intent.
  • Focus on "why" as well as "what"
  • Follow the commit message style observed in recent commits

3. Stage Files

Stage relevant files by name. Avoid staging:

  • Files containing secrets (.env, credentials.json, etc.)
  • Large binaries
  • Unrelated changes
git add <specific-files>

4. Create Commit

Use HEREDOC format to ensure proper formatting of multi-line commit messages:

git commit -s -m "$(cat <<'EOF'
<commit message>
EOF
)"

5. Verify

Run git status after commit to confirm success.

Commit Message Format

<short description>

<body explaining why the change is needed and what it changes>

Signed-off-by: <user name> <user email>

Only omit the body for a truly tiny mechanical commit, such as a typo fix or single-value metadata bump, and only when that matches the repository's recent commit style.

Do not add a type prefix such as feat:, fix:, docs:, or chore: unless the user explicitly asks for one or the repository's recent history overwhelmingly requires it.

Example

git add skills/stage-and-commit/SKILL.md CLAUDE.md README.md
git commit -s -m "$(cat <<'EOF'
Add stage-and-commit skill for standardized commits

Introduces /stage-and-commit skill that enforces commit sign-offs
per workspace conventions.
EOF
)"

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.