@dzhechkov/p-replicator 1.5.6 → 1.5.7

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dzhechko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,244 @@
1
+ # 01. Quick Start
2
+
3
+ 5 minutes from empty folder to a working AI pipeline.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js ≥ 16.0.0
8
+ - Claude Code installed (CLI or web)
9
+ - Git initialized in the project (`git init` if not already)
10
+ - Docker + Docker Compose (needed for `/start` Phase 3)
11
+
12
+ ## Installation
13
+
14
+ In your project root:
15
+
16
+ ```bash
17
+ npx @dzhechkov/p-replicator init
18
+ ```
19
+
20
+ This creates:
21
+
22
+ - `.claude/skills/` — 10 pre-shipped skills
23
+ - `.claude/commands/` — 11 slash commands (`/replicate`, `/run`, `/feature`, ...)
24
+ - `.claude/agents/` — 4 pipeline agents
25
+ - `.claude/rules/` — 5 governance rules
26
+ - `.claude/hooks/` — 6 cross-platform Node scripts
27
+ - `.claude/settings.json` — hooks + statusline configuration
28
+ - `.p-replicator.json` — install manifest
29
+
30
+ Install is idempotent: `init` won't overwrite existing files without `--force`.
31
+
32
+ ## First run
33
+
34
+ ```bash
35
+ claude # open Claude Code in the project
36
+ ```
37
+
38
+ In Claude Code, run:
39
+
40
+ ```
41
+ /replicate "Describe your product in 1-2 sentences"
42
+ ```
43
+
44
+ This launches a 5-phase pipeline:
45
+
46
+ | Phase | What it does | Artifacts |
47
+ |------|-----------|-----------|
48
+ | **0. Product Discovery** (optional) | Reverse-engineer similar companies | `docs/00_product_discovery.md` |
49
+ | **1. Planning** | Generate 11 SPARC documents | `docs/PRD.md`, `Architecture.md`, `Pseudocode.md`, ... |
50
+ | **2. Validation** | 5-agent swarm validates docs (INVEST/SMART, score ≥70) | `docs/validation-report.md` |
51
+ | **3. Toolkit Generation** | Generate project-specific agents, rules, skills | `.claude/agents/planner.md`, `architect.md`, ... |
52
+ | **4. Finalize** | Scaffolds (Dockerfile, docker-compose.yml, .gitignore) + git commit | Project ready |
53
+
54
+ Each phase has a checkpoint where you type "ok" to proceed or give feedback.
55
+
56
+ ## Alternative entry — I already have technical docs
57
+
58
+ If you already have technical documentation (tech spec, architecture, API specs,
59
+ design docs), you can **skip Phase 0** (Product Discovery) and feed your existing
60
+ docs straight into Phase 1 as pre-filled context.
61
+
62
+ ### Setup
63
+
64
+ ```bash
65
+ mkdir -p docs/existing
66
+ cp your-tech-doc-*.md docs/existing/ # place your existing docs here
67
+ ```
68
+
69
+ ### Three sub-paths
70
+
71
+ | Path | When to use | What gets invoked |
72
+ |---|---|---|
73
+ | **A. /replicate with override** | Full pipeline + toolkit + scaffold | `/replicate "Use my docs in docs/existing/, skip Phase 0"` |
74
+ | **B. SPARC docs only** | Want only the 11 SPARC docs | Invoke skill directly: "use `sparc-prd-mini` in AUTO mode on `docs/existing/`" |
75
+ | **C. Validation-only** | Docs already SPARC-shaped | Rename to `PRD.md`, `Architecture.md`, etc., then "invoke `requirements-validator`" |
76
+
77
+ ### What changes in the pipeline
78
+
79
+ - **Phase 0** — skipped entirely
80
+ - **Phase 1** — `sparc-prd-mini` runs in AUTO mode (no interactive questions),
81
+ reads your docs, generates the 11 SPARC slots; missing parts are marked `[GAP: ...]`
82
+ - **Phase 2-4** — unchanged (validation → toolkit → scaffold)
83
+
84
+ ### Caveats
85
+
86
+ - Your docs may not map cleanly to all 11 SPARC slots — expect `[GAP: ...]` markers
87
+ - Validation may flag user stories as "not INVEST" — this is a signal that your
88
+ docs need extending, not a bug
89
+ - Architecture constraints (pattern, containers, infra, deploy, AI integration)
90
+ must be passed to Phase 1 explicitly if not in your docs
91
+
92
+ Full spec: see `.claude/commands/replicate.md` "Alternative entry" section and
93
+ the `.claude/rules/replicate-pipeline.md` rule.
94
+
95
+ ## Adding features to an existing project (Mode 2)
96
+
97
+ If you **already have a working project** (stack defined, PRD/Specification/
98
+ CLAUDE.md exist) and want to add new features with the same validation cycle
99
+ as `/replicate` — use `/feature`, not `/replicate`.
100
+
101
+ ### Install (idempotent)
102
+
103
+ ```bash
104
+ cd existing-project
105
+ npx @dzhechkov/p-replicator init # WILL NOT overwrite your CLAUDE.md
106
+ npx @dzhechkov/p-replicator verify # confirm pre-shipped contract intact
107
+ ```
108
+
109
+ ### Normalize SPARC paths (one-time)
110
+
111
+ `/feature` reads docs from standard slots:
112
+
113
+ ```bash
114
+ mv docs/your-prd.md docs/PRD.md # if you use different names
115
+ mv docs/your-spec.md docs/Specification.md
116
+ mv docs/your-arch.md docs/Architecture.md
117
+ # Pseudocode / Refinement / Completion — optional
118
+ ```
119
+
120
+ ### Run features (3 sub-paths)
121
+
122
+ | Path | When | Command |
123
+ |---|---|---|
124
+ | **A. /feature directly** | Single feature, ≥4 files, new capability | `/feature add-stripe-payments` |
125
+ | **B. /go auto-router** | Mixed complexity | `/go add-pagination` (routes /plan vs /feature) |
126
+ | **C. Direct skill invocation** | Only validation cycle, no full lifecycle | `requirements-validator` + `brutal-honesty-review` |
127
+
128
+ ### Validation thresholds (same swarm as /replicate Phase 2)
129
+
130
+ | Verdict | Score | Action |
131
+ |---|---|---|
132
+ | 🟢 READY | ≥ 70 | IMPLEMENT |
133
+ | 🟡 CAVEATS | 50-69 | IMPLEMENT + auto-retry once |
134
+ | 🔴 NEEDS WORK | < 50 / blockers | return to PLAN, max 3 retries |
135
+
136
+ ### What's preserved during `init`
137
+
138
+ - `CLAUDE.md` (root) — **not touched** (only `--force` overwrites)
139
+ - `docs/PRD.md`, `Specification.md` — **not touched**
140
+ - `.claude/commands/your-custom.md` — **not touched** (init only adds pre-shipped 11)
141
+ - `.claude/settings.json` — **merged** via v1.4.2+ merge logic with deep-equals
142
+ - `.gitignore`, `package.json` — **not touched** by init
143
+
144
+ ### Caveats
145
+
146
+ - DO NOT run `/start` in Mode 2 — it expects a fresh scaffold
147
+ - `/feature-ent` unavailable in Mode 2 without manually adding DDD/ADR/C4 docs
148
+ - Auto-commit hooks (Stop) may conflict with custom git workflows — edit
149
+ `settings.json` after `init` (merge preserves your edits on subsequent updates)
150
+ - No `--prd-path` flag for non-standard paths — one-time rename/symlink required
151
+ (see KNOWN_LIMITATIONS.md M3)
152
+
153
+ Full recipe: `02_user_guide.md` section "Feature workflow in an existing project (Mode 2)".
154
+
155
+ ## Verify the install
156
+
157
+ After `/replicate`, run:
158
+
159
+ ```bash
160
+ npx @dzhechkov/p-replicator verify
161
+ ```
162
+
163
+ The command checks:
164
+
165
+ - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 5 rules + settings.json
166
+ - **Post-/replicate hints** (advisory): CLAUDE.md, project-specific agents,
167
+ feature-roadmap.json, security rules, etc.
168
+
169
+ Exit code `0` means the pre-shipped contract is intact; warnings indicate
170
+ project-specific artifacts not yet created.
171
+
172
+ Alternative (general health check):
173
+
174
+ ```bash
175
+ npx @dzhechkov/p-replicator doctor
176
+ ```
177
+
178
+ ## What to do next
179
+
180
+ Right after `/replicate`, three main paths are available:
181
+
182
+ ### 1. Bootstrap the project (`/start`)
183
+
184
+ ```
185
+ /start
186
+ ```
187
+
188
+ Builds the scaffold per `docs/Architecture.md`: creates monorepo packages,
189
+ generates `package.json`, brings up Docker, runs migrations.
190
+
191
+ ### 2. Autonomous feature build (`/run mvp`)
192
+
193
+ ```
194
+ /run mvp # MVP-only features
195
+ /run all # everything in roadmap
196
+ /run mvp --feature-branches # each feature in a separate branch
197
+ /run mvp --feature-branches --auto-merge # also merge each branch into main
198
+ ```
199
+
200
+ Loop: `/next` → `/go <id>` → push commit → next feature. Stops when roadmap
201
+ is empty.
202
+
203
+ ### 3. One specific feature (`/go`)
204
+
205
+ ```
206
+ /go auth-jwt # auto-router /plan vs /feature
207
+ /feature auth-jwt # explicitly run full SPARC-mini cycle
208
+ /plan add-payment-gateway # lightweight plan file
209
+ ```
210
+
211
+ ## Additional commands
212
+
213
+ | Command | When to use |
214
+ |---|---|
215
+ | `/myinsights "description"` | Capture rakes — error/workaround for future sessions |
216
+ | `/docs` | Generate user-facing docs (RU + EN) |
217
+ | `/harvest` | Extract reusable patterns into knowledge base |
218
+ | `/deploy staging` | Deployment workflow with per-tier checks |
219
+
220
+ ## What appears in your project after `init`
221
+
222
+ ```
223
+ your-project/
224
+ ├── .claude/
225
+ │ ├── skills/ # 10 skills
226
+ │ ├── commands/ # 11 slash commands
227
+ │ ├── agents/ # 4 pipeline agents
228
+ │ ├── rules/ # 5 rules
229
+ │ ├── hooks/ # 6 Node scripts
230
+ │ └── settings.json # hooks + statusline config
231
+ ├── .p-replicator.json # install manifest
232
+ └── (your existing files…)
233
+ ```
234
+
235
+ All `.claude/` files are canonical templates from the package. Don't edit
236
+ them directly: on subsequent `update`, they merge through the
237
+ `mergeSettingsJson` + `removeOrphanHooks` algorithm (preserving user
238
+ customizations).
239
+
240
+ ## Next steps
241
+
242
+ - Read [02_user_guide.md](./02_user_guide.md) — details on each command
243
+ - Read [03_admin_guide.md](./03_admin_guide.md) — hooks/statusline configuration
244
+ - If something's off — [06_troubleshooting.md](./06_troubleshooting.md)