Skip to content

#2 feat(2-git-memory): git memory — write side, read side, bootstrap distribution - #34

Merged
ivan-hilckov merged 6 commits into
mainfrom
worktree-2-git-memory
Jul 14, 2026
Merged

ivan-hilckov merged 6 commits into
mainfrom
worktree-2-git-memory

Conversation

@ivan-hilckov

Copy link
Copy Markdown
Contributor

Summary

Implements the git memory (#2, ADR-0012): commit messages become the project's long-term decision history, written for coding agents as the primary readers. The existing subject convention stays; commits that carry a decision get a prose body explaining why plus optional decision trailers from a fixed vocabulary of four (Constraint:, Rejected:, Directive:, Related:). Every code skill now reads the affected files' history before working, and bootstrap distributes the convention to target projects as a mandatory CLAUDE.md section plus a commit-msg hook.

Design decisions

  • Body by content, not by type — the test is "will a reader six months out wonder why"; mechanical commits stay one-liners, so the hook warns (never blocks) on a bodyless feat/fix/refactor and blocks only a malformed subject.
  • Four trailers, not nine — the Lore Protocol self-assessment keys (Confidence:, Scope-risk:, …) were dropped as ritual noise; see .yoke/adr/0012-commit-messages-as-git-memory.md for the full trade-off.
  • Both guides live in skills/gca/reference/ — the owning-skill precedent (issues/reference/github-issues.md); the seven consuming skills cross-reference them.
  • Trailer ban narrowed, not lifted — identity trailers (Co-Authored-By, Signed-off-by) stay banned; decision trailers are the point.
  • The commits in this branch already follow the new convention — review them as the first live sample of the memory.

Test plan

  • Hook validated against 9 message shapes (valid one-liner, body+trailers, bodyless feat → warning, colon-after-ticket → block, no type → block, merge commit → skip, YouTrack id with digit in project code, docs one-liner, no-slug fix)
  • pnpm run format:check — clean
  • YAML frontmatter intact in all 7 touched SKILL.md files; JSON manifests parse
  • Reviewer: read git log of this branch — the bodies and trailers should read as useful memory, not ritual

Changes

File Action Description
skills/gca/reference/commit-convention.md extend "Body — the git memory" section: by-content rule, 4 trailers, example, anti-patterns; trailer ban narrowed to identity trailers
skills/gca/reference/history-reading.md new Read side: which git command answers which question, acting on Constraint:/Directive:/Rejected:
skills/{do,draft,review,grill,grill-docs,prd,issues}/SKILL.md extend Read-the-git-memory step before touching or judging code
skills/bootstrap/agents/claude-md-generator.md extend Mandatory "Git memory (commit convention)" CLAUDE.md section (create + enrich)
skills/bootstrap/reference/hooks-patterns.md extend § Git memory commit-msg hook — the scaffolded script
skills/bootstrap/reference/bootstrap-pipeline.md extend Phase 3 orchestrator step scaffolds the hook; Phase 7 stages it when tracked
.husky/commit-msg, CLAUDE.md new/extend Dogfood: yoke runs the hook itself; Conventions documents the format

Commits

Validation

  • pnpm run format:check — all files use Prettier code style
  • Hook test matrix: 9/9 expected outcomes (2 blocks, 2 warnings, 5 clean passes)
  • python3 JSON parse of plugin.json + marketplace.json — OK

Ivan Hilkov added 6 commits July 14, 2026 09:20
…and decision trailers

The write side of the git memory: commit bodies carry the Decision
Shadow so a future agent recovers the why from git log alone. The
vocabulary is fixed at four decision trailers; the body is required by
content, not by commit type, so mechanical commits stay one-liners. The
old blanket trailer ban narrows to identity trailers only.

Rejected: nine-trailer Lore Protocol vocabulary — self-assessment keys degrade into ritual noise
Related: #2
Related: .yoke/adr/0012-commit-messages-as-git-memory.md
The read side of the git memory: which git command answers which
question, and how to act on Constraint/Directive/Rejected findings.
Lives next to commit-convention.md because both sides of the memory
share one owner, mirroring the issues/github-issues.md precedent.

Directive: git log --trailer= does not exist — the real filters are --grep with a line-anchored key and the %(trailers:key=...) format
Related: #2
Every skill that touches or judges code now reads the affected files'
commit history before working, so constraints and rejected approaches
recorded in the memory actually steer new work. Executors (do, draft)
gate modification on it; review must cite the commit a finding argues
with; the exploration skills (grill, grill-docs, prd, issues) treat
history findings as interview and artifact material.

Related: #2
…k in bootstrap

Distribution of the git memory to target projects rides the two things
bootstrap already generates: a mandatory CLAUDE.md section (always-on
for any agent, with or without yoke skills) and a commit-msg hook. The
hook checks shape and presence only — a hook cannot judge whether a
commit carries a decision, so a bodyless feat/fix/refactor warns
instead of blocking.

Rejected: a separate .claude/rules/ file per the original issue #2 plan — one more artifact where an existing CLAUDE.md section suffices
Related: #2
The hook's ticket pattern [A-Z]+-[0-9]+ rejected R2-50-style ids where
the project code itself contains a digit; real YouTrack projects use
them. Caught by running the hook against the convention's own examples.

Constraint: hook regex must accept every ticket form the commit-convention Ticket ID tables list
Related: #2
Dogfooding: the repo that ships the convention runs the hook itself, so
the read side gets real history to work against. The hook is tracked in
.husky/ and activates for everyone via the existing husky prepare
script; commits in this very branch already follow the format.

Related: #2
@ivan-hilckov ivan-hilckov added enhancement New feature or request documentation Improvements or additions to documentation labels Jul 14, 2026
@ivan-hilckov
ivan-hilckov merged commit e5e36c9 into main Jul 14, 2026
1 check passed
@ivan-hilckov
ivan-hilckov deleted the worktree-2-git-memory branch July 14, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant