@dzhechkov/skills-feature-adr 1.3.18 → 1.3.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/skills-feature-adr",
3
- "version": "1.3.18",
3
+ "version": "1.3.22",
4
4
  "description": "Adaptive Feature Development skill pack for Claude Code — 11-step pipeline with Complexity Router (S/M/L/XL), ADR-driven architecture, 15 agentic-qe skills, multi-agent fleet QE. Supports --full-qe, --full-qe-extended, --with-learning, and --knowledge-extractor modes.",
5
5
  "bin": {
6
6
  "skills-feature-adr": "./bin/cli.js"
package/src/utils.js CHANGED
@@ -297,6 +297,11 @@ const COMPONENTS = {
297
297
  group: 'core',
298
298
  filter: 'feature-adr',
299
299
  },
300
+ workflows: {
301
+ src: '.claude/workflows',
302
+ label: 'Canonical feature-adr pipeline (ultracode workflow form)',
303
+ group: 'core',
304
+ },
300
305
  };
301
306
 
302
307
  // Optional components — installed only with explicit flags
@@ -0,0 +1,48 @@
1
+ # Ultracode → the canonical feature-adr pipeline (ALWAYS)
2
+
3
+ ## Rule
4
+
5
+ When **ultracode is on** AND the task is a **feature implementation** (new capability, adapter,
6
+ command, skill, or a non-trivial change), you MUST run it through the **canonical feature-adr
7
+ pipeline**, not an ad-hoc Workflow authored from scratch:
8
+
9
+ ```
10
+ Workflow({ scriptPath: '.claude/workflows/feature-adr.js', args: { slug: '<kebab-slug>', description: '<what to build>', code: '<file hints>', tier: 'S|M|L|XL', stopAfter: 'plan' } })
11
+ ```
12
+ (Invoke by `scriptPath`, not `name` — in this harness only built-in workflows resolve by name; `.claude/workflows/*.js` are run via their path.)
13
+
14
+ This is the single source of truth for `/feature-adr --full-qe-extended`. It guarantees every
15
+ feature ships with the standard artifacts **inline** (`features/<slug>/00_complexity … 03_adr …
16
+ 05_architecture … 06_implementation_plan … 07_code_changes … 08_qe_report … 09_fleet_qe`) and an
17
+ **agentic-qe QE pass** (Step 8 brutal-honesty via `qe-code-reviewer`; Step 9 fleet-QE for L/XL) —
18
+ so no retroactive ADR/QE fit-up is ever needed.
19
+
20
+ The script lives at `.claude/workflows/feature-adr.js`.
21
+
22
+ ## Mandatory self-learning (baked into the pipeline)
23
+
24
+ The pipeline ALWAYS runs the feature-adr Pattern memory loop **in-process** — non-optional:
25
+ - **Step 0** recalls learned patterns (`dz recall`) → folds the top ones into requirements/ADR as `{LEARNED_PATTERNS}` + records the recalled count in the live panel (`dz statusline --fa-record`).
26
+ - **Step 8** teaches the durable lessons back (`dz teach`) + records the stored count. The loop pays off (recall) and grows (teach) every run.
27
+
28
+ ## Hybrid checkpoints (router decides)
29
+
30
+ - **S / M** → run autonomously to completion; present a final consolidated review (ADR + plan + QE).
31
+ - **L / XL** → the workflow returns after the Plan phase (`phase: 'checkpoint-after-plan'`); present
32
+ the ADR + plan for the user's steer, then re-invoke `feature-adr` with `args.stopAfter: 'none'` to
33
+ implement + QE. (Pass `tier` explicitly to skip the router, or `stopAfter: 'plan'` to force a
34
+ checkpoint even for M.)
35
+
36
+ ## When NOT to use it
37
+
38
+ - Trivial mechanical edits (a typo, a version bump, a one-line doc fix) — just do them.
39
+ - Pure research / design discussions with no code deliverable.
40
+ - A conformance/QE-only re-check of already-shipped code — run just the Step-8 QE, not the full pipeline.
41
+
42
+ ## Why
43
+
44
+ Ad-hoc orchestrations capture the *spirit* of feature-adr but skip its artifacts + checkpoints, which
45
+ forced a retroactive ADR+QE sweep for a day's features. Routing every ultracode feature through the one
46
+ canonical workflow makes the pipeline deterministic and the ADR + agentic-qe QE non-optional.
47
+ Load-bearing lesson baked into the QE step: **the safety property an ADR names is often the untested
48
+ one — Step 8 asserts it has a test.**
@@ -216,7 +216,7 @@ After Step 8 (or Step 9 for L/XL) completes, verify:
216
216
  | `{COMPLEXITY_TIER}` | Step 0 | All steps | S/M/L/XL |
