@dzhechkov/skills-feature-adr 1.3.10 → 1.3.12

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/README.md CHANGED
@@ -379,7 +379,8 @@ npx @dzhechkov/skills-feature-adr init --with-learning --knowledge-extractor
379
379
 
380
380
  There are **three independent self-learning systems** that can sit under a Feature ADR run.
381
381
  `--full-qe-extended` does **not** turn on learning by itself — it controls QE depth. Learning is a
382
- separate, orthogonal concern. The three layers do **not conflict**: each is isolated by its own
382
+ separate concern though in Direct modes the pipeline now adds explicit touchpoints into layer B
383
+ (Step 0 pattern recall, Steps 8/9 outcome store — see the skill's "Pattern memory loop" section). The three layers do **not conflict**: each is isolated by its own
383
384
  storage path, its own learning signal, and its own consumer.
384
385
 
385
386
  | Layer | Turn it on with | Learns from | Storage (distinct!) | Needs a DB? |
@@ -408,6 +409,25 @@ storage path, its own learning signal, and its own consumer.
408
409
  - Living inside the `dz` harness and want cross-session memory → `dz setup` (add agentdb only if you
409
410
  want the vector tier).
410
411
 
412
+ ### Maintenance: consolidate periodically
413
+
414
+ Hooks and events only **collect** raw data — distilling it into reusable patterns is a separate
415
+ **consolidation** step, and for layers B and C that step is worth running deliberately:
416
+
417
+ - **A (reward JSON)** — nothing to do; it consolidates implicitly at every checkpoint.
418
+ - **B (agentic-qe)** — queues raw *experiences* that only its consolidation pass distills into
419
+ patterns. Left alone, a project can pile up thousands of unconsolidated experiences over a month
420
+ while its per-prompt pattern injection returns **zero useful patterns**. Run
421
+ `aqe learning consolidate` periodically (e.g. weekly, or after a heavy QE run);
422
+ `aqe learning stats` shows the experience backlog.
423
+ - **C (dz harness)** — run `dz consolidate` to harvest session learnings into the lexical store
424
+ (mirrored to the agentdb vector store if present); inspect the result with `dz recall`. The
425
+ SessionEnd hook automates this **only on clean session ends** — crashed or killed sessions are
426
+ missed.
427
+
428
+ **Degradation symptom:** patterns stop improving while raw logs keep growing. If recall/injection
429
+ quality plateaus, you're collecting but not distilling — consolidate.
430
+
411
431
  > There is no single unified "what did the whole stack learn" view — each layer reports from its own
412
432
  > store. That's the price of isolation (and the reason there are no cascading failures). Tune each
413
433
  > where it lives.
@@ -446,6 +466,46 @@ npx @dzhechkov/skills-feature-adr init # Feature development
446
466
 
447
467
  ---
448
468
 
469
+ ## Troubleshooting
470
+
471
+ ### `sh: 1: skills-feature-adr: not found` — npx inside a monorepo with workspaces
472
+
473
+ If you run `npx @dzhechkov/skills-feature-adr <command>` from **inside a monorepo** whose root
474
+ `package.json` declares `"workspaces"` (npm/pnpm/yarn) and a local workspace package shadows this
475
+ name (e.g. you vendored or forked this package, or you're developing it), npx resolves the **local
476
+ workspace copy** instead of fetching from the registry. It then looks for the bin shim in
477
+ `node_modules/.bin/` — which the workspace manager may never have created (pnpm links shims only
478
+ for declared dependencies) — and falls back to running the bare command in your shell:
479
+
480
+ ```
481
+ sh: 1: skills-feature-adr: not found
482
+ ```
483
+
484
+ **Note:** pinning a version (`npx @dzhechkov/skills-feature-adr@x.y.z`) does **not** bypass
485
+ workspace resolution — verified.
486
+
487
+ **Fixes:**
488
+
489
+ ```bash
490
+ # 1. Run it where it belongs — in the TARGET project (where .claude/ lives).
491
+ # That directory is normally not the package's own monorepo:
492
+ cd /path/to/your-project
493
+ npx @dzhechkov/skills-feature-adr update
494
+
495
+ # 2. Developing inside the monorepo that contains this package? Invoke the
496
+ # workspace copy's bin directly:
497
+ node <monorepo>/packages/@dzhechkov/skills-feature-adr/bin/cli.js update
498
+
499
+ # 3. Or use a global install (resolves independently of any workspace):
500
+ npm install -g @dzhechkov/skills-feature-adr
501
+ skills-feature-adr update
502
+ ```
503
+
504
+ Related: `init`/`update`/`remove` operate on the **current directory's** `.claude/` install — running
505
+ them inside the package's own monorepo is almost never what you want anyway.
506
+
507
+ ---
508
+
449
509
  ## Requirements
450
510
 
451
511
  - **Claude Code CLI** — installed and configured ([installation guide](https://docs.anthropic.com/en/docs/claude-code))
@@ -208,6 +208,19 @@ consumer):
208
208
  **Do you need agentdb?** For A and B — **no** (each has its own store). Only layer C's *vector* tier
209
209
  uses agentdb, and even there it's optional (lexical recall works without it).
210
210
 
211
+ **Maintenance: consolidate periodically.** Hooks/events only *collect* raw data — distilling it into
212
+ reusable patterns is a separate consolidation step:
213
+ - **A** — nothing to do (consolidates implicitly at each checkpoint).
214
+ - **B** — agentic-qe queues raw experiences that only its consolidation pass distills. Skip it and a
215
+ project can pile up thousands of unconsolidated experiences while per-prompt pattern injection
216
+ returns zero useful patterns. Run `aqe learning consolidate` periodically (weekly, or after a
217
+ heavy QE run); `aqe learning stats` shows the backlog.
218
+ - **C** — run `dz consolidate` (harvests session learnings into the lexical store, mirrored to the
219
+ vector store if present); inspect with `dz recall`. The SessionEnd hook covers **clean exits only**.
220
+
221
+ **Degradation symptom:** patterns stop improving while raw logs keep growing → you're collecting,
222
+ not distilling. Consolidate.
223
+
211
224
  ---
212
225
 
213
226
  ## 9. Team workflow conventions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/skills-feature-adr",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
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"
@@ -216,6 +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
220
  | `{REQUIREMENTS}` | Step 1 | Steps 2-9 | structured |
220
221
  | `{RESEARCH_FINDINGS}` | Step 2 | Steps 3-5 | structured |
221
222
  | `{ADR_DECISIONS}` | Step 3 | Steps 3.5-7 | list[ADR] |
@@ -342,18 +343,32 @@ Step 0 (Complexity Router) checks:
342
343
  3. If flag + installed → set `{AGENTIC_QE_MODE}` = `direct` or `direct-extended`
343
344
  4. If flag present but not installed → WARN and fall back to reference mode
344
345
 
346
+ ### Pattern memory loop (Direct modes)
347
+
348
+ When `{AGENTIC_QE_MODE}` = `direct` | `direct-extended`, the pipeline runs a recall → store cycle
349
+ over agentic-qe's MCP pattern memory (`namespace: "learning"`, `fleet_init` first):
350
+
351
+ - **Step 0** — `memory_query("patterns/feature-adr/*")` → sets `{LEARNED_PATTERNS}` (top-3 by confidence); Step 1 folds them into the requirements brief as advisory lessons.
352
+ - **Step 8** — recalls `patterns/feature-adr/qe/*` to prime the review checklist; stores a `qe-outcome` record after the gap loop closes.
353
+ - **Step 9** — recalls `patterns/feature-adr/fleet/*` to prime agent focus; stores a `fleet-qe-finding` record after the fleet verdict.
354
+
355
+ All calls are non-blocking — an error or empty result never stalls the pipeline. This layer is
356
+ **distinct from the Keysarium reward layer** installed by `--with-learning`: it uses agentic-qe MCP
357
+ memory, is gated on Direct modes only, and never touches `.keysarium/memory/`.
358
+
345
359
  ### What changes with `--full-qe`
346
360
 
347
361
  Full agentic-qe protocols for the same 9 core skills. No new agents, just deeper methodology.
348
362
 
349
363
  | Step | Reference Mode (default) | Direct Mode (`--full-qe`) |
350
364
  |------|--------------------------|---------------------------|
365
+ | Step 0 | Standard routing | + pattern recall → `{LEARNED_PATTERNS}` |
351
366
  | Step 3 | Condensed shift-left protocol | Full Level 1-4 shift-left with BDD generators |
352
367
  | Step 3.5 | 3 core + flag-based conditionals | Full QCSD swarm with all 9 agents + DDD mapping |
353
368
  | Step 6 | SPARC-GOAP goal state analysis | Full agent with milestone tracking + success metrics |
354
369
  | Step 7 | Standard code generation | Standard code generation (no change) |
355
- | Step 8 | Brutal-honesty 3-mode review | Full calibration levels (1-3) + evidence protocol |
356
- | Step 9 | 4 agents with condensed protocols | 4 agents with full agentic-qe protocols |
370
+ | Step 8 | Brutal-honesty 3-mode review | Full calibration levels (1-3) + evidence protocol + QE pattern recall/store |
371
+ | Step 9 | 4 agents with condensed protocols | 4 agents with full agentic-qe protocols + fleet pattern recall/store |
357
372
 
358
373
  ### What `--full-qe-extended` adds on top
359
374
 
@@ -399,7 +414,7 @@ npx @dzhechkov/skills-feature-adr init --with-learning --knowledge-extractor
399
414
  | Flag | Installs | Purpose |
400
415
  |------|----------|---------|
401
416
  | (none) | Core skill + command + rules + shard | Feature development pipeline |
402
- | `--with-learning` | + `lib/memory-protocol.md`, `lib/reward-tracker.md`, `.claude/rules/reward-learning.md` | Installs the shared **Keysarium learning layer** (Phases 0-5, `.keysarium/memory/`). The feature-adr pipeline itself does not yet wire `memory_query`/`memory_store` into its Steps 0-9 — this layer applies only if you also run the Keysarium pipeline. |
417
+ | `--with-learning` | + `lib/memory-protocol.md`, `lib/reward-tracker.md`, `.claude/rules/reward-learning.md` | Installs the shared **Keysarium learning layer** (Phases 0-5, `.keysarium/memory/`). The feature-adr pipeline itself does not yet wire `memory_query`/`memory_store` into its Steps 0-9 — this layer applies only if you also run the Keysarium pipeline. A separate loop exists: in Direct modes (`--full-qe`/`--full-qe-extended`) the pipeline wires **agentic-qe MCP** pattern memory into Steps 0/8/9 — see "Pattern memory loop (Direct modes)" above. |
403
418
  | `--knowledge-extractor` | + `.claude/skills/knowledge-extractor/`, `.claude/commands/harvest.md` | Extract reusable patterns after feature completion |
404
419
 
405
420
  > **Note:** If `@dzhechkov/keysarium` is already installed, these flags are not needed — keysarium includes all learning and extraction capabilities.
@@ -79,6 +79,18 @@ Load `references/complexity-matrix.md` for the full matrix. Summary:
79
79
 
80
80
  R = Requirements, P = Planning (ADR+DDD+Arch), I = Implementation, Q = QE
81
81
 
82
+ ### 6. Pattern Recall (Direct Mode only)
83
+
84
+ Runs after tier classification, only when `{AGENTIC_QE_MODE}` = `direct` | `direct-extended`
85
+ (set during Step 0 flag detection per SKILL.md: `--full-qe`/`--full-qe-extended` + agentic-qe installed). Non-blocking — an error or empty result must never stall the pipeline.
86
+
87
+ 1. If the aqe fleet is not yet initialized this session, call `mcp__agentic-qe__fleet_init` first (required before any other aqe MCP tool).
88
+ 2. Call `mcp__agentic-qe__memory_query({ pattern: "patterns/feature-adr/*", namespace: "learning", limit: 5 })`.
89
+ 3. Select the top 3 results by `confidence` → set `{LEARNED_PATTERNS}`.
90
+ 4. Reference mode, no hits, or error → `{LEARNED_PATTERNS}` = `[]`; proceed normally.
91
+
92
+ Step 1 folds `{LEARNED_PATTERNS}` into the requirements brief as "lessons from previous features" — advisory context only, never requirements themselves. Why here: Step 0 is the one point where recall can be keyed to the feature's phase and domain — per-prompt hook auto-injection cannot see which pipeline step is running.
93
+
82
94
  ## Output
83
95
 
84
96
  Set the following variables:
@@ -88,6 +100,7 @@ Set the following variables:
88
100
  {ACTIVE_STEPS} = [0, 1, 6, 7, 8] # example for S
89
101
  {TIME_BUDGET} = { requirements: 2, planning: 0, implementation: 10, qe: 3 }
90
102
  {DIMENSION_SCORES} = { files: 1, domains: 1, integrations: 1, breaking: 1, models: 1, crosscutting: 1 }
103
+ {LEARNED_PATTERNS} = [ ... ] # top-3 by confidence from memory_query; [] in reference mode / no hits / error
91
104
  ```
92
105
 
93
106
  Create artifact: `features/<slug>/00_complexity_assessment.md`
@@ -29,6 +29,12 @@ Read: .claude/skills/explore/SKILL.md
29
29
  Use the explore skill to clarify ambiguous requirements through adaptive questioning.
30
30
  For S-tier: skip explore, extract requirements directly from description.
31
31
 
32
+ ### 1.5 Fold Learned Patterns (Direct modes only)
33
+
34
+ If `{LEARNED_PATTERNS}` is non-empty (set by Step 0's Pattern Recall), fold each into the
35
+ requirements brief as an advisory "lesson from previous features" — context that informs
36
+ elicitation, never a requirement itself. Empty/absent → skip silently.
37
+
32
38
  ### 2. Identify Stakeholders
33
39
 
34
40
  | Question | Why |
@@ -56,6 +56,19 @@ For critical user flows:
56
56
  - Test with realistic data volumes
57
57
  - Test failure recovery scenarios
58
58
 
59
+ ### 2.5 QE Pattern Recall (Direct Mode only)
60
+
61
+ When `{AGENTIC_QE_MODE}` = `direct` | `direct-extended`, before the brutal-honesty review starts,
62
+ recall prior QE outcomes for similar work:
63
+
64
+ ```
65
+ mcp__agentic-qe__memory_query({ pattern: "patterns/feature-adr/qe/*", namespace: "learning", limit: 5 })
66
+ // If this session resumed directly at Step 8, call fleet_init first (as in Steps 0/9).
67
+ ```
68
+
69
+ Use the results to prime the review checklist — e.g. recurring gap types, dimensions that historically
70
+ produced blockers. Non-blocking: empty result or error → proceed with the standard checklist.
71
+
59
72
  ### 3. Code Review via Brutal Honesty Review (M+)
60
73
 
61
74
  > Load: `references/agentic-qe/brutal-honesty-review.md`
@@ -193,6 +206,28 @@ Compile all findings into a structured report:
193
206
  ✅ READY FOR MERGE | ❌ NEEDS FIXES | ⚠️ CONDITIONAL APPROVAL
194
207
  ```
195
208
 
209
+ ### 8. QE Pattern Store (Direct Mode only)
210
+
211
+ When `{AGENTIC_QE_MODE}` = `direct` | `direct-extended`, after the gap loop is closed and the verdict is set:
212
+
213
+ ```
214
+ mcp__agentic-qe__memory_store({
215
+ key: "patterns/feature-adr/qe/{timestamp}",
216
+ namespace: "learning",
217
+ value: {
218
+ pattern: "<one-sentence lesson from this QE run>",
219
+ confidence: <honest 0-1 derived from the gap loop>,
220
+ type: "qe-outcome",
221
+ metadata: { tier: "{COMPLEXITY_TIER}", gaps_found: <N>, verdict: "<READY|NEEDS_FIXES|CONDITIONAL>" }
222
+ },
223
+ persist: true
224
+ })
225
+ ```
226
+
227
+ Confidence must be honest — derived from the gap loop, never a fabricated 1.0
228
+ (e.g. zero gaps in one iteration ≈ 0.9; gaps remaining after 3 iterations ≤ 0.4).
229
+ Non-blocking: a write failure is logged and the pipeline continues.
230
+
196
231
  ## Output
197
232
 
198
233
  Create `features/<slug>/08_qe_report.md` with full QE report.
@@ -263,6 +263,37 @@ are added — the same fleet runs with deeper methodology from the full skill fi
263
263
  | Agent 3 | Condensed enterprise-integration | Full hierarchical fleet + QCSD flags |
264
264
  | Agent 4 | Condensed regression-testing | Full change-based + historical + time-budget strategies |
265
265
 
266
+ ## Pattern Memory Loop (Direct Modes)
267
+
268
+ When `{AGENTIC_QE_MODE}` = `direct` | `direct-extended`, Step 9 runs a recall → store cycle over
269
+ agentic-qe pattern memory. Non-blocking: errors or empty results never stall the assessment.
270
+ (`fleet_init` was called in Step 0; call it first if this session resumed at Step 9.)
271
+
272
+ **Before fleet assembly** — prime agent focus areas:
273
+
274
+ ```
275
+ mcp__agentic-qe__memory_query({ pattern: "patterns/feature-adr/fleet/*", namespace: "learning", limit: 5 })
276
+ ```
277
+
278
+ Fold recurring findings (e.g. traceability chains that historically break, risk categories that recur)
279
+ into each agent's scope brief.
280
+
281
+ **After the fleet verdict** — store the finding for future pipeline runs:
282
+
283
+ ```
284
+ mcp__agentic-qe__memory_store({
285
+ key: "patterns/feature-adr/fleet/{timestamp}",
286
+ namespace: "learning",
287
+ value: {
288
+ pattern: "<one-sentence lesson from this assessment>",
289
+ confidence: <honest 0-1 from gap synthesis — never a fabricated 1.0>,
290
+ type: "fleet-qe-finding",
291
+ metadata: { tier: "{COMPLEXITY_TIER}", verdict: "{FLEET_QE_VERDICT}", agents_used: <4-7>, remediation_count: <N> }
292
+ },
293
+ persist: true
294
+ })
295
+ ```
296
+
266
297
  ## Direct Extended Mode (`--full-qe-extended`)
267
298
 
268
299
  When `{AGENTIC_QE_MODE}` = `direct-extended`, Step 9 gets everything from
@@ -282,7 +313,7 @@ These agents are spawned alongside Agents 1-4 in the same message.
282
313
 
283
314
  After Step 9 completes, if `--full-qe-extended` is active:
284
315
  1. Load `qcsd-production-swarm` feedback loop patterns
285
- 2. Store Fleet QE findings in memory for future pipeline runs
316
+ 2. Store Fleet QE findings via the Pattern Memory Loop above (`patterns/feature-adr/fleet/{timestamp}`)
286
317
  3. Flag production health risks for monitoring post-deploy
287
318
  4. Advisory: suggest post-deploy monitoring checklist
288
319