Adapter Composition
Purpose #
Show how one Adapter + N Stack Packs + shared catalogs + shared docs compose into a single emitted tree.
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 LR
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 inputs [Inputs]
adapter["1 Adapter
(e.g. @aidokit/adapter-claude-code)"]:::adapter
p1["Stack pack #1
(e.g. node-ts)"]:::pack
p2["Stack pack #2
(e.g. react)"]:::pack
pn["…"]:::pack
bs["@aidokit/base-skills
(18 v4 core skills)"]:::core
sd["@aidokit/shared-docs
(docs/ + agent-artifacts/)"]:::core
mc["@aidokit/mcp-catalog"]:::core
end
ctx["ProjectContext"]:::artifact
subgraph cli ["@aidokit/cli — composes"]
skills["skills = [...CORE_BASE_SKILLS,
...p1.suggestSkills(ctx),
...p2.suggestSkills(ctx)]"]:::cli
mcps["mcpIds = unique([
...p1.suggestMCPs(ctx),
...p2.suggestMCPs(ctx),
...triggerEval(MCP_CATALOG, ctx)
])"]:::cli
validation["validations = flatMap(packs, sp => sp.suggestValidationCommands(ctx))"]:::cli
plan["filePlan = [
adapter.emitAgentRulesFile(ctx),
...adapter.emitEngineConfig(ctx),
...adapter.emitVerbs(ctx),
...adapter.emitRoles(ctx),
...adapter.emitSkills(ctx, skills),
...adapter.emitWatchdog(ctx),
...adapter.emitOutputStyles(ctx),
...sd.getDocsSkeleton(ctx),
...sd.getArtifactsSkeleton(ctx),
]"]:::cli
end
out[".claude/ (or .codex/, .copilot/)
CLAUDE.md / AGENTS.md / copilot-instructions.md
docs/ + agent-artifacts/ + .aido/adapter.md"]:::artifact
inputs --> ctx --> cli --> out
bs --> skills
mc --> mcps
validation --> plan
Multi-adapter projects (v1.0) #
%%{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 LR
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;
init["aidokit init --adapter claude-code,codex,copilot"]:::cli
ctx["ProjectContext"]:::artifact
init --> ctx
ctx --> a1["adapter-claude-code emits
.claude/ + CLAUDE.md"]:::cli
ctx --> a2["adapter-codex emits
.codex/ + AGENTS.md"]:::cli
ctx --> a3["adapter-copilot emits
.copilot/ + .github/copilot-instructions.md"]:::cli
a1 --> shared["Shared: docs/ + agent-artifacts/
(emitted exactly once,
deduplicated by CLI)"]:::artifact
a2 --> shared
a3 --> shared
The shared-docs deduplication is the multi-adapter polish work in v1.0 (ADR-0016 §Consequences).
What this shows #
- Stack packs return data (
SkillTemplate[], ids, commands). They do not emit files. - The CLI is the only place that performs the composition.
- Adapters consume the merged skills array; they don't know which pack contributed what.
- MCP suggestions combine pack-driven and catalog-trigger-driven sources, then de-dup.