@dzhechkov/p-replicator 1.5.18 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/.dz-manifest.json +173 -57
  2. package/CHANGELOG.md +262 -0
  3. package/MULTIPLATFORM_ROADMAP.md +1 -1
  4. package/README/eng/01_quickstart.md +2 -2
  5. package/README/eng/02_user_guide.md +1 -1
  6. package/README/eng/03_admin_guide.md +2 -2
  7. package/README/eng/05_architecture.md +6 -2
  8. package/README/eng/README.md +1 -1
  9. package/README/ru/01_quickstart.md +2 -2
  10. package/README/ru/02_user_guide.md +1 -1
  11. package/README/ru/03_admin_guide.md +2 -2
  12. package/README/ru/05_architecture.md +1 -1
  13. package/README/ru/README.md +1 -1
  14. package/README/ru/html/index.html +7 -7
  15. package/README.md +139 -16
  16. package/bin/cli.js +0 -0
  17. package/package.json +11 -10
  18. package/sbom.json +346 -56
  19. package/src/utils.js +4 -0
  20. package/templates/.claude/agents/doc-validator.md +2 -1
  21. package/templates/.claude/agents/product-discoverer.md +1 -1
  22. package/templates/.claude/commands/next.md +16 -0
  23. package/templates/.claude/commands/replicate.md +183 -9
  24. package/templates/.claude/commands/start.md +19 -1
  25. package/templates/.claude/hooks/autocommit-insights.cjs +95 -10
  26. package/templates/.claude/hooks/autocommit-plans.cjs +95 -10
  27. package/templates/.claude/hooks/autocommit-roadmap.cjs +96 -13
  28. package/templates/.claude/hooks/check-docs-complete.cjs +174 -0
  29. package/templates/.claude/hooks/check-growth-trace.cjs +191 -0
  30. package/templates/.claude/hooks/check-ports.cjs +232 -0
  31. package/templates/.claude/hooks/session-insights.cjs +13 -1
  32. package/templates/.claude/hooks/state-update.cjs +13 -1
  33. package/templates/.claude/hooks/statusline.cjs +145 -18
  34. package/templates/.claude/rules/docker-ports.md +123 -0
  35. package/templates/.claude/rules/replicate-pipeline.md +19 -6
  36. package/templates/.claude/rules/skill-interface-protocol.md +9 -0
  37. package/templates/.claude/settings.json +5 -5
  38. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/01-detect-parse.md +57 -14
  39. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/02-analyze-map.md +9 -7
  40. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/03-generate-p0.md +6 -4
  41. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/08-skill-composition.md +2 -2
  42. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/enhanced-recommendations.md +6 -4
  43. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/extended-mapping.md +2 -2
  44. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-agents.md +2 -2
  45. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-skills.md +1 -1
  46. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/enhanced-claude-md.md +2 -2
  47. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle.md +2 -2
  48. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-suggestions.md +11 -2
  49. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +1 -1
  50. package/templates/.claude/skills/requirements-validator/SKILL.md +59 -0
  51. package/templates/.claude/skills/requirements-validator/references/scoring-system.md +28 -0
  52. package/templates/.claude/skills/reverse-engineering-unicorn/modules/01-intelligence.md +4 -4
  53. package/templates/.claude/skills/reverse-engineering-unicorn/modules/02-product-customers.md +2 -2
  54. package/templates/.claude/skills/reverse-engineering-unicorn/modules/025-cjm-prototype.md +9 -1
  55. package/templates/.claude/skills/reverse-engineering-unicorn/modules/03-market-competition.md +3 -3
  56. package/templates/.claude/skills/reverse-engineering-unicorn/modules/04-business-finance.md +3 -3
  57. package/templates/.claude/skills/reverse-engineering-unicorn/modules/05-growth-engine.md +132 -12
  58. package/templates/.claude/skills/reverse-engineering-unicorn/modules/06-playbook-synthesis.md +1 -1
  59. package/templates/.claude/skills/sparc-prd-mini/SKILL.md +152 -10
  60. package/tests/e2e/lifecycle.test.js +21 -10
  61. package/tests/snapshot/baseline.json +42 -38
  62. package/tests/snapshot/update-baseline.js +2 -1
  63. package/tests/unit/adr-decision-coverage.test.js +137 -0
  64. package/tests/unit/adr-scanner-contract.test.js +108 -0
  65. package/tests/unit/autocommit-deletion.test.js +242 -0
  66. package/tests/unit/check-docs-complete.test.js +249 -0
  67. package/tests/unit/check-growth-trace.test.js +188 -0
  68. package/tests/unit/check-ports.test.js +184 -0
  69. package/tests/unit/db-port-rule.test.js +216 -0
  70. package/tests/unit/detect-parse-anchor.test.js +109 -0
  71. package/tests/unit/external-dependency-check.test.js +209 -0
  72. package/tests/unit/growth-axes-and-compliance.test.js +169 -0
  73. package/tests/unit/growth-gate-conditional.test.js +122 -0
  74. package/tests/unit/growth-module-b2b-gate.test.js +122 -0
  75. package/tests/unit/growth-requirements-bridge.test.js +127 -0
  76. package/tests/unit/hooks-project-anchored.test.js +223 -0
  77. package/tests/unit/hooks-report-failures.test.js +207 -0
  78. package/tests/unit/module-copy-identity.test.js +76 -0
  79. package/tests/unit/pipeline-file-ownership.test.js +95 -0
  80. package/tests/unit/roadmap-one-schema.test.js +179 -0
  81. package/tests/unit/skill-paths-prebaked.test.js +174 -0
  82. package/tests/unit/sparc-reconciliation.test.js +117 -0
  83. package/tests/unit/spec-pseudocode-traceability.test.js +146 -0
  84. package/tests/unit/statusline-honest-labels.test.js +178 -0
  85. package/tests/unit/statusline-two-roots.test.js +237 -0
  86. package/tests/unit/sync-templates-guard.test.js +209 -0
  87. package/tests/unit/utils.test.js +2 -2
  88. package/tests/unit/validation-gate-teeth.test.js +158 -0
  89. package/LICENSE +0 -21
