@dzhechkov/p-replicator 1.5.6 → 1.5.8

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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/README/eng/01_quickstart.md +244 -0
  3. package/README/eng/02_user_guide.md +634 -0
  4. package/README/eng/03_admin_guide.md +333 -0
  5. package/README/eng/04_api_reference.md +302 -0
  6. package/README/eng/05_architecture.md +370 -0
  7. package/README/eng/06_troubleshooting.md +353 -0
  8. package/README/eng/07_changelog.md +134 -0
  9. package/README/eng/README.md +60 -0
  10. package/README/ru/01_quickstart.md +244 -0
  11. package/README/ru/02_user_guide.md +633 -0
  12. package/README/ru/03_admin_guide.md +337 -0
  13. package/README/ru/04_api_reference.md +333 -0
  14. package/README/ru/05_architecture.md +372 -0
  15. package/README/ru/06_troubleshooting.md +355 -0
  16. package/README/ru/07_changelog.md +146 -0
  17. package/README/ru/README.md +60 -0
  18. package/README/ru/html/build.js +553 -0
  19. package/README/ru/html/index.html +1312 -0
  20. package/README/ru/html/script.js +496 -0
  21. package/README/ru/html/style.css +804 -0
  22. package/bin/cli.js +0 -0
  23. package/package.json +10 -10
  24. package/src/cli.js +7 -1
  25. package/src/commands/init.js +4 -1
  26. package/templates/.claude/agents/replicate-coordinator.md +23 -21
  27. package/templates/.claude/commands/replicate.md +4 -2
  28. package/templates/.claude/rules/replicate-pipeline.md +16 -0
  29. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/03-generate-p0.md +15 -0
  30. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/04-generate-p1.md +20 -0
  31. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/README.md +11 -0
  32. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +3 -0
  33. package/templates/.claude/skills/problem-solver-enhanced/SKILL.md +3 -0
  34. package/templates/.claude/skills/reverse-engineering-unicorn/SKILL.md +3 -0
