docs: surface Conventional Commits requirement across agent entry points

The implementer + reviewer sandcastle prompts already enforce
conventional commits, but the convention was buried in those prompt
templates — agents not running through sandcastle (e.g. interactive
Claude sessions, ad-hoc fixups) had no visible signal that the format
is non-negotiable.

Four visibility surfaces now carry the signal:

  - CLAUDE.md Key Conventions: new top bullet stating the spec
    (<type>(<scope>): <subject>), the full type list, breaking-change
    syntax (!), and three example commits
  - AGENTS.md preamble: parallel callout alongside the vocabulary
    and quality-gates notes
  - .claude/hooks/session-start.sh: one-line reminder in the boot
    pointers (every session now sees it at start)
  - .claude/hooks/prompt-context.sh: new 10th keyword group fires
    when a user prompt mentions commit/message/changelog/conventional,
    injecting the full spec into the turn's context

Conventional Commits spec: https://www.conventionalcommits.org/

Verified: the prompt-context hook smoke-tests green when a prompt
containing "commit message" is piped in — it emits the conventional
commits pointer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 17:07:10 +02:00
parent 365c521076
commit 7193acd1d1
4 changed files with 7 additions and 0 deletions

View File

@@ -37,6 +37,9 @@ fi
if echo "$prompt" | grep -qE 'coverage|uncovered|lcov|mutation|stryker|coverage band'; then if echo "$prompt" | grep -qE 'coverage|uncovered|lcov|mutation|stryker|coverage band'; then
inject+=('Coverage: ADR-020 + docs/guides/coverage.md (cookbook). 4 layers — L0 vitest thresholds, L1 pnpm coverage:diff (cover-the-diff), L2 coverage/summary.json (committed trend), L3 pnpm mutate (Stryker on entities + use-cases). Manifest-driven: feature.manifest.ts coverage.bands is the single source of truth.') inject+=('Coverage: ADR-020 + docs/guides/coverage.md (cookbook). 4 layers — L0 vitest thresholds, L1 pnpm coverage:diff (cover-the-diff), L2 coverage/summary.json (committed trend), L3 pnpm mutate (Stryker on entities + use-cases). Manifest-driven: feature.manifest.ts coverage.bands is the single source of truth.')
fi fi
if echo "$prompt" | grep -qE 'commit|message|changelog|conventional'; then
inject+=('Conventional Commits (non-negotiable): <type>(<scope>): <imperative subject> (≤72 chars). Types: feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert. Use `!` for breaking changes. Body explains WHY if non-obvious. Examples: feat(auth): hash password before persisting; refactor(docs)!: consolidate scaffolding into guides. See CLAUDE.md Key Conventions.')
fi
if [ ${#inject[@]} -gt 0 ]; then if [ ${#inject[@]} -gt 0 ]; then
echo "=== context-relevant pointers (from .claude/hooks/prompt-context.sh) ===" echo "=== context-relevant pointers (from .claude/hooks/prompt-context.sh) ==="

View File

@@ -9,6 +9,7 @@ Architecture: AGENTS.md, docs/architecture/overview.md, docs/architecture/agent-
Workflow: pnpm work status | pnpm work next | pnpm work dispatch (ADR-019) Workflow: pnpm work status | pnpm work next | pnpm work dispatch (ADR-019)
Generator-first: pnpm turbo gen <kind> beats hand-rolled scaffolding (non-negotiable) Generator-first: pnpm turbo gen <kind> beats hand-rolled scaffolding (non-negotiable)
Conformance: pnpm conformance + pnpm fallow (5-gate drift detection) Conformance: pnpm conformance + pnpm fallow (5-gate drift detection)
Conventional Commits (non-negotiable): <type>(<scope>): <subject> — see CLAUDE.md Key Conventions
Skills: to-prd, grill-with-docs, grill-me, handoff (.claude/skills/) Skills: to-prd, grill-with-docs, grill-me, handoff (.claude/skills/)
EOF EOF

View File

@@ -4,6 +4,8 @@ This is a **Turborepo + pnpm monorepo** organized by vertical features. Each fea
> **Vocabulary:** Every cross-cutting term used in this repo (feature, use case, manifest, slice, conformance, dispatch, etc.) is defined in [`docs/glossary.md`](./docs/glossary.md). When in doubt about what a term means **here**, check the glossary first — it's the single source for shared vocabulary between humans and agents. > **Vocabulary:** Every cross-cutting term used in this repo (feature, use case, manifest, slice, conformance, dispatch, etc.) is defined in [`docs/glossary.md`](./docs/glossary.md). When in doubt about what a term means **here**, check the glossary first — it's the single source for shared vocabulary between humans and agents.
> **Commits:** Every commit message follows [Conventional Commits](https://www.conventionalcommits.org/): `<type>(<scope>): <imperative subject>` (≤72 chars). Types: `feat | fix | docs | style | refactor | test | chore | perf | ci | build | revert`. Use `!` for breaking changes. The sandcastle implementer + reviewer prompts enforce this; agents authoring autonomously MUST honor it.
## Agent-driven development ## Agent-driven development
This template assumes agents (Claude, Codex, etc.) will author most feature work. The orchestration substrate is [Sandcastle](https://github.com/mattpocock/sandcastle) — see [ADR-019](./docs/decisions/adr-019-sandcastle-for-agent-orchestration.md). Day-to-day entry points: This template assumes agents (Claude, Codex, etc.) will author most feature work. The orchestration substrate is [Sandcastle](https://github.com/mattpocock/sandcastle) — see [ADR-019](./docs/decisions/adr-019-sandcastle-for-agent-orchestration.md). Day-to-day entry points:

View File

@@ -90,6 +90,7 @@ See `docs/guides/coverage.md` for the cookbook and ADR-020 for the full rational
## Key Conventions ## Key Conventions
- **Conventional Commits (non-negotiable)** Every commit message MUST follow the [Conventional Commits](https://www.conventionalcommits.org/) spec: `<type>(<scope>): <imperative subject>` (≤72 chars). Types: `feat | fix | docs | style | refactor | test | chore | perf | ci | build | revert`. Use `!` after type/scope for breaking changes. Body explains WHY if non-obvious. Examples: `feat(auth): hash password before persisting`, `test(blog): assert article not found error`, `refactor(docs)!: consolidate scaffolding into guides`. The sandcastle implementer + reviewer prompts both enforce this; agents authoring commits autonomously MUST honor it.
- **Relative imports in `src/`** Source files use relative paths (`../repositories/...`), not `@/` alias - **Relative imports in `src/`** Source files use relative paths (`../repositories/...`), not `@/` alias
- **`@/` alias in tests** Test files (`*.test.ts`) use `@/` to import from `src/` - **`@/` alias in tests** Test files (`*.test.ts`) use `@/` to import from `src/`
- **`vitest.config.ts`** Every package must define `resolve.alias: { "@": path.resolve(__dirname, "./src") }` - **`vitest.config.ts`** Every package must define `resolve.alias: { "@": path.resolve(__dirname, "./src") }`