@dzhechkov/skills-feature-adr 1.0.0 → 1.2.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 (29) hide show
  1. package/README.md +144 -26
  2. package/package.json +9 -3
  3. package/src/cli.js +19 -7
  4. package/src/commands/init.js +97 -8
  5. package/src/utils.js +36 -0
  6. package/templates/.claude/commands/feature-adr.md +8 -0
  7. package/templates/.claude/shards/feature-adr.shard.md +64 -10
  8. package/templates/.claude/skills/feature-adr/SKILL.md +245 -59
  9. package/templates/.claude/skills/feature-adr/modules/03-adr.md +43 -0
  10. package/templates/.claude/skills/feature-adr/modules/03.5-ideation-swarm.md +180 -0
  11. package/templates/.claude/skills/feature-adr/modules/06-implementation-plan.md +56 -7
  12. package/templates/.claude/skills/feature-adr/modules/08-qe.md +87 -23
  13. package/templates/.claude/skills/feature-adr/modules/09-fleet-qe.md +305 -0
  14. package/templates/.claude/skills/feature-adr/references/agentic-qe/README.md +143 -0
  15. package/templates/.claude/skills/feature-adr/references/agentic-qe/brutal-honesty-review.md +240 -0
  16. package/templates/.claude/skills/feature-adr/references/agentic-qe/chaos-engineering-resilience.md +163 -0
  17. package/templates/.claude/skills/feature-adr/references/agentic-qe/code-goal-planner.md +446 -0
  18. package/templates/.claude/skills/feature-adr/references/agentic-qe/enterprise-integration-testing.md +111 -0
  19. package/templates/.claude/skills/feature-adr/references/agentic-qe/mutation-testing.md +236 -0
  20. package/templates/.claude/skills/feature-adr/references/agentic-qe/performance-testing.md +315 -0
  21. package/templates/.claude/skills/feature-adr/references/agentic-qe/qcsd-ideation-swarm.md +126 -0
  22. package/templates/.claude/skills/feature-adr/references/agentic-qe/qcsd-production-swarm.md +108 -0
  23. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-coverage-analysis.md +193 -0
  24. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-requirements-validation.md +254 -0
  25. package/templates/.claude/skills/feature-adr/references/agentic-qe/regression-testing.md +233 -0
  26. package/templates/.claude/skills/feature-adr/references/agentic-qe/risk-based-testing.md +212 -0
  27. package/templates/.claude/skills/feature-adr/references/agentic-qe/security-testing.md +311 -0
  28. package/templates/.claude/skills/feature-adr/references/agentic-qe/shift-left-testing.md +231 -0
  29. package/templates/.claude/skills/feature-adr/references/agentic-qe/tdd-london-chicago.md +249 -0
package/README.md CHANGED
@@ -2,21 +2,24 @@
2
2
 
3
3
  **Adaptive Feature Development skill pack for Claude Code**
4
4
 
