agentleFS
tranquocthongtranquocthong/claude-spec-flow/skills/commit/SKILL.md

commit

Skill0 starsChanged 51 days agoMITView on GitHub

spec-flow SHIP step: conventional-commit + push + surface the merge/pull-request link, VCS-agnostic (GitHub + GitLab), with a base-branch guard. Branch creation is owned by the lifecycle commands (/sf:ingest, /sf:bug, /sf:change) via the engine's branch-ensure; this skill commits on the current work branch and refuses to commit on the configured base branch. Invoke ONLY in spec-flow context — explicitly as /sf:commit, or from the /sf:phase ship step. Do NOT auto-trigger on a bare "commit"/"commit push" request — that is the user's own commit workflow, not this skill.

  • Commits and pushes

189 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use validate-plan, act-on-feedback 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.
  • shawn-dumasSkill

    validate-plan

    Validate an orchestration plan after pre-flight certification. Runs adversarial review, deep review (verify prompt data against codebase), and PoC gate for risky approaches. Auto-invoked by orchestrate-* skills at Step 8.

    Also in 5 projects that use this

  • MicrosoftSkill

    act-on-feedback

    Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

    Also in 3 projects that use this

  • decocmsSkill

    add-mcp-tools

    Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth integration

    Also in 3 projects that use this

  • MicrosoftSkill

    generate-run-commands

    Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.

    Also in 3 projects that use this

  • mitsuhikoSkill

    oebb-scotty

    Austrian rail travel planner (ÖBB Scotty). Use when planning train journeys in Austria, checking departures/arrivals at stations, or looking for service disruptions. Covers ÖBB trains, S-Bahn, regional trains, and connections to neighboring countries.

    Also in 3 projects that use this

  • mitsuhikoSkill

    pi-share

    Load and parse session transcripts from shittycodingagent.ai/buildwithpi.ai/buildwithpi.com/pi.dev (pi-share) URLs. Fetches gists, decodes embedded session data, and extracts conversation history.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 168 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    If .spec-flow/config.json exists, read its branching block (mode, base).

    line 52
  2. Very specific:

    If branching.mode is not off and the current branch equals branching.base (e.g.

    line 54
  3. Very specific:

    If mode: off, or there is no .spec-flow/ (non-spec-flow repo), or already on a work branch → proceed normally.

    line 59
  4. Distinctive:

    Read git diff --cached to understand intent.

    line 69
  5. Very specific:

    If something staged looks unrelated, you MAY git restore --staged <file> to drop it (working-tree change stays intact).

    line 71
  6. Very specific:

    Add Push: origin/{branch} and the MR/PR link when pushed.

    line 131

“Common” is measured: kept by at least 6 in 10 of the 168 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

commit — conventional commit + push (spec-flow)

Turn the staged diff into a clean conventional commit, push, and surface the MR/PR link. This skill is convention only — no personal style, no stack assumptions. Branch policy lives in .spec-flow/config.json → branching and is created by the lifecycle commands, not here.

Multi-repo: this skill operates on the current working directory's git repo only. When config.repos is set (one SD across sibling service repos), the caller runs this skill once per repo with staged changes — cd into each repo first. branch-ensure has already created the same feat/<feature> branch in each, so each invocation commits + pushes + surfaces one PR for that service; collect the PR links together.

Modes

InvocationBehavior
commitCommit staged changes on the current branch
commit pushCommit + push + surface MR/PR link

Process

Step 1 — Gather context (run in parallel)

git status --short
git diff --cached --stat
git diff --stat
git log --oneline -5
git rev-parse --abbrev-ref HEAD

Collect: current branch, staged files (git diff --cached --name-only), unstaged/untracked (informational), and the repo's recent commit style.

Step 2 — Base-branch guard (spec-flow)

If .spec-flow/config.json exists, read its branching block (mode, base).

  • If branching.mode is not off and the current branch equals branching.base (e.g. main): STOP. Do not commit. Tell the user:

    You're on the base branch <base>. spec-flow creates the work branch at /sf:ingest (per SD), /sf:bug, or /sf:change — run the relevant one first, then re-run commit. (Or set branching.mode: "off" in .spec-flow/config.json to allow commits on <base>.)

  • If mode: off, or there is no .spec-flow/ (non-spec-flow repo), or already on a work branch → proceed normally.

Branch creation is the engine's job (branch-ensure, called by the lifecycle commands) — a single source of truth for naming. This skill never runs git checkout -b.

Step 3 — Scan staged changes

Work from the staged set only. Never git add — the user decides what enters the index.

  1. Read git diff --cached to understand intent.
  2. Nothing staged → stop (see Edge Cases).
  3. If something staged looks unrelated, you MAY git restore --staged <file> to drop it (working-tree change stays intact). Never add new files.

Step 4 — Detect type and scope (language-agnostic, from staged diff)

Type (first match wins):

TypeWhen
featNew files / new capability / new endpoint, command, or public function
fixCorrects wrong behavior, error handling, or an incorrect value
refactorRename / move / restructure with no behavior change
choreBuild files, dependencies, config, generated artifacts, formatting
docsOnly docs / comments (.md, doc-comments) changed
testOnly test files changed (any *test* / *spec* path the repo uses)

Scope: the primary module/feature affected, derived from the common directory or filename of the staged files (e.g. auth, bug, snapshot, init). Omit scope if changes span many unrelated areas.

Step 5 — Commit (staged only)

{type}({scope}): {subject}

{body — only when multiple distinct changes or non-obvious}

Rules: subject imperative, ≤72 chars, no trailing period; body bullets only when needed; match the repo's existing style from Step 1. Plain text only — no emoji.

git commit -m "$(cat <<'EOF'
{type}({scope}): {subject}

{optional body}
EOF
)"

Step 6 — Push + surface MR/PR (push mode)

git push -u origin "$(git rev-parse --abbrev-ref HEAD)"

(-u on first push sets upstream; later pushes can be plain git push.) Then surface the review link, VCS-agnostic:

  • GitLab: the push output prints a remote: ... merge_requests/new?... URL — report it.
  • GitHub: report the compare URL from the push output, or run gh pr create if the user wants the PR opened. (Ask before running gh if approval is required in this environment.)

Step 7 — Report

Branch: {current-branch}
Commit: {short-hash} — {subject}
Files:  {count} changed

Add Push: origin/{branch} and the MR/PR link when pushed. Always list unstaged/untracked files left out, so the user knows what wasn't committed.

Edge Cases

  • Nothing staged → stop: "No staged changes. git add <files> then re-run." List unstaged/untracked. Do NOT auto-stage.
  • On base branch with mode != off → refuse (Step 2). Point to lifecycle commands.
  • Unstaged files alongside staged → commit only staged; list the rest in the report.
  • Amend → only if the user explicitly asks, and never amend an already-pushed commit.

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.