@codemcp/ade 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.beads/issues.jsonl +26 -0
- package/.beads/last-touched +1 -1
- package/.vibe/beads-state-ade-fix-docset-writing-37fuoj.json +29 -0
- package/.vibe/development-plan-fix-docset-writing.md +77 -0
- package/.vibe/docs/architecture.md +201 -0
- package/.vibe/docs/design.md +179 -0
- package/.vibe/docs/requirements.md +17 -0
- package/ade.extensions.mjs +13 -15
- package/docs/CLI-PRD.md +38 -40
- package/docs/CLI-design.md +47 -57
- package/docs/guide/extensions.md +6 -14
- package/package.json +1 -1
- package/packages/cli/dist/index.js +15202 -5579
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/commands/conventions.integration.spec.ts +29 -4
- package/packages/cli/src/commands/extensions.integration.spec.ts +26 -4
- package/packages/cli/src/commands/install.ts +2 -0
- package/packages/cli/src/commands/knowledge-docset.integration.spec.ts +179 -0
- package/packages/cli/src/commands/knowledge.integration.spec.ts +24 -36
- package/packages/cli/src/commands/setup.spec.ts +1 -101
- package/packages/cli/src/commands/setup.ts +23 -36
- package/packages/cli/src/knowledge-installer.spec.ts +43 -3
- package/packages/cli/src/knowledge-installer.ts +12 -9
- package/packages/core/package.json +1 -1
- package/packages/core/src/catalog/catalog.spec.ts +75 -43
- package/packages/core/src/catalog/facets/architecture.ts +89 -58
- package/packages/core/src/catalog/facets/practices.ts +9 -8
- package/packages/core/src/index.ts +4 -4
- package/packages/core/src/registry.spec.ts +1 -1
- package/packages/core/src/registry.ts +2 -2
- package/packages/core/src/resolver.spec.ts +61 -154
- package/packages/core/src/resolver.ts +0 -54
- package/packages/core/src/types.ts +5 -10
- package/packages/core/src/writers/docset.spec.ts +40 -0
- package/packages/core/src/writers/docset.ts +24 -0
- package/packages/harnesses/package.json +1 -1
- package/packages/core/src/writers/knowledge.spec.ts +0 -26
- package/packages/core/src/writers/knowledge.ts +0 -15
package/docs/CLI-PRD.md
CHANGED
|
@@ -40,8 +40,9 @@ from that facet).
|
|
|
40
40
|
|
|
41
41
|
### Option
|
|
42
42
|
|
|
43
|
-
One possible answer to a facet. Each option carries a recipe
|
|
44
|
-
|
|
43
|
+
One possible answer to a facet. Each option carries a recipe list of
|
|
44
|
+
provisions. Documentation sources (docsets) are declared as `docset`
|
|
45
|
+
provisions in the recipe alongside skills and other provisions.
|
|
45
46
|
|
|
46
47
|
### Recipe
|
|
47
48
|
|
|
@@ -57,15 +58,13 @@ runtime config and agent instructions.
|
|
|
57
58
|
|
|
58
59
|
### Docset
|
|
59
60
|
|
|
60
|
-
Documentation sources
|
|
61
|
-
|
|
62
|
-
"TanStack" implies TanStack Router/Query/Form/Table docs
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`
|
|
67
|
-
the resolver automatically adds a `@codemcp/knowledge-server` MCP server
|
|
68
|
-
entry.
|
|
61
|
+
Documentation sources declared as a `docset` provision in an option's
|
|
62
|
+
recipe. Docsets are always implied by an upstream selection (e.g. picking
|
|
63
|
+
"TanStack" implies TanStack Router/Query/Form/Table docs declared as
|
|
64
|
+
`docset` provisions in the `tanstack` option's recipe). The `docsetWriter`
|
|
65
|
+
maps each provision to a `KnowledgeSource` in LogicalConfig. When any
|
|
66
|
+
knowledge sources are present, the resolver automatically adds a
|
|
67
|
+
`@codemcp/knowledge-server` MCP server entry.
|
|
69
68
|
|
|
70
69
|
### Provision
|
|
71
70
|
|
|
@@ -76,15 +75,17 @@ carries writer-specific config. Provision types:
|
|
|
76
75
|
| ------------- | ------------------------------------------------------------ |
|
|
77
76
|
| `workflows` | MCP server entry for `@codemcp/workflows-server` |
|
|
78
77
|
| `skills` | Skill definitions (inline or external) for `@codemcp/skills` |
|
|
79
|
-
| `
|
|
78
|
+
| `docset` | Knowledge source entry for `@codemcp/knowledge` |
|
|
80
79
|
| `instruction` | Raw instruction text for the agent |
|
|
81
80
|
|
|
82
81
|
### KnowledgeSource
|
|
83
82
|
|
|
84
|
-
Describes the origin of documentation content
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
Describes the origin of documentation content. The `preset` field controls
|
|
84
|
+
how the source is fetched: `"git-repo"` (default) for git repositories,
|
|
85
|
+
`"archive"` for remote `.tar.gz` archives, `"local-folder"` for local paths.
|
|
86
|
+
The `@codemcp/knowledge` package manages the physical docset artifacts via
|
|
87
|
+
its programmatic API (`createDocset` + `initDocset`); ADE tracks the sources
|
|
88
|
+
in LogicalConfig.
|
|
88
89
|
|
|
89
90
|
### LogicalConfig (intermediate representation)
|
|
90
91
|
|
|
@@ -95,7 +96,7 @@ resolution step and the agent writers:
|
|
|
95
96
|
mcp_servers: [{ref, command, args, env}]
|
|
96
97
|
instructions: [string]
|
|
97
98
|
skills: [SkillDefinition]
|
|
98
|
-
knowledge_sources: [{name, origin, description}]
|
|
99
|
+
knowledge_sources: [{name, origin, description, preset?}]
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
### Agent Writer
|
|
@@ -124,8 +125,6 @@ choices:
|
|
|
124
125
|
practices: # multi-select facet
|
|
125
126
|
- conventional-commits
|
|
126
127
|
- tdd-london
|
|
127
|
-
excluded_docsets: # docsets the user opted out of
|
|
128
|
-
- tanstack-table-docs
|
|
129
128
|
custom: # user-managed section (not touched by CLI)
|
|
130
129
|
mcp_servers:
|
|
131
130
|
- ref: custom-server
|
|
@@ -148,16 +147,12 @@ when a facet selection or catalog version is updated.
|
|
|
148
147
|
## CLI Commands
|
|
149
148
|
|
|
150
149
|
```
|
|
151
|
-
ade setup Interactive TUI: walk through facets,
|
|
152
|
-
|
|
153
|
-
install skills
|
|
150
|
+
ade setup Interactive TUI: walk through facets, write
|
|
151
|
+
config.yaml + config.lock.yaml + agent files,
|
|
152
|
+
install skills, prompt to initialize knowledge sources.
|
|
154
153
|
Re-running setup on an existing project pre-selects
|
|
155
154
|
previous choices as defaults. Warns if a previous
|
|
156
155
|
selection references an option no longer in the catalog.
|
|
157
|
-
|
|
158
|
-
ade install Apply config.lock.yaml → agent files + skills + knowledge.
|
|
159
|
-
Non-interactive. Idempotent. Does not re-resolve — uses
|
|
160
|
-
the lock file as-is.
|
|
161
156
|
```
|
|
162
157
|
|
|
163
158
|
## Catalog
|
|
@@ -190,8 +185,8 @@ Stack and framework conventions that shape the project structure.
|
|
|
190
185
|
| `tanstack` | Full-stack conventions for TanStack (Router, Query, Form, Table) |
|
|
191
186
|
|
|
192
187
|
Each architecture option carries inline skills (conventions, design patterns,
|
|
193
|
-
code style, testing) and
|
|
194
|
-
documentation).
|
|
188
|
+
code style, testing) and docset provisions (one `docset` recipe entry per
|
|
189
|
+
documentation source).
|
|
195
190
|
|
|
196
191
|
### 3. Practices (`practices`) — multi-select
|
|
197
192
|
|
|
@@ -204,18 +199,20 @@ Composable development practices. Multiple selections allowed.
|
|
|
204
199
|
| `adr-nygard` | Architecture Decision Records following Nygard's template |
|
|
205
200
|
|
|
206
201
|
Practices with associated documentation (e.g. Conventional Commits) carry
|
|
207
|
-
|
|
202
|
+
`docset` provisions that resolve to knowledge sources alongside architecture
|
|
203
|
+
docsets.
|
|
208
204
|
|
|
209
205
|
### Documentation Layer (derived)
|
|
210
206
|
|
|
211
207
|
Documentation is **not** a standalone facet. Instead, each option in
|
|
212
|
-
architecture and practices declares
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
208
|
+
architecture and practices declares documentation sources as `docset`
|
|
209
|
+
provisions in its recipe — the same mechanism used for skills. The resolver
|
|
210
|
+
processes these like any other provision: `docsetWriter` maps each to a
|
|
211
|
+
`KnowledgeSource`. Accepted docsets become `knowledge_sources` in
|
|
212
|
+
LogicalConfig, which triggers:
|
|
216
213
|
|
|
217
214
|
1. Automatic addition of the `@codemcp/knowledge-server` MCP server entry
|
|
218
|
-
2.
|
|
215
|
+
2. A confirmation prompt in `ade setup` — default is to defer initialization
|
|
219
216
|
|
|
220
217
|
## Non-Goals (initial release)
|
|
221
218
|
|
|
@@ -243,9 +240,10 @@ triggers:
|
|
|
243
240
|
5. **User edits are confined to `custom`.** The rest of `config.yaml` is
|
|
244
241
|
CLI-managed, eliminating merge conflicts in the structured sections.
|
|
245
242
|
|
|
246
|
-
6. **Docsets are
|
|
247
|
-
sources are always implied by an upstream selection.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
243
|
+
6. **Docsets are `docset` provisions in the recipe, not a separate field.**
|
|
244
|
+
Documentation sources are always implied by an upstream selection. They are
|
|
245
|
+
declared as `{ writer: "docset", config: {...} }` recipe entries —
|
|
246
|
+
consistent with how skills are declared. This eliminates the separate
|
|
247
|
+
`Option.docsets[]` field, the `excluded_docsets` opt-out mechanism, and the
|
|
248
|
+
per-item confirmation multiselect. Users can still defer or skip
|
|
249
|
+
initialization via the single confirm prompt in `ade setup`.
|
package/docs/CLI-design.md
CHANGED
|
@@ -31,7 +31,7 @@ core/src/
|
|
|
31
31
|
writers/ # built-in provision writers
|
|
32
32
|
workflows.ts
|
|
33
33
|
skills.ts
|
|
34
|
-
|
|
34
|
+
docset.ts
|
|
35
35
|
instruction.ts
|
|
36
36
|
agents/ # built-in agent writers
|
|
37
37
|
claude-code.ts # AGENTS.md, .claude/settings.json, skill files
|
|
@@ -91,21 +91,18 @@ read existing config.yaml (if any) for default selections
|
|
|
91
91
|
→ pre-select previous choice as default (if still valid)
|
|
92
92
|
→ warn if previous choice references a stale option
|
|
93
93
|
→ collect new user choices
|
|
94
|
-
→ collect docsets from all selected options
|
|
95
|
-
→ present docset confirmation (opt-out multiselect)
|
|
96
94
|
→ resolve choices + catalog → LogicalConfig
|
|
97
95
|
→ write config.yaml (user choices)
|
|
98
96
|
→ write config.lock.yaml (resolved LogicalConfig snapshot)
|
|
99
97
|
→ run agent writer (generate AGENTS.md, settings.json, etc.)
|
|
100
98
|
→ install skills via @codemcp/skills API
|
|
101
|
-
→
|
|
99
|
+
→ prompt to initialize knowledge sources via @codemcp/knowledge API
|
|
102
100
|
```
|
|
103
101
|
|
|
104
102
|
Resolution expands each selected option's recipe provisions into
|
|
105
|
-
LogicalConfig fragments,
|
|
106
|
-
`
|
|
107
|
-
|
|
108
|
-
merges the custom section, and deduplicates MCP servers by ref.
|
|
103
|
+
LogicalConfig fragments, maps `docset` provisions to `knowledge_sources`,
|
|
104
|
+
adds the `@codemcp/knowledge-server` MCP entry if knowledge sources are
|
|
105
|
+
present, merges the custom section, and deduplicates MCP servers by ref.
|
|
109
106
|
|
|
110
107
|
For **multi-select facets**, each selected option's recipe is resolved
|
|
111
108
|
independently and their LogicalConfig fragments are merged.
|
|
@@ -180,23 +177,6 @@ interface Option {
|
|
|
180
177
|
label: string; // e.g. "CodeMCP Workflows"
|
|
181
178
|
description: string;
|
|
182
179
|
recipe: Provision[]; // multiple provisions per option is common
|
|
183
|
-
docsets?: DocsetDef[]; // recommended documentation for this option
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Documentation as a weak entity on Option. Docsets are derived from
|
|
187
|
-
// upstream selections — picking "TanStack" in architecture implies
|
|
188
|
-
// TanStack docs, picking "GitHub Actions CI/CD" in practices implies
|
|
189
|
-
// GH Actions docs. The TUI presents all implied docsets as pre-selected
|
|
190
|
-
// defaults and allows the user to deselect. This is opt-out, not opt-in.
|
|
191
|
-
//
|
|
192
|
-
// The resolver collects docsets from all selected options, deduplicates
|
|
193
|
-
// by id, filters by excluded_docsets from UserConfig, and maps enabled
|
|
194
|
-
// docsets directly to knowledge_sources in LogicalConfig.
|
|
195
|
-
interface DocsetDef {
|
|
196
|
-
id: string; // unique key for dedup, e.g. "tanstack-query-docs"
|
|
197
|
-
label: string; // display name, e.g. "TanStack Query Reference"
|
|
198
|
-
origin: string; // URL, path, or package ref
|
|
199
|
-
description: string; // shown in TUI
|
|
200
180
|
}
|
|
201
181
|
|
|
202
182
|
// A recipe typically contains multiple provisions for different writers.
|
|
@@ -238,6 +218,7 @@ interface KnowledgeSource {
|
|
|
238
218
|
name: string; // e.g. "tanstack"
|
|
239
219
|
origin: string; // URL, path, or package ref
|
|
240
220
|
description: string;
|
|
221
|
+
preset?: "git-repo" | "local-folder" | "archive"; // defaults to "git-repo"
|
|
241
222
|
}
|
|
242
223
|
```
|
|
243
224
|
|
|
@@ -247,7 +228,6 @@ interface KnowledgeSource {
|
|
|
247
228
|
// config.yaml — mostly CLI-managed, agent-agnostic
|
|
248
229
|
interface UserConfig {
|
|
249
230
|
choices: Record<string, string | string[]>; // single-select: string, multi-select: string[]
|
|
250
|
-
excluded_docsets?: string[]; // docset IDs the user opted out of
|
|
251
231
|
custom?: {
|
|
252
232
|
// user-managed section
|
|
253
233
|
mcp_servers?: McpServerEntry[];
|
|
@@ -355,7 +335,7 @@ function createDefaultRegistry(): WriterRegistry {
|
|
|
355
335
|
registerProvisionWriter(registry, instructionWriter);
|
|
356
336
|
registerProvisionWriter(registry, workflowsWriter);
|
|
357
337
|
registerProvisionWriter(registry, skillsWriter);
|
|
358
|
-
registerProvisionWriter(registry,
|
|
338
|
+
registerProvisionWriter(registry, docsetWriter);
|
|
359
339
|
|
|
360
340
|
registerAgentWriter(registry, claudeCodeWriter);
|
|
361
341
|
|
|
@@ -390,10 +370,12 @@ interface SkillsConfig {
|
|
|
390
370
|
skills: SkillDefinition[];
|
|
391
371
|
}
|
|
392
372
|
|
|
393
|
-
interface
|
|
394
|
-
|
|
395
|
-
|
|
373
|
+
interface DocsetConfig {
|
|
374
|
+
id: string;
|
|
375
|
+
label: string;
|
|
376
|
+
origin: string;
|
|
396
377
|
description: string;
|
|
378
|
+
preset?: "git-repo" | "local-folder" | "archive"; // defaults to "git-repo"
|
|
397
379
|
}
|
|
398
380
|
|
|
399
381
|
interface InstructionConfig {
|
|
@@ -474,16 +456,23 @@ Inline skills include a `body` field; external skills reference a `source`.
|
|
|
474
456
|
The actual installation (writing SKILL.md files and calling `@codemcp/skills`
|
|
475
457
|
API) is handled by the agent writer and CLI's `skills-installer`.
|
|
476
458
|
|
|
477
|
-
### `
|
|
459
|
+
### `docset` writer
|
|
478
460
|
|
|
479
461
|
```typescript
|
|
480
|
-
{
|
|
462
|
+
{
|
|
463
|
+
id: "tanstack-query-docs",
|
|
464
|
+
label: "TanStack Query",
|
|
465
|
+
origin: "https://github.com/TanStack/query.git",
|
|
466
|
+
description: "Server state management",
|
|
467
|
+
preset: "git-repo" // optional, defaults to "git-repo"
|
|
468
|
+
}
|
|
481
469
|
```
|
|
482
470
|
|
|
483
|
-
Produces a `KnowledgeSource` entry in LogicalConfig. The
|
|
484
|
-
|
|
485
|
-
`
|
|
486
|
-
|
|
471
|
+
Produces a `KnowledgeSource` entry in LogicalConfig. The `preset` field
|
|
472
|
+
controls how the source is fetched: `"git-repo"` (default) for git
|
|
473
|
+
repositories, `"archive"` for remote `.tar.gz` archives, `"local-folder"`
|
|
474
|
+
for local paths. The actual installation (calling `@codemcp/knowledge` API)
|
|
475
|
+
is handled by the CLI's `knowledge-installer`.
|
|
487
476
|
|
|
488
477
|
### `mcp-server` writer
|
|
489
478
|
|
|
@@ -545,7 +534,7 @@ export const processFacet: Facet = {
|
|
|
545
534
|
]
|
|
546
535
|
};
|
|
547
536
|
|
|
548
|
-
// catalog/facets/architecture.ts — options carry skills +
|
|
537
|
+
// catalog/facets/architecture.ts — options carry skills + docset provisions
|
|
549
538
|
export const architectureFacet: Facet = {
|
|
550
539
|
id: "architecture",
|
|
551
540
|
label: "Architecture",
|
|
@@ -578,20 +567,24 @@ export const architectureFacet: Facet = {
|
|
|
578
567
|
{
|
|
579
568
|
writer: "instruction",
|
|
580
569
|
config: { text: "This project follows TanStack conventions..." }
|
|
581
|
-
}
|
|
582
|
-
],
|
|
583
|
-
docsets: [
|
|
570
|
+
},
|
|
584
571
|
{
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
572
|
+
writer: "docset",
|
|
573
|
+
config: {
|
|
574
|
+
id: "tanstack-router-docs",
|
|
575
|
+
label: "TanStack Router",
|
|
576
|
+
origin: "https://github.com/TanStack/router.git",
|
|
577
|
+
description: "File-based routing, loaders, and search params"
|
|
578
|
+
}
|
|
589
579
|
},
|
|
590
580
|
{
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
581
|
+
writer: "docset",
|
|
582
|
+
config: {
|
|
583
|
+
id: "tanstack-query-docs",
|
|
584
|
+
label: "TanStack Query",
|
|
585
|
+
origin: "https://github.com/TanStack/query.git",
|
|
586
|
+
description: "Server state management, caching, and mutations"
|
|
587
|
+
}
|
|
595
588
|
}
|
|
596
589
|
// ... form, table
|
|
597
590
|
]
|
|
@@ -634,13 +627,10 @@ export const architectureFacet: Facet = {
|
|
|
634
627
|
merge conflicts: the CLI never touches `custom`, and users never touch
|
|
635
628
|
the rest. Agent writers merge both sections when generating output.
|
|
636
629
|
|
|
637
|
-
7. **Docsets are
|
|
638
|
-
sources are always implied by an upstream selection (architecture
|
|
639
|
-
practices).
|
|
640
|
-
|
|
641
|
-
`
|
|
642
|
-
|
|
643
|
-
not opt-in). Config stores `excluded_docsets` (what the user opted out of)
|
|
644
|
-
rather than selected docsets, keeping the common case (accept all
|
|
645
|
-
recommendations) zero-config. When knowledge sources are present, the
|
|
630
|
+
7. **Docsets are `docset` provisions in the recipe, not a separate field on Option.**
|
|
631
|
+
Documentation sources are always implied by an upstream selection (architecture
|
|
632
|
+
or practices). Each option declares docsets as `{ writer: "docset", config: {...} }`
|
|
633
|
+
recipe entries — consistent with how skills are declared. The resolver processes
|
|
634
|
+
`docset` provisions like any other: the `docsetWriter` maps each one to a
|
|
635
|
+
`KnowledgeSource` in LogicalConfig. When knowledge sources are present, the
|
|
646
636
|
resolver automatically adds a `@codemcp/knowledge-server` MCP server entry.
|
package/docs/guide/extensions.md
CHANGED
|
@@ -89,21 +89,14 @@ export default {
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
|
-
writer: "
|
|
92
|
+
writer: "docset",
|
|
93
93
|
config: {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
id: "sap-abap-cloud-docs",
|
|
95
|
+
label: "SAP ABAP Cloud",
|
|
96
|
+
origin: "https://your-serialized-version-of-abap-docs.git",
|
|
97
|
+
description: "SAP ABAP Cloud development documentation"
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
|
-
],
|
|
100
|
-
docsets: [
|
|
101
|
-
{
|
|
102
|
-
id: "sap-abap-cloud-docs",
|
|
103
|
-
label: "SAP ABAP Cloud",
|
|
104
|
-
origin: "https://help.sap.com/docs/abap-cloud",
|
|
105
|
-
description: "SAP ABAP Cloud development documentation"
|
|
106
|
-
}
|
|
107
100
|
]
|
|
108
101
|
}
|
|
109
102
|
]
|
|
@@ -117,8 +110,7 @@ After running `ade setup` and selecting `SAP BTP / ABAP`:
|
|
|
117
110
|
to `.agentskills/skills/<name>/` for agent consumption
|
|
118
111
|
- Knowledge sources appear in `config.lock.yaml` under
|
|
119
112
|
`logical_config.knowledge_sources` and can be initialised with
|
|
120
|
-
`npx @codemcp/knowledge init
|
|
121
|
-
- Docsets appear in the setup wizard's documentation sources step
|
|
113
|
+
`npx @codemcp/knowledge init <id>`
|
|
122
114
|
|
|
123
115
|
## Adding a new facet
|
|
124
116
|
|