package/CHANGELOG.md CHANGED
@@ -5,6 +5,268 @@ All notable changes to `@dzhechkov/p-replicator` are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.0] - 2026-08-27
9
+
10
+ **MINOR — hooks 8 → 9** (`check-docs-complete`). After `update`, `doctor` and `verify` expect the new count.
11
+
12
+ ### Added
13
+ - **`check-docs-complete.cjs`** — the cheap question, asked before the expensive one. Phase 2 used to
14
+ launch a swarm of validation agents over whatever Phase 1 produced; existence, emptiness and
15
+ unfilled placeholders are decidable by forty lines. `/replicate` now runs it at the Phase 1→2
16
+ boundary and does not start the swarm on exit 1.
17
+ - **A resume section in `/replicate`** — the three signals that already answer "where did we stop":
18
+ the per-phase commits, this checker, and `verify`. Automated phase detection was deliberately NOT
19
+ added; the reasoning is recorded there so it can be revisited on evidence.
20
+
21
+ ### Changed
22
+ - **`prepublishOnly` now runs the snapshot test before signing.** `tests/` is in `files[]`, so a
23
+ baseline drifted from the templates used to be signed, shipped and wrong — `dz sign` states its own
24
+ limit: tamper-evidence, never truthfulness.
25
+
26
+ ### Honest limit
27
+ The completeness check proves the documents were WRITTEN, not that they are correct. Correctness is
28
+ what the Phase-2 swarm is for. It blocks only on shapes that cannot be anything else (`{{…}}`,
29
+ TODO/TBD/XXX/FIXME); bracketed prose is NAMED as a warning and never blocks, because it cannot be
30
+ told from a mermaid label without understanding the document — and `[GAP: …]` always reaches Phase 2,
31
+ which owns it.
32
+
33
+ ## [1.8.0] - 2026-08-27
34
+
35
+ **MINOR — the ten shipped skills no longer depend on a rewrite rule being read.**
36
+
37
+ ### Changed
38
+ - **Skill paths are pre-baked.** They referenced each other by claude.ai `/mnt/skills/user/<name>/`
39
+ paths and worked only because two rules files tell the model to rewrite them at read time — layer
40
+ 4, silent when it lapses. 27 references now resolve directly.
41
+ - Two skills referenced but NOT shipped (`frontend-design`, `idea2prd-manual`) are declared OPTIONAL
42
+ with a fallback rather than rewritten. A local-looking path that resolves to nothing is worse than
43
+ an obviously foreign one.
44
+ - 56 occurrences are DELIBERATELY preserved: the toolkit generator's own instructions to scan its
45
+ output for unrewritten paths, and the rewrite tables. Rewriting them would blind the self-check.
46
+ - The rewrite rules stay — a skill YOU bring from claude.ai still needs them.
47
+
48
+ ### Fixed
49
+ - `03-generate-p0.md` named `.claude/skills/goap-research/` as an output path two lines under a note
50
+ saying that name is an alias which never exists as a directory.
51
+
52
+ ## [1.7.0] - 2026-08-27
53
+
54
+ **Growth stops being analysis and becomes an obligation.** Two features, both cross-family reviewed
55
+ (grades B and C); artifacts in `features/growth-requirements-bridge/` and
56
+ `features/growth-list-and-compliance/`.
57
+
58
+ **MINOR — the pre-shipped contract changed again.** Hooks 7 → 8 (`check-growth-trace`). After
59
+ `update`, `doctor` and `verify` expect the new count.
60
+
61
+ ### Added
62
+
63
+ - **Phase 0 now writes `docs/product-discovery-brief.md`.** MEASURED before this change: it never
64
+ did. The brief was passed to Phase 1 in conversation and evaporated, so the M5 growth analysis had
65
+ no artifact anything downstream could read. Nothing was ignoring it — there was nothing to ignore.
66
+ - **`Growth Requirements Seed`** in M5: `FR-GROWTH-nnn` DRAFT obligations, each naming its source
67
+ block, carrying that block's confidence verbatim, and now carrying a compliance verdict.
68
+ - **Growth type is two independent axes** — a go-to-market MOTION and a growth LOOP — plus the three
69
+ mechanics the old list omitted (badge/embed, one- and two-sided incentivised referral, network
70
+ effect). `No loop` is a real answer and skips the loop-only output instead of demanding an
71
+ invented flywheel.
72
+ - **A compliance checklist** before any technique becomes a requirement. It cites the norm and where
73
+ to check it, and carries no amount, threshold or statute: those are jurisdiction-specific and go
74
+ stale within a year. A `no` answer is recorded against the requirement and blocks its promotion.
75
+ - **`Growth Traceability`** in `requirements-validator` — CONDITIONAL, scored `+5 / +0 / -10`
76
+ OUTSIDE the 100-point table. A project with no acquisition objective, or one that never ran
77
+ Phase 0, scores `+0` and never a penalty.
78
+ - **`.claude/hooks/check-growth-trace.cjs`** — the deterministic counterpart. Exit `0` traced ·
79
+ `1` analysed then dropped · `2` **the check did not run**. Wired to no event, like `check-ports`.
80
+ - **README:** a usage-scenario section for both deliberately-invoked checks, closing a gap 1.6.0 left
81
+ when `check-ports` shipped without one.
82
+
83
+ ### Fixed
84
+
85
+ - The pipeline rule listed **four** hook files when eight ship, and the components table said
86
+ **Rules 5** when six do — both stale since 1.6.0.
87
+
88
+ ### Honest limits, stated in the shipped artifacts
89
+
90
+ The seed proves an obligation was carried forward, never that it was built. The compliance checklist
91
+ asks its questions and records the answers; it does not establish that anything is lawful. And the
92
+ validator criterion is prose read by a model — layer 3. Only `check-growth-trace.cjs` is
93
+ deterministic, and only when someone runs it.
94
+
95
+ ## [1.6.0] - 2026-08-27
96
+
97
+ **Seventeen features** across two days, from the field-report sweep (PR-003, PR-005+010, PR-008,
98
+ PR-009+004, PR-010, PR-011, PR-012, PR-013, PR-007 G5) plus a latent publish hazard, a silent-failure
99
+ class, a growth-module gate and three regressions found in passing. Every one went through the full
100
+ design→plan→code→cross-family-QE pipeline; artifacts live in `features/<slug>/` in the source repo.
101
+
102
+ **MINOR, not patch — the pre-shipped contract changed twice.** Rules went 5 → 6 (`docker-ports`) and
103
+ hooks 6 → 7 (`check-ports`). After `update`, `doctor` and `verify` expect the new counts.
104
+
105
+ ### Added — a check that can fail, for the rule that could not
106
+
107
+ `.claude/hooks/check-ports.cjs` enforces «Правило №0» against a real `docker compose config`, in Node
108
+ so it runs where the package promises to run. **Three exit codes: 0 clean, 1 violation, 2 THE CHECK
109
+ DID NOT RUN** — no compose, no docker, an unparseable config. A check that answers "clean" when it
110
+ could not look turns an unknown into a reassurance.
111
+
112
+ It is a rewrite, not a transcription: the bash original never looked at `network_mode: host`, which
113
+ the rule forbids. It is not registered as an event hook — invoke it deliberately:
114
+
115
+ ```bash
116
+ node .claude/hooks/check-ports.cjs .
117
+ ```
118
+
119
+ ### Added — a recorded decision cannot be quietly left unbuilt
120
+
121
+ Phase 2 closes with a decision-coverage step: every `ADR-<nnn>` in `docs/ADR.md` must be named
122
+ downstream, and every downstream reference must match a real decision. Both directions, both able to
123
+ say `none`. It establishes that a decision is NAMED, not that it was implemented, and says so.
124
+
125
+ ### Changed — deleting an artifact is now recorded
126
+
127
+ The three autocommit hooks treated a deleted roadmap as "nothing to do". A deletion is now committed
128
+ with its own `auto-remove` subject, classified from what git actually staged — so deleting one file
129
+ inside a surviving directory counts too. A project that never had the artifact stays silent.
130
+
131
+ ### Fixed — the status line stops saying untrue things
132
+
133
+ The progress bar was built from done/total and captioned `mvp`; it now carries the caption it draws.
134
+ And the domain guess had no word boundaries, so "healthchecks" made a project medical and "slack"
135
+ made it enterprise. Boundaries are Unicode lookarounds, not `\b` — `\b` does not work around
136
+ Cyrillic at all.
137
+
138
+ ### Fixed — the project scanner could not recognise its own output
139
+
140
+ Seven probes resolved from one parameter and disagreed about what it was; the two that decide whether
141
+ a project is SPARC-shaped looked exactly where the pipeline does not write.
142
+
143
+ ### Fixed — the growth module was gated off for the type it handles itself
144
+
145
+ Two callers disabled it for B2B while the module branches on type internally. The condition is now
146
+ about applicability, not product type.
147
+
148
+ **The version number and the decision to publish were the owner's**; both were given on 2026-08-27.
149
+ npm's latest before this release was 1.5.18; 1.5.19 was staged and never published.
150
+
151
+ ### Fixed — the shipped hooks did not work from a subdirectory, and never committed anything
152
+
153
+ - `settings.json` pinned all five commands to `${CLAUDE_PROJECT_DIR}` (braced, quoted — the form
154
+ Claude Code rewrites for PowerShell). Relative paths resolve against the process cwd, which drifts
155
+ the moment any tool call runs `cd`, so every `Stop` hook died with `MODULE_NOT_FOUND` — silently,
156
+ because hooks are non-blocking.
157
+ - All six hooks now anchor their DATA at an absolute `CLAUDE_PROJECT_DIR`, falling back to their own
158
+ `__dirname`. Fixing only `settings.json` would have made them run and silently do nothing.
159
+ - The three autocommit hooks passed `-m` AFTER `--`, so git parsed the commit message as a pathspec
160
+ and the commit failed from every directory, always. They had never committed anything.
161
+
162
+ ### Fixed — the status line told half the truth from every directory
163
+
164
+ Toolkit counts now resolve from the project root regardless of cwd, and the roadmap is a survey of
165
+ `projects/*` rather than a guess — sub-project figures are labelled as theirs and never merged into
166
+ the root's own counters. The survey is bounded (24 entries, 512 KB per file) because it renders on
167
+ every prompt.
168
+
169
+ ### Added — the pipeline can now refuse to build on unvalidated input
170
+
171
+ - A blocking FLOOR on the requirements gate: `Testable = 0` or `Completeness = 0` blocks whatever the
172
+ total says. A story with no acceptance criteria totalled 72/100 and read as "fix minor issues".
173
+ - Phase 3 has a checkable precondition — the validation report must exist and its FIRST
174
+ `**Verdict:**` line must be green or yellow — replacing an unenforceable "never skip validation".
175
+ - An External Dependencies inventory in `Architecture.md` plus a sixth Phase-2 lens: every external
176
+ capability a requirement rests on carries evidence (a citation WITH a verbatim quote) and one of
177
+ three verdicts. An unconfirmed capability stops the requirements that rest on it, not the run.
178
+ - Scenario↔algorithm traceability: scenario IDs in Phase 3, `REALISES:` in Phase 4 algorithms, and a
179
+ coverage reconciliation that runs BOTH ways. It establishes that a claim exists — not that the
180
+ algorithm performs the check, and it says so in the template.
181
+
182
+ ### Added — `.claude/rules/docker-ports.md` (6th pre-shipped rule)
183
+
184
+ "Правило №0": storage has no host publication except a loopback bind. Every forbidden form is named
185
+ — `0.0.0.0`, `[::]`, a single explicit public address, and `network_mode: host`, which needs no
186
+ `ports:` entry at all. The rule states that the package does NOT check your compose file, so nobody
187
+ infers a guarantee from its presence.
188
+
189
+ **This changes the pre-shipped contract from 5 rules to 6.** `doctor`, `verify`, the status line and
190
+ the READMEs move together, and a test now holds every count site to `COMPONENTS.rules.items`.
191
+
192
+ ### Fixed — one schema for `feature-roadmap.json`
193
+
194
+ It was documented twice, incompatibly, both copies claiming to be canonical. `commands/next.md` is
195
+ now the schema; the other document points at it. The status line marks a roadmap whose `priority`
196
+ values are off-schema instead of rendering a confident `mvp 0/0`.
197
+
198
+ ### Fixed — `/start` no longer discards what `/replicate` wrote
199
+
200
+ Both wrote `docker-compose.yml`, `.gitignore` and `README.md`, and `/replicate` recommends running
201
+ `/start` afterwards — so the collision was the normal path. Both sides now guard: if the file exists,
202
+ make the minimal targeted edit, inspect the diff, and name every changed hunk.
203
+
204
+ ### Security — `scripts/sync-templates.js` fails closed
205
+
206
+ It copied a discovered repo root's `.claude/` over `templates/` — the npm tarball — and inside a
207
+ monorepo the walk-up finds the MONOREPO. It was safe only because nothing called it, while a test
208
+ helper and an architecture doc both invited the call. It now refuses unless the root carries a
209
+ regular `.p-replicator-sync-source` file with an exact declaration.
210
+
211
+ ### Changed — a hook that cannot commit no longer says nothing
212
+
213
+ A real git failure now prints ONE line to **stdout** naming the hook, the artifact and git's own
214
+ reason, and still exits 0. The ordinary "nothing to commit" path stays silent.
215
+
216
+ The stream matters and was wrong at first: MEASURED in the Claude Code binary, a hook exiting 0 has
217
+ its **stderr discarded** (*"Exit code 0 - stdout/stderr not shown"*) while stdout can be surfaced
218
+ (*"Exit code 0 - stdout shown in transcript mode (ctrl+o)"*). "Visible" here means transcript mode
219
+ and the debug log — not an interruption: a `Stop` hook cannot put a line in front of you without
220
+ blocking your session, and blocking is worse.
221
+
222
+ Still open, and it is the owner's call: whether a DELETED target should be auto-committed.
223
+
224
+ ### Tests
225
+
226
+ **116 → 235** (MEASURED — reproducer `npm test` in this package; 116 before the first of these
227
+ features, 235 after the last). Every feature's guard is proven by mutation: apply it, watch a
228
+ specific assertion go red, restore, watch it pass.
229
+
230
+ ## [1.5.19] - 2026-08-25
231
+
232
+ ### Fixed
233
+
234
+ - **The ADR chain was dead for every `/replicate` project.** The scanner required a directory of
235
+ `docs/adr/*.md`, which is the idea2prd-manual shape; a `/replicate` project writes a single
236
+ `docs/ADR.md`, so decisions were recorded and never read. The scanner now accepts both shapes.
237
+
238
+ ## [1.5.18] - 2026-08-25
239
+
240
+ ### Changed
241
+
242
+ - Version bump only, as part of a 51-package publish sweep — signatures re-verified against the
243
+ published tarballs. No behaviour change in this package.
244
+
245
+ ## [1.5.17] - 2026-08-25
246
+
247
+ ### Fixed
248
+
249
+ - Slice-H cross-model QE round 5 in `learning_bridge.py`. Recorded honestly at the time: the finding
250
+ count across five rounds went 11 → 10 → 5 → 3 → 6 and **did not converge**.
251
+
252
+ ## [1.5.16] - 2026-08-25
253
+
254
+ ### Fixed
255
+
256
+ - Slice-H QE round 4: acronym-versus-name confusion, laundered identifiers, and a forgeable probe.
257
+ The acronym test had been wrong in BOTH directions — it accepted `McDonald` and rejected `apoB`,
258
+ an example from this package's own README.
259
+
260
+ ## [1.5.15] - 2026-08-25
261
+
262
+ ### Fixed
263
+
264
+ - Slice-H QE round 3: the `learning_bridge.py` guard became a token allowlist rather than an
265
+ enumeration of bad cases, with evidence-provenance tests added.
266
+
267
+ > These five entries were reconstructed from git history on 2026-08-27 (backlog `2b286239`). They are
268
+ > accurate about what changed and why; they are terser than a contemporaneous entry would have been.
269
+
8
270
  ## [1.5.14] - 2026-07-28
