@kaddo/cli 3.38.0 → 3.39.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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +158 -25
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -535,6 +535,7 @@ create --from roadmap → owners → guard → explain`.
535
535
  | v3.37 | Placeholder-aware readiness: knowledge files are classified missing/placeholder/weak/useful; a bootstrap file isn't treated as ready knowledge. Layers downgrade to Placeholder/Weak, a new Knowledge Refinement phase recommends the right agent, and `create --from roadmap` is never suggested with 0 candidates |
536
536
  | v3.37.1 | Unified next-step: one shared resolver (`core/next-step.ts`) powers `context`, `understand` and `explain` (Phase + Readiness) so they never diverge; agent JSON exposes `nextStepRecommendation`. Fixes duplicate `capabilities` line in explain |
537
537
  | v3.38 | Open-question source locations: `kaddo questions` shows each question's `Source` (path:line), `Status`, `Severity`, `Note` + a copy/paste resolution example and localized how-to-resolve guide; JSON/report/MCP carry `sourcePath`, `line`, `raw`, `note` |
538
+ | v3.39 | Existing capability discovery: state-aware `capabilities.md` (pre-ai/legacy = evidence-backed Capability Inventory + Gaps + Roadmap Candidate Signals; legacy adds criticality/change-risk/modernization); capability-agent discovers with evidence, roadmap-agent treats capabilities as primary source |
538
539
 
539
540
  **Optional modules (installed with `kaddo add`):**
540
541
 
package/dist/index.js CHANGED
@@ -2207,6 +2207,32 @@ kaddo context
2207
2207
  Especially useful for pre-AI projects, legacy projects, existing codebases with little
2208
2208
  documentation, and projects where capabilities are not explicitly documented.
2209
2209
 
2210
+ ## State-aware modes (VS-074)
2211
+
2212
+ Adapt to \`project.state\` (from \`.kaddo/config.yml\`):
2213
+
2214
+ - **new \u2192 Planned Capability Definition.** Define the capabilities the product *should* have. Use
2215
+ \`[planned]\` items; evidence is not required yet.
2216
+ - **pre-ai \u2192 Existing Capability Discovery.** Document the capabilities the system *already has*, as a
2217
+ structured inventory with **evidence**, status and gaps \u2014 a photograph of what exists today, not a
2218
+ wishlist.
2219
+ - **legacy \u2192 Legacy Capability Discovery.** Same inventory plus **criticality**, **change risk**,
2220
+ **operational dependency** and **modernization notes** per capability.
2221
+
2222
+ ## Capability status values
2223
+
2224
+ Classify every discovered capability with exactly one status:
2225
+
2226
+ - \`implemented\` \u2014 clearly present; **must have evidence**.
2227
+ - \`partial\` \u2014 exists but incomplete.
2228
+ - \`inferred\` \u2014 likely present from indirect signals; not yet confirmed.
2229
+ - \`risky\` \u2014 exists but carries technical/operational risk.
2230
+ - \`deprecated\` \u2014 present but obsolete / being replaced.
2231
+ - \`unknown\` \u2014 not enough evidence to classify.
2232
+
2233
+ Never mark a capability \`implemented\` without evidence. When evidence is indirect, use \`inferred\`.
2234
+ When there is no evidence at all, use \`unknown\` and write \`Evidence: - pending validation\`.
2235
+
2210
2236
  ## Input Required
2211
2237
 
2212
2238
  Provide \`.kaddo/context-pack.md\` as the primary input.
@@ -2230,14 +2256,20 @@ Analyze the context pack and identify:
2230
2256
  7. Suggested ownership.
2231
2257
  8. Candidate code globs if evident.
2232
2258
 
2259
+ For **pre-ai** and **legacy**, produce the richer inventory (see Output Format): a
2260
+ \`## Capability Inventory\` with status + evidence per capability, a \`## Capability Gaps\` section, and
2261
+ \`## Roadmap Candidate Signals\` (signals only \u2014 never a formal roadmap). For **legacy**, add
2262
+ \`Criticality\`, \`Change risk\`, \`Operational dependency\` and \`Modernization notes\` per capability.
2263
+
2233
2264
  ## Constraints
2234
2265
 
2235
2266
  - Do not invent business context.
2236
- - Mark assumptions clearly.
2267
+ - Do not invent evidence; never mark \`implemented\` without a concrete path/route/table/function.
2268
+ - Mark assumptions clearly; use \`inferred\`/\`unknown\` when evidence is missing.
2237
2269
  - Prefer "candidate capability" when evidence is incomplete.
2238
2270
  - Do not produce implementation tasks.
2239
- - Do not generate a roadmap yet.
2240
- - Do not create ADRs.
2271
+ - Do not generate a roadmap yet \u2014 only \`[gap]\` and \`[candidate]\` signals.
2272
+ - Do not create ADRs or Work Items.
2241
2273
  - Do not write code.
2242
2274
 
2243
2275
  ## Output Format
@@ -2280,6 +2312,47 @@ Generated from Kaddo Context Pack.
2280
2312
  ## Suggested Next Step
2281
2313
  \`\`\`
2282
2314
 
2315
+ ### Output Format \u2014 pre-ai / legacy (Existing Capability Discovery)
2316
+
2317
+ \`\`\`markdown
2318
+ # Existing Capabilities
2319
+
2320
+ ## Capability Inventory
2321
+
2322
+ ### <Capability name>
2323
+
2324
+ - Status: implemented | partial | inferred | risky | deprecated | unknown
2325
+ - Capability type: business | product | technical | integration | operational
2326
+ - User-facing: yes | no | internal
2327
+ - Evidence:
2328
+ - \`<path/to/file>\`
2329
+ - \`<route>\` / \`<table>\` / \`<function>\`
2330
+ - Related flows / data / integrations:
2331
+ - Current behavior:
2332
+ - Known constraints:
2333
+ - Risks or uncertainty:
2334
+ - Open questions:
2335
+ - [open] ...
2336
+ <!-- legacy only: -->
2337
+ - Criticality: low | medium | high
2338
+ - Change risk: low | medium | high
2339
+ - Operational dependency:
2340
+ - Modernization notes:
2341
+
2342
+ ## Capability Gaps
2343
+
2344
+ - [gap] <Gap description>
2345
+ - Related capability: <name>
2346
+ - Impact: low | medium | high
2347
+ - Possible roadmap candidate: yes | no
2348
+
2349
+ ## Roadmap Candidate Signals
2350
+
2351
+ - [candidate] <Potential roadmap candidate>
2352
+ - Based on: partial capability | gap | risk | open question | business goal
2353
+ - Related capability: <name>
2354
+ \`\`\`
2355
+
2283
2356
  ## Where to Save the Result
2284
2357
 
2285
2358
  Save the output as \`knowledge/product/capabilities.md\`.
@@ -2396,12 +2469,24 @@ Use this agent after capabilities and architecture are understood (or at least a
2396
2469
 
2397
2470
  ## Input Required
2398
2471
 
2399
- Provide \`.kaddo/context-pack.md\` as the primary input.
2472
+ Provide \`.kaddo/context-pack.md\` as the primary input, and treat
2473
+ \`knowledge/product/capabilities.md\` as the **primary source for roadmap candidates** (VS-074).
2474
+
2475
+ Derive roadmap candidates from the capability inventory, prioritizing:
2476
+
2477
+ - \`partial\` capabilities (finish what exists)
2478
+ - \`## Capability Gaps\` (\`[gap]\` items, especially Impact: high)
2479
+ - \`## Roadmap Candidate Signals\` (\`[candidate]\` items)
2480
+ - \`risky\` capabilities (especially in legacy \u2014 stabilize before extending)
2481
+ - resolved/assumed/deferred open questions and business goals
2482
+ - technical risks and decision candidates
2483
+
2484
+ **Do not** build a roadmap from general ideas when \`capabilities.md\` is still a placeholder or weak:
2485
+ if capabilities are not yet discovered, recommend running the \`capability-agent\` first.
2400
2486
 
2401
2487
  Optionally provide (use whatever is available; mark anything missing as an assumption or
2402
2488
  open question):
2403
2489
 
2404
- - \`knowledge/product/capabilities.md\`
2405
2490
  - \`knowledge/tech/current-state.md\`
2406
2491
  - \`knowledge/legacy/risks.md\`
2407
2492
  - \`knowledge/legacy/unknowns.md\`
@@ -2809,6 +2894,10 @@ A refined Work Item intended to be saved under the lifecycle workspace:
2809
2894
  **Open questions:**
2810
2895
 
2811
2896
  **Suggested ownership (code globs):**
2897
+
2898
+ **Related capability:** <!-- recommended (VS-074): the capability from
2899
+ knowledge/product/capabilities.md this Work Item advances, so work traces back to a real capability.
2900
+ Add \`related_capability: <name>\` to the front matter when known. -->
2812
2901
  \`\`\`
2813
2902
 
2814
2903
  ## Where to Save the Result
@@ -6992,6 +7081,9 @@ function isPlaceholderLine(line) {
6992
7081
  if (/^[-*]\s+(\[[^\]]+\]\s*)?_.+_$/.test(t)) return true;
6993
7082
  if (/^[-*]\s+\[[^\]]+\]\s*$/.test(t)) return true;
6994
7083
  if (/^_(?:Describe|List|Document|What|Which|Who|Use|To be defined|No production code)\b/i.test(t)) return true;
7084
+ if (/<[^>]+>/.test(t)) return true;
7085
+ if (/^[-*]\s+[^:]+:\s*$/.test(t)) return true;
7086
+ if (/^[-*]\s+[^:]+:\s*\S.*\s\|\s/.test(t)) return true;
6995
7087
  return false;
6996
7088
  }
6997
7089
  function isStructuralLine(line, inFrontMatter) {
@@ -7817,10 +7909,11 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
7817
7909
  if (!exists(join(dir, ".kaddo", "understand.md"))) {
7818
7910
  return { id: "understand", phase: "Discovery", label: "Run `kaddo understand` to summarize the project context.", command: "kaddo understand", reason: "No understand handoff has been generated yet." };
7819
7911
  }
7820
- const refine = (id, agent, target, quality) => ({
7912
+ const discovery = state === "pre-ai" || state === "legacy";
7913
+ const refine = (id, agent, target, quality, verb = "complete") => ({
7821
7914
  id,
7822
7915
  phase: "Knowledge Refinement",
7823
- label: `Use ${agent} to complete \`${target}\`.`,
7916
+ label: `Use ${agent} to ${verb} \`${target}\`.`,
7824
7917
  agent,
