@dzhechkov/p-replicator 1.0.0 → 1.1.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 (19) hide show
  1. package/README.md +25 -3
  2. package/package.json +7 -4
  3. package/src/commands/doctor.js +2 -2
  4. package/src/commands/list.js +1 -1
  5. package/templates/.claude/rules/replicate-pipeline.md +13 -1
  6. package/templates/.claude/rules/skill-interface-protocol.md +148 -0
  7. package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +116 -63
  8. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/01-detect-parse.md +329 -0
  9. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/02-analyze-map.md +449 -0
  10. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/03-generate-p0.md +630 -0
  11. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/04-generate-p1.md +537 -0
  12. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/05-generate-p2p3.md +512 -0
  13. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/06-package-deliver.md +710 -0
  14. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/07-harvest-feedback.md +286 -0
  15. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/08-skill-composition.md +378 -0
  16. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/09-cross-project-learning.md +461 -0
  17. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/README.md +83 -0
  18. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/maturity-integration.md +198 -0
  19. package/templates/.claude/skills/pipeline-forge/references/self-extracted-patterns.md +260 -0
@@ -0,0 +1,537 @@
1
+ # Module: Generate P1 (Recommended)
2
+
3
+ Phase 4 of the CC-Toolkit-Generator-Enhanced pipeline. Generates recommended instruments
4
+ that significantly enhance the developer experience. Items are scored by the recommendation
5
+ engine and conditionally included based on project characteristics and document richness.
6
+
7
+ ## Input
8
+
9
+ - **Internal Project Model (IPM)** — from Phase 1 (Detect & Parse)
10
+ - `project_name`, `tech_stack`, `docker_services`, `monorepo_packages`
11
+ - `has_external_apis`, `has_database`, `has_ddd`, `has_gherkin`, `has_fitness`
12
+ - `has_ai_context`, `has_pseudocode`, `has_adr`, `has_c4`
13
+ - **Instrument Map** — from Phase 2 (Analyze & Map)
14
+ - Scored instrument list with tier assignments (P0/P1/P2/P3)
15
+ - Document-to-instrument mapping with source references
16
+ - **P0 Outputs** — from Phase 3 (Generate P0)
17
+ - Generated CLAUDE.md, settings.json, feature-lifecycle rule, 6 lifecycle skills
18
+ - Confirmed project paths and naming conventions
19
+
20
+ ## Process
21
+
22
+ ### Step 1: Filter P1 Candidates
23
+
24
+ Select all instruments assigned tier P1 from the Instrument Map (score >= 12 after tier boosts).
25
+ Apply the scoring engine from `view("references/enhanced-recommendations.md")` to finalize the set.
26
+
27
+ ```
28
+ P1 Candidate Instruments:
29
+ Agents: planner.md, code-reviewer.md, architect.md
30
+ Skills: project-context/, coding-standards/, testing-patterns/
31
+ Commands: /plan, /test, /deploy
32
+ Rules: testing.md
33
+
34
+ Conditional P1 (require detection flags):
35
+ Enterprise Lifecycle: /feature-ent, feature-lifecycle-ent.md rule, idea2prd-manual/ skill, goap-research-ed25519/ skill
36
+ Feature Suggestions: /next, feature-navigator/ skill, feature-roadmap.json, SessionStart hook, feature-context.py
37
+ Automation Commands: /go, /run, /docs
38
+ ```
39
+
40
+ ### Step 2: Generate Core P1 Agents
41
+
42
+ #### 2a. planner.md Agent
43
+
44
+ Source documents: Pseudocode.md (SPARC) or `docs/pseudocode/*.pseudo` (idea2prd)
45
+
46
+ ```
47
+ Generate .claude/agents/planner.md:
48
+ - Extract algorithm structures from Pseudocode documents
49
+ - Include function signatures, error handling patterns
50
+ - Reference actual pseudocode file paths in agent instructions
51
+ - Set model: sonnet, tools: Read, Glob, Grep, Write
52
+ - Include planning templates derived from PRD functional requirements
53
+ ```
54
+
55
+ Fill `{{PSEUDOCODE_REFERENCES}}` from IPM pseudocode index.
56
+ Fill `{{PLANNING_TEMPLATES}}` from PRD functional requirements.
57
+
58
+ #### 2b. code-reviewer.md Agent
59
+
60
+ Source documents: Refinement.md + Specification.md (SPARC) or Fitness Functions + ADRs (idea2prd)
61
+
62
+ ```
63
+ Generate .claude/agents/code-reviewer.md:
64
+ - Extract review criteria from Refinement.md edge cases and security checks
65
+ - IF has_ddd: include DDD compliance checklist from view("references/templates/ddd-agents.md")
66
+ - IF has_fitness: include fitness function verification checklist
67
+ - IF has_adr: include ADR compliance verification list
68
+ - Set model: sonnet, tools: Read, Glob, Grep, Bash
69
+ - Include code quality standards from Specification.md NFRs
70
+ ```
71
+
72
+ Fill `{{REVIEW_CHECKLIST}}` from Refinement edge cases.
73
+ Fill `{{FITNESS_FUNCTIONS_CHECKLIST}}` from fitness functions (if present).
74
+ Fill `{{ADR_COMPLIANCE_LIST}}` from top ADRs (if present).
75
+
76
+ #### 2c. architect.md Agent
77
+
78
+ Source documents: Architecture.md + Solution_Strategy.md (SPARC) or C4 + ADRs + DDD Strategic (idea2prd)
79
+
80
+ ```
81
+ Generate .claude/agents/architect.md:
82
+ - Extract system structure from Architecture.md
83
+ - Include tech stack rationale from Solution_Strategy.md
84
+ - IF has_c4: include C4 context and container summaries from view("references/templates/ddd-agents.md")
85
+ - IF has_adr: include top 5-10 ADR summaries with status
86
+ - IF has_fitness: include architecture fitness functions
87
+ - Set model: opus, tools: Read, Glob, Grep, Write
88
+ - Include ADR template for new architectural decisions
89
+ ```
90
+
91
+ Fill `{{C4_CONTEXT_SUMMARY}}` from C4 diagrams (if present).
92
+ Fill `{{TOP_ADRS_SUMMARY}}` from ADR files (if present).
93
+ Fill `{{ARCHITECTURE_FITNESS_FUNCTIONS}}` from fitness docs (if present).
94
+
95
+ ### Step 3: Generate Core P1 Skills
96
+
97
+ #### 3a. project-context/ Skill
98
+
99
+ Source: Research_Findings.md + Final_Summary.md (SPARC) or .ai-context/* + Research (idea2prd)
100
+
101
+ ```
102
+ Generate .claude/skills/project-context/SKILL.md:
103
+ - Use template from view("references/templates/ddd-skills.md") section "project-context/ Skill (Enhanced)"
104
+ - IF has_ai_context: integrate all 8 .ai-context files directly
105
+ - README.md → Overview
106
+ - architecture-summary.md → Architecture Summary
107
+ - key-decisions.md → Key Decisions
108
+ - domain-glossary.md → Domain Glossary
109
+ - bounded-contexts.md → Bounded Contexts
110
+ - ELSE: extract from Research_Findings.md and Final_Summary.md
111
+ - Fill {{FROM_PRD_PERSONAS}} from PRD user personas
112
+ - Fill {{FROM_PRD_METRICS}} from PRD success metrics
113
+ ```
114
+
115
+ #### 3b. coding-standards/ Skill
116
+
117
+ Source: Architecture.md tech stack (SPARC) or DDD Tactical + ADRs + .ai-context/coding-standards.md (idea2prd)
118
+
119
+ ```
120
+ Generate .claude/skills/coding-standards/SKILL.md:
121
+ - Use template from view("references/templates/ddd-skills.md") section "coding-standards/ Skill (Enhanced)"
122
+ - Extract tech stack conventions from Architecture.md
123
+ - IF has_ddd: include DDD naming conventions and file organization
124
+ - IF has_adr: extract coding-related decisions as standards
125
+ - IF has_ai_context: integrate .ai-context/coding-standards.md directly
126
+ - Fill {{TECH_KEYWORDS}} from IPM tech stack
127
+ - Fill {{CODING_STANDARDS_FROM_ADRS}} from ADR extraction
128
+ - Fill {{ANTI_PATTERNS_FROM_REJECTED_ADRS}} from rejected ADR alternatives
129
+ ```
130
+
131
+ #### 3c. testing-patterns/ Skill
132
+
133
+ Source: Refinement.md test strategy (SPARC) or Gherkin + Fitness Functions (idea2prd)
134
+
135
+ ```
136
+ Generate .claude/skills/testing-patterns/SKILL.md:
137
+ - Use template from view("references/templates/ddd-skills.md") section "testing-patterns/ Skill (Enhanced)"
138
+ - IF has_gherkin: extract Given/When/Then patterns, create step-to-code mappings
139
+ - IF has_fitness: include coverage requirements from fitness functions
140
+ - ELSE: derive testing patterns from Refinement.md test strategy
141
+ - Fill {{GHERKIN_FEATURES_TABLE}} from docs/tests/*.feature index
142
+ - Fill {{GIVEN_MAPPINGS}}, {{WHEN_MAPPINGS}}, {{THEN_MAPPINGS}} from Gherkin steps
143
+ - Fill {{LINE_TARGET}}, {{BRANCH_TARGET}} from fitness functions
144
+ ```
145
+
146
+ ### Step 4: Generate Core P1 Commands
147
+
148
+ #### 4a. /plan Command
149
+
150
+ Source: PRD.md + Pseudocode.md
151
+
152
+ ```
153
+ Generate .claude/commands/plan.md:
154
+ - Lightweight implementation planning with persistence to docs/plans/
155
+ - Include auto-commit via Stop hook (already in settings.json from P0)
156
+ - Reference planner agent for complex plans
157
+ - Include plan template with sections: Goal, Tasks, Files, Dependencies, Risks
158
+ - Generate docs/plans/ directory
159
+ ```
160
+
161
+ #### 4b. /test Command
162
+
163
+ Source: Refinement.md + Specification.md (SPARC) or Gherkin + Pseudocode (idea2prd)
164
+
165
+ ```
166
+ Generate .claude/commands/test.md:
167
+ - IF has_gherkin: use enhanced template from view("references/templates/ddd-hooks-commands.md") section "/test Command"
168
+ - Include available Gherkin features list
169
+ - Support: /test [feature], /test all, /test generate [feature]
170
+ - Include Gherkin-to-test mapping examples
171
+ - ELSE: standard test runner command
172
+ - Support: /test, /test [scope], /test coverage
173
+ - Fill {{GHERKIN_FEATURES_LIST}} from docs/tests/*.feature
174
+ - Fill {{GENERATED_TEST_TEMPLATE}} from tech stack test conventions
175
+ ```
176
+
177
+ #### 4c. /deploy Command
178
+
179
+ Source: Completion.md (SPARC) or COMPLETION_CHECKLIST.md (idea2prd)
180
+
181
+ ```
182
+ Generate .claude/commands/deploy.md:
183
+ - Use enhanced template from view("references/templates/ddd-hooks-commands.md") section "/deploy Command"
184
+ - Extract pre-deployment checklist from Completion.md
185
+ - Include environment tiers: dev (auto), staging (checks), prod (manual)
186
+ - IF has_fitness: include fitness function verification in pre-deploy
187
+ - IF has_ddd: include DDD validation in pre-deploy
188
+ - Fill {{FROM_COMPLETION_CHECKLIST}} from Completion docs
189
+ ```
190
+
191
+ ### Step 5: Generate Core P1 Rules
192
+
193
+ #### 5a. testing.md Rule
194
+
195
+ Source: Refinement.md (SPARC) or Fitness Functions (idea2prd)
196
+
197
+ ```
198
+ Generate .claude/rules/testing.md:
199
+ - Extract testing requirements and standards
200
+ - IF has_fitness: include fitness function thresholds (coverage targets, complexity limits)
201
+ - IF has_gherkin: include Gherkin scenario coverage requirements
202
+ - Include test naming conventions from tech stack
203
+ - Include test organization rules (unit/integration/e2e)
204
+ ```
205
+
206
+ ### Step 6: Conditional P1 — Enterprise Lifecycle (IF DDD detected)
207
+
208
+ **Trigger:** `IPM.has_ddd == true`
209
+
210
+ Read complete template: `view("references/templates/feature-lifecycle-ent.md")`
211
+
212
+ ```
213
+ IF has_ddd:
214
+ 6a. Generate .claude/commands/feature-ent.md
215
+ - Full enterprise 4-phase lifecycle command
216
+ - Phase 0: Pre-flight check (verify skills exist)
217
+ - Phase 1: PLAN (idea2prd-manual → DDD/ADR/C4/Gherkin)
218
+ - Phase 2: VALIDATE (requirements-validator swarm, 7 agents, score >= 70)
219
+ - Phase 3: IMPLEMENT (parallel agents per Bounded Context)
220
+ - Phase 4: REVIEW (brutal-honesty-review swarm, 6 agents)
221
+ - Output to docs/features/<feature-name>/ with full subdirectory structure
222
+
223
+ 6b. Generate .claude/rules/feature-lifecycle-ent.md
224
+ - When to use /feature-ent vs /feature decision matrix
225
+ - Enterprise planning rules (full idea2prd-manual, mandatory DDD)
226
+ - Enterprise validation rules (7 agents, extended scope)
227
+ - Enterprise implementation rules (Task per Bounded Context)
228
+ - Enterprise review rules (6 agents, ADR + fitness verification)
229
+
230
+ 6c. Copy skill directories with path rewrite:
231
+ - Copy .claude/skills/idea2prd-manual/ (entire directory)
232
+ Path rewrite in SKILL.md:
233
+ /mnt/skills/user/explore/SKILL.md → .claude/skills/explore/SKILL.md
234
+ /mnt/skills/user/goap-research-ed25519/SKILL.md → .claude/skills/goap-research-ed25519/SKILL.md
235
+ /mnt/skills/user/problem-solver-enhanced/SKILL.md → .claude/skills/problem-solver-enhanced/SKILL.md
236
+ Also update informational references (Lines 50-52): paths to .claude/skills/
237
+
238
+ - Copy .claude/skills/goap-research-ed25519/ (entire directory)
239
+
240
+ NOTE: Do NOT duplicate skills already copied in P0:
241
+ - explore/ (already present)
242
+ - problem-solver-enhanced/ (already present)
243
+ - requirements-validator/ (already present)
244
+ - brutal-honesty-review/ (already present)
245
+
246
+ 6d. Add Enterprise Feature Lifecycle section to CLAUDE.md:
247
+ - /feature-ent usage summary
248
+ - Available enterprise lifecycle skills list
249
+ - When to use /feature vs /feature-ent guidance
250
+ ```
251
+
252
+ ### Step 7: Conditional P1 — Feature Suggestions System
253
+
254
+ **Trigger:** Always generated for P1 (enhances developer workflow regardless of pipeline).
255
+
256
+ Read complete template: `view("references/templates/feature-suggestions.md")`
257
+
258
+ ```
259
+ 7a. Generate .claude/feature-roadmap.json
260
+ - Pre-populate from PRD.md Functional Requirements
261
+ - Extract feature names, descriptions, MoSCoW priorities
262
+ - Extract dependencies from Architecture.md
263
+ - Status assignment:
264
+ - Already implemented (git/codebase scan) → "done"
265
+ - Current sprint, highest priority → "in_progress" (max 1-2)
266
+ - Next Must-have features → "next"
267
+ - Should-have features → "planned"
268
+ - Features with unmet depends_on → "blocked"
269
+ - Minimum viable roadmap: at least 5 features with correct statuses
270
+
271
+ 7b. Generate .claude/hooks/feature-context.py
272
+ - SessionStart hook script
273
+ - Reads feature-roadmap.json + git log + TODO scan
274
+ - Outputs context snapshot: sprint progress, current/next features, blockers, recent commits
275
+ - Keep timeout <= 10 seconds
276
+
277
+ 7c. Update .claude/settings.json (merge with existing from P0):
278
+ - Add SessionStart hook: python3 .claude/hooks/feature-context.py (timeout: 10)
279
+ - Add Stop hook: auto-commit feature-roadmap.json if changed
280
+ - Merge with existing Stop hooks (insights + plans auto-commit)
281
+
282
+ 7d. Generate .claude/skills/feature-navigator/SKILL.md
283
+ - Read roadmap, git log, TODO scan
284
+ - Present sprint progress, in-progress, next-up, blocked items
285
+ - Suggest top 3 actions (actionable, 3-8 words each)
286
+ - Update roadmap when features are completed (cascade dependency unblocking)
287
+ - Priority rules: in_progress > next > planned; respect depends_on
288
+
289
+ 7e. Generate .claude/commands/next.md
290
+ - Default: show sprint progress + top 3 next tasks
291
+ - /next update: scan codebase, suggest status updates
292
+ - /next [feature-id]: mark done, cascade unblocking, show next
293
+
294
+ 7f. Add Feature Roadmap section to CLAUDE.md:
295
+ - Link to feature-roadmap.json
296
+ - /next command usage summary
297
+ - SessionStart hook explanation
298
+
299
+ 7g. Add Feature Workflow section to DEVELOPMENT_GUIDE.md:
300
+ - /next → pick feature → /feature or /feature-ent → /next [id] cycle
301
+ ```
302
+
303
+ ### Step 8: Conditional P1 — Automation Commands
304
+
305
+ **Trigger:** Always generated for P1 (provides autonomous execution capabilities).
306
+
307
+ Read complete template: `view("references/templates/automation-commands.md")`
308
+
309
+ ```
310
+ 8a. Generate .claude/commands/go.md
311
+ - Step 1: Determine target feature (from $ARGUMENTS or /next logic)
312
+ - Step 2: Analyze complexity with scoring matrix:
313
+ | Signal | Score |
314
+ | Touches <= 3 files | -2 |
315
+ | Touches 4-10 files | 0 |
316
+ | Touches > 10 files | +3 |
317
+ | External API integration | +2 |
318
+ | New database entities | +2 |
319
+ | Cross-bounded-context dependencies | +3 |
320
+ | Hotfix or minor improvement | -3 |
321
+ | DDD docs in project | +1 |
322
+ | Gherkin scenarios for feature | +1 |
323
+ | Implementation < 30 min | -2 |
324
+ | Implementation > 2 hours | +3 |
325
+ - Step 3: Decision matrix:
326
+ | Score | Pipeline | Condition |
327
+ | <= -2 | /plan | Simple task |
328
+ | -1 to 4 | /feature | Standard feature |
329
+ | >= +5 | /feature-ent | IF feature-ent available |
330
+ | >= +5 | /feature | IF feature-ent NOT available (with warning) |
331
+ - Step 4: Execute selected pipeline autonomously
332
+ - Step 5: Post-implementation — update roadmap, commit, push, report
333
+
334
+ 8b. Generate .claude/commands/run.md
335
+ - Step 0: Parse scope — "mvp" (default) or "all"
336
+ - Step 1: Bootstrap project via /start (skip if already bootstrapped)
337
+ - Step 2: Feature loop — /next → /go → verify → repeat
338
+ - mvp scope: implement only "next" and "in_progress" features
339
+ - all scope: implement ALL features until every one is "done"
340
+ - Step 3: Finalize — full test suite, tag (v0.1.0-mvp or v1.0.0), summary report
341
+ - Error recovery: independent commits, skip after 3 failures, always push state
342
+
343
+ 8c. Generate .claude/commands/docs.md
344
+ - Step 1: Gather context from docs/, CLAUDE.md, myinsights/, source code
345
+ - Step 2: Determine scope — languages (rus/eng/both), mode (create/update)
346
+ - Step 3: Generate 7 documentation files per language:
347
+ 1. deployment.md
348
+ 2. admin-guide.md
349
+ 3. user-guide.md
350
+ 4. infrastructure.md
351
+ 5. architecture.md
352
+ 6. ui-guide.md
353
+ 7. user-flows.md
354
+ - Step 4: Generate README/index.md (bilingual table of contents)
355
+ - Step 5: Commit and report
356
+
357
+ 8d. Add Automation Commands section to CLAUDE.md:
358
+ - /go, /run, /run mvp, /run all, /docs summary
359
+ - Command hierarchy diagram
360
+
361
+ 8e. Add Autonomous Development section to DEVELOPMENT_GUIDE.md:
362
+ - Single feature: /go
363
+ - Full MVP: /run or /run mvp
364
+ - Complete project: /run all
365
+ - Documentation: /docs, /docs rus, /docs eng, /docs update
366
+ - Command hierarchy: /run → /start → /next → /go → /plan|/feature|/feature-ent
367
+ ```
368
+
369
+ ## Output
370
+
371
+ ### Generated Files (Core P1)
372
+
373
+ | File | Type | Path |
374
+ |------|------|------|
375
+ | planner.md | Agent | `.claude/agents/planner.md` |
376
+ | code-reviewer.md | Agent | `.claude/agents/code-reviewer.md` |
377
+ | architect.md | Agent | `.claude/agents/architect.md` |
378
+ | project-context/ | Skill | `.claude/skills/project-context/SKILL.md` |
379
+ | coding-standards/ | Skill | `.claude/skills/coding-standards/SKILL.md` |
380
+ | testing-patterns/ | Skill | `.claude/skills/testing-patterns/SKILL.md` |
381
+ | plan.md | Command | `.claude/commands/plan.md` |
382
+ | test.md | Command | `.claude/commands/test.md` |
383
+ | deploy.md | Command | `.claude/commands/deploy.md` |
384
+ | testing.md | Rule | `.claude/rules/testing.md` |
385
+
386
+ ### Generated Files (Conditional: Enterprise Lifecycle — IF DDD)
387
+
388
+ | File | Type | Path |
389
+ |------|------|------|
390
+ | feature-ent.md | Command | `.claude/commands/feature-ent.md` |
391
+ | feature-lifecycle-ent.md | Rule | `.claude/rules/feature-lifecycle-ent.md` |
392
+ | idea2prd-manual/ | Skill (copy) | `.claude/skills/idea2prd-manual/` |
393
+ | goap-research-ed25519/ | Skill (copy) | `.claude/skills/goap-research-ed25519/` |
394
+
395
+ ### Generated Files (Conditional: Feature Suggestions — Always P1)
396
+
397
+ | File | Type | Path |
398
+ |------|------|------|
399
+ | feature-roadmap.json | Data | `.claude/feature-roadmap.json` |
400
+ | feature-context.py | Hook | `.claude/hooks/feature-context.py` |
401
+ | settings.json | Config (merge) | `.claude/settings.json` |
402
+ | feature-navigator/ | Skill | `.claude/skills/feature-navigator/SKILL.md` |
403
+ | next.md | Command | `.claude/commands/next.md` |
404
+
405
+ ### Generated Files (Conditional: Automation Commands — Always P1)
406
+
407
+ | File | Type | Path |
408
+ |------|------|------|
409
+ | go.md | Command | `.claude/commands/go.md` |
410
+ | run.md | Command | `.claude/commands/run.md` |
411
+ | docs.md | Command | `.claude/commands/docs.md` |
412
+
413
+ ### Modified Files (CLAUDE.md and DEVELOPMENT_GUIDE.md sections added)
414
+
415
+ - CLAUDE.md: Enterprise Feature Lifecycle, Feature Roadmap, Automation Commands sections
416
+ - DEVELOPMENT_GUIDE.md: Feature Workflow, Autonomous Development sections
417
+
418
+ ### Directories Created
419
+
420
+ - `docs/plans/` (for /plan command output)
421
+ - `.claude/hooks/` (for feature-context.py)
422
+
423
+ ## Quality Gate
424
+
425
+ All of the following must pass before proceeding to Phase 5:
426
+
427
+ ### Core P1 Validation
428
+
429
+ - [ ] All 3 agents generated with correct `model`, `tools`, and `skills` fields
430
+ - [ ] All 3 skills generated with `name`, `description`, and `---` frontmatter
431
+ - [ ] All 3 commands generated with `description` and `$ARGUMENTS` frontmatter
432
+ - [ ] `testing.md` rule generated with testing standards from source docs
433
+ - [ ] All `{{PLACEHOLDER}}` values substituted with actual project data
434
+ - [ ] No `{{IF_DDD}}` markers in output when `has_ddd == false`
435
+ - [ ] Agent/skill descriptions include trigger keywords for auto-activation
436
+ - [ ] All scored items above P1 threshold (score >= 12) are generated
437
+
438
+ ### Conditional: Enterprise Lifecycle Validation (IF DDD)
439
+
440
+ - [ ] `/feature-ent` command includes all 4 phases with checkpoints
441
+ - [ ] `feature-lifecycle-ent.md` rule includes decision matrix (/feature vs /feature-ent)
442
+ - [ ] `idea2prd-manual/` skill copied with ALL path rewrites applied (3 external skill paths)
443
+ - [ ] `goap-research-ed25519/` skill copied completely
444
+ - [ ] No duplicate skill copies (explore, problem-solver-enhanced already in P0)
445
+ - [ ] CLAUDE.md includes Enterprise Feature Lifecycle section
446
+
447
+ ### Conditional: Feature Suggestions Validation
448
+
449
+ - [ ] `feature-roadmap.json` is valid JSON with >= 5 features
450
+ - [ ] Feature statuses correctly assigned from MoSCoW priorities
451
+ - [ ] `feature-context.py` is valid Python, timeout <= 10 seconds
452
+ - [ ] `settings.json` merges SessionStart + Stop hooks correctly (no overwrite of P0 hooks)
453
+ - [ ] `feature-navigator/SKILL.md` includes priority rules and roadmap update logic
454
+ - [ ] `/next` command supports: default, update, and [feature-id] subcommands
455
+
456
+ ### Conditional: Automation Commands Validation
457
+
458
+ - [ ] `/go` includes complexity scoring matrix with correct thresholds
459
+ - [ ] `/go` checks for `/feature-ent` availability before selecting it
460
+ - [ ] `/go` includes fallback behavior when `/feature-ent` is not available
461
+ - [ ] `/run` supports both "mvp" and "all" scope modes
462
+ - [ ] `/run` includes error recovery (skip after 3 failures, always push)
463
+ - [ ] `/docs` generates 7 files per language with correct structure
464
+ - [ ] CLAUDE.md includes Automation Commands section
465
+ - [ ] DEVELOPMENT_GUIDE.md includes command hierarchy diagram
466
+
467
+ ### Context Budget Check
468
+
469
+ - [ ] Generated skills + agents total <= 5k tokens (target 3.5k)
470
+ - [ ] Commands + hooks total <= 2k tokens (target 1k)
471
+ - [ ] CLAUDE.md additions stay within 6k total limit
472
+
473
+ ## Dependencies
474
+
475
+ ### Template Files (read via view())
476
+
477
+ | Template | Used For |
478
+ |----------|----------|
479
+ | `references/templates/feature-lifecycle-ent.md` | Enterprise lifecycle: /feature-ent, rule, skill copy protocol |
480
+ | `references/templates/feature-suggestions.md` | Feature suggestions: /next, feature-navigator, roadmap.json, hooks |
481
+ | `references/templates/automation-commands.md` | Automation: /go, /run, /docs commands |
482
+ | `references/templates/ddd-agents.md` | DDD-enhanced agent templates: domain-expert, ddd-validator, architect, tdd-guide, code-reviewer |
483
+ | `references/templates/ddd-skills.md` | DDD-enhanced skill templates: aggregate-patterns, event-handlers, testing-patterns, project-context, coding-standards |
484
+ | `references/enhanced-recommendations.md` | Scoring engine for instrument selection and tier assignment |
485
+
486
+ ### Upstream Modules
487
+
488
+ | Module | Provides |
489
+ |--------|----------|
490
+ | `01-detect-parse.md` | IPM with project characteristics and detection flags |
491
+ | `02-analyze-map.md` | Instrument Map with scored items and tier assignments |
492
+ | `03-generate-p0.md` | P0 outputs (CLAUDE.md, settings.json, lifecycle skills) to extend |
493
+
494
+ ### Skill Dependencies (copy sources)
495
+
496
+ | Skill | Source Location | Condition |
497
+ |-------|----------------|-----------|
498
+ | idea2prd-manual/ | `.claude/skills/idea2prd-manual/` | IF has_ddd |
499
+ | goap-research-ed25519/ | `.claude/skills/goap-research-ed25519/` | IF has_ddd |
500
+
501
+ ## Reusability
502
+
503
+ ### Conditional Generation Pattern with Scoring Engine
504
+
505
+ The scoring-based conditional generation pattern used in this module is universal and can be
506
+ applied to any multi-file generation system where output should adapt to input characteristics:
507
+
508
+ 1. **Define detection flags** from input analysis (boolean characteristics)
509
+ 2. **Score each candidate output** using weighted rules tied to input signals
510
+ 3. **Assign tiers** based on score thresholds (mandatory/recommended/optional)
511
+ 4. **Conditionally generate** only items that meet their tier threshold
512
+ 5. **Apply path rewrites** when copying assets between contexts
513
+
514
+ This pattern avoids monolithic "generate everything" approaches while maintaining deterministic
515
+ output based on input quality. The scoring engine can be extracted and reused for:
516
+
517
+ - Plugin/extension generation systems
518
+ - Configuration scaffold generators
519
+ - Template-based project initializers
520
+ - Any system where output complexity should scale with input richness
521
+
522
+ ### Feature Suggestions as Reusable System
523
+
524
+ The feature-roadmap.json + SessionStart hook + /next command pattern is a self-contained
525
+ feature navigation system that can be extracted and used in any project with a backlog:
526
+
527
+ - JSON data file as single source of truth
528
+ - Hook injects context at session start (zero runtime cost)
529
+ - Command provides interactive navigation
530
+ - Skill enables on-demand deep inspection
531
+ - Auto-commit on session end preserves state
532
+
533
+ ### Automation Command Hierarchy
534
+
535
+ The /go -> /run orchestration pattern (simple command delegates to appropriate pipeline
536
+ based on analysis) is reusable for any multi-pipeline execution system where the correct
537
+ pipeline depends on runtime characteristics of the input.