@dzhechkov/p-replicator 1.5.17 → 1.6.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.
- package/.dz-manifest.json +173 -65
- package/CHANGELOG.md +135 -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 +6 -2
- package/README/eng/README.md +1 -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 +1 -1
- package/README/ru/html/index.html +7 -7
- package/README.md +41 -18
- package/bin/cli.js +0 -0
- package/package.json +11 -10
- package/sbom.json +347 -77
- package/src/utils.js +2 -0
- package/templates/.claude/agents/doc-validator.md +2 -1
- package/templates/.claude/agents/product-discoverer.md +1 -1
- package/templates/.claude/commands/next.md +16 -0
- package/templates/.claude/commands/replicate.md +126 -8
- package/templates/.claude/commands/start.md +19 -1
- package/templates/.claude/hooks/autocommit-insights.cjs +95 -10
- package/templates/.claude/hooks/autocommit-plans.cjs +95 -10
- package/templates/.claude/hooks/autocommit-roadmap.cjs +96 -13
- package/templates/.claude/hooks/check-ports.cjs +232 -0
- package/templates/.claude/hooks/session-insights.cjs +13 -1
- package/templates/.claude/hooks/state-update.cjs +13 -1
- package/templates/.claude/hooks/statusline.cjs +145 -18
- package/templates/.claude/rules/docker-ports.md +123 -0
- package/templates/.claude/rules/replicate-pipeline.md +5 -2
- package/templates/.claude/settings.json +5 -5
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/01-detect-parse.md +57 -14
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/02-analyze-map.md +9 -7
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/enhanced-recommendations.md +6 -4
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/extended-mapping.md +2 -2
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-agents.md +2 -2
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-skills.md +1 -1
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/enhanced-claude-md.md +2 -2
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-suggestions.md +11 -2
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +1 -1
- package/templates/.claude/skills/goap-research-ed25519/SKILL.md +340 -47
- package/templates/.claude/skills/goap-research-ed25519/scripts/check_report_evidence.py +359 -3
- package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +386 -13
- package/templates/.claude/skills/goap-research-ed25519/scripts/fixture_legacy_v2_fact.json +23 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/fixtures_field_cases.json +133 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/goap_planner.py +314 -44
- package/templates/.claude/skills/goap-research-ed25519/scripts/learning_bridge.py +890 -303
- package/templates/.claude/skills/goap-research-ed25519/scripts/population_match.py +591 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/risk_statement.py +289 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_ed25519_verifier.py +57 -2
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_evidence_provenance.py +969 -344
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_goap_planner.py +420 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_population_match.py +544 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_risk_absolute.py +239 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_signature_v3.py +554 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_suite_completeness.py +90 -0
- package/templates/.claude/skills/requirements-validator/SKILL.md +7 -0
- package/templates/.claude/skills/requirements-validator/references/scoring-system.md +28 -0
- package/templates/.claude/skills/sparc-prd-mini/SKILL.md +143 -1
- package/tests/e2e/lifecycle.test.js +21 -10
- package/tests/snapshot/baseline.json +51 -34
- package/tests/snapshot/update-baseline.js +2 -1
- package/tests/unit/adr-decision-coverage.test.js +137 -0
- package/tests/unit/adr-scanner-contract.test.js +108 -0
- package/tests/unit/autocommit-deletion.test.js +242 -0
- package/tests/unit/check-ports.test.js +184 -0
- package/tests/unit/db-port-rule.test.js +216 -0
- package/tests/unit/detect-parse-anchor.test.js +109 -0
- package/tests/unit/external-dependency-check.test.js +209 -0
- package/tests/unit/growth-module-b2b-gate.test.js +104 -0
- package/tests/unit/hooks-project-anchored.test.js +223 -0
- package/tests/unit/hooks-report-failures.test.js +207 -0
- package/tests/unit/pipeline-file-ownership.test.js +95 -0
- package/tests/unit/roadmap-one-schema.test.js +179 -0
- package/tests/unit/sparc-reconciliation.test.js +117 -0
- package/tests/unit/spec-pseudocode-traceability.test.js +146 -0
- package/tests/unit/statusline-honest-labels.test.js +178 -0
- package/tests/unit/statusline-two-roots.test.js +237 -0
- package/tests/unit/sync-templates-guard.test.js +209 -0
- package/tests/unit/utils.test.js +2 -2
- package/tests/unit/validation-gate-teeth.test.js +158 -0
- package/LICENSE +0 -21
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Docker-порты: что смотрит наружу, а что нет
|
|
2
|
+
|
|
3
|
+
## Правило №0 — хранилище не публикуется в интернет
|
|
4
|
+
|
|
5
|
+
**Инвариант:** у хранилища НЕТ публикации на хост — кроме привязки к петле. Postgres, MySQL,
|
|
6
|
+
MariaDB, MongoDB, Redis, Elasticsearch/OpenSearch, MinIO, RabbitMQ, Memcached, ClickHouse.
|
|
7
|
+
|
|
8
|
+
Формулировка «не на все интерфейсы» была бы слишком узкой и пропускала бы половину случаев. Запрещено
|
|
9
|
+
всё это, а не только первое:
|
|
10
|
+
|
|
11
|
+
| Строка | Почему нарушение |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `"5432:5432"` | без адреса Docker привязывает ко ВСЕМ интерфейсам |
|
|
14
|
+
| `"0.0.0.0:5432:5432"` | то же самое, явно |
|
|
15
|
+
| `"[::]:5432:5432"` | IPv6-джокер — та же дыра, часто забывают |
|
|
16
|
+
| `"203.0.113.7:5432:5432"` | ОДИН явный публичный адрес: не «все интерфейсы», но из интернета доступно ровно так же |
|
|
17
|
+
| `network_mode: host` | публикации нет вовсе, а порт всё равно наружу: контейнер слушает прямо на хосте. Хранилищу этот режим не подходит |
|
|
18
|
+
|
|
19
|
+
Разрешено ровно два состояния: публикации нет, либо она привязана к петле (`127.0.0.1` или `::1`).
|
|
20
|
+
|
|
21
|
+
**Почему это правило №0, а не пожелание.** Тестовый Postgres, поднятый с `-p 55432:5432` и паролем
|
|
22
|
+
`postgres`, был взломан из интернета примерно за час: через `COPY … TO PROGRAM` на машину въехал
|
|
23
|
+
червь-майнер. Порт был открыт «на время отладки». Цена ошибки здесь — компрометация машины, а не
|
|
24
|
+
неудобство, поэтому правило безусловное.
|
|
25
|
+
|
|
26
|
+
## Что писать вместо
|
|
27
|
+
|
|
28
|
+
Достаточно **убрать `ports:` целиком**:
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
services:
|
|
32
|
+
db:
|
|
33
|
+
image: postgres:16
|
|
34
|
+
# никакого ports: — и это ПОЛНОЕ решение
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Соседи по сети compose достучатся до сервиса по его имени** (`db:5432`) без всякой публикации:
|
|
38
|
+
внутри сети видны все порты, которые контейнер слушает. Публикация нужна только для доступа С ХОСТА,
|
|
39
|
+
а не между контейнерами.
|
|
40
|
+
|
|
41
|
+
`expose:` в современном Compose ничего не открывает и ничего не требуется — это документирующая
|
|
42
|
+
запись, не более:
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
expose:
|
|
46
|
+
- "5432" # необязательно; читается как «этот сервис слушает 5432»
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Писать её можно, полагаться на неё как на «то, что включает доступ» — нельзя: доступ внутри сети есть
|
|
50
|
+
и без неё.
|
|
51
|
+
|
|
52
|
+
## Исключение: петля — это законно
|
|
53
|
+
|
|
54
|
+
Привязка к петлевому адресу разрешена и является нормальным способом поднять тестовое окружение,
|
|
55
|
+
где тесты идут с хоста:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
ports:
|
|
59
|
+
- "127.0.0.1:55432:5432" # ЗАКОННО: доступно только с самой машины
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Петлевых форм две и они равноправны: `127.0.0.1:` и `[::1]:`. Всё остальное — нарушение, включая
|
|
63
|
+
`0.0.0.0`, `[::]`, отсутствие адреса вообще и один явный внешний адрес. Docker показывает привязку
|
|
64
|
+
как `host_ip:`; «доступно мне» от «доступно всем» отличает именно она.
|
|
65
|
+
|
|
66
|
+
Правило без этого исключения запрещало бы ровно то, что предписывает сам конвейер, поэтому исключение
|
|
67
|
+
такая же часть правила, как и запрет.
|
|
68
|
+
|
|
69
|
+
## За reverse-proxy приложение тоже не публикуется
|
|
70
|
+
|
|
71
|
+
Если в compose есть `caddy`/`nginx`/`traefik`, то он и есть единственная дверь. Опубликованное рядом
|
|
72
|
+
приложение позволяет обойти прокси — а вместе с ним и всё, что прокси гарантирует: TLS,
|
|
73
|
+
rate-limiting, заголовки. Известный конкретный случай: код, доверяющий последнему элементу
|
|
74
|
+
`X-Forwarded-For`, потому что его дописывает прокси, при прямом доступе получает этот элемент от
|
|
75
|
+
клиента — и лимит обходится сменой заголовка.
|
|
76
|
+
|
|
77
|
+
## Чем это правило НЕ является
|
|
78
|
+
|
|
79
|
+
**Проверка теперь есть — но она не запускается сама.** В пакете отгружается
|
|
80
|
+
`.claude/hooks/check-ports.cjs`: он читает нормализованный конфиг (`docker compose config`) и
|
|
81
|
+
проверяет ровно этот инвариант, включая `network_mode: host` и обход reverse-proxy.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
node .claude/hooks/check-ports.cjs . # или путь к конкретному compose-файлу
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Коды возврата — три, и третий здесь главный: `0` правило соблюдено, `1` нарушено, **`2` проверка НЕ
|
|
88
|
+
ВЫПОЛНЕНА** (нет compose, нет docker, конфиг не читается). Проверка, которая на нечитаемом конфиге
|
|
89
|
+
отвечает «чисто», хуже отсутствия проверки: она превращает неизвестность в заверение.
|
|
90
|
+
|
|
91
|
+
**Чего она НЕ делает.** Она не привязана ни к какому событию — её надо позвать. Она смотрит на ВАШ
|
|
92
|
+
проект, а не на машину: конфликты с портами, уже занятыми другими контейнерами, она не ищет. И она
|
|
93
|
+
проверяет конфиг, а не запущенный стек.
|
|
94
|
+
|
|
95
|
+
Детерминированная проверка существует отдельно (`check-port-conflicts.sh`, «Правило №0») и в этот
|
|
96
|
+
пакет не входит. Причина: она на bash, а ХУКИ пакета принципиально на кросс-платформенном Node —
|
|
97
|
+
ради Windows, — и проверка портов по форме именно хук. (Точности ради: пара вспомогательных `.sh`
|
|
98
|
+
в пакете уже есть, внутри навыка `brutal-honesty-review`; обещание Node относится к хукам, а не ко
|
|
99
|
+
всему пакету.) Если проверка вам нужна, её надо взять и подключить осознанно.
|
|
100
|
+
|
|
101
|
+
Не выводите из присутствия этого правила, что кто-то за вас смотрит. Пока проверки нет, единственный
|
|
102
|
+
контроль — глаза на ревью, и знать об этом важнее, чем иметь правило.
|
|
103
|
+
|
|
104
|
+
## Быстрая самопроверка
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
docker compose config
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Смотреть надо весь нормализованный вывод, а не окно вокруг `published`: Docker печатает `host_ip`
|
|
111
|
+
отдельной строкой, и она не обязана попасть в фиксированные `-A2` — проверка по окну молча пропустит
|
|
112
|
+
нарушение.
|
|
113
|
+
|
|
114
|
+
Для каждого сервиса-хранилища ответьте на два вопроса:
|
|
115
|
+
|
|
116
|
+
1. есть ли у него `published:` (или `network_mode: host`)?
|
|
117
|
+
2. если есть — стоит ли рядом `host_ip: 127.0.0.1` либо `host_ip: ::1`?
|
|
118
|
+
|
|
119
|
+
«Да» на первый и «нет» на второй — нарушение правила №0. Обе петлевые формы равноправны: проверка
|
|
120
|
+
только по `127.0.0.1` отвергла бы `::1`, который это же правило разрешает.
|
|
121
|
+
|
|
122
|
+
Детерминированная версия этой проверки существует и разбирает вывод с отслеживанием состояния именно
|
|
123
|
+
потому, что построчного окна недостаточно.
|
|
@@ -121,6 +121,9 @@ Always pass these constraints to sparc-prd-mini (Phase 1):
|
|
|
121
121
|
- Infrastructure: VPS (AdminVPS/HOSTKEY)
|
|
122
122
|
- Deploy: Docker Compose direct deploy
|
|
123
123
|
- AI Integration: MCP servers
|
|
124
|
+
- Storage: у баз и очередей НЕТ публикации на хост — кроме привязки к петле (`127.0.0.1` / `::1`).
|
|
125
|
+
Ни `0.0.0.0`, ни `[::]`, ни один явный внешний адрес, ни `network_mode: host`
|
|
126
|
+
(см. `.claude/rules/docker-ports.md`, «Правило №0»)
|
|
124
127
|
|
|
125
128
|
## Git Discipline During Pipeline
|
|
126
129
|
|
|
@@ -148,8 +151,8 @@ are project-agnostic and can be enhanced (read by Phase 3) but never recreated.
|
|
|
148
151
|
**Agents (4):** `replicate-coordinator`, `product-discoverer`, `doc-validator`,
|
|
149
152
|
`harvest-coordinator`
|
|
150
153
|
|
|
151
|
-
**Rules (
|
|
152
|
-
`insights-capture`, `feature-lifecycle`
|
|
154
|
+
**Rules (6):** `replicate-pipeline`, `skill-interface-protocol`, `git-workflow`,
|
|
155
|
+
`insights-capture`, `feature-lifecycle`, `docker-ports`
|
|
153
156
|
|
|
154
157
|
**Hooks:** `.claude/settings.json` (SessionStart + Stop) + cross-platform Node
|
|
155
158
|
scripts in `.claude/hooks/` (`session-insights.cjs`, `autocommit-roadmap.cjs`,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"_comment": "Default hooks + statusline shipped by @dzhechkov/p-replicator init. Cross-platform Node scripts (no bash dependencies). Auto-commits roadmap/insights/plans on Stop, injects relevant insights on SessionStart. Statusline displays pipeline+roadmap+toolkit dashboard above the prompt. Project-specific hooks (DDD, fitness functions, etc.) are merged in by /replicate Phase 3.",
|
|
4
4
|
"statusLine": {
|
|
5
5
|
"type": "command",
|
|
6
|
-
"command": "node
|
|
6
|
+
"command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/statusline.cjs\""
|
|
7
7
|
},
|
|
8
8
|
"hooks": {
|
|
9
9
|
"SessionStart": [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"hooks": [
|
|
13
13
|
{
|
|
14
14
|
"type": "command",
|
|
15
|
-
"command": "node
|
|
15
|
+
"command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/session-insights.cjs\"",
|
|
16
16
|
"timeout": 5
|
|
17
17
|
}
|
|
18
18
|
]
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"hooks": [
|
|
25
25
|
{
|
|
26
26
|
"type": "command",
|
|
27
|
-
"command": "node
|
|
27
|
+
"command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/autocommit-roadmap.cjs\"",
|
|
28
28
|
"timeout": 10
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"type": "command",
|
|
32
|
-
"command": "node
|
|
32
|
+
"command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/autocommit-insights.cjs\"",
|
|
33
33
|
"timeout": 10
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"type": "command",
|
|
37
|
-
"command": "node
|
|
37
|
+
"command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/autocommit-plans.cjs\"",
|
|
38
38
|
"timeout": 10
|
|
39
39
|
}
|
|
40
40
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Module: Detect & Parse
|
|
2
2
|
|
|
3
3
|
Phase 1 of the CC-Toolkit-Generator Enhanced pipeline.
|
|
4
|
-
Scans the
|
|
4
|
+
Scans the PROJECT ROOT (see `docs_path` below — it is the root, not `docs/`), detects the pipeline type, identifies project
|
|
5
5
|
characteristics, and builds the Internal Project Model (IPM) used by all
|
|
6
6
|
subsequent modules.
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ subsequent modules.
|
|
|
11
11
|
|
|
12
12
|
| Parameter | Type | Description |
|
|
13
13
|
|-----------|------|-------------|
|
|
14
|
-
| `docs_path` | string |
|
|
14
|
+
| `docs_path` | string | The directory every probe below resolves from. In Claude.ai context: `/mnt/user-data/uploads/`. In Claude Code / replicate context: **the PROJECT ROOT** — not `docs/`. It has to be the root, because the probes reach both `.ai-context/` (a root-level directory, beside `.claude/`) and `docs/…` below it; anchoring at `docs/` would force `../` on half of them. |
|
|
15
15
|
|
|
16
16
|
No prior module output is required. This is the foundation module.
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@ Scan `docs_path` recursively and catalog every file by category.
|
|
|
25
25
|
|
|
26
26
|
```
|
|
27
27
|
SCAN docs_path FOR:
|
|
28
|
-
# SPARC pipeline files (
|
|
28
|
+
# SPARC pipeline files — under docs/ (replicate.md:233-243 writes them all there)
|
|
29
29
|
PRD.md
|
|
30
30
|
Solution_Strategy.md
|
|
31
31
|
Specification.md
|
|
@@ -41,7 +41,8 @@ SCAN docs_path FOR:
|
|
|
41
41
|
docs/prd/PRD.md
|
|
42
42
|
docs/ddd/strategic/ # bounded-contexts.md, context-map.md
|
|
43
43
|
docs/ddd/tactical/ # aggregates/, entities/, value-objects/, events/, repositories/
|
|
44
|
-
docs/adr/*.md # ADR-001-*.md, ADR-002-*.md, ...
|
|
44
|
+
docs/adr/*.md # ADR-001-*.md, ADR-002-*.md, ... (directory shape)
|
|
45
|
+
docs/ADR.md # single-file shape — /replicate writes ALL decisions here
|
|
45
46
|
docs/c4/*.mermaid # context.mermaid, container.mermaid, component.mermaid
|
|
46
47
|
docs/pseudocode/*.pseudo
|
|
47
48
|
docs/tests/*.feature # Gherkin scenarios
|
|
@@ -72,13 +73,18 @@ def detect_pipeline(docs_path: str) -> str:
|
|
|
72
73
|
has_ddd = exists(f"{docs_path}/docs/ddd/")
|
|
73
74
|
has_ai_context = exists(f"{docs_path}/.ai-context/")
|
|
74
75
|
has_gherkin = glob(f"{docs_path}/docs/tests/*.feature")
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
# Pipeline-IDENTITY marker: the docs/adr/ DIRECTORY is an idea2prd fingerprint. The
|
|
77
|
+
# expression is deliberately unchanged (>5) so routing stays byte-identical for every
|
|
78
|
+
# existing project. The DECISION-presence flag `has_adr` (see Collector below) never
|
|
79
|
+
# participates in routing: it can now be true via docs/ADR.md — a /replicate fingerprint,
|
|
80
|
+
# not an idea2prd one — and flipping routing on it would silently reroute SPARC projects.
|
|
81
|
+
has_idea2prd_adr_dir = len(glob(f"{docs_path}/docs/adr/*.md")) > 5
|
|
82
|
+
has_sparc_arch = exists(f"{docs_path}/docs/Architecture.md") # replicate.md:237 writes it here
|
|
83
|
+
has_sparc_sol = exists(f"{docs_path}/docs/Solution_Strategy.md") # replicate.md:234 writes it here
|
|
78
84
|
|
|
79
85
|
if has_ddd and has_ai_context:
|
|
80
86
|
return "IDEA2PRD_FULL" # Complete idea2prd-manual output
|
|
81
|
-
elif has_ddd or
|
|
87
|
+
elif has_ddd or has_idea2prd_adr_dir:
|
|
82
88
|
return "IDEA2PRD_PARTIAL" # Partial idea2prd output
|
|
83
89
|
elif has_sparc_arch and has_sparc_sol:
|
|
84
90
|
return "SPARC" # Full SPARC documentation set
|
|
@@ -88,12 +94,49 @@ def detect_pipeline(docs_path: str) -> str:
|
|
|
88
94
|
return "MINIMAL" # Basic PRD only, or mixed
|
|
89
95
|
```
|
|
90
96
|
|
|
97
|
+
### ADR collector — ONE normalizer for both storage shapes
|
|
98
|
+
|
|
99
|
+
ADRs arrive in two shapes: a `docs/adr/*.md` directory (idea2prd-manual, one decision per file) and
|
|
100
|
+
a single `docs/ADR.md` (what `/replicate` writes). ONE collector handles both; no other step in this
|
|
101
|
+
skill may glob ADR paths for itself — every consumer iterates `detected_docs.idea2prd.adrs`.
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
def collect_adrs(docs_path: str) -> list:
|
|
105
|
+
entries = []
|
|
106
|
+
for f in glob(f"{docs_path}/docs/adr/*.md"): # shape A: one decision per file
|
|
107
|
+
entries.append({ "id": id_from_filename(f), # ADR-001-title.md -> "ADR-001"
|
|
108
|
+
"title": first_heading(f),
|
|
109
|
+
"source_path": f })
|
|
110
|
+
single = f"{docs_path}/docs/ADR.md" # shape B: /replicate's single file
|
|
111
|
+
if exists(single):
|
|
112
|
+
for section in split_on_h2_headings(read(single)): # each "## ..." heading opens one decision
|
|
113
|
+
entries.append({ "id": id_from_heading(section), # "## ADR-003: X" -> "ADR-003"; else slug of title
|
|
114
|
+
"title": heading_title(section),
|
|
115
|
+
"source_path": single })
|
|
116
|
+
# STABLE-FIRST dedupe: keep the FIRST entry for a given id (falling back to title when an id is
|
|
117
|
+
# absent), and directory entries are appended first — so "directory wins" is a property of the
|
|
118
|
+
# ORDER above, not an unstated convention inside the helper.
|
|
119
|
+
return dedupe_stable_first_by_id_then_title(entries) # both shapes present -> merged, no double-count
|
|
120
|
+
|
|
121
|
+
has_adr = len(collect_adrs(docs_path)) > 0 # THE one definition — decisions, not files
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Worked examples (the behavioural contract, verbatim acid ids):
|
|
125
|
+
|
|
126
|
+
- **A1** — `docs/ADR.md` with two `##` sections ⇒ 2 entries, `has_adr: true`. The single-file shape
|
|
127
|
+
is a first-class citizen, not a fallback.
|
|
128
|
+
- **A4** — `docs/ADR.md` exists but holds prose with NO `##` headings ⇒ 0 entries,
|
|
129
|
+
`has_adr: false`. A file is not a decision; presence of the path never flips the flag by itself.
|
|
130
|
+
- **A5** — BOTH shapes present and `docs/adr/ADR-002-caching.md` duplicates the id of a `## ADR-002`
|
|
131
|
+
section ⇒ one merged list, the duplicate dropped (directory entry wins — it is the finer-grained
|
|
132
|
+
source).
|
|
133
|
+
|
|
91
134
|
| Pipeline | Minimum Docs | Typical File Count |
|
|
92
135
|
|----------|-------------|-------------------|
|
|
93
136
|
| IDEA2PRD_FULL | `docs/ddd/` + `.ai-context/` | 30-50 files |
|
|
94
137
|
| IDEA2PRD_PARTIAL | `docs/ddd/` or `docs/adr/` (>5) | 15-30 files |
|
|
95
|
-
| SPARC | `Architecture.md` + `Solution_Strategy.md` | 8-11 files |
|
|
96
|
-
| SPARC_MINIMAL | `Architecture.md` only | 2-5 files |
|
|
138
|
+
| SPARC | `docs/Architecture.md` + `docs/Solution_Strategy.md` | 8-11 files |
|
|
139
|
+
| SPARC_MINIMAL | `docs/Architecture.md` only | 2-5 files |
|
|
97
140
|
| MINIMAL | PRD.md only | 1-3 files |
|
|
98
141
|
|
|
99
142
|
### Step 3: Detect Project Characteristics
|
|
@@ -116,7 +159,7 @@ IF any keyword found → has_external_apis = true
|
|
|
116
159
|
#### 3b. `has_database`
|
|
117
160
|
|
|
118
161
|
```
|
|
119
|
-
SCAN Architecture.md, Specification.md, docker-compose.yml,
|
|
162
|
+
SCAN docs/Architecture.md, docs/Specification.md, docker-compose.yml (project root),
|
|
120
163
|
ADR-*-data.md, repositories/*.md FOR:
|
|
121
164
|
keywords: "PostgreSQL", "Postgres", "MongoDB", "MySQL", "Redis",
|
|
122
165
|
"database", "Prisma", "TypeORM", "Drizzle", "Knex",
|
|
@@ -185,7 +228,7 @@ IPM = {
|
|
|
185
228
|
events: [paths] | [],
|
|
186
229
|
repositories: [paths] | []
|
|
187
230
|
},
|
|
188
|
-
adrs: [
|
|
231
|
+
adrs: [{id, title, source_path}] | [], // collect_adrs() output — entries, not bare paths
|
|
189
232
|
c4_diagrams: [paths] | [],
|
|
190
233
|
pseudocode: [paths] | [],
|
|
191
234
|
gherkin_tests: [paths] | [],
|
|
@@ -217,7 +260,7 @@ IPM = {
|
|
|
217
260
|
has_ddd_strategic: bool, // same as has_ddd (alias for readability)
|
|
218
261
|
has_gherkin: bool, // detected_docs.idea2prd.gherkin_tests non-empty
|
|
219
262
|
has_fitness: bool, // detected_docs.idea2prd.fitness non-empty
|
|
220
|
-
has_adr: bool, //
|
|
263
|
+
has_adr: bool, // collect_adrs() output non-empty — the ONE definition (see ADR collector)
|
|
221
264
|
has_c4: bool, // detected_docs.idea2prd.c4 non-empty
|
|
222
265
|
has_ai_context: bool, // detected_docs.ai_context.readme non-null
|
|
223
266
|
has_pseudocode: bool, // detected_docs.sparc.pseudocode OR idea2prd.pseudocode non-null
|
|
@@ -291,7 +334,7 @@ All of the following must be satisfied before the IPM is considered valid:
|
|
|
291
334
|
|
|
292
335
|
| Check | Condition | Action on Failure |
|
|
293
336
|
|-------|-----------|-------------------|
|
|
294
|
-
| Minimum docs | SPARC: at least `PRD.md` + `Architecture.md` present | Halt. Ask user to upload missing docs. |
|
|
337
|
+
| Minimum docs | SPARC: at least `docs/PRD.md` + `docs/Architecture.md` present | Halt. Ask user to upload missing docs. |
|
|
295
338
|
| Minimum docs | idea2prd: at least `docs/ddd/` directory present | Halt. Ask user to upload missing docs. |
|
|
296
339
|
| Pipeline resolved | `pipeline_type` is not ambiguous | If mixed signals, default to "SPARC" with unified mapping. |
|
|
297
340
|
| Characteristics scanned | All 4 characteristic flags have been evaluated | Re-scan if any flag is missing. |
|
|
@@ -128,7 +128,9 @@ DDD TACTICAL:
|
|
|
128
128
|
- Event handlers → PostToolUse hooks (P2)
|
|
129
129
|
|
|
130
130
|
ADR DOCUMENTS:
|
|
131
|
-
|
|
131
|
+
# via detected_docs.idea2prd.adrs — the Module-1 collector output, BOTH storage
|
|
132
|
+
# shapes (docs/adr/*.md AND the single docs/ADR.md). Never glob ADR paths here.
|
|
133
|
+
FOR EACH entry IN detected_docs.idea2prd.adrs (read entry.source_path):
|
|
132
134
|
CLASSIFY by keywords:
|
|
133
135
|
"security", "auth", "encryption" → security.md rule
|
|
134
136
|
"performance", "scale", "cache" → performance rules
|
|
@@ -217,8 +219,8 @@ aggregates/ has >3 files → ddd-validator.md (+8), +5 if >7 files
|
|
|
217
219
|
aggregates/ has >5 files → aggregate-patterns/ (+5)
|
|
218
220
|
events/ has >3 files → event-handlers/ (+5)
|
|
219
221
|
events/ has >0 files → event-handlers/ (+10)
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
adrs has >10 decisions → architect.md (+10) # detected_docs.idea2prd.adrs — decisions, not files
|
|
223
|
+
adrs has >15 decisions → architect.md (+5 additional)
|
|
222
224
|
docs/tests/*.feature exists → testing-patterns/ (+10), tdd-guide.md (+8)
|
|
223
225
|
tests/ has >10 scenarios → testing-patterns/ (+5)
|
|
224
226
|
docs/fitness/ exists → fitness-functions.md (+10)
|
|
@@ -226,10 +228,10 @@ fitness has >5 functions → validation hooks (+5)
|
|
|
226
228
|
.ai-context/ exists → INTEGRATE into CLAUDE.md, project-context/ (+10)
|
|
227
229
|
.ai-context/ has >4 files → project-context/ RECOMMEND
|
|
228
230
|
|
|
229
|
-
# ADR Security Boost
|
|
230
|
-
FOR EACH adr
|
|
231
|
-
FOR EACH adr
|
|
232
|
-
FOR EACH adr
|
|
231
|
+
# ADR Security Boost (over detected_docs.idea2prd.adrs — read each entry.source_path)
|
|
232
|
+
FOR EACH adr entry containing "security": security.md += 2
|
|
233
|
+
FOR EACH adr entry containing "authentication": security.md += 1
|
|
234
|
+
FOR EACH adr entry containing "encryption": security.md += 1
|
|
233
235
|
```
|
|
234
236
|
|
|
235
237
|
#### 4c. Assign Priority Tiers
|
|
@@ -13,7 +13,9 @@ def detect_pipeline(uploads_path: str) -> str:
|
|
|
13
13
|
has_ddd = exists(f"{uploads_path}/docs/ddd/")
|
|
14
14
|
has_ai_context = exists(f"{uploads_path}/.ai-context/")
|
|
15
15
|
has_gherkin = glob(f"{uploads_path}/docs/tests/*.feature")
|
|
16
|
-
|
|
16
|
+
# Shape marker only (mirrors Module 1 detect_pipeline). The DECISION flag has_adr is
|
|
17
|
+
# defined ONCE, in Module 1 ADR collector — never redefined here.
|
|
18
|
+
has_idea2prd_adr_dir = len(glob(f"{uploads_path}/docs/adr/*.md")) > 5
|
|
17
19
|
has_sparc = exists(f"{uploads_path}/Architecture.md")
|
|
18
20
|
|
|
19
21
|
if has_ddd and has_ai_context:
|
|
@@ -124,7 +126,7 @@ if len(events) > 5:
|
|
|
124
126
|
```python
|
|
125
127
|
score = 10 # base (always somewhat useful)
|
|
126
128
|
|
|
127
|
-
adrs =
|
|
129
|
+
adrs = detected_docs.idea2prd.adrs # Module-1 collector: both storage shapes
|
|
128
130
|
if len(adrs) > 5:
|
|
129
131
|
score += 5
|
|
130
132
|
if len(adrs) > 10:
|
|
@@ -145,8 +147,8 @@ if exists("docs/c4/container.mermaid"):
|
|
|
145
147
|
```python
|
|
146
148
|
security_boost = 0
|
|
147
149
|
|
|
148
|
-
for adr in
|
|
149
|
-
content = read(adr)
|
|
150
|
+
for adr in detected_docs.idea2prd.adrs: # both storage shapes
|
|
151
|
+
content = read(adr.source_path)
|
|
150
152
|
if "security" in content.lower():
|
|
151
153
|
security_boost += 2
|
|
152
154
|
if "authentication" in content.lower():
|
package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/extended-mapping.md
CHANGED
|
@@ -211,7 +211,7 @@ EXTRACT events/*.md:
|
|
|
211
211
|
### From ADRs
|
|
212
212
|
|
|
213
213
|
```
|
|
214
|
-
FOR EACH
|
|
214
|
+
FOR EACH entry IN detected_docs.idea2prd.adrs (read entry.source_path):
|
|
215
215
|
EXTRACT:
|
|
216
216
|
- Title → Rule/skill name candidate
|
|
217
217
|
- Status → (if Accepted) include, (if Deprecated) exclude
|
|
@@ -348,7 +348,7 @@ IF fitness has architecture rules: +5 to ddd-validator
|
|
|
348
348
|
### From ADR Integration Decisions
|
|
349
349
|
|
|
350
350
|
```
|
|
351
|
-
SCAN
|
|
351
|
+
SCAN detected_docs.idea2prd.adrs (each entry.source_path) for:
|
|
352
352
|
- "GitHub" → @modelcontextprotocol/server-github
|
|
353
353
|
- "PostgreSQL", "Postgres" → @modelcontextprotocol/server-postgres
|
|
354
354
|
- "MongoDB" → @modelcontextprotocol/server-mongodb
|
package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-agents.md
CHANGED
|
@@ -425,7 +425,7 @@ APPROVE / REQUEST_CHANGES / COMMENT
|
|
|
425
425
|
- Context diagram summary
|
|
426
426
|
- Container descriptions
|
|
427
427
|
|
|
428
|
-
2. Extract from `docs/adr
|
|
428
|
+
2. Extract from `detected_docs.idea2prd.adrs` (docs/adr/*.md or the single docs/ADR.md):
|
|
429
429
|
- Top 5-10 most important ADRs
|
|
430
430
|
- Architecture-related decisions
|
|
431
431
|
|
|
@@ -448,7 +448,7 @@ APPROVE / REQUEST_CHANGES / COMMENT
|
|
|
448
448
|
1. Extract from `docs/fitness/`:
|
|
449
449
|
- All fitness functions as checklist
|
|
450
450
|
|
|
451
|
-
2. Extract from `docs/adr
|
|
451
|
+
2. Extract from `detected_docs.idea2prd.adrs` (docs/adr/*.md or the single docs/ADR.md):
|
|
452
452
|
- Key decisions affecting code
|
|
453
453
|
|
|
454
454
|
3. Extract from `docs/ddd/tactical/`:
|
package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-skills.md
CHANGED
|
@@ -345,6 +345,6 @@ src/
|
|
|
345
345
|
1. From `.ai-context/coding-standards.md`:
|
|
346
346
|
- Direct integration
|
|
347
347
|
|
|
348
|
-
2. From `docs/adr
|
|
348
|
+
2. From `detected_docs.idea2prd.adrs` (docs/adr/*.md or the single docs/ADR.md):
|
|
349
349
|
- Extract coding-related decisions
|
|
350
350
|
- Extract rejected alternatives as anti-patterns
|
|
@@ -188,9 +188,9 @@ If specific .ai-context file missing, extract from:
|
|
|
188
188
|
|---------|----------------|------------------|
|
|
189
189
|
| Overview | docs/prd/PRD.md | Research_Findings.md |
|
|
190
190
|
| Architecture | docs/c4/*.mermaid | Architecture.md |
|
|
191
|
-
| Key Decisions | docs/adr/*.md | Solution_Strategy.md |
|
|
191
|
+
| Key Decisions | detected_docs.idea2prd.adrs (docs/adr/*.md or docs/ADR.md) | Solution_Strategy.md |
|
|
192
192
|
| Domain Model | docs/ddd/strategic/ | Specification.md |
|
|
193
|
-
| Tech Stack |
|
|
193
|
+
| Tech Stack | adrs entries titled *technology* | Architecture.md |
|
|
194
194
|
| Testing | docs/tests/*.feature | Refinement.md |
|
|
195
195
|
| Deployment | docs/completion/ | Completion.md |
|
|
196
196
|
|
|
@@ -4,13 +4,21 @@ Templates for generating a feature navigation and contextual suggestion system.
|
|
|
4
4
|
Combines CLAUDE.md roadmap, SessionStart hook for dynamic context, `/next` command,
|
|
5
5
|
and `feature-navigator` skill for on-demand roadmap navigation.
|
|
6
6
|
|
|
7
|
-
Architecture: **feature-roadmap.json** as single
|
|
7
|
+
Architecture: **feature-roadmap.json** as the system's single data file → consumed by hook, skill,
|
|
8
|
+
and command. (The SCHEMA of that file is defined once, in `.claude/commands/next.md`; this document
|
|
9
|
+
describes the system built on it, not the file's fields.)
|
|
8
10
|
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
## 1. Data File Template: `feature-roadmap.json`
|
|
12
14
|
|
|
13
|
-
Generate as `.claude/feature-roadmap.json` — pre-populate from project's PRD/Specification
|
|
15
|
+
Generate as `.claude/feature-roadmap.json` — pre-populate from project's PRD/Specification.
|
|
16
|
+
|
|
17
|
+
**Fields: follow `.claude/commands/next.md`, which holds the single schema.** In particular every
|
|
18
|
+
feature carries `priority` from the closed set `mvp | high | medium | low`; a roadmap without it
|
|
19
|
+
cannot be read by the shipped status line. The sketch below shows only the ENVELOPE and this system's
|
|
20
|
+
OPTIONAL extensions — `project`, `current_sprint`, `description`, `sprint`, `files` — which the
|
|
21
|
+
canonical schema does not forbid:
|
|
14
22
|
|
|
15
23
|
```json
|
|
16
24
|
{
|
|
@@ -21,6 +29,7 @@ Generate as `.claude/feature-roadmap.json` — pre-populate from project's PRD/S
|
|
|
21
29
|
"id": "{{feature-id}}",
|
|
22
30
|
"name": "{{Feature Name}}",
|
|
23
31
|
"description": "{{Brief description of the feature}}",
|
|
32
|
+
"priority": "mvp|high|medium|low",
|
|
24
33
|
"status": "done|in_progress|next|planned|blocked",
|
|
25
34
|
"files": ["src/path/to/main-file.ts"],
|
|
26
35
|
"depends_on": ["{{other-feature-id}}"],
|
package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md
CHANGED
|
@@ -139,7 +139,7 @@ List ALL documentation files the /start should read.
|
|
|
139
139
|
```markdown
|
|
140
140
|
- `docs/ddd/strategic/` → bounded contexts, context map
|
|
141
141
|
- `docs/ddd/tactical/` → aggregates, entities, events
|
|
142
|
-
- `docs/adr
|
|
142
|
+
- `detected_docs.idea2prd.adrs` (docs/adr/ or docs/ADR.md) → technology decisions
|
|
143
143
|
- `docs/tests/*.feature` → Gherkin test scenarios
|
|
144
144
|
```
|
|
145
145
|
|