git-commit
Session-scoped git commit with conventional message analysis.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- git-commit
- license
- MIT
- description
- Session-scoped git commit with conventional message analysis.
- allowed-tools
- Bash
02 资源文件 2
- 参考文档agents/openai.yaml121 B
- 参考文档references/private-data.md5.1 KB
03 SKILL.md 正文
Git Commit with Conventional Commits
Create standardized, semantic git commits scoped to this session's work. Analyze the diff for type, scope, and message — but stage and commit only in-scope paths.
Workflow
1. Establish session scope
Derive in-scope paths from this conversation before touching git:
- Files created, edited, renamed, or deleted in this session
- Paths the user explicitly named as part of this commit
- Paths tied to the issue or feature this session is working on (when stated)
Scope unclear — stop and ask the user which files or work belong in this commit. Do not stage or commit until scope is confirmed. Triggers:
- No in-scope paths can be derived (clean session, or commit requested with no prior work in the thread)
- The user's request is vague ("commit my changes", "commit everything") and multiple unrelated changes exist in the working tree
- In-scope paths are ambiguous (e.g. overlapping features, shared files, unclear boundaries)
Done when: a concrete list of in-scope paths exists, confirmed by derivation or by the user.
2. Partition working tree changes
git status --porcelain
git diff --staged # if anything is already staged
git diff # unstaged working tree
Classify every dirty path as in-scope or out-of-scope against the list from step 1.
- Out-of-scope paths are almost certainly from another concurrent session — do not stage or commit them
- Report out-of-scope paths to the user; they can expand scope explicitly if needed
- If a file is in-scope but also contains hunks from outside this session, use
git add -pfor that file or ask the user
Done when: every dirty path is classified and out-of-scope paths are surfaced (if any).
3. Stage in-scope files only
git add path/to/in-scope-file1 path/to/in-scope-file2
git add -p path/to/mixed-file # when only some hunks belong to this session
Use path-specific git add only — never git add -A or git add . when out-of-scope dirty files exist.
Stage only paths destined to pass the private-data gate (step 4).
Done when: the staged diff contains only in-scope changes.
4. Private-data gate
Scan what will be committed — staged diff only:
git diff --cached --name-only
git diff --cached
Read references/private-data.md. Classify every staged path against secrets, PII, and sensitive-path signals. Merge optional CLI results (gitleaks, detect-secrets) when on PATH.
When findings exist — halt. List every flagged file with signal types (path:line, category, context hint — never the value). Present a structured-choices gate per that reference:
unstage_conflicts— unstage flagged paths, return to step 3 or stop if nothing remains (Recommended unless only low-confidence doc/PII hits)proceed— user accepts risk; continueabort— exit without committing
Re-run this step after re-staging following unstage_conflicts.
Done when: staged diff has zero unresolved findings, or user chose proceed via gate.
Versioned CHANGELOG.md sections (## YYYY-MM-DD · vX.Y.Z) are written by changelog-generator — apply's Changelog group, or when the user asks for a changelog. If this session already edited CHANGELOG.md, it is an in-scope path in steps 1–3 like any other file.
5. Generate commit message
Analyze the staged diff (not the full working tree) to determine:
- Type: What kind of change is this?
- Scope: What area/module is affected?
- Description: One-line summary (present tense, imperative mood, <72 chars)
6. Execute commit
# Single line
git commit -m "<type>[scope]: <description>"
# Multi-line with body/footer
git commit -m "$(cat <<'EOF'
<type>[scope]: <description>
<optional body>
<optional footer>
EOF
)"
Done when: commit succeeds and git status shows no staged in-scope changes remaining (out-of-scope dirt may still exist — that is expected).
Safety
- Session scope only — never pick up concurrent-session dirt (steps 1–3).
- Private-data gate blocks commit until resolved or user proceeds via gate (step 4).
- No git config updates, destructive commands, hook skips, or force push to main/master unless the user explicitly requests.
- Failed hooks: fix and create a new commit — do not amend unless the user asks.
04 同仓库更多 Skills
improve
Survey any codebase as a senior advisor and produce prioritized handoff artifacts for OTHER models/agents to execute — OpenSpec change packages (when capability specs exist) or legacy implementation plans. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.
git-commit
Session-scoped git commit with conventional message analysis and staging. Use when user asks to commit changes, create a git commit, or mentions "/commit". Commits only this session's work — never picks up changes from concurrent sessions on the same branch. Asks for scope clarification when session work is empty or ambiguous. Private-data gate on staged diff before commit.
improve
Survey any codebase as a senior advisor and produce prioritized handoff artifacts for OTHER models/agents to execute — OpenSpec change packages (when capability specs exist) or legacy implementation plans. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.
git-commit
Session-scoped git commit with conventional message analysis and staging. Use when user asks to commit changes, create a git commit, or mentions "/commit". Commits only this session's work — never picks up changes from concurrent sessions on the same branch. Asks for scope clarification when session work is empty or ambiguous. Private-data gate on staged diff before commit.
supabase-postgres-best-practices
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
improve
Read-only codebase survey producing executor-ready handoff artifacts.