@dzhechkov/p-replicator 1.5.2 → 1.5.3
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.
- package/README.md +1070 -188
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,37 +1,116 @@
|
|
|
1
1
|
# @dzhechkov/p-replicator
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
> **Claude Code toolkit for AI-assisted product development (Vibe Coding).**
|
|
4
|
+
> Transform a product idea — or an existing project — into fully documented,
|
|
5
|
+
> validated, toolkit-equipped code with a 5-phase SPARC pipeline.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@dzhechkov/p-replicator)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
|
|
11
|
+
**Quick links:** [npm](https://www.npmjs.com/package/@dzhechkov/p-replicator) · [GitHub](https://github.com/dzhechko/pu-unicorn-replicate) · [Issues](https://github.com/dzhechko/pu-unicorn-replicate/issues) · [Telegram](https://t.me/llm_notes)
|
|
12
|
+
|
|
13
|
+
## Documentation in your language
|
|
14
|
+
|
|
15
|
+
- 🇷🇺 [Документация на русском](./README/ru/README.md) — 8 разделов (~3000 строк)
|
|
16
|
+
- 🇬🇧 [English documentation](./README/eng/README.md) — 8 sections (~3000 lines)
|
|
17
|
+
- 🌐 [Interactive HTML guide (RU)](./README/ru/html/index.html) — single-page with search, theming, syntax highlighting
|
|
18
|
+
|
|
19
|
+
This README is **comprehensive and self-contained** — covers ~95% of what most users need. For deep dives (architecture internals, full troubleshooting, formal API schemas) see the eng/ folder.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Table of Contents
|
|
24
|
+
|
|
25
|
+
- [What is p-replicator?](#what-is-p-replicator)
|
|
26
|
+
- [Quick Start](#quick-start)
|
|
27
|
+
- [Already have technical documentation?](#already-have-technical-documentation)
|
|
28
|
+
- [Adding features to an existing project (Mode 2)](#adding-features-to-an-existing-project-mode-2)
|
|
29
|
+
- [Installation](#installation)
|
|
30
|
+
- [What Gets Installed](#what-gets-installed)
|
|
31
|
+
- [Verify the install](#verify-the-install)
|
|
32
|
+
- [Pipeline overview — `/replicate` phases](#pipeline-overview--replicate-phases)
|
|
33
|
+
- [Skills Reference](#skills-reference)
|
|
34
|
+
- [Commands Reference](#commands-reference)
|
|
35
|
+
- [CLI Commands](#cli-commands)
|
|
36
|
+
- [Validation Cycle Details](#validation-cycle-details)
|
|
37
|
+
- [Feature Lifecycle — `/feature` command](#feature-lifecycle--feature-command)
|
|
38
|
+
- [Statusline Dashboard](#statusline-dashboard)
|
|
39
|
+
- [Hooks System](#hooks-system)
|
|
40
|
+
- [Roadmap & Insights](#roadmap--insights)
|
|
41
|
+
- [Architecture Highlights](#architecture-highlights)
|
|
42
|
+
- [Configuration](#configuration)
|
|
43
|
+
- [Update workflow](#update-workflow)
|
|
44
|
+
- [Troubleshooting](#troubleshooting)
|
|
45
|
+
- [Migration](#migration)
|
|
46
|
+
- [Test Infrastructure](#test-infrastructure)
|
|
47
|
+
- [Known Limitations](#known-limitations)
|
|
48
|
+
- [Changelog Highlights](#changelog-highlights)
|
|
49
|
+
- [Contributing](#contributing)
|
|
50
|
+
- [License](#license)
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## What is p-replicator?
|
|
55
|
+
|
|
56
|
+
`@dzhechkov/p-replicator` installs a ready-made `.claude/` toolkit into any project: **11 slash commands**, **10 skills**, **4 agents**, **5 rules**, **6 hook scripts**, and a `settings.json` with pre-configured hooks and a multi-line statusline dashboard.
|
|
57
|
+
|
|
58
|
+
The flagship `/replicate` command takes a project through a **5-phase pipeline**:
|
|
4
59
|
|
|
5
|
-
|
|
60
|
+
```
|
|
61
|
+
Phase 0 (optional) Product Discovery reverse-engineering of similar companies
|
|
62
|
+
Phase 1 Planning 11 SPARC documents (PRD, Architecture, Pseudocode, ...)
|
|
63
|
+
Phase 2 Validation 5-agent swarm validates against INVEST + SMART
|
|
64
|
+
Phase 3 Toolkit Generation project-specific agents, rules, skills
|
|
65
|
+
Phase 4 Finalize docker-compose.yml, Dockerfile, .gitignore + git commit
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Plus **`/feature`** for adding new features to a project with the same SPARC-mini validation cycle, **`/run --feature-branches`** for autonomous batch builds with per-feature git branches, **`/harvest`** for extracting reusable patterns into a knowledge base, and 8 more commands (`/start`, `/plan`, `/go`, `/next`, `/myinsights`, `/docs`, `/deploy`, `/feature-ent`).
|
|
6
69
|
|
|
7
|
-
|
|
70
|
+
**Two main use cases:**
|
|
8
71
|
|
|
9
|
-
|
|
10
|
-
|
|
72
|
+
| Use case | Entry command | Time | Result |
|
|
73
|
+
|---|---|---|---|
|
|
74
|
+
| **Bootstrap a new project** from idea or company name | `/replicate` | 45–90 min | Fully-documented project + scaffold + Docker |
|
|
75
|
+
| **Add features** to an existing project | `/feature` (Mode 2) | 10–30 min per feature | Validated SPARC docs + implementation + review |
|
|
11
76
|
|
|
12
|
-
|
|
13
|
-
|
|
77
|
+
**Target architecture for generated projects:**
|
|
78
|
+
- **Pattern:** Distributed Monolith (Monorepo)
|
|
79
|
+
- **Containers:** Docker + Docker Compose
|
|
80
|
+
- **Infrastructure:** VPS (e.g., AdminVPS, HOSTKEY)
|
|
81
|
+
- **Deploy:** Docker Compose direct deploy
|
|
82
|
+
- **AI Integration:** MCP servers
|
|
83
|
+
|
|
84
|
+
---
|
|
14
85
|
|
|
15
86
|
## Quick Start
|
|
16
87
|
|
|
17
88
|
```bash
|
|
18
|
-
# Install
|
|
89
|
+
# 1. Install in any project
|
|
90
|
+
cd your-project
|
|
19
91
|
npx @dzhechkov/p-replicator init
|
|
20
92
|
|
|
21
|
-
# Open Claude Code
|
|
93
|
+
# 2. Open Claude Code
|
|
22
94
|
claude
|
|
23
95
|
|
|
24
|
-
# Run the pipeline
|
|
96
|
+
# 3. Run the pipeline
|
|
25
97
|
/replicate "Online marketplace for handmade crafts with AI-powered recommendations"
|
|
26
98
|
```
|
|
27
99
|
|
|
28
|
-
The system walks you through 4
|
|
100
|
+
The system walks you through 4–5 phases with interactive checkpoints. At each checkpoint you review the output and confirm before proceeding.
|
|
101
|
+
|
|
102
|
+
**Estimated time:** 45–90 minutes for the full pipeline (Phase 0 optional).
|
|
29
103
|
|
|
30
|
-
|
|
104
|
+
After `/replicate` completes:
|
|
105
|
+
- `/start` — bootstrap the scaffold from `Architecture.md`
|
|
106
|
+
- `/run mvp` — autonomous feature build from roadmap
|
|
107
|
+
- `/feature <id>` — single-feature lifecycle
|
|
31
108
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Already have technical documentation?
|
|
112
|
+
|
|
113
|
+
If you already have tech specs, architecture notes, or API docs for the project, you can skip Phase 0 (Product Discovery) and feed your existing docs into Phase 1 as input:
|
|
35
114
|
|
|
36
115
|
```bash
|
|
37
116
|
mkdir -p docs/existing
|
|
@@ -41,19 +120,26 @@ claude
|
|
|
41
120
|
/replicate "Use my existing docs in docs/existing/, skip Phase 0"
|
|
42
121
|
```
|
|
43
122
|
|
|
44
|
-
Three sub-paths
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
123
|
+
**Three sub-paths:**
|
|
124
|
+
|
|
125
|
+
| Path | When | Result |
|
|
126
|
+
|---|---|---|
|
|
127
|
+
| **A. Full pipeline** | Have tech docs, want full pipeline + toolkit + scaffold | All 11 SPARC docs + validation + toolkit + scaffold |
|
|
128
|
+
| **B. SPARC docs only** | Want only the 11 SPARC docs | Invoke `sparc-prd-mini` skill in AUTO mode |
|
|
129
|
+
| **C. Validation-only** | Existing docs already SPARC-shaped | Rename to `PRD.md`, `Architecture.md`, ... + invoke `requirements-validator` |
|
|
130
|
+
|
|
131
|
+
**Modified flow when triggered:**
|
|
132
|
+
- **Phase 0** — SKIPPED entirely
|
|
133
|
+
- **Phase 1** — `sparc-prd-mini` runs in **AUTO mode**, reads your docs, generates the 11 SPARC slots; missing parts marked `[GAP: ...]`
|
|
134
|
+
- **Phase 2-4** — unchanged
|
|
48
135
|
|
|
49
|
-
Full recipe
|
|
50
|
-
([RU](./README/ru/02_user_guide.md#альтернативный-вход-у-вас-уже-есть-техдокументация)).
|
|
136
|
+
Full recipe: see [User Guide](./README/eng/02_user_guide.md#starting-from-existing-tech-docs) ([RU](./README/ru/02_user_guide.md#альтернативный-вход-у-вас-уже-есть-техдокументация)).
|
|
51
137
|
|
|
52
|
-
|
|
138
|
+
---
|
|
53
139
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
cycle that `/replicate` provides — use `/feature` (Mode 2):
|
|
140
|
+
## Adding features to an existing project (Mode 2)
|
|
141
|
+
|
|
142
|
+
If you already have a working project (stack, PRD, CLAUDE.md, Specification defined) and want to **add new features** with the same SPARC-mini validation cycle that `/replicate` provides — use `/feature` (Mode 2):
|
|
57
143
|
|
|
58
144
|
```bash
|
|
59
145
|
cd existing-project
|
|
@@ -62,28 +148,210 @@ claude
|
|
|
62
148
|
/feature add-stripe-payments # 4-phase: PLAN → VALIDATE → IMPLEMENT → REVIEW
|
|
63
149
|
```
|
|
64
150
|
|
|
65
|
-
`/feature` runs the same validation pipeline as `/replicate` Phase 2, scoped
|
|
66
|
-
|
|
67
|
-
|
|
151
|
+
`/feature` runs the same validation pipeline as `/replicate` Phase 2, scoped to a single feature. Same verdicts: 🟢 READY (≥70) / 🟡 CAVEATS (50–69) / 🔴 NEEDS WORK (<50). Same retry logic. Same `brutal-honesty-review` post-implementation.
|
|
152
|
+
|
|
153
|
+
**Two officially supported entry modes for `/feature`:**
|
|
154
|
+
|
|
155
|
+
| Mode | When | Pre-conditions |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| **Mode 1: Post-/replicate** | Project bootstrapped via `/replicate` | CLAUDE.md, docs/, scaffold all generated by /replicate |
|
|
158
|
+
| **Mode 2: Existing project** | Working project, adding features with verification | `init` ran on top of existing project; CLAUDE.md already exists |
|
|
159
|
+
|
|
160
|
+
**Three sub-paths for Mode 2:**
|
|
161
|
+
|
|
162
|
+
| Path | When | Skills invoked |
|
|
163
|
+
|---|---|---|
|
|
164
|
+
| **A. /feature directly** | Single feature ≥4 files, new capability | sparc-prd-mini → requirements-validator → parallel implement → brutal-honesty-review |
|
|
165
|
+
| **B. /go auto-router** | Mixed complexity | Routes between /plan (≤3 files) and /feature (≥4 files) |
|
|
166
|
+
| **C. Direct skill invocation** | Only validation cycle | requirements-validator + brutal-honesty-review skills directly |
|
|
167
|
+
|
|
168
|
+
**Mode 2 setup (one-time):**
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# 1. Install (idempotent — does NOT touch CLAUDE.md or existing .claude/ files)
|
|
172
|
+
npx @dzhechkov/p-replicator init
|
|
173
|
+
npx @dzhechkov/p-replicator verify
|
|
174
|
+
|
|
175
|
+
# 2. Normalize SPARC paths (one-time)
|
|
176
|
+
mv docs/your-prd.md docs/PRD.md
|
|
177
|
+
mv docs/your-spec.md docs/Specification.md
|
|
178
|
+
mv docs/your-arch.md docs/Architecture.md
|
|
179
|
+
|
|
180
|
+
# 3. (Optional) feature-roadmap for batch mode via /run
|
|
181
|
+
cat > .claude/feature-roadmap.json << 'EOF'
|
|
182
|
+
{"features": [{"id": "stripe-payments", "title": "Stripe", "priority": "mvp", "status": "planned"}]}
|
|
183
|
+
EOF
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Mode 2 caveats:**
|
|
187
|
+
- DO NOT run `/start` — it expects a fresh scaffold
|
|
188
|
+
- `/feature-ent` unavailable in Mode 2 without DDD/ADR/C4 docs
|
|
189
|
+
- Auto-commit hooks may conflict with custom git workflows — edit `settings.json` after `init`
|
|
190
|
+
- No `--prd-path` flag for non-standard paths — one-time rename/symlink required (see [KNOWN_LIMITATIONS.md](./KNOWN_LIMITATIONS.md) M3)
|
|
191
|
+
|
|
192
|
+
Full recipe: see [User Guide](./README/eng/02_user_guide.md#feature-workflow-in-an-existing-project-mode-2) ([RU](./README/ru/02_user_guide.md#feature-workflow-в-существующем-проекте-mode-2)).
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Installation
|
|
197
|
+
|
|
198
|
+
### Prerequisites
|
|
199
|
+
|
|
200
|
+
- **Node.js** ≥ 16.0.0
|
|
201
|
+
- **Claude Code** installed (CLI or web)
|
|
202
|
+
- **Git** initialized in the project (`git init` if not already)
|
|
203
|
+
- **Docker + Docker Compose** (needed for `/start` Phase 3, optional for `/feature`)
|
|
204
|
+
|
|
205
|
+
### Install command
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
cd your-project
|
|
209
|
+
npx @dzhechkov/p-replicator init
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
This creates:
|
|
213
|
+
|
|
214
|
+
- `.claude/skills/` — 10 pre-shipped skills
|
|
215
|
+
- `.claude/commands/` — 11 slash commands (`/replicate`, `/run`, `/feature`, ...)
|
|
216
|
+
- `.claude/agents/` — 4 pipeline agents
|
|
217
|
+
- `.claude/rules/` — 5 governance rules
|
|
218
|
+
- `.claude/hooks/` — 6 cross-platform Node scripts
|
|
219
|
+
- `.claude/settings.json` — hooks + statusline configuration
|
|
220
|
+
- `.p-replicator.json` — install manifest
|
|
221
|
+
|
|
222
|
+
**Idempotency:** `init` will NOT overwrite existing files without `--force`. Your `CLAUDE.md`, custom commands, and modified settings are preserved.
|
|
68
223
|
|
|
69
|
-
|
|
70
|
-
- **A. /feature directly** — single feature, full 4-phase lifecycle
|
|
71
|
-
- **B. /go auto-router** — picks /plan vs /feature based on complexity
|
|
72
|
-
- **C. Direct skill invocation** — only the validation cycle, no full lifecycle
|
|
224
|
+
### Common install scenarios
|
|
73
225
|
|
|
74
|
-
|
|
75
|
-
|
|
226
|
+
| Scenario | Command |
|
|
227
|
+
|---|---|
|
|
228
|
+
| Fresh project | `npx @dzhechkov/p-replicator init` |
|
|
229
|
+
| Existing project (preserve all custom files) | `npx @dzhechkov/p-replicator init` (idempotent — same as fresh) |
|
|
230
|
+
| Upgrade (preserve user customizations) | `npx @dzhechkov/p-replicator@latest update` |
|
|
231
|
+
| Repair broken install | `npx @dzhechkov/p-replicator init --force` |
|
|
232
|
+
| Full reset (loses custom hooks) | `npx @dzhechkov/p-replicator init --force --reset-settings` |
|
|
233
|
+
| Preview without writing | `npx @dzhechkov/p-replicator init --dry-run` |
|
|
234
|
+
|
|
235
|
+
---
|
|
76
236
|
|
|
77
237
|
## What Gets Installed
|
|
78
238
|
|
|
79
239
|
| Component | Count | Description |
|
|
80
240
|
|-----------|-------|-------------|
|
|
81
241
|
| **Skills** | 10 | 90+ files (~200K chars). Modular architecture: foundation → composite → master orchestrator |
|
|
82
|
-
| **Commands** |
|
|
83
|
-
| **Agents** | 4 | replicate-coordinator
|
|
84
|
-
| **Rules** |
|
|
242
|
+
| **Commands** | 11 | `/replicate`, `/harvest`, `/start`, `/plan`, `/feature`, `/go`, `/run`, `/next`, `/myinsights`, `/docs`, `/deploy` |
|
|
243
|
+
| **Agents** | 4 | `replicate-coordinator`, `product-discoverer`, `doc-validator`, `harvest-coordinator` |
|
|
244
|
+
| **Rules** | 5 | `replicate-pipeline`, `skill-interface-protocol`, `git-workflow`, `insights-capture`, `feature-lifecycle` |
|
|
245
|
+
| **Hooks** | 6 | `session-insights`, `autocommit-{roadmap,insights,plans}`, `statusline`, `state-update` (cross-platform Node) |
|
|
246
|
+
| **Settings** | 1 | `settings.json` with statusLine + SessionStart + Stop hooks pre-configured |
|
|
247
|
+
|
|
248
|
+
After running `/replicate`, the toolkit also generates **project-specific** artifacts:
|
|
249
|
+
|
|
250
|
+
- `.claude/agents/planner.md`, `code-reviewer.md`, `architect.md` (project-aware)
|
|
251
|
+
- `.claude/rules/security.md`, `coding-style.md`, `testing.md`, optionally `secrets-management.md`
|
|
252
|
+
- `.claude/skills/project-context/`, `coding-standards/`, optionally `security-patterns/`
|
|
253
|
+
- `.claude/feature-roadmap.json` (from PRD MVP scope)
|
|
254
|
+
- `CLAUDE.md` enhanced with project-specific content
|
|
255
|
+
- `DEVELOPMENT_GUIDE.md`, project `README.md`
|
|
256
|
+
- `docker-compose.yml`, `Dockerfile`, `.gitignore` (Phase 4 scaffolds)
|
|
257
|
+
- `docs/*` — all SPARC documentation (11 files)
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Verify the install
|
|
262
|
+
|
|
263
|
+
After `/replicate`, run:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
npx @dzhechkov/p-replicator verify
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
The command checks:
|
|
270
|
+
|
|
271
|
+
- **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 5 rules + settings.json + 6 hooks
|
|
272
|
+
- **Post-/replicate hints** (advisory): CLAUDE.md, project-specific agents, feature-roadmap.json, security rules, etc.
|
|
273
|
+
|
|
274
|
+
**Exit codes:**
|
|
275
|
+
- `0` — pre-shipped contract intact (warnings about project-specific are normal pre-/replicate)
|
|
276
|
+
- `1` — pre-shipped contract violated → run `init --force` to repair
|
|
277
|
+
|
|
278
|
+
**Alternative — health check:**
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
npx @dzhechkov/p-replicator doctor
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
`doctor` verifies pre-shipped contract + Prerequisites (`git on PATH`). Stricter than `verify` for must-have components.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Pipeline overview — `/replicate` phases
|
|
289
|
+
|
|
290
|
+
### Phase 0 — Product Discovery (optional)
|
|
291
|
+
|
|
292
|
+
**Activated for:** new SaaS, startups, products to research. **Skipped for:** internal tools, experiments, projects with existing tech docs.
|
|
293
|
+
|
|
294
|
+
- Skill: `reverse-engineering-unicorn` (JTBD analysis + competitors + Blue Ocean canvas)
|
|
295
|
+
- Output: `docs/00_product_discovery.md`
|
|
296
|
+
|
|
297
|
+
### Phase 1 — Planning (SPARC docs)
|
|
298
|
+
|
|
299
|
+
Generates 11 standardized documents in `docs/`:
|
|
300
|
+
|
|
301
|
+
| Document | Content |
|
|
302
|
+
|---|---|
|
|
303
|
+
| `PRD.md` | Vision, personas, user stories |
|
|
304
|
+
| `Solution_Strategy.md` | Solution approach |
|
|
305
|
+
| `Specification.md` | Acceptance criteria, NFRs |
|
|
306
|
+
| `Pseudocode.md` | Algorithms, data flow |
|
|
307
|
+
| `Architecture.md` | C4 diagrams, tech stack |
|
|
308
|
+
| `Refinement.md` | Edge cases, testing strategy |
|
|
309
|
+
| `Completion.md` | Deploy, CI/CD, monitoring |
|
|
310
|
+
| `Research_Findings.md` | Market and tech research |
|
|
311
|
+
| `Final_Summary.md` | Executive summary |
|
|
312
|
+
| `C4_Diagrams.md` | Context / container / component |
|
|
313
|
+
| `ADR.md` | Architecture Decision Records |
|
|
314
|
+
|
|
315
|
+
Skill: `sparc-prd-mini` (internally chains explore + research + solve sub-phases).
|
|
316
|
+
|
|
317
|
+
### Phase 2 — Validation (5-agent swarm)
|
|
318
|
+
|
|
319
|
+
| Agent | Validates |
|
|
320
|
+
|---|---|
|
|
321
|
+
| `validator-stories` | INVEST criteria for user stories |
|
|
322
|
+
| `validator-acceptance` | SMART criteria for acceptance criteria |
|
|
323
|
+
| `validator-architecture` | Architecture consistency vs target constraints |
|
|
324
|
+
| `validator-pseudocode` | Algorithm cohesion |
|
|
325
|
+
| `validator-coherence` | Cross-document consistency |
|
|
326
|
+
|
|
327
|
+
**Verdicts:**
|
|
328
|
+
- 🟢 **READY** (score ≥70) → Phase 3
|
|
329
|
+
- 🟡 **CAVEATS** (50–69) → Phase 3 with notes (auto-retry once on 🟡 in AUTO mode)
|
|
330
|
+
- 🔴 **NEEDS WORK** (<50 or blockers) → return to Phase 1, max 3 retries → halt
|
|
331
|
+
|
|
332
|
+
Output: `docs/validation-report.md`, `docs/test-scenarios.md` (BDD).
|
|
85
333
|
|
|
86
|
-
|
|
334
|
+
### Phase 3 — Toolkit Generation (project-specific only)
|
|
335
|
+
|
|
336
|
+
**Does NOT generate pre-shipped commands** (those are installed via `init`). Generates only project-specific artifacts:
|
|
337
|
+
|
|
338
|
+
- `.claude/agents/{planner,code-reviewer,architect}.md` — project-aware
|
|
339
|
+
- `.claude/rules/{security,coding-style,testing}.md` — derived from Specification + Refinement
|
|
340
|
+
- `.claude/skills/{project-context,coding-standards}/` — domain knowledge
|
|
341
|
+
- `CLAUDE.md` enhanced with project content
|
|
342
|
+
- `.claude/feature-roadmap.json` — from PRD MVP scope
|
|
343
|
+
- `DEVELOPMENT_GUIDE.md`, `README.md`
|
|
344
|
+
- Conditional: `.mcp.json` (if external integrations detected), `.claude/commands/feature-ent.md` (if DDD docs detected)
|
|
345
|
+
|
|
346
|
+
Skill: `cc-toolkit-generator-enhanced` (9 modules with quality gates).
|
|
347
|
+
|
|
348
|
+
### Phase 4 — Finalize
|
|
349
|
+
|
|
350
|
+
- `docker-compose.yml`, `Dockerfile`, `.gitignore` (scaffold files)
|
|
351
|
+
- Git commit `chore: initial project setup from SPARC documentation`
|
|
352
|
+
- Final summary
|
|
353
|
+
|
|
354
|
+
---
|
|
87
355
|
|
|
88
356
|
## Skills Reference
|
|
89
357
|
|
|
@@ -94,13 +362,13 @@ After running `/replicate`, the toolkit generates additional commands, agents, r
|
|
|
94
362
|
| `goap-research-ed25519` | Verified research with Ed25519 anti-hallucination |
|
|
95
363
|
| `problem-solver-enhanced` | First principles + TRIZ (9 modules) |
|
|
96
364
|
| `requirements-validator` | INVEST/SMART validation + BDD scenarios |
|
|
97
|
-
| `brutal-honesty-review` | Unvarnished technical criticism |
|
|
365
|
+
| `brutal-honesty-review` | Unvarnished technical criticism by severity |
|
|
98
366
|
| `cc-toolkit-generator-enhanced` | Modular toolkit generator (9 modules, ~165K chars) + cross-project learning |
|
|
99
367
|
| `reverse-engineering-unicorn` | Company reverse engineering + playbook |
|
|
100
|
-
| `pipeline-forge` | Meta-skill: build AI pipelines from patterns |
|
|
368
|
+
| `pipeline-forge` | Meta-skill: build AI pipelines from extracted patterns |
|
|
101
369
|
| `knowledge-extractor` | Extract reusable knowledge from projects |
|
|
102
370
|
|
|
103
|
-
|
|
371
|
+
### Skill Architecture
|
|
104
372
|
|
|
105
373
|
Skills use a **composable module system** with three tiers:
|
|
106
374
|
|
|
@@ -122,270 +390,884 @@ The `cc-toolkit-generator-enhanced` skill is the largest component (~165K chars)
|
|
|
122
390
|
| 08-skill-composition | Dependency graph + path rewriting |
|
|
123
391
|
| 09-cross-project-learning | Pattern reuse via maturity model |
|
|
124
392
|
|
|
125
|
-
|
|
393
|
+
### `view()` cross-skill loading
|
|
394
|
+
|
|
395
|
+
Skills use `view()` for cross-skill loading at runtime:
|
|
396
|
+
|
|
397
|
+
```markdown
|
|
398
|
+
view() .claude/skills/explore/SKILL.md
|
|
399
|
+
view() .claude/skills/explore/references/questioning-techniques.md
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Claude Code resolves these references dynamically — when executing a skill, the LLM reads referenced files at the moment of use. This lets skill A delegate to skill B without duplicating content.
|
|
403
|
+
|
|
404
|
+
**Limitation:** only Claude Code supports this runtime mechanism. For other platforms (Codex, OpenCode), skill content must be **inlined** at install time. See [`MULTIPLATFORM_ROADMAP.md`](./MULTIPLATFORM_ROADMAP.md).
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Commands Reference
|
|
409
|
+
|
|
410
|
+
| Command | Purpose | When to use |
|
|
411
|
+
|---|---|---|
|
|
412
|
+
| `/replicate` | Full pipeline: idea → SPARC docs → toolkit | Start of a new project |
|
|
413
|
+
| `/start` | Bootstrap scaffold from SPARC docs | After `/replicate`, before feature work |
|
|
414
|
+
| `/run` | Autonomous feature build loop from roadmap | Regular development |
|
|
415
|
+
| `/go` | Router: picks `/plan`, `/feature`, or `/feature-ent` | One specific feature |
|
|
416
|
+
| `/next` | Show next feature from roadmap | Sprint navigation |
|
|
417
|
+
| `/plan` | Lightweight plan in `docs/plans/<id>.md` | Small task (≤3 files) |
|
|
418
|
+
| `/feature` | Full SPARC-mini cycle (PLAN → VALIDATE → IMPLEMENT → REVIEW) | Large feature (4+ files) |
|
|
419
|
+
| `/myinsights` | Capture or recall insights | After every non-trivial debug |
|
|
420
|
+
| `/docs` | Bilingual docs generator (RU + EN) | End of project or feature |
|
|
421
|
+
| `/harvest` | Extract reusable patterns | After completed project |
|
|
422
|
+
| `/deploy` | Deployment workflow (dev/staging/prod) | Deployment |
|
|
423
|
+
|
|
424
|
+
### `/run` — autonomous feature build
|
|
126
425
|
|
|
127
426
|
```bash
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
npx @dzhechkov/p-replicator doctor # Health check
|
|
427
|
+
/run mvp # only priority=mvp features
|
|
428
|
+
/run all # everything in roadmap
|
|
429
|
+
/run mvp --feature-branches # each feature in its own branch
|
|
430
|
+
/run mvp --feature-branches --auto-merge # also merge into main
|
|
133
431
|
```
|
|
134
432
|
|
|
135
|
-
|
|
433
|
+
**One iteration loop:**
|
|
136
434
|
|
|
137
435
|
```
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
436
|
+
while features in scope:
|
|
437
|
+
feature_id = /next # pick highest-priority
|
|
438
|
+
if no feature: break
|
|
439
|
+
/go feature_id # complexity router
|
|
440
|
+
verify (tests green, code committed)
|
|
441
|
+
mark roadmap entry: status=done
|
|
442
|
+
git commit + git push
|
|
142
443
|
```
|
|
143
444
|
|
|
144
|
-
|
|
445
|
+
**`--feature-branches` flag** (v1.5.0):
|
|
446
|
+
- Creates `feature/{NNN}-{id}` branch per feature (zero-padded 3-digit)
|
|
447
|
+
- Auto-stashes uncommitted changes with message `auto-stash before /run feature-branches`
|
|
448
|
+
- Optional `--auto-merge` merges branch into main on success
|
|
449
|
+
- Updates `feature-roadmap.json` with `number` + `branch` fields
|
|
145
450
|
|
|
146
|
-
|
|
451
|
+
### `/go` — intelligent router
|
|
147
452
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
453
|
+
`/go <id>` decides between:
|
|
454
|
+
- `/plan` — for small tasks (≤3 files, no new architecture)
|
|
455
|
+
- `/feature` — for large features (4+ files)
|
|
456
|
+
- `/feature-ent` — for cross-bounded-context features with new ADRs (only available if Phase 3 generated `feature-ent.md` from DDD docs)
|
|
457
|
+
|
|
458
|
+
### `/myinsights` — knowledge capture
|
|
459
|
+
|
|
460
|
+
Build a project-local knowledge base of "rakes" (development insights) that auto-inject into every session via the SessionStart hook.
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
/myinsights # interactive prompt
|
|
464
|
+
/myinsights "Prisma migrate dev fails silently if shadow DB unreachable. Workaround: set DATABASE_URL_SHADOW explicitly."
|
|
465
|
+
/myinsights recall prisma # search by keyword
|
|
151
466
|
```
|
|
152
467
|
|
|
153
|
-
|
|
468
|
+
Storage: `.claude/insights/index.md` — markdown log auto-committed by Stop hook.
|
|
154
469
|
|
|
155
|
-
|
|
470
|
+
### `/harvest` — knowledge extraction
|
|
156
471
|
|
|
157
|
-
-
|
|
158
|
-
- Identifies target customer segments (Jobs-To-Be-Done)
|
|
159
|
-
- Analyzes competitive landscape (Blue Ocean Canvas)
|
|
160
|
-
- Maps unit economics and monetization
|
|
161
|
-
- Produces a Product Discovery Brief used by Phase 1
|
|
472
|
+
Extract reusable patterns from a completed project into a knowledge base. Skill: `knowledge-extractor` (4 modules: agent review → classify → decontextualize → integrate).
|
|
162
473
|
|
|
163
|
-
|
|
474
|
+
---
|
|
164
475
|
|
|
165
|
-
|
|
476
|
+
## CLI Commands
|
|
166
477
|
|
|
167
|
-
|
|
168
|
-
|----------|---------|
|
|
169
|
-
| `PRD.md` | Product Requirements — vision, personas, user stories |
|
|
170
|
-
| `Solution_Strategy.md` | Problem analysis and solution approach |
|
|
171
|
-
| `Specification.md` | Detailed requirements with acceptance criteria |
|
|
172
|
-
| `Pseudocode.md` | Algorithms and data flow |
|
|
173
|
-
| `Architecture.md` | System design and component diagrams |
|
|
174
|
-
| `Refinement.md` | Edge cases, testing strategy |
|
|
175
|
-
| `Completion.md` | Deployment, CI/CD, monitoring |
|
|
176
|
-
| `Research_Findings.md` | Market and technology research |
|
|
177
|
-
| `Final_Summary.md` | Executive summary |
|
|
178
|
-
| `C4_Diagrams.md` | System context, container, and component diagrams |
|
|
179
|
-
| `ADR.md` | Architecture Decision Records |
|
|
478
|
+
### Subcommands
|
|
180
479
|
|
|
181
|
-
|
|
480
|
+
| Subcommand | Purpose | Exit code |
|
|
481
|
+
|---|---|---|
|
|
482
|
+
| `init` (default) | Install package in project | `0` ok, `1` if already installed without `--force` |
|
|
483
|
+
| `update` | Upgrade files to new version (preserves customizations) | `0` ok, `1` if not installed |
|
|
484
|
+
| `remove` | Delete package-tracked files | `0` ok, `1` if not installed |
|
|
485
|
+
| `list` | List installed components with metadata | `0` |
|
|
486
|
+
| `doctor` | Health check of pre-shipped contract + git PATH | `0` ok, `1` if anything broken |
|
|
487
|
+
| `verify` | Pre-shipped + post-/replicate verification | `0` ok, `1` if pre-shipped contract violated |
|
|
182
488
|
|
|
183
|
-
|
|
489
|
+
### Global flags
|
|
184
490
|
|
|
185
|
-
|
|
|
186
|
-
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
491
|
+
| Flag | Where it works | Description |
|
|
492
|
+
|---|---|---|
|
|
493
|
+
| `--force` | `init` | Overwrite existing files (with merge logic for settings.json) |
|
|
494
|
+
| `--dry-run` | `init`, `update`, `remove` | Preview without writing to disk |
|
|
495
|
+
| `--reset-settings` | `init --force`, `update` | Full overwrite of settings.json (disables merge) |
|
|
496
|
+
| `--help`, `-h` | any | Show help |
|
|
497
|
+
| `--version`, `-v` | any | Show package version |
|
|
498
|
+
|
|
499
|
+
### Slash command flags (inside Claude Code)
|
|
500
|
+
|
|
501
|
+
| Flag | Where | Description |
|
|
502
|
+
|---|---|---|
|
|
503
|
+
| `--feature-branches` | `/run`, `/go` | Each feature on its own branch `feature/{NNN}-{id}` |
|
|
504
|
+
| `--auto-merge` | `/run`, `/go` (with `--feature-branches`) | Auto-merge feature branch into main on success |
|
|
505
|
+
| `--skip-tests` | `/start` | Skip test generation |
|
|
506
|
+
| `--skip-seed` | `/start` | Skip DB seeding |
|
|
507
|
+
| `--dry-run` | `/start`, `/replicate` | Preview without writing |
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## Validation Cycle Details
|
|
512
|
+
|
|
513
|
+
The same validation pipeline runs in **`/replicate` Phase 2** and **`/feature` Phase 2**. Skill: `requirements-validator`.
|
|
514
|
+
|
|
515
|
+
### Validators (5-agent swarm)
|
|
516
|
+
|
|
517
|
+
| Agent | Criteria | Scoring |
|
|
518
|
+
|---|---|---|
|
|
519
|
+
| `validator-stories` | INVEST: Independent, Negotiable, Valuable, Estimable, Small, Testable | 0–100 per story, average |
|
|
520
|
+
| `validator-acceptance` | SMART: Specific, Measurable, Achievable, Relevant, Time-bound | 0–100 per AC, average |
|
|
521
|
+
| `validator-architecture` | Consistency vs target constraints (Distributed Monolith / Docker / VPS / MCP) | Pass/fail + score |
|
|
522
|
+
| `validator-pseudocode` | Algorithm cohesion + data-flow coherence | 0–100 |
|
|
523
|
+
| `validator-coherence` | Cross-document consistency (PRD↔Spec, Spec↔Pseudocode, etc.) | 0–100 |
|
|
524
|
+
|
|
525
|
+
### Verdicts
|
|
192
526
|
|
|
193
|
-
|
|
527
|
+
| Verdict | Threshold | Next |
|
|
528
|
+
|---|---|---|
|
|
529
|
+
| 🟢 **READY** | average ≥ 70, no blockers | Phase 3 (or IMPLEMENT in /feature) |
|
|
530
|
+
| 🟡 **CAVEATS** | 50–69, no blockers | Phase 3 with notes (AUTO mode auto-retries once on 🟡) |
|
|
531
|
+
| 🔴 **NEEDS WORK** | < 50 OR any blocker | Return to Phase 1 / PLAN, max 3 retries → halt |
|
|
194
532
|
|
|
195
|
-
|
|
533
|
+
After 3 retries with 🔴, the pipeline halts and surfaces to the user. The user can adjust the input or override.
|
|
196
534
|
|
|
197
|
-
###
|
|
535
|
+
### Output
|
|
198
536
|
|
|
199
|
-
|
|
537
|
+
- `docs/validation-report.md` (or `docs/features/<id>/validation-report.md` for /feature)
|
|
538
|
+
- `docs/test-scenarios.md` — BDD scenarios derived from acceptance criteria
|
|
200
539
|
|
|
201
|
-
|
|
202
|
-
|----------|-----------|
|
|
203
|
-
| **Commands** | `/start`, `/feature`, `/plan`, `/next`, `/deploy`, `/myinsights`, `/go`, `/run`, `/docs` |
|
|
204
|
-
| **Agents** | `planner`, `code-reviewer`, `architect` |
|
|
205
|
-
| **Rules** | `git-workflow`, `feature-lifecycle`, `security`, `coding-style`, `insights-capture` |
|
|
206
|
-
| **Skills** | `project-context`, `coding-standards`, `testing-patterns`, `feature-navigator` |
|
|
207
|
-
| **Hooks** | `SessionStart` (feature context), `Stop` (auto-commit) |
|
|
208
|
-
| **Project files** | `CLAUDE.md`, `DEVELOPMENT_GUIDE.md`, `README.md` |
|
|
540
|
+
### Post-implementation review (`brutal-honesty-review`)
|
|
209
541
|
|
|
210
|
-
|
|
211
|
-
- DDD patterns found → `/feature-ent`, enterprise lifecycle
|
|
212
|
-
- External APIs detected → security rules, secrets management
|
|
213
|
-
- Fitness functions defined → fitness validation rules
|
|
542
|
+
After `IMPLEMENT` phase (Phase 3 of /feature), `brutal-honesty-review` skill classifies findings by severity:
|
|
214
543
|
|
|
215
|
-
|
|
544
|
+
| Severity | Action |
|
|
545
|
+
|---|---|
|
|
546
|
+
| `blocker` | MUST fix before merge |
|
|
547
|
+
| `high` | Fix in this feature unless explicit deferral |
|
|
548
|
+
| `medium` | Optional fix; create follow-up issue |
|
|
549
|
+
| `low` | Logged, no action required |
|
|
216
550
|
|
|
217
|
-
|
|
551
|
+
Output: `docs/features/<id>/review-report.md`.
|
|
218
552
|
|
|
219
|
-
|
|
553
|
+
---
|
|
220
554
|
|
|
221
|
-
|
|
555
|
+
## Feature Lifecycle — `/feature` command
|
|
222
556
|
|
|
223
|
-
|
|
224
|
-
|---------|--------|
|
|
225
|
-
| `ok` | Proceed to next phase |
|
|
226
|
-
| `add [detail]` | Add information to current phase output |
|
|
227
|
-
| `fix [issue]` | Fix something in current output |
|
|
228
|
-
| `redo` | Redo the current phase |
|
|
229
|
-
| `skip` | Skip the current phase (not recommended for Phase 2) |
|
|
557
|
+
`/feature <id>` runs a 4-phase lifecycle: **PLAN → VALIDATE → IMPLEMENT → REVIEW**. Project-context-aware (reads `docs/`), checkpoint-driven, parallel where independent.
|
|
230
558
|
|
|
231
|
-
|
|
559
|
+
### Two entry modes
|
|
232
560
|
|
|
233
|
-
|
|
561
|
+
| Mode | When | Pre-conditions |
|
|
562
|
+
|---|---|---|
|
|
563
|
+
| **Mode 1: Post-/replicate** | Project bootstrapped via `/replicate` | CLAUDE.md, docs/, scaffold all generated |
|
|
564
|
+
| **Mode 2: Existing project** | Working project, adding features with verification | `init` ran on top of existing project |
|
|
234
565
|
|
|
235
|
-
|
|
566
|
+
The 4-phase pipeline is **identical in both modes**. Same validation thresholds, same retry logic, same brutal-honesty review.
|
|
236
567
|
|
|
237
|
-
|
|
568
|
+
### Phase 1 — PLAN (sparc-prd-mini)
|
|
238
569
|
|
|
239
|
-
|
|
570
|
+
Generates 5 SPARC docs in `docs/features/<feature>/`:
|
|
571
|
+
- `01_specification.md` — requirements + acceptance criteria
|
|
572
|
+
- `02_pseudocode.md` — algorithms + data flow
|
|
573
|
+
- `03_architecture.md` — component placement + dependencies
|
|
574
|
+
- `04_refinement.md` — edge cases + error paths
|
|
575
|
+
- `05_completion.md` — testing + deployment notes
|
|
576
|
+
|
|
577
|
+
### Phase 2 — VALIDATE (requirements-validator)
|
|
578
|
+
|
|
579
|
+
Same swarm-of-5 as `/replicate` Phase 2. Verdict 🟢/🟡/🔴 with same retry logic.
|
|
580
|
+
|
|
581
|
+
### Phase 3 — IMPLEMENT (parallel agents)
|
|
582
|
+
|
|
583
|
+
1. Identify independent work units from Phase 1 Architecture
|
|
584
|
+
2. Spawn parallel `Task` tool calls, one per unit
|
|
585
|
+
3. Each Task: implement + write tests + commit
|
|
586
|
+
4. Coordinator merges/integrates
|
|
587
|
+
5. Run full test suite
|
|
588
|
+
|
|
589
|
+
**Quality gate:** tests pass, lint clean, build succeeds.
|
|
590
|
+
|
|
591
|
+
### Phase 4 — REVIEW (brutal-honesty-review)
|
|
592
|
+
|
|
593
|
+
Severity-classified findings. Critical (`blocker` | `high`) MUST be fixed.
|
|
594
|
+
|
|
595
|
+
### AUTO mode (called from /go or /run)
|
|
596
|
+
|
|
597
|
+
- Phase 1: proceed if all docs exist
|
|
598
|
+
- Phase 2: proceed if 🟢 or 🟡; auto-retry once on 🔴
|
|
599
|
+
- Phase 3: proceed if tests + lint + build green
|
|
600
|
+
- Phase 4: auto-fix `high` if straightforward; halt on `blocker`
|
|
601
|
+
|
|
602
|
+
### Final steps
|
|
603
|
+
|
|
604
|
+
1. Update `.claude/feature-roadmap.json`: status `in_progress` → `done`
|
|
605
|
+
2. Commit: `feat(<feature>): complete lifecycle [phases 1-4]`
|
|
606
|
+
3. Push (if `--feature-branches` mode: also create branch + optional auto-merge)
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
## Statusline Dashboard
|
|
611
|
+
|
|
612
|
+
**6-line ANSI dashboard** above Claude Code's prompt with real-time pipeline + roadmap + toolkit + status metrics.
|
|
240
613
|
|
|
241
614
|
```
|
|
242
|
-
|
|
615
|
+
P-Replicator V1.5.x ● user │ Sonnet 4.7
|
|
616
|
+
🚀 Pipeline /<cmd> ▓▓▓░░░░ 50% │ Phase: VALIDATE (2/4) │ Last: /replicate
|
|
617
|
+
🎯 Roadmap [●●●○○○○○] mvp 3/8 │ Done 5/12 │ ▶ auth-jwt │ Domain: banking
|
|
618
|
+
📊 SPARC ●11/11 │ 🟢 78/100 │ Plans ●3 │ ADRs ●2 │ Harvest 2026-05-05
|
|
619
|
+
🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●5+2 │ Hooks ●6/6
|
|
620
|
+
💡 Insights ●12 (2026-05-06) │ Tests 85/85 ✓ │ MCP ●1/1 │ Settings ✓ │ 🧬 Keysarium ✓
|
|
243
621
|
```
|
|
244
622
|
|
|
245
|
-
|
|
623
|
+
### Sources (heuristic + state-file)
|
|
624
|
+
|
|
625
|
+
| Metric | Source |
|
|
626
|
+
|---|---|
|
|
627
|
+
| Pipeline command + phase + progress | `.claude/.p-replicator-state.json` |
|
|
628
|
+
| Roadmap progress | `.claude/feature-roadmap.json` |
|
|
629
|
+
| SPARC count | `docs/{PRD,Architecture,...}.md` |
|
|
630
|
+
| Validation score | regex extract from `docs/validation-report.md` |
|
|
631
|
+
| Plans count | `docs/plans/*.md` |
|
|
632
|
+
| ADRs count | `docs/ADR.md` H2/H3 headings, or `docs/adr/*.md`, or `docs/ddd/adr/*.md` |
|
|
633
|
+
| Insights count + last date | `## YYYY-MM-DD` in `.claude/insights/index.md` |
|
|
634
|
+
| Toolkit counts | filesystem walks of `.claude/{skills,commands,agents,rules,hooks}/` |
|
|
635
|
+
| Settings status | deep-equals current vs `manifest.shippedDefaults` |
|
|
636
|
+
| MCP servers | `.mcp.json` |
|
|
637
|
+
| Domain | keyword grep in `CLAUDE.md` |
|
|
638
|
+
| Last harvest | `TOOLKIT_HARVEST.md` mtime |
|
|
639
|
+
| Last test | optional `.claude/.last-test.json` cache |
|
|
640
|
+
|
|
641
|
+
### Defensive design
|
|
642
|
+
|
|
643
|
+
Every section wrapped in `safeRun()` with fallback — one parse error doesn't break the whole status bar.
|
|
246
644
|
|
|
247
|
-
|
|
645
|
+
**Stale state:** state file older than 30 minutes is ignored (Pipeline section shows `idle`).
|
|
248
646
|
|
|
647
|
+
**Disable statusline:** remove the `statusLine` field from `.claude/settings.json`. The deletion is preserved on next `update` thanks to merge logic.
|
|
648
|
+
|
|
649
|
+
For internals, see [admin guide](./README/eng/03_admin_guide.md#statusline--dashboard) and [`documentation/07-dashboard-howto.md`](../../documentation/07-dashboard-howto.md) (in source repo).
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
653
|
+
## Hooks System
|
|
654
|
+
|
|
655
|
+
`p-replicator` ships **6 cross-platform Node scripts** in `.claude/hooks/`:
|
|
656
|
+
|
|
657
|
+
| Hook | Event | Purpose |
|
|
658
|
+
|---|---|---|
|
|
659
|
+
| `session-insights.cjs` | SessionStart | Inject 3 recent insights from `.claude/insights/index.md` to stdout (Claude Code captures into context) |
|
|
660
|
+
| `autocommit-roadmap.cjs` | Stop | Auto-commit `.claude/feature-roadmap.json` if changed |
|
|
661
|
+
| `autocommit-insights.cjs` | Stop | Auto-commit `.claude/insights/` if changed |
|
|
662
|
+
| `autocommit-plans.cjs` | Stop | Auto-commit `docs/plans/` if changed |
|
|
663
|
+
| `statusline.cjs` | (statusLine config) | Multi-line dashboard above the prompt |
|
|
664
|
+
| `state-update.cjs` | (utility) | Argv-driven helper for writing `.claude/.p-replicator-state.json` |
|
|
665
|
+
|
|
666
|
+
### Cross-platform discipline
|
|
667
|
+
|
|
668
|
+
All 4 autocommit scripts use `execFileSync('git', [...])` (no shell pipes, no `2>/dev/null`/`|| true`). Works identically on Windows-cmd, bash, PowerShell.
|
|
669
|
+
|
|
670
|
+
**Each script is defensive:** wrapped in try/catch, always exits 0 (best-effort, never blocks the session).
|
|
671
|
+
|
|
672
|
+
### State file for live progress
|
|
673
|
+
|
|
674
|
+
`.claude/.p-replicator-state.json` — ephemeral state, updated by commands during pipeline execution:
|
|
675
|
+
|
|
676
|
+
```json
|
|
677
|
+
{
|
|
678
|
+
"currentCommand": "/feature",
|
|
679
|
+
"currentPhase": { "name": "VALIDATE", "index": 2, "total": 4, "progress": 0.5 },
|
|
680
|
+
"lastCommand": "/replicate",
|
|
681
|
+
"lastFeature": "auth-jwt",
|
|
682
|
+
"updatedAt": "2026-05-07T..."
|
|
683
|
+
}
|
|
249
684
|
```
|
|
250
|
-
|
|
685
|
+
|
|
686
|
+
Updated via `state-update.cjs`:
|
|
687
|
+
|
|
688
|
+
```bash
|
|
689
|
+
node .claude/hooks/state-update.cjs \
|
|
690
|
+
--command /feature \
|
|
691
|
+
--phase VALIDATE \
|
|
692
|
+
--index 2 \
|
|
693
|
+
--total 4 \
|
|
694
|
+
--progress 0.5
|
|
251
695
|
```
|
|
252
696
|
|
|
253
|
-
|
|
697
|
+
Pipeline commands optionally call this script (via Bash tool) so statusline shows real progress.
|
|
698
|
+
|
|
699
|
+
**⚠️ Recommendation:** add to `.gitignore`:
|
|
254
700
|
|
|
255
|
-
|
|
701
|
+
```
|
|
702
|
+
.claude/.p-replicator-state.json
|
|
703
|
+
.claude/.last-test.json
|
|
704
|
+
```
|
|
256
705
|
|
|
706
|
+
---
|
|
707
|
+
|
|
708
|
+
## Roadmap & Insights
|
|
709
|
+
|
|
710
|
+
### Feature roadmap (`.claude/feature-roadmap.json`)
|
|
711
|
+
|
|
712
|
+
**File:** generated in `/replicate` Phase 3 from PRD MVP scope, or by hand for Mode 2.
|
|
713
|
+
|
|
714
|
+
**Schema (post v1.5.0):**
|
|
715
|
+
|
|
716
|
+
```json
|
|
717
|
+
{
|
|
718
|
+
"version": "1.0",
|
|
719
|
+
"features": [
|
|
720
|
+
{
|
|
721
|
+
"id": "auth-jwt",
|
|
722
|
+
"number": 1,
|
|
723
|
+
"branch": "feature/001-auth-jwt",
|
|
724
|
+
"name": "JWT-based authentication",
|
|
725
|
+
"priority": "mvp",
|
|
726
|
+
"status": "next",
|
|
727
|
+
"complexity": "medium",
|
|
728
|
+
"estimated_hours": "2-4",
|
|
729
|
+
"blockers": [],
|
|
730
|
+
"expected_files": ["packages/backend/src/auth/jwt.ts"],
|
|
731
|
+
"depends_on": []
|
|
732
|
+
}
|
|
733
|
+
]
|
|
734
|
+
}
|
|
257
735
|
```
|
|
258
|
-
|
|
736
|
+
|
|
737
|
+
**Lifecycle states:** `planned` → `next` → `in_progress` → `done` (or `blocked`).
|
|
738
|
+
|
|
739
|
+
**`number` and `branch`** are populated by `--feature-branches` flag. Auto-commit via `autocommit-roadmap.cjs` (Stop hook).
|
|
740
|
+
|
|
741
|
+
### Insights system
|
|
742
|
+
|
|
743
|
+
**Storage:** `.claude/insights/index.md` (markdown log).
|
|
744
|
+
|
|
745
|
+
**Entry format:**
|
|
746
|
+
|
|
747
|
+
```markdown
|
|
748
|
+
## YYYY-MM-DD — short title
|
|
749
|
+
|
|
750
|
+
**Tags:** tag1, tag2, tag3
|
|
751
|
+
|
|
752
|
+
**Problem:**
|
|
753
|
+
What happened (1-3 sentences).
|
|
754
|
+
|
|
755
|
+
**Solution:**
|
|
756
|
+
What fixed it (1-5 sentences with code if relevant).
|
|
757
|
+
|
|
758
|
+
**References:** file:line or commit hash or external link
|
|
759
|
+
|
|
760
|
+
---
|
|
259
761
|
```
|
|
260
762
|
|
|
261
|
-
|
|
763
|
+
**Lifecycle:**
|
|
764
|
+
- ≤ 50 entries → single `index.md`
|
|
765
|
+
- > 50 → split into archive `<YYYY-MM>.md` with `index.md` as TOC
|
|
766
|
+
- Never delete — only supersede via `**Status:** superseded by <link>`
|
|
767
|
+
|
|
768
|
+
**Tag conventions:**
|
|
769
|
+
- ✅ `prisma-migration`, `postgres-timezone`, `docker-compose-network`
|
|
770
|
+
- ❌ `bug`, `fix`, `important` (too generic — recall fails)
|
|
771
|
+
|
|
772
|
+
**Auto-injection:** `SessionStart` hook (`session-insights.cjs`) reads top 3 recent entries to stdout, Claude Code injects into initial session context.
|
|
773
|
+
|
|
774
|
+
---
|
|
775
|
+
|
|
776
|
+
## Architecture Highlights
|
|
777
|
+
|
|
778
|
+
### Two-tier model: Pre-shipped vs Project-generated
|
|
779
|
+
|
|
780
|
+
| Tier | Created by | Lives in | Updated |
|
|
781
|
+
|---|---|---|---|
|
|
782
|
+
| **Pre-shipped** | `npx p-replicator init` | `.claude/{skills,commands,agents,rules,hooks}/` + `settings.json` | On each package upgrade |
|
|
783
|
+
| **Project-generated** | `/replicate` Phase 3 (LLM execution) | `CLAUDE.md`, `.claude/agents/planner.md`, `docs/`, etc. | Only on regeneration |
|
|
784
|
+
|
|
785
|
+
This is **the main fix of v1.4.0** — previously `/replicate` Phase 3 tried to generate ALL artifacts (including generic commands like `/run`, `/feature`), which led to flaky outputs (LLM compression, missed templates). Post-v1.4.0, generic commands are pre-shipped, Phase 3 generates ONLY project-specific artifacts.
|
|
262
786
|
|
|
263
|
-
###
|
|
787
|
+
### SSOT: `utils.COMPONENTS`
|
|
264
788
|
|
|
789
|
+
Single source of truth for what's shipped and what's generated, in `src/utils.js`. **Any future edit to items automatically updates 5 surfaces** (init, update, doctor, verify, list, cli help) — eliminating drift issues that existed pre-v1.3.1.
|
|
790
|
+
|
|
791
|
+
### Settings.json merge logic (v1.4.2 + v1.4.3)
|
|
792
|
+
|
|
793
|
+
`init --force` and `update` use `mergeSettingsJson(existing, template)` to preserve user customizations:
|
|
794
|
+
|
|
795
|
+
- **User-added hook** (absent from template) → preserved
|
|
796
|
+
- **User-modified default** (changed command) → treated as user-added → preserved
|
|
797
|
+
- **Identical command** in template and user → de-duped
|
|
798
|
+
- **New hook in template** → added to user's settings
|
|
799
|
+
- **Removed default** (was in old template, gone from new) → orphan-detected and removed
|
|
800
|
+
|
|
801
|
+
**Identity model:** hooks compared by `command` string. **Override:** `--reset-settings` flag disables merge — full overwrite.
|
|
802
|
+
|
|
803
|
+
### Manifest schema (`.p-replicator.json`)
|
|
804
|
+
|
|
805
|
+
```json
|
|
806
|
+
{
|
|
807
|
+
"version": "1.5.x",
|
|
808
|
+
"installedAt": "2026-05-07T12:00:00.000Z",
|
|
809
|
+
"components": ["agents", "commands", "hooks", "rules", "settings", "skills"],
|
|
810
|
+
"files": ["...sorted list of all installed files..."],
|
|
811
|
+
"shippedDefaults": {
|
|
812
|
+
"settings.json": { "hooks": {...}, "statusLine": {...} }
|
|
813
|
+
}
|
|
814
|
+
}
|
|
265
815
|
```
|
|
266
|
-
|
|
267
|
-
|
|
816
|
+
|
|
817
|
+
`shippedDefaults` is the baseline for orphan detection on upgrade (v1.4.3+). Backward-compatible: pre-v1.4.3 manifests load without error, orphan detection skipped on first upgrade.
|
|
818
|
+
|
|
819
|
+
For complete internals, see [`README/eng/05_architecture.md`](./README/eng/05_architecture.md) — covers cross-platform hooks, sync-templates merge mode, settings merge algorithm, statusline architecture.
|
|
820
|
+
|
|
821
|
+
---
|
|
822
|
+
|
|
823
|
+
## Configuration
|
|
824
|
+
|
|
825
|
+
### `.claude/settings.json`
|
|
826
|
+
|
|
827
|
+
Default structure after `init`:
|
|
828
|
+
|
|
829
|
+
```json
|
|
830
|
+
{
|
|
831
|
+
"$schema": "https://www.schemastore.org/claude-code-settings.json",
|
|
832
|
+
"_comment": "Default hooks + statusline shipped by @dzhechkov/p-replicator init.",
|
|
833
|
+
"statusLine": {
|
|
834
|
+
"type": "command",
|
|
835
|
+
"command": "node .claude/hooks/statusline.cjs"
|
|
836
|
+
},
|
|
837
|
+
"hooks": {
|
|
838
|
+
"SessionStart": [
|
|
839
|
+
{
|
|
840
|
+
"matcher": "*",
|
|
841
|
+
"hooks": [
|
|
842
|
+
{ "type": "command", "command": "node .claude/hooks/session-insights.cjs", "timeout": 5 }
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
"Stop": [
|
|
847
|
+
{
|
|
848
|
+
"matcher": "*",
|
|
849
|
+
"hooks": [
|
|
850
|
+
{ "type": "command", "command": "node .claude/hooks/autocommit-roadmap.cjs", "timeout": 10 },
|
|
851
|
+
{ "type": "command", "command": "node .claude/hooks/autocommit-insights.cjs", "timeout": 10 },
|
|
852
|
+
{ "type": "command", "command": "node .claude/hooks/autocommit-plans.cjs", "timeout": 10 }
|
|
853
|
+
]
|
|
854
|
+
}
|
|
855
|
+
]
|
|
856
|
+
}
|
|
857
|
+
}
|
|
268
858
|
```
|
|
269
859
|
|
|
270
|
-
|
|
860
|
+
**Customization:** add new hooks or event types — preserved on `init --force` or `update` thanks to merge logic.
|
|
271
861
|
|
|
272
|
-
|
|
862
|
+
**Disable individual default hooks:** delete from `settings.json` after `init`. The deletion is preserved on next `update` (orphan detection only removes hooks **previously shipped** but absent in **new** template — your manual deletion is a user customization).
|
|
273
863
|
|
|
274
|
-
|
|
864
|
+
### MCP servers (`.mcp.json`)
|
|
275
865
|
|
|
276
|
-
|
|
866
|
+
Project-local MCP server config:
|
|
277
867
|
|
|
868
|
+
```json
|
|
869
|
+
{
|
|
870
|
+
"mcpServers": {
|
|
871
|
+
"filesystem": {
|
|
872
|
+
"command": "npx",
|
|
873
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
|
|
874
|
+
},
|
|
875
|
+
"github": {
|
|
876
|
+
"command": "npx",
|
|
877
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
878
|
+
"env": { "GITHUB_TOKEN": "..." }
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
278
882
|
```
|
|
279
|
-
|
|
280
|
-
|
|
883
|
+
|
|
884
|
+
Statusline shows MCP server count. `/replicate` Phase 3 auto-generates `.mcp.json` when external integrations are detected.
|
|
885
|
+
|
|
886
|
+
### Keysarium integration
|
|
887
|
+
|
|
888
|
+
If `.keysarium.json` (from sibling `@dzhechkov/keysarium` package) is detected:
|
|
889
|
+
|
|
890
|
+
- `init` shows an integration banner
|
|
891
|
+
- Statusline shows `🧬 Keysarium ✓`
|
|
892
|
+
- `/replicate` Phase 3 doesn't duplicate skills already provided by Keysarium
|
|
893
|
+
|
|
894
|
+
---
|
|
895
|
+
|
|
896
|
+
## Update workflow
|
|
897
|
+
|
|
898
|
+
```bash
|
|
899
|
+
# Safe upgrade with preserved customizations:
|
|
900
|
+
npx @dzhechkov/p-replicator@latest update
|
|
901
|
+
|
|
902
|
+
# Or via init --force (also preserves customizations):
|
|
903
|
+
npx @dzhechkov/p-replicator@latest init --force
|
|
904
|
+
|
|
905
|
+
# Full reset of settings.json to defaults (loses custom hooks):
|
|
906
|
+
npx @dzhechkov/p-replicator@latest init --force --reset-settings
|
|
281
907
|
```
|
|
282
908
|
|
|
283
|
-
|
|
909
|
+
### What the merge logic does
|
|
284
910
|
|
|
285
|
-
|
|
911
|
+
1. Reads `manifest.shippedDefaults['settings.json']` (what we shipped previously)
|
|
912
|
+
2. Reads current `templates/.claude/settings.json` (new template)
|
|
913
|
+
3. Reads `.claude/settings.json` (user's current)
|
|
914
|
+
4. **Orphan detection:** removes hooks present in old template but missing in new
|
|
915
|
+
5. **Merge:** adds hooks from new template that aren't already in user's current
|
|
916
|
+
6. User-added hooks (never in old template) are **preserved**
|
|
286
917
|
|
|
287
|
-
|
|
918
|
+
After upgrade, run `verify` to confirm:
|
|
288
919
|
|
|
289
|
-
|
|
920
|
+
```bash
|
|
921
|
+
npx @dzhechkov/p-replicator verify
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
---
|
|
925
|
+
|
|
926
|
+
## Troubleshooting
|
|
927
|
+
|
|
928
|
+
### `init` refuses: "P-Replicator is already installed"
|
|
290
929
|
|
|
930
|
+
```bash
|
|
931
|
+
npx @dzhechkov/p-replicator update # safe upgrade
|
|
932
|
+
npx @dzhechkov/p-replicator init --force # forced re-install
|
|
933
|
+
npx @dzhechkov/p-replicator init --force --reset-settings # full reset
|
|
291
934
|
```
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
935
|
+
|
|
936
|
+
### Missing files after `init`
|
|
937
|
+
|
|
938
|
+
```bash
|
|
939
|
+
npx @dzhechkov/p-replicator doctor # see what's missing
|
|
940
|
+
npx @dzhechkov/p-replicator init --force # repair
|
|
295
941
|
```
|
|
296
942
|
|
|
297
|
-
|
|
943
|
+
### Install went to `~/node_modules` instead of project
|
|
298
944
|
|
|
299
|
-
|
|
945
|
+
Cause: no `package.json` in your project, npm walks up and finds one in home directory.
|
|
300
946
|
|
|
301
|
-
|
|
947
|
+
```bash
|
|
948
|
+
npm init -y
|
|
949
|
+
npx @dzhechkov/p-replicator init
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
### Statusline doesn't appear
|
|
953
|
+
|
|
954
|
+
Checks:
|
|
955
|
+
1. Claude Code version supports `statusLine` config? Update Claude Code.
|
|
956
|
+
2. `statusLine` field present in `.claude/settings.json`?
|
|
957
|
+
3. Script runs directly:
|
|
302
958
|
|
|
959
|
+
```bash
|
|
960
|
+
node .claude/hooks/statusline.cjs
|
|
303
961
|
```
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
962
|
+
|
|
963
|
+
Should print 6 lines of ANSI output. If it errors:
|
|
964
|
+
|
|
965
|
+
```bash
|
|
966
|
+
node .claude/hooks/statusline.cjs 2>&1
|
|
307
967
|
```
|
|
308
968
|
|
|
309
|
-
|
|
969
|
+
Likely cause: corrupt JSON or missing `.p-replicator.json`.
|
|
310
970
|
|
|
971
|
+
### Hooks aren't auto-committing
|
|
972
|
+
|
|
973
|
+
```bash
|
|
974
|
+
npx @dzhechkov/p-replicator doctor
|
|
311
975
|
```
|
|
312
|
-
|
|
313
|
-
|
|
976
|
+
|
|
977
|
+
Look for `✓ git on PATH` in Prerequisites section. Also verify `.git` exists:
|
|
978
|
+
|
|
979
|
+
```bash
|
|
980
|
+
git rev-parse --git-dir
|
|
314
981
|
```
|
|
315
982
|
|
|
316
|
-
|
|
983
|
+
Debug a specific hook:
|
|
317
984
|
|
|
985
|
+
```bash
|
|
986
|
+
node .claude/hooks/autocommit-roadmap.cjs
|
|
987
|
+
echo "Exit: $?"
|
|
988
|
+
git log -1 --format="%s"
|
|
318
989
|
```
|
|
319
|
-
|
|
990
|
+
|
|
991
|
+
### Statusline shows "Settings ⚠️ merged" but I didn't change anything
|
|
992
|
+
|
|
993
|
+
Cause: some process modified `settings.json` (formatting, whitespace, ordering). Statusline compares via deep-equals on sorted keys.
|
|
994
|
+
|
|
995
|
+
```bash
|
|
996
|
+
npx @dzhechkov/p-replicator init --force --reset-settings
|
|
320
997
|
```
|
|
321
998
|
|
|
322
|
-
###
|
|
999
|
+
### Settings.json lost my custom hooks after update
|
|
1000
|
+
|
|
1001
|
+
This was a bug pre-v1.4.2. In v1.4.2+, `update` and `init --force` use `mergeSettingsJson` which preserves user customizations.
|
|
323
1002
|
|
|
1003
|
+
If you're on v1.4.1 or earlier:
|
|
1004
|
+
|
|
1005
|
+
```bash
|
|
1006
|
+
npx @dzhechkov/p-replicator@latest update
|
|
324
1007
|
```
|
|
325
|
-
|
|
1008
|
+
|
|
1009
|
+
Restore lost hooks from git history:
|
|
1010
|
+
|
|
1011
|
+
```bash
|
|
1012
|
+
git log -p --follow -- .claude/settings.json
|
|
326
1013
|
```
|
|
327
1014
|
|
|
328
|
-
###
|
|
1015
|
+
### `/run --feature-branches` immediately fails "not on main"
|
|
329
1016
|
|
|
330
|
-
|
|
1017
|
+
Cause: you're on a feature branch. Switch to main:
|
|
331
1018
|
|
|
332
|
-
|
|
1019
|
+
```bash
|
|
1020
|
+
git checkout main
|
|
1021
|
+
/run mvp --feature-branches
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
### `--feature-branches` lost my unsaved changes
|
|
333
1025
|
|
|
334
|
-
|
|
1026
|
+
They're stashed:
|
|
335
1027
|
|
|
1028
|
+
```bash
|
|
1029
|
+
git stash list
|
|
1030
|
+
git stash show stash@{0}
|
|
1031
|
+
git stash pop
|
|
336
1032
|
```
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
1033
|
+
|
|
1034
|
+
`p-replicator` auto-stashes with message `auto-stash before /run feature-branches`.
|
|
1035
|
+
|
|
1036
|
+
### `/replicate` didn't generate expected commands (`/run`, `/feature`, ...)
|
|
1037
|
+
|
|
1038
|
+
This is solved in v1.4.0+. All 11 generic commands are now pre-shipped via `init`. If you're on an old version:
|
|
1039
|
+
|
|
1040
|
+
```bash
|
|
1041
|
+
npx @dzhechkov/p-replicator@latest init --force
|
|
1042
|
+
npx @dzhechkov/p-replicator verify
|
|
340
1043
|
```
|
|
341
1044
|
|
|
342
|
-
###
|
|
1045
|
+
### Insights aren't auto-injected into new sessions
|
|
1046
|
+
|
|
1047
|
+
Checks:
|
|
1048
|
+
1. `.claude/insights/index.md` exists with entries?
|
|
1049
|
+
2. Hook works:
|
|
1050
|
+
```bash
|
|
1051
|
+
node .claude/hooks/session-insights.cjs # should print recent insights
|
|
1052
|
+
```
|
|
1053
|
+
3. SessionStart hook configured in `settings.json`?
|
|
343
1054
|
|
|
1055
|
+
If all 3 OK but still nothing — Claude Code may cache. Restart `claude`.
|
|
1056
|
+
|
|
1057
|
+
### Statusline lags on every command
|
|
1058
|
+
|
|
1059
|
+
```bash
|
|
1060
|
+
time node .claude/hooks/statusline.cjs # how many seconds?
|
|
344
1061
|
```
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
1062
|
+
|
|
1063
|
+
Should be < 100ms. If > 1s, check `docs/` size:
|
|
1064
|
+
|
|
1065
|
+
```bash
|
|
1066
|
+
du -sh docs/
|
|
1067
|
+
find docs/ -type f -name "*.md" | wc -l
|
|
349
1068
|
```
|
|
350
1069
|
|
|
351
|
-
|
|
1070
|
+
Workaround: temporarily disable statusline by removing the `statusLine` field in `.claude/settings.json`. See [KNOWN_LIMITATIONS.md](./KNOWN_LIMITATIONS.md) item L6 for future enhancement (`STATUSLINE_PROFILE=1` env var).
|
|
1071
|
+
|
|
1072
|
+
For full troubleshooting (15+ issues with detailed diagnostics), see [`README/eng/06_troubleshooting.md`](./README/eng/06_troubleshooting.md).
|
|
1073
|
+
|
|
1074
|
+
---
|
|
1075
|
+
|
|
1076
|
+
## Migration
|
|
352
1077
|
|
|
1078
|
+
| From → To | What you get | Migration cost |
|
|
1079
|
+
|---|---|---|
|
|
1080
|
+
| 1.3.x → 1.5.x | All pre-shipped commands + statusline + feature-branches + merge logic + Mode 2 | `init --force` (preserves customizations) |
|
|
1081
|
+
| 1.4.0 → 1.4.1 | Cross-platform hooks + sync merge mode | `init --force` |
|
|
1082
|
+
| 1.4.1 → 1.4.2 | Settings merge (preserve customizations) | `init --force` is safe (preserves) |
|
|
1083
|
+
| 1.4.2 → 1.4.3 | Orphan detection | First upgrade lacks baseline — re-run `init --force` to populate |
|
|
1084
|
+
| 1.4.3 → 1.5.0 | Statusline + `--feature-branches` | `update` or `init --force` |
|
|
1085
|
+
| 1.5.0 → 1.5.1 | "Existing tech docs" workflow formalized | docs only — no migration |
|
|
1086
|
+
| 1.5.1 → 1.5.2 | Mode 2 (existing project + /feature) formalized | docs only — no migration |
|
|
1087
|
+
|
|
1088
|
+
**No breaking changes** between any versions. All upgrades are backward-compatible.
|
|
1089
|
+
|
|
1090
|
+
After any upgrade — `verify` to confirm contract:
|
|
1091
|
+
|
|
1092
|
+
```bash
|
|
1093
|
+
npx @dzhechkov/p-replicator verify
|
|
353
1094
|
```
|
|
354
|
-
|
|
1095
|
+
|
|
1096
|
+
---
|
|
1097
|
+
|
|
1098
|
+
## Test Infrastructure
|
|
1099
|
+
|
|
1100
|
+
**Suite:** 105 tests, 36 suites, ~25 sec runtime.
|
|
1101
|
+
|
|
1102
|
+
| Layer | File | Coverage |
|
|
1103
|
+
|---|---|---|
|
|
1104
|
+
| **Unit** | `tests/unit/utils.test.js` (54 tests) | Pure functions: createManifest, mergeSettingsJson, removeOrphanHooks, getItemRelativePath, parseToolkit logic |
|
|
1105
|
+
| **E2E** | `tests/e2e/lifecycle.test.js` (48 tests) | Full CLI lifecycle, hooks installation, settings merge edge cases, statusline output, --feature-branches docs |
|
|
1106
|
+
| **Snapshot** | `tests/snapshot/templates.test.js` (3 tests) | SHA-256 baseline of all 115 files in `templates/` |
|
|
1107
|
+
|
|
1108
|
+
**Meta-tests** verify consistency between documents:
|
|
1109
|
+
- `replicate-pipeline.md` mentions every pre-shipped command (no orphan in rule)
|
|
1110
|
+
- `replicate.md` Phase 3 doesn't claim "Generate `<pre-shipped>.md`" (no spec drift)
|
|
1111
|
+
|
|
1112
|
+
**Snapshot baseline** regenerated via `npm run snapshot:baseline` after intentional template changes.
|
|
1113
|
+
|
|
1114
|
+
```bash
|
|
1115
|
+
npm test # full suite
|
|
1116
|
+
npm run test:unit # unit only
|
|
1117
|
+
npm run test:e2e # e2e only
|
|
1118
|
+
npm run test:snapshot # snapshot only
|
|
355
1119
|
```
|
|
356
1120
|
|
|
357
|
-
|
|
1121
|
+
---
|
|
1122
|
+
|
|
1123
|
+
## Known Limitations
|
|
1124
|
+
|
|
1125
|
+
For currently-open improvement items — see [`KNOWN_LIMITATIONS.md`](./KNOWN_LIMITATIONS.md) (8 entries: 3 medium, 5 low priority).
|
|
1126
|
+
|
|
1127
|
+
**Highlights:**
|
|
1128
|
+
- **M1** — `--feature-branches` behavior tested only via documentation-presence (not e2e git workflow)
|
|
1129
|
+
- **M2** — No formal `--from-docs` CLI flag (workflow works via natural-language only)
|
|
1130
|
+
- **M3** — `/feature` requires standard SPARC doc paths (no `--prd-path` flag)
|
|
1131
|
+
- **L5** — `.p-replicator-state.json` not auto-gitignored
|
|
1132
|
+
- **L6** — Statusline could profile per-section if slow
|
|
1133
|
+
|
|
1134
|
+
For multiplatform support roadmap (Codex, OpenCode, KiloCode) — see [`MULTIPLATFORM_ROADMAP.md`](./MULTIPLATFORM_ROADMAP.md).
|
|
1135
|
+
|
|
1136
|
+
---
|
|
358
1137
|
|
|
359
|
-
##
|
|
1138
|
+
## Changelog Highlights
|
|
360
1139
|
|
|
361
|
-
|
|
1140
|
+
### v1.5.2 — 2026-05-07 (Mode 2 documentation)
|
|
362
1141
|
|
|
363
|
-
|
|
1142
|
+
Formalized **"Feature workflow in existing project (Mode 2)"** across all documentation surfaces. Pure docs/spec patch — no code changes.
|
|
364
1143
|
|
|
365
|
-
|
|
1144
|
+
### v1.5.1 — 2026-05-07 (Existing-docs workflow)
|
|
366
1145
|
|
|
367
|
-
|
|
1146
|
+
Formalized **"Starting from existing technical documentation"** workflow for `/replicate`. New build.js link-rewriter for HTML guide.
|
|
368
1147
|
|
|
369
|
-
5.
|
|
1148
|
+
### v1.5.0 — 2026-05-07 (Statusline + feature-branches)
|
|
370
1149
|
|
|
371
|
-
|
|
1150
|
+
- ✨ **Statusline dashboard** (RuFlo-style 6-line bar) via `templates/.claude/hooks/statusline.cjs`
|
|
1151
|
+
- ✨ **`--feature-branches` flag** for `/run` and `/go` (each feature on its own branch `feature/{NNN}-{id}`)
|
|
1152
|
+
- 🆕 `state-update.cjs` — argv-driven helper
|
|
1153
|
+
- 🆕 `--auto-merge` companion flag
|
|
372
1154
|
|
|
373
|
-
|
|
1155
|
+
### v1.4.3 — 2026-05-07 (Orphan hook detection)
|
|
374
1156
|
|
|
375
|
-
|
|
1157
|
+
- 🐛 `mergeSettingsJson` now cleans hooks shipped previously but removed in newer template
|
|
1158
|
+
- 🆕 `manifest.shippedDefaults['settings.json']` baseline
|
|
1159
|
+
- 🐛 `update.js` now also uses merge logic
|
|
376
1160
|
|
|
377
|
-
|
|
1161
|
+
### v1.4.2 — 2026-05-06 (Merge + meta-tests)
|
|
378
1162
|
|
|
379
|
-
|
|
1163
|
+
- 🐛 `init --force` MERGES settings.json (preserves user customizations)
|
|
1164
|
+
- 🆕 `--reset-settings` flag for explicit nuclear-overwrite
|
|
1165
|
+
- 🐛 Stronger meta-test for `replicate.md` drift (multi-axis)
|
|
1166
|
+
- 🆕 `doctor` checks `git on PATH`
|
|
380
1167
|
|
|
381
|
-
|
|
1168
|
+
### v1.4.1 — 2026-05-06 (Cross-platform + critical fix)
|
|
1169
|
+
|
|
1170
|
+
- 🐛 Cross-platform hooks: replaced bash chains with 4 Node scripts
|
|
1171
|
+
- 🐛 `verify.js` SSOT: `kind: 'pre-shipped' | 'project-generated'` field
|
|
1172
|
+
- 🐛 Meta-tests for `replicate.md` ↔ `replicate-pipeline.md` consistency
|
|
1173
|
+
- 🐛 **Critical regression fixed:** `sync-templates.js` cleanDir silently deleted pre-shipped files
|
|
1174
|
+
|
|
1175
|
+
### v1.4.0 — 2026-05-06 (Major: 9 pre-shipped commands)
|
|
1176
|
+
|
|
1177
|
+
- ✨ **9 new pre-shipped commands:** `/start`, `/plan`, `/feature`, `/go`, `/run`, `/next`, `/myinsights`, `/docs`, `/deploy`
|
|
1178
|
+
- ✨ **3 new pre-shipped rules:** `git-workflow`, `insights-capture`, `feature-lifecycle`
|
|
1179
|
+
- ✨ Settings.json shipped with hooks
|
|
1180
|
+
- ✨ `verify` command — replaces user's manual verification prompt
|
|
1181
|
+
- 🐛 5 sources of truth divergence unified via `utils.COMPONENTS.items`
|
|
1182
|
+
|
|
1183
|
+
### v1.3.1 — 2026-05-06 (SSOT bugfix)
|
|
1184
|
+
|
|
1185
|
+
- 🐛 `cli.js` --help showed "1 rule" while `EXPECTED_RULES` had 2 entries → SSOT fix
|
|
1186
|
+
- 🐛 `update.js` corrupted manifest → `getRelativePaths(templateClaude)` fix
|
|
1187
|
+
- 🐛 `update` now removes orphan template files
|
|
1188
|
+
|
|
1189
|
+
### v1.3.0 (baseline)
|
|
1190
|
+
|
|
1191
|
+
Initial published version. 10 skills, 2 commands (`/replicate`, `/harvest`), 4 agents, 2 rules.
|
|
1192
|
+
|
|
1193
|
+
For full version history with migration notes — see [`CHANGELOG.md`](./CHANGELOG.md) (authoritative source).
|
|
1194
|
+
|
|
1195
|
+
---
|
|
1196
|
+
|
|
1197
|
+
## Contributing
|
|
1198
|
+
|
|
1199
|
+
This package is part of the [`pu-unicorn-replicate`](https://github.com/dzhechko/pu-unicorn-replicate) monorepo.
|
|
1200
|
+
|
|
1201
|
+
### Development setup
|
|
1202
|
+
|
|
1203
|
+
```bash
|
|
1204
|
+
git clone https://github.com/dzhechko/pu-unicorn-replicate.git
|
|
1205
|
+
cd pu-unicorn-replicate/packages/p-replicator
|
|
1206
|
+
npm install
|
|
1207
|
+
npm test
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
### Pre-publish checklist
|
|
382
1211
|
|
|
383
1212
|
```bash
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
#
|
|
1213
|
+
npm run snapshot:baseline # regenerate baseline if templates/ changed
|
|
1214
|
+
npm test # all 105 tests must pass
|
|
1215
|
+
npm pack --dry-run # verify tarball contents
|
|
1216
|
+
npm publish # prepublishOnly hook syncs source → templates/
|
|
387
1217
|
```
|
|
388
1218
|
|
|
1219
|
+
### Filing issues
|
|
1220
|
+
|
|
1221
|
+
https://github.com/dzhechko/pu-unicorn-replicate/issues
|
|
1222
|
+
|
|
1223
|
+
Include:
|
|
1224
|
+
- `npx @dzhechkov/p-replicator --version` output
|
|
1225
|
+
- `npx @dzhechkov/p-replicator verify` output
|
|
1226
|
+
- Repro steps + expected vs actual
|
|
1227
|
+
|
|
1228
|
+
### Patterns persisted in AQE memory
|
|
1229
|
+
|
|
1230
|
+
Each significant improvement is persisted as a cross-session pattern (16+ entries from v1.3.1 → v1.5.2). Categories:
|
|
1231
|
+
|
|
1232
|
+
- `cli-package-ssot-component-lists`, `cli-package-manifest-preservation` (v1.3.1)
|
|
1233
|
+
- `cli-package-pre-ship-vs-generate-boundary`, `cli-package-verify-replaces-manual-prompts` (v1.4.0)
|
|
1234
|
+
- `cli-package-cross-platform-hooks-via-node-scripts`, `cli-package-kind-discrimination-for-ssot` (v1.4.1)
|
|
1235
|
+
- `cli-package-settings-json-merge-vs-overwrite`, `meta-test-multi-axis-drift-detection` (v1.4.2)
|
|
1236
|
+
- `cli-shipped-defaults-baseline-for-orphan-detection`, `cli-update-must-mirror-init-merge-logic` (v1.4.3)
|
|
1237
|
+
- `cli-statusline-multi-line-dashboard`, `cli-feature-branches-flag-for-teaching-workflows` (v1.5.0)
|
|
1238
|
+
- `doc-rollout-pattern` (v1.5.1, v1.5.2 — 14-surface symmetric rollout)
|
|
1239
|
+
|
|
1240
|
+
---
|
|
1241
|
+
|
|
389
1242
|
## License
|
|
390
1243
|
|
|
391
|
-
MIT
|
|
1244
|
+
MIT — see [LICENSE](./LICENSE).
|
|
1245
|
+
|
|
1246
|
+
---
|
|
1247
|
+
|
|
1248
|
+
## Links
|
|
1249
|
+
|
|
1250
|
+
- **npm:** https://www.npmjs.com/package/@dzhechkov/p-replicator
|
|
1251
|
+
- **GitHub:** https://github.com/dzhechko/pu-unicorn-replicate
|
|
1252
|
+
- **Issues:** https://github.com/dzhechko/pu-unicorn-replicate/issues
|
|
1253
|
+
- **Telegram:** https://t.me/llm_notes
|
|
1254
|
+
- **Author:** dzhechko
|
|
1255
|
+
|
|
1256
|
+
### Companion documentation
|
|
1257
|
+
|
|
1258
|
+
- [`CHANGELOG.md`](./CHANGELOG.md) — version history (authoritative)
|
|
1259
|
+
- [`KNOWN_LIMITATIONS.md`](./KNOWN_LIMITATIONS.md) — 8 open improvement items
|
|
1260
|
+
- [`MULTIPLATFORM_ROADMAP.md`](./MULTIPLATFORM_ROADMAP.md) — Codex/OpenCode/KiloCode support roadmap
|
|
1261
|
+
- [`README/ru/`](./README/ru/) — Russian documentation (8 sections)
|
|
1262
|
+
- [`README/eng/`](./README/eng/) — English documentation (8 sections, deeper than this README)
|
|
1263
|
+
- [`README/ru/html/index.html`](./README/ru/html/index.html) — interactive single-page HTML guide
|
|
1264
|
+
|
|
1265
|
+
---
|
|
1266
|
+
|
|
1267
|
+
**🚀 Ready to start?**
|
|
1268
|
+
|
|
1269
|
+
```bash
|
|
1270
|
+
npx @dzhechkov/p-replicator init && claude
|
|
1271
|
+
```
|
|
1272
|
+
|
|
1273
|
+
Then in Claude Code: `/replicate "your idea"` (new project) or `/feature add-something` (existing project).
|