@dzhechkov/p-replicator 1.10.4 → 1.13.1

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 (136) hide show
  1. package/.dz-manifest.json +312 -76
  2. package/CHANGELOG.md +232 -0
  3. package/MULTIPLATFORM_ROADMAP.md +1 -1
  4. package/README/eng/01_quickstart.md +3 -3
  5. package/README/eng/02_user_guide.md +1 -1
  6. package/README/eng/03_admin_guide.md +2 -2
  7. package/README/eng/04_api_reference.md +11 -5
  8. package/README/eng/05_architecture.md +1 -1
  9. package/README/eng/README.md +2 -1
  10. package/README/ru/01_quickstart.md +3 -3
  11. package/README/ru/02_user_guide.md +1 -1
  12. package/README/ru/03_admin_guide.md +2 -2
  13. package/README/ru/04_api_reference.md +11 -5
  14. package/README/ru/05_architecture.md +1 -1
  15. package/README/ru/README.md +2 -1
  16. package/README/ru/html/index.html +9 -9
  17. package/README.md +278 -39
  18. package/package.json +5 -4
  19. package/sbom.json +665 -75
  20. package/scripts/check-pipeline-gaps.sh +413 -0
  21. package/src/commands/doctor.js +94 -4
  22. package/src/commands/init.js +1 -1
  23. package/src/rule-components.json +15 -0
  24. package/src/utils.js +35 -11
  25. package/templates/.claude/agents/harvest-coordinator.md +10 -1
  26. package/templates/.claude/agents/product-discoverer.md +38 -0
  27. package/templates/.claude/agents/replicate-coordinator.md +11 -1
  28. package/templates/.claude/commands/feature.md +81 -9
  29. package/templates/.claude/commands/go.md +9 -0
  30. package/templates/.claude/commands/harvest.md +39 -3
  31. package/templates/.claude/commands/myinsights.md +21 -26
  32. package/templates/.claude/commands/replicate.md +171 -37
  33. package/templates/.claude/commands/start.md +29 -0
  34. package/templates/.claude/hooks/capture-source-path.cjs +795 -0
  35. package/templates/.claude/hooks/check-canon.cjs +493 -0
  36. package/templates/.claude/hooks/check-embed-contract.cjs +374 -0
  37. package/templates/.claude/hooks/check-external-deps.cjs +288 -0
  38. package/templates/.claude/hooks/check-file-ownership.cjs +424 -0
  39. package/templates/.claude/hooks/check-handoff-manifest.cjs +367 -0
  40. package/templates/.claude/hooks/check-job-contract.cjs +501 -0
  41. package/templates/.claude/hooks/check-look-origin.cjs +240 -0
  42. package/templates/.claude/hooks/check-look-trace.cjs +385 -0
  43. package/templates/.claude/hooks/check-metric-source.cjs +296 -0
  44. package/templates/.claude/hooks/check-model-cost.cjs +470 -0
  45. package/templates/.claude/hooks/check-ports.cjs +434 -24
  46. package/templates/.claude/hooks/check-source-version.cjs +312 -0
  47. package/templates/.claude/hooks/check-swarm-receipts.cjs +197 -0
  48. package/templates/.claude/hooks/check-webhook-contract.cjs +535 -0
  49. package/templates/.claude/hooks/session-insights.cjs +158 -25
  50. package/templates/.claude/hooks/statusline.cjs +2 -2
  51. package/templates/.claude/hooks/write-insight.cjs +253 -0
  52. package/templates/.claude/rules/cost-of-detection-ladder.md +96 -0
  53. package/templates/.claude/rules/docker-ports.md +41 -19
  54. package/templates/.claude/rules/embeddable-widget.md +73 -0
  55. package/templates/.claude/rules/feature-lifecycle.md +13 -3
  56. package/templates/.claude/rules/honest-configuration.md +54 -0
  57. package/templates/.claude/rules/incoming-webhooks.md +99 -0
  58. package/templates/.claude/rules/insights-capture.md +10 -5
  59. package/templates/.claude/rules/long-running-job.md +73 -0
  60. package/templates/.claude/rules/model-call-cost.md +85 -0
  61. package/templates/.claude/rules/replicate-pipeline.md +123 -52
  62. package/templates/.claude/rules/skill-interface-protocol.md +1 -0
  63. package/templates/.claude/rules/swarm-file-evidence.md +46 -0
  64. package/templates/.claude/settings.json +13 -1
  65. package/templates/.claude/skills/brutal-honesty-review/SKILL.md +9 -0
  66. package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +4 -0
  67. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/03-generate-p0.md +46 -1
  68. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/04-generate-p1.md +7 -1
  69. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/06-package-deliver.md +20 -2
  70. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/claude-md-strategy.md +7 -0
  71. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/automation-commands.md +17 -0
  72. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle-ent.md +43 -5
  73. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle.md +43 -7
  74. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +19 -1
  75. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/swarm-file-evidence.md +151 -0
  76. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +37 -22
  77. package/templates/.claude/skills/goap-research-ed25519/references/negative-results.md +94 -0
  78. package/templates/.claude/skills/goap-research-ed25519/scripts/check_report_evidence.py +368 -4
  79. package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +122 -5
  80. package/templates/.claude/skills/goap-research-ed25519/scripts/evidence_fetch.py +33 -16
  81. package/templates/.claude/skills/goap-research-ed25519/scripts/quote_provenance.py +342 -0
  82. package/templates/.claude/skills/goap-research-ed25519/scripts/test_ed25519_verifier.py +60 -0
  83. package/templates/.claude/skills/goap-research-ed25519/scripts/test_evidence_provenance.py +139 -6
  84. package/templates/.claude/skills/goap-research-ed25519/scripts/test_quote_provenance.py +274 -0
  85. package/templates/.claude/skills/goap-research-ed25519/scripts/test_suite_completeness.py +2 -1
  86. package/templates/.claude/skills/knowledge-extractor/SKILL.md +4 -0
  87. package/templates/.claude/skills/knowledge-extractor/modules/01-agent-review.md +16 -5
  88. package/templates/.claude/skills/pipeline-forge/SKILL.md +18 -23
  89. package/templates/.claude/skills/pipeline-forge/examples/replicate-analysis.md +7 -2
  90. package/templates/.claude/skills/pipeline-forge/references/patterns-catalog.md +19 -1
  91. package/templates/.claude/skills/pipeline-forge/references/self-extracted-patterns.md +17 -6
  92. package/templates/.claude/skills/pipeline-forge/references/skill-anatomy.md +0 -1
  93. package/templates/.claude/skills/reverse-engineering-unicorn/modules/025-cjm-prototype.md +21 -1
  94. package/templates/.claude/skills/sparc-prd-mini/SKILL.md +234 -716
  95. package/tests/e2e/lifecycle.test.js +55 -9
  96. package/tests/e2e/packed-insights-writer.test.js +308 -0
  97. package/tests/fixtures/prep-traceability-fixture/docs/features/order-refund/01_specification.md +29 -0
  98. package/tests/fixtures/prep-traceability-fixture/docs/features/order-refund/02_pseudocode.md +57 -0
  99. package/tests/snapshot/baseline.json +72 -46
  100. package/tests/snapshot/templates.test.js +47 -0
  101. package/tests/unit/absence-is-not-emptiness.test.js +15 -1
  102. package/tests/unit/capture-source-path.test.js +492 -0
  103. package/tests/unit/check-canon.test.js +403 -0
  104. package/tests/unit/check-embed-contract.test.js +422 -0
  105. package/tests/unit/check-external-deps.test.js +363 -0
  106. package/tests/unit/check-file-ownership.test.js +388 -0
  107. package/tests/unit/check-handoff-manifest.test.js +410 -0
  108. package/tests/unit/check-job-contract.test.js +514 -0
  109. package/tests/unit/check-look-origin.test.js +180 -0
  110. package/tests/unit/check-look-trace.test.js +420 -0
  111. package/tests/unit/check-metric-source.test.js +325 -0
  112. package/tests/unit/check-model-cost.test.js +425 -0
  113. package/tests/unit/check-pipeline-gaps.test.js +94 -0
  114. package/tests/unit/check-ports.test.js +773 -2
  115. package/tests/unit/check-source-version.test.js +344 -0
  116. package/tests/unit/check-swarm-receipts.test.js +231 -0
  117. package/tests/unit/check-webhook-contract.test.js +536 -0
  118. package/tests/unit/db-port-rule.test.js +43 -6
  119. package/tests/unit/detection-ladder-contract.test.js +302 -0
  120. package/tests/unit/detection-ladder-registry.test.js +52 -0
  121. package/tests/unit/doctor-insight-flow.test.js +315 -0
  122. package/tests/unit/external-dependency-check.test.js +19 -19
  123. package/tests/unit/generator-swarm-contract.test.js +287 -0
  124. package/tests/unit/guard-honest-input-meta.test.js +64 -0
  125. package/tests/unit/honest-failure-rules.test.js +574 -0
  126. package/tests/unit/hooks-project-anchored.test.js +67 -3
  127. package/tests/unit/insights-docs-tell-the-truth.test.js +52 -31
  128. package/tests/unit/insights-dz-delegation.test.js +197 -0
  129. package/tests/unit/insights-writer.test.js +285 -0
  130. package/tests/unit/look-phase-contract.test.js +231 -0
  131. package/tests/unit/negative-conclusion-gate.test.js +300 -0
  132. package/tests/unit/quote-provenance.test.js +122 -0
  133. package/tests/unit/shipped-suite-context.test.js +3 -1
  134. package/tests/unit/traceability-machine-ids.test.js +413 -0
  135. package/tests/unit/traceability-negative-fixture.test.js +322 -0
  136. package/tests/unit/utils.test.js +40 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,238 @@ 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