@@ -0,0 +1,634 @@
1
+ # 02. User Guide
2
+
3
+ Detailed walkthrough of all 11 commands and their workflows.
4
+
5
+ ## Command summary
6
+
7
+ | Command | Purpose | When to use |
8
+ |---|---|---|
9
+ | `/replicate` | Full pipeline: idea → SPARC docs → toolkit | Start of a new project |
10
+ | `/start` | Bootstrap scaffold from SPARC docs | After `/replicate`, before feature work |
11
+ | `/run` | Autonomous feature build loop from roadmap | Regular development |
12
+ | `/go` | Router: picks /plan, /feature, or /feature-ent | One specific feature |
13
+ | `/next` | Show next feature from roadmap | Sprint navigation |
14
+ | `/plan` | Lightweight plan in `docs/plans/<id>.md` | Small task (≤3 files) |
15
+ | `/feature` | Full SPARC-mini cycle (PLAN → VALIDATE → IMPLEMENT → REVIEW) | Large feature (4+ files) |
16
+ | `/myinsights` | Capture or recall insights | After every non-trivial debug |
17
+ | `/docs` | Bilingual docs generator (RU + EN) | End of project or feature |
18
+ | `/harvest` | Extract reusable patterns | After completed project |
19
+ | `/deploy` | Deployment workflow (dev/staging/prod) | Deployment |
20
+
21
+ ---
22
+
23
+ ## /replicate — main pipeline
24
+
25
+ **Purpose:** turn a product idea into a fully documented, validated,
26
+ toolkit-equipped project.
27
+
28
+ **Usage:**
29
+
30
+ ```
31
+ /replicate "AI-powered handmade marketplace"
32
+ /replicate "company name" # for reverse-engineering mode
33
+ ```
34
+
35
+ ### Phase 0 — Product Discovery (optional)
36
+
37
+ Auto-activates for SaaS, startups, new products. Skipped for internal tools
38
+ and experiments.
39
+
40
+ - Reverse-engineer similar companies via `reverse-engineering-unicorn` skill
41
+ - JTBD analysis + competitors + Blue Ocean canvas
42
+ - Output: `docs/00_product_discovery.md`
43
+
44
+ ### Phase 1 — Planning (SPARC docs)
45
+
46
+ Generates 11 documents in `docs/`:
47
+
48
+ | Document | Content |
49
+ |---|---|
50
+ | `PRD.md` | Vision, personas, user stories |
51
+ | `Solution_Strategy.md` | Solution approach |
52
+ | `Specification.md` | Acceptance criteria, NFRs |
53
+ | `Pseudocode.md` | Algorithms and data flow |
54
+ | `Architecture.md` | C4 diagrams, tech stack |
55
+ | `Refinement.md` | Edge cases, testing strategy |
56
+ | `Completion.md` | Deploy, CI/CD, monitoring |
57
+ | `Research_Findings.md` | Market and tech research |
58
+ | `Final_Summary.md` | Executive summary |
59
+ | `C4_Diagrams.md` | Context / container / component |
60
+ | `ADR.md` | Architecture Decision Records |
61
+
62
+ Uses `sparc-prd-mini` skill (which internally chains explore + research +
63
+ solve phases).
64
+
65
+ ### Phase 2 — Validation
66
+
67
+ 5 parallel validator agents:
68
+
69
+ | Agent | Validates |
70
+ |---|---|
71
+ | `validator-stories` | INVEST criteria for user stories |
72
+ | `validator-acceptance` | SMART criteria for AC |
73
+ | `validator-architecture` | Architecture consistency |
74
+ | `validator-pseudocode` | Algorithm cohesion |
75
+ | `validator-coherence` | Cross-document consistency |
76
+
77
+ **Verdicts:**
78
+ - 🟢 READY (score ≥70) → Phase 3
79
+ - 🟡 CAVEATS (50-69) → Phase 3 with notes
80
+ - 🔴 NEEDS WORK (<50 or blockers) → return to Phase 1 (max 3 retries)
81
+
82
+ ### Phase 3 — Toolkit Generation
83
+
84
+ **Does NOT generate pre-shipped commands** (already installed via init).
85
+ Generates **only project-specific** artifacts:
86
+
87
+ - `.claude/agents/planner.md`, `code-reviewer.md`, `architect.md` (project-aware)
88
+ - `.claude/rules/security.md`, `coding-style.md`, `testing.md`
89
+ - `.claude/skills/project-context/`, `coding-standards/`
90
+ - `CLAUDE.md` enhanced with project content
91
+ - `.claude/feature-roadmap.json` (from PRD MVP scope)
92
+ - `DEVELOPMENT_GUIDE.md`, `README.md`
93
+
94
+ ### Phase 4 — Finalize
95
+
96
+ - `docker-compose.yml`, `Dockerfile`, `.gitignore` (scaffold files)
97
+ - Git commit "chore: initial project setup"
98
+ - Final summary
99
+
100
+ ### Starting from existing tech docs
101
+
102
+ The pipeline officially supports starting **from user-provided technical
103
+ documentation** — bypassing Phase 0 (Product Discovery). Useful when:
104
+
105
+ - You're migrating an existing project to the Claude Code workflow
106
+ - You have a tech spec / architecture / API docs from a prior phase
107
+ - You only need to generate SPARC documents and/or validate them
108
+
109
+ #### Trigger detection (any of)
110
+
111
+ `/replicate` switches to this mode when input contains:
112
+
113
+ - A path reference: "use my docs in `docs/existing/`", "my tech specs are in `<path>`"
114
+ - An explicit skip: "skip discovery", "skip Phase 0"
115
+ - A statement: "I already have technical documentation"
116
+ - The semantic flag: `/replicate --from-docs <path>` or `--skip-discovery`
117
+
118
+ #### Setup
119
+
120
+ Place your docs in a project-local subfolder (conventionally `docs/existing/`
121
+ or `docs/source/`) — visible to the pipeline but separate from generated SPARC outputs.
122
+
123
+ ```bash
124
+ mkdir -p docs/existing
125
+ cp your-tech-doc-*.md docs/existing/
126
+ ```
127
+
128
+ #### What changes per phase
129
+
130
+ | Phase | Default mode | Existing-docs mode |
131
+ |---|---|---|
132
+ | **Phase 0** | reverse-engineering-unicorn (opt.) | **SKIPPED** |
133
+ | **Phase 1** | sparc-prd-mini interactive | sparc-prd-mini **AUTO mode** + your docs as context |
134
+ | Phase 1 sub-phases | Explore + Research + Solve | **SKIPPED** (answers already in your docs) |
135
+ | **Phase 2** | Validation (5 agents) | unchanged |
136
+ | **Phase 3** | Toolkit Generation | unchanged |
137
+ | **Phase 4** | Finalize + scaffolds | unchanged |
138
+
139
+ #### Three sub-paths
140
+
141
+ ##### Path A — full pipeline (recommended)
142
+
143
+ ```
144
+ /replicate "Use my docs in docs/existing/, skip Phase 0"
145
+ ```
146
+
147
+ Get all 11 SPARC documents + validation report + project-specific toolkit +
148
+ Docker scaffold. Best choice when you need a fully-generated project.
149
+
150
+ ##### Path B — SPARC docs only
151
+
152
+ ```
153
+ In Claude Code: "Use sparc-prd-mini skill in AUTO mode, read context from
154
+ docs/existing/, generate the 11 SPARC documents in docs/. Do not run Phase 2/3/4."
155
+ ```
156
+
157
+ Only the 11 files in `docs/`. No validation, no toolkit, no scaffold. Useful
158
+ when you only need documentation standardization.
159
+
160
+ ##### Path C — validation only
161
+
162
+ If your docs are already SPARC-shaped (you already have `PRD.md`, `Architecture.md`, etc.):
163
+
164
+ ```bash
165
+ # 1. Move/rename docs to standard SPARC names
166
+ mv docs/existing/PRD.md docs/PRD.md
167
+ # ... rest of 10 SPARC names
168
+
169
+ # 2. In Claude Code:
170
+ "Invoke the requirements-validator skill on docs/. Generate validation-report.md."
171
+ ```
172
+
173
+ You'll get only `docs/validation-report.md` + `docs/test-scenarios.md`. No
174
+ SPARC re-generation.
175
+
176
+ #### Caveats (important)
177
+
178
+ - **`[GAP: ...]` markers** — if your docs don't cover one of the 11 SPARC slots,
179
+ sparc-prd-mini will leave a placeholder. Normal, but requires manual completion
180
+ before Phase 3.
181
+ - **Validation may flag "not INVEST"** — if user stories in your docs don't
182
+ follow INVEST/SMART, the swarm will report 🟡 CAVEATS or 🔴 NEEDS WORK. This
183
+ is a signal that the docs need extending, not a bug.
184
+ - **Architecture constraints** — pattern, containers, infrastructure, deploy,
185
+ AI integration — must be in your docs or passed in input explicitly. By
186
+ default, sparc-prd-mini uses the target architecture from this repo:
187
+ Distributed Monolith / Docker / VPS / MCP.
188
+
189
+ #### Verification
190
+
191
+ After `/replicate`, run:
192
+
193
+ ```bash
194
+ npx @dzhechkov/p-replicator verify
195
+ ```
196
+
197
+ `verify` reports:
198
+ - ✅ Pre-shipped contract intact
199
+ - ✅ Post-/replicate hints: SPARC docs, validation-report, optionally toolkit artifacts
200
+
201
+ #### Future enhancement (M2 in KNOWN_LIMITATIONS)
202
+
203
+ The semantic `--from-docs <path>` flag currently works via natural-language
204
+ override in the `/replicate` input. A formal CLI flag with command-level
205
+ parsing is on the roadmap (see KNOWN_LIMITATIONS.md M2).
206
+
207
+ ---
208
+
209
+ ## /start — project bootstrap
210
+
211
+ **Purpose:** turn SPARC documentation into a working monorepo with
212
+ `docker compose up`.
213
+
214
+ **Usage:**
215
+
216
+ ```
217
+ /start # with tests + migrations
218
+ /start --skip-tests # without tests (faster)
219
+ /start --skip-seed # without DB seeding
220
+ /start --dry-run # preview without writing
221
+ ```
222
+
223
+ **4 phases (sequential → parallel → sequential → finalize):**
224
+
225
+ 1. **Foundation** — root configs (`package.json`, `docker-compose.yml`, `.env.example`)
226
+ 2. **Packages** (⚡ parallel via `Task` tool) — one Task per package from Architecture.md
227
+ 3. **Integration** — `docker compose build/up`, migrations, health check
228
+ 4. **Finalize** — README + `git tag v0.1.0-scaffold`
229
+
230
+ **Critical rule:** every Phase 2 Task MUST reference specific SPARC docs
231
+ (e.g., `docs/Specification.md` → ORM schema), never generate from memory.
232
+
233
+ ---
234
+
235
+ ## /run — autonomous feature build
236
+
237
+ **Purpose:** roll through the entire roadmap (or MVP subset) autonomously.
238
+
239
+ **Usage:**
240
+
241
+ ```
242
+ /run mvp # priority=mvp only
243
+ /run all # everything in `next`/`planned`
244
+ /run mvp --feature-branches # each feature in a branch
245
+ /run mvp --feature-branches --auto-merge # with auto-merge
246
+ ```
247
+
248
+ **Per-iteration workflow:**
249
+
250
+ ```
251
+ while features in scope:
252
+ feature_id = /next # pick highest-priority
253
+ if no feature: break
254
+ /go feature_id # complexity router
255
+ verify (tests green, code committed)
256
+ mark roadmap entry: status=done
257
+ git commit + git push
258
+ ```
259
+
260
+ **With `--feature-branches`** add steps:
261
+ 1. Verify on `main` (else fail)
262
+ 2. Auto-stash dirty working tree
263
+ 3. `git checkout -b feature/{NNN}-{id}` (NNN = zero-padded 3-digit)
264
+ 4. After implementation: `git push origin feature/{NNN}-{id}`
265
+ 5. Update roadmap with `branch` field
266
+ 6. `git checkout main`
267
+ 7. (if `--auto-merge`) `git merge --no-ff feature/{NNN}-{id}`
268
+
269
+ **Use case:** teaching / demos. Instructor checks out
270
+ `feature/003-payment` for a specific feature demonstration.
271
+
272
+ ---
273
+
274
+ ## /go — intelligent router
275
+
276
+ **Purpose:** auto-pick `/plan`, `/feature`, or `/feature-ent` based on
277
+ complexity score.
278
+
279
+ **Usage:**
280
+
281
+ ```
282
+ /go auth-jwt # by feature id from roadmap
283
+ /go "Add Stripe integration" # free-form description
284
+ /go auth-jwt --feature-branches # with branch workflow (see /run)
285
+ ```
286
+
287
+ **Complexity scoring matrix:**
288
+
289
+ | Signal | Points |
290
+ |---|---|
291
+ | Touches ≤ 3 files | -2 |
292
+ | Touches > 10 files | +3 |
293
+ | External API integration | +2 |
294
+ | New DB entities | +2 |
295
+ | Cross-bounded-context dependencies | +3 |
296
+ | Hotfix | -3 |
297
+ | > 2 hours implementation | +3 |
298
+
299
+ **Decision:**
300
+ - ≤ -2 → `/plan`
301
+ - -1 to +4 → `/feature`
302
+ - ≥ +5 + `/feature-ent` available → `/feature-ent` (DDD pipeline)
303
+ - ≥ +5 without `/feature-ent` → `/feature` with extra architecture care
304
+
305
+ ---
306
+
307
+ ## /next — roadmap navigator
308
+
309
+ **Usage:**
310
+
311
+ ```
312
+ /next # default: top 3 next/planned features
313
+ /next update # scan code, suggest status updates
314
+ /next auth-jwt # mark done + cascade unblock
315
+ ```
316
+
317
+ **Default output:**
318
+
319
+ ```
320
+ 1. [mvp] auth-jwt — JWT login (medium, 2-4h)
321
+ 2. [mvp] user-profile — Profile CRUD (simple, 1-2h)
322
+ 3. [high] payment-webhook — Stripe handler (complex, 4-6h)
323
+
324
+ In progress: <id>
325
+ Done: 5/12
326
+ Blocked: 1
327
+ ```
328
+
329
+ **Roadmap schema** is documented in `04_api_reference.md`.
330
+
331
+ ---
332
+
333
+ ## /plan — lightweight plan
334
+
335
+ **When:** ≤3 files, < 30 min implementation, no new architecture.
336
+
337
+ **Usage:**
338
+
339
+ ```
340
+ /plan add-validation-helper
341
+ /plan "fix race condition in cart"
342
+ ```
343
+
344
+ **Output:** `docs/plans/<slug>.md` with sections:
345
+ - Goal (1-2 sentences)
346
+ - Tasks (numbered checklist)
347
+ - Files Touched (table)
348
+ - Dependencies + Risks
349
+ - Verification
350
+
351
+ Auto-commit via Stop hook.
352
+
353
+ ---
354
+
355
+ ## /feature — full SPARC-mini cycle
356
+
357
+ **When:** ≥4 files, new capability, new architecture.
358
+
359
+ **4 phases with checkpoints:**
360
+
361
+ ### Phase 1 — PLAN (sparc-prd-mini)
362
+ Generates 5 SPARC docs in `docs/features/<feature>/`:
363
+ - `01_specification.md`, `02_pseudocode.md`, `03_architecture.md`,
364
+ `04_refinement.md`, `05_completion.md`
365
+
366
+ ### Phase 2 — VALIDATE (requirements-validator)
367
+ Score ≥ 70 → Phase 3. Auto-retry on 🟡 (caveats), max 3 retries on 🔴.
368
+
369
+ ### Phase 3 — IMPLEMENT (parallel agents)
370
+ `Task` tool spawns parallel tasks per independent unit from Architecture.
371
+
372
+ ### Phase 4 — REVIEW (brutal-honesty-review)
373
+ Findings by severity: blocker (must fix) / high / medium / low.
374
+
375
+ **AUTO mode** (called from `/go` or `/run`): no per-phase confirmations.
376
+
377
+ ### Feature workflow in an existing project (Mode 2)
378
+
379
+ `/feature` officially supports **two entry modes** — both use the identical
380
+ 4-phase pipeline (PLAN → VALIDATE → IMPLEMENT → REVIEW), the same validation
381
+ thresholds, the same retry logic.
382
+
383
+ | Mode | When | Pre-conditions |
384
+ |---|---|---|
385
+ | **Mode 1: Post-/replicate** | Project bootstrapped via `/replicate` | CLAUDE.md, docs/, scaffold all generated by /replicate |
386
+ | **Mode 2: Existing project** | Working project, adding features with verification | `init` ran on top of existing project; CLAUDE.md already exists |
387
+
388
+ #### When to use Mode 2
389
+
390
+ - You already have stack, PRD, Specification, Architecture, CLAUDE.md
391
+ - You want to add features with the **same validation cycle** as `/replicate`
392
+ - You do NOT want to regenerate the existing CLAUDE.md and scaffold
393
+
394
+ #### Steps for Mode 2
395
+
396
+ ```bash
397
+ # 1. Install (idempotent — does NOT touch CLAUDE.md or existing .claude/ files)
398
+ cd existing-project
399
+ npx @dzhechkov/p-replicator init
400
+ npx @dzhechkov/p-replicator verify # pre-shipped contract OK
401
+
402
+ # 2. Normalize SPARC paths (one-time)
403
+ # /feature expects docs/PRD.md, docs/Specification.md, docs/Architecture.md
404
+ mv docs/your-prd.md docs/PRD.md
405
+ mv docs/your-spec.md docs/Specification.md
406
+ mv docs/your-arch.md docs/Architecture.md
407
+
408
+ # 3. (Optional) feature-roadmap for batch mode via /run
409
+ cat > .claude/feature-roadmap.json << 'EOF'
410
+ {
411
+ "features": [
412
+ {"id": "stripe-payments", "title": "Stripe", "priority": "mvp", "status": "planned"},
413
+ {"id": "user-2fa", "title": "2FA TOTP", "priority": "mvp", "status": "planned"}
414
+ ]
415
+ }
416
+ EOF
417
+
418
+ # 4. Run
419
+ claude
420
+ /feature stripe-payments # single feature
421
+ /run mvp --feature-branches --auto-merge # batch with git branching
422
+ ```
423
+
424
+ #### Three sub-paths for Mode 2
425
+
426
+ ##### Path A — `/feature` directly (recommended)
427
+
428
+ Single feature, full 4-phase lifecycle. Use when the feature touches ≥4 files
429
+ or introduces new capability/architecture.
430
+
431
+ ```
432
+ /feature add-stripe-payments
433
+ ```
434
+
435
+ ##### Path B — `/go` auto-router
436
+
437
+ Picks between `/plan` (≤3 files) and `/feature` (≥4 files) based on heuristics.
438
+
439
+ ```
440
+ /go add-pagination # → /plan (small)
441
+ /go add-stripe-payments # → /feature (large)
442
+ ```
443
+
444
+ ##### Path C — direct skill invocation (validation cycle only)
445
+
446
+ If you have your own implementation flow and just need the **validation cycle**:
447
+
448
+ ```
449
+ In Claude Code:
450
+ "Invoke the requirements-validator skill on docs/features/my-feature/.
451
+ Generate validation-report.md with verdict 🟢/🟡/🔴."
452
+
453
+ After implementation:
454
+ "Invoke the brutal-honesty-review skill on the changed files."
455
+ ```
456
+
457
+ #### What's preserved during `init` in an existing project
458
+
459
+ | Artifact | Behavior |
460
+ |---|---|
461
+ | `CLAUDE.md` (root) | **Preserved** (only `--force` overwrites) |
462
+ | `docs/PRD.md`, `Specification.md`, your docs | **Preserved** |
463
+ | `.claude/commands/your-custom.md` | **Preserved** |
464
+ | `.claude/settings.json` | **Merged** (v1.4.2+ deep-equals merge with `shippedDefaults` baseline for orphan-detection) |
465
+ | `.gitignore`, `package.json` | **Not touched** |
466
+ | `.p-replicator.json` | Newly created (manifest) |
467
+
468
+ #### Validation thresholds (identical to /replicate Phase 2)
469
+
470
+ `requirements-validator` scores on INVEST (user stories) + SMART (acceptance
471
+ criteria). The same swarm-of-5 used in `/replicate`:
472
+
473
+ - 🟢 **READY** (score ≥ 70) — IMPLEMENT
474
+ - 🟡 **CAVEATS** (50-69, no blockers) — IMPLEMENT + auto-retry once
475
+ - 🔴 **NEEDS WORK** (< 50 OR blockers) — return to PLAN, max 3 retries → halt
476
+
477
+ After `IMPLEMENT` — `brutal-honesty-review` with severity:
478
+ `blocker` (must fix) / `high` (fix unless deferred) / `medium` (follow-up issue) / `low` (logged only).
479
+
480
+ #### Mode 2 caveats (important)
481
+
482
+ 1. **DO NOT run `/start`** — it's for fresh scaffolds based on `Architecture.md`,
483
+ not for adding to an existing project.
484
+ 2. **`/feature-ent` unavailable** in Mode 2 without DDD/ADR/C4 docs — `/replicate`
485
+ Phase 3 normally generates it conditionally. Use `/feature` or `/go` instead.
486
+ 3. **Auto-commit hooks** (`Stop` → `autocommit-roadmap.cjs` / `-insights.cjs` /
487
+ `-plans.cjs`) may conflict with custom git workflows. Solution: after `init`,
488
+ edit `.claude/settings.json` — remove unwanted matchers. v1.4.2+ merge logic
489
+ preserves your edits on subsequent `update` runs thanks to `shippedDefaults`
490
+ baseline.
491
+ 4. **Non-standard doc paths** — there are no `--prd-path` / `--spec-path` flags.
492
+ Solution: one-time rename or symlink. See KNOWN_LIMITATIONS.md M3 — formal
493
+ config-flag is on the roadmap (Tier S effort).
494
+
495
+ #### Verification
496
+
497
+ After `/feature` (or `/run`), run:
498
+
499
+ ```bash
500
+ npx @dzhechkov/p-replicator verify
501
+ ```
502
+
503
+ Should report:
504
+ - ✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 5 rules + settings.json)
505
+ - ✅ Post-/replicate hints — many will be absent in Mode 2 (this is normal)
506
+ - 📊 Per-feature artifacts: `docs/features/<id>/01_specification.md`...`05_completion.md`,
507
+ `validation-report.md`, `review-report.md`
508
+
509
+ #### Future enhancement (M3 in KNOWN_LIMITATIONS)
510
+
511
+ `docPaths` config in `.p-replicator.json` for non-standard doc paths is on the
512
+ roadmap. Tier S effort, pure config + spec-read changes, no CLI code modifications.
513
+
514
+ ---
515
+
516
+ ## /myinsights — knowledge capture
517
+
518
+ **Purpose:** build a project-local knowledge base of "rakes" auto-injected
519
+ into every session via SessionStart hook.
520
+
521
+ **Usage:**
522
+
523
+ ```
524
+ /myinsights # interactive prompt
525
+ /myinsights "Prisma migrate dev fails silently if shadow DB unreachable. Workaround: set DATABASE_URL_SHADOW explicitly."
526
+ /myinsights recall prisma # search by keyword
527
+ ```
528
+
529
+ **Entry structure:**
530
+
531
+ ```markdown
532
+ ## 2026-05-07 — Prisma shadow DB requirement
533
+
534
+ **Tags:** prisma-migration, postgres-shadow
535
+
536
+ **Problem:**
537
+ Migrate dev fails silently when shadow DB unreachable.
538
+
539
+ **Solution:**
540
+ Set DATABASE_URL_SHADOW env var to a separate database.
541
+
542
+ **References:** packages/backend/prisma/schema.prisma:12
543
+ ```
544
+
545
+ **Auto-injection:** `SessionStart` hook
546
+ (`.claude/hooks/session-insights.cjs`) reads `.claude/insights/index.md`,
547
+ prints 3 most recent entries to stdout, Claude Code injects into initial
548
+ context.
549
+
550
+ ---
551
+
552
+ ## /docs — documentation generator
553
+
554
+ **This is the command that created these files.** Bilingual (RU + EN) by
555
+ default.
556
+
557
+ **Usage:**
558
+
559
+ ```
560
+ /docs # RU + EN, create or replace
561
+ /docs ru # Russian only
562
+ /docs eng # English only
563
+ /docs update # update only changed sections
564
+ ```
565
+
566
+ **Output:** `README/{ru,eng}/` with 8 files per language (this file is one
567
+ of them).
568
+
569
+ ---
570
+
571
+ ## /harvest — knowledge extraction
572
+
573
+ **Purpose:** at project end, extract reusable patterns (skills, commands,
574
+ rules, templates, snippets) for future projects.
575
+
576
+ **Usage:**
577
+
578
+ ```
579
+ /harvest quick # fast, no checkpoints (~15 min)
580
+ /harvest full # full 4-phase pipeline (~45 min)
581
+ /harvest marker # mark artifact for extraction
582
+ /harvest audit # toolkit maturity review
583
+ ```
584
+
585
+ **4 phases (full):**
586
+ 1. AGENT REVIEW — 5 parallel scanner agents
587
+ 2. CLASSIFY — 7 categories
588
+ 3. DECONTEXTUALIZE — strip project-specific names
589
+ 4. INTEGRATE — write to toolkit, update index
590
+
591
+ ---
592
+
593
+ ## /deploy — deployment workflow
594
+
595
+ **Usage:**
596
+
597
+ ```
598
+ /deploy dev # auto, minimal checks
599
+ /deploy staging # gate checks + smoke tests + health
600
+ /deploy prod # explicit `yes` confirmation + rollback plan
601
+ ```
602
+
603
+ **Per-tier gate checks:**
604
+ - ALL: tests pass, build OK, lint clean
605
+ - STAGING+PROD: env vars set, external services reachable, images tagged
606
+ - PROD: staging successful in 24h, no critical issues, on-call notified
607
+
608
+ **Auto-rollback** on staging/prod when health check fails.
609
+
610
+ ---
611
+
612
+ ## Command relationships
613
+
614
+ ```
615
+ /replicate ─┬─ /start ──────── (one-time bootstrap)
616
+
617
+ └─ /run mvp/all ──┬─ /next (selection)
618
+ ├─ /go ──┬─ /plan (simple)
619
+ │ └─ /feature (standard)
620
+ │ └─ AUTO mode inside /run
621
+ └─ git push + roadmap update
622
+
623
+ Anytime:
624
+ /myinsights — knowledge capture
625
+ /docs — docs refresh
626
+ /verify, /doctor — health checks (CLI)
627
+
628
+ End of project:
629
+ /harvest — pattern extraction
630
+ /deploy — production deployment
631
+ ```
632
+
633
+ For configuration details (hooks/statusline/insights) see
634
+ [03_admin_guide.md](./03_admin_guide.md).