@dzhechkov/p-replicator 1.12.0 → 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 (106) hide show
  1. package/.dz-manifest.json +225 -61
  2. package/CHANGELOG.md +148 -1
  3. package/LICENSE +21 -0
  4. package/MULTIPLATFORM_ROADMAP.md +1 -1
  5. package/README/eng/01_quickstart.md +2 -2
  6. package/README/eng/02_user_guide.md +1 -1
  7. package/README/eng/03_admin_guide.md +2 -2
  8. package/README/eng/05_architecture.md +1 -1
  9. package/README/eng/README.md +2 -1
  10. package/README/ru/01_quickstart.md +2 -2
  11. package/README/ru/02_user_guide.md +1 -1
  12. package/README/ru/03_admin_guide.md +2 -2
  13. package/README/ru/05_architecture.md +1 -1
  14. package/README/ru/README.md +2 -1
  15. package/README/ru/html/index.html +8 -8
  16. package/README.md +132 -9
  17. package/bin/cli.js +0 -0
  18. package/package.json +10 -11
  19. package/sbom.json +470 -60
  20. package/scripts/check-pipeline-gaps.sh +0 -0
  21. package/src/commands/init.js +1 -1
  22. package/src/rule-components.json +5 -1
  23. package/src/utils.js +32 -3
  24. package/templates/.claude/agents/product-discoverer.md +38 -0
  25. package/templates/.claude/agents/replicate-coordinator.md +11 -1
  26. package/templates/.claude/commands/feature.md +29 -5
  27. package/templates/.claude/commands/go.md +6 -8
  28. package/templates/.claude/commands/harvest.md +5 -7
  29. package/templates/.claude/commands/replicate.md +169 -44
  30. package/templates/.claude/commands/start.md +28 -7
  31. package/templates/.claude/hooks/capture-source-path.cjs +795 -0
  32. package/templates/.claude/hooks/check-canon.cjs +493 -0
  33. package/templates/.claude/hooks/check-embed-contract.cjs +374 -0
  34. package/templates/.claude/hooks/check-external-deps.cjs +288 -0
  35. package/templates/.claude/hooks/check-file-ownership.cjs +424 -0
  36. package/templates/.claude/hooks/check-handoff-manifest.cjs +367 -0
  37. package/templates/.claude/hooks/check-job-contract.cjs +501 -0
  38. package/templates/.claude/hooks/check-look-origin.cjs +240 -0
  39. package/templates/.claude/hooks/check-look-trace.cjs +385 -0
  40. package/templates/.claude/hooks/check-metric-source.cjs +296 -0
  41. package/templates/.claude/hooks/check-model-cost.cjs +470 -0
  42. package/templates/.claude/hooks/check-ports.cjs +27 -6
  43. package/templates/.claude/hooks/check-source-version.cjs +312 -0
  44. package/templates/.claude/hooks/check-swarm-receipts.cjs +197 -0
  45. package/templates/.claude/hooks/check-webhook-contract.cjs +535 -0
  46. package/templates/.claude/hooks/statusline.cjs +2 -2
  47. package/templates/.claude/rules/embeddable-widget.md +73 -0
  48. package/templates/.claude/rules/feature-lifecycle.md +5 -6
  49. package/templates/.claude/rules/incoming-webhooks.md +99 -0
  50. package/templates/.claude/rules/long-running-job.md +73 -0
  51. package/templates/.claude/rules/model-call-cost.md +85 -0
  52. package/templates/.claude/rules/replicate-pipeline.md +121 -52
  53. package/templates/.claude/skills/brutal-honesty-review/SKILL.md +9 -0
  54. package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +4 -0
  55. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/03-generate-p0.md +46 -1
  56. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/04-generate-p1.md +7 -1
  57. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/06-package-deliver.md +20 -2
  58. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/claude-md-strategy.md +7 -0
  59. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/automation-commands.md +17 -0
  60. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle-ent.md +43 -5
  61. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle.md +43 -7
  62. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +19 -1
  63. package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/swarm-file-evidence.md +151 -0
  64. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +37 -22
  65. package/templates/.claude/skills/goap-research-ed25519/references/negative-results.md +94 -0
  66. package/templates/.claude/skills/goap-research-ed25519/scripts/check_report_evidence.py +368 -4
  67. package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +122 -5
  68. package/templates/.claude/skills/goap-research-ed25519/scripts/evidence_fetch.py +33 -16
  69. package/templates/.claude/skills/goap-research-ed25519/scripts/quote_provenance.py +342 -0
  70. package/templates/.claude/skills/goap-research-ed25519/scripts/test_ed25519_verifier.py +60 -0
  71. package/templates/.claude/skills/goap-research-ed25519/scripts/test_evidence_provenance.py +139 -6
  72. package/templates/.claude/skills/goap-research-ed25519/scripts/test_quote_provenance.py +274 -0
  73. package/templates/.claude/skills/goap-research-ed25519/scripts/test_suite_completeness.py +2 -1
  74. package/templates/.claude/skills/knowledge-extractor/SKILL.md +4 -0
  75. package/templates/.claude/skills/pipeline-forge/SKILL.md +18 -23
  76. package/templates/.claude/skills/pipeline-forge/examples/replicate-analysis.md +7 -2
  77. package/templates/.claude/skills/pipeline-forge/references/patterns-catalog.md +19 -1
  78. package/templates/.claude/skills/pipeline-forge/references/self-extracted-patterns.md +17 -6
  79. package/templates/.claude/skills/pipeline-forge/references/skill-anatomy.md +0 -1
  80. package/templates/.claude/skills/reverse-engineering-unicorn/modules/025-cjm-prototype.md +21 -1
  81. package/templates/.claude/skills/sparc-prd-mini/SKILL.md +173 -725
  82. package/tests/snapshot/baseline.json +60 -38
  83. package/tests/unit/capture-source-path.test.js +492 -0
  84. package/tests/unit/check-canon.test.js +403 -0
  85. package/tests/unit/check-embed-contract.test.js +422 -0
  86. package/tests/unit/check-external-deps.test.js +363 -0
  87. package/tests/unit/check-file-ownership.test.js +388 -0
  88. package/tests/unit/check-handoff-manifest.test.js +410 -0
  89. package/tests/unit/check-job-contract.test.js +514 -0
  90. package/tests/unit/check-look-origin.test.js +180 -0
  91. package/tests/unit/check-look-trace.test.js +420 -0
  92. package/tests/unit/check-metric-source.test.js +325 -0
  93. package/tests/unit/check-model-cost.test.js +425 -0
  94. package/tests/unit/check-ports.test.js +46 -2
  95. package/tests/unit/check-source-version.test.js +344 -0
  96. package/tests/unit/check-swarm-receipts.test.js +231 -0
  97. package/tests/unit/check-webhook-contract.test.js +536 -0
  98. package/tests/unit/db-port-rule.test.js +8 -2
  99. package/tests/unit/detection-ladder-registry.test.js +2 -2
  100. package/tests/unit/generator-swarm-contract.test.js +287 -0
  101. package/tests/unit/guard-honest-input-meta.test.js +64 -0
  102. package/tests/unit/honest-failure-rules.test.js +91 -9
  103. package/tests/unit/look-phase-contract.test.js +231 -0
  104. package/tests/unit/negative-conclusion-gate.test.js +300 -0
  105. package/tests/unit/quote-provenance.test.js +122 -0
  106. package/tests/unit/utils.test.js +40 -3
package/CHANGELOG.md CHANGED
@@ -7,7 +7,154 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- _Nothing yet._
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.
11
158
 
12
159
  ## [1.12.0] - 2026-08-31
13
160
 
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dzhechko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -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
- | 9 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) |
@@ -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 + 9 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/ # 9 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 + 9 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 ●9+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 + 9 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:**
@@ -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**, **9 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
@@ -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 + 9 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/ # 9 правил
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 + 9 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 ●9+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 + 9 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:**
@@ -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 агента**, **9 правил**, **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>9 правил</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>
@@ -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 + 9 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/ # 9 правил
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 + 9 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 ●9+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 + 9 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>