5
- 9-step pipeline with Complexity Router (S/M/L/XL) for developing features of any scale — from a 3-file config change to a cross-cutting 30+ file refactoring. Part of the [Keysarium](https://www.npmjs.com/package/@dzhechkov/keysarium) ecosystem.
5
+ 11-step pipeline with Complexity Router (S/M/L/XL) for developing features of any scale — from a 3-file config change to a cross-cutting 30+ file refactoring. Integrates 15 skills from [agentic-qe](https://github.com/proffesor-for-testing/agentic-qe) for comprehensive quality engineering. Part of the [Keysarium](https://www.npmjs.com/package/@dzhechkov/keysarium) ecosystem.
6
6
 
7
7
  ---
8
8
 
9
9
  ## Quick Start
10
10
 
11
11
  ```bash
12
- # One-command install via npx
13
- npx @dzhechkov/skills-feature-adr
12
+ # Core install (feature-adr pipeline only)
13
+ npx @dzhechkov/skills-feature-adr init
14
+
15
+ # Full install with learning + knowledge extraction
16
+ npx @dzhechkov/skills-feature-adr init --with-learning --knowledge-extractor
14
17
 
15
18
  # Or install globally
16
19
  npm install -g @dzhechkov/skills-feature-adr
17
- skills-feature-adr init
20
+ skills-feature-adr init --with-learning --knowledge-extractor
18
21
 
19
- # Install into a project that already has @dzhechkov/keysarium
22
+ # Already have @dzhechkov/keysarium? Just install core (learning & harvest included)
20
23
  npx @dzhechkov/skills-feature-adr init
21
24
  ```
22
25
 
@@ -28,11 +31,11 @@ After installation, open Claude Code in your project directory and use `/feature
28
31
 
29
32
  | Component | Count | Description |
30
33
  |-----------|-------|-------------|
31
- | **Skill** | 1 | `feature-adr` — 9-step pipeline with complexity routing |
32
- | **Modules** | 9 | Steps 00-08: Complexity Router → Requirements → Research → ADR → DDD → Architecture → Plan → Code → QE |
33
- | **References** | 4 | Complexity matrix, ADR template, C4 template, QE checklist |
34
+ | **Skill** | 1 | `feature-adr` — 11-step pipeline with complexity routing |
35
+ | **Modules** | 11 | Steps 00-09 + 03.5: Router → Requirements → Research → ADR → QCSD → DDD → Architecture → Plan → Code → QE → Fleet QE |
36
+ | **References** | 4+15 | Complexity matrix, ADR/C4/QE templates + 15 agentic-qe skill protocols |
34
37
  | **Examples** | 1 | Sample M-tier feature output |
35
- | **Command** | 1 | `/feature-adr` — orchestrator command |
38
+ | **Command** | 1 | `/feature-adr` — orchestrator (supports `--full-qe` and `--full-qe-extended`) |
36
39
  | **Rules** | 1 | `feature-adr-conventions` — directory structure and naming |
37
40
  | **Shards** | 1 | `feature-adr` — governance shard with quality gates |
38
41
 
@@ -44,7 +47,10 @@ Everything is installed into your project's `.claude/` directory and works nativ
44
47
 
45
48
  ```bash
46
49
  npx @dzhechkov/skills-feature-adr # Full install (same as init)
47
- npx @dzhechkov/skills-feature-adr init # Install all components
50
+ npx @dzhechkov/skills-feature-adr init # Install core components
51
+ npx @dzhechkov/skills-feature-adr init --with-learning # + reward learning
52
+ npx @dzhechkov/skills-feature-adr init --knowledge-extractor # + knowledge extractor
53
+ npx @dzhechkov/skills-feature-adr init --with-learning --knowledge-extractor # + both
48
54
  npx @dzhechkov/skills-feature-adr init --force # Overwrite existing files
49
55
  npx @dzhechkov/skills-feature-adr init --dry-run # Preview without making changes
50
56
  npx @dzhechkov/skills-feature-adr update # Update to latest version
@@ -75,9 +81,17 @@ ARCHITECTURE → IMPLEMENTATION → CODE → QE
75
81
 
76
82
  # The Complexity Router classifies your feature automatically:
77
83
  # S → fast track (5 steps)
78
- # M → standard (7 steps)
79
- # L → full pipeline (9 steps)
84
+ # M → standard (8 steps)
85
+ # L → full pipeline (11 steps)
80
86
  # XL → full DAG + multi-agent swarm
87
+
88
+ # With full agentic-qe integration (requires: npm install -g agentic-qe)
89
+ /feature-adr --full-qe Add payment processing module
90
+ # Full protocols for 9 core skills, same agents, deeper methodology
91
+
92
+ # With extended agentic-qe (chaos, security, performance, mutation, TDD)
93
+ /feature-adr --full-qe-extended Migrate authentication to zero-trust architecture
94
+ # Full protocols + 6 extra skills, up to 7 fleet QE agents
81
95
  ```
82
96
 
83
97
  ---
@@ -106,17 +120,21 @@ ARCHITECTURE → IMPLEMENTATION → CODE → QE
106
120
 
107
121
  ## Pipeline Steps
108
122
 
109
- | Step | Name | Tiers | Model | Output |
110
- |------|------|-------|-------|--------|
111
- | 0 | Complexity Router | All | haiku | `00_complexity_assessment.md` |
112
- | 1 | Requirements | All | sonnet | `01_requirements.md` |
113
- | 2 | Research | L/XL | sonnet | `02_research.md` |
114
- | 3 | ADR | M+ | opus | `03_adr/001-*.md` |
115
- | 4 | DDD | L/XL | opus | `04_domain_model.md` |
116
- | 5 | Architecture | M+ | opus | `05_architecture.md` + diagrams |
117
- | 6 | Implementation Plan | All | sonnet | `06_implementation_plan.md` |
118
- | 7 | Code | All | opus | `07_code_changes/` |
119
- | 8 | QE | All | sonnet | `08_qe_report.md` |
123
+ | Step | Name | Tiers | Model | Agentic QE Skill | Output |
124
+ |------|------|-------|-------|------------------|--------|
125
+ | 0 | Complexity Router | All | haiku | — | `00_complexity_assessment.md` |
126
+ | 1 | Requirements | All | sonnet | — | `01_requirements.md` |
127
+ | 2 | Research | L/XL | sonnet | — | `02_research.md` |
128
+ | 3 | ADR + Shift-Left | M+ | opus | shift-left-testing | `03_adr/001-*.md` |
129
+ | 3.5 | QCSD Ideation Swarm | M+ | sonnet | qcsd-ideation-swarm | `03.5_ideation_report.md` |
130
+ | 4 | DDD | L/XL | opus | — | `04_domain_model.md` |
131
+ | 5 | Architecture | M+ | opus | | `05_architecture.md` + diagrams |
132
+ | 6 | SPARC-GOAP Plan | All | sonnet | code-goal-planner | `06_implementation_plan.md` |
133
+ | 7 | Code | All | opus | tdd-london-chicago* | `07_code_changes/` |
134
+ | 8 | QE + Brutal Honesty | All | sonnet | brutal-honesty-review | `08_qe_report.md` |
135
+ | 9 | Fleet QE | L/XL | sonnet | 5 skills (4 agents) | `09_fleet_qe_assessment.md` |
136
+
137
+ *\* Extended skills (marked with \*) are only available with `--full-qe-extended`*
120
138
 
121
139
  ---
122
140
 
@@ -135,6 +153,7 @@ features/<feature-slug>/
135
153
  ├── 07_code_changes/
136
154
  │ └── change_manifest.md ← Always
137
155
  ├── 08_qe_report.md ← Always
156
+ ├── 09_fleet_qe_assessment.md ← L/XL only
138
157
  ├── diagrams/ ← M+ only
139
158
  │ ├── architecture-c4.mermaid
140
159
  │ └── sequence-*.mermaid
@@ -143,6 +162,103 @@ features/<feature-slug>/
143
162
 
144
163
  ---
145
164
 
165
+ ## Agentic QE Integration
166
+
167
+ Feature ADR integrates 15 skills from [agentic-qe](https://github.com/proffesor-for-testing/agentic-qe) for quality engineering at every step.
168
+
169
+ ### Three Modes
170
+
171
+ | Mode | Flag | Skills | Requires |
172
+ |------|------|--------|----------|
173
+ | **Reference** | (none) | 9 core (condensed copies) | Nothing — works out of the box |
174
+ | **Direct** | `--full-qe` | 9 core (full protocols) | [agentic-qe](https://github.com/proffesor-for-testing/agentic-qe) installed |
175
+ | **Direct Extended** | `--full-qe-extended` | 15 (9 core + 6 extended) | [agentic-qe](https://github.com/proffesor-for-testing/agentic-qe) installed |
176
+
177
+ ### Installing agentic-qe (required for `--full-qe` and `--full-qe-extended`)
178
+
179
+ ```bash
180
+ # 1. Install agentic-qe globally
181
+ npm install -g agentic-qe
182
+
183
+ # 2. Initialize in your project (auto-detects tech stack, configures MCP)
184
+ cd your-project && aqe init --auto
185
+ ```
186
+
187
+ Source: [github.com/proffesor-for-testing/agentic-qe](https://github.com/proffesor-for-testing/agentic-qe)
188
+
189
+ After installation, feature-adr auto-detects agentic-qe when you use the `--full-qe` or `--full-qe-extended` flags. If agentic-qe is not found, the pipeline falls back to Reference Mode with a warning.
190
+
191
+ ### Core Skills (9, all modes)
192
+
193
+ | Skill | Step | Purpose |
194
+ |-------|------|---------|
195
+ | shift-left-testing | 3 | ADR testability validation |
196
+ | qcsd-ideation-swarm | 3.5 | HTSM + SFDIPOT quality swarm |
197
+ | code-goal-planner | 6 | SPARC-GOAP milestone planning |
198
+ | brutal-honesty-review | 8 | Linus/Ramsay/Bach code review |
199
+ | qe-requirements-validation | 9 | Traceability matrix + SMART |
200
+ | risk-based-testing | 9 | Probability×Impact 5×5 scoring |
201
+ | enterprise-integration-testing | 9 | Contract testing + E2E flows |
202
+ | regression-testing | 9 | Change-based test selection |
203
+ | qe-coverage-analysis | 9 | Risk-weighted coverage |
204
+
205
+ ### Extended Skills (6, `--full-qe-extended` only)
206
+
207
+ | Skill | Step | Condition |
208
+ |-------|------|-----------|
209
+ | tdd-london-chicago | 7 | Always |
210
+ | mutation-testing | 8 | If test suite exists |
211
+ | security-testing | 8, 9 | `HAS_AUTH` / `HAS_EXTERNAL_API` |
212
+ | performance-testing | 8, 9 | `HAS_PERFORMANCE_SLA` |
213
+ | chaos-engineering-resilience | 9 | `HAS_INFRASTRUCTURE_CHANGE` |
214
+ | qcsd-production-swarm | Post-9 | Advisory feedback loops |
215
+
216
+ ---
217
+
218
+ ## Optional Features: Learning & Knowledge Extraction
219
+
220
+ Feature ADR can be extended with reward learning and knowledge extraction — no additional packages required.
221
+
222
+ ### `--with-learning` — Reward Learning
223
+
224
+ Adds the Memory Protocol and Reward Tracker. The pipeline **learns from your feedback** at every checkpoint:
225
+ - Stores reward scores based on your responses (immediate approval = 1.0, minor adjustments = 0.7, rework = 0.3)
226
+ - Loads historical patterns at the start of each step
227
+ - Detects domain-specific bottlenecks and skill effectiveness trends
228
+
229
+ ```bash
230
+ npx @dzhechkov/skills-feature-adr init --with-learning
231
+ ```
232
+
233
+ **Installs:** `lib/memory-protocol.md`, `lib/reward-tracker.md`, `.claude/rules/reward-learning.md`
234
+
235
+ ### `--knowledge-extractor` — Knowledge Harvesting
236
+
237
+ Adds the Knowledge Extractor skill with the `/harvest` command. After completing a feature, extract reusable patterns:
238
+
239
+ ```bash
240
+ npx @dzhechkov/skills-feature-adr init --knowledge-extractor
241
+
242
+ # After completing a feature:
243
+ /harvest features/<feature-slug>/
244
+ ```
245
+
246
+ **Installs:** `.claude/skills/knowledge-extractor/` (5 agents, 7 categories, 8 quality gates), `.claude/commands/harvest.md`
247
+
248
+ ### Both at once
249
+
250
+ ```bash
251
+ npx @dzhechkov/skills-feature-adr init --with-learning --knowledge-extractor
252
+ ```
253
+
254
+ ### Already using `@dzhechkov/keysarium`?
255
+
256
+ > **If you have `@dzhechkov/keysarium` installed, these flags are not needed.**
257
+ > Keysarium already includes reward learning, knowledge extraction, and more.
258
+ > The installer auto-detects keysarium and skips optional components to avoid duplication.
259
+
260
+ ---
261
+
146
262
  ## Shared Skills
147
263
 
148
264
  Feature ADR uses these skills from `@dzhechkov/keysarium` (if installed):
@@ -166,9 +282,11 @@ npx @dzhechkov/skills-bto init # Build-Test-Optimize
166
282
  npx @dzhechkov/skills-feature-adr init # Feature development
167
283
 
168
284
  # Use the right tool for the job:
169
- /casarium [case description] # AI case research (7 phases)
170
- /feature-adr [feature description] # Feature development (9 steps)
171
- /bto [skill path] # Skill evaluation & optimization
285
+ /casarium [case description] # AI case research (7 phases)
286
+ /feature-adr [feature description] # Feature development (11 steps)
287
+ /feature-adr --full-qe [feature description] # + full agentic-qe protocols
288
+ /feature-adr --full-qe-extended [feature desc] # + extended QE skills
289
+ /bto [skill path] # Skill evaluation & optimization
172
290
  ```
173
291
 
174
292
  ---
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dzhechkov/skills-feature-adr",
3
- "version": "1.0.0",
4
- "description": "Adaptive Feature Development skill pack for Claude Code — 9-step pipeline with Complexity Router (S/M/L/XL), ADR-driven architecture, and multi-agent QE",
3
+ "version": "1.2.0",
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
  "main": "src/cli.js",
6
6
  "bin": {
7
7
  "skills-feature-adr": "./bin/cli.js"
@@ -27,7 +27,13 @@
27
27
  "skills",
28
28
  "skill-pack",
29
29
  "ddd",
30
- "quality-engineering"
30
+ "quality-engineering",
31
+ "agentic-qe",
32
+ "shift-left",
33
+ "fleet-qe",
34
+ "reward-learning",
35
+ "knowledge-extractor",
36
+ "harvest"
31
37
  ],
32
38
  "author": "dzhechko",
33
39
  "license": "MIT",
package/src/cli.js CHANGED
@@ -10,7 +10,7 @@ function showBanner() {
10
10
  console.log('');
11
11
  console.log(cyan('\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557'));
12
12
  console.log(cyan('\u2551') + bold(' FEATURE-ADR \u2014 Adaptive Feature Development ') + cyan('\u2551'));
13
- console.log(cyan('\u2551') + ' 9-step pipeline with Complexity Router (S/M/L/XL) ' + cyan('\u2551'));
13
+ console.log(cyan('\u2551') + ' 11-step pipeline with Complexity Router (S/M/L/XL) ' + cyan('\u2551'));
14
14
  console.log(cyan('\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D'));
15
15
  console.log('');
16
16
  }
@@ -37,20 +37,24 @@ function showHelp() {
37
37
  console.log(' ' + green('doctor') + ' Check Feature ADR installation health');
38
38
  console.log('');
39
39
  console.log(bold('Options:'));
40
- console.log(' ' + yellow('--force') + ' Overwrite existing files without prompting');
41
- console.log(' ' + yellow('--dry-run') + ' Show what would be done without making changes');
42
- console.log(' ' + yellow('--help, -h') + ' Show this help message');
43
- console.log(' ' + yellow('--version, -v') + ' Show version number');
40
+ console.log(' ' + yellow('--force') + ' Overwrite existing files without prompting');
41
+ console.log(' ' + yellow('--dry-run') + ' Show what would be done without making changes');
42
+ console.log(' ' + yellow('--with-learning') + ' Add reward learning (memory protocol + reward tracker)');
43
+ console.log(' ' + yellow('--knowledge-extractor') + ' Add knowledge extractor skill (/harvest)');
44
+ console.log(' ' + yellow('--help, -h') + ' Show this help message');
45
+ console.log(' ' + yellow('--version, -v') + ' Show version number');
44
46
  console.log('');
45
47
  console.log(bold('Examples:'));
46
48
  console.log(dim(' $ ') + 'npx @dzhechkov/skills-feature-adr init');
49
+ console.log(dim(' $ ') + 'npx @dzhechkov/skills-feature-adr init --with-learning');
50
+ console.log(dim(' $ ') + 'npx @dzhechkov/skills-feature-adr init --with-learning --knowledge-extractor');
47
51
  console.log(dim(' $ ') + 'npx @dzhechkov/skills-feature-adr init --force');
48
- console.log(dim(' $ ') + 'npx @dzhechkov/skills-feature-adr update --dry-run');
49
52
  console.log(dim(' $ ') + 'npx @dzhechkov/skills-feature-adr doctor');
50
53
  console.log('');
51
54
  console.log(bold('Integration:'));
52
55
  console.log(' Works alongside @dzhechkov/keysarium and @dzhechkov/skills-bto.');
53
- console.log(' Install all three for the full toolkit.');
56
+ console.log(' If @dzhechkov/keysarium is already installed, --with-learning and');
57
+ console.log(' --knowledge-extractor are not needed (already included in keysarium).');
54
58
  console.log('');
55
59
  }
56
60
 
@@ -63,6 +67,8 @@ function parseArgs(argv) {
63
67
  const flags = {
64
68
  force: false,
65
69
  dryRun: false,
70
+ withLearning: false,
71
+ knowledgeExtractor: false,
66
72
  targetDir: process.cwd(),
67
73
  };
68
74
 
@@ -76,6 +82,12 @@ function parseArgs(argv) {
76
82
  case '--dry-run':
77
83
  flags.dryRun = true;
78
84
  break;
85
+ case '--with-learning':
86
+ flags.withLearning = true;
87
+ break;
88
+ case '--knowledge-extractor':
89
+ flags.knowledgeExtractor = true;
90
+ break;
79
91
  case '--help':
80
92
  case '-h':
81
93
  command = 'help';
@@ -8,7 +8,7 @@ const {
8
8
  copyDirRecursive, copyDirFiltered, fileExists, readJSON,
9
9
  ensureDir, getRelativePaths, getRelativePathsFiltered,
10
10
  createManifest, writeManifest, getTemplatesDir,
11
- COMPONENTS, MANIFEST_FILE, getComponentFilter,
11
+ COMPONENTS, OPTIONAL_COMPONENTS, MANIFEST_FILE, getComponentFilter,
12
12
  } = require('../utils');
13
13
 
14
14
  // ---------------------------------------------------------------------------
@@ -47,6 +47,13 @@ function installComponent(key, comp, templatesDir, targetDir) {
47
47
  return [];
48
48
  }
49
49
 
50
+ // Single file copy (for isFile components)
51
+ if (comp.isFile) {
52
+ ensureDir(path.dirname(dest));
53
+ fs.copyFileSync(src, dest);
54
+ return [comp.src];
55
+ }
56
+
50
57
  const filterFn = getComponentFilter(comp);
51
58
 
52
59
  if (filterFn) {
@@ -58,12 +65,33 @@ function installComponent(key, comp, templatesDir, targetDir) {
58
65
  return getRelativePaths(dest).map((rel) => path.join(comp.src, rel));
59
66
  }
60
67
 
68
+ // Resolve which optional component keys to install based on flags
69
+ function getOptionalKeys(flags, keysariumDetected) {
70
+ if (keysariumDetected) return []; // keysarium already provides these
71
+
72
+ const keys = [];
73
+
74
+ if (flags.withLearning) {
75
+ for (const [key, comp] of Object.entries(OPTIONAL_COMPONENTS)) {
76
+ if (comp.group === 'learning') keys.push(key);
77
+ }
78
+ }
79
+
80
+ if (flags.knowledgeExtractor) {
81
+ for (const [key, comp] of Object.entries(OPTIONAL_COMPONENTS)) {
82
+ if (comp.group === 'knowledge-extractor') keys.push(key);
83
+ }
84
+ }
85
+
86
+ return keys;
87
+ }
88
+
61
89
  // ---------------------------------------------------------------------------
62
90
  // Main command
63
91
  // ---------------------------------------------------------------------------
64
92
 
65
93
  async function run(options) {
66
- const { force, dryRun, targetDir } = options;
94
+ const { force, dryRun, targetDir, withLearning, knowledgeExtractor } = options;
67
95
  const manifestPath = path.join(targetDir, MANIFEST_FILE);
68
96
 
69
97
  // ── a) Check for existing installation ─────────────────────────────────
@@ -78,12 +106,23 @@ async function run(options) {
78
106
 
79
107
  // ── b) Detect keysarium integration ────────────────────────────────────
80
108
  const keysariumManifest = detectKeysarium(targetDir);
109
+ const keysariumDetected = !!keysariumManifest;
110
+
81
111
  if (keysariumManifest) {
82
112
  showKeysariumIntegration(keysariumManifest);
83
113
  }
84
114
 
115
+ // Warn if flags used but keysarium already provides these
116
+ if (keysariumDetected && (withLearning || knowledgeExtractor)) {
117
+ console.log('');
118
+ warn('Keysarium is already installed \u2014 it includes learning and knowledge extraction.');
119
+ info('Flags --with-learning and --knowledge-extractor are not needed. Skipping optional components.');
120
+ console.log('');
121
+ }
122
+
85
123
  // ── c) Determine components ────────────────────────────────────────────
86
124
  const componentKeys = Object.keys(COMPONENTS);
125
+ const optionalKeys = getOptionalKeys(options, keysariumDetected);
87
126
  const templatesDir = getTemplatesDir();
88
127
 
89
128
  // ── d) Show plan ───────────────────────────────────────────────────────
@@ -97,6 +136,16 @@ async function run(options) {
97
136
  console.log(` ${green('+')} ${comp.label}${filterNote}`);
98
137
  }
99
138
 
139
+ if (optionalKeys.length > 0) {
140
+ console.log('');
141
+ info(bold('Optional components:'));
142
+ console.log('');
143
+ for (const key of optionalKeys) {
144
+ const comp = OPTIONAL_COMPONENTS[key];
145
+ console.log(` ${yellow('+')} ${comp.label}`);
146
+ }
147
+ }
148
+
100
149
  console.log('');
101
150
 
102
151
  if (dryRun) {
@@ -104,14 +153,25 @@ async function run(options) {
104
153
  process.exit(0);
105
154
  }
106
155
 
107
- // ── e) Install components ──────────────────────────────────────────────
108
- const totalComponents = componentKeys.length;
156
+ // ── e) Install core components ─────────────────────────────────────────
157
+ const totalComponents = componentKeys.length + optionalKeys.length;
109
158
  const installedFiles = [];
159
+ let stepNum = 0;
110
160
 
111
- for (let i = 0; i < totalComponents; i++) {
112
- const key = componentKeys[i];
161
+ for (const key of componentKeys) {
162
+ stepNum++;
113
163
  const comp = COMPONENTS[key];
114
- step(i + 1, totalComponents, `Installing ${comp.label}...`);
164
+ step(stepNum, totalComponents, `Installing ${comp.label}...`);
165
+
166
+ const files = installComponent(key, comp, templatesDir, targetDir);
167
+ installedFiles.push(...files);
168
+ }
169
+
170
+ // ── e2) Install optional components ────────────────────────────────────
171
+ for (const key of optionalKeys) {
172
+ stepNum++;
173
+ const comp = OPTIONAL_COMPONENTS[key];
174
+ step(stepNum, totalComponents, `Installing ${comp.label}...`);
115
175
 
116
176
  const files = installComponent(key, comp, templatesDir, targetDir);
117
177
  installedFiles.push(...files);
@@ -122,7 +182,15 @@ async function run(options) {
122
182
  const pkg = readJSON(pkgPath);
123
183
  const version = pkg ? pkg.version : '0.0.0';
124
184
 
125
- const manifest = createManifest(version, componentKeys, installedFiles.sort());
185
+ const allKeys = [...componentKeys, ...optionalKeys];
186
+ const manifest = createManifest(version, allKeys, installedFiles.sort());
187
+
188
+ // Track optional features in manifest
189
+ manifest.optional = {
190
+ withLearning: optionalKeys.some((k) => OPTIONAL_COMPONENTS[k]?.group === 'learning'),
191
+ knowledgeExtractor: optionalKeys.some((k) => OPTIONAL_COMPONENTS[k]?.group === 'knowledge-extractor'),
192
+ };
193
+
126
194
  writeManifest(targetDir, manifest);
127
195
  info(`Created ${MANIFEST_FILE} manifest`);
128
196
 
@@ -136,6 +204,10 @@ async function run(options) {
136
204
  const comp = COMPONENTS[key];
137
205
  console.log(` ${green('\u2713')} ${comp.label}`);
138
206
  }
207
+ for (const key of optionalKeys) {
208
+ const comp = OPTIONAL_COMPONENTS[key];
209
+ console.log(` ${green('\u2713')} ${comp.label} ${yellow('[optional]')}`);
210
+ }
139
211
 
140
212
  console.log('');
141
213
  console.log(bold('Next steps:'));
@@ -143,6 +215,14 @@ async function run(options) {
143
215
  console.log(` 2. Run ${cyan('/feature-adr [description]')} to start the pipeline`);
144
216
  console.log(` 3. The Complexity Router will classify your feature as S/M/L/XL`);
145
217
  console.log(` 4. Then the pipeline adapts: fewer steps for S, full DAG for XL`);
218
+
219
+ if (manifest.optional.withLearning) {
220
+ console.log(` 5. Reward learning is active \u2014 pipeline improves from your feedback`);
221
+ }
222
+ if (manifest.optional.knowledgeExtractor) {
223
+ console.log(` ${manifest.optional.withLearning ? '6' : '5'}. Run ${cyan('/harvest features/<slug>/')} after completing a feature to extract knowledge`);
224
+ }
225
+
146
226
  console.log('');
147
227
 
148
228
  console.log(bold('Complexity Tiers:'));
@@ -152,10 +232,19 @@ async function run(options) {
152
232
  console.log(` ${bold('XL')} ${dim('\u2014 30+ files, ~4h+ (Full DAG + multi-agent swarm)')}`);
153
233
  console.log('');
154
234
 
235
+ if (!withLearning && !knowledgeExtractor && !keysariumDetected) {
236
+ console.log(bold('Optional features:'));
237
+ console.log(` ${dim('Add reward learning:')} npx @dzhechkov/skills-feature-adr init --with-learning --force`);
238
+ console.log(` ${dim('Add knowledge extractor:')} npx @dzhechkov/skills-feature-adr init --knowledge-extractor --force`);
239
+ console.log(` ${dim('Add both:')} npx @dzhechkov/skills-feature-adr init --with-learning --knowledge-extractor --force`);
240
+ console.log('');
241
+ }
242
+
155
243
  if (keysariumManifest) {
156
244
  console.log(bold('Integration:'));
157
245
  console.log(` Feature ADR is available alongside your Keysarium pipeline.`);
158
246
  console.log(` Use ${cyan('/casarium')} for research, ${cyan('/feature-adr')} for feature development.`);
247
+ console.log(` Learning and knowledge extraction are provided by Keysarium.`);
159
248
  console.log('');
160
249
  }
161
250
 
package/src/utils.js CHANGED
@@ -270,6 +270,41 @@ const COMPONENTS = {
270
270
  },
271
271
  };
272
272
 
273
+ // Optional components — installed only with explicit flags
274
+ const OPTIONAL_COMPONENTS = {
275
+ // --with-learning
276
+ learning_lib_memory: {
277
+ src: 'lib/memory-protocol.md',
278
+ label: 'Memory Protocol (reward-calibrated learning)',
279
+ group: 'learning',
280
+ isFile: true,
281
+ },
282
+ learning_lib_reward: {
283
+ src: 'lib/reward-tracker.md',
284
+ label: 'Reward Tracker (analytics & pattern detection)',
285
+ group: 'learning',
286
+ isFile: true,
287
+ },
288
+ learning_rule: {
289
+ src: '.claude/rules/reward-learning.md',
290
+ label: 'Reward Learning Rules',
291
+ group: 'learning',
292
+ isFile: true,
293
+ },
294
+ // --knowledge-extractor
295
+ knowledge_extractor_skill: {
296
+ src: '.claude/skills/knowledge-extractor',
297
+ label: 'Knowledge Extractor Skill (5 agents, 7 categories, 8 gates)',
298
+ group: 'knowledge-extractor',
299
+ },
300
+ knowledge_extractor_command: {
301
+ src: '.claude/commands',
302
+ label: 'Harvest Command (/harvest)',
303
+ group: 'knowledge-extractor',
304
+ filter: 'harvest',
305
+ },
306
+ };
307
+
273
308
  // ===========================================================================
274
309
  // Filter helpers
275
310
  // ===========================================================================
@@ -328,6 +363,7 @@ module.exports = {
328
363
 
329
364
  // Components
330
365
  COMPONENTS,
366
+ OPTIONAL_COMPONENTS,
331
367
 
332
368
  // Filters
333
369
  getComponentFilter,
@@ -3,6 +3,8 @@
3
3
  ## Использование
4
4
  ```
5
5
  /feature-adr [описание фичи или путь к issue]
6
+ /feature-adr --full-qe [описание фичи] # Direct Mode: полные протоколы agentic-qe
7
+ /feature-adr --full-qe-extended [описание фичи] # Direct Extended: полные протоколы + доп. скиллы
6
8
  ```
7
9
 
8
10
  ## Аргумент
@@ -16,6 +18,12 @@ $ARGUMENTS
16
18
  3. **Step 0 — Complexity Router:**
17
19
  - Прочитай `modules/00-complexity-router.md` и `references/complexity-matrix.md`
18
20
  - Классифицируй фичу в S/M/L/XL
21
+ - **Проверь agentic-qe флаги:**
22
+ - `--full-qe` → проверь `which aqe` или `node_modules/agentic-qe/`.
23
+ Если найден → `{AGENTIC_QE_MODE}=direct`. Если нет → WARN, fallback to reference.
24
+ - `--full-qe-extended` → то же + `{AGENTIC_QE_MODE}=direct-extended`.
25
+ Активирует доп. скиллы (chaos, security, performance, mutation, TDD, production-swarm).
26
+ - Без флагов → `{AGENTIC_QE_MODE}=reference` (condensed копии, без установки).
19
27
  - Определи `{ACTIVE_STEPS}` и `{TIME_BUDGET}`
20
28
  - Покажи Checkpoint 0 и **жди подтверждения tier**
21
29