@dzhechkov/p-replicator 1.0.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 (92) hide show
  1. package/README.md +314 -0
  2. package/bin/cli.js +4 -0
  3. package/package.json +62 -0
  4. package/src/cli.js +160 -0
  5. package/src/commands/doctor.js +151 -0
  6. package/src/commands/init.js +155 -0
  7. package/src/commands/list.js +133 -0
  8. package/src/commands/remove.js +111 -0
  9. package/src/commands/update.js +102 -0
  10. package/src/utils.js +280 -0
  11. package/templates/.claude/agents/doc-validator.md +92 -0
  12. package/templates/.claude/agents/harvest-coordinator.md +91 -0
  13. package/templates/.claude/agents/product-discoverer.md +57 -0
  14. package/templates/.claude/agents/replicate-coordinator.md +98 -0
  15. package/templates/.claude/commands/harvest.md +106 -0
  16. package/templates/.claude/commands/replicate.md +389 -0
  17. package/templates/.claude/rules/replicate-pipeline.md +92 -0
  18. package/templates/.claude/skills/brutal-honesty-review/README.md +218 -0
  19. package/templates/.claude/skills/brutal-honesty-review/SKILL.md +225 -0
  20. package/templates/.claude/skills/brutal-honesty-review/resources/assessment-rubrics.md +295 -0
  21. package/templates/.claude/skills/brutal-honesty-review/resources/review-template.md +102 -0
  22. package/templates/.claude/skills/brutal-honesty-review/scripts/assess-code.sh +179 -0
  23. package/templates/.claude/skills/brutal-honesty-review/scripts/assess-tests.sh +223 -0
  24. package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +374 -0
  25. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/claude-md-strategy.md +178 -0
  26. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/enhanced-recommendations.md +416 -0
  27. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/extended-mapping.md +370 -0
  28. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/automation-commands.md +733 -0
  29. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-agents.md +416 -0
  30. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-hooks-commands.md +524 -0
  31. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-skills.md +350 -0
  32. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/enhanced-claude-md.md +235 -0
  33. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle-ent.md +400 -0
  34. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle.md +325 -0
  35. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-suggestions.md +423 -0
  36. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/insights-system.md +349 -0
  37. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/mcp.md +274 -0
  38. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +283 -0
  39. package/templates/.claude/skills/explore/SKILL.md +215 -0
  40. package/templates/.claude/skills/explore/references/questioning-techniques.md +151 -0
  41. package/templates/.claude/skills/explore/references/task-brief-templates.md +355 -0
  42. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +415 -0
  43. package/templates/.claude/skills/goap-research-ed25519/references/ed25519-verification.md +658 -0
  44. package/templates/.claude/skills/goap-research-ed25519/references/research-actions.md +544 -0
  45. package/templates/.claude/skills/goap-research-ed25519/references/source-evaluation.md +560 -0
  46. package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +662 -0
  47. package/templates/.claude/skills/goap-research-ed25519/scripts/goap_planner.py +720 -0
  48. package/templates/.claude/skills/knowledge-extractor/SKILL.md +412 -0
  49. package/templates/.claude/skills/knowledge-extractor/examples/rate-limiting-extraction.md +259 -0
  50. package/templates/.claude/skills/knowledge-extractor/modules/01-agent-review.md +192 -0
  51. package/templates/.claude/skills/knowledge-extractor/modules/02-classify.md +122 -0
  52. package/templates/.claude/skills/knowledge-extractor/modules/03-decontextualize.md +156 -0
  53. package/templates/.claude/skills/knowledge-extractor/modules/04-integrate.md +178 -0
  54. package/templates/.claude/skills/knowledge-extractor/references/artifact-categories.md +342 -0
  55. package/templates/.claude/skills/knowledge-extractor/references/decontextualization-guide.md +247 -0
  56. package/templates/.claude/skills/knowledge-extractor/references/maturity-model.md +153 -0
  57. package/templates/.claude/skills/knowledge-extractor/templates/artifact-card.md +60 -0
  58. package/templates/.claude/skills/knowledge-extractor/templates/harvest-report.md +70 -0
  59. package/templates/.claude/skills/knowledge-extractor/templates/toolkit-harvest.md +38 -0
  60. package/templates/.claude/skills/pipeline-forge/SKILL.md +523 -0
  61. package/templates/.claude/skills/pipeline-forge/examples/replicate-analysis.md +291 -0
  62. package/templates/.claude/skills/pipeline-forge/references/patterns-catalog.md +408 -0
  63. package/templates/.claude/skills/pipeline-forge/references/quality-gates.md +268 -0
  64. package/templates/.claude/skills/pipeline-forge/references/skill-anatomy.md +292 -0
  65. package/templates/.claude/skills/pipeline-forge/templates/agent-template.md +60 -0
  66. package/templates/.claude/skills/pipeline-forge/templates/command-template.md +80 -0
  67. package/templates/.claude/skills/pipeline-forge/templates/pipeline-template.md +137 -0
  68. package/templates/.claude/skills/pipeline-forge/templates/skill-template.md +132 -0
  69. package/templates/.claude/skills/problem-solver-enhanced/SKILL.md +562 -0
  70. package/templates/.claude/skills/requirements-validator/SKILL.md +121 -0
  71. package/templates/.claude/skills/requirements-validator/assets/templates/bdd-feature-template.feature +69 -0
  72. package/templates/.claude/skills/requirements-validator/references/bdd-patterns.md +184 -0
  73. package/templates/.claude/skills/requirements-validator/references/invest-criteria.md +121 -0
  74. package/templates/.claude/skills/requirements-validator/references/scoring-system.md +134 -0
  75. package/templates/.claude/skills/requirements-validator/references/smart-criteria.md +130 -0
  76. package/templates/.claude/skills/reverse-engineering-unicorn/SKILL.md +194 -0
  77. package/templates/.claude/skills/reverse-engineering-unicorn/examples/noom-cjm-example.md +100 -0
  78. package/templates/.claude/skills/reverse-engineering-unicorn/examples/noom-module1-example.md +88 -0
  79. package/templates/.claude/skills/reverse-engineering-unicorn/modules/01-intelligence.md +328 -0
  80. package/templates/.claude/skills/reverse-engineering-unicorn/modules/02-product-customers.md +221 -0
  81. package/templates/.claude/skills/reverse-engineering-unicorn/modules/025-cjm-prototype.md +206 -0
  82. package/templates/.claude/skills/reverse-engineering-unicorn/modules/03-market-competition.md +402 -0
  83. package/templates/.claude/skills/reverse-engineering-unicorn/modules/04-business-finance.md +287 -0
  84. package/templates/.claude/skills/reverse-engineering-unicorn/modules/05-growth-engine.md +290 -0
  85. package/templates/.claude/skills/reverse-engineering-unicorn/modules/06-playbook-synthesis.md +286 -0
  86. package/templates/.claude/skills/reverse-engineering-unicorn/references/blue-ocean-canvas.md +39 -0
  87. package/templates/.claude/skills/reverse-engineering-unicorn/references/industry-benchmarks.md +67 -0
  88. package/templates/.claude/skills/reverse-engineering-unicorn/references/jtbd-canvas.md +48 -0
  89. package/templates/.claude/skills/sparc-prd-mini/SKILL.md +955 -0
  90. package/templates/.claude/skills/sparc-prd-mini/references/sparc-methodology.md +360 -0
  91. package/templates/.claude/skills/sparc-prd-mini/templates/CLAUDE.md +91 -0
  92. package/templates/.claude/skills/sparc-prd-mini/templates/prd.md +336 -0