9
271
 
10
272
  ### Fixed — Documentation & packaging (package-verification findings)
@@ -112,7 +112,7 @@ Beyond Level 2 — adapt logic for platform-specific capabilities:
112
112
  | `/myinsights`, `/docs`, `/harvest`, `/start`, `/deploy` | ✅ universal | path-translate | **Yes** |
113
113
  | 10 skills (sparc-prd-mini, etc.) | ⚠️ Claude-specific composition | inline-compile into commands | **Compromise** — sacrifice runtime-loading |
114
114
  | 4 pre-shipped agents | ⚠️ Claude Task-tool specific | translate to platform sub-agents | **Yes if platform supports** |
115
- | 5 rules | ✅ universal markdown | path-translate | **Yes** |
115
+ | 6 rules | ✅ universal markdown | path-translate | **Yes** |
116
116
  | Hooks (SessionStart insights, Stop autocommit) | ❌ Claude-only | bake into commands as instructions | **Compromise** — degraded UX |
117
117
  | Statusline dashboard | ❌ Claude-only | optional `progress.md` file? | **Skip** — Claude-exclusive feature |
118
118
  | `verify` CLI command | ✅ universal | works as-is | **Yes** (already works) |
@@ -162,7 +162,7 @@ npx @dzhechkov/p-replicator verify
162
162
 