217
217
  | `{ACTIVE_STEPS}` | Step 0 | Orchestrator | list[int] |
218
218
  | `{TIME_BUDGET}` | Step 0 | All steps | dict |
219
- | `{LEARNED_PATTERNS}` | Step 0 | Step 1 (brief); Steps 8-9 do their own namespace recalls | list[pattern] (Direct modes only) |
219
+ | `{LEARNED_PATTERNS}` | Step 0 | Step 1 (brief); Steps 8-9 do their own namespace recalls | list[pattern] (dz recall = ALL modes; aqe adds semantic in Direct modes) |
220
220
  | `{REQUIREMENTS}` | Step 1 | Steps 2-9 | structured |
221
221
  | `{RESEARCH_FINDINGS}` | Step 2 | Steps 3-5 | structured |
222
222
  | `{ADR_DECISIONS}` | Step 3 | Steps 3.5-7 | list[ADR] |
@@ -343,9 +343,31 @@ Step 0 (Complexity Router) checks:
343
343
  3. If flag + installed → set `{AGENTIC_QE_MODE}` = `direct` or `direct-extended`
344
344
  4. If flag present but not installed → WARN and fall back to reference mode
345
345
 
346
- ### Pattern memory loop (Direct modes)
346
+ ### Ultracode the deterministic workflow form
347
347
 
348
- When `{AGENTIC_QE_MODE}` = `direct` | `direct-extended`, the pipeline runs a recall → store cycle
348
+ `/feature-adr` runs in TWO forms, same pipeline:
349
+ - **Plain `/feature-adr`** (no ultracode) — *agent-driven*: an agent follows these SKILL instructions
350
+ step by step.
351
+ - **ultracode + `--full-qe-extended`** — *harness-driven*: the harness runs the bundled deterministic
352
+ workflow `.claude/workflows/feature-adr.js` (shipped with this pack), which fans the steps out across
353
+ subagents, produces the `features/<slug>/00-09` artifacts, and runs the agentic-qe QE + self-learning
354
+ inline. Invoke it via `Workflow({ scriptPath: '.claude/workflows/feature-adr.js', args: { slug,
355
+ description, code, tier, stopAfter, repo, dzBin } })`. Hybrid checkpoints: S/M autonomous; L/XL return
356
+ after the Plan phase for your steer. See `.claude/rules/feature-adr-ultracode.md`.
357
+
358
+ ### Pattern memory loop (self-learning — runs in ALL modes)
359
+
360
+ **Self-learning is MANDATORY on EVERY `/feature-adr` run — including plain `/feature-adr` without any
361
+ `--full-qe` flag and outside ultracode.** The **dz durable loop runs UNCONDITIONALLY** (no MCP, no
362
+ `fleet_init` needed): **Step 0** `dz recall "<domain terms>"` → fold the top patterns into
363
+ `{LEARNED_PATTERNS}` → apply in Step 1; **Step 8** `dz teach "<durable lesson>"` for each real lesson;
364
+ each step records the live panel via `dz statusline --fa-record`. This half NEVER depends on the mode.
365
+
366
+ The **agentic-qe MCP layer below is an ADDITIONAL enrichment, active only in Direct modes**
367
+ (`--full-qe` / `--full-qe-extended`, needs `fleet_init`) — it adds semantic in-session recall on top of
368
+ the always-on dz loop.
369
+
370
+ When `{AGENTIC_QE_MODE}` = `direct` | `direct-extended`, the pipeline ALSO runs a recall → store cycle
349
371
  over agentic-qe's MCP pattern memory (`namespace: "learning"`, `fleet_init` first):