+ ## [Unreleased]
9
+
10
+ **Phase 0.5 gains the instrument for its `путь` axis: the source product is CLICKED THROUGH in a
11
+ browser instead of the axis staying permanently empty.**
12
+
13
+ Staged, not published — a disk version is not a shipped one.
14
+
15
+ ### Added
16
+
17
+ - **`.claude/hooks/capture-source-path.cjs`** — the browser click-through. `clone-website` captures
18
+ what is visible at ONE url; the route a person takes through a product — registration, onboarding,
19
+ first value, paywall — was captured by nothing, so the `путь` column shipped in 1.13.0 had no way
20
+ to be filled. This walks it and emits rows in the SAME `FR-LOOK-nnn` family, continuing the
21
+ profile's numbering. No second identifier family, no second artifact: the axis is a COLUMN.
22
+
23
+ Three outcomes, each with its own exit code — `0` captured · `1` the source opened but has no
24
+ onward step (a one-screen product: a legitimate `ИСТОЧНИКА НЕТ` for this axis, and a PROVEN
25
+ negative rather than blindness) · `2` `НЕ ИЗМЕРЕНО` with a reason from the closed list, printed as
26
+ the exact profile lines to paste.
27
+
28
+ **The zero-dependency contract is untouched.** Playwright is an EXTERNAL prerequisite exactly like
29
+ `clone-website`'s browser MCP: the module is resolved on the machine at run time
30
+ (`PLAYWRIGHT_MODULE` → the project → `npm root -g`) and its absence is the honest outcome
31
+ `no-browser`, never a crash.
32
+
33
+ **The legality boundary is executable, not merely described.** REGULARITIES are captured — the
34
+ spacing step, the type scale, how many hierarchy levels, how many form fields, how many screens to
35
+ first value — never VALUES to carry over. Third-party CSS and DOM are copyrighted code, so they
36
+ are not stored by default (`--keep-dom` warns out loud); the evidence directory ships its own
37
+ `.gitignore` and a note that it holds someone else's material; `robots.txt` is read before
38
+ crawling more than one page and a refusal is the outcome `robots-disallowed`; authentication and
39
+ any circumvention are refused outright, with a login screen recorded as the legitimate last step;
40
+ the User-Agent is honest, because masquerading as an ordinary browser would itself be
41
+ circumvention. Politeness is enforced, not advised: one thread, a pause (default 1500 ms, floor
42
+ 250), a hard page cap of 12 — exceeding either is clamped ALOUD.
43
+
44
+ **Brittleness is designed out.** Only computed styles and semantic roles (aria, form types,
45
+ accessible names) are read; class names are read NOWHERE, because bundlers change them on every
46
+ build of someone else's site.
47
+
48
+ ### Changed
49
+
50
+ - **Each axis of the Source Product Profile now answers for itself** — `**Статус съёмки:**` for
51
+ `облик`, `**Статус съёмки (путь):**` for `путь`. They FAIL APART (a landing page captures while
52
+ the click-through dies on a 403), so one shared status would have to lie about one of them. This
53
+ is one extra header line in the SAME artifact, not a second document, and the path declaration is
54
+ demanded only when the axis carries no rows — rows are its answer.
55
+
56
+ - `check-look-trace.cjs` now refuses an EMPTY, UNDECLARED `путь` axis with exit `2`. Before the
57
+ instrument existed, silence about the path was unavoidable; now it is a gap, and reading it as
58
+ clean would bless every profile that only ever looked at one screen. A `НЕ ИЗМЕРЕНО` path axis
59
+ keeps a fully traced profile at `2` — everything written down is traced, yet half the phase never
60
+ ran. A declared `ИСТОЧНИКА НЕТ` path axis does NOT block a clean bill, because the trace set is
61
+ non-empty and an honest answer must stay able to reach `0`. A proven loss outranks an unanswered
62
+ axis: `1` beats `2`.
63
+
64
+ - The closed reason list grew by the four ways a CLICK-THROUGH fails, each naming a different
65
+ repair: `no-browser`, `bot-protected`, `timeout`, `robots-disallowed`. `no-browser-mcp` (the
66
+ `clone-website` prerequisite) and `no-browser` (a local Playwright) stay separate entries — they
67
+ are different missing tools, and the matcher is pinned so neither spelling swallows the other.
68
+
69
+ ### Measured
70
+
71
+ - Nine live runs against a local fixture on 2026-09-01 exercised every outcome: captured,
72
+ one-screen, `no-browser`, `robots-disallowed` (both an explicit `Disallow` and an unreadable
73
+ robots.txt), `bot-protected` (403), `auth-required`, `out-of-scope`, `unreachable`. Politeness was
74
+ measured rather than asserted: at `--delay-ms 2000` the gap between requests was 2613 ms and
75
+ exactly two pages were fetched under `--max-pages 2`.
76
+
77
+ - **The spacing step is inferred by SHARE, not by GCD, and that is a measurement, not a preference.**
78
+ One browser default expressed in `em` (an `h1` at 56px yields a 38px margin) collapses the GCD to
79
+ 1–2 on a site with an honest 4px grid. On the probe histogram 8/12/16/20/24 the share for 4 is
80
+ 0.91 and for 8 is 0.73, so 4 is named and the share is printed alongside — "step 4px, share 0.91"
81
+ is checkable, "step 4px" is not.
82
+
83
+ - Six mutations, all discriminating: removing the path-axis gate (4 red), un-naming the instrument
84
+ in the rule (1), deleting the legality boundary from the rule (1), replacing the share inference
85
+ with an exact GCD (2), ignoring the politeness delay (1), skipping the robots.txt gate (1).
86
+
87
+ - The always-loaded corpus grew by +1158.75 estimated tokens (1.33% of the re-pinned preimage),
88
+ inside the untouched 4037.75 trigger. The instrument's own doctrine lives in its file header,
89
+ which is not part of that corpus — nothing reads a hook on every run.
90
+
91
+ ## [1.13.0] - 2026-09-01
92
+
93
+ **MINOR — `/replicate` gains a mandatory Phase 0.5 (Source Product Profile): when a project
94
+ reproduces an existing product, its LOOK is captured on the record instead of being invented.**
95
+
96
+ Staged, not published — a disk version is not a shipped one.
97
+
98
+ ### Added
99
+
100
+ - **Phase 0.5 — Source Product Profile**, a phase of its own between the Phase 0 checkpoint and
101
+ Phase 1. It asks, in every run, whether the project reproduces a NAMED existing product and what
102
+ that product looks like, and writes `docs/source-product-profile.md` in all three outcomes:
103
+ `СНЯТ` (captured — a filled `FR-LOOK-nnn` seed table), `ИСТОЧНИКА НЕТ` (the project replicates
104
+ nothing — a legitimate answer), and `НЕ ИЗМЕРЕНО` (a source was named but could not be captured,
105
+ with a reason from the closed list `no-browser-mcp` | `unreachable` | `auth-required` |
106
+ `out-of-scope`).
107
+
108
+ It is a SEPARATE phase, not a seventh module of `reverse-engineering-unicorn`, because Phase 0 is
109
+ skipped entirely by the `--from-docs` / `--skip-discovery` entry. A look-capture inside Phase 0
110
+ would switch itself off for exactly the projects that arrive with someone else's documentation —
111
+ which are, more often than not, replications of someone else's product.
112
+
113
+ Identifiers are ONE family: `FR-LOOK-<nnn>` with the axis (`облик` / `путь`) as a COLUMN. A second
114
+ namespace such as `FR-FLOW-nnn` would have to be kept in step with the first; one family with a
115
+ column does not.
116
+
117
+ - `.claude/hooks/check-look-trace.cjs` — the deterministic half. Did the Phase-0.5 seed reach
118
+ `docs/Specification.md`? Three exit codes, and the third is the point: `0` traced (or rejected
119
+ with a reason), `1` proven loss with the ids NAMED, `2` THE CHECK DID NOT RUN — no profile, no
120
+ Specification, an untouched template table, a reused id, a row with no axis, or either of the two
121
+ legitimate non-captures. Per the shipped `honest-configuration` rule (CFG-I4), an unreachable
122
+ source of truth yields UNKNOWN, never a plausible value.
123
+
124
+ The capture itself is performed by the canonical `clone-website` skill from the separate
125
+ `@dzhechkov/skills-website-cloner` package, run recon-only. It is **called, never vendored**
126
+ (ADR-0001): the pre-shipped skill contract stays at ten.
127
+
128
+ ### Changed
129
+
130
+ - `reverse-engineering-unicorn/modules/025-cjm-prototype.md`: the industry palette table
131
+ (Health→Emerald, Fintech→Blue, …) is now a **labelled FALLBACK**, reachable only through
132
+ «источника нет» and «облик НЕ ИЗМЕРЕН», with a precedence block above it. A pipeline whose job is
133
+ to reproduce a product was assigning that product a palette by industry; the guess is not one of
134
+ two equal options, it is worse than a measurement by exactly the distance between invented and
135
+ observed. The table stays — it is the right answer when there is no source — and in those states
136
+ it is signed as a fallback, because an unlabelled palette and a labelled one look identical to the
137
+ next reader and mean different things.
138
+ - Hook inventory: **11** utilities in `.claude/hooks/` (was 10). `replicate-pipeline.md` had said
139
+ «Hooks (8 files)» since the ninth and tenth landed — a second-generation lie fixed in the same
140
+ change, along with the README hook table, which listed only seven of them.
141
+ - `replicate.md`, `rules/replicate-pipeline.md` and `agents/replicate-coordinator.md` — the three
142
+ places that declare the phase sequence — all carry Phase 0.5 and the same artifact path; a test
143
+ pins their agreement and the section ORDER.
144
+
145
+ ### Tests
146
+
147
+ - `tests/unit/check-look-trace.test.js` — 15 behaviour tests over real temporary projects: a filled
148
+ table with no promotion exits 1 with the lost ids NAMED; an absent profile exits 2, never 0; an
149
+ untouched bracketed template exits 2 rather than reading as "the phase ran"; each of the three
150
+ outcomes, the closed reason list, a reused id, a missing axis, and one binary producing all three
151
+ verdicts in a single run.
152
+ - `tests/unit/look-phase-contract.test.js` — 9 tests pinning the phase in the prose: the Phase 0.5
153
+ section index lies between the Phase 0 checkpoint and the Phase 1 heading, the three declaring
154
+ files agree, the industry palette is labelled a fallback with the precedence block ABOVE the
155
+ table, the capture skill is not vendored, and the advertised hook count matches what ships.
156
+ MEASURED: three independent mutations (renaming the section heading, unlabelling the table
157
+ caption, unregistering the hook) each turn the suite red.
158
+
159
+ ## [1.12.0] - 2026-08-31
160
+
161
+ **MINOR — the pre-shipped rule contract moves from seven rules to nine, and the port check gains a
162
+ second, deliberately chosen scope.**
163
+
164
+ Note for anyone upgrading from 1.10.4: `1.11.0` was prepared but never published, so this release
165
+ carries its ladder work as well. Read both entries.
166
+
167
+ ### Added
168
+
169
+ - `check-ports.cjs --machine`: a second scope that inventories the running containers of the current
170
+ Docker context, recognizes storage through the shared image taxonomy, attributes Compose ownership
171
+ from labels, and probes Redis auth live. The rule always stated a MACHINE invariant while the check
172
+ answered for one DIRECTORY — a green receipt was reported on a host where three neighbouring
173
+ databases sat on `0.0.0.0` and a Redis ran with no password at all. Catalog mode never queries the
174
+ runtime; the loopback exception stays, and revoking it would be a separate decision.
175
+ - `swarm-file-evidence` rule: every parallel work unit has a named file result. A narrative reply is
176
+ only a pointer, silence is neither progress nor completion, and a status of `running` beside a dead
177
+ recorded PID closes the unit as failed rather than reporting work from silence.
178
+ - `honest-configuration` rule: a value governing external output, access, limits, routing, or an
179
+ authoritative measurement must not become plausible or permissive when its meaning is absent or
180
+ unproven. `undefined` stays distinct from `''`, the allowlist lives in code while the environment
181
+ only selects from it, and `0/0` renders unavailable rather than `0%`.
182
+ - The packaged `write-insight.cjs` boundary is the required final persistence gate for quick and full
183
+ `/harvest` runs carrying a candidate. Its structured-stdin contract lazily creates the Markdown
184
+ carrier, preserves prior bytes on append, and returns `duplicate` for an exact normalized replay.
185
+ Runtime behaviour has no `dz` dependency. Until this landed, `/harvest` had no writer at all: a
186
+ field project ran three days and 69 commits with 19 fixes and zero insights recorded, every
187
+ surface green.
188
+ - Exact-artifact acceptance installs `npm pack` output into a fresh consumer and exercises
189
+ absent → create → append → replay → delete → doctor → recreate without checkout substitution.
190
+ - Targeted mutation defenses for receipt enforcement, first-write creation, exact-repeat idempotence
191
+ and missing-carrier visibility.
192
+ - `doctor` reports the insight FLOW: fix commits against insight records for a named period. It is
193
+ informational by construction — a low ratio can equally mean the work went smoothly — and it never
194
+ changes doctor's exit code.
195
+
196
+ ### Changed
197
+
198
+ - The SessionStart insight hook now prints `инсайтов пока нет; /myinsights создаст первую запись`
199
+ when the carrier is absent, while remaining exit-zero and non-mutating; empty and read-error states
200
+ stay distinct from that ordinary missing branch. The hook's silence was the named cause of the
201
+ three-day invisibility above.
202
+ - The pre-shipped hook/utility contract grows from 9 to 10.
203
+ - Insight delivery delegates to `dz` only when recall is genuinely ARMED. `command -v dz` is not the
204
+ condition: local output is suppressed only after a successful, non-empty recall carrying
205
+ `--domain p-replicator-insights`. Absent, failing, and empty recall each fall back to local output,
206
+ and a failure is named rather than swallowed. Markdown remains the source of truth throughout.
207
+ - `docker-ports.md` now names EXPOSURE as the consequence of a miss instead of port conflicts, and
208
+ explains that the left-hand side of `${DB_PORT:-11432}:5432` says nothing about the publish
209
+ address — the address is the third element, defaulting to all interfaces.
210
+
211
+ ### Honest limits
212
+
213
+ - An unreadable state — no git, not a repository, an unreadable carrier, a config that cannot be
214
+ parsed — renders as NOT PERFORMED with its reason named, never as a measured zero. A check that
215
+ answers "clean" about a state it could not read is worse than no check.
216
+ - `--machine` is a snapshot of the current Docker context at the moment it is invoked. It is not
217
+ continuous monitoring, and it says nothing about stopped containers or another context.
218
+ - The flow check counts; it does not judge whether the captured insights are worth anything.
219
+
220
+ ## [1.11.0] - 2026-08-30
221
+
222
+ **MINOR — the pre-shipped consumer rule contract moves from six rules to seven.**
223
+
224
+ ### Added
225
+
226
+ - Added the consumer-local `cost-of-detection-ladder` rule: five enforcement layers, signal-fit
227
+ check selection, and an owned reaction for every violation.
228
+ - Registered and shipped the ladder as the seventh rule required by `init`, `doctor`, and `verify`,
229
+ with link-backs from the two ADR-named quality-gate rules.
230
+
231
+ ### Fixed
232
+
233
+ - Made the backlink contract ignore the ladder link itself when detecting prose allusions, so
234
+ removing either required link now makes the focused gate fail.
235
+ - Replaced the distribution tautology with an assertion over the actual `npm pack --dry-run --json`
236
+ file listing.
237
+ - Added a mutation-gate case for removing the seventh-rule requirement, restored the count scanner's
238
+ cross-line reach, and aligned the signed manifest with the files npm actually packs.
239
+
8
240
  ## [1.10.0] - 2026-08-27
