aidokitwiki

Dogfood Loop

Audience-Contributor Status-Shipped v0.5

Purpose #

Show the byte-compare invariant between the hand-built .claude/ in this repo and the .claude/ emitted by @aidokit/adapter-claude-code.

Diagram #

%%{init: {
  "theme": "base",
  "themeVariables": {
    "fontFamily": "ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif",
    "fontSize": "14px",
    "primaryColor": "#eff6ff",
    "primaryTextColor": "#0f172a",
    "primaryBorderColor": "#2563eb",
    "lineColor": "#475569",
    "secondaryColor": "#f1f5f9",
    "tertiaryColor": "#ffffff",
    "clusterBkg": "#f8fafc",
    "clusterBorder": "#cbd5e1"
  }
}}%%
flowchart TD
  classDef actor    fill:#ede9fe,stroke:#6d28d9,color:#1e1b4b,stroke-width:1.2px;
  classDef cli      fill:#dbeafe,stroke:#1d4ed8,color:#0c1f4a,stroke-width:1.4px;
  classDef adapter  fill:#cffafe,stroke:#0e7490,color:#083344;
  classDef pack     fill:#dcfce7,stroke:#15803d,color:#052e16;
  classDef core     fill:#fef9c3,stroke:#a16207,color:#422006;
  classDef artifact fill:#f1f5f9,stroke:#475569,color:#0f172a;
  classDef stop     fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d,stroke-dasharray:4 3;
  classDef ok       fill:#ecfdf5,stroke:#047857,color:#064e3b;
  classDef external fill:#fff7ed,stroke:#c2410c,color:#431407;

  subgraph repo ["aidokit repository"]
    src["packages/adapter-claude-code/src/files/"]:::adapter
    bs["packages/base-skills/src/files/skills/*.md"]:::core
    sd["packages/shared-docs/src/files/"]:::core
    hand["aidokit/.claude/
(hand-built reference)"]:::artifact end build["pnpm build
copy-files.mjs: src/files/ → dist/files/"]:::cli cli["@aidokit/cli init
(in temp dir, no-prompts, fixed flags)"]:::cli emitted["temp/.claude/
(adapter output)"]:::artifact diff{{"diff -r aidokit/.claude temp/.claude"}}:::stop pass["✔ dogfood clean
(diff empty, OR
only documented intentional
differences)"]:::ok fail["✘ CI fails
fix adapter, OR
update hand-built
(both must stay in sync)"]:::stop src --> build bs --> build sd --> build build --> cli cli --> emitted hand --> diff emitted --> diff diff --> pass diff --> fail

What this shows #

When the diff fails #

  1. Determine which direction is canonical for your change: - Adding a new emitted file → update the hand-built .claude/ to match the adapter's new emission. - Fixing a bug in the adapter → the hand-built .claude/ is correct; adapter must match it.
  2. Run pnpm build so dist/files/ is regenerated.
  3. Re-run the integration test (packages/cli/test/integration/init-emit.test.ts).
  4. If the divergence is intentional, document it; otherwise iterate until clean.