@dzhechkov/p-replicator 1.10.3 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.dz-manifest.json +119 -47
  2. package/CHANGELOG.md +85 -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/README.md +1 -1
  9. package/README/ru/01_quickstart.md +3 -3
  10. package/README/ru/02_user_guide.md +1 -1
  11. package/README/ru/03_admin_guide.md +2 -2
  12. package/README/ru/04_api_reference.md +11 -5
  13. package/README/ru/README.md +1 -1
  14. package/README/ru/html/index.html +7 -7
  15. package/README.md +154 -38
  16. package/bin/cli.js +0 -0
  17. package/package.json +15 -13
  18. package/sbom.json +226 -46
  19. package/scripts/check-pipeline-gaps.sh +413 -0
  20. package/src/commands/doctor.js +94 -4
  21. package/src/rule-components.json +11 -0
  22. package/src/utils.js +3 -8
  23. package/templates/.claude/agents/harvest-coordinator.md +10 -1
  24. package/templates/.claude/commands/feature.md +57 -9
  25. package/templates/.claude/commands/go.md +11 -0
  26. package/templates/.claude/commands/harvest.md +41 -3
  27. package/templates/.claude/commands/myinsights.md +21 -26
  28. package/templates/.claude/commands/replicate.md +10 -1
  29. package/templates/.claude/commands/start.md +8 -0
  30. package/templates/.claude/hooks/check-ports.cjs +409 -20
  31. package/templates/.claude/hooks/session-insights.cjs +158 -25
  32. package/templates/.claude/hooks/statusline.cjs +2 -2
  33. package/templates/.claude/hooks/write-insight.cjs +253 -0
  34. package/templates/.claude/rules/cost-of-detection-ladder.md +96 -0
  35. package/templates/.claude/rules/docker-ports.md +41 -19
  36. package/templates/.claude/rules/feature-lifecycle.md +14 -3
  37. package/templates/.claude/rules/honest-configuration.md +54 -0
  38. package/templates/.claude/rules/insights-capture.md +10 -5
  39. package/templates/.claude/rules/replicate-pipeline.md +4 -2
  40. package/templates/.claude/rules/skill-interface-protocol.md +1 -0
  41. package/templates/.claude/rules/swarm-file-evidence.md +46 -0
  42. package/templates/.claude/settings.json +13 -1
  43. package/templates/.claude/skills/knowledge-extractor/modules/01-agent-review.md +16 -5
  44. package/templates/.claude/skills/sparc-prd-mini/SKILL.md +86 -16
  45. package/tests/e2e/lifecycle.test.js +55 -9
  46. package/tests/e2e/packed-insights-writer.test.js +308 -0
  47. package/tests/fixtures/prep-traceability-fixture/docs/features/order-refund/01_specification.md +29 -0
  48. package/tests/fixtures/prep-traceability-fixture/docs/features/order-refund/02_pseudocode.md +57 -0
  49. package/tests/snapshot/baseline.json +24 -20
  50. package/tests/snapshot/templates.test.js +47 -0
  51. package/tests/unit/absence-is-not-emptiness.test.js +15 -1
  52. package/tests/unit/check-pipeline-gaps.test.js +94 -0
  53. package/tests/unit/check-ports.test.js +729 -2
  54. package/tests/unit/db-port-rule.test.js +36 -5
  55. package/tests/unit/detection-ladder-contract.test.js +302 -0
  56. package/tests/unit/detection-ladder-registry.test.js +52 -0
  57. package/tests/unit/doctor-insight-flow.test.js +315 -0
  58. package/tests/unit/external-dependency-check.test.js +19 -19
  59. package/tests/unit/honest-failure-rules.test.js +492 -0
  60. package/tests/unit/hooks-project-anchored.test.js +67 -3
  61. package/tests/unit/insights-docs-tell-the-truth.test.js +52 -31
  62. package/tests/unit/insights-dz-delegation.test.js +197 -0
  63. package/tests/unit/insights-writer.test.js +285 -0
  64. package/tests/unit/shipped-suite-context.test.js +3 -1
  65. package/tests/unit/traceability-machine-ids.test.js +413 -0
  66. package/tests/unit/traceability-negative-fixture.test.js +322 -0
  67. package/tests/unit/utils.test.js +3 -2
  68. package/LICENSE +0 -21
@@ -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 + 9 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 ●9+2 │ Hooks ●7/7
87
87
  💡 Insights ●12 (2026-05-06) │ Tests 85/85 ✓ │ MCP ●1/1 │ Settings ✓ │ 🧬 Keysarium ✓