9
241
 
10
242
  **Every guard in this package can now be shown to fail — and three that could not, now can.**
@@ -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
- | 6 rules | ✅ universal markdown | path-translate | **Yes** |
115
+ | 13 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) |
@@ -22,7 +22,7 @@ This creates:
22
22
  - `.claude/skills/` — 10 pre-shipped skills
23
23
  - `.claude/commands/` — 11 slash commands (`/replicate`, `/run`, `/feature`, ...)
24
24
  - `.claude/agents/` — 4 pipeline agents
25
- - `.claude/rules/` — 5 governance rules
25
+ - `.claude/rules/` — 9 governance rules
26
26
  - `.claude/hooks/` — 6 cross-platform Node scripts
27
27
  - `.claude/settings.json` — hooks + statusline configuration
28
28
  - `.p-replicator.json` — install manifest
@@ -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 + 6 rules + settings.json
165
+ - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 13 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/ # 6 rules
228
+ │ ├── rules/ # 13 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 + 6 rules + settings.json)
504
+ - ✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 13 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 ●6+2 │ Hooks ●7/7
86
+ 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●13+2 │ Hooks ●17/17
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 + 6 rules + settings.json + 7 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 + 13 rules + settings.json + 17 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:**
@@ -51,7 +51,7 @@ Formal reference: CLI commands, flags, JSON schemas.
51
51
  ],
