aidokitwiki

Prepare a Change for Review

Audience-Contributor Status-Shipped v0.5

Purpose #

The full per-PR loop from "I picked up a task" to "PR ready for review": brief, scope, code, tests, changeset, conformance, dogfood, and the PR checklist.

Big Picture #

The repo runs a one-package-per-PR discipline (CLAUDE.md §9.2). Cross-package refactors are separate PRs. Every behaviour-changing PR needs a changeset, tests, and (where applicable) ADR + dogfood + conformance.

How It Works #

1. Confirm scope #

2. Read the relevant spec section #

Cite a section in your PR. The repo's source-of-truth ordering from CLAUDE.md §9.3:

  1. v4 kit base parts
  2. specs in .docs/docs/specs/
  3. ADRs
  4. README / ROADMAP / ARCHITECTURE
  5. predecessor kit versions
  6. Claude Code official docs (for Claude Code primitives)
  7. user instructions
  8. general knowledge

If a v4 base doc conflicts with a spec, flag the conflict as > [!TODO] and ask. Do not silently pick.

3. Decide if you need an ADR #

You need an ADR for changes touching:

Use the template at .docs/docs/architecture/decisions/0000-template.md. Numbering is monotonic; do not reuse.

4. Write code + tests #

5. Add a changeset #

Every PR that changes published behaviour:

pnpm changeset

Choose: patch / minor / major. Pre-1.0, minor allows breaking changes (ADR-0004 §4). Commit the generated .changeset/<slug>.md.

6. Update documentation #

7. Run the full local verification #

pnpm lint
pnpm typecheck
pnpm test
pnpm build

Then the targeted runs:

pnpm --filter @aidokit/<the-package-you-touched> test
pnpm --filter aidokit test test/integration/init-emit.test.ts   # if emitted output affected

For dogfood:

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

Should be empty.

8. Self-review against contributing/review-checklist.md #

The shared checklist. The high-bar items:

9. Open the PR #

Title:

feat(<package>): <short imperative summary>
fix(<package>): ...
docs: ...
chore: ...

PR body should:

Example PR loop #

A contributor wants to add a new check to the conformance harness:

  1. Spec section: .docs/docs/specs/conformance-levels.md Appendix B.1 for the existing check ids.
  2. Spec change: add the new check id to Appendix B (append-only).
  3. Code: add the predicate to packages/core/src/conformance/checks.ts.
  4. Tests: unit test against synthetic fixtures from Appendix A.
  5. Update @aidokit/adapter-claude-code and other adapters if they fail the new check; if intentional gap, document in manifest.gaps.
  6. Changeset: minor bump for @aidokit/core (new check is additive); patch for affected adapter(s).
  7. Wiki: update reference/conformance-reference.md.
  8. PR.

Common Mistakes #

Checklist #