@@ -0,0 +1,325 @@
1
+ # Feature Lifecycle Templates
2
+
3
+ Templates for generating the 4-phase feature development lifecycle system.
4
+
5
+ ---
6
+
7
+ ## 1. Skill Copying Protocol
8
+
9
+ When generating the toolkit, **copy these skills from the user's skill set** into `.claude/skills/`:
10
+
11
+ ```bash
12
+ # Source paths (Claude.ai user skills)
13
+ /mnt/skills/user/sparc-prd-mini/ → .claude/skills/sparc-prd-mini/
14
+ /mnt/skills/user/explore/ → .claude/skills/explore/
15
+ /mnt/skills/user/goap-research/ → .claude/skills/goap-research/
16
+ /mnt/skills/user/problem-solver-enhanced/ → .claude/skills/problem-solver-enhanced/
17
+ /mnt/skills/user/requirements-validator/ → .claude/skills/requirements-validator/
18
+ /mnt/skills/user/brutal-honesty-review/ → .claude/skills/brutal-honesty-review/
19
+ ```
20
+
21
+ Copy the **entire directory** for each skill (SKILL.md + references/ + scripts/ + templates/).
22
+
23
+ **⚠️ Path Rewrite Required for sparc-prd-mini:**
24
+ After copying, rewrite ALL `view()` paths in `sparc-prd-mini/SKILL.md`:
25
+
26
+ External skill paths (3):
27
+ ```
28
+ /mnt/skills/user/explore/SKILL.md → .claude/skills/explore/SKILL.md
29
+ /mnt/skills/user/goap-research/SKILL.md → .claude/skills/goap-research/SKILL.md
30
+ /mnt/skills/user/problem-solver-enhanced/SKILL.md → .claude/skills/problem-solver-enhanced/SKILL.md
31
+ ```
32
+
33
+ Internal template/reference paths (3):
34
+ ```
35
+ templates/prd.md → .claude/skills/sparc-prd-mini/templates/prd.md
36
+ references/sparc-methodology.md → .claude/skills/sparc-prd-mini/references/sparc-methodology.md
37
+ templates/CLAUDE.md → .claude/skills/sparc-prd-mini/templates/CLAUDE.md
38
+ ```
39
+
40
+ This ensures sparc-prd-mini correctly delegates to external skills AND finds its own templates in Claude Code environment.
41
+
42
+ Also update informational references in `sparc-prd-mini/SKILL.md` (not executable, but avoids confusion):
43
+ ```
44
+ Lines 31-33: External Dependencies table — update paths to .claude/skills/
45
+ Lines 951-953: Dependency Version Note — update paths to .claude/skills/
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 2. Command Template: `/feature`
51
+
52
+ Generate as `.claude/commands/feature.md`:
53
+
54
+ ```markdown
55
+ ---
56
+ description: Full feature lifecycle — from idea to reviewed implementation.
57
+ Orchestrates SPARC planning, validation, implementation, and review.
58
+ $ARGUMENTS: feature name or brief description
59
+ ---
60
+
61
+ # /feature $ARGUMENTS
62
+
63
+ ## Overview
64
+
65
+ Four-phase feature development lifecycle with quality gates between each phase.
66
+ All documentation goes to `docs/features/<feature-name>/sparc/`.
67
+
68
+ ## Phase 0: PRE-FLIGHT CHECK
69
+
70
+ Before starting, verify all required skills exist:
71
+
72
+ ```
73
+ Required skills in .claude/skills/:
74
+ ✅ sparc-prd-mini/SKILL.md — ABORT if missing (core orchestrator)
75
+ ⚠️ explore/SKILL.md — fallback: built-in Socratic questions (degraded)
76
+ ⚠️ goap-research/SKILL.md — fallback: direct web_search (degraded)
77
+ ⚠️ problem-solver-enhanced/SKILL.md — fallback: First Principles + SCQA only (degraded)
78
+ ✅ requirements-validator/SKILL.md — ABORT if missing (Phase 2 blocker)
79
+ ✅ brutal-honesty-review/SKILL.md — ABORT if missing (Phase 4 blocker)
80
+ ```
81
+
82
+ If any ✅ skill is missing → stop and inform user to re-run toolkit generator.
83
+ If any ⚠️ skill is missing → warn user about degraded quality, continue.
84
+
85
+ ## Phase 1: PLAN (sparc-prd-mini)
86
+
87
+ **Goal:** Research, analyze, and create full SPARC documentation for the feature.
88
+
89
+ ```
90
+ Read the sparc-prd-mini skill from .claude/skills/sparc-prd-mini/SKILL.md
91
+ ```
92
+
93
+ 1. Create feature directory: `docs/features/<feature-name>/sparc/`
94
+ 2. Run sparc-prd-mini Gate to assess task clarity (skip Explore if clear)
95
+ 3. Apply sparc-prd-mini MANUAL mode to the feature
96
+ 4. sparc-prd-mini delegates to external skills via view():
97
+ - explore → Socratic questioning → Product Brief
98
+ - goap-research → GOAP A* + OODA → Research Findings
99
+ - problem-solver-enhanced → 9 modules + TRIZ → Solution Strategy
100
+ 5. Output all SPARC documents into the feature directory:
101
+ - PRD.md, Solution_Strategy.md, Specification.md
102
+ - Pseudocode.md, Architecture.md, Refinement.md
103
+ - Completion.md, Research_Findings.md, Final_Summary.md
104
+ - Note: CLAUDE.md is NOT generated per-feature (project-level CLAUDE.md already exists)
105
+ 6. Git commit: `docs(feature): SPARC planning for <feature-name>`
106
+
107
+ **⏸️ Checkpoint:** Show SPARC summary, ask to proceed to validation.
108
+
109
+ ## Phase 2: VALIDATE (requirements-validator, swarm)
110
+
111
+ **Goal:** Validate SPARC documentation quality using swarm of validation agents.
112
+
113
+ ```
114
+ Read the requirements-validator skill from .claude/skills/requirements-validator/SKILL.md
115
+ ```
116
+
117
+ Use swarm of agents to validate:
118
+
119
+ | Agent | Scope | Target |
120
+ |-------|-------|--------|
121
+ | validator-stories | User Stories from Specification.md | INVEST criteria, score ≥70 |
122
+ | validator-acceptance | Acceptance Criteria | SMART criteria, testability |
123
+ | validator-architecture | Architecture.md | Consistency with project Architecture |
124
+ | validator-pseudocode | Pseudocode.md | Completeness, implementability |
125
+ | validator-coherence | All SPARC files | Cross-reference consistency |
126
+
127
+ **Iterative loop (max 3 iterations):**
128
+ 1. Run all validators in parallel (Task tool)
129
+ 2. Aggregate gaps and blocked items
130
+ 3. Fix gaps in SPARC documents
131
+ 4. Re-validate
132
+ 5. Repeat until: no BLOCKED items, average score ≥70
133
+
134
+ Save validation report: `docs/features/<feature-name>/sparc/validation-report.md`
135
+ Git commit: `docs(feature): validation complete for <feature-name>`
136
+
137
+ **⏸️ Checkpoint:** Show validation results, ask to proceed to implementation.
138
+
139
+ ## Phase 3: IMPLEMENT (swarm + parallel tasks)
140
+
141
+ **Goal:** Implement the feature using validated SPARC documents as source of truth.
142
+
143
+ When SPARC plan is ready for implementation:
144
+ 1. Read ALL documents from `docs/features/<feature-name>/sparc/`
145
+ 2. Use swarm of agents and specialized skills to deliver:
146
+ - `@planner` — break down into tasks from Pseudocode.md
147
+ - `@architect` — ensure consistency with Architecture.md
148
+ - Implementation agents — parallel Task tool for independent modules
149
+ 3. **Make implementation modular** for reuse in other cases and applications
150
+ 4. Save frequent commits to GitHub
151
+ 5. Spawn concurrent tasks to speed up development
152
+
153
+ **Implementation rules:**
154
+ - Each module gets its own Task for parallel execution
155
+ - Reference SPARC docs, don't hallucinate code
156
+ - Commit after each logical unit: `feat(<feature-name>): <what>`
157
+ - Run tests in parallel with implementation
158
+
159
+ **⏸️ Checkpoint:** Show implementation summary, ask to proceed to review.
160
+
161
+ ## Phase 4: REVIEW (brutal-honesty-review, swarm)
162
+
163
+ **Goal:** Rigorous post-implementation review and improvement.
164
+
165
+ ```
166
+ Read the brutal-honesty-review skill from .claude/skills/brutal-honesty-review/SKILL.md
167
+ ```
168
+
169
+ Use swarm of agents for review:
170
+
171
+ | Agent | Scope | Focus |
172
+ |-------|-------|-------|
173
+ | code-quality | Source code | Clean code, patterns, naming |
174
+ | architecture | Integration | Consistency with project architecture |
175
+ | security | Security surface | Vulnerabilities, input validation |
176
+ | performance | Hot paths | Bottlenecks, complexity |
177
+ | testing | Test coverage | Edge cases, missing tests |
178
+
179
+ Process:
180
+ 1. Run brutal-honesty-review on implementation
181
+ 2. Fix identified issues (use Task tool for parallel fixes)
182
+ 3. Save frequent commits: `fix(<feature-name>): <what>`
183
+ 4. Benchmark after implementation
184
+ 5. Re-review critical findings until clean
185
+
186
+ Save review report: `docs/features/<feature-name>/review-report.md`
187
+ Git commit: `docs(feature): review complete for <feature-name>`
188
+
189
+ ## Completion
190
+
191
+ After all 4 phases:
192
+ ```
193
+ ✅ Feature: <feature-name>
194
+
195
+ 📁 docs/features/<feature-name>/
196
+ ├── sparc/ # SPARC documentation
197
+ │ ├── PRD.md
198
+ │ ├── Specification.md
199
+ │ ├── Architecture.md
200
+ │ ├── Pseudocode.md
201
+ │ ├── ...
202
+ │ └── validation-report.md
203
+ └── review-report.md # Brutal honesty review
204
+
205
+ 📊 Validation: score XX/100
206
+ 🔍 Review: X issues found → X fixed
207
+ 💾 Commits: N commits
208
+
209
+ 💡 Consider running /myinsights if you encountered any tricky issues.
210
+ ```
211
+ ```
212
+
213
+ ---
214
+
215
+ ## 3. Rule Template: `feature-lifecycle.md`
216
+
217
+ Generate as `.claude/rules/feature-lifecycle.md`:
218
+
219
+ ```markdown
220
+ # Feature Development Lifecycle
221
+
222
+ ## Protocol
223
+
224
+ Every new feature MUST follow the 4-phase lifecycle:
225
+
226
+ ```
227
+ /feature [name]
228
+ Phase 1: PLAN → sparc-prd-mini → docs/features/<n>/sparc/
229
+ Phase 2: VALIDATE → requirements-validator (swarm, max 3 iterations)
230
+ Phase 3: IMPLEMENT → swarm of agents + parallel tasks
231
+ Phase 4: REVIEW → brutal-honesty-review (swarm)
232
+ ```
233
+
234
+ ## Rules
235
+
236
+ ### Planning (Phase 1)
237
+ - ALL features get SPARC documentation, no exceptions
238
+ - Documentation lives in `docs/features/<feature-name>/sparc/`
239
+ - sparc-prd-mini runs Gate to assess task clarity before starting
240
+ - Use sparc-prd-mini in MANUAL mode for complex features, AUTO for minor
241
+ - sparc-prd-mini delegates to explore, goap-research, problem-solver-enhanced via view()
242
+ - Architecture.md MUST be consistent with project's root Architecture
243
+ - Commit docs before implementation
244
+
245
+ ### Validation (Phase 2)
246
+ - Run requirements-validator as swarm (parallel validation agents)
247
+ - Minimum score: 70/100 average, no BLOCKED items
248
+ - Fix gaps in docs, not in code
249
+ - Max 3 iterations — if not passing, escalate to user
250
+ - Commit validation-report.md
251
+
252
+ ### Implementation (Phase 3)
253
+ - Read SPARC docs — don't hallucinate code
254
+ - Modular design — components reusable across projects
255
+ - Use Task tool for parallel work on independent modules
256
+ - Commit after each logical change (not at end)
257
+ - Run tests in parallel with development
258
+ - Format: `feat(<feature-name>): <description>`
259
+
260
+ ### Review (Phase 4)
261
+ - Use brutal-honesty-review with swarm of agents
262
+ - No sugar-coating — find real problems
263
+ - Fix all critical and major issues before marking complete
264
+ - Benchmark performance after implementation
265
+ - Commit review-report.md
266
+
267
+ ## Feature Directory Structure
268
+
269
+ ```
270
+ docs/features/
271
+ ├── user-authentication/
272
+ │ ├── sparc/
273
+ │ │ ├── PRD.md
274
+ │ │ ├── Specification.md
275
+ │ │ ├── Architecture.md
276
+ │ │ ├── Pseudocode.md
277
+ │ │ ├── Solution_Strategy.md
278
+ │ │ ├── Refinement.md
279
+ │ │ ├── Completion.md
280
+ │ │ ├── Research_Findings.md
281
+ │ │ ├── Final_Summary.md
282
+ │ │ └── validation-report.md
283
+ │ └── review-report.md
284
+ ├── payment-integration/
285
+ │ ├── sparc/
286
+ │ │ └── ...
287
+ │ └── review-report.md
288
+ └── ...
289
+ ```
290
+
291
+ ## When to Skip Phases
292
+
293
+ | Scenario | Skip | Justification |
294
+ |----------|------|---------------|
295
+ | Hotfix (1-5 lines) | Phase 1-2 | Too small for full SPARC |
296
+ | Config change | Phase 1-2 | No new functionality |
297
+ | Dependency update | Phase 1-2 | No new design needed |
298
+ | Refactoring | Phase 1 only | Validate + implement + review |
299
+ | New feature | NEVER skip | Full lifecycle always |
300
+
301
+ For skipped phases, still run Phase 4 (brutal-honesty-review) on the changes.
302
+ ```
303
+
304
+ ---
305
+
306
+ ## 4. CLAUDE.md Integration
307
+
308
+ Add to CLAUDE.md generation:
309
+
310
+ ```markdown
311
+ ## 🔄 Feature Development Lifecycle
312
+ New features use the 4-phase lifecycle: `/feature [name]`
313
+ 1. **PLAN** — sparc-prd-mini (with Gate + external skills) → `docs/features/<n>/sparc/`
314
+ 2. **VALIDATE** — requirements-validator swarm → score ≥70
315
+ 3. **IMPLEMENT** — parallel agents from validated docs
316
+ 4. **REVIEW** — brutal-honesty-review swarm → fix all criticals
317
+
318
+ Available lifecycle skills in `.claude/skills/`:
319
+ - `sparc-prd-mini` (orchestrator, delegates to explore, goap-research, problem-solver-enhanced)
320
+ - `explore` (Socratic questioning → Product Brief)
321
+ - `goap-research` (GOAP A* + OODA → Research Findings)
322
+ - `problem-solver-enhanced` (9 modules + TRIZ → Solution Strategy)
323
+ - `requirements-validator`
324
+ - `brutal-honesty-review`
325
+ ```