52
52
  "shippedDefaults": {
53
53
  "settings.json": {
54
- "hooks": { "SessionStart": [...], "Stop": [...] },
54
+ "hooks": { "SessionStart": [...], "UserPromptSubmit": [...], "Stop": [...] },
55
55
  "statusLine": { "type": "command", "command": "..." }
56
56
  }
57
57
  }
@@ -176,6 +176,7 @@ node .claude/hooks/state-update.cjs --json '{"currentCommand":"/run", ...}'
176
176
  },
177
177
  "hooks": {
178
178
  "SessionStart": [ /* matchers + hooks */ ],
179
+ "UserPromptSubmit": [ /* matchers + hooks */ ],
179
180
  "Stop": [ /* matchers + hooks */ ],
180
181
  "PreToolUse": [ /* user-added */ ],
181
182
  "PostToolUse": [ /* user-added */ ]
@@ -216,6 +217,7 @@ Each entry:
216
217
 
217
218
  **Event types in Claude Code:**
218
219
  - `SessionStart` — at session start (stdout injected into context)
220
+ - `UserPromptSubmit` — after the real user prompt is available (structured context injection)
219
221
  - `Stop` — at turn end (side-effects: commit, log)
220
222
  - `PreToolUse`, `PostToolUse` — around tool calls
221
223
 
@@ -268,10 +270,14 @@ Used by `verify`, `doctor`, `list` for uniform path resolution.
268
270
 
269
271
  ### `session-insights.cjs`
270
272
 
271
- **Trigger:** `SessionStart` hook.
272
- **Reads:** `.claude/insights/index.md` (`## YYYY-MM-DD` headings)
273
- **Writes:** stdout (Claude Code injects into session context)
274
- **Output:** up to 3 recent insights as `## Recent project insights\n\n## ... ## ... ## ...`
273
+ **Trigger:** `SessionStart` and `UserPromptSubmit` hooks.
274
+ **Reads:** the Markdown source of truth at `.claude/insights/index.md`; prompt-time delivery also
275
+ invokes optional `dz recall` with the project root pinned.
276
+ **Writes:** the missing-carrier hint at SessionStart, or one UserPromptSubmit context envelope.
277
+ **Output:** only a successful, non-empty dz recall result suppresses local output. Absent, failing,
278
+ or empty recall uses the local fallback of up to 3 recent Markdown entries; failure is named and the
279
+ other two states are quiet. The writer establishes Markdown first and only then attempts a
280
+ best-effort, idempotent `dz teach` duplicate, so projection failure cannot erase the record.
275
281
 
276
282
  ### `autocommit-roadmap.cjs` / `autocommit-insights.cjs` / `autocommit-plans.cjs`
277
283
 
@@ -73,7 +73,7 @@ function getItemRelativePath(comp, itemKey) {
73
73
 
74
74
  **Design principle:** zero shell dependency.
75
75
 
76
- All 7 hook scripts are pure Node, using `execFileSync('git', [...])`
76
+ All 15 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
@@ -6,7 +6,8 @@ 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**, **6 rules**, **7 hook
9
+ **11 slash commands**, **10 skills**, **4 agents**, **13 rules**, **15 hook
10
+ **11 slash commands**, **10 skills**, **4 agents**, **13 rules**, **7 hook
10
11
  scripts**, and a `settings.json` with pre-configured hooks. The flagship
11
12
  `/replicate` command takes a project through a 5-phase pipeline (Discovery →
12
13
  Planning → Validation → Toolkit Generation → Finalize), generating SPARC
@@ -22,7 +22,7 @@ npx @dzhechkov/p-replicator init
22
22
  - `.claude/skills/` — 10 предустановленных skills
23
23
  - `.claude/commands/` — 11 slash-команд (`/replicate`, `/run`, `/feature`, ...)
24
24
  - `.claude/agents/` — 4 пайплайн-агента
25
- - `.claude/rules/` — 5 governance-правил
25
+ - `.claude/rules/` — 9 governance-правил
26
26
  - `.claude/hooks/` — 6 cross-platform Node-скриптов
27
27
  - `.claude/settings.json` — конфигурация hooks + statusline
28
28
  - `.p-replicator.json` — манифест установки
@@ -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 + 6 rules + settings.json
165
+ - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 13 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/ # 6 правил
228
+ │ ├── rules/ # 13 правил
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 + 6 rules + settings.json)
505
+ - ✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 13 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 ●6+2 │ Hooks ●7/7
86
+ 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●13+2 │ Hooks ●17/17
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 + 6 rules + settings.json + 7 hooks + git on PATH | После init / при подозрении что что-то сломалось |
251
+ | `npx @dzhechkov/p-replicator doctor` | Pre-shipped contract: 10 skills + 11 commands + 4 agents + 13 rules + settings.json + 17 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:**
@@ -51,7 +51,7 @@
51
51
  ],
