@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,223 @@
1
+ #!/bin/bash
2
+ # Brutal Honesty Test Assessment Script (Ramsay Mode)
3
+
4
+ set -e
5
+
6
+ # Colors
7
+ RED='\033[0;31m'
8
+ YELLOW='\033[1;33m'
9
+ GREEN='\033[0;32m'
10
+ NC='\033[0m' # No Color
11
+
12
+ echo "👨‍🍳 BRUTAL HONESTY TEST ASSESSMENT (Ramsay Mode)"
13
+ echo "=================================================="
14
+ echo ""
15
+
16
+ # Check if test directory argument provided
17
+ if [ -z "$1" ]; then
18
+ echo "Usage: $0 <test-directory>"
19
+ exit 1
20
+ fi
21
+
22
+ TEST_DIR="$1"
23
+
24
+ # Check if test directory exists
25
+ if [ ! -d "$TEST_DIR" ]; then
26
+ echo -e "${RED}🔴 FAILING: Test directory '$TEST_DIR' doesn't exist${NC}"
27
+ echo " → Where are the tests? Did you even write any?"
28
+ exit 1
29
+ fi
30
+
31
+ # Function to assess coverage
32
+ assess_coverage() {
33
+ echo "📊 COVERAGE CHECK"
34
+ echo "----------------"
35
+
36
+ # Run coverage if npm test with coverage exists
37
+ if [ -f "package.json" ] && grep -q "test:coverage" package.json; then
38
+ echo "Running coverage analysis..."
39
+ npm run test:coverage 2>/dev/null || true
40
+
41
+ # Extract coverage percentage
42
+ coverage=$(npm run test:coverage 2>&1 | grep -oP '\d+\.\d+(?=%)' | head -1 || echo "0")
43
+
44
+ if (( $(echo "$coverage < 50" | bc -l) )); then
45
+ echo -e "${RED}🔴 RAW: ${coverage}% coverage${NC}"
46
+ echo " → This is embarrassing. You're barely testing anything."
47
+ elif (( $(echo "$coverage < 80" | bc -l) )); then
48
+ echo -e "${YELLOW}🟡 ACCEPTABLE: ${coverage}% coverage${NC}"
49
+ echo " → Minimum is 80%. You're not there yet."
50
+ else
51
+ echo -e "${GREEN}🟢 MICHELIN STAR: ${coverage}% coverage${NC}"
52
+ fi
53
+ else
54
+ echo -e "${YELLOW}⚠️ No coverage command found${NC}"
55
+ echo " → Add 'test:coverage' script to package.json"
56
+ fi
57
+ }
58
+
59
+ # Function to assess edge cases
60
+ assess_edge_cases() {
61
+ echo ""
62
+ echo "🎯 EDGE CASE CHECK"
63
+ echo "-----------------"
64
+
65
+ # Check for common edge case patterns
66
+ edge_case_patterns=(
67
+ "null"
68
+ "undefined"
69
+ "empty"
70
+ "zero"
71
+ "negative"
72
+ "max"
73
+ "min"
74
+ "overflow"
75
+ "boundary"
76
+ )
77
+
78
+ found_count=0
79
+ for pattern in "${edge_case_patterns[@]}"; do
80
+ if grep -ri "$pattern" "$TEST_DIR" > /dev/null 2>&1; then
81
+ ((found_count++))
82
+ fi
83
+ done
84
+
85
+ if [ "$found_count" -eq 0 ]; then
86
+ echo -e "${RED}🔴 RAW: No edge cases tested${NC}"
87
+ echo " → You're only testing the happy path. That's not testing."
88
+ elif [ "$found_count" -lt 3 ]; then
89
+ echo -e "${YELLOW}🟡 ACCEPTABLE: Found $found_count edge case patterns${NC}"
90
+ echo " → Test more: null, empty, boundaries, overflow"
91
+ else
92
+ echo -e "${GREEN}🟢 MICHELIN STAR: Found $found_count edge case patterns${NC}"
93
+ fi
94
+ }
95
+
96
+ # Function to assess test clarity
97
+ assess_clarity() {
98
+ echo ""
99
+ echo "📖 CLARITY CHECK"
100
+ echo "---------------"
101
+
102
+ # Check for descriptive test names
103
+ unclear_tests=$(grep -r "test('test" "$TEST_DIR" 2>/dev/null | wc -l)
104
+ if [ "$unclear_tests" -gt 0 ]; then
105
+ echo -e "${RED}🔴 RAW: Found $unclear_tests unclear test names${NC}"
106
+ echo " → 'test1', 'test2' - What are you testing? Use descriptive names."
107
+ fi
108
+
109
+ # Check for describe/it blocks
110
+ if grep -r "describe\|it\|test" "$TEST_DIR" > /dev/null 2>&1; then
111
+ echo -e "${GREEN}✓ Tests have structure${NC}"
112
+ else
113
+ echo -e "${YELLOW}⚠️ No test framework patterns detected${NC}"
114
+ fi
115
+ }
116
+
117
+ # Function to assess test speed
118
+ assess_speed() {
119
+ echo ""
120
+ echo "⚡ SPEED CHECK"
121
+ echo "-------------"
122
+
123
+ echo "Running tests..."
124
+ start_time=$(date +%s)
125
+
126
+ # Run tests (suppress output)
127
+ if npm test > /dev/null 2>&1; then
128
+ end_time=$(date +%s)
129
+ duration=$((end_time - start_time))
130
+
131
+ if [ "$duration" -gt 60 ]; then
132
+ echo -e "${RED}🔴 RAW: Tests took ${duration}s${NC}"
133
+ echo " → Unit tests should run in seconds, not minutes."
134
+ echo " → Are you calling real databases/networks?"
135
+ elif [ "$duration" -gt 10 ]; then
136
+ echo -e "${YELLOW}🟡 ACCEPTABLE: Tests took ${duration}s${NC}"
137
+ echo " → Aim for <10s. Use mocks and in-memory operations."
138
+ else
139
+ echo -e "${GREEN}🟢 MICHELIN STAR: Tests took ${duration}s${NC}"
140
+ fi
141
+ else
142
+ echo -e "${RED}🔴 FAILING: Tests don't even pass${NC}"
143
+ echo " → Fix your broken tests before worrying about speed."
144
+ fi
145
+ }
146
+
147
+ # Function to assess stability
148
+ assess_stability() {
149
+ echo ""
150
+ echo "🎲 STABILITY CHECK"
151
+ echo "-----------------"
152
+
153
+ # Check for flaky patterns
154
+ if grep -ri "setTimeout\|sleep\|wait" "$TEST_DIR" > /dev/null 2>&1; then
155
+ echo -e "${RED}🔴 RAW: Timing-based tests detected${NC}"
156
+ echo " → You're creating flaky tests. Use proper async/await."
157
+ fi
158
+
159
+ # Run tests multiple times to detect flakes
160
+ echo "Running tests 3x to detect flakes..."
161
+ failures=0
162
+ for i in {1..3}; do
163
+ if ! npm test > /dev/null 2>&1; then
164
+ ((failures++))
165
+ fi
166
+ done
167
+
168
+ if [ "$failures" -gt 0 ]; then
169
+ echo -e "${RED}🔴 RAW: Tests failed $failures/3 times${NC}"
170
+ echo " → FLAKY TESTS. These are worse than no tests."
171
+ echo " → Fix the non-determinism before merging."
172
+ else
173
+ echo -e "${GREEN}🟢 MICHELIN STAR: Tests are stable${NC}"
174
+ fi
175
+ }
176
+
177
+ # Function to assess isolation
178
+ assess_isolation() {
179
+ echo ""
180
+ echo "🏝️ ISOLATION CHECK"
181
+ echo "------------------"
182
+
183
+ # Check for shared state patterns
184
+ if grep -ri "global\|beforeAll\|shared" "$TEST_DIR" > /dev/null 2>&1; then
185
+ echo -e "${YELLOW}🟡 WARNING: Shared state patterns detected${NC}"
186
+ echo " → Are your tests independent? Can they run in any order?"
187
+ fi
188
+
189
+ # Check for test order dependencies
190
+ if grep -r "\.only\|\.skip" "$TEST_DIR" > /dev/null 2>&1; then
191
+ echo -e "${YELLOW}🟡 WARNING: .only or .skip found${NC}"
192
+ echo " → Don't commit tests with .only or .skip"
193
+ fi
194
+
195
+ echo -e "${GREEN}✓ Review test isolation manually${NC}"
196
+ }
197
+
198
+ # Run all assessments
199
+ assess_coverage
200
+ assess_edge_cases
201
+ assess_clarity
202
+ assess_speed
203
+ assess_stability
204
+ assess_isolation
205
+
206
+ # Final verdict
207
+ echo ""
208
+ echo "=================================================="
209
+ echo "🎯 FINAL VERDICT"
210
+ echo "=================================================="
211
+ echo ""
212
+ echo "Look at the results above. If you see multiple 🔴 RAW marks,"
213
+ echo "these tests are NOT production-ready."
214
+ echo ""
215
+ echo "Expected standards:"
216
+ echo " - 80%+ branch coverage"
217
+ echo " - Edge cases tested (null, empty, boundaries)"
218
+ echo " - Clear test names"
219
+ echo " - <10s to run"
220
+ echo " - 0% flaky"
221
+ echo " - Independent tests"
222
+ echo ""
223
+ echo "You know what good tests look like. Why aren't you writing them?"
@@ -0,0 +1,374 @@
1
+ ---
2
+ name: cc-toolkit-generator-enhanced
3
+ description: >
4
+ Generate complete Claude Code toolkit from idea2prd-manual or SPARC documentation.
5
+ Supports: PRD, SPARC, DDD, ADR, C4, Pseudocode, Gherkin, Fitness Functions.
6
+ Creates CLAUDE.md, agents, skills, commands, hooks, rules, MCP configs.
7
+ Feature lifecycle: /feature + sparc-prd-mini + requirements-validator + brutal-honesty-review.
8
+ Enterprise lifecycle: /feature-ent + idea2prd-manual (conditional P1).
9
+ Feature suggestions: /next + feature-navigator skill + SessionStart hook.
10
+ Insights: /myinsights + index/detail architecture. Plans: /plan with auto-commit.
11
+ Automation: /go (smart pipeline), /run (autonomous build loop), /docs (bilingual RU/EN docs).
12
+ Triggers: "cc-toolkit-enhanced", "generate toolkit from docs", "создай инструменты из документации".
13
+ Three modes: AUTO, HYBRID (default), MANUAL.
14
+ ---
15
+
16
+ # CC-Toolkit-Generator Enhanced
17
+
18
+ Generate production-ready Claude Code instruments from **SPARC or idea2prd-manual documentation**.
19
+
20
+ ## Input Documents
21
+
22
+ ### SPARC Pipeline
23
+
24
+ | Document | Maps To |
25
+ |----------|---------|
26
+ | **PRD.md** | CLAUDE.md overview, /plan command, feature context |
27
+ | **Solution_Strategy.md** | CLAUDE.md problem context, architect agent |
28
+ | **Specification.md** | coding-standards/ skill, security.md rule, /test command |
29
+ | **Pseudocode.md** | planner agent templates, /start Phase 2 references |
30
+ | **Architecture.md** | CLAUDE.md tech stack, /start structure, architect agent, MCP |
31
+ | **Refinement.md** | testing.md rule, code-reviewer agent, /test command |
32
+ | **Completion.md** | /deploy command, /start Phase 3, CI/CD hooks |
33
+ | **Research_Findings.md** | project-context/ skill, domain knowledge |
34
+ | **Final_Summary.md** | CLAUDE.md quick reference, DEVELOPMENT_GUIDE.md |
35
+ | **CLAUDE.md** (from docs) | Base for enhanced CLAUDE.md |
36
+
37
+ ### idea2prd-manual Pipeline
38
+
39
+ | Category | Documents | Maps To |
40
+ |----------|-----------|---------|
41
+ | **Analyst** | Task_Brief, Research_Findings, Product_Idea | CLAUDE.md context, project-context skill |
42
+ | **PRD** | PRD.md | CLAUDE.md overview, commands |
43
+ | **DDD Strategic** | bounded-contexts/, context-map | domain-model skill, architect agent |
44
+ | **DDD Tactical** | aggregates/, entities/, events/ | coding-standards skill, validation hooks |
45
+ | **ADR** | adr/*.md | CLAUDE.md decisions, rules |
46
+ | **C4** | c4/*.mermaid | architect agent, CLAUDE.md diagrams |
47
+ | **Pseudocode** | pseudocode/*.pseudo | planner agent, tdd-guide agent |
48
+ | **Tests** | tests/*.feature (Gherkin) | /test command, testing rules |
49
+ | **Fitness** | fitness/*.md | hooks (quality gates), rules |
50
+ | **Completion** | COMPLETION_CHECKLIST.md | /deploy command, CI/CD hooks |
51
+ | **.ai-context/** | 8 context files | Direct CLAUDE.md integration |
52
+
53
+ ## Mode Selection
54
+
55
+ | Mode | Triggers | Checkpoints | Time |
56
+ |------|----------|-------------|------|
57
+ | **AUTO** | "auto", "быстро" | 0 | ~5 min |
58
+ | **HYBRID** | default, "smart" | 2 | ~10 min |
59
+ | **MANUAL** | "manual", "пошагово" | 6 | ~20 min |
60
+
61
+ ## Workflow
62
+
63
+ ### Phase 1: Detect & Parse
64
+
65
+ 1. Scan `/mnt/user-data/uploads/` for documents
66
+ - If no documents found: ask user to upload SPARC or idea2prd documentation set
67
+ - Minimum required: at least PRD.md + Architecture.md (SPARC) or docs/ddd/ (idea2prd)
68
+ 2. Detect source pipeline:
69
+ - Has `docs/ddd/` → idea2prd-manual
70
+ - Has `Architecture.md` + `Solution_Strategy.md` → SPARC
71
+ - Has `Architecture.md` only → SPARC minimal
72
+ - Mixed → Use unified mapping
73
+ 3. Detect project characteristics:
74
+ - **has_external_apis** — scan for API integrations
75
+ - **has_database** — scan for DB services
76
+ - **monorepo_packages** — extract from project structure
77
+ - **docker_services** — extract from docker-compose
78
+ 4. Build Internal Project Model (IPM)
79
+
80
+ **MANUAL Checkpoint 1:** Document Detection Review
81
+
82
+ ### Phase 2: Analyze & Map
83
+
84
+ **SPARC Pipeline:** See [SPARC Mapping](#sparc-document-mapping) below.
85
+ **idea2prd Pipeline:** See `references/extended-mapping.md` for complete DDD/ADR/Gherkin/Fitness mappings.
86
+
87
+ **MANUAL Checkpoint 2:** Mapping Approval
88
+
89
+ ### Phase 3: Generate P0 (Mandatory)
90
+
91
+ Always generate these items:
92
+
93
+ | # | Instrument | Template Source |
94
+ |---|-----------|----------------|
95
+ | 1 | **CLAUDE.md** | `references/claude-md-strategy.md` — pipeline-specific strategy |
96
+ | 2 | **security.md** rule | From Specification NFRs or ADRs + Fitness Functions |
97
+ | 3 | **coding-style.md** rule | From Architecture tech stack or DDD Tactical + ADRs |
98
+ | 4 | **commands/start.md** | `references/templates/start-command.md` |
99
+ | 5 | **commands/myinsights.md** | `references/templates/insights-system.md` |
100
+ | 6 | **commands/feature.md** | `references/templates/feature-lifecycle.md` |
101
+ | 7 | **rules/git-workflow.md** | Semantic commit conventions |
102
+ | 8 | **rules/insights-capture.md** | `references/templates/insights-system.md` |
103
+ | 9 | **rules/feature-lifecycle.md** | `references/templates/feature-lifecycle.md` |
104
+ | 10 | **settings.json** hooks | insights + plans auto-commit, SessionStart |
105
+ | 11-16 | **6 lifecycle skills** | `references/templates/feature-lifecycle.md` — copy protocol + path rewrite |
106
+
107
+ **Conditional P0:**
108
+ - **rules/secrets-management.md** + **skills/security-patterns/** — IF has_external_apis
109
+ - **rules/domain-model.md** — IF has DDD Strategic docs
110
+
111
+ **MANUAL Checkpoint 3:** P0 Review
112
+
113
+ ### Phase 4: Generate P1 (Recommended)
114
+
115
+ | Instrument | Source (SPARC) | Source (idea2prd) |
116
+ |------------|----------------|-------------------|
117
+ | planner.md agent | Pseudocode, PRD | Pseudocode, PRD |
118
+ | code-reviewer.md agent | Refinement, Specification | Fitness, ADR |
119
+ | architect.md agent | Architecture, Solution_Strategy | C4, ADR, DDD Strategic |
120
+ | project-context/ skill | Research_Findings, Final_Summary | Research, .ai-context |
121
+ | coding-standards/ skill | Architecture (tech stack) | DDD Tactical, ADR |
122
+ | testing-patterns/ skill | Refinement (test strategy) | Gherkin, Fitness |
123
+ | /plan command | PRD, Pseudocode | PRD, Pseudocode |
124
+ | /test command | Refinement, Specification | Gherkin |
125
+ | /deploy command | Completion | Completion Checklist |
126
+ | testing.md rule | Refinement | Fitness Functions |
127
+
128
+ **Enterprise Lifecycle (IF DDD detected) — see `references/templates/feature-lifecycle-ent.md`:**
129
+ - /feature-ent command, feature-lifecycle-ent.md rule
130
+ - Copy skills: idea2prd-manual/, goap-research-ed25519/
131
+
132
+ **Feature Suggestions System — see `references/templates/feature-suggestions.md`:**
133
+ - /next command, feature-navigator/ skill, feature-roadmap.json, SessionStart hook
134
+
135
+ **Automation Commands — see `references/templates/automation-commands.md`:**
136
+ - /go (smart pipeline), /run (autonomous build loop), /docs (bilingual RU/EN)
137
+
138
+ **MANUAL Checkpoint 4:** P1 Selection
139
+
140
+ ### Phase 5: Generate P2-P3 (Optional)
141
+
142
+ **P2:** tdd-guide.md agent, settings.json hooks, /review command
143
+ **P2 DDD-only:** ddd-validator.md agent, aggregate-patterns/ skill, event-handlers/ skill, /validate-ddd
144
+ **P3:** .mcp.json (see `references/templates/mcp.md`), Coolify MCP, Docker MCP
145
+
146
+ **MANUAL Checkpoint 5:** P2-P3 Selection
147
+
148
+ ### Phase 6: Package & Deliver
149
+
150
+ Create output archive per [Output Structure](#output-structure).
151
+ Run the [Master Validation Checklist](#master-validation-checklist) before delivery.
152
+
153
+ **MANUAL Checkpoint 6:** Final Review
154
+
155
+ ## Output Structure
156
+
157
+ ```
158
+ [project-name]-cc-toolkit/
159
+ ├── CLAUDE.md
160
+ ├── DEVELOPMENT_GUIDE.md
161
+ ├── .claude/
162
+ │ ├── settings.json # Hooks: insights + roadmap + plans, SessionStart
163
+ │ ├── feature-roadmap.json # Feature status (from PRD)
164
+ │ ├── hooks/feature-context.py # SessionStart: inject feature context
165
+ │ ├── agents/
166
+ │ │ ├── planner.md, code-reviewer.md, architect.md
167
+ │ │ ├── tdd-guide.md # P2
168
+ │ │ ├── domain-expert.md # {{IF_DDD}}
169
+ │ │ └── ddd-validator.md # {{IF_DDD}} P2
170
+ │ ├── skills/
171
+ │ │ ├── sparc-prd-mini/ # ⭐ P0 — feature planning orchestrator
172
+ │ │ ├── explore/ # ⭐ P0 — Socratic questioning
173
+ │ │ ├── goap-research/ # ⭐ P0 — GOAP research
174
+ │ │ ├── problem-solver-enhanced/ # ⭐ P0 — 9 modules + TRIZ
175
+ │ │ ├── requirements-validator/ # ⭐ P0 — doc validation
176
+ │ │ ├── brutal-honesty-review/ # ⭐ P0 — post-impl review
177
+ │ │ ├── idea2prd-manual/ # {{IF_DDD}} P1
178
+ │ │ ├── goap-research-ed25519/ # {{IF_DDD}} P1
179
+ │ │ ├── feature-navigator/ # P1 — roadmap navigation
180
+ │ │ ├── project-context/, coding-standards/, testing-patterns/
181
+ │ │ ├── security-patterns/ # {{IF_EXTERNAL_APIS}}
182
+ │ │ ├── aggregate-patterns/ # {{IF_DDD}} P2
183
+ │ │ └── event-handlers/ # {{IF_DDD}} P2
184
+ │ ├── commands/
185
+ │ │ ├── start.md # ⭐ P0 — full project bootstrap
186
+ │ │ ├── myinsights.md # ⭐ P0 — insight capture
187
+ │ │ ├── feature.md # ⭐ P0 — feature lifecycle
188
+ │ │ ├── feature-ent.md # {{IF_DDD}} P1
189
+ │ │ ├── next.md, plan.md # P1
190
+ │ │ ├── go.md, run.md, docs.md # P1 — automation
191
+ │ │ ├── test.md, deploy.md, review.md
192
+ │ │ └── validate-ddd.md # {{IF_DDD}} P2
193
+ │ └── rules/
194
+ │ ├── security.md, coding-style.md, testing.md
195
+ │ ├── git-workflow.md # ⭐ P0
196
+ │ ├── insights-capture.md # ⭐ P0
197
+ │ ├── feature-lifecycle.md # ⭐ P0
198
+ │ ├── feature-lifecycle-ent.md # {{IF_DDD}} P1
199
+ │ ├── secrets-management.md # {{IF_EXTERNAL_APIS}}
200
+ │ ├── domain-model.md # {{IF_DDD}}
201
+ │ └── fitness-functions.md # {{IF_DDD}}
202
+ ├── docs/features/, docs/plans/
203
+ ├── README/ # Bilingual (RU/EN), created by /docs
204
+ ├── .mcp.json # {{IF_EXTERNAL_INTEGRATIONS}}
205
+ └── INSTALL.md
206
+ ```
207
+
208
+ **Markers:** `{{IF_DDD}}` = DDD docs detected; `{{IF_EXTERNAL_APIS}}` = external APIs; `{{IF_EXTERNAL_INTEGRATIONS}}` = external MCP.
209
+
210
+ ## SPARC Document Mapping
211
+
212
+ > Primary pipeline. Apply when `docs/ddd/` is NOT present.
213
+
214
+ | SPARC Document | Section | Primary Output | Secondary Output |
215
+ |----------------|---------|----------------|------------------|
216
+ | **PRD.md** | Executive Summary | CLAUDE.md Overview | — |
217
+ | PRD.md | Problem Statement | CLAUDE.md Problem Context | architect.md |
218
+ | PRD.md | Functional Requirements | /plan features | /start Phase 2 scope |
219
+ | PRD.md | NFRs | security.md, testing.md | rules |
220
+ | PRD.md | User Stories | /test templates | testing-patterns/ |
221
+ | **Solution_Strategy.md** | Root Cause / Framework | project-context/, architect.md | CLAUDE.md |
222
+ | **Specification.md** | Data Model / API / Security | /start Phase 2, security.md | coding-standards/ |
223
+ | **Pseudocode.md** | Algorithms / Error Handling | planner.md, code-reviewer.md | /start refs |
224
+ | **Architecture.md** | Structure / Stack / Docker / APIs | CLAUDE.md, /start, .mcp.json | coding-style.md |
225
+ | **Refinement.md** | Edge Cases / Testing / Security | code-reviewer.md, testing.md, /test | tdd-guide.md |
226
+ | **Completion.md** | CI/CD / Docker / Monitoring | /deploy, /start Phase 3 | hooks |
227
+ | **Research_Findings.md** | Tech Decisions / Best Practices | architect.md, coding-standards/ | CLAUDE.md |
228
+ | **Final_Summary.md** | Quick Reference | CLAUDE.md | DEVELOPMENT_GUIDE.md |
229
+
230
+ ### Extraction Patterns
231
+
232
+ ```
233
+ EXTRACT PRD.md: name → title, problem → context, requirements → features, NFRs → rules
234
+ EXTRACT Architecture: structure → /start P1, packages → /start P2, docker → /start P3,
235
+ stack → CLAUDE.md, APIs → security-patterns, DB → migration
236
+ EXTRACT Pseudocode: functions → planner templates, algorithms → /start P2 refs,
237
+ errors → code-reviewer
238
+ ```
239
+
240
+ ## Smart Recommendations
241
+
242
+ ```
243
+ # SPARC Core
244
+ Architecture.md → architect.md (+10), /start (+10)
245
+ Pseudocode.md → planner.md (+10), BOOST /start P2
246
+ Refinement.md → testing.md (+8), code-reviewer.md (+8), /test (+8)
247
+ Solution_Strategy → project-context/ (+8), BOOST architect (+3)
248
+ Completion.md → /deploy (+8), BOOST /start P3
249
+
250
+ # Detection-based
251
+ "API"|"integration"|"external" → security-patterns/ (+10), secrets-management.md (+10)
252
+ "PostgreSQL"|"MongoDB"|"database" → BOOST /start P3 with migration
253
+ "Coolify" → coolify MCP (+8); "Docker" → docker MCP (+5)
254
+
255
+ # DDD-Specific
256
+ docs/ddd/strategic/ → domain-expert.md (+10)
257
+ docs/ddd/tactical/aggregates → ddd-validator.md (+10), /validate-ddd (+8)
258
+ docs/ddd/tactical/events/ → event-handlers/ (+8)
259
+ docs/adr/ (>10 files) → architect.md (+10)
260
+ docs/tests/*.feature → testing-patterns/ (+10), tdd-guide.md (+8)
261
+ docs/fitness/ → fitness-functions.md (+10)
262
+ .ai-context/ → INTEGRATE into CLAUDE.md, project-context/ (+10)
263
+ ```
264
+
265
+ See `references/enhanced-recommendations.md` for detailed scoring.
266
+
267
+ ## CLAUDE.md Generation
268
+
269
+ **Read `references/claude-md-strategy.md`** for complete generation strategy.
270
+
271
+ Two pipeline-specific strategies with shared base sections:
272
+ - **SPARC** → emphasis on Problem & Solution, Key Algorithms
273
+ - **idea2prd** → emphasis on Domain Model, Key Decisions, Quality Gates
274
+
275
+ Both include: Parallel Execution Strategy, Swarm Agents, Git Workflow, Available Agents/Skills/Commands, Development Insights, Feature Lifecycle, Feature Roadmap, Plans, Automation Commands.
276
+
277
+ ## Key Systems (read templates before generating)
278
+
279
+ | System | Template File | Key Components |
280
+ |--------|--------------|----------------|
281
+ | **/start** | `templates/start-command.md` | 4-phase bootstrap, parallel Tasks, anti-hallucination |
282
+ | **Insights** | `templates/insights-system.md` | /myinsights, insights-capture rule, Stop hook, index+detail |
283
+ | **Feature Lifecycle** | `templates/feature-lifecycle.md` | /feature (4 phases), 6 skills copy, path rewrite |
284
+ | **Enterprise Lifecycle** | `templates/feature-lifecycle-ent.md` | /feature-ent, idea2prd-manual, goap-research-ed25519 |
285
+ | **Feature Suggestions** | `templates/feature-suggestions.md` | /next, feature-navigator, roadmap.json, SessionStart |
286
+ | **Automation** | `templates/automation-commands.md` | /go, /run, /docs, command hierarchy |
287
+ | **DDD Agents** | `templates/ddd-agents.md` | domain-expert, ddd-validator |
288
+ | **DDD Skills** | `templates/ddd-skills.md` | aggregate-patterns, event-handlers |
289
+ | **DDD Hooks/Commands** | `templates/ddd-hooks-commands.md` | hooks, /validate-ddd |
290
+ | **MCP** | `templates/mcp.md` | .mcp.json generation |
291
+ | **Enhanced CLAUDE.md** | `templates/enhanced-claude-md.md` | Additional CLAUDE.md sections |
292
+
293
+ ## Context Budget
294
+
295
+ | Component | Target | Max |
296
+ |-----------|--------|-----|
297
+ | CLAUDE.md | 4k | 6k |
298
+ | /start command | 2k | 4k |
299
+ | /myinsights, /feature, /plan | 3k combined | 5.5k |
300
+ | Domain rules | 1.5k | 2.5k |
301
+ | Generated skills + agents | 3.5k | 5k |
302
+ | Copied lifecycle skills | 0 | 0 (on-demand) |
303
+ | Commands + hooks | 1k | 2k |
304
+ | DEVELOPMENT_GUIDE | 1k | 2k |
305
+ | **Total** | ~18k | 30k (<15% of 200k) |
306
+
307
+ ## Checkpoint Commands (MANUAL Mode)
308
+
309
+ | Checkpoint | Commands |
310
+ |------------|----------|
311
+ | CP1: Detection | `ок`, `добавь [doc]`, `убери [doc]` |
312
+ | CP2: Mapping | `повысь [tool]`, `понизь [tool]`, `покажи mapping` |
313
+ | CP3: P0 | `измени [file]`, `покажи [file]` |
314
+ | CP4: P1 | `+N`, `-N`, `всё`, `минимум` |
315
+ | CP5: P2-P3 | `+agents`, `+skills`, `+hooks`, `+mcp` |
316
+ | CP6: Final | `превью [file]`, `скачать`, `добавить [tool]` |
317
+
318
+ ## Master Validation Checklist
319
+
320
+ Run in Phase 6 before delivery.
321
+
322
+ ### P0 Mandatory
323
+
324
+ - [ ] CLAUDE.md generated per `references/claude-md-strategy.md`
325
+ - [ ] CLAUDE.md includes: Parallel Execution, Swarm Agents, Insights, Feature Lifecycle, Roadmap, Plans, Automation
326
+ - [ ] DEVELOPMENT_GUIDE.md with full lifecycle instructions
327
+ - [ ] `/start` — complete project gen, all packages, Task parallelism, Docker health check, references actual docs
328
+ - [ ] `/myinsights` — duplicate detection, subcommands, index+detail architecture
329
+ - [ ] `insights-capture.md` rule with auto-grep pattern
330
+ - [ ] `/feature` — 4-phase lifecycle (plan → validate → implement → review)
331
+ - [ ] `feature-lifecycle.md` rule
332
+ - [ ] 6 lifecycle skills copied with path rewrite (`/mnt/skills/user/` → `.claude/skills/`)
333
+ - [ ] `git-workflow.md` rule (semantic commits)
334
+ - [ ] `settings.json` — Stop hooks (insights + roadmap + plans) + SessionStart hook
335
+ - [ ] `docs/features/` directory created
336
+
337
+ ### P0 Conditional
338
+
339
+ - [ ] `secrets-management.md` + `security-patterns/` — IF has_external_apis
340
+ - [ ] `domain-model.md` rule — IF DDD Strategic docs
341
+ - [ ] `/start` includes DB migration + seed — IF has_database
342
+
343
+ ### P1 Enterprise (IF DDD)
344
+
345
+ - [ ] `/feature-ent` + `feature-lifecycle-ent.md` rule
346
+ - [ ] `idea2prd-manual/` + `goap-research-ed25519/` skills copied with path rewrites
347
+ - [ ] CLAUDE.md Enterprise Feature Lifecycle section
348
+
349
+ ### P1 Feature Suggestions
350
+
351
+ - [ ] `feature-roadmap.json` populated (min 5 features from PRD)
352
+ - [ ] `feature-context.py` SessionStart hook
353
+ - [ ] `/next` command + `feature-navigator/` skill
354
+
355
+ ### P1 Automation
356
+
357
+ - [ ] `/go` — complexity scoring → pipeline selection
358
+ - [ ] `/run` — /start → /next → /go loop (MVP/all scope)
359
+ - [ ] `/docs` — bilingual RU/EN generation
360
+
361
+ ### Pipeline-Specific (IF applicable)
362
+
363
+ - [ ] Bounded Contexts → agent scopes (DDD)
364
+ - [ ] Aggregates → validation patterns (DDD)
365
+ - [ ] ADR decisions → rules (ADR)
366
+ - [ ] Fitness Functions → hooks (Fitness)
367
+ - [ ] Gherkin features → test commands (Gherkin)
368
+ - [ ] .ai-context/ → CLAUDE.md integration
369
+
370
+ ## Dependencies
371
+
372
+ - SPARC documentation set (11 files) — primary pipeline
373
+ - Alternatively: idea2prd-manual/auto output
374
+ - Optional: .ai-context/ directory