From ctx
Automates git commits with constitution rule enforcement (e.g., spec-per-commit), pre-commit QA checks (build/lint), and prompts to capture decisions/learnings. Replaces raw git commit for all changes.
npx claudepluginhub activememory/ctx --plugin ctxThis skill uses the workspace's default tool permissions.
Commit code changes, then prompt for decisions and learnings
Manages git commit workflows: checks status and diffs, stages changes selectively, generates and validates conventional commit messages, then executes commits.
Guides systematic git commits: checks staging status, reviews diffs, splits changes into atomic commits, formats conventional messages. Use before PRs or when committing code.
Creates conventional git commits with validation, branch safety checks, local Python/JS linting/formatting/typechecking, change review, and agent attribution. Use for safe commits.
Share bugs, ideas, or general feedback.
Commit code changes, then prompt for decisions and learnings worth persisting. Bridges the gap between committing code and recording the context behind it.
git commit bypasses spec enforcement and violates CONSTITUTION./ctx-commit
/ctx-commit "implement session enrichment"
/ctx-commit --skip-qa
Read .context/CONSTITUTION.md (if it exists) for commit-specific
rules. Common project rules to look for and enforce:
Spec: trailer, verify a spec file exists in
specs/ before proceeding. If no spec exists, stop and offer to run
/ctx-spec to scaffold one.Signed-off-by:, include it.Read CONSTITUTION fully and apply all relevant rules before proceeding to pre-commit checks.
Unless the user says --skip-qa or "skip checks":
git diff --name-only to see what changedVerify before claiming ready: map each claim to evidence. "Tests pass" requires test output with 0 failures. "Build succeeds" requires exit 0. "Lint clean" requires linter output with 0 errors. Run commands fresh — never reuse earlier output. Before proceeding to stage, answer these self-audit questions:
If any answer reveals a gap, address it before staging.
git statusgit add -A)Spec: and Signed-off-by: trailers (see format below)After a successful commit, ask the user:
Any context to capture?
- Decision: Did you make a design choice or trade-off?
- Learning: Did you hit a gotcha or discover something?
- Neither: No context to capture: we're done.
Wait for the user's response. If they provide a decision or learning, record it using the appropriate command:
ctx add decision "Use PostgreSQL" \
--context "Need a reliable database" \
--rationale "ACID compliance and JSON support" \
--consequence "Team needs training"
ctx add learning "Go embed requires files in same package" \
--context "..." --lesson "..." --application "..."
After every commit, run /ctx-reflect to capture the bigger
picture before moving on. This is mandatory: Skipping reflection
is how context gets lost between sessions.
Follow the repository's existing commit style. Draft messages that:
Spec:,
Signed-off-by:)Example:
complete journal-recall merge wiring and cross-cutting cleanup
Wire journal commands through journal/core packages instead of
recall/core. Move importer, lock, unlock, sync cmd packages from
recall/cmd to journal/cmd.
Changes:
- journal/core/{plan,execute,query} are now canonical
- sourcefm/sourceformat renamed to source/frontmatter, source/format
- Magic numbers extracted to config/stats constants
- state.StateDir renamed to state.Dir across 26 callers
- splitLines moved to parse.ByteLines
- /ctx-commit skill generalized to be language-agnostic
Spec: specs/journal-merge-completion.md
Signed-off-by: Jane Doe <jane@example.com>
Spec: in the commit message. If
CONSTITUTION also requires it, this is non-negotiable..env, credentials, tokens) in the diff
before stagingBefore committing, verify:
Spec: and Signed-off-by: trailers are presentgit add -A)After committing, verify:
After every successful commit, relay a structured summary to the human verbatim:
┌─ Commit Summary ─────────────────────────
│ Spec: specs/<name>.md
│ Tasks closed: <list or "none">
│ Files changed: <count>
│ Message: <first line of commit message>
└──────────────────────────────────────────