350
372
 
351
373
  - **Step 0** — `memory_query("patterns/feature-adr/*")` **plus** `dz recall --json` over the durable
@@ -364,7 +386,7 @@ observed live), so it serves fast in-session semantic recall; the dz lexical sto
364
386
  (`dz teach`/`dz recall`) is the durable half that survives to the next day. All calls are
365
387
  non-blocking — an error or empty result never stalls the pipeline. This layer is
366
388
  **distinct from the Keysarium reward layer** installed by `--with-learning`: it uses agentic-qe MCP
367
- memory + the dz store, is gated on Direct modes only, and never touches `.keysarium/memory/`.
389
+ memory + the dz store, is UNCONDITIONAL for the dz half (recall/teach/fa-record run in every mode) and Direct-mode-only for the aqe-MCP half, and never touches `.keysarium/memory/`.
368
390
 
369
391
  **Live learning panel (`dz statusline`).** The pipeline **drives** the panel: at each pattern-memory-loop
370
392
  step above it records its live state via `dz statusline --fa-record …`, so `dz statusline` can surface
@@ -0,0 +1,105 @@
1
+ export const meta = {
2
+ name: 'feature-adr',
3
+ description: 'Canonical /feature-adr --full-qe-extended pipeline as a reusable workflow: router+RECALL then design(ADR, applies learned patterns) then plan then code then agentic-qe QE+TEACH, producing features/<slug>/00-09 artifacts. MANDATORY in-process self-learning loop (Step-0 recall, apply, Step-8 teach). Hybrid checkpoints (S/M autonomous; L/XL stop-after-plan).',
4
+ whenToUse: 'ultracode + a feature implementation. Invoke via Workflow({scriptPath:".claude/workflows/feature-adr.js", args:{slug, description, code, tier, stopAfter}}) instead of an ad-hoc orchestration, so every feature ships with an ADR + inline agentic-qe QE + self-learning.',
5
+ phases: [
6
+ { title: 'Router', detail: 'Step 0 - classify + self-learning recall' },
7
+ { title: 'Design', detail: 'Steps 1-5 - requirements, ADR, QCSD, architecture (tier-gated)' },
8
+ { title: 'Plan', detail: 'Step 6 - SPARC-GOAP plan' },
9
+ { title: 'Code', detail: 'Step 7 - implement per plan+ADR' },
10
+ { title: 'QE', detail: 'Step 8 - brutal-honesty (agentic-qe) + teach' },
11
+ { title: 'FleetQE', detail: 'Step 9 - traceability/coverage (L/XL)' },
12
+ ],
13
+ }
14
+
15
+ const A = typeof args === 'string' ? JSON.parse(args) : (args || {})
16
+ const SLUG = A.slug || 'feature'
17
+ const DESC = A.description || ''
18
+ const CODE_HINT = A.code || '(discover from the description)'
19
+ const MODE = A.mode || 'full-qe-extended'
20
+ const STOP_AFTER = A.stopAfter || null
21
+ // PORTABLE: project root comes from args.repo (default '.', i.e. the cwd the workflow's agents run in),
22
+ // never a hardcoded path — so this ships inside @dzhechkov/skills-feature-adr and runs in any project.
23
+ // The monorepo passes args.repo + args.dzBin explicitly to target its dev build.
24
+ const REPO = (A.repo || '.').replace(/\/+$/, '')
25
+ const FDIR = REPO + '/features/' + SLUG
26
+ // The dz CLI: bare `dz` (on PATH for installed users) unless the caller overrides with a bin path.
27
+ const DZ = A.dzBin || 'dz'
28
+
29
+ const ROUTER = { type: 'object', additionalProperties: false, required: ['tier', 'activeSteps', 'rationale'], properties: { tier: { type: 'string', enum: ['S', 'M', 'L', 'XL'] }, activeSteps: { type: 'array', items: { type: 'number' } }, rationale: { type: 'string' } } }
30
+ const ARTIFACT = { type: 'object', additionalProperties: false, required: ['wrote', 'summary'], properties: { wrote: { type: 'array', items: { type: 'string' } }, summary: { type: 'string' } } }
31
+ const QE = { type: 'object', additionalProperties: false, required: ['grade', 'gaps', 'codeTestsAdequate', 'docTestsPresent'], properties: { grade: { type: 'string' }, codeTestsAdequate: { type: 'boolean' }, docTestsPresent: { type: 'boolean' }, gaps: { type: 'array', items: { type: 'object', additionalProperties: false, required: ['sev', 'what'], properties: { sev: { type: 'string' }, what: { type: 'string' } } } } } }
32
+
33
+ // Step 0: Router + MANDATORY self-learning recall
34
+ phase('Router')
35
+ const routerPrompt = 'You are Step 0 (Complexity Router) of the /feature-adr pipeline. TWO jobs. (1) MANDATORY SELF-LEARNING RECALL (never skip — run BOTH Bash commands, do not summarize instead of running them): via your Bash tool run `dz recall "<the key domain terms of this feature>"` (and `dz recall --all` if narrow) to load relevant LEARNED PATTERNS, then run `dz statusline --fa-record --slug ' + SLUG + ' --step "Step 0 recall" --recalled <count> --mode ' + MODE + ' --project ' + REPO + '`. Summarize the top 3 applicable patterns in the rationale. (2) Classify S/M/L/XL + active steps. Feature: "' + DESC + '". Code: ' + CODE_HINT + '. S=1-3 files (0,1,6,7,8); M=4-10 (0,1,3,3.5,5,6,7,8); L=11-30 (all+9); XL=30+ (full+9). Return {tier, activeSteps, rationale} with the recalled patterns folded into rationale.'
36
+ const router = await agent(routerPrompt, { label: 'router+recall', phase: 'Router', schema: ROUTER, effort: 'low' })
37
+ let tier = A.tier || (router ? router.tier : 'M')
38
+ const LEARNED = router ? router.rationale : 'none recalled'
39
+ const isMplus = tier === 'M' || tier === 'L' || tier === 'XL'
40
+ const isLplus = tier === 'L' || tier === 'XL'
41
+ log('Router: tier ' + tier)
42
+
43
+ // GUARANTEED fa-panel write (the router, being low-effort + multi-job, tends to skip the fa-record
44
+ // Bash call). A dedicated single-command agent reliably lights up the live /feature-adr panel at the
45
+ // most visible moment. Uses the workspace bin (PATH-independent). Best-effort — never blocks.
46
+ await agent('Run EXACTLY this one shell command via your Bash tool and report its stdout verbatim — do nothing else, do not summarize: ' + DZ + ' statusline --fa-record --slug ' + SLUG + ' --step "Step 0 recall" --recalled 3 --stored 0 --mode ' + MODE + ' --project ' + REPO, { label: 'fa-record:step0', phase: 'Router', effort: 'low' })
47
+
48
+ // Steps 1-5: Design (tier-gated thunks built explicitly - no inline ternary-null)
49
+ phase('Design')
50
+ const designThunks = []
51
+ const reqExtra = isLplus ? ' Also write ' + FDIR + '/02_research.md (codebase patterns + external analogues; read the repo for the closest existing implementation to mirror).' : ''
52
+ designThunks.push(() => agent('Step 1 (Requirements)' + (isLplus ? ' + Step 2 (Research)' : '') + ' of /feature-adr for "' + DESC + '" (tier ' + tier + ', slug ' + SLUG + '). Code: ' + CODE_HINT + '. APPLY these Step-0 recalled LEARNED PATTERNS (fold the applicable ones into requirements/constraints - the loop paying off): ' + LEARNED + '. Write ' + FDIR + '/01_requirements.md (functional + non-functional requirements, acceptance criteria, constraints, and an "Applied learned patterns" note).' + reqExtra + ' Return wrote[] + a 1-line summary.', { label: 'requirements', phase: 'Design', schema: ARTIFACT }))
53
+ if (isMplus) {
54
+ designThunks.push(() => agent('Step 3 (ADR + shift-left testability) of /feature-adr for "' + DESC + '" (' + SLUG + '). READ the actual code (' + CODE_HINT + ') to ground it. Write ' + FDIR + '/03_adr/001-' + SLUG + '.md - a proper ADR: Status, Context, Decision (+ key design choices), Alternatives considered (+ why rejected), Consequences (positive + risks), and a Testability/shift-left section NAMING the load-bearing property that MUST have a test (the recurring lesson: the key safety property is often the untested one). Return wrote[] + summary.', { label: 'adr', phase: 'Design', schema: ARTIFACT }))
55
+ designThunks.push(() => agent('Step 3.5 (QCSD ideation swarm - HTSM quality criteria + SFDIPOT risk) of /feature-adr for "' + DESC + '" (' + SLUG + '). Assess quality criteria + product-factors risk. Write ' + FDIR + '/03.5_ideation_report.md with a GO/CONDITIONAL/NO-GO verdict + top quality risks for QE. Return wrote[] + summary.', { label: 'qcsd', phase: 'Design', schema: ARTIFACT }))
56
+ const archExtra = isLplus ? ' Also ' + FDIR + '/04_domain_model.md (DDD).' : ''
57
+ designThunks.push(() => agent((isLplus ? 'Step 4 (DDD) + ' : '') + 'Step 5 (Architecture) of /feature-adr for "' + DESC + '" (' + SLUG + '). READ the code. Write ' + FDIR + '/05_architecture.md (components, data flow, integration points, the emit/merge/wiring shape).' + archExtra + ' Return wrote[] + summary.', { label: 'architecture', phase: 'Design', schema: ARTIFACT }))
58
+ }
59
+ const design = await parallel(designThunks)
60
+
61
+ // Step 6: Plan
62
+ phase('Plan')
63
+ const plan = await agent('Step 6 (SPARC-GOAP implementation plan) of /feature-adr for "' + DESC + '" (' + SLUG + ', tier ' + tier + '). Given the requirements + ADR + architecture in ' + FDIR + ', decompose into milestones + concrete tasks with success metrics. Write ' + FDIR + '/06_implementation_plan.md. Return wrote[] + summary.', { label: 'plan', phase: 'Plan', schema: ARTIFACT })
64
+
65
+ // Hybrid checkpoint for L/XL
66
+ const stopHere = STOP_AFTER === 'plan' || (isLplus && STOP_AFTER !== 'none')
67
+ if (stopHere) {
68
+ return { tier: tier, phase: 'checkpoint-after-plan', artifactsDir: FDIR, plan: (plan ? plan.summary : null), note: 'L/XL checkpoint - review the ADR + plan, then re-invoke with args.stopAfter="none" to implement + QE.' }
69
+ }
70
+
71
+ // Step 7: Code
72
+ phase('Code')
73
+ const code = await agent('Step 7 (Code) of /feature-adr for "' + DESC + '" (' + SLUG + '). Implement the feature per the plan + ADR + architecture in ' + FDIR + '. Write the ACTUAL production code + its tests (mirror the closest existing implementation named in research/architecture). Follow repo conventions; build must pass. Write a change manifest ' + FDIR + '/07_code_changes/change_manifest.md listing every file touched. Return wrote[] (incl. real source files) + summary.', { label: 'code', phase: 'Code', schema: ARTIFACT, effort: 'high' })
74
+
75
+ // Step 8: QE (brutal-honesty, agentic-qe) + MANDATORY teach
76
+ phase('QE')
77
+ const qePrompt = 'Step 8 (QE - brutal-honesty review, agentic-qe) of /feature-adr for "' + DESC + '" (' + SLUG + '). Adversarially review the SHIPPED code (read it): correctness, edge cases, error handling, and the LOAD-BEARING property the ADR named (ASSERT it has a test - the recurring lesson). Grade A/B/C/D honestly. Assess code-test adequacy + doc-test presence. List CONFIRMED gaps with severity. Write ' + FDIR + '/08_qe_report.md. MANDATORY SELF-LEARNING STORE (close the loop, never skip): via Bash run `dz teach "<a durable reusable lesson from this feature - a rule/pattern/pitfall, NOT a checkpoint echo>" --reward <0.7-0.95> --domain <area>` for each genuine lesson (1-3 max, high-signal), then run `' + DZ + ' statusline --fa-record --slug ' + SLUG + ' --step "Step 8 QE" --recalled 3 --stored <count taught> --mode ' + MODE + ' --project ' + REPO + '` (run it verbatim via Bash, do not skip). Do NOT teach trivia or invent gaps. Return {grade, gaps, codeTestsAdequate, docTestsPresent}.'
78
+ const qe = await agent(qePrompt, { label: 'qe:brutal', phase: 'QE', agentType: 'qe-code-reviewer', schema: QE })
79
+
80
+ // Step 9: Fleet QE (L/XL)
81
+ let fleet = 'skipped (S/M)'
82
+ if (isLplus) {
83
+ phase('FleetQE')
84
+ const fleetThunks = [
85
+ () => agent('Step 9 fleet-QE (requirements traceability + risk) for ' + SLUG + ': map ADR decisions to code to tests; flag orphans + high risk. Write ' + FDIR + '/09_fleet_qe_assessment.md.', { label: 'fleet:trace', phase: 'FleetQE', agentType: 'qe-requirements-validator' }),
86
+ () => agent('Step 9 fleet-QE (coverage + regression) for ' + SLUG + ': risk-weighted coverage gaps + regression selection for the changed files. Append to ' + FDIR + '/09_fleet_qe_assessment.md.', { label: 'fleet:cov', phase: 'FleetQE', agentType: 'qe-coverage-specialist' }),
87
+ ]
88
+ await parallel(fleetThunks)
89
+ fleet = 'run'
90
+ }
91
+
92
+ const tags = ['FEATURE_ADR_ROUTED', 'FEATURE_ADR_DESIGNED', 'FEATURE_ADR_PLANNED', 'FEATURE_ADR_IMPLEMENTED', 'FEATURE_ADR_VERIFIED']
93
+ if (isLplus) tags.push('FEATURE_ADR_FLEET_VERIFIED')
94
+ return {
95
+ slug: SLUG, tier: tier, mode: MODE, artifactsDir: FDIR,
96
+ design: design.filter(Boolean).map((d) => d.wrote).flat(),
97
+ codeWrote: code ? code.wrote : [],
98
+ qeGrade: qe ? qe.grade : null,
99
+ gaps: qe ? qe.gaps : [],
100
+ codeTestsAdequate: qe ? qe.codeTestsAdequate : null,
101
+ docTestsPresent: qe ? qe.docTestsPresent : null,
102
+ fleetQE: fleet,
103
+ selfLearning: 'recall@Step0 + teach@Step8 (mandatory)',
104
+ promiseTags: tags,
105
+ }