88
88
  ```
89
89
 
@@ -248,7 +248,7 @@ echo ".claude/.last-test.json" >> .gitignore
248
248
 
249
249
  | Инструмент | Что проверяет | Когда |
250
250
  |---|---|---|
251
- | `npx @dzhechkov/p-replicator doctor` | Pre-shipped contract: 10 skills + 11 commands + 4 agents + 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 + 9 rules + settings.json + 7 hooks + git on PATH | После init / при подозрении что что-то сломалось |
252
252
  | `npx @dzhechkov/p-replicator verify` | Pre-shipped + post-/replicate hints (CLAUDE.md, planner.md, security.md, feature-roadmap.json, и т.д.) | После каждого `/replicate` для уверенности |
253
253
 
254
254
  **`doctor` exit codes:**
@@ -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
 
@@ -6,7 +6,7 @@ toolkit для AI-assisted разработки в Claude Code (Vibe Coding).
6
6
  ## Что это
7
7
 
8
8
  `p-replicator` устанавливает в проект готовый набор `.claude/`-инструментов:
9
- **11 slash-команд**, **10 skills**, **4 агента**, **6 правил**, **7 hook-скриптов**
9
+ **11 slash-команд**, **10 skills**, **4 агента**, **9 правил**, **7 hook-скриптов**
10
10
  и `settings.json` с pre-configured хуками. Главная команда `/replicate`
11
11
  проводит проект через 5-фазный pipeline (Discovery → Planning → Validation →
12
12
  Toolkit Generation → Finalize), генерирует SPARC-документацию и project-specific
@@ -112,7 +112,7 @@
112
112
  <h1 id="dokumentatsiya-dzhechkovp-replicator">Документация @dzhechkov/p-replicator</h1>
113
113
  <p>Полный комплект документации к npm-пакету <code>@dzhechkov/p-replicator</code> — toolkit для AI-assisted разработки в Claude Code (Vibe Coding).</p>
114
114
  <h2 id="index-chto-eto">Что это</h2>
115
- <p><code>p-replicator</code> устанавливает в проект готовый набор <code>.claude/</code>-инструментов: <strong>11 slash-команд</strong>, <strong>10 skills</strong>, <strong>4 агента</strong>, <strong>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>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>
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 + 9 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/ # 9 правил
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 + 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>
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 ●9+2 │ Hooks ●7/7
555
555
  💡 Insights ●12 (2026-05-06) │ Tests 85/85 ✓ │ MCP ●1/1 │ Settings ✓ │ 🧬 Keysarium ✓</code></pre>
556
556
  <p><strong>Источники (heuristic + state-file):</strong></p>
557
557
  <div class="table-wrap"><table><thead><tr><th>Метрика</th><th>Откуда</th></tr></thead><tbody><tr><td>Pipeline command + phase + progress</td><td><code>.claude/.p-replicator-state.json</code> (state-file)</td></tr><tr><td>Roadmap progress</td><td><code>.claude/feature-roadmap.json</code></td></tr><tr><td>SPARC count</td><td><code>docs/{PRD,Architecture,...}.md</code> files</td></tr><tr><td>Validation score</td><td>regex extract from <code>docs/validation-report.md</code></td></tr><tr><td>Plans count</td><td><code>docs/plans/*.md</code></td></tr><tr><td>ADRs count</td><td><code>docs/ADR.md</code> <code>## ADR-...</code> headings, или <code>docs/adr/*.md</code>, или <code>docs/ddd/adr/*.md</code></td></tr><tr><td>Insights count + last date</td><td><code>## YYYY-MM-DD</code> headings в <code>.claude/insights/index.md</code></td></tr><tr><td>Toolkit counts</td><td>filesystem walk <code>.claude/{skills,commands,agents,rules,hooks}/</code></td></tr><tr><td>Settings status</td><td>deep-equals current vs <code>manifest.shippedDefaults</code> → <code>defaults</code>/<code>merged</code></td></tr><tr><td>MCP servers</td><td><code>.mcp.json</code></td></tr><tr><td>Domain</td><td>keyword grep <code>CLAUDE.md</code> (banking/retail/enterprise/healthcare)</td></tr><tr><td>Last harvest</td><td><code>TOOLKIT_HARVEST.md</code> mtime</td></tr><tr><td>Last test</td><td>optional <code>.claude/.last-test.json</code> cache</td></tr></tbody></table></div>
@@ -638,7 +638,7 @@ echo ".claude/.last-test.json" &gt;&gt; .gitignore</code></pre>
638
638
  <p><strong>Auto-commit</strong> через <code>autocommit-roadmap.cjs</code> (Stop hook) при изменениях.</p>
639
639
  <hr>
640
640
  <h2 id="admin-guide-doctor-verify-dva-raznyh-instrumenta">Doctor + Verify — два разных инструмента</h2>
641
- <div class="table-wrap"><table><thead><tr><th>Инструмент</th><th>Что проверяет</th><th>Когда</th></tr></thead><tbody><tr><td><code>npx @dzhechkov/p-replicator doctor</code></td><td>Pre-shipped contract: 10 skills + 11 commands + 4 agents + 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 + 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>
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>
package/README.md CHANGED
@@ -11,10 +11,10 @@
11
11
  [![License](https://img.shields.io/badge/License-MIT-22c55e.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
12
12
  [![Node](https://img.shields.io/badge/node-%E2%89%A516-339933?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org)
13
13
 
14
- [![Tests](https://img.shields.io/badge/tests-105%2F105-22c55e?style=flat-square)](#test-infrastructure)
14
+ [![Tests](https://img.shields.io/badge/tests-440%20pass%20%7C%203%20skip-22c55e?style=flat-square)](#test-infrastructure)
15
15
  [![Skills](https://img.shields.io/badge/skills-10-8b5cf6?style=flat-square)](#skills-reference)
16
16
  [![Commands](https://img.shields.io/badge/slash%20commands-11-f59e0b?style=flat-square)](#commands-reference)
17
- [![Hooks](https://img.shields.io/badge/hooks-6-3b82f6?style=flat-square)](#hooks-system)
17
+ [![Hooks](https://img.shields.io/badge/hooks-10-3b82f6?style=flat-square)](#hooks-system)
18
18
  [![SPARC Pipeline](https://img.shields.io/badge/SPARC-5%20phases-ec4899?style=flat-square)](#pipeline-overview--replicate-phases)
19
19
 
20
20
  <br>
@@ -101,7 +101,7 @@
101
101
 
102
102
  ## 📖 What is p-replicator?
103
103
 
104
- `@dzhechkov/p-replicator` installs a ready-made `.claude/` toolkit into any project: **11 slash commands**, **10 skills**, **4 agents**, **6 rules**, **9 hook scripts**, and a `settings.json` with pre-configured hooks and a multi-line statusline dashboard.
104
+ `@dzhechkov/p-replicator` installs a ready-made `.claude/` toolkit into any project: **11 slash commands**, **10 skills**, **4 agents**, **9 rules**, **10 hook utilities**, and a `settings.json` with pre-configured hooks and a multi-line statusline dashboard.
105
105
 
106
106
  The flagship `/replicate` command takes a project through a **5-phase pipeline**:
107
107
 
@@ -262,8 +262,8 @@ This creates:
262
262
  - `.claude/skills/` — 10 pre-shipped skills
263
263
  - `.claude/commands/` — 11 slash commands (`/replicate`, `/run`, `/feature`, ...)
264
264
  - `.claude/agents/` — 4 pipeline agents
265
- - `.claude/rules/` — 5 governance rules
266
- - `.claude/hooks/` — 6 cross-platform Node scripts
265
+ - `.claude/rules/` — 9 governance rules
266
+ - `.claude/hooks/` — 10 cross-platform Node scripts
267
267
  - `.claude/settings.json` — hooks + statusline configuration
268
268
  - `.p-replicator.json` — install manifest
269
269
 
@@ -289,9 +289,9 @@ This creates:
289
289
  | **Skills** | 10 | 92 files (880K+ chars — MEASURED via `wc -c` over `templates/.claude/skills`: 880,679). Modular architecture: foundation → composite → master orchestrator |
290
290
  | **Commands** | 11 | `/replicate`, `/harvest`, `/start`, `/plan`, `/feature`, `/go`, `/run`, `/next`, `/myinsights`, `/docs`, `/deploy` |
291
291
  | **Agents** | 4 | `replicate-coordinator`, `product-discoverer`, `doc-validator`, `harvest-coordinator` |
292
- | **Rules** | 6 | `replicate-pipeline`, `skill-interface-protocol`, `git-workflow`, `insights-capture`, `feature-lifecycle`, `docker-ports` |
293
- | **Hooks** | 9 | `session-insights`, `autocommit-{roadmap,insights,plans}`, `statusline`, `state-update`, `check-ports`, `check-growth-trace`, `check-docs-complete` (cross-platform Node) |
294
- | **Settings** | 1 | `settings.json` with statusLine + SessionStart + Stop hooks pre-configured |
292
+ | **Rules** | 9 | `cost-of-detection-ladder`, `replicate-pipeline`, `skill-interface-protocol`, `git-workflow`, `insights-capture`, `feature-lifecycle`, `docker-ports`, `swarm-file-evidence`, `honest-configuration` |
293
+ | **Hooks** | 10 | Ten cross-platform Node utilities, including the harvest insight writer |
294
+ | **Settings** | 1 | `settings.json` with statusLine + SessionStart + UserPromptSubmit + Stop hooks pre-configured |
295
295
 
296
296
  After running `/replicate`, the toolkit also generates **project-specific** artifacts:
297
297
 
@@ -326,13 +326,15 @@ Discovery Brief was never written to disk at all. Since 1.7.0:
326
326
 
327
327
  What none of this proves: that anything was built, or that copying a competitor's move is lawful.
328
328
 
329
- ## 🔎 The three deliberate checks
329
+ ## 🔎 Deliberate checks
330
330
 
331
- Six of the nine hook scripts run themselves. Three do not: they are utilities you invoke when you want
331
+ Six of the nine hook utilities run themselves. Three do not: they are utilities you invoke when you want
332
332
  an answer, and they are wired to no event on purpose. A hook of this package is **non-blocking by
333
333
  contract** — it can print, never refuse — so a check that must be able to say "no" cannot be one.
334
+ The package also ships the non-hook Bash traceability checker described after those three utilities;
335
+ `/feature` invokes it as a blocking pipeline gate.
334
336
 
335
- Both answer with **three** exit codes, and the third is the one that matters:
337
+ Each answers with **three** exit codes, and the third is the one that matters:
336
338
 
337
339
  | Code | Meaning |
338
340
  |:---:|---|
@@ -346,7 +348,8 @@ why a missing config, a missing docker, or a missing brief is `2` and never `0`.
346
348
  ### `check-ports.cjs` — no database faces the internet
347
349
 
348
350
  ```bash
