@dzhechkov/p-replicator 1.12.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dz-manifest.json +281 -65
- package/CHANGELOG.md +148 -1
- package/LICENSE +21 -0
- package/MULTIPLATFORM_ROADMAP.md +1 -1
- package/README/eng/01_quickstart.md +2 -2
- package/README/eng/02_user_guide.md +1 -1
- package/README/eng/03_admin_guide.md +2 -2
- package/README/eng/05_architecture.md +1 -1
- package/README/eng/README.md +2 -1
- package/README/ru/01_quickstart.md +2 -2
- package/README/ru/02_user_guide.md +1 -1
- package/README/ru/03_admin_guide.md +2 -2
- package/README/ru/05_architecture.md +1 -1
- package/README/ru/README.md +2 -1
- package/README/ru/html/index.html +8 -8
- package/README.md +150 -9
- package/bin/cli.js +0 -0
- package/package.json +10 -11
- package/sbom.json +604 -64
- package/scripts/check-pipeline-gaps.sh +510 -21
- package/src/commands/init.js +1 -1
- package/src/rule-components.json +5 -1
- package/src/utils.js +33 -3
- package/templates/.claude/agents/product-discoverer.md +38 -0
- package/templates/.claude/agents/replicate-coordinator.md +11 -1
- package/templates/.claude/commands/feature.md +72 -6
- package/templates/.claude/commands/go.md +6 -8
- package/templates/.claude/commands/harvest.md +5 -7
- package/templates/.claude/commands/replicate.md +169 -44
- package/templates/.claude/commands/start.md +28 -7
- package/templates/.claude/hooks/capture-source-path.cjs +795 -0
- package/templates/.claude/hooks/check-canon.cjs +493 -0
- package/templates/.claude/hooks/check-embed-contract.cjs +374 -0
- package/templates/.claude/hooks/check-external-deps.cjs +288 -0
- package/templates/.claude/hooks/check-file-ownership.cjs +424 -0
- package/templates/.claude/hooks/check-handoff-manifest.cjs +367 -0
- package/templates/.claude/hooks/check-job-contract.cjs +501 -0
- package/templates/.claude/hooks/check-look-origin.cjs +240 -0
- package/templates/.claude/hooks/check-look-trace.cjs +385 -0
- package/templates/.claude/hooks/check-metric-source.cjs +296 -0
- package/templates/.claude/hooks/check-model-cost.cjs +470 -0
- package/templates/.claude/hooks/check-ports.cjs +27 -6
- package/templates/.claude/hooks/check-review-contract.cjs +205 -0
- package/templates/.claude/hooks/check-source-version.cjs +312 -0
- package/templates/.claude/hooks/check-swarm-receipts.cjs +197 -0
- package/templates/.claude/hooks/check-webhook-contract.cjs +535 -0
- package/templates/.claude/hooks/statusline.cjs +2 -2
- package/templates/.claude/rules/embeddable-widget.md +73 -0
- package/templates/.claude/rules/feature-lifecycle.md +5 -6
- package/templates/.claude/rules/incoming-webhooks.md +99 -0
- package/templates/.claude/rules/long-running-job.md +73 -0
- package/templates/.claude/rules/model-call-cost.md +85 -0
- package/templates/.claude/rules/replicate-pipeline.md +122 -52
- package/templates/.claude/skills/brutal-honesty-review/SKILL.md +9 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +4 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/03-generate-p0.md +46 -1
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/04-generate-p1.md +7 -1
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/06-package-deliver.md +20 -2
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/claude-md-strategy.md +7 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/automation-commands.md +17 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle-ent.md +43 -5
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle.md +43 -7
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +19 -1
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/swarm-file-evidence.md +151 -0
- package/templates/.claude/skills/goap-research-ed25519/SKILL.md +37 -22
- package/templates/.claude/skills/goap-research-ed25519/references/negative-results.md +94 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/check_report_evidence.py +368 -4
- package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +122 -5
- package/templates/.claude/skills/goap-research-ed25519/scripts/evidence_fetch.py +33 -16
- package/templates/.claude/skills/goap-research-ed25519/scripts/quote_provenance.py +342 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_ed25519_verifier.py +60 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_evidence_provenance.py +139 -6
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_quote_provenance.py +274 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_suite_completeness.py +2 -1
- package/templates/.claude/skills/knowledge-extractor/SKILL.md +4 -0
- package/templates/.claude/skills/pipeline-forge/SKILL.md +18 -23
- package/templates/.claude/skills/pipeline-forge/examples/replicate-analysis.md +7 -2
- package/templates/.claude/skills/pipeline-forge/references/patterns-catalog.md +19 -1
- package/templates/.claude/skills/pipeline-forge/references/self-extracted-patterns.md +17 -6
- package/templates/.claude/skills/pipeline-forge/references/skill-anatomy.md +0 -1
- package/templates/.claude/skills/requirements-validator/SKILL.md +18 -5
- package/templates/.claude/skills/requirements-validator/references/feature-report-contracts.md +67 -0
- package/templates/.claude/skills/requirements-validator/references/scoring-system.md +15 -6
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/025-cjm-prototype.md +21 -1
- package/templates/.claude/skills/sparc-prd-mini/SKILL.md +173 -725
- package/tests/e2e/feature-contour.test.js +176 -0
- package/tests/fixtures/feature-contour/docs/features/demo-gate/01_specification.md +15 -0
- package/tests/fixtures/feature-contour/docs/features/demo-gate/02_pseudocode.md +19 -0
- package/tests/fixtures/feature-contour/docs/features/demo-gate/03_architecture.md +3 -0
- package/tests/fixtures/feature-contour/docs/features/demo-gate/04_refinement.md +3 -0
- package/tests/fixtures/feature-contour/docs/features/demo-gate/05_completion.md +7 -0
- package/tests/fixtures/feature-contour/docs/features/demo-gate/review-report.md +11 -0
- package/tests/fixtures/feature-contour/docs/features/demo-gate/validation-report.md +10 -0
- package/tests/fixtures/feature-contour/tests/demo.test.js +16 -0
- package/tests/snapshot/baseline.json +64 -40
- package/tests/unit/capture-source-path.test.js +492 -0
- package/tests/unit/check-canon.test.js +403 -0
- package/tests/unit/check-embed-contract.test.js +422 -0
- package/tests/unit/check-external-deps.test.js +363 -0
- package/tests/unit/check-file-ownership.test.js +388 -0
- package/tests/unit/check-handoff-manifest.test.js +410 -0
- package/tests/unit/check-job-contract.test.js +514 -0
- package/tests/unit/check-look-origin.test.js +180 -0
- package/tests/unit/check-look-trace.test.js +420 -0
- package/tests/unit/check-metric-source.test.js +325 -0
- package/tests/unit/check-model-cost.test.js +425 -0
- package/tests/unit/check-ports.test.js +46 -2
- package/tests/unit/check-review-contract.test.js +181 -0
- package/tests/unit/check-source-version.test.js +344 -0
- package/tests/unit/check-swarm-receipts.test.js +231 -0
- package/tests/unit/check-webhook-contract.test.js +536 -0
- package/tests/unit/db-port-rule.test.js +8 -2
- package/tests/unit/detection-ladder-registry.test.js +2 -2
- package/tests/unit/generator-swarm-contract.test.js +287 -0
- package/tests/unit/guard-honest-input-meta.test.js +64 -0
- package/tests/unit/honest-failure-rules.test.js +106 -9
- package/tests/unit/look-phase-contract.test.js +231 -0
- package/tests/unit/negative-conclusion-gate.test.js +300 -0
- package/tests/unit/quote-provenance.test.js +122 -0
- package/tests/unit/sync-templates-guard.test.js +46 -3
- package/tests/unit/traceability-completion-gate.test.js +267 -0
- package/tests/unit/utils.test.js +40 -3
package/src/utils.js
CHANGED
|
@@ -354,7 +354,22 @@ const COMPONENTS = {
|
|
|
354
354
|
'write-insight': 'Validate and append one harvest insight to the project Markdown carrier',
|
|
355
355
|
'check-ports': 'Enforce docker-ports Правило №0 against a real compose (invoke deliberately; exits 0/1/2)',
|
|
356
356
|
'check-growth-trace': 'Did the M5 growth seed reach docs/Specification.md (invoke deliberately; exits 0/1/2)',
|
|
357
|
+
'check-look-trace': 'Did the Phase-0.5 source-look seed reach docs/Specification.md (invoke deliberately; exits 0/1/2)',
|
|
358
|
+
'check-look-origin': 'Did a third-party-analysis HYPOTHESIS row reach Specification.md without dated live confirmation (invoke deliberately; exits 0/1/2)',
|
|
359
|
+
'check-review-contract': 'Does review-report.md answer every AC id, disclose the reviewer family and name the spec revision it judged (exits 0/1/2)',
|
|
360
|
+
'capture-source-path': 'Phase-0.5 «путь» axis: click through the source product in a browser and emit FR-LOOK rows (external Playwright; exits 0/1/2)',
|
|
357
361
|
'check-docs-complete': 'Are Phase-1 documents written and placeholder-free, before the Phase-2 swarm (invoke deliberately; exits 0/1/2)',
|
|
362
|
+
'check-swarm-receipts': 'Did every parallel work unit deliver its named terminal file, before the coordinator aggregates (invoke deliberately; exits 0/1/2)',
|
|
363
|
+
'check-embed-contract': 'Was the embeddable widget checked on a FOREIGN origin — cross-origin, style leakage, host CSP (invoke deliberately; exits 0/1/2)',
|
|
364
|
+
'check-webhook-contract': 'Is the incoming webhook signed, deduplicated by a NAMED repeat key with atomic exclusion, and safe against reordering (invoke deliberately; exits 0/1/2)',
|
|
365
|
+
'check-job-contract': 'Does long-running work carry a handle issued before the work, three distinguishable states and a retry that continues (invoke deliberately; exits 0/1/2)',
|
|
366
|
+
'check-model-cost': 'Does every external model call name a ceiling that can BIND — a number, per user and per day, refusing at the limit (invoke deliberately; exits 0/1/2)',
|
|
367
|
+
'check-canon': 'Before a WRITING fan-out: is the shared canon named, pinned by sha256 and free of colliding ordinals and self-contradicting lists (invoke deliberately; exits 0/1/2)',
|
|
368
|
+
'check-file-ownership': 'Before a WRITING fan-out: does every written file have exactly one writer — coordinator included — and does a file born by a SPLIT get its owner at creation (invoke deliberately; exits 0/1/2)',
|
|
369
|
+
'check-source-version': 'Before a merge: does every edit and every verdict declare the sha256 of the source it was built on, and does it still match (invoke deliberately; exits 0/1/2)',
|
|
370
|
+
'check-handoff-manifest': 'Phase 0 to Phase 1: did every enumerated discovery output get an answer — cited by id, or rejected with a reason (invoke deliberately; exits 0/1/2)',
|
|
371
|
+
'check-external-deps': 'Does the external-dependency inventory EXIST and carry a verdict per row — an absent section is never «no dependencies» (invoke deliberately; exits 0/1/2)',
|
|
372
|
+
'check-metric-source': 'Does every success metric name WHERE its value comes from, from a closed list, and does an external-API metric have its inventory row (invoke deliberately; exits 0/1/2)',
|
|
358
373
|
},
|
|
359
374
|
},
|
|
360
375
|
// ─── Project-generated groups (created by /replicate Phase 3) ───────────
|
|
@@ -498,6 +513,19 @@ function removeOrphanHooks(existing, oldTemplate, newTemplate) {
|
|
|
498
513
|
return cleaned;
|
|
499
514
|
}
|
|
500
515
|
|
|
516
|
+
/**
|
|
517
|
+
* Canonical form of a hook command for DEDUP ONLY (backlog a1ef0e41 — MEASURED: a user who
|
|
518
|
+
* hand-rewrote `$CLAUDE_PROJECT_DIR` into `${CLAUDE_PROJECT_DIR}` got every event hook DOUBLED on
|
|
519
|
+
* the next update, because the byte-equality Set saw two different strings for one command).
|
|
520
|
+
* Both spellings expand identically in sh, so for identity purposes they ARE the same command:
|
|
521
|
+
* `${VAR}` collapses to `$VAR`, and whitespace runs collapse to one space. The STORED command is
|
|
522
|
+
* never rewritten — the user's own spelling always survives; only the comparison key changes.
|
|
523
|
+
*/
|
|
524
|
+
function canonicalHookCommand(command) {
|
|
525
|
+
if (typeof command !== 'string') return command;
|
|
526
|
+
return command.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, '$$$1').replace(/\s+/g, ' ').trim();
|
|
527
|
+
}
|
|
528
|
+
|
|
501
529
|
function mergeHookMatchers(existing, template) {
|
|
502
530
|
// Clone the existing array; we'll mutate per-entry hook arrays via reference.
|
|
503
531
|
const result = existing.map((m) => ({ ...m, hooks: [...(m.hooks || [])] }));
|
|
@@ -508,10 +536,12 @@ function mergeHookMatchers(existing, template) {
|
|
|
508
536
|
result.push({ ...tplEntry, hooks: [...(tplEntry.hooks || [])] });
|
|
509
537
|
continue;
|
|
510
538
|
}
|
|
511
|
-
// Same matcher — append template hooks not already present
|
|
512
|
-
|
|
539
|
+
// Same matcher — append template hooks not already present. Identity is the CANONICAL
|
|
540
|
+
// command (see canonicalHookCommand), so a user's `${VAR}` respelling of a shipped `$VAR`
|
|
541
|
+
// hook no longer reads as a different hook and doubles on every update.
|
|
542
|
+
const existingCmds = new Set(target.hooks.map((h) => canonicalHookCommand(h.command)));
|
|
513
543
|
for (const tplHook of tplEntry.hooks || []) {
|
|
514
|
-
if (!existingCmds.has(tplHook.command)) {
|
|
544
|
+
if (!existingCmds.has(canonicalHookCommand(tplHook.command))) {
|
|
515
545
|
target.hooks.push(tplHook);
|
|
516
546
|
}
|
|
517
547
|
}
|
|
@@ -46,8 +46,46 @@ Product Discovery Brief — structured markdown passed as pre-filled context to
|
|
|
46
46
|
|
|
47
47
|
### Key Insights for PRD
|
|
48
48
|
[Top 3-5 insights that should inform product planning]
|
|
49
|
+
|
|
50
|
+
## Манифест передачи
|
|
51
|
+
|
|
52
|
+
**Фаза 0 выполнена:** да
|
|
53
|
+
**Проверка манифеста:** ВЫПОЛНЕНА
|
|
54
|
+
**Причина:** —
|
|
55
|
+
|
|
56
|
+
| Выход | Идентификатор | Модуль |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| [what this run actually produced] | PD-INSIGHT-001 | M5 |
|
|
49
59
|
```
|
|
50
60
|
|
|
61
|
+
### The manifest is REQUIRED, and it is the last thing written
|
|
62
|
+
|
|
63
|
+
The brief's six sections are passed onward through a CLOSED list of four fields
|
|
64
|
+
(`target_segments`, `key_competitors`, `differentiation`, `monetization`). Two of the six therefore
|
|
65
|
+
have no field at all — «Key Insights for PRD» has none, and «Growth Channels» travels only through
|
|
66
|
+
the separate `FR-GROWTH` seed. The artifact is written, it is on disk, and the next phase has no
|
|
67
|
+
input through which it could reach a decision: «used» and «silently dropped» look identical from
|
|
68
|
+
every side, because nobody is obliged to answer by list.
|
|
69
|
+
|
|
70
|
+
The manifest is that list. Three rules, and each of them is what makes it checkable rather than
|
|
71
|
+
ceremonial:
|
|
72
|
+
|
|
73
|
+
1. **Only ENUMERABLE outputs of the REAL run**, each with a stable identifier `PD-WORD-nnn`
|
|
74
|
+
(uppercase, three digits, never reused). Free prose cannot be answered by list, and answering by
|
|
75
|
+
list is the entire cure.
|
|
76
|
+
2. **A module that did not run owes NOTHING.** Do not invent rows for modules you skipped — a
|
|
77
|
+
manifest padded to look complete is worse than a short one, because it makes the check pass while
|
|
78
|
+
describing work nobody did.
|
|
79
|
+
3. **Phase 1 answers every row**: cite the id in a Phase-1 document, or reject it WITH A REASON in
|
|
80
|
+
the same line. Silence is neither, and it is the only outcome the check refuses to interpret
|
|
81
|
+
charitably.
|
|
82
|
+
|
|
83
|
+
Deterministic half: `node .claude/hooks/check-handoff-manifest.cjs .` — `0` every output answered ·
|
|
84
|
+
`1` a defect is PROVEN and NAMED (an output nobody answered for, a rejection with no reason, an
|
|
85
|
+
empty manifest) · `2` THE CHECK DID NOT RUN (no brief — Phase 0 never ran, `--from-docs` skips it —
|
|
86
|
+
no manifest section, no Phase-1 documents, a malformed or duplicated id, or the honest «НЕ
|
|
87
|
+
ВЫПОЛНЕНА» with a reason). Exit `2` never means "all clear".
|
|
88
|
+
|
|
51
89
|
## Anti-Hallucination Rules
|
|
52
90
|
|
|
53
91
|
- Search first — never answer from memory for facts
|
|
@@ -8,9 +8,19 @@ Activated automatically by the `/replicate` command. Do NOT invoke directly.
|
|
|
8
8
|
|
|
9
9
|
## Responsibilities
|
|
10
10
|
|
|
11
|
-
1. **Phase Management** — ensure correct phase sequence (0 → 1 → 2 → 3 → 4)
|
|
11
|
+
1. **Phase Management** — ensure correct phase sequence (0 → 0.5 → 1 → 2 → 3 → 4).
|
|
12
|
+
Phase 0 is OPTIONAL and is skipped entirely by the `--from-docs` / `--skip-discovery` entry;
|
|
13
|
+
**Phase 0.5 (Source Product Profile) is MANDATORY and runs in every case**, which is why it is a
|
|
14
|
+
separate phase rather than a module inside Phase 0.
|
|
12
15
|
2. **Context Passing** — carry forward outputs between phases:
|
|
13
16
|
- Phase 0 → Phase 1: Product Discovery Brief
|
|
17
|
+
- Phase 0.5 → Phase 1: Source Product Profile (`docs/source-product-profile.md`) — a capture
|
|
18
|
+
status PER AXIS (`облик` and `путь` each answer `СНЯТ` / `НЕ ИЗМЕРЕНО` + reason /
|
|
19
|
+
`ИСТОЧНИКА НЕТ`, because they fail apart) plus the `FR-LOOK-nnn` seed rows of ONE family. A
|
|
20
|
+
`СНЯТ` profile's palette SUPERSEDES the industry palette of `025-cjm-prototype.md`; in the
|
|
21
|
+
other two states that table is a LABELLED fallback. The `путь` axis is captured by
|
|
22
|
+
`.claude/hooks/capture-source-path.cjs` (browser click-through; Playwright is an external
|
|
23
|
+
prerequisite, and its absence is the outcome `no-browser`, never a stalled run)
|
|
14
24
|
- Phase 1 → Phase 2: 11 SPARC documents
|
|
15
25
|
- Phase 2 → Phase 3: Validated docs + test-scenarios
|
|
16
26
|
- Phase 3 → Phase 4: Complete toolkit
|
|
@@ -133,6 +133,17 @@ Run validation against INVEST + SMART + BDD scenario completeness.
|
|
|
133
133
|
|
|
134
134
|
Output: `docs/features/<feature>/validation-report.md`
|
|
135
135
|
|
|
136
|
+
The report carries the `Spec revision:` line and the `## Criterion scenarios` table (AC id → BDD
|
|
137
|
+
scenario) in the exact format of
|
|
138
|
+
`.claude/skills/requirements-validator/references/feature-report-contracts.md`. Then run:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
bash "$CHECK_PIPELINE_GAPS" "${CLAUDE_PROJECT_DIR:-.}" --report-revision --criterion-scenarios
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Same exit semantics as the Phase 1 gate: `0` advances; `1` (stale revision, AC id without a scenario
|
|
145
|
+
row) returns to Phase 2; `2` stops.
|
|
146
|
+
|
|
136
147
|
### Phase 3: IMPLEMENT (parallel agents)
|
|
137
148
|
|
|
138
149
|
1. Read SPARC docs from Phase 1
|
|
@@ -143,22 +154,74 @@ Output: `docs/features/<feature>/validation-report.md`
|
|
|
143
154
|
6. Coordinator validates every trace before merge/integration
|
|
144
155
|
7. Run full test suite
|
|
145
156
|
|
|
157
|
+
#### Canon before dispatch (required)
|
|
158
|
+
|
|
159
|
+
**The canon MUST be frozen BEFORE dispatch.** Parallel units are N writers deriving names and
|
|
160
|
+
numbers from one source; the collision exists ONLY IN THE UNION, so no worker can see it and no
|
|
161
|
+
receipt can catch it. The coordinator records `docs/dispatch-plan.md` — the canon path and its
|
|
162
|
+
sha256 — or runs the units sequentially.
|
|
163
|
+
|
|
164
|
+
The same plan MUST assign OWNERSHIP: exactly one writer per file, the coordinator included, and a
|
|
165
|
+
file born by SPLITTING another gets its owner AT CREATION — ownership never travels by itself.
|
|
166
|
+
|
|
167
|
+
Every EDIT and every VERDICT MUST declare the sha256 of the source it was built on; a
|
|
168
|
+
mismatch with the live file is a refusal WITHOUT mutation — a read copy is a snapshot of the moment
|
|
169
|
+
of reading, not of the file.
|
|
170
|
+
|
|
171
|
+
Field forms and closed value lists are in the checkers' headers:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
node .claude/hooks/check-canon.cjs .
|
|
175
|
+
node .claude/hooks/check-file-ownership.cjs .
|
|
176
|
+
node .claude/hooks/check-source-version.cjs .
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`0` frozen and intact · `1` a defect is PROVEN and named · `2` **THE CHECK DID NOT RUN**, which is
|
|
180
|
+
never "all clear".
|
|
181
|
+
|
|
146
182
|
#### Positive file receipt (required)
|
|
147
183
|
|
|
148
184
|
Before dispatch, allocate one `RUN_ID` and, for every independent unit, a unique `WORK_UNIT_ID`.
|
|
149
185
|
Resolve `TRACE_PATH` to an absolute path unique to `(RUN_ID, WORK_UNIT_ID)` and pass both fields.
|
|
150
186
|
Require the worker to write a substantive body ending in `Status: completed` or `Status: failed` to
|
|
151
|
-
`TRACE_PATH` before
|
|
152
|
-
|
|
153
|
-
receipt
|
|
154
|
-
|
|
155
|
-
|
|
187
|
+
`TRACE_PATH` before its one-line pointer. Before integration, MUST verify a regular, non-symlink,
|
|
188
|
+
substantive, post-launch file with a terminal status. Narrative/chat/silence is never a receipt; any
|
|
189
|
+
invalid receipt MUST block merge/completion. Full rule and bounded exception:
|
|
190
|
+
`.claude/rules/swarm-file-evidence.md`.
|
|
191
|
+
|
|
192
|
+
#### Threshold tests pin the number (layer-2 rule)
|
|
193
|
+
|
|
194
|
+
A test of a THRESHOLD asserts the literal number; a test of a DERIVED value calls the production
|
|
195
|
+
implementation. A test that computes its expectation from the production constant is green for any
|
|
196
|
+
value and proves nothing.
|
|
197
|
+
|
|
198
|
+
#### Blocking criterion-coverage gate
|
|
199
|
+
|
|
200
|
+
`05_completion.md` MUST carry the `## Criterion coverage` table (AC id → test file → test title; format
|
|
201
|
+
in `feature-report-contracts.md`). At the end of Phase 3 run:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
bash "$CHECK_PIPELINE_GAPS" "${CLAUDE_PROJECT_DIR:-.}" --completion
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`0` advances; `1` (an AC without a test, a row whose file or title does not exist) returns to
|
|
208
|
+
Phase 3; `2` stops. Never downgrade either non-zero status to a warning.
|
|
156
209
|
|
|
157
210
|
### Phase 4: REVIEW (brutal-honesty-review)
|
|
158
211
|
|
|
159
212
|
Read: `.claude/skills/brutal-honesty-review/SKILL.md`
|
|
160
213
|
|
|
161
|
-
|
|
214
|
+
Specification contract: the review receives `01_specification.md` + `validation-report.md` (a review
|
|
215
|
+
not given the specification is incomplete by construction and says so) and writes
|
|
216
|
+
`docs/features/<feature>/review-report.md` — `Reviewer family:` (disclosure) and `Spec revision:` in the
|
|
217
|
+
first 20 lines, an AC-by-AC `## Spec conformance` table — per `feature-report-contracts.md`. Then run:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/check-review-contract.cjs" "${CLAUDE_PROJECT_DIR:-.}" "<feature>"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
`0` advances; `1` (named contract gaps) returns to Phase 4; `2` stops. Findings classified by
|
|
224
|
+
severity. Critical (blocker | high) MUST be fixed.
|
|
162
225
|
|
|
163
226
|
## Final Steps
|
|
164
227
|
|
|
@@ -172,8 +235,11 @@ Skip per-phase user confirmations. Auto-decisions:
|
|
|
172
235
|
- Phase 1: proceed if all docs exist
|
|
173
236
|
- Phase 1 traceability: proceed only when `check-pipeline-gaps.sh` exits `0`; preserve exit `1`/`2`
|
|
174
237
|
- Phase 2: proceed if 🟢 or 🟡; auto-retry once on 🔴
|
|
238
|
+
- Phase 2 report revision + criterion scenarios: proceed only when `--report-revision --criterion-scenarios` exits `0`; preserve exit `1`/`2`
|
|
175
239
|
- Phase 3: proceed if tests + lint + build green
|
|
240
|
+
- Phase 3 criterion coverage: proceed only when `--completion` exits `0`; preserve exit `1`/`2`
|
|
176
241
|
- Phase 4: auto-fix `high` if straightforward; halt on `blocker`
|
|
242
|
+
- Phase 4 review contract: proceed only when `check-review-contract.cjs` exits `0`; preserve exit `1`/`2`
|
|
177
243
|
|
|
178
244
|
## Related
|
|
179
245
|
|
|
@@ -75,14 +75,12 @@ Same as `/feature` but with idea2prd-manual + DDD coherence + ADR consistency
|
|
|
75
75
|
|
|
76
76
|
### Delegated parallel-work receipt (required)
|
|
77
77
|
|
|
78
|
-
For
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
aggregation/completion unless every required receipt is valid and completed. The selected pipeline
|
|
85
|
-
owns the paths; this router never substitutes its own report. See `.claude/rules/swarm-file-evidence.md`.
|
|
78
|
+
For parallel work, assign each unit a unique `WORK_UNIT_ID` and unique absolute `TRACE_PATH`. The worker
|
|
79
|
+
MUST write a substantive body ending in `Status: completed` or `Status: failed` to `TRACE_PATH` before
|
|
80
|
+
its one-line pointer. Before merge/synthesis/completion, the selected pipeline MUST verify a regular,
|
|
81
|
+
non-symlink, substantive, post-launch file with a terminal status. Narrative/chat/silence is never a
|
|
82
|
+
receipt; any invalid receipt MUST block merge/completion, and this router never substitutes its report.
|
|
83
|
+
Full rule: `.claude/rules/swarm-file-evidence.md`.
|
|
86
84
|
|
|
87
85
|
## Step 6: Post-Implementation
|
|
88
86
|
|
|
@@ -55,13 +55,11 @@ Gate 5: PERSIST INSIGHT — quick/full must receive a valid writer receipt befor
|
|
|
55
55
|
|
|
56
56
|
### Phase 1 positive file receipts (required)
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
unreadable, duplicate, failed, dead-PID, or probe-error perspectives and refuse harvest completion
|
|
64
|
-
unless every required receipt is valid and completed. See `.claude/rules/swarm-file-evidence.md`.
|
|
58
|
+
Assign each perspective a unique `WORK_UNIT_ID` and unique absolute `TRACE_PATH`. Its agent MUST write
|
|
59
|
+
a substantive body ending in `Status: completed` or `Status: failed` to `TRACE_PATH` before its one-line
|
|
60
|
+
pointer. Before classification/synthesis, verify a regular, non-symlink, substantive, post-launch file
|
|
61
|
+
with a terminal status. Narrative/chat/silence is never a receipt; any invalid receipt MUST block
|
|
62
|
+
harvest completion. Full rule: `.claude/rules/swarm-file-evidence.md`.
|
|
65
63
|
|
|
66
64
|
## REQUIRED INSIGHT PERSISTENCE GATE (quick/full only)
|
|
67
65
|
|
|
@@ -31,6 +31,7 @@ All skills are available locally. Read their SKILL.md when needed:
|
|
|
31
31
|
| Skill | Path | Phase |
|
|
32
32
|
|-------|------|-------|
|
|
33
33
|
| reverse-engineering-unicorn | `.claude/skills/reverse-engineering-unicorn/SKILL.md` | Phase 0 |
|
|
34
|
+
| clone-website *(EXTERNAL — not pre-shipped)* | `.claude/skills/clone-website/SKILL.md` — install `@dzhechkov/skills-website-cloner` | Phase 0.5 (recon-only) |
|
|
34
35
|
| sparc-prd-mini | `.claude/skills/sparc-prd-mini/SKILL.md` | Phase 1 |
|
|
35
36
|
| explore | `.claude/skills/explore/SKILL.md` | Phase 1 (dependency) |
|
|
36
37
|
| goap-research-ed25519 | `.claude/skills/goap-research-ed25519/SKILL.md` | Phase 1 (dependency) |
|
|
@@ -48,11 +49,13 @@ All skills are available locally. Read their SKILL.md when needed:
|
|
|
48
49
|
## Pipeline
|
|
49
50
|
|
|
50
51
|
```
|
|
51
|
-
INPUT → [PRODUCT DISCOVERY] → PLANNING → VALIDATION → TOOLKIT → FINALIZE
|
|
52
|
-
(optional) sparc-prd requirements cc-toolkit commit
|
|
53
|
-
-mini -validator -generator & report
|
|
52
|
+
INPUT → [PRODUCT DISCOVERY] → SOURCE PRODUCT → PLANNING → VALIDATION → TOOLKIT → FINALIZE
|
|
53
|
+
(optional) PROFILE sparc-prd requirements cc-toolkit commit
|
|
54
|
+
(ALWAYS) -mini -validator -generator & report
|
|
54
55
|
```
|
|
55
56
|
|
|
57
|
+
Фаза 0 пропускается входом `--from-docs`; **Фаза 0.5 выполняется всегда** — потому и отдельная.
|
|
58
|
+
|
|
56
59
|
**Note:** sparc-prd-mini v2 already includes Explore, Research, and Solve phases
|
|
57
60
|
internally via skill references. The coordinator does NOT duplicate these phases.
|
|
58
61
|
|
|
@@ -80,17 +83,13 @@ but distinct from generated SPARC outputs.
|
|
|
80
83
|
### Modified pipeline flow when triggered
|
|
81
84
|
|
|
82
85
|
- **Phase 0** (Product Discovery): SKIPPED entirely (no reverse-engineering-unicorn invocation)
|
|
83
|
-
- **Phase
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
Specification, Pseudocode, Architecture, Refinement, Completion,
|
|
91
|
-
Research_Findings, Final_Summary, C4_Diagrams, ADR)
|
|
92
|
-
- For SPARC slots without source content in existing docs, mark with a
|
|
93
|
-
`[GAP: needs <description>]` placeholder rather than asking the user
|
|
86
|
+
- **Phase 0.5** (Source Product Profile): **RUNS — this entry does NOT skip it**; the skip is Phase 0
|
|
87
|
+
alone, and a project arriving with someone else's docs is usually a replication. Where those docs
|
|
88
|
+
describe the source, record `СНЯТ` from them; where they do not, `НЕ ИЗМЕРЕНО` with a reason.
|
|
89
|
+
- **Phase 1** (sparc-prd-mini): MODIFIED — **AUTO mode** (no interactive questions); SKIP
|
|
90
|
+
Explore/Research/Solve (they generate answers the user docs already hold); READ the user path as
|
|
91
|
+
pre-filled context; generate the 11 SPARC documents in `docs/`, mapping existing content to slots;
|
|
92
|
+
a slot with no source content gets `[GAP: needs <description>]` instead of a question
|
|
94
93
|
- **Phase 2** (validation): runs UNCHANGED (validates the generated SPARC docs)
|
|
95
94
|
- **Phase 3** (toolkit generation): runs UNCHANGED
|
|
96
95
|
- **Phase 4** (finalize): runs UNCHANGED
|
|
@@ -142,7 +141,7 @@ above, but applies to ad-hoc feature additions rather than full project bootstra
|
|
|
142
141
|
|
|
143
142
|
### Start
|
|
144
143
|
|
|
145
|
-
1. Briefly explain the phases (4 main + 1 optional)
|
|
144
|
+
1. Briefly explain the phases (4 main + 1 optional Phase 0 + the mandatory Phase 0.5)
|
|
146
145
|
2. Mention the target architecture (distributed monolith + Docker на VPS)
|
|
147
146
|
3. Determine project type → is Product Discovery needed?
|
|
148
147
|
4. Begin with the relevant phase
|
|
@@ -207,6 +206,106 @@ project has no growth requirements, and no consumer may read it that way.
|
|
|
207
206
|
═══════════════════════════════════════════════════════════════
|
|
208
207
|
```
|
|
209
208
|
|
|
209
|
+
### Phase 0.5: SOURCE PRODUCT PROFILE (обязательная — выполняется ВСЕГДА)
|
|
210
|
+
|
|
211
|
+
Когда проект воспроизводит существующий продукт, его ОБЛИК — палитра, типографика, плотность,
|
|
212
|
+
компоновка экранов, порядок шагов — сердцевина задачи, а не приятность. Все шесть модулей Фазы 0
|
|
213
|
+
разбирают бизнес, а палитру `025-cjm-prototype.md` НАЗНАЧАЛ по отрасли: конвейер, чья задача
|
|
214
|
+
воспроизвести продукт, выдумывал ему внешность.
|
|
215
|
+
|
|
216
|
+
**Почему ОТДЕЛЬНАЯ фаза, а не модуль Фазы 0.** Вход `--from-docs` / `--skip-discovery` пропускает
|
|
217
|
+
Фазу 0 целиком. Модуль внутри неё выключился бы ровно для проектов с чужой документацией — то есть
|
|
218
|
+
чаще всего именно для клонов. Поэтому фаза стоит ПОСЛЕ чекпоинта Фазы 0 и от него не зависит.
|
|
219
|
+
|
|
220
|
+
**Съёмка — навык `clone-website` из ОТДЕЛЬНОГО пакета
|
|
221
|
+
[`@dzhechkov/skills-website-cloner`](https://www.npmjs.com/package/@dzhechkov/skills-website-cloner),
|
|
222
|
+
режим только разведка. ВЫЗЫВАЕТСЯ, НЕ КОПИРУЕТСЯ** — вендорить его сюда запрещено (ADR-0001 +
|
|
223
|
+
`sources.json`): `npx @dzhechkov/skills-website-cloner init`. Навыка нет или браузерный MCP
|
|
224
|
+
недоступен → исход `НЕ ИЗМЕРЕНО (no-browser-mcp)`; фаза всё равно выполняется, конвейер не встаёт.
|
|
225
|
+
|
|
226
|
+
**Артефакт `docs/source-product-profile.md` — пишется ВСЕГДА, во всех трёх исходах:**
|
|
227
|
+
|
|
228
|
+
```markdown
|
|
229
|
+
**Источник:** Senja — https://senja.io (либо `нет`)
|
|
230
|
+
**Статус съёмки:** СНЯТ (ось «облик»; ровно одно: СНЯТ | НЕ ИЗМЕРЕНО | ИСТОЧНИКА НЕТ)
|
|
231
|
+
**Причина:** — (обязательна при НЕ ИЗМЕРЕНО, из закрытого списка ниже)
|
|
232
|
+
**Статус съёмки (путь):** СНЯТ (ось «путь»; обязательна, когда строк оси «путь» НЕТ)
|
|
233
|
+
**Причина (путь):** — (обязательна при НЕ ИЗМЕРЕНО оси «путь»)
|
|
234
|
+
**Происхождение:** прокликано (закрытый список: прокликано | сторонний-разбор | вручную | не снято)
|
|
235
|
+
**Источник разбора:** — (обязательны при сторонний-разбор; дата — из разметки
|
|
236
|
+
**Дата стороннего снимка:** — источника, не из пересказа)
|
|
237
|
+
|
|
238
|
+
## 🎨 Look Requirements Seed
|
|
239
|
+
|
|
240
|
+
| ID | Обязательство | Ось | Источник-экран | Уверенность | Статус (ЧЕРНОВИК \| ГИПОТЕЗА \| ПОДТВЕРЖДЕНО \| УСТАРЕЛО) |
|
|
241
|
+
|----|---|---|---|---|---|
|
|
242
|
+
| FR-LOOK-001 | [что обязаны воспроизвести] | облик | [URL/скриншот] | [как измерено] | ЧЕРНОВИК |
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Закрытый список причин, каждая означает СВОЙ ремонт: `no-browser-mcp` · `no-browser` ·
|
|
246
|
+
`unreachable` · `auth-required` · `out-of-scope` · `bot-protected` · `timeout` ·
|
|
247
|
+
`robots-disallowed`.
|
|
248
|
+
|
|
249
|
+
`FR-LOOK-<nnn>` — ОДНО семейство: три цифры, по порядку, номер не переиспользуется. Ось (`облик` —
|
|
250
|
+
что видно; `путь` — в каком порядке идут экраны) это КОЛОНКА, а не второе пространство имён: два
|
|
251
|
+
семейства пришлось бы держать в согласии, одно с колонкой — нет. Полные правила строки и то, что
|
|
252
|
+
именно считается заполненной строкой, — в шапке `.claude/hooks/check-look-trace.cjs`.
|
|
253
|
+
|
|
254
|
+
**Две оси отвечают ПОРОЗНЬ, потому что и отказывают порознь:** лендинг снимается, а прокликивание
|
|
255
|
+
упирается в 403 — один общий статус обязан был бы соврать про одну из осей. Строки оси «путь» и
|
|
256
|
+
есть её ответ; объявление `**Статус съёмки (путь):**` требуется, только когда таких строк НЕТ.
|
|
257
|
+
|
|
258
|
+
**Инструмент оси «путь» — прокликивание браузером:**
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
node .claude/hooks/capture-source-path.cjs <url> --max-pages 5 --delay-ms 1500
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
`0` снято, строки `FR-LOOK-nnn` с осью `путь` на stdout · `1` источник открылся, перехода нет
|
|
265
|
+
(одноэкранный продукт — законный `ИСТОЧНИКА НЕТ` для этой оси) · `2` НЕ ИЗМЕРЕНО с причиной из
|
|
266
|
+
списка. Playwright — ВНЕШНЕЕ предусловие (у пакета ноль зависимостей): нет его → честный
|
|
267
|
+
`no-browser`, конвейер не встаёт. Границы съёмки — в `replicate-pipeline.md`, раздел Фазы 0.5;
|
|
268
|
+
они не пожелание, а условие законности.
|
|
269
|
+
|
|
270
|
+
**ТРИ исхода, и третий — тот, ради которого фаза написана именно так:**
|
|
271
|
+
|
|
272
|
+
| Исход | Когда | Откуда палитра |
|
|
273
|
+
|---|---|---|
|
|
274
|
+
| `СНЯТ` | облик собран | из источника; отраслевая таблица `025` НЕ применяется |
|
|
275
|
+
| `НЕ ИЗМЕРЕНО` | источник НАЗВАН, снять не удалось (причина из списка) | отраслевая, ПОДПИСАННАЯ как фолбэк |
|
|
276
|
+
| `ИСТОЧНИКА НЕТ` | проект ничего не воспроизводит | отраслевая, ПОДПИСАННАЯ как фолбэк |
|
|
277
|
+
|
|
278
|
+
Правило `honest-configuration` CFG-I4: недостижимый источник истины даёт UNKNOWN, никогда
|
|
279
|
+
правдоподобное значение. «Источник назван, но не снят» — честное «неизвестно», а не «требований по
|
|
280
|
+
облику нет».
|
|
281
|
+
|
|
282
|
+
**Ворота фазы — детерминированная проверка, после записи профиля:**
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
node .claude/hooks/check-look-trace.cjs .
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
`0` все строки доехали до `docs/Specification.md` либо отклонены с причиной · `1` потеря доказана,
|
|
289
|
+
потерянные id названы · `2` **проверка НЕ выполнена** (нет профиля, нет спецификации, шаблон не
|
|
290
|
+
тронут, ось «путь» пуста и не объявлена, либо исход не `СНЯТ`) — это НЕ «всё в порядке». До Фазы 1
|
|
291
|
+
код `2` ожидаем: промоушена ещё не было, и здесь проверка отвечает только на вопрос «профиль
|
|
292
|
+
написан и разбирается ли он».
|
|
293
|
+
|
|
294
|
+
**Куда это идёт.** Фаза 1 промотирует принятые строки `FR-LOOK-nnn` в `docs/Specification.md` — так
|
|
295
|
+
же, как `FR-GROWTH-nnn`. Фаза НЕ утверждает, что интерфейс похож на источник: она ловит ровно один
|
|
296
|
+
класс потерь — облик посмотрели и забыли. Похожесть доказывает визуальное сравнение.
|
|
297
|
+
|
|
298
|
+
**Checkpoint:**
|
|
299
|
+
```
|
|
300
|
+
═══════════════════════════════════════════════════════════════
|
|
301
|
+
✅ PHASE 0.5: SOURCE PRODUCT PROFILE
|
|
302
|
+
Источник: [название | нет] · облик: [СНЯТ | НЕ ИЗМЕРЕНО (причина) | ИСТОЧНИКА НЕТ]
|
|
303
|
+
· путь: [СНЯТ | НЕ ИЗМЕРЕНО (причина) | ИСТОЧНИКА НЕТ]
|
|
304
|
+
Обязательств по облику: [N] (облик: [N] · путь: [N])
|
|
305
|
+
⏸️ "ок" — next | "превью облик" — show profile
|
|
306
|
+
═══════════════════════════════════════════════════════════════
|
|
307
|
+
```
|
|
308
|
+
|
|
210
309
|
### Phase 1: PLANNING
|
|
211
310
|
|
|
212
311
|
Read the skill: `.claude/skills/sparc-prd-mini/SKILL.md`
|
|
@@ -233,6 +332,10 @@ Product Context: # From Phase 0 (if applicable)
|
|
|
233
332
|
differentiation: [from Blue Ocean]
|
|
234
333
|
monetization: [from Unit Economics]
|
|
235
334
|
|
|
335
|
+
Source Look Context: # From Phase 0.5 (ALWAYS present — one of the three outcomes)
|
|
336
|
+
capture_status: [СНЯТ | НЕ ИЗМЕРЕНО (причина) | ИСТОЧНИКА НЕТ]
|
|
337
|
+
look_obligations: [rows of docs/source-product-profile.md, FR-LOOK-nnn]
|
|
338
|
+
|
|
236
339
|
Security Pattern: # If external integrations
|
|
237
340
|
api_keys_input: "UI Settings > Integrations"
|
|
238
341
|
storage: "Encrypted IndexedDB (AES-GCM 256-bit)"
|
|
@@ -257,6 +360,18 @@ Write all 11 documents to `docs/`:
|
|
|
257
360
|
- `docs/C4_Diagrams.md` (if applicable)
|
|
258
361
|
- `docs/ADR.md` (if applicable)
|
|
259
362
|
|
|
363
|
+
**Промоушен семян — один шаг для двух семейств.** Принятые строки `FR-GROWTH-nnn` (из
|
|
364
|
+
`docs/product-discovery-brief.md`) и `FR-LOOK-nnn` (из `docs/source-product-profile.md`) переносятся
|
|
365
|
+
в `docs/Specification.md` — каждая либо как требование, либо как отклонение С ПРИЧИНОЙ в той же
|
|
366
|
+
строке. Молча уронить нельзя: это ловят `check-growth-trace.cjs` и `check-look-trace.cjs`.
|
|
367
|
+
|
|
368
|
+
**The handoff manifest is WIDER than the two seeds.** Phase 0 ends the brief with
|
|
369
|
+
`## Манифест передачи` — the enumerated outputs of the REAL run, each with a stable `PD-WORD-nnn`
|
|
370
|
+
id. Phase 1 MUST answer for EVERY one: cite it in a Phase-1 document, or reject it WITH A REASON.
|
|
371
|
+
Silence is forbidden, because an output nobody must answer for is written the same way whether it
|
|
372
|
+
was used or dropped. Checked by `node .claude/hooks/check-handoff-manifest.cjs .` — `2` means THE
|
|
373
|
+
CHECK DID NOT RUN, never "all clear".
|
|
374
|
+
|
|
260
375
|
Git commit: `docs: SPARC documentation for [project-name]`
|
|
261
376
|
|
|
262
377
|
**Checkpoint:**
|
|
@@ -295,6 +410,7 @@ Created [N] documents in docs/
|
|
|
295
410
|
|
|
296
411
|
```bash
|
|
297
412
|
node .claude/hooks/check-docs-complete.cjs .
|
|
413
|
+
node .claude/hooks/check-external-deps.cjs .
|
|
298
414
|
```
|
|
299
415
|
|
|
300
416
|
| Код | Что делать |
|
|
@@ -303,6 +419,11 @@ node .claude/hooks/check-docs-complete.cjs .
|
|
|
303
419
|
| `1` | **НЕ запускайте рой.** Вернитесь в Фазу 1 и допишите названные документы |
|
|
304
420
|
| `2` | проверка не выполнена — почините вызов и повторите; это НЕ «всё в порядке» |
|
|
305
421
|
|
|
422
|
+
**Инвентарь внешних зависимостей ОБЯЗАН СУЩЕСТВОВАТЬ, и отсутствующий раздел — это НЕ «зависимостей
|
|
423
|
+
нет».** На пустом множестве зелёный вердикт «ни одна внешняя зависимость не UNCONFIRMED и не
|
|
424
|
+
CONTRADICTED» истинен САМ СОБОЙ — вакуумная истина в роли проверки. Продукт, который действительно
|
|
425
|
+
никого не зовёт, пишет это дословно.
|
|
426
|
+
|
|
306
427
|
Причина, по которой шаг стоит здесь, а не внутри роя: существование файла, его пустота и
|
|
307
428
|
незаполненный шаблон решаются сорока строками кода. Отправлять на этот вопрос рой агентов — значит
|
|
308
429
|
платить вероятностной проверкой за то, что решается детерминированно. Рою остаётся то, ради чего он
|
|
@@ -311,6 +432,22 @@ node .claude/hooks/check-docs-complete.cjs .
|
|
|
311
432
|
Ограничение, которое проверка печатает сама: она доказывает, что документы НАПИСАНЫ, а не что они
|
|
312
433
|
верны. Верность — работа роя.
|
|
313
434
|
|
|
435
|
+
**Шаги 2.1–2.4 — условные критерии приёмки.** Запускайте только проверки поверхностей продукта;
|
|
436
|
+
отсутствующая поверхность законно даёт `2`.
|
|
437
|
+
|
|
438
|
+
| Шаг / поверхность | Зачем | Правило | Команда |
|
|
439
|
+
|---|---|---|---|
|
|
440
|
+
| 2.0 Чужой разбор | ГИПОТЕЗА без датированного живого подтверждения не промотируется | `.claude/rules/replicate-pipeline.md` | `node .claude/hooks/check-look-origin.cjs .` |
|
|
441
|
+
| 2.1 Встраиваемый виджет на ЧУЖОЙ странице | три origin-невидимых отказа | `.claude/rules/embeddable-widget.md` | `node .claude/hooks/check-embed-contract.cjs .` |
|
|
442
|
+
| 2.2 Долгая задача (МИНУТЫ) | «нет ответа» ≠ «выполняется»: иначе потерянный оплаченный результат, повтор с нуля и третья копия | `.claude/rules/long-running-job.md` | `node .claude/hooks/check-job-contract.cjs .` |
|
|
443
|
+
| 2.3 Входящий вебхук | событие повторяется и может прийти от кого угодно | `.claude/rules/incoming-webhooks.md` | `node .claude/hooks/check-webhook-contract.cjs .` |
|
|
444
|
+
| 2.4 Платная модель | потраченного не вернуть; несконфигурированный потолок ОБЯЗАН валить запуск, не означать бесконечность | `.claude/rules/model-call-cost.md` | `node .claude/hooks/check-model-cost.cjs .` |
|
|
445
|
+
|
|
446
|
+
У каждого стража три кода: `0` проверено · `1` дефект ДОКАЗАН и назван · `2` проверка НЕ ВЫПОЛНЕНА — и это НЕ «в порядке»: код 2 никогда не читается как успех, у него в выводе названа причина, и она попадает в отчёт фазы дословно.
|
|
447
|
+
|
|
448
|
+
Для каждой команды: `0` проверено · `1` дефект ДОКАЗАН и назван · `2` проверка НЕ ВЫПОЛНЕНА — и это
|
|
449
|
+
НЕ «в порядке».
|
|
450
|
+
|
|
314
451
|
Read the skill: `.claude/skills/requirements-validator/SKILL.md`
|
|
315
452
|
|
|
316
453
|
**Goal:** Verify all documentation for completeness, testability, and implementation readiness.
|
|
@@ -329,13 +466,11 @@ Read the skill: `.claude/skills/requirements-validator/SKILL.md`
|
|
|
329
466
|
The sixth lens is the only one that looks OUTSIDE the documents. The other five compare our own
|
|
330
467
|
output with our own output, which cannot discover that a service does not do what we assumed.
|
|
331
468
|
|
|
332
|
-
**Positive file receipt (required).**
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
missing, stale, partial, unreadable, duplicate, failed, dead-PID, or probe-error lenses and refuse
|
|
338
|
-
aggregation/completion unless every required receipt is valid and completed. See
|
|
469
|
+
**Positive file receipt (required).** Assign each validation lens a unique `WORK_UNIT_ID` and unique
|
|
470
|
+
absolute `TRACE_PATH`. Its validator MUST write a substantive fragment ending in `Status: completed`
|
|
471
|
+
or `Status: failed` to `TRACE_PATH` before its one-line pointer. Before AGGREGATE, verify a regular,
|
|
472
|
+
non-symlink, substantive, post-launch file with a terminal status. Narrative/chat/silence is never a
|
|
473
|
+
receipt; any invalid receipt MUST block aggregation/completion. Full rule:
|
|
339
474
|
`.claude/rules/swarm-file-evidence.md`.
|
|
340
475
|
|
|
341
476
|
**Process (iterative, max 3 iterations):**
|
|
@@ -481,12 +616,9 @@ Read the skill: `.claude/skills/cc-toolkit-generator-enhanced/SKILL.md`
|
|
|
481
616
|
**IMPORTANT (Claude Code adaptation, post v1.4):**
|
|
482
617
|
- Scan `docs/` directory for SPARC documents (NOT `/mnt/user-data/uploads/`)
|
|
483
618
|
- Generate files IN-PLACE into the project (NOT into output directory)
|
|
484
|
-
-
|
|
485
|
-
-
|
|
486
|
-
|
|
487
|
-
- All 9 rules: `cost-of-detection-ladder`, `replicate-pipeline`, `skill-interface-protocol`, `git-workflow`, `insights-capture`, `feature-lifecycle`, `docker-ports`, `swarm-file-evidence`, `honest-configuration`
|
|
488
|
-
- All 4 pipeline agents: `replicate-coordinator`, `product-discoverer`, `doc-validator`, `harvest-coordinator`
|
|
489
|
-
- `.claude/settings.json` + cross-platform Node hook scripts in `.claude/hooks/`
|
|
619
|
+
- The toolkit pre-shipped by `npx p-replicator init` is enumerated in
|
|
620
|
+
`.claude/rules/replicate-pipeline.md`; do NOT overwrite or regenerate any listed skill, command,
|
|
621
|
+
rule, agent, setting, or hook.
|
|
490
622
|
- Phase 3 generates ONLY project-specific artifacts derived from SPARC docs (see below).
|
|
491
623
|
|
|
492
624
|
**Generate these project-specific files:**
|
|
@@ -568,22 +700,9 @@ git commit -m "chore: initial project setup from SPARC documentation"
|
|
|
568
700
|
═══════════════════════════════════════════════════════════════
|
|
569
701
|
✅ REPLICATE COMPLETE: [project-name]
|
|
570
702
|
|
|
571
|
-
📁 Project structure:
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
├── README.md # Quick start
|
|
575
|
-
├── docs/ # [N] SPARC documents
|
|
576
|
-
│ ├── validation-report.md # Validation results
|
|
577
|
-
│ ├── test-scenarios.md # BDD scenarios
|
|
578
|
-
│ └── features/ # For future features
|
|
579
|
-
├── .claude/
|
|
580
|
-
│ ├── commands/ # /start, /feature, /plan, /go, /run, /deploy, /myinsights
|
|
581
|
-
│ ├── agents/ # planner, code-reviewer, architect
|
|
582
|
-
│ ├── skills/ # 8 shared + project-specific skills
|
|
583
|
-
│ ├── rules/ # git-workflow, security, coding-style, ...
|
|
584
|
-
│ └── settings.json # Hooks (insights auto-commit)
|
|
585
|
-
├── docker-compose.yml # Scaffold
|
|
586
|
-
└── Dockerfile # Scaffold
|
|
703
|
+
📁 Project structure: CLAUDE.md · DEVELOPMENT_GUIDE.md · README.md · docs/ ([N] SPARC документов,
|
|
704
|
+
validation-report.md, test-scenarios.md, features/) · .claude/ (commands, agents, skills, rules,
|
|
705
|
+
settings.json) · docker-compose.yml · Dockerfile
|
|
587
706
|
|
|
588
707
|
🚀 Next steps:
|
|
589
708
|
1. Run /start to bootstrap the project
|
|
@@ -635,6 +754,7 @@ PRINCIPLE: User enters keys via UI → stored encrypted in browser → NEVER sen
|
|
|
635
754
|
| `ок` | Next phase |
|
|
636
755
|
| `превью [filename]` | View generated file |
|
|
637
756
|
| `превью discovery` | Show Product Discovery Brief |
|
|
757
|
+
| `превью облик` | Show Source Product Profile (Phase 0.5) |
|
|
638
758
|
| `превью validation` | Show Validation Report |
|
|
639
759
|
| `превью toolkit` | Show toolkit structure |
|
|
640
760
|
|
|
@@ -642,6 +762,9 @@ PRINCIPLE: User enters keys via UI → stored encrypted in browser → NEVER sen
|
|
|
642
762
|
|
|
643
763
|
### ALWAYS
|
|
644
764
|
- Read skill SKILL.md before executing its logic
|
|
765
|
+
- Run Phase 0.5 in EVERY run, including `--from-docs`, and write `docs/source-product-profile.md` in
|
|
766
|
+
all three outcomes — an absent profile and one saying «источника нет» look identical to the next
|
|
767
|
+
reader and mean different things
|
|
645
768
|
- Checkpoint after each phase
|
|
646
769
|
- Pass Architecture Constraints to sparc-prd-mini
|
|
647
770
|
- Write docs to `docs/` directory (not `/output/`)
|
|
@@ -657,4 +780,6 @@ PRINCIPLE: User enters keys via UI → stored encrypted in browser → NEVER sen
|
|
|
657
780
|
### CONDITIONAL
|
|
658
781
|
- If external APIs → include security-patterns/ skill + secrets-management.md rule
|
|
659
782
|
- If new product → start with Phase 0 (Product Discovery)
|
|
783
|
+
- If the project replicates an existing product → Phase 0.5's captured look SUPERSEDES the industry
|
|
784
|
+
palette of `025-cjm-prototype.md`, which is a LABELLED fallback for the other two outcomes only
|
|
660
785
|
- If B2B/Enterprise → strengthen security patterns in validation
|