Skip to content

Case Studies

The theory chapters compress into three installable skills that live in this repository. Each demonstrates a different layer of the stack, each is unit tested in CI, and together they form the release pipeline sketched in chapter 9.

Skill Layers Chapters
commit-crafter Workflow · references · validation script 3, 4, 5, 6
changelog-forge Deterministic script · template · script-filled draft 6, 7, 10
lessons-keeper Memory protocol · storage script 8

Case study 1 · commit-crafter — workflow + verification

The job: every commit message follows the team's Conventional Commits convention, without the agent improvising a new style per commit.

The design decisions worth stealing:

  • The description routes with the user's vocabulary — "commit this", "write a commit message", "reword", "squash" all appear verbatim.
  • Boundaries are explicit: never stage files, never commit without approval, never add attribution footers. The skill earns trust by what it won't do.
  • The body owns the workflow; two references carry the weight. The type catalog and footer rules live in references/conventional-commits.md; staged-diff → message pairs live in references/examples.md. Both have when to read conditions.
  • The skill validates its own output with scripts/check_message.py — format, type, subject length, imperative mood, breaking-change footer — and re-runs until exit 0 before the user ever sees the message. The agent can't forget the rules; the script remembers them.

Where it earns its keep: the validation loop. Without it, "keep the subject under 50 characters" is honored maybe nine times out of ten; with it, the tenth is caught, explained, and fixed invisibly.

Case study 2 · changelog-forge — determinism + template

The job: generate a CHANGELOG entry from git history that is complete (nothing missed since the last tag) and readable (human prose, not commit spam).

The design decisions worth stealing:

  • The division of labor is sharp. The script (scripts/generate_changelog.py) parses git log, categorizes by Conventional Commit type into Added / Changed / Fixed / Breaking, and renders the template with raw bullets. The agent then rewrites the bullets: merging duplicates, dropping chore/release noise, translating commit-speak into user-speak.
  • Determinism where it matters. No clock calls — the entry date defaults to the HEAD commit's date, so re-runs agree. --write refuses to insert a version that already exists (exit 2 with an actionable message) — the idempotency that makes agent retries harmless.
  • The template is the contract. Section order comes from assets/changelog_template.md; the script renders only non-empty sections; and the workflow's final step is a mechanical grep "{{" placeholder check.
  • Exit codes as an interface: 0 rendered, 2 version already exists, 3 git failure — each with stderr the agent can act on (chapter 6).

Where it earns its keep: the completeness guarantee. A model asked to "write release notes from the last 40 commits" will invent or omit entries; the script's git-log-derived draft makes omission structurally impossible.

Case study 3 · lessons-keeper — a protocol, not a document

The job: stop rediscovering the same project quirks every session — record durable lessons to a versioned file, recall them before starting.

The design decisions worth stealing:

  • Memory is a protocol with explicit triggers, not "write down anything interesting": recall before non-trivial work, record after finishing, both as concrete script invocations.
  • Every lesson must cite evidence (a path, a command, an error). When the evidence disappears from the codebase, the lesson is suspect — the recall protocol says verify, then obey or prune.
  • Memory is advisory: code, tests, and CI win any disagreement with a lesson. One line in the skill prevents stale memory from hijacking workflows.
  • Hygiene is mechanical: prune --keep N, duplicate refusal, and a hard separation of project scope (.lessons/, committed) from user scope (~/.lessons/, personal).

Where it earns its keep: the second week. Lessons like "the payment sandbox only mocks 3DS on deploy days" are worth an hour every time a fresh session would otherwise hit the same wall.

The pipeline view

Individually, each skill is modest. Chained, they cover a release:

commit-crafter    → clean, conventional commits (the interface)
        ↓
changelog-forge   → complete, human changelog from that history
        ↓
(usage)           → the release's rough edges
        ↓
lessons-keeper    → durable lessons recorded for the next cycle

Clean commits make the changelog deterministic; the changelog makes the release review fast; the lessons make the next cycle cheaper. Format standards are the interfaces between skills — which is why the "boring" skill (commit messages) is the one that composes best.

Install any of them

cp -r examples/changelog-forge ~/.agents/skills/

Then start a fresh agent session and say "prepare the changelog for the next release". Full source: examples/.