@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
package/src/utils.js ADDED
@@ -0,0 +1,280 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // ===========================================================================
7
+ // Colors — ANSI escape codes (zero dependencies)
8
+ // ===========================================================================
9
+
10
+ const supportsColor = process.stdout.isTTY && !process.env.NO_COLOR;
11
+
12
+ function wrap(code, text) {
13
+ if (!supportsColor) return text;
14
+ return `\x1b[${code}m${text}\x1b[0m`;
15
+ }
16
+
17
+ function green(text) { return wrap('32', text); }
18
+ function red(text) { return wrap('31', text); }
19
+ function yellow(text) { return wrap('33', text); }
20
+ function blue(text) { return wrap('34', text); }
21
+ function cyan(text) { return wrap('36', text); }
22
+ function bold(text) { return wrap('1', text); }
23
+ function dim(text) { return wrap('2', text); }
24
+ function gray(text) { return wrap('90', text); }
25
+
26
+ // ===========================================================================
27
+ // Logging
28
+ // ===========================================================================
29
+
30
+ function info(msg) { console.log(blue('[INFO]') + ' ' + msg); }
31
+ function success(msg) { console.log(green('[OK]') + ' ' + msg); }
32
+ function warn(msg) { console.log(yellow('[WARN]') + ' ' + msg); }
33
+ function error(msg) { console.log(red('[ERROR]') + ' ' + msg); }
34
+
35
+ function step(n, total, msg) {
36
+ console.log(cyan(`[${n}/${total}]`) + ' ' + msg);
37
+ }
38
+
39
+ // ===========================================================================
40
+ // File operations — all synchronous, Node.js built-ins only
41
+ // ===========================================================================
42
+
43
+ /**
44
+ * Copy a directory recursively from src to dest, creating dirs as needed.
45
+ */
46
+ function copyDirRecursive(src, dest) {
47
+ const stat = fs.statSync(src);
48
+
49
+ if (stat.isFile()) {
50
+ ensureDir(path.dirname(dest));
51
+ fs.copyFileSync(src, dest);
52
+ return;
53
+ }
54
+
55
+ if (stat.isDirectory()) {
56
+ ensureDir(dest);
57
+ const entries = fs.readdirSync(src);
58
+ for (const entry of entries) {
59
+ copyDirRecursive(path.join(src, entry), path.join(dest, entry));
60
+ }
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Copy a directory recursively, but only include files matching a filter.
66
+ */
67
+ function copyDirFiltered(src, dest, filterFn) {
68
+ const stat = fs.statSync(src);
69
+
70
+ if (!stat.isDirectory()) {
71
+ if (filterFn(path.basename(src))) {
72
+ ensureDir(path.dirname(dest));
73
+ fs.copyFileSync(src, dest);
74
+ }
75
+ return;
76
+ }
77
+
78
+ ensureDir(dest);
79
+ const entries = fs.readdirSync(src);
80
+ for (const entry of entries) {
81
+ if (!filterFn(entry)) continue;
82
+ const srcEntry = path.join(src, entry);
83
+ const destEntry = path.join(dest, entry);
84
+ const entryStat = fs.statSync(srcEntry);
85
+
86
+ if (entryStat.isDirectory()) {
87
+ copyDirRecursive(srcEntry, destEntry);
88
+ } else {
89
+ fs.copyFileSync(srcEntry, destEntry);
90
+ }
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Returns true if the path exists.
96
+ */
97
+ function fileExists(filePath) {
98
+ try {
99
+ fs.accessSync(filePath);
100
+ return true;
101
+ } catch {
102
+ return false;
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Read and parse a JSON file. Returns null if not found or invalid.
108
+ */
109
+ function readJSON(filePath) {
110
+ try {
111
+ const raw = fs.readFileSync(filePath, 'utf8');
112
+ return JSON.parse(raw);
113
+ } catch {
114
+ return null;
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Write an object as JSON with 2-space indentation.
120
+ */
121
+ function writeJSON(filePath, data) {
122
+ ensureDir(path.dirname(filePath));
123
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n', 'utf8');
124
+ }
125
+
126
+ /**
127
+ * Create a directory (and parents) if it does not exist.
128
+ */
129
+ function ensureDir(dirPath) {
130
+ fs.mkdirSync(dirPath, { recursive: true });
131
+ }
132
+
133
+ /**
134
+ * Return an array of all file paths relative to `dir`, traversed recursively.
135
+ */
136
+ function getRelativePaths(dir) {
137
+ const results = [];
138
+
139
+ function walk(current, rel) {
140
+ const entries = fs.readdirSync(current);
141
+ for (const entry of entries) {
142
+ const full = path.join(current, entry);
143
+ const relPath = rel ? path.join(rel, entry) : entry;
144
+ const stat = fs.statSync(full);
145
+ if (stat.isDirectory()) {
146
+ walk(full, relPath);
147
+ } else {
148
+ results.push(relPath);
149
+ }
150
+ }
151
+ }
152
+
153
+ if (fileExists(dir) && fs.statSync(dir).isDirectory()) {
154
+ walk(dir, '');
155
+ }
156
+
157
+ return results;
158
+ }
159
+
160
+ /**
161
+ * Compare files between srcDir and destDir.
162
+ * Returns { added, modified, unchanged, missing }.
163
+ */
164
+ function diffFiles(srcDir, destDir) {
165
+ const srcFiles = new Set(getRelativePaths(srcDir));
166
+ const destFiles = new Set(getRelativePaths(destDir));
167
+
168
+ const added = [];
169
+ const modified = [];
170
+ const unchanged = [];
171
+ const missing = [];
172
+
173
+ for (const rel of srcFiles) {
174
+ if (!destFiles.has(rel)) {
175
+ added.push(rel);
176
+ } else {
177
+ const srcContent = fs.readFileSync(path.join(srcDir, rel));
178
+ const destContent = fs.readFileSync(path.join(destDir, rel));
179
+ if (srcContent.equals(destContent)) {
180
+ unchanged.push(rel);
181
+ } else {
182
+ modified.push(rel);
183
+ }
184
+ }
185
+ }
186
+
187
+ for (const rel of destFiles) {
188
+ if (!srcFiles.has(rel)) {
189
+ missing.push(rel);
190
+ }
191
+ }
192
+
193
+ return { added, modified, unchanged, missing };
194
+ }
195
+
196
+ // ===========================================================================
197
+ // Manifest — .p-replicator.json management
198
+ // ===========================================================================
199
+
200
+ const MANIFEST_FILE = '.p-replicator.json';
201
+
202
+ function readManifest(targetDir) {
203
+ return readJSON(path.join(targetDir, MANIFEST_FILE));
204
+ }
205
+
206
+ function writeManifest(targetDir, data) {
207
+ writeJSON(path.join(targetDir, MANIFEST_FILE), data);
208
+ }
209
+
210
+ function createManifest(version, components, files) {
211
+ return {
212
+ version: version,
213
+ installedAt: new Date().toISOString(),
214
+ components: components,
215
+ files: files,
216
+ };
217
+ }
218
+
219
+ // ===========================================================================
220
+ // Templates path
221
+ // ===========================================================================
222
+
223
+ function getTemplatesDir() {
224
+ return path.join(__dirname, '..', 'templates');
225
+ }
226
+
227
+ // ===========================================================================
228
+ // Component definitions — PU Unicorn Replicate
229
+ //
230
+ // All components are installed as complete directories (no prefix filtering
231
+ // needed since this is a complete package).
232
+ // ===========================================================================
233
+
234
+ const COMPONENTS = {
235
+ skills: {
236
+ src: '.claude/skills',
237
+ label: 'Skills (10 skill packs)',
238
+ group: 'core',
239
+ },
240
+ commands: {
241
+ src: '.claude/commands',
242
+ label: 'Commands (/replicate, /harvest)',
243
+ group: 'core',
244
+ },
245
+ agents: {
246
+ src: '.claude/agents',
247
+ label: 'Agents (4 orchestrators)',
248
+ group: 'core',
249
+ },
250
+ rules: {
251
+ src: '.claude/rules',
252
+ label: 'Rules (pipeline constraints)',
253
+ group: 'core',
254
+ },
255
+ };
256
+
257
+ // ===========================================================================
258
+ // Exports
259
+ // ===========================================================================
260
+
261
+ module.exports = {
262
+ // Colors
263
+ green, red, yellow, blue, cyan, bold, dim, gray,
264
+
265
+ // Logging
266
+ info, success, warn, error, step,
267
+
268
+ // File operations
269
+ copyDirRecursive, copyDirFiltered, fileExists, readJSON, writeJSON,
270
+ ensureDir, getRelativePaths, diffFiles,
271
+
272
+ // Manifest
273
+ MANIFEST_FILE, readManifest, writeManifest, createManifest,
274
+
275
+ // Templates
276
+ getTemplatesDir,
277
+
278
+ // Components
279
+ COMPONENTS,
280
+ };
@@ -0,0 +1,92 @@
1
+ # Documentation Validator Agent
2
+
3
+ Validates SPARC documentation for completeness, testability, and implementation readiness.
4
+ Uses swarm of parallel validation sub-agents.
5
+
6
+ ## When to Use
7
+
8
+ Activated during `/replicate` Phase 2 after SPARC documentation is generated.
9
+ Also usable standalone to re-validate documentation at any time.
10
+
11
+ ## Skill Reference
12
+
13
+ Uses `requirements-validator` skill.
14
+ Read from: `.claude/skills/requirements-validator/SKILL.md`
15
+
16
+ ## Swarm Strategy
17
+
18
+ Launch 5 parallel validation agents using Task tool:
19
+
20
+ | Agent | Scope | Criteria | Tool |
21
+ |-------|-------|----------|------|
22
+ | `validator-stories` | PRD → User Stories | INVEST (Independent, Negotiable, Valuable, Estimable, Small, Testable) | Task |
23
+ | `validator-acceptance` | Stories → AC | SMART (Specific, Measurable, Achievable, Relevant, Time-bound) | Task |
24
+ | `validator-architecture` | Architecture.md | Target constraints compliance, completeness | Task |
25
+ | `validator-pseudocode` | Pseudocode.md | Story coverage, implementability | Task |
26
+ | `validator-coherence` | Cross-document | Consistency, no contradictions | Task |
27
+
28
+ ## Scoring System
29
+
30
+ - 0-49: BLOCKED (must fix before proceeding)
31
+ - 50-69: WARNING (should improve)
32
+ - 70-100: READY (proceed to toolkit generation)
33
+
34
+ ## Iterative Process (max 3 iterations)
35
+
36
+ ```
37
+ Iteration N:
38
+ 1. ANALYZE — parallel 5 validator agents
39
+ 2. AGGREGATE — Gap Register + scoring
40
+ 3. FIX — resolve gaps in documentation
41
+ 4. RE-VALIDATE — re-check fixes
42
+
43
+ Exit criteria:
44
+ - No BLOCKED (score <50)
45
+ - Average score ≥70
46
+ - No contradictions between documents
47
+
48
+ If NOT met and N < 3 → next iteration
49
+ If met OR N = 3 → exit with verdict
50
+ ```
51
+
52
+ ## BDD Scenarios Generation
53
+
54
+ Automatically generate Gherkin scenarios from validated user stories:
55
+ - Happy path (1-2 scenarios per story)
56
+ - Error handling (2-3 scenarios)
57
+ - Edge cases (1-2 scenarios)
58
+ - Security scenarios (if applicable)
59
+
60
+ Save to: `docs/test-scenarios.md`
61
+
62
+ ## Output
63
+
64
+ ### Validation Report (`docs/validation-report.md`)
65
+
66
+ ```markdown
67
+ # Validation Report
68
+
69
+ ## Summary
70
+ - Iteration: [N] of max 3
71
+ - Average score: XX/100
72
+ - Blocked/Warnings: X/X → Fixed: X/X
73
+
74
+ ## Gap Register
75
+ | ID | Document | Issue | Severity | Status |
76
+ |----|----------|-------|----------|--------|
77
+
78
+ ## Cross-Document Consistency
79
+ | Check | Status | Notes |
80
+ |-------|--------|-------|
81
+
82
+ ## Readiness Verdict
83
+ 🟢 READY / 🟡 CAVEATS / 🔴 NEEDS WORK
84
+ ```
85
+
86
+ ### Verdicts
87
+
88
+ | Verdict | Conditions | Action |
89
+ |---------|-----------|--------|
90
+ | 🟢 READY | All scores ≥50, average ≥70, no contradictions | → Phase 3 |
91
+ | 🟡 CAVEATS | Warnings exist, no blocked, limitations described | → Phase 3 with notes |
92
+ | 🔴 NEEDS WORK | Blocked items exist | → Return to Phase 1 |
@@ -0,0 +1,91 @@
1
+ # Harvest Coordinator Agent
2
+
3
+ Orchestrates knowledge extraction from projects using a swarm of parallel
4
+ extraction agents. Coordinates the 4-phase harvest pipeline.
5
+
6
+ ## When to Use
7
+
8
+ Activated by the `/harvest` command. Also invocable directly when extracting
9
+ knowledge from a completed project or sprint.
10
+
11
+ ## Skill Reference
12
+
13
+ Uses `knowledge-extractor` skill.
14
+ Read from: `.claude/skills/knowledge-extractor/SKILL.md`
15
+
16
+ ## Responsibilities
17
+
18
+ 1. **Swarm Management** — launch and coordinate 5 parallel extraction agents (Phase 1)
19
+ 2. **Classification** — categorize findings into 7 artifact types (Phase 2)
20
+ 3. **Quality Enforcement** — ensure decontextualization quality gate passes (Phase 3)
21
+ 4. **Integration** — write artifacts and update toolkit index (Phase 4)
22
+ 5. **Reporting** — produce harvest report with recommendations
23
+
24
+ ## Swarm Strategy (Phase 1)
25
+
26
+ Launch 5 parallel agents via Task tool:
27
+
28
+ | Agent | Scope | Focus |
29
+ |-------|-------|-------|
30
+ | `extractor-patterns` | Architecture & code | Middleware, error handling, data access |
31
+ | `extractor-commands` | Scripts & CLI | Build scripts, dev utilities, commands |
32
+ | `extractor-rules` | Constraints & lessons | TODOs, HACKs, edge cases in tests |
33
+ | `extractor-templates` | Configs & structures | Docker, CI/CD, linter configs |
34
+ | `extractor-snippets` | Code fragments | Utils, helpers, one-liners |
35
+
36
+ **Each agent receives:**
37
+ - Project root path
38
+ - `TOOLKIT_HARVEST.md` content (if exists)
39
+ - Instructions from its module section in `modules/01-agent-review.md`
40
+
41
+ **Merge results:** Deduplicate, cross-reference, sort by reusability confidence.
42
+
43
+ ## Quality Gate (Phase 3)
44
+
45
+ For each artifact, verify before integration:
46
+
47
+ | Check | Blocking? |
48
+ |-------|-----------|
49
+ | No project-specific names | YES |
50
+ | No hardcoded paths | YES |
51
+ | "When to use" section | YES |
52
+ | "When NOT to use" section | YES |
53
+ | Prerequisites documented | YES |
54
+ | Code compiles standalone | YES (code artifacts) |
55
+ | Maturity level assigned | YES |
56
+ | At least 1 variant | NO |
57
+
58
+ If `brutal-honesty-review` skill available → apply Bach-mode BS detection.
59
+
60
+ ## Artifact Categories
61
+
62
+ | Category | Target Location |
63
+ |----------|----------------|
64
+ | Skills | `.claude/skills/[name]/SKILL.md` |
65
+ | Commands | `.claude/commands/[name].md` |
66
+ | Hooks | `.claude/settings.json` |
67
+ | Rules | `.claude/rules/[name].md` |
68
+ | Templates | `templates/[name]/` |
69
+ | Patterns | `docs/patterns/[name].md` |
70
+ | Snippets | `snippets/[lang]/[name].[ext]` |
71
+
72
+ ## Output
73
+
74
+ ### Per Phase
75
+ - Phase 1: Raw Findings List (N candidates)
76
+ - Phase 2: Classified Artifact List (M extract, K skip)
77
+ - Phase 3: Generalized Artifacts (decontextualized, documented)
78
+ - Phase 4: Harvest Report + Updated Toolkit
79
+
80
+ ### Git Commit
81
+ ```
82
+ chore: harvest [N] artifacts from [project-name]
83
+ ```
84
+
85
+ ## Integration with Other Skills
86
+
87
+ | Skill | Phase | Purpose |
88
+ |-------|-------|---------|
89
+ | `explore` | Phase 1 | Clarify extraction scope |
90
+ | `brutal-honesty-review` | Phase 3 | BS-detect unworthy artifacts |
91
+ | `pipeline-forge` | Phase 4 | Structure new skills properly |
@@ -0,0 +1,57 @@
1
+ # Product Discoverer Agent
2
+
3
+ Performs competitive analysis and market research for Phase 0 of the `/replicate` pipeline.
4
+
5
+ ## When to Use
6
+
7
+ Activated during `/replicate` Phase 0 when the project is a new product, startup, or SaaS.
8
+ Skipped for internal tools and experiments.
9
+
10
+ ## Skill Reference
11
+
12
+ Uses `reverse-engineering-unicorn` skill in QUICK mode.
13
+ Read from: `.claude/skills/reverse-engineering-unicorn/SKILL.md`
14
+
15
+ ## Selected Modules (QUICK mode)
16
+
17
+ | Module | When | Output |
18
+ |--------|------|--------|
19
+ | M2: Product & Customers | Always | JTBD, Value Prop, segments |
20
+ | M3: Market & Competition | Always | TAM/SAM, competitors, Blue Ocean Canvas |
21
+ | M4: Business & Finance | If monetization model needed | Unit economics |
22
+ | M5: Growth Engine | If B2C/PLG | Channels, integrations, viral loops |
23
+
24
+ ## Output Format
25
+
26
+ Product Discovery Brief — structured markdown passed as pre-filled context to Phase 1 (sparc-prd-mini):
27
+
28
+ ```markdown
29
+ ## Product Discovery Brief
30
+
31
+ ### Target Segments
32
+ [From JTBD analysis]
33
+
34
+ ### Key Competitors
35
+ | Competitor | Strengths | Weaknesses | Differentiation |
36
+ |------------|-----------|------------|-----------------|
37
+
38
+ ### Blue Ocean Canvas
39
+ [From strategy canvas analysis]
40
+
41
+ ### Monetization Model
42
+ [From unit economics — if applicable]
43
+
44
+ ### Growth Channels
45
+ [From growth engine analysis — if applicable]
46
+
47
+ ### Key Insights for PRD
48
+ [Top 3-5 insights that should inform product planning]
49
+ ```
50
+
51
+ ## Anti-Hallucination Rules
52
+
53
+ - Search first — never answer from memory for facts
54
+ - Source attribution — every fact → URL
55
+ - "НЕ НАЙДЕНО" > fabrication
56
+ - Hypotheses marked with `[H]` tag
57
+ - Confidence score at end
@@ -0,0 +1,98 @@
1
+ # Replicate Coordinator Agent
2
+
3
+ Orchestrates the full `/replicate` pipeline — from product idea to ready-to-code project.
4
+
5
+ ## When to Use
6
+
7
+ Activated automatically by the `/replicate` command. Do NOT invoke directly.
8
+
9
+ ## Responsibilities
10
+
11
+ 1. **Phase Management** — ensure correct phase sequence (0 → 1 → 2 → 3 → 4)
12
+ 2. **Context Passing** — carry forward outputs between phases:
13
+ - Phase 0 → Phase 1: Product Discovery Brief
14
+ - Phase 1 → Phase 2: 11 SPARC documents
15
+ - Phase 2 → Phase 3: Validated docs + test-scenarios
16
+ - Phase 3 → Phase 4: Complete toolkit
17
+ 3. **Skill Coordination** — read and apply skills from `.claude/skills/`
18
+ 4. **Quality Gates** — enforce checkpoints between phases
19
+ 5. **In-Place Generation** — write all files directly into the project (no zip, no output/)
20
+
21
+ ## Architecture Constraints (always pass to Phase 1)
22
+
23
+ ```yaml
24
+ Architecture Constraints:
25
+ pattern: "Distributed Monolith (Monorepo)"
26
+ containers: "Docker + Docker Compose"
27
+ infrastructure: "VPS (AdminVPS/HOSTKEY)"
28
+ deploy: "Docker Compose direct deploy (SSH / CI pipeline)"
29
+ ai_integration: "MCP servers"
30
+ ```
31
+
32
+ ## Skill Path Mapping (claude.ai → Claude Code)
33
+
34
+ When skills reference `/mnt/skills/user/` paths, map them:
35
+
36
+ | claude.ai path | Claude Code path |
37
+ |----------------|------------------|
38
+ | `/mnt/skills/user/explore/` | `.claude/skills/explore/` |
39
+ | `/mnt/skills/user/goap-research/` | `.claude/skills/goap-research-ed25519/` |
40
+ | `/mnt/skills/user/goap-research-ed25519/` | `.claude/skills/goap-research-ed25519/` |
41
+ | `/mnt/skills/user/problem-solver-enhanced/` | `.claude/skills/problem-solver-enhanced/` |
42
+ | `/mnt/skills/user/sparc-prd-mini/` | `.claude/skills/sparc-prd-mini/` |
43
+ | `/mnt/skills/user/requirements-validator/` | `.claude/skills/requirements-validator/` |
44
+ | `/mnt/skills/user/cc-toolkit-generator-enhanced/` | `.claude/skills/cc-toolkit-generator-enhanced/` |
45
+ | `/mnt/skills/user/reverse-engineering-unicorn/` | `.claude/skills/reverse-engineering-unicorn/` |
46
+ | `/mnt/skills/user/brutal-honesty-review/` | `.claude/skills/brutal-honesty-review/` |
47
+
48
+ ## Output Path Mapping (claude.ai → Claude Code)
49
+
50
+ | claude.ai path | Claude Code path |
51
+ |----------------|------------------|
52
+ | `/output/[name]-sparc/` | `docs/` |
53
+ | `/mnt/user-data/uploads/` | `docs/` |
54
+ | `[project-name]-cc-toolkit/` | project root (in-place) |
55
+ | `[project-name].zip` | N/A (no packaging) |
56
+
57
+ ## What /replicate Generates
58
+
59
+ After full pipeline execution, these files are created/modified:
60
+
61
+ ### Generated Commands
62
+ - `.claude/commands/start.md` — project bootstrap
63
+ - `.claude/commands/feature.md` — 4-phase feature lifecycle
64
+ - `.claude/commands/plan.md` — implementation planning
65
+ - `.claude/commands/myinsights.md` — insights capture
66
+ - `.claude/commands/deploy.md` — deployment workflow
67
+ - `.claude/commands/test.md` — test generation (if applicable)
68
+
69
+ ### Generated Agents
70
+ - `.claude/agents/planner.md` — from Pseudocode.md
71
+ - `.claude/agents/code-reviewer.md` — from Refinement.md
72
+ - `.claude/agents/architect.md` — from Architecture.md + Solution_Strategy.md
73
+
74
+ ### Generated Rules
75
+ - `.claude/rules/git-workflow.md` — semantic commit conventions
76
+ - `.claude/rules/insights-capture.md` — insight capture protocol
77
+ - `.claude/rules/feature-lifecycle.md` — feature development protocol
78
+ - `.claude/rules/security.md` — from Specification.md NFRs
79
+ - `.claude/rules/coding-style.md` — from Architecture.md tech stack
80
+ - `.claude/rules/secrets-management.md` — IF external APIs
81
+
82
+ ### Generated/Modified Config
83
+ - `.claude/settings.json` — hooks (insights auto-commit on Stop)
84
+ - `.mcp.json` — IF external integrations
85
+
86
+ ### Generated Documentation
87
+ - `docs/*.md` — 11+ SPARC documents
88
+ - `docs/validation-report.md` — validation results
89
+ - `docs/test-scenarios.md` — BDD/Gherkin scenarios
90
+ - `docs/features/` — empty dir for future features
91
+
92
+ ### Generated Root Files
93
+ - `CLAUDE.md` — enhanced with project-specific content
94
+ - `DEVELOPMENT_GUIDE.md` — step-by-step dev lifecycle
95
+ - `README.md` — enhanced with project info
96
+ - `docker-compose.yml` — from Architecture.md
97
+ - `Dockerfile` — from Architecture.md tech stack
98
+ - `.gitignore` — if not exists