163
163
  The command checks:
164
164
 
165
- - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 5 rules + settings.json
165
+ - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 6 rules + settings.json
166
166
  - **Post-/replicate hints** (advisory): CLAUDE.md, project-specific agents,
167
167
  feature-roadmap.json, security rules, etc.
168
168
 
@@ -225,7 +225,7 @@ your-project/
225
225
  │ ├── skills/ # 10 skills
226
226
  │ ├── commands/ # 11 slash commands
227
227
  │ ├── agents/ # 4 pipeline agents
228
- │ ├── rules/ # 5 rules
228
+ │ ├── rules/ # 6 rules
229
229
  │ ├── hooks/ # 6 Node scripts
230
230
  │ └── settings.json # hooks + statusline config
231
231
  ├── .p-replicator.json # install manifest
@@ -501,7 +501,7 @@ npx @dzhechkov/p-replicator verify
501
501
  ```
502
502
 
503
503
  Should report:
504
- - ✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 5 rules + settings.json)
504
+ - ✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 6 rules + settings.json)
505
505
  - ✅ Post-/replicate hints — many will be absent in Mode 2 (this is normal)
506
506
  - 📊 Per-feature artifacts: `docs/features/<id>/01_specification.md`...`05_completion.md`,
507
507
  `validation-report.md`, `review-report.md`
@@ -83,7 +83,7 @@ P-Replicator V1.5.0 ● user │ Sonnet 4.7
83
83
  🚀 Pipeline /<cmd> ▓▓▓░░░░ 50% │ Phase: VALIDATE (2/4) │ Last: /replicate
84
84
  🎯 Roadmap [●●●○○○○○] mvp 3/8 │ Done 5/12 │ ▶ auth-jwt │ Domain: banking
85
85
  📊 SPARC ●11/11 │ 🟢 78/100 │ Plans ●3 │ ADRs ●2 │ Harvest 2026-05-05
86
- 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●5+2 │ Hooks ●6/6
86
+ 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●6+2 │ Hooks ●7/7
87
87
  💡 Insights ●12 (2026-05-06) │ Tests 85/85 ✓ │ MCP ●1/1 │ Settings ✓ │ 🧬 Keysarium ✓
88
88
  ```