349
- node .claude/hooks/check-ports.cjs .
351
+ node .claude/hooks/check-ports.cjs . # catalog: one Compose project
352
+ node .claude/hooks/check-ports.cjs --machine # point-in-time snapshot of the current Docker context
350
353
  ```
351
354
 
352
355
  ```
@@ -355,9 +358,25 @@ node .claude/hooks/check-ports.cjs .
355
358
  Убрать ports: целиком, либо привязать к 127.0.0.1
356
359
  ```
357
360
 
358
- Reads the normalised config (`docker compose config`), so the short port form and `extends` are
359
- already resolved. Catches `network_mode: host` and services published beside a reverse-proxy too.
360
- A loopback bind (`127.0.0.1:` or `[::1]:`) is legal and passes — that exception is part of the rule.
361
+ Catalog mode reads one normalised config (`docker compose config`), so the short port form and
362
+ `extends` are already resolved. It catches `network_mode: host` and services published beside a
363
+ reverse-proxy, but it never queries running containers. Its clean receipt is limited to that selected
364
+ catalog. A loopback bind (`127.0.0.1:` or `[::1]:`) is legal in catalog mode — that exception remains
365
+ part of the rule.
366
+
367
+ For Redis/Memcached, catalog mode also classifies visible authentication configuration: established
368
+ absence of a password is `1`, while a config-bearing volume/custom image that can hide the answer is
369
+ `2`, never a guessed clean result. The catalog loopback exception is applied first and remains legal.
370
+
371
+ Machine mode enumerates recognised running storage containers in the current Docker context, inspects
372
+ their live bind addresses and Compose ownership labels, and probes live Redis authentication there
373
+ only. Its clean receipt is a point-in-time snapshot, not continuous monitoring and not a claim about
374
+ stopped containers or another Docker context. A live loopback Redis without a password is reported as
375
+ a separate violation even though the catalog loopback exception remains legal.
376
+
377
+ Both scopes preserve the same contract: `0` means the selected scope was checked clean, `1` means a
378
+ violation was established, and `2` means **the check did not run to completion** (`проверка НЕ
379
+ ВЫПОЛНЕНА`) because Docker/config/permissions or a required runtime observation was unavailable.
361
380
 
362
381
  **When to run it:** after writing or editing `docker-compose.yml`, and before any deploy.
363
382
 
@@ -408,6 +427,48 @@ A conscious rejection **with a reason written down** passes; a silent drop does
408
427
  **What it does NOT prove:** that anything was built, or that copying a competitor's growth move is
409
428
  lawful. It proves an obligation was carried forward, nothing more.
410
429
 
430
+ ### `check-pipeline-gaps.sh` — FR/NFR/AC keys are joins, not decoration
431
+
432
+ The package owns the checker at `scripts/check-pipeline-gaps.sh`. `/feature` resolves that packaged
433
+ file directly, so an installed consumer runs the same executable without copying it onto the hooks
434
+ surface:
435
+
436
+ ```bash
437
+ CHECK_PIPELINE_GAPS="$(node -p "require.resolve('@dzhechkov/p-replicator/scripts/check-pipeline-gaps.sh')")" || {
438
+ printf 'NOT-ESTABLISHED packaged checker could not be resolved\n' >&2
439
+ exit 2
440
+ }
441
+ bash "$CHECK_PIPELINE_GAPS" "${CLAUDE_PROJECT_DIR:-.}" --traceability
442
+ ```
443
+
444
+ The checker reads complete `DOCUMENT_ROLE_MAP` blocks from the installed `/feature` command and
445
+ `sparc-prd-mini` skill. It checks the applicable project-level pair and every immediate
446
+ `docs/features/*/` contour independently. It never rediscovers `01_specification.md` or
447
+ `02_pseudocode.md` by basename.
448
+
449
+ Accepted specification declarations are level-three headings such as
450
+ `### FR-order-refund-1`, `### NFR-order-refund-2 — latency`, and
451
+ `### AC-order-refund-3 - accepted`. Pseudocode evidence is a standalone
452
+ ``REQUIREMENT: `FR-order-refund-1` `` line inside an `### Algorithm:` block. Prose, comments,
453
+ tables, and nested `SC-FR-*` identifiers are ignored. Duplicate or malformed declarations block.
454
+
455
+ For each contour it runs both sorted differences: specification→pseudocode names requirements with
456
+ no algorithm claim; pseudocode→specification names dangling claims. Every gap is printed with its
457
+ contour, direction, and exact key. Exit `0` means every readable contour was checked and both sets
458
+ match; exit `1` means a named content/traceability gap; exit `2` means the map or filesystem evidence
459
+ was not trustworthy enough to compare. `/feature` preserves both non-zero states before Phase 2.
460
+
461
+ Symlinked contours or role files are refused rather than followed outside the declared root. Matching
462
+ keys prove cross-document linkage only; they do not prove that an algorithm semantically implements
463
+ the requirement.
464
+
465
+ **Scope and provenance.** This package executable implements the ADR-owned traceability decision
466
+ only: role-map resolution, project plus immediate-feature traversal, structural FR/NFR/AC
467
+ declarations, both `comm -23` directions, duplicate/malformed/symlink refusal, exact diagnostics,
468
+ and blocking `0/1/2` exits. It deliberately does not carry the old workspace-only PR-001/PR-002/
469
+ PR-004/PR-007, weekly-metric, port, or `[GAP]` umbrella checks. The workspace source is not needed
470
+ by an installed consumer.
471
+
411
472
  ## ✅ Verify the install
412
473
 
413
474
  After `/replicate`, run:
@@ -418,7 +479,7 @@ npx @dzhechkov/p-replicator verify
418
479
 
419
480
  The command checks:
420
481
 
421
- - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 6 rules + settings.json + 9 hooks
482
+ - **Pre-shipped contract** (must-have): 10 skills + 11 commands + 4 agents + 9 rules + settings.json + 10 hooks
422
483
  - **Post-/replicate hints** (advisory): CLAUDE.md, project-specific agents, feature-roadmap.json, security rules, etc.
423
484
 
424
485
  **Exit codes:**
@@ -431,7 +492,9 @@ The command checks:
431
492
  npx @dzhechkov/p-replicator doctor
432
493
  ```
433
494
 
434
- `doctor` verifies pre-shipped contract + Prerequisites (`git on PATH`). Stricter than `verify` for must-have components.
495
+ `doctor` verifies pre-shipped contract + Prerequisites (`git on PATH`). It also prints the
496
+ informational, non-gating insight-flow observation described below. It remains stricter than
497
+ `verify` for must-have components.
435
498
 
436
499
  ---
437
500
 
@@ -615,7 +678,8 @@ while features in scope:
615
678
 
616
679
  ### `/myinsights` — knowledge capture
617
680
 
618
- Build a project-local knowledge base of "rakes" (development insights) that auto-inject into every session via the SessionStart hook.
681
+ Build a project-local knowledge base of "rakes" (development insights). Markdown remains the source
682
+ of truth; `UserPromptSubmit` uses optional dz recall with a local fallback.
619
683
 
620
684
  ```bash
621
685
  /myinsights # interactive prompt
@@ -623,12 +687,23 @@ Build a project-local knowledge base of "rakes" (development insights) that auto
623
687
  /myinsights recall prisma # search by keyword
624
688
  ```
625
689
 
626
- Storage: `.claude/insights/index.md` — markdown log auto-committed by Stop hook.
690
+ Storage: `.claude/insights/index.md` — Markdown log auto-committed by Stop hook. A successful,
691
+ non-empty dz recall result may own prompt-time delivery; absent, failing, or empty recall uses the
692
+ local last-three fallback.
627
693
 
628
694
  ### `/harvest` — knowledge extraction
629
695
 
630
696
  Extract reusable patterns from a completed project into a knowledge base. Skill: `knowledge-extractor` (4 modules: agent review → classify → decontextualize → integrate).
631
697
 
698
+ Quick and full runs with a reusable finding have a required final persistence gate. The command
699
+ passes one structured record to `.claude/hooks/write-insight.cjs`; normal completion requires a
700
+ `created`, `appended`, or `duplicate` receipt. The writer creates `.claude/insights/index.md` only
701
+ on the first valid write, preserves prior bytes on append, and suppresses an exact normalized replay
702
+ even when its render date changes. It then attempts an idempotent, best-effort `dz teach` projection;
703
+ absence or failure never changes the Markdown receipt. `marker` and findings-free runs do not
704
+ manufacture entries. The deterministic tests cover creation, append preservation, exact-repeat
705
+ idempotence, and optional projection; they do not claim the text is meaningful.
706
+
632
707
  ---
633
708
 
634
709
  ## 💻 CLI Commands
@@ -641,7 +716,7 @@ Extract reusable patterns from a completed project into a knowledge base. Skill:
641
716
  | `update` | Upgrade files to new version (preserves customizations) | `0` ok, `1` if not installed |
642
717
  | `remove` | Delete package-tracked files | `0` ok, `1` if not installed |
643
718
  | `list` | List installed components with metadata | `0` |
644
- | `doctor` | Health check of pre-shipped contract + git PATH | `0` ok, `1` if anything broken |
719
+ | `doctor` | Health check + informational recent fix/insight counts | `0` ok, `1` only if existing health checks find breakage |
645
720
  | `verify` | Pre-shipped + post-/replicate verification | `0` ok, `1` if pre-shipped contract violated |
646
721
 
647
722
  ### Global flags
@@ -732,6 +807,9 @@ Generates 5 SPARC docs in `docs/features/<feature>/`:
732
807
  - `04_refinement.md` — edge cases + error paths
733
808
  - `05_completion.md` — testing + deployment notes
734
809
 
810
+ Before Phase 2, `/feature` runs the installed machine-key checker. Only exit `0` advances; exit `1`
811
+ returns to PLAN with exact FR/NFR/AC gaps, while exit `2` stops on an unresolved role map or document.
812
+
735
813
  ### Phase 2 — VALIDATE (requirements-validator)
736
814
 
737
815
  Same swarm-of-5 as `/replicate` Phase 2. Verdict 🟢/🟡/🔴 with same retry logic.
@@ -752,7 +830,7 @@ Severity-classified findings. Critical (`blocker` | `high`) MUST be fixed.
752
830
 
753
831
  ### AUTO mode (called from /go or /run)
754
832
 
755
- - Phase 1: proceed if all docs exist
833
+ - Phase 1: proceed only if all docs exist and the traceability checker exits `0`
756
834
  - Phase 2: proceed if 🟢 or 🟡; auto-retry once on 🔴
757
835
  - Phase 3: proceed if tests + lint + build green
758
836
  - Phase 4: auto-fix `high` if straightforward; halt on `blocker`
@@ -774,7 +852,7 @@ P-Replicator V1.5.x ● user │ Sonnet 4.7
774
852
  🚀 Pipeline /<cmd> ▓▓▓░░░░ 50% │ Phase: VALIDATE (2/4) │ Last: /replicate
775
853
  🎯 Roadmap [●●●○○○○○] mvp 3/8 │ Done 5/12 │ ▶ auth-jwt │ Domain: banking
776
854
  📊 SPARC ●11/11 │ 🟢 78/100 │ Plans ●3 │ ADRs ●2 │ Harvest 2026-05-05
777
- 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●6+2 │ Hooks ●7/7
855
+ 🛠️ Toolkit Skills ●10/10 │ Cmds ●11/11 │ Agents ●4+3 │ Rules ●9+2 │ Hooks ●9/9
778
856
  💡 Insights ●12 (2026-05-06) │ Tests 85/85 ✓ │ MCP ●1/1 │ Settings ✓ │ 🧬 Keysarium ✓
779
857
  ```
780
858
 
@@ -810,16 +888,19 @@ For internals, see [admin guide](./README/eng/03_admin_guide.md#statusline--dash
810
888
 
811
889
  ## 🪝 Hooks System
812
890
 
813
- `p-replicator` ships **6 cross-platform Node scripts** in `.claude/hooks/`:
891
+ `p-replicator` ships **10 cross-platform Node utilities** in `.claude/hooks/`. The Bash traceability
892
+ gate described above remains a package script and is resolved directly by `/feature`; it is not a
893
+ Claude Code hook.
814
894
 
815
895
  | Hook | Event | Purpose |
816
896
  |---|---|---|
817
- | `session-insights.cjs` | SessionStart | Inject 3 recent insights from `.claude/insights/index.md` to stdout (Claude Code captures into context) |
897
+ | `session-insights.cjs` | SessionStart + UserPromptSubmit | Show the missing-carrier hint at start; at prompt time select armed dz recall or the local last-three fallback |
818
898
  | `autocommit-roadmap.cjs` | Stop | Auto-commit `.claude/feature-roadmap.json` if changed |
819
899
  | `autocommit-insights.cjs` | Stop | Auto-commit `.claude/insights/` if changed |
820
900
  | `autocommit-plans.cjs` | Stop | Auto-commit `docs/plans/` if changed |
821
901
  | `statusline.cjs` | (statusLine config) | Multi-line dashboard above the prompt |
822
902
  | `state-update.cjs` | (utility) | Argv-driven helper for writing `.claude/.p-replicator-state.json` |
903
+ | `write-insight.cjs` | (utility, invoked by `/harvest`) | Establish Markdown, return `created`/`appended`/`duplicate`, then best-effort project the same record through dz |
823
904
 
824
905
  ### Cross-platform discipline
825
906
 
@@ -898,7 +979,14 @@ Pipeline commands optionally call this script (via Bash tool) so statusline show
898
979
 
899
980
  ### Insights system
900
981
 
901
- **Storage:** `.claude/insights/index.md` (markdown log).
982
+ **Storage:** `.claude/insights/index.md` (Markdown source of truth). The writer persists it before
983
+ an idempotent best-effort `dz teach` duplicate, so removing or breaking `.dz` cannot remove a record.
984
+
985
+ `/myinsights` captures a record manually; quick/full `/harvest` uses the same carrier through the
986
+ packaged writer. A fresh install intentionally has no `.claude/insights/` directory. The first valid
987
+ write creates it; `init` does not pre-create an empty carrier, so doctor can keep distinguishing
988
+ missing, existing-empty, and populated states. Until that first write, SessionStart prints one line:
989
+ `инсайтов пока нет; /myinsights создаст первую запись`.
902
990
 
903
991
  **Entry format:**
904
992
 
@@ -927,7 +1015,28 @@ What fixed it (1-5 sentences with code if relevant).
927
1015
  - ✅ `prisma-migration`, `postgres-timezone`, `docker-compose-network`
928
1016
  - ❌ `bug`, `fix`, `important` (too generic — recall fails)
929
1017
 
930
- **Auto-injection:** `SessionStart` hook (`session-insights.cjs`) reads top 3 recent entries to stdout, Claude Code injects into initial session context.
1018
+ **Prompt-time injection:** `UserPromptSubmit` passes the real prompt to `session-insights.cjs`. Only a
1019
+ successful, non-empty dz recall result from the insight domain suppresses local output. Absent,
1020
+ failing, or empty recall uses the local fallback (the last 3 Markdown entries); failure is named,
1021
+ absence and empty output are quiet, and one invocation never emits both sources. `SessionStart`
1022
+ retains only the missing-carrier hint above.
1023
+
1024
+ ### Doctor insight-flow observation
1025
+
1026
+ Every `doctor` invocation measures one shared period covering the current date and the preceding two
1027
+ dates—three calendar days in the process's local timezone—and prints the period with both raw counts:
1028
+ `N fix commits and M insight records`.
1029
+
1030
+ - Fix commits come from a fresh, bounded read of project git history and count only Conventional
1031
+ Commit subjects beginning with `fix:` or `fix(scope):`.
1032
+ - Insight records come from fresh dated `## YYYY-MM-DD — ...` headings in
1033
+ `.claude/insights/index.md`. A missing carrier is a measured count of zero.
1034
+ - If the project is not a git repository, has no readable history, or a required source is unreadable,
1035
+ the line says `check NOT performed` and names the source instead of inventing a count.
1036
+
1037
+ The observation is informational: it has no threshold, does not interpret the relationship between
1038
+ the counts, and does not change `doctor` exit status. Existing installation-health checks remain the
1039
+ only owners of exit `0` or `1`.
931
1040
 
932
1041
  ---
933
1042
 
@@ -1001,6 +1110,14 @@ Default structure after `init`:
1001
1110
  ]
1002
1111
  }
1003
1112
  ],
1113
+ "UserPromptSubmit": [
1114
+ {
1115
+ "matcher": "*",
1116
+ "hooks": [
1117
+ { "type": "command", "command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/session-insights.cjs\"", "timeout": 5 }
1118
+ ]
1119
+ }
1120
+ ],
1004
1121
  "Stop": [
1005
1122
  {
1006
1123
  "matcher": "*",
@@ -1220,17 +1337,15 @@ npx @dzhechkov/p-replicator@latest init --force
1220
1337
  npx @dzhechkov/p-replicator verify
1221
1338
  ```
1222
1339
 
1223
- ### Insights aren't auto-injected into new sessions
1340
+ ### Insights aren't injected after a prompt
1224
1341
 
1225
1342
  Checks:
1226
1343
  1. `.claude/insights/index.md` exists with entries?
1227
- 2. Hook works:
1228
- ```bash
1229
- node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/session-insights.cjs" # should print recent insights
1230
- ```
1231
- 3. SessionStart hook configured in `settings.json`?
1344
+ 2. `UserPromptSubmit` is configured in `.claude/settings.json`?
1345
+ 3. If dz recall fails, does the hook name degradation and show the local fallback?
1346
+ 4. If dz is absent or returns empty, does the local fallback appear without a dz error?
1232
1347
 
1233
- If all 3 OK but still nothing — Claude Code may cache. Restart `claude`.
1348
+ If all checks are OK but still nothing — Claude Code may cache settings. Restart `claude`.
1234
1349
 
1235
1350
  ### Statusline lags on every command
1236
1351
 
@@ -1296,17 +1411,18 @@ npx @dzhechkov/p-replicator verify
1296
1411
 
1297
1412
  <br>
1298
1413
 
1299
- **Suite:** 105 tests, 36 suites, ~25 sec runtime.
1414
+ **Suite command:** `npm test` (plain Node test runner; never watch mode).
1300
1415
 
1301
1416
  | Layer | File | Coverage |
1302
1417
  |---|---|---|
1303
- | **Unit** | `tests/unit/utils.test.js` (54 tests) | Pure functions: createManifest, mergeSettingsJson, removeOrphanHooks, getItemRelativePath, parseToolkit logic |
1304
- | **E2E** | `tests/e2e/lifecycle.test.js` (48 tests) | Full CLI lifecycle, hooks installation, settings merge edge cases, statusline output, --feature-branches docs |
1305
- | **Snapshot** | `tests/snapshot/templates.test.js` (3 tests) | SHA-256 baseline of all 115 files in `templates/` |
1418
+ | **Unit** | `tests/unit/*.test.js` | Pure utilities, role-map and traceability contracts, hook behavior, and document consistency |
1419
+ | **E2E** | `tests/e2e/*.test.js` | Full CLI lifecycle plus fresh-install execution of the exact `npm pack` insight writer artifact |
1420
+ | **Snapshot** | `tests/snapshot/templates.test.js` | SHA-256 baseline of package templates (140 file hashes, MEASURED — `npm run snapshot:baseline`) |
1306
1421
 
1307
1422
  **Meta-tests** verify consistency between documents:
1308
1423
  - `replicate-pipeline.md` mentions every pre-shipped command (no orphan in rule)
1309
1424
  - `replicate.md` Phase 3 doesn't claim "Generate `<pre-shipped>.md`" (no spec drift)
1425
+ - Negative/E2E fixtures live under `tests/fixtures/`; `files[]` ships `tests/`, so they are included in the npm package.
1310
1426
 
1311
1427
  **Snapshot baseline** regenerated via `npm run snapshot:baseline` after intentional template changes.
1312
1428
 
@@ -1466,7 +1582,7 @@ npm test
1466
1582
 
1467
1583
  ```bash
1468
1584
  npm run snapshot:baseline # regenerate baseline if templates/ changed
1469
- npm test # all 105 tests must pass
1585
+ npm test # settled suite: 396 pass + 3 intentional skips
1470
1586
  npm pack --dry-run # verify tarball contents
1471
1587
  npm publish
1472
1588
  ```
package/bin/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/p-replicator",
3
- "version": "1.10.3",
3
+ "version": "1.12.0",
4
4
  "description": "P-Replicator — Claude Code toolkit for AI-assisted product development (Vibe Coding). Full /replicate pipeline, 10 modular skills (880K+ chars), /harvest knowledge extraction, swarm agents, quality gates, security patterns, cross-project learning.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -9,6 +9,7 @@
9
9
  "files": [
10
10
  "bin/",
11
11
  "src/",
12
+ "scripts/check-pipeline-gaps.sh",
12
13
  "templates/",
13
14
  "tests/",
14
15
  "README/",
@@ -18,6 +19,15 @@
18
19
  ".dz-manifest.json",
19
20
  "sbom.json"
20
21
  ],
22
+ "scripts": {
23
+ "prepublishOnly": "node --test tests/snapshot/templates.test.js && node ../../../scripts/prepublish-gate.mjs",
24
+ "test": "node --test tests/unit/honest-failure-rules.test.js tests/unit/detection-ladder-contract.test.js tests/unit/detection-ladder-registry.test.js tests/unit/utils.test.js tests/unit/adr-scanner-contract.test.js tests/unit/sparc-reconciliation.test.js tests/unit/pipeline-file-ownership.test.js tests/unit/validation-gate-teeth.test.js tests/unit/hooks-project-anchored.test.js tests/unit/insights-dz-delegation.test.js tests/unit/statusline-two-roots.test.js tests/unit/external-dependency-check.test.js tests/unit/spec-pseudocode-traceability.test.js tests/unit/sync-templates-guard.test.js tests/unit/db-port-rule.test.js tests/unit/roadmap-one-schema.test.js tests/unit/hooks-report-failures.test.js tests/unit/growth-module-b2b-gate.test.js tests/unit/detect-parse-anchor.test.js tests/unit/statusline-honest-labels.test.js tests/unit/autocommit-deletion.test.js tests/unit/check-ports.test.js tests/unit/doctor-insight-flow.test.js tests/unit/adr-decision-coverage.test.js tests/unit/growth-requirements-bridge.test.js tests/unit/check-growth-trace.test.js tests/unit/growth-gate-conditional.test.js tests/unit/module-copy-identity.test.js tests/unit/growth-axes-and-compliance.test.js tests/unit/skill-paths-prebaked.test.js tests/unit/check-docs-complete.test.js tests/unit/absence-is-not-emptiness.test.js tests/unit/guard-forms.test.js tests/unit/generated-guard-templates.test.js tests/unit/shipped-suite-context.test.js tests/unit/assess-scripts.test.js tests/unit/insights-docs-tell-the-truth.test.js tests/unit/insights-writer.test.js tests/unit/check-pipeline-gaps.test.js tests/unit/traceability-machine-ids.test.js tests/unit/traceability-negative-fixture.test.js tests/e2e/lifecycle.test.js tests/e2e/packed-insights-writer.test.js tests/snapshot/templates.test.js",
25
+ "test:unit": "node --test tests/unit/honest-failure-rules.test.js tests/unit/detection-ladder-contract.test.js tests/unit/detection-ladder-registry.test.js tests/unit/utils.test.js tests/unit/adr-scanner-contract.test.js tests/unit/sparc-reconciliation.test.js tests/unit/pipeline-file-ownership.test.js tests/unit/validation-gate-teeth.test.js tests/unit/hooks-project-anchored.test.js tests/unit/insights-dz-delegation.test.js tests/unit/statusline-two-roots.test.js tests/unit/external-dependency-check.test.js tests/unit/spec-pseudocode-traceability.test.js tests/unit/sync-templates-guard.test.js tests/unit/db-port-rule.test.js tests/unit/roadmap-one-schema.test.js tests/unit/hooks-report-failures.test.js tests/unit/growth-module-b2b-gate.test.js tests/unit/detect-parse-anchor.test.js tests/unit/statusline-honest-labels.test.js tests/unit/autocommit-deletion.test.js tests/unit/check-ports.test.js tests/unit/doctor-insight-flow.test.js tests/unit/adr-decision-coverage.test.js tests/unit/growth-requirements-bridge.test.js tests/unit/check-growth-trace.test.js tests/unit/growth-gate-conditional.test.js tests/unit/module-copy-identity.test.js tests/unit/growth-axes-and-compliance.test.js tests/unit/skill-paths-prebaked.test.js tests/unit/check-docs-complete.test.js tests/unit/absence-is-not-emptiness.test.js tests/unit/guard-forms.test.js tests/unit/generated-guard-templates.test.js tests/unit/shipped-suite-context.test.js tests/unit/assess-scripts.test.js tests/unit/insights-docs-tell-the-truth.test.js tests/unit/insights-writer.test.js tests/unit/check-pipeline-gaps.test.js tests/unit/traceability-machine-ids.test.js tests/unit/traceability-negative-fixture.test.js",
26
+ "test:e2e": "node --test tests/e2e/lifecycle.test.js tests/e2e/packed-insights-writer.test.js",
27
+ "test:snapshot": "node --test tests/snapshot/templates.test.js",
28
+ "test:doctor": "node bin/cli.js doctor",
29
+ "snapshot:baseline": "node tests/snapshot/update-baseline.js"
30
+ },
21
31
  "keywords": [
22
32
  "claude",
23
33
  "claude-code",
@@ -53,12 +63,12 @@
53
63
  },
54
64
  "repository": {
55
65
  "type": "git",
56
- "url": "https://github.com/djd1m/dz-harness-hub.git",
66
+ "url": "git+https://github.com/djd1m/dz-harness.git",
57
67
  "directory": "packages/@dzhechkov/p-replicator"
58
68
  },
59
- "homepage": "https://github.com/djd1m/dz-harness-hub/tree/main/packages/@dzhechkov/p-replicator#readme",
69
+ "homepage": "https://github.com/djd1m/dz-harness/tree/main/packages/@dzhechkov/p-replicator#readme",
60
70
  "bugs": {
61
- "url": "https://github.com/djd1m/dz-harness-hub/issues"
71
+ "url": "https://github.com/djd1m/dz-harness/issues"
62
72
  },
63
73
  "peerDependencies": {
64
74
  "@dzhechkov/keysarium-core": "^1.1.0"
@@ -70,13 +80,5 @@
70
80
  },
71
81
  "publishConfig": {
72
82
  "access": "public"
73
- },
74
- "scripts": {
75
- "test": "node --test tests/unit/utils.test.js tests/unit/adr-scanner-contract.test.js tests/unit/sparc-reconciliation.test.js tests/unit/pipeline-file-ownership.test.js tests/unit/validation-gate-teeth.test.js tests/unit/hooks-project-anchored.test.js tests/unit/statusline-two-roots.test.js tests/unit/external-dependency-check.test.js tests/unit/spec-pseudocode-traceability.test.js tests/unit/sync-templates-guard.test.js tests/unit/db-port-rule.test.js tests/unit/roadmap-one-schema.test.js tests/unit/hooks-report-failures.test.js tests/unit/growth-module-b2b-gate.test.js tests/unit/detect-parse-anchor.test.js tests/unit/statusline-honest-labels.test.js tests/unit/autocommit-deletion.test.js tests/unit/check-ports.test.js tests/unit/adr-decision-coverage.test.js tests/unit/growth-requirements-bridge.test.js tests/unit/check-growth-trace.test.js tests/unit/growth-gate-conditional.test.js tests/unit/module-copy-identity.test.js tests/unit/growth-axes-and-compliance.test.js tests/unit/skill-paths-prebaked.test.js tests/unit/check-docs-complete.test.js tests/unit/absence-is-not-emptiness.test.js tests/unit/guard-forms.test.js tests/unit/generated-guard-templates.test.js tests/unit/shipped-suite-context.test.js tests/unit/assess-scripts.test.js tests/unit/insights-docs-tell-the-truth.test.js tests/e2e/lifecycle.test.js tests/snapshot/templates.test.js",
76
- "test:unit": "node --test tests/unit/utils.test.js tests/unit/adr-scanner-contract.test.js tests/unit/sparc-reconciliation.test.js tests/unit/pipeline-file-ownership.test.js tests/unit/validation-gate-teeth.test.js tests/unit/hooks-project-anchored.test.js tests/unit/statusline-two-roots.test.js tests/unit/external-dependency-check.test.js tests/unit/spec-pseudocode-traceability.test.js tests/unit/sync-templates-guard.test.js tests/unit/db-port-rule.test.js tests/unit/roadmap-one-schema.test.js tests/unit/hooks-report-failures.test.js tests/unit/growth-module-b2b-gate.test.js tests/unit/detect-parse-anchor.test.js tests/unit/statusline-honest-labels.test.js tests/unit/autocommit-deletion.test.js tests/unit/check-ports.test.js tests/unit/adr-decision-coverage.test.js tests/unit/growth-requirements-bridge.test.js tests/unit/check-growth-trace.test.js tests/unit/growth-gate-conditional.test.js tests/unit/module-copy-identity.test.js tests/unit/growth-axes-and-compliance.test.js tests/unit/skill-paths-prebaked.test.js tests/unit/check-docs-complete.test.js tests/unit/absence-is-not-emptiness.test.js tests/unit/guard-forms.test.js tests/unit/generated-guard-templates.test.js tests/unit/shipped-suite-context.test.js tests/unit/assess-scripts.test.js tests/unit/insights-docs-tell-the-truth.test.js",
77
- "test:e2e": "node --test tests/e2e/lifecycle.test.js",
78
- "test:snapshot": "node --test tests/snapshot/templates.test.js",
79
- "test:doctor": "node bin/cli.js doctor",
80
- "snapshot:baseline": "node tests/snapshot/update-baseline.js"
81
83
  }
82
- }
84
+ }