patterns/commit/skills/commit/SKILL.md
Use when: committing code with security audit, tests, review gates
npx skillsauth add ryderfreeman4logos/cli-sub-agent commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Check your initial prompt. If it contains the literal string "Use the commit skill", then:
YOU ARE THE EXECUTOR. Follow these rules:
../../PATTERN.md relative to this SKILL.md, and follow it step by step.csa run, csa review, csa debate, or ANY csa command. You must perform the work DIRECTLY. Running any csa command causes infinite recursion.Only if you are the main agent (Claude Code / human user):
Enforce "Commit = Audited" discipline: every commit passes branch check, formatting, linting, tests, security audit, and heterogeneous code review before being created. Includes automatic PR creation when a logical milestone is reached, with pr-bot integration for cloud review.
All quality hooks MUST be allowed to run. Bypassing hooks is a critical SOP violation.
When just pre-commit fails:
When just test fails:
git commitmain or dev)csa run --sa-mode true --skill commit "Commit the current changes with scope: <scope>"
When operating under SA mode (e.g., dispatched by /sa or any autonomous workflow),
ALL csa invocations MUST include --sa-mode true. This includes csa run,
csa review, csa debate, and any other execution commands. Omitting --sa-mode
at root depth causes a hard error; passing false when the caller is in SA mode
breaks prompt-guard propagation.
just fmt, just clippy, just test sequentially. Fix any failures.git add relevant files. Also stages all tracked modifications via git add -u to include just fmt-reformatted files (outside requested scope) and rule-055 pre-existing dirty state. Logs any files staged beyond the requested scope with a NOTE line. Verify no untracked files remain.security-audit pattern via CSA -- three-phase audit (test completeness, vulnerability scan, code quality).ai-reviewed-commit pattern via CSA -- authorship-aware review (debate for self-authored, csa review --diff --allow-fallback for others). Fix-and-retry up to 3 rounds (hard cap). After round 3, if review still reports non-false-positive P0/P1 findings, STOP and ask the user whether to continue. Exception: if the user's prior prompt explicitly authorized unbounded looping (e.g., "loop until clean", "keep fixing until review passes"), continue without asking. Also continue without asking if all round-3 findings are false positives per orchestrator judgement.
parallel-fix pattern (parallel RECON / serial EDIT) instead of a single-employee fix. See patterns/parallel-fix/skills/parallel-fix/SKILL.md.tier-1-quick (tool and thinking budget come from config). The commit body MUST include the AI Reviewer Metadata block from Commit Message Format (AI Era). If a review session already ran in this workflow, prefer resuming it with --session <review-session-id> (reuses cached context, near-zero new tokens). When resuming, keep the same tool (sessions are tool-locked).git commit -m "${COMMIT_MSG}"./pr-bot.
Runs automatically when commit is standalone. Skipped when parent workflow
(mktsk/dev2merge) sets CSA_SKIP_PUBLISH=true, or automatically in
executor mode (CSA_DEPTH set and non-zero plus CSA_INTERNAL_INVOCATION=1)
so that employee sessions stay orchestration-pure and only the Layer 0
orchestrator runs the push + PR + pr-bot transaction (#752 Bug 4, #782).
/pr-bot internally runs a separate cumulative review (csa review --range main...HEAD) covering ALL commits on the branch before push. This is distinct from Step 6's per-commit review (csa review --diff). Do NOT skip pr-bot's internal review even if Step 6 passed.| Layer | Command | Scope | Timing |
|-------|---------|-------|--------|
| Per-commit | csa review --diff | Staged changes only | Before git commit (Step 6) |
| Pre-PR cumulative | csa review --range main...HEAD | Full feature branch | Before git push (inside /pr-bot Step 2) |
Both layers are mandatory. The per-commit review catches issues in each individual change; the cumulative review catches cross-commit issues and ensures the full branch is coherent.
This is the while-waiting checklist. When you background a csa session wait via run_in_background: true, the next task-notification wakes you up automatically. Do not sleep or add extra polling on top.
Safe parallel work:
gh pr create yet.Do NOT:
csa run or csa review sessions that could race on git branch or checkout state with the waiting one (single-checkout sequential rule, AGENTS.md 028).git commit, git checkout <other-branch>, or git push.If there is no useful parallel work available, return control and wait for the notification. Do not invent speculative work just to stay busy.
All commits created by this workflow must use:
<type>(<scope>): <subject>
<Description of what changed>
### AI Reviewer Metadata
- **Design Intent**: <Why this change was made, what problem it solves. Context not obvious from the diff.>
- **Key Decisions**: <Significant architectural or implementation choices made during the task.>
- **Reviewer Guidance**: List areas needing careful review, with REQUIRED sub-fields:
- **Timing/Race Scenarios**: any timing-sensitive ordering, concurrency race, file-system race, or async ordering the change must survive. List the concrete input/orderings to verify. Use `none` when not applicable.
- **Boundary Cases**: null/empty/max/min/off-by-one inputs and other edge conditions that require explicit checking. Use `none` when not applicable.
- **Regression Tests Added**: list the concrete test names that cover the timing/race and boundary guidance above. This field is REQUIRED. If `Timing/Race Scenarios` is not `none`, this list MUST be non-empty and the pre-commit review MUST fail when matching tests are missing.
| Command | Effect |
|---------|--------|
| /commit | Commit current staged changes with full audit pipeline |
| /commit scope=executor | Commit with explicit scope for commit message |
security-audit (Step 5), ai-reviewed-commit (Step 6)pr-bot (Step 9, when milestone)mktsk (as commit step after each implementation task), dev2merge, dev-to-merge (legacy alias)just fmt, just clippy, just test all exit 0.just fmt and rule-055 pre-existing dirty state are staged with NOTE log lines. Review/fix cycle modifications staged in Step 20 before commit.git status shows clean working tree (enforced: Step 6 stages pre-commit dirty state, Step 20 stages review/fix-cycle modifications before git commit)./pr-bot invoked (skipped when CSA_SKIP_PUBLISH=true).development
Use when running a non-blocking CSA background code health scan that uses csa health and csa tokuin estimate to propose refactoring GitHub issues for files over token or complexity thresholds.
data-ai
Recover main-agent context after `/clear`, `/compact`, or lost local thread state by using `csa recall` against recorded Claude main sessions.
tools
Use when: merged PR had HIGH/CRITICAL findings that represent a bug class — extracts reusable coding rule
tools
Use when: review found 2+ independent findings in different files, fix phase can parallelize RECON