89
89
 
@@ -245,7 +245,7 @@ from PRD MVP scope, or by hand).
245
245
 
246
246
  | Tool | Checks | When |
247
247
  |---|---|---|
248
- | `npx @dzhechkov/p-replicator doctor` | Pre-shipped contract: 10 skills + 11 commands + 4 agents + 5 rules + settings.json + 6 hooks + git on PATH | After init / when something seems broken |
248
+ | `npx @dzhechkov/p-replicator doctor` | Pre-shipped contract: 10 skills + 11 commands + 4 agents + 6 rules + settings.json + 7 hooks + git on PATH | After init / when something seems broken |
249
249
  | `npx @dzhechkov/p-replicator verify` | Pre-shipped + post-/replicate hints (CLAUDE.md, planner.md, security.md, feature-roadmap.json, etc.) | After every `/replicate` to confirm |
250
250
 
251
251
  **`doctor` exit codes:**
@@ -73,7 +73,7 @@ function getItemRelativePath(comp, itemKey) {
73
73
 
74
74
  **Design principle:** zero shell dependency.
75
75
 
76
- All 6 hook scripts are pure Node, using `execFileSync('git', [...])`
76
+ All 7 hook scripts are pure Node, using `execFileSync('git', [...])`
77
77
  instead of shell pipes. This works equivalently on:
78
78
  - Windows cmd.exe (no `2>/dev/null`, no `2>nul` — neither needed)
79
79
  - Bash / zsh / Git Bash on Windows
@@ -111,7 +111,11 @@ try {
111
111
 
112
112
  ## Sync-templates: MERGE mode (v1.4.1)
113
113
 
114
- **File:** `scripts/sync-templates.js` — runs as `prepublishOnly` hook.
114
+ **File:** `scripts/sync-templates.js` — **not** a `prepublishOnly` hook, and not part of publishing.
115
+ `prepublishOnly` runs the publish gate (`scripts/prepublish-gate.mjs`); this script is opt-in only and
116
+ refuses to run unless the root it finds carries a `.p-replicator-sync-source` marker. The section
117
+ below records how its MERGE mode works, for whoever opts in — it does not describe anything that
118
+ happens during a normal publish.
115
119
 
116
120
  **Goal:** copy `.claude/` from source repo into `templates/.claude/` (which
117
121
  ends up in the npm tarball).
@@ -6,7 +6,7 @@ product development in Claude Code (Vibe Coding).
6
6
  ## What it is
7
7
 
8
8
  `p-replicator` installs a ready-made `.claude/` toolkit into any project:
9
- **11 slash commands**, **10 skills**, **4 agents**, **5 rules**, **6 hook
9
+ **11 slash commands**, **10 skills**, **4 agents**, **6 rules**, **7 hook
10
10
  scripts**, and a `settings.json` with pre-configured hooks. The flagship
11
11
  `/replicate` command takes a project through a 5-phase pipeline (Discovery →
12
12
  Planning → Validation → Toolkit Generation → Finalize), generating SPARC
@@ -162,7 +162,7 @@ npx @dzhechkov/p-replicator verify
162
162
 
163
163
  Команда проверит:
164
164
 
165
- - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 5 rules + settings.json
165
+ - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 6 rules + settings.json
166
166
  - **Post-/replicate hints** (advisory): CLAUDE.md, project-specific агенты,
167
167
  feature-roadmap.json, security-правила и т.д.
168
168
 
@@ -225,7 +225,7 @@ npx @dzhechkov/p-replicator doctor
225
225
  │ ├── skills/ # 10 skills
226
226
  │ ├── commands/ # 11 slash-команд
227
227
  │ ├── agents/ # 4 pipeline-агента
228
- │ ├── rules/ # 5 правил
228
+ │ ├── rules/ # 6 правил
229
229
  │ ├── hooks/ # 6 Node-скриптов
230
230
  │ └── settings.json # hooks + statusline config
231
231
  ├── .p-replicator.json # манифест установки
@@ -502,7 +502,7 @@ npx @dzhechkov/p-replicator verify
502
502
  ```
503
503
 
504
504
  Должен показать:
505
- - ✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 5 rules + settings.json)
505
+ - ✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 6 rules + settings.json)
506
506
  - ✅ Post-/replicate hints — для Mode 2 многие будут отсутствовать (это нормально)
507
507
  - 📊 Per-feature artifacts: `docs/features/<id>/01_specification.md`...`05_completion.md`,
508
508
  `validation-report.md`, `review-report.md`
@@ -83,7 +83,7 @@ P-Replicator V1.5.0 ● user │ Sonnet 4.7
83
83
  🚀 Pipeline /<cmd> ▓▓▓░░░░ 50% │ Phase: VALIDATE (2/4) │ Last: /replicate
84
84
  🎯 Roadmap [●●●○○○○○] mvp 3/8 │ Done 5/12 │ ▶ auth-jwt │ Domain: banking
85
85
  📊 SPARC ●11/11 │ 🟢 78/100 │ Plans ●3 │ ADRs ●2 │ Harvest 2026-05-05
86
- 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●5+2 │ Hooks ●6/6
86
+ 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●6+2 │ Hooks ●7/7
87
87
  💡 Insights ●12 (2026-05-06) │ Tests 85/85 ✓ │ MCP ●1/1 │ Settings ✓ │ 🧬 Keysarium ✓
88
88
  ```
89
89
 
@@ -248,7 +248,7 @@ echo ".claude/.last-test.json" >> .gitignore
248
248
 
249
249
  | Инструмент | Что проверяет | Когда |
250
250
  |---|---|---|
251
- | `npx @dzhechkov/p-replicator doctor` | Pre-shipped contract: 10 skills + 11 commands + 4 agents + 5 rules + settings.json + 6 hooks + git on PATH | После init / при подозрении что что-то сломалось |
251
+ | `npx @dzhechkov/p-replicator doctor` | Pre-shipped contract: 10 skills + 11 commands + 4 agents + 6 rules + settings.json + 7 hooks + git on PATH | После init / при подозрении что что-то сломалось |
252
252
  | `npx @dzhechkov/p-replicator verify` | Pre-shipped + post-/replicate hints (CLAUDE.md, planner.md, security.md, feature-roadmap.json, и т.д.) | После каждого `/replicate` для уверенности |
253
253
 
254
254
  **`doctor` exit codes:**
@@ -73,7 +73,7 @@ function getItemRelativePath(comp, itemKey) {
73
73
 
74
74
  **Дизайн-принцип:** zero shell dependency.
75
75
 
76
- Все 6 hook-скриптов написаны на pure Node, используют `execFileSync('git', [...])`
76
+ Все 7 hook-скриптов написаны на pure Node, используют `execFileSync('git', [...])`
77
77
  вместо shell-pipes. Это эквивалентно работает на:
78
78
  - Windows cmd.exe (нет `2>/dev/null`, есть `2>nul` — не нужен ни тот ни другой)
79
79
  - Bash / zsh / Git Bash на Windows
@@ -6,7 +6,7 @@ toolkit для AI-assisted разработки в Claude Code (Vibe Coding).
6
6
  ## Что это
7
7
 
8
8
  `p-replicator` устанавливает в проект готовый набор `.claude/`-инструментов:
9
- **11 slash-команд**, **10 skills**, **4 агента**, **5 правил**, **6 hook-скриптов**
9
+ **11 slash-команд**, **10 skills**, **4 агента**, **6 правил**, **7 hook-скриптов**
10
10
  и `settings.json` с pre-configured хуками. Главная команда `/replicate`
11
11
  проводит проект через 5-фазный pipeline (Discovery → Planning → Validation →
12
12
  Toolkit Generation → Finalize), генерирует SPARC-документацию и project-specific
@@ -112,7 +112,7 @@
112
112
  <h1 id="dokumentatsiya-dzhechkovp-replicator">Документация @dzhechkov/p-replicator</h1>
113
113
  <p>Полный комплект документации к npm-пакету <code>@dzhechkov/p-replicator</code> — toolkit для AI-assisted разработки в Claude Code (Vibe Coding).</p>
114
114
  <h2 id="index-chto-eto">Что это</h2>
115
- <p><code>p-replicator</code> устанавливает в проект готовый набор <code>.claude/</code>-инструментов: <strong>11 slash-команд</strong>, <strong>10 skills</strong>, <strong>4 агента</strong>, <strong>5 правил</strong>, <strong>6 hook-скриптов</strong> и <code>settings.json</code> с pre-configured хуками. Главная команда <code>/replicate</code> проводит проект через 5-фазный pipeline (Discovery → Planning → Validation → Toolkit Generation → Finalize), генерирует SPARC-документацию и project-specific артефакты.</p>
115
+ <p><code>p-replicator</code> устанавливает в проект готовый набор <code>.claude/</code>-инструментов: <strong>11 slash-команд</strong>, <strong>10 skills</strong>, <strong>4 агента</strong>, <strong>6 правил</strong>, <strong>7 hook-скриптов</strong> и <code>settings.json</code> с pre-configured хуками. Главная команда <code>/replicate</code> проводит проект через 5-фазный pipeline (Discovery → Planning → Validation → Toolkit Generation → Finalize), генерирует SPARC-документацию и project-specific артефакты.</p>
116
116
  <h2 id="index-navigatsiya">Навигация</h2>
117
117
  <div class="table-wrap"><table><thead><tr><th>Раздел</th><th>Описание</th></tr></thead><tbody><tr><td><a href="#quickstart">01_quickstart.md</a></td><td>Установка, первый запуск, проверка</td></tr><tr><td><a href="#user-guide">02_user_guide.md</a></td><td>Все команды и workflow с примерами</td></tr><tr><td><a href="#admin-guide">03_admin_guide.md</a></td><td>Настройка hooks, settings.json, statusline, insights</td></tr><tr><td><a href="#api-reference">04_api_reference.md</a></td><td>CLI-флаги, схемы манифеста, roadmap, state</td></tr><tr><td><a href="#architecture">05_architecture.md</a></td><td>Архитектура: pre-shipped vs generated, SSOT, hooks</td></tr><tr><td><a href="#troubleshooting">06_troubleshooting.md</a></td><td>Решение типичных проблем</td></tr><tr><td><a href="#changelog">07_changelog.md</a></td><td>История версий 1.3.x → 1.5.x</td></tr></tbody></table></div>
118
118
  <h2 id="index-yazyki">Языки</h2>
@@ -186,7 +186,7 @@ mv docs/your-arch.md docs/Architecture.md
186
186
  <p>После <code>/replicate</code> выполните:</p>
187
187
  <pre data-lang="bash"><code class="language-bash">npx @dzhechkov/p-replicator verify</code></pre>
188
188
  <p>Команда проверит:</p>
189
- <ul><li><strong>Pre-shipped contract</strong> (must-have): 10 skills + 11 commands + 4 agents + 5 rules + settings.json</li><li><strong>Post-/replicate hints</strong> (advisory): CLAUDE.md, project-specific агенты, feature-roadmap.json, security-правила и т.д.</li></ul>
189
+ <ul><li><strong>Pre-shipped contract</strong> (must-have): 10 skills + 11 commands + 4 agents + 6 rules + settings.json</li><li><strong>Post-/replicate hints</strong> (advisory): CLAUDE.md, project-specific агенты, feature-roadmap.json, security-правила и т.д.</li></ul>
190
190
  <p>Exit code <code>0</code> означает что pre-shipped контракт цел; warnings показывают что из project-specific артефактов ещё не создано.</p>
191
191
  <p>Альтернатива (для общей health-проверки):</p>
192
192
  <pre data-lang="bash"><code class="language-bash">npx @dzhechkov/p-replicator doctor</code></pre>
@@ -213,7 +213,7 @@ mv docs/your-arch.md docs/Architecture.md
213
213
  │ ├── skills/ # 10 skills
214
214
  │ ├── commands/ # 11 slash-команд
215
215
  │ ├── agents/ # 4 pipeline-агента
216
- │ ├── rules/ # 5 правил
216
+ │ ├── rules/ # 6 правил
217
217
  │ ├── hooks/ # 6 Node-скриптов
218
218
  │ └── settings.json # hooks + statusline config
219
219
  ├── .p-replicator.json # манифест установки
@@ -429,7 +429,7 @@ claude
429
429
  <p>После <code>/feature</code> (или <code>/run</code>) запустите:</p>
430
430
  <pre data-lang="bash"><code class="language-bash">npx @dzhechkov/p-replicator verify</code></pre>
431
431
  <p>Должен показать:</p>
432
- <ul><li>✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 5 rules + settings.json)</li><li>✅ Post-/replicate hints — для Mode 2 многие будут отсутствовать (это нормально)</li><li>📊 Per-feature artifacts: <code>docs/features/&lt;id&gt;/01_specification.md</code>...<code>05_completion.md</code>, <code>validation-report.md</code>, <code>review-report.md</code></li></ul>
432
+ <ul><li>✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 6 rules + settings.json)</li><li>✅ Post-/replicate hints — для Mode 2 многие будут отсутствовать (это нормально)</li><li>📊 Per-feature artifacts: <code>docs/features/&lt;id&gt;/01_specification.md</code>...<code>05_completion.md</code>, <code>validation-report.md</code>, <code>review-report.md</code></li></ul>
433
433
  <h4 id="user-guide-future-enhancement-m3-v-knownlimitations">Future enhancement (M3 в KNOWN_LIMITATIONS)</h4>
434
434
  <p><code>docPaths</code> config в <code>.p-replicator.json</code> для нестандартных путей доков — в roadmap'е. Tier S effort, чисто config + spec-read изменения, без изменений CLI-кода.</p>
435
435
  <hr>
@@ -551,7 +551,7 @@ Set DATABASE_URL_SHADOW env var explicitly to a separate database.
551
551
  🚀 Pipeline /&lt;cmd&gt; ▓▓▓░░░░ 50% │ Phase: VALIDATE (2/4) │ Last: /replicate
552
552
  🎯 Roadmap [●●●○○○○○] mvp 3/8 │ Done 5/12 │ ▶ auth-jwt │ Domain: banking
553
553
  📊 SPARC ●11/11 │ 🟢 78/100 │ Plans ●3 │ ADRs ●2 │ Harvest 2026-05-05
554
- 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●5+2 │ Hooks ●6/6
554
+ 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●6+2 │ Hooks ●7/7
555
555
  💡 Insights ●12 (2026-05-06) │ Tests 85/85 ✓ │ MCP ●1/1 │ Settings ✓ │ 🧬 Keysarium ✓</code></pre>
556
556
  <p><strong>Источники (heuristic + state-file):</strong></p>
557
557
  <div class="table-wrap"><table><thead><tr><th>Метрика</th><th>Откуда</th></tr></thead><tbody><tr><td>Pipeline command + phase + progress</td><td><code>.claude/.p-replicator-state.json</code> (state-file)</td></tr><tr><td>Roadmap progress</td><td><code>.claude/feature-roadmap.json</code></td></tr><tr><td>SPARC count</td><td><code>docs/{PRD,Architecture,...}.md</code> files</td></tr><tr><td>Validation score</td><td>regex extract from <code>docs/validation-report.md</code></td></tr><tr><td>Plans count</td><td><code>docs/plans/*.md</code></td></tr><tr><td>ADRs count</td><td><code>docs/ADR.md</code> <code>## ADR-...</code> headings, или <code>docs/adr/*.md</code>, или <code>docs/ddd/adr/*.md</code></td></tr><tr><td>Insights count + last date</td><td><code>## YYYY-MM-DD</code> headings в <code>.claude/insights/index.md</code></td></tr><tr><td>Toolkit counts</td><td>filesystem walk <code>.claude/{skills,commands,agents,rules,hooks}/</code></td></tr><tr><td>Settings status</td><td>deep-equals current vs <code>manifest.shippedDefaults</code> → <code>defaults</code>/<code>merged</code></td></tr><tr><td>MCP servers</td><td><code>.mcp.json</code></td></tr><tr><td>Domain</td><td>keyword grep <code>CLAUDE.md</code> (banking/retail/enterprise/healthcare)</td></tr><tr><td>Last harvest</td><td><code>TOOLKIT_HARVEST.md</code> mtime</td></tr><tr><td>Last test</td><td>optional <code>.claude/.last-test.json</code> cache</td></tr></tbody></table></div>
@@ -638,7 +638,7 @@ echo ".claude/.last-test.json" &gt;&gt; .gitignore</code></pre>
638
638
  <p><strong>Auto-commit</strong> через <code>autocommit-roadmap.cjs</code> (Stop hook) при изменениях.</p>
639
639
  <hr>
640
640
  <h2 id="admin-guide-doctor-verify-dva-raznyh-instrumenta">Doctor + Verify — два разных инструмента</h2>
641
- <div class="table-wrap"><table><thead><tr><th>Инструмент</th><th>Что проверяет</th><th>Когда</th></tr></thead><tbody><tr><td><code>npx @dzhechkov/p-replicator doctor</code></td><td>Pre-shipped contract: 10 skills + 11 commands + 4 agents + 5 rules + settings.json + 6 hooks + git on PATH</td><td>После init / при подозрении что что-то сломалось</td></tr><tr><td><code>npx @dzhechkov/p-replicator verify</code></td><td>Pre-shipped + post-/replicate hints (CLAUDE.md, planner.md, security.md, feature-roadmap.json, и т.д.)</td><td>После каждого <code>/replicate</code> для уверенности</td></tr></tbody></table></div>
641
+ <div class="table-wrap"><table><thead><tr><th>Инструмент</th><th>Что проверяет</th><th>Когда</th></tr></thead><tbody><tr><td><code>npx @dzhechkov/p-replicator doctor</code></td><td>Pre-shipped contract: 10 skills + 11 commands + 4 agents + 6 rules + settings.json + 7 hooks + git on PATH</td><td>После init / при подозрении что что-то сломалось</td></tr><tr><td><code>npx @dzhechkov/p-replicator verify</code></td><td>Pre-shipped + post-/replicate hints (CLAUDE.md, planner.md, security.md, feature-roadmap.json, и т.д.)</td><td>После каждого <code>/replicate</code> для уверенности</td></tr></tbody></table></div>
642
642
  <p><strong><code>doctor</code> exit codes:</strong></p>
643
643
  <ul><li><code>0</code> — всё в порядке</li><li><code>1</code> — что-то отсутствует из must-have (используйте <code>init --force</code> для repair)</li></ul>
644
644
  <p><strong><code>verify</code> exit codes:</strong></p>
@@ -914,7 +914,7 @@ npx @dzhechkov/p-replicator@latest init --force --reset-settings</code></pre>
914
914
  <hr>
915
915
  <h2 id="architecture-cross-platform-hooks-v141">Cross-platform hooks (v1.4.1)</h2>
916
916
  <p><strong>Дизайн-принцип:</strong> zero shell dependency.</p>
917
- <p>Все 6 hook-скриптов написаны на pure Node, используют <code>execFileSync('git', [...])</code> вместо shell-pipes. Это эквивалентно работает на:</p>
917
+ <p>Все 7 hook-скриптов написаны на pure Node, используют <code>execFileSync('git', [...])</code> вместо shell-pipes. Это эквивалентно работает на:</p>
918
918
  <ul><li>Windows cmd.exe (нет <code>2&gt;/dev/null</code>, есть <code>2&gt;nul</code> — не нужен ни тот ни другой)</li><li>Bash / zsh / Git Bash на Windows</li><li>PowerShell</li></ul>
919
919
  <p><strong>Pattern для autocommit-скрипта:</strong></p>
920
920
  <pre data-lang="javascript"><code class="language-javascript">const fs = require('node:fs');