How to update the v4 reference
Purpose #
When the emitted kit content needs to change, update src/files/ in the adapter / base-skills, the hand-built .claude/ in this repo, and (if intentional) the v4 base parts in .docs/context/.
Big Picture #
There are three places kit content lives:
.docs/context/claude-workflow-kit-v4-base-part-{1,2,3}.mdand…v4-a-z.md— the reference.packages/adapter-claude-code/src/files/andpackages/base-skills/src/files/skills/— what the adapter emits.aidokit/.claude/— the hand-built dogfood reference at the repo root.
The dogfood gate (concepts/dogfood-gate.md) makes (2) and (3) byte-equal post-Phase 8. The v4 base parts (1) are the human-readable spec for what (2) and (3) should contain.
How It Works #
When the change is a content fix (bug or omission) #
- Identify the source v4 section in
.docs/context/claude-workflow-kit-v4-base-part-{1,2,3}.md. If the change is true to v4 (you're correcting a port), no spec change is needed. - Edit
packages/<pkg>/src/files/<path>(the canonical adapter / base-skills location). - Edit
.claude/<same-path>(the hand-built reference). pnpm buildregeneratesdist/files/.- Run the integration test + dogfood compare:
pnpm --filter aidokit test test/integration/init-emit.test.ts
mkdir /tmp/dog && cd /tmp/dog && git init
node /path/to/aidokit/packages/cli/dist/bin/aidokit.js init --adapter claude-code --stack node-ts --yes
diff -r /path/to/aidokit/.claude ./.claude
- Both should be empty/clean. If the dogfood diff is non-empty, you missed updating one side.
- Changeset (patch for fixes; minor for behavioural changes).
When the change is an intentional divergence from v4 #
This is rare. The change must be justified by an ADR.
- Open an ADR (how-to-write-an-adr.md) capturing what diverges from v4 and why.
- Update the v4 base parts in
.docs/context/to reflect the new canonical content. Mark the v4 file with a> [!IMPORTANT]callout describing the deviation and link the ADR. - Update adapter + base-skills sources to emit the new content.
- Update the hand-built
.claude/to match. - Dogfood compare clean.
- Changeset.
When the change is additive (new skill, new role, new schema) #
- Add the content to
packages/<pkg>/src/files/.... - Add the same content to
.claude/so dogfood stays clean. - If it's a base skill, add the metadata entry in
packages/base-skills/src/skills.ts(see tutorials/extend-an-adapter.md). - If it's a new role or watchdog script, update
packages/adapter-claude-code/src/emit/<area>.tsif the emit logic needs to know about it. - Update .docs/context/claude-workflow-kit-v4-base-part-3.md with the addition.
- Test, changeset.
Source-of-truth ordering (when sources conflict) #
From CLAUDE.md §9.3:
- v4 kit base parts
- specs in
.docs/docs/specs/ - ADRs
- README / ROADMAP / ARCHITECTURE
- predecessor kit versions (v3, v2.1) — context only
- Claude Code official docs (authoritative for Claude Code primitives)
- user instructions
- general knowledge
If v4 base parts and a spec conflict, flag and ask — don't silently pick.
Example: fixing a typo in a role file #
Symptom: packages/adapter-claude-code/src/files/engine/agents/builder.md has a typo.
- Open
.docs/context/claude-workflow-kit-v4-base-part-3.md§47 (or whichever Part-3 section portsbuilder.md). Confirm the v4 source is correct (no typo). - Fix
packages/adapter-claude-code/src/files/engine/agents/builder.md. - Fix
.claude/agents/builder.md(the hand-built copy). pnpm build && pnpm --filter aidokit test test/integration/init-emit.test.ts- Dogfood compare clean.
- Changeset: patch for
@aidokit/adapter-claude-code.
Common pitfalls #
- Updating one side only. The dogfood gate will fail; either
dist/files/is wrong (runpnpm build) or the hand-built.claude/was missed. - Silently diverging from v4. If your change is intentional, capture it as an ADR and update the v4 base parts to reflect it. Otherwise reviewers can't tell whether the new content is a port or a fork.
- Forgetting
descriptionandallowedToolson a new base skill — required per ADR-0013. - Editing
.docs/context/files for "tidying" — they are the reference. Edits there are spec changes.