52
52
  "shippedDefaults": {
53
53
  "settings.json": {
54
- "hooks": { "SessionStart": [...], "Stop": [...] },
54
+ "hooks": { "SessionStart": [...], "UserPromptSubmit": [...], "Stop": [...] },
55
55
  "statusLine": { "type": "command", "command": "..." }
56
56
  }
57
57
  }
@@ -180,6 +180,7 @@ node .claude/hooks/state-update.cjs --json '{"currentCommand":"/run", ...}'
180
180
  },
181
181
  "hooks": {
182
182
  "SessionStart": [ /* matchers + hooks */ ],
183
+ "UserPromptSubmit": [ /* matchers + hooks */ ],
183
184
  "Stop": [ /* matchers + hooks */ ],
184
185
  "PreToolUse": [ /* user-added */ ],
185
186
  "PostToolUse": [ /* user-added */ ]
@@ -220,6 +221,7 @@ node .claude/hooks/state-update.cjs --json '{"currentCommand":"/run", ...}'
220
221
 
221
222
  **Event types в Claude Code:**
222
223
  - `SessionStart` — при начале сессии (stdout инжектится в context)
224
+ - `UserPromptSubmit` — после появления реального пользовательского prompt (structured context)
223
225
  - `Stop` — при завершении turn'а (side-effects: commit, log)
224
226
  - `PreToolUse`, `PostToolUse` — вокруг tool-вызовов
225
227
 
@@ -299,10 +301,14 @@ const COMPONENTS = {
299
301
 
300
302
  ### `session-insights.cjs`
301
303
 
302
- **Trigger:** `SessionStart` hook.
303
- **Reads:** `.claude/insights/index.md` (`## YYYY-MM-DD` headings)
304
- **Writes:** stdout (Claude Code инжектит в session context)
305
- **Output:** до 3 свежих insights в `## Recent project insights\n\n## ... ## ... ## ...` format
304
+ **Trigger:** hooks `SessionStart` и `UserPromptSubmit`.
305
+ **Reads:** Markdown-источник истины `.claude/insights/index.md`; prompt-time выдача также вызывает
306
+ optional `dz recall` с закреплённым корнем проекта.
307
+ **Writes:** missing-carrier hint на SessionStart либо один context-envelope UserPromptSubmit.
308
+ **Output:** только успешный непустой вывод recall подавляет локальную выдачу. Отсутствующий,
309
+ падающий или пустой recall использует локальный fallback до 3 свежих Markdown-записей; failure
310
+ назван, отсутствие и пустой вывод тихие. Writer сначала сохраняет Markdown и только затем делает
311
+ best-effort идемпотентный дубль через `dz teach`, поэтому отказ проекции не стирает запись.
306
312
 
307
313
  ### `autocommit-roadmap.cjs` / `autocommit-insights.cjs` / `autocommit-plans.cjs`
308
314
 
@@ -73,7 +73,7 @@ function getItemRelativePath(comp, itemKey) {
73
73
 
74
74
  **Дизайн-принцип:** zero shell dependency.
75
75
 
76
- Все 7 hook-скриптов написаны на pure Node, используют `execFileSync('git', [...])`
76
+ Все 15 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,8 @@ toolkit для AI-assisted разработки в Claude Code (Vibe Coding).
6
6
  ## Что это
7
7
 
8
8
  `p-replicator` устанавливает в проект готовый набор `.claude/`-инструментов:
9
- **11 slash-команд**, **10 skills**, **4 агента**, **6 правил**, **7 hook-скриптов**
9
+ **11 slash-команд**, **10 skills**, **4 агента**, **13 правил**, **15 hook-скриптов**
10
+ **11 slash-команд**, **10 skills**, **4 агента**, **13 правил**, **7 hook-скриптов**
10
11
  и `settings.json` с pre-configured хуками. Главная команда `/replicate`
11
12
  проводит проект через 5-фазный pipeline (Discovery → Planning → Validation →
12
13
  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>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>
115
+ <p><code>p-replicator</code> устанавливает в проект готовый набор <code>.claude/</code>-инструментов: <strong>11 slash-команд</strong>, <strong>10 skills</strong>, <strong>4 агента</strong>, <strong>13 правил</strong>, <strong>17 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>
@@ -140,7 +140,7 @@ claude # открыть Claude Code
140
140
  <p>В корне вашего проекта:</p>
141
141
  <pre data-lang="bash"><code class="language-bash">npx @dzhechkov/p-replicator init</code></pre>
142
142
  <p>Это создаст:</p>
143
- <ul><li><code>.claude/skills/</code> — 10 предустановленных skills</li><li><code>.claude/commands/</code> — 11 slash-команд (<code>/replicate</code>, <code>/run</code>, <code>/feature</code>, ...)</li><li><code>.claude/agents/</code> — 4 пайплайн-агента</li><li><code>.claude/rules/</code> — 5 governance-правил</li><li><code>.claude/hooks/</code> — 6 cross-platform Node-скриптов</li><li><code>.claude/settings.json</code> — конфигурация hooks + statusline</li><li><code>.p-replicator.json</code> — манифест установки</li></ul>
143
+ <ul><li><code>.claude/skills/</code> — 10 предустановленных skills</li><li><code>.claude/commands/</code> — 11 slash-команд (<code>/replicate</code>, <code>/run</code>, <code>/feature</code>, ...)</li><li><code>.claude/agents/</code> — 4 пайплайн-агента</li><li><code>.claude/rules/</code> — 9 governance-правил</li><li><code>.claude/hooks/</code> — 6 cross-platform Node-скриптов</li><li><code>.claude/settings.json</code> — конфигурация hooks + statusline</li><li><code>.p-replicator.json</code> — манифест установки</li></ul>
144
144
  <p>Установка идемпотентна: <code>init</code> не перезапишет существующие файлы без флага <code>--force</code>.</p>
145
145
  <h2 id="quickstart-pervyy-zapusk">Первый запуск</h2>
146
146
  <pre data-lang="bash"><code class="language-bash">claude # открыть Claude Code в проекте</code></pre>
@@ -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 + 6 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 + 13 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/ # 6 правил
216
+ │ ├── rules/ # 13 правил
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 + 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>
432
+ <ul><li>✅ Pre-shipped contract intact (10 skills + 11 commands + 4 agents + 13 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 ●6+2 │ Hooks ●7/7
554
+ 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●13+2 │ Hooks ●17/17
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 + 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>
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 + 13 rules + settings.json + 17 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>Все 7 hook-скриптов написаны на pure Node, используют <code>execFileSync('git', [...])</code> вместо shell-pipes. Это эквивалентно работает на:</p>
917
+ <p>Все 17 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');
@@ -1277,7 +1277,7 @@ find docs/ -type f -name "*.md" | wc -l</code></pre>
1277
1277
  <ul><li>🐛 <strong>Cross-platform hooks:</strong> заменены bash-chains на 4 Node-скрипта (<code>session-insights</code>, <code>autocommit-{roadmap,insights,plans}</code>)</li><li>🐛 <strong><code>verify.js</code> SSOT:</strong> <code>kind: 'pre-shipped' | 'project-generated'</code> field + 3 новых project-generated groups</li><li>🐛 <strong>Meta-tests</strong> для <code>replicate.md</code> ↔ <code>replicate-pipeline.md</code> consistency</li><li>🐛 <strong>Critical regression discovered + fixed:</strong> <code>sync-templates.js</code> cleanDir тихо удалял pre-shipped файлы во время <code>npm publish --dry-run</code>. Switched to MERGE mode</li><li>🆕 6th COMPONENTS group: <code>hooks</code> (4 cross-platform Node scripts)</li><li>🆕 <code>getItemRelativePath()</code> helper для централизованного path-derivation</li><li>📊 74 tests, +14 от v1.4.0</li></ul>
1278
1278
  <h2 id="changelog-v140-2026-05-06">v1.4.0 — 2026-05-06</h2>
1279
1279
  <p><strong>Major release — 9 pre-shipped команд + verify command.</strong></p>
1280
- <ul><li>✨ Закрыт корневой источник pain: <code>/replicate</code> Phase 3 больше не пытается генерировать generic команды. Все 11 commands + 5 rules + settings.json + 4 hooks теперь pre-shipped через <code>init</code></li><li>✨ <strong>9 новых pre-shipped команд:</strong> <code>/start</code>, <code>/plan</code>, <code>/feature</code>, <code>/go</code>, <code>/run</code>, <code>/next</code>, <code>/myinsights</code>, <code>/docs</code>, <code>/deploy</code></li><li>✨ <strong>3 новых pre-shipped rules:</strong> <code>git-workflow</code>, <code>insights-capture</code>, <code>feature-lifecycle</code></li><li>✨ <strong>Settings.json shipped</strong> with hooks (SessionStart insights inject + Stop auto-commit)</li><li>✨ <strong><code>verify</code> command</strong> — replaces user's manual verification prompt</li><li>🐛 5 sources of truth divergence (<code>replicate.md</code>, <code>replicate-pipeline.md</code>, cc-toolkit modules, README, cli help) unified via <code>utils.COMPONENTS.items</code></li><li>📊 60 tests, +8 от v1.3.1</li></ul>
1280
+ <ul><li>✨ Закрыт корневой источник pain: <code>/replicate</code> Phase 3 больше не пытается генерировать generic команды. Все 11 commands + 13 rules + settings.json + 17 hooks теперь pre-shipped через <code>init</code></li><li>✨ <strong>9 новых pre-shipped команд:</strong> <code>/start</code>, <code>/plan</code>, <code>/feature</code>, <code>/go</code>, <code>/run</code>, <code>/next</code>, <code>/myinsights</code>, <code>/docs</code>, <code>/deploy</code></li><li>✨ <strong>3 новых pre-shipped rules:</strong> <code>git-workflow</code>, <code>insights-capture</code>, <code>feature-lifecycle</code></li><li>✨ <strong>Settings.json shipped</strong> with hooks (SessionStart insights inject + Stop auto-commit)</li><li>✨ <strong><code>verify</code> command</strong> — replaces user's manual verification prompt</li><li>🐛 5 sources of truth divergence (<code>replicate.md</code>, <code>replicate-pipeline.md</code>, cc-toolkit modules, README, cli help) unified via <code>utils.COMPONENTS.items</code></li><li>📊 60 tests, +8 от v1.3.1</li></ul>
1281
1281
  <h2 id="changelog-v131-2026-05-06">v1.3.1 — 2026-05-06</h2>
1282
1282
  <p><strong>Two real bug fixes.</strong></p>
1283
1283
  <ul><li>🐛 <strong><code>cli.js</code> --help showed «1 rule» while <code>EXPECTED_RULES</code> had 2 entries.</strong> SSOT fix: <code>COMPONENTS.&lt;group&gt;.items</code> map is single source of truth for counts, used by doctor/list/cli.js help via dynamic derivation</li><li>🐛 <strong><code>update.js</code> corrupted manifest</strong> — walked user's full <code>.claude/</code>, capturing project-generated files into <code>manifest.files</code>. Subsequent <code>remove</code> would delete them, contradicting documented behavior. Fixed by using <code>getRelativePaths(templateClaude)</code> instead</li><li>🐛 Bonus: <code>update</code> now removes orphan template files (files in old manifest but not in new template) — addresses original v1.3.0 concern about ignored <code>missing[]</code> from <code>diffFiles</code></li><li>📊 52 tests, +7 от v1.3.0</li></ul>