7825
7918
  target,
7826
7919
  reason: `${target} is ${quality === "missing" ? "missing" : "still a bootstrap placeholder or too thin"}.`,
@@ -7832,8 +7925,10 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
7832
7925
  });
7833
7926
  if (qBusiness !== "useful") return refine("refine-business", "business-agent", B, qBusiness);
7834
7927
  if (qProduct !== "useful" || qCap !== "useful") {
7835
- const target = qCap !== "useful" ? CAP : P;
7836
- return refine("refine-product", "capability-agent", target, qCap !== "useful" ? qCap : qProduct);
7928
+ if (qCap !== "useful") {
7929
+ return refine("refine-product", "capability-agent", CAP, qCap, discovery ? "discover and document existing system capabilities in" : "complete");
7930
+ }
7931
+ return refine("refine-product", "capability-agent", P, qProduct);
7837
7932
  }
7838
7933
  if (qCurrentState !== "useful") return refine("refine-current-state", "architecture-agent", CS, qCurrentState);
7839
7934
  if (qCodebase !== "useful") {
@@ -12157,39 +12252,77 @@ _Document the product capabilities that should exist._
12157
12252
  `,
12158
12253
  "pre-ai": `# Existing Capabilities
12159
12254
 
12160
- ## Observed capabilities
12255
+ > Discover the capabilities the system already has (evidence-backed). Use the capability-agent to fill this in \u2014 run \`kaddo add agents\`, then feed it the context pack.
12161
12256
 
12162
- - [observed] _Capability observed in the existing system._
12257
+ ## Capability Inventory
12163
12258
 
12164
- ## Partial capabilities
12259
+ ### <Capability name>
12165
12260
 
12166
- - [partial] _Capability that appears incomplete or uncertain._
12261
+ - Status: implemented | partial | inferred | risky | deprecated | unknown
12262
+ - Capability type: business | product | technical | integration | operational
12263
+ - User-facing: yes | no | internal
12264
+ - Evidence:
12265
+ - _\`path/to/file\`, route, table or function \u2014 or \`pending validation\`._
12266
+ - Related flows / data / integrations:
12267
+ - _..._
12268
+ - Current behavior:
12269
+ - _..._
12270
+ - Known constraints:
12271
+ - _..._
12272
+ - Risks or uncertainty:
12273
+ - _..._
12274
+ - Open questions:
12275
+ - [open] _..._
12167
12276
 
12168
- ## Assumptions
12277
+ ## Capability Gaps
12169
12278
 
12170
- - [assumed] _Safe assumption to confirm later._
12279
+ - [gap] _Gap description._
12280
+ - Related capability: _<name>_
12281
+ - Impact: low | medium | high
12282
+ - Possible roadmap candidate: yes | no
12171
12283
 
12172
- ## Open questions
12284
+ ## Roadmap Candidate Signals
12173
12285
 
12174
- - [open] _What capability is unclear?_
12286
+ - [candidate] _Potential roadmap candidate._
12287
+ - Based on: partial capability | gap | risk | open question | business goal
12288
+ - Related capability: _<name>_
12175
12289
  `,
12176
12290
  legacy: `# Legacy Capabilities
12177
12291
 
12178
- ## Critical capabilities
12292
+ > Discover existing capabilities plus their criticality, change risk and modernization signals. Use the capability-agent to fill this in.
12179
12293
 
12180
- - [critical] _Capability that must keep working._
12294
+ ## Capability Inventory
12181
12295
 
12182
- ## Risky capabilities
12296
+ ### <Capability name>
12183
12297
 
12184
- - [risky] _Capability that is hard to change or poorly understood._
12298
+ - Status: implemented | partial | inferred | risky | deprecated | unknown
12299
+ - Capability type: business | product | technical | integration | operational
12300
+ - User-facing: yes | no | internal
12301
+ - Criticality: low | medium | high
12302
+ - Change risk: low | medium | high
12303
+ - Operational dependency:
12304
+ - _..._
12305
+ - Evidence:
12306
+ - _\`path/to/file\`, route, table or function \u2014 or \`pending validation\`._
12307
+ - Current behavior:
12308
+ - _..._
12309
+ - Modernization notes:
12310
+ - _..._
12311
+ - Open questions:
12312
+ - [open] _..._
12185
12313
 
12186
- ## Replacement candidates
12314
+ ## Capability Gaps
12187
12315
 
12188
- - [candidate] _Capability that may be modernized later._
12316
+ - [gap] _Gap description._
12317
+ - Related capability: _<name>_
12318
+ - Impact: low | medium | high
12319
+ - Possible roadmap candidate: yes | no
12189
12320
 
12190
- ## Open questions
12321
+ ## Roadmap Candidate Signals
12191
12322
 
12192
- - [open] _What capability risk is unclear?_
12323
+ - [candidate] _Potential modernization or roadmap candidate._
12324
+ - Based on: partial capability | gap | risk | open question | business goal
12325
+ - Related capability: _<name>_
12193
12326
  `
12194
12327
  },
12195
12328
  codebase: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/cli",
3
- "version": "3.38.0",
3
+ "version": "3.39.0",
4
4
  "description": "Knowledge Driven Development toolkit",
5
5
  "license": "MIT",
6
6
  "repository": {