spec-runner 1.1.13 → 1.1.17
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/bin/spec-runner-installer.js +63 -0
- package/package.json +1 -1
- package/spec-runner/templates/.claude/agents/design-reviewer.md +8 -8
- package/spec-runner/templates/.claude/agents/impact-analyzer.md +35 -11
- package/spec-runner/templates/.claude/rules/coding.md +11 -0
- package/spec-runner/templates/.claude/rules/design-docs.md +52 -18
- package/spec-runner/templates/.claude/rules/harness-formats.md +93 -0
- package/spec-runner/templates/.claude/settings.json +15 -0
- package/spec-runner/templates/.claude/skills/architecture-definition/SKILL.md +43 -15
- package/spec-runner/templates/.claude/skills/architecture-skill-development/SKILL.md +26 -21
- package/spec-runner/templates/.claude/skills/design-change/SKILL.md +14 -12
- package/spec-runner/templates/.claude/skills/design-change/templates/90_ADR/ADR/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -32
- package/spec-runner/templates/.claude/skills/docs-driven-seed/SKILL.md +127 -0
- package/spec-runner/templates/.claude/skills/docs-driven-seed/templates/01_/350/246/201/344/273/266/345/256/232/347/276/251//343/203/246/343/203/223/343/202/255/343/202/277/343/202/271/350/250/200/350/252/236/350/276/236/346/233/270.md +15 -0
- package/spec-runner/templates/.claude/skills/docs-driven-seed/templates/01_/350/246/201/344/273/266/345/256/232/347/276/251//350/246/201/344/273/266/345/256/232/347/276/251.md +34 -0
- package/spec-runner/templates/.claude/skills/docs-driven-seed/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/202/267/343/202/271/343/203/206/343/203/240/345/205/250/344/275/223/344/277/257/347/236/260.md +33 -0
- package/spec-runner/templates/.claude/skills/docs-driven-seed/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/203/211/343/203/241/343/202/244/343/203/263/343/203/242/343/203/207/343/203/253.md +32 -0
- package/spec-runner/templates/.claude/skills/docs-driven-seed/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/344/270/200/350/246/247.md +15 -0
- package/spec-runner/templates/.claude/skills/docs-driven-seed/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/01_/343/203/211/343/203/241/343/202/244/343/203/263/{/343/203/211/343/203/241/343/202/244/343/203/263/345/220/215}.md +56 -0
- package/spec-runner/templates/.claude/skills/docs-driven-seed/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/02_/343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/UC-{/346/227/245/346/234/254/350/252/236/345/220/215}.md +55 -0
- package/spec-runner/templates/.claude/skills/existing-project-to-docs/SKILL.md +12 -9
- package/spec-runner/templates/.claude/skills/harness-engineering/SKILL.md +4 -0
- package/spec-runner/templates/.claude/skills/simple-seed/SKILL.md +105 -0
- package/spec-runner/templates/.claude/skills/simple-seed/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/01_/343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/UC-{/346/227/245/346/234/254/350/252/236/345/220/215}.md +53 -0
- package/spec-runner/templates/.claude/skills/test-driven-development/SKILL.md +104 -7
- package/spec-runner/templates/.github/agents/design-reviewer.agent.md +8 -8
- package/spec-runner/templates/.github/agents/impact-analyzer.agent.md +35 -11
- package/spec-runner/templates/.github/instructions/coding.instructions.md +11 -0
- package/spec-runner/templates/.github/instructions/design-docs.instructions.md +52 -18
- package/spec-runner/templates/.github/instructions/harness-formats.instructions.md +87 -0
- package/spec-runner/templates/.github/skills/architecture-definition/SKILL.md +43 -15
- package/spec-runner/templates/.github/skills/architecture-skill-development/SKILL.md +26 -21
- package/spec-runner/templates/.github/skills/design-change/SKILL.md +14 -12
- package/spec-runner/templates/.github/skills/design-change/templates/90_ADR/ADR/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -32
- package/spec-runner/templates/.github/skills/docs-driven-seed/SKILL.md +127 -0
- package/spec-runner/templates/.github/skills/docs-driven-seed/templates/01_/350/246/201/344/273/266/345/256/232/347/276/251//343/203/246/343/203/223/343/202/255/343/202/277/343/202/271/350/250/200/350/252/236/350/276/236/346/233/270.md +15 -0
- package/spec-runner/templates/.github/skills/docs-driven-seed/templates/01_/350/246/201/344/273/266/345/256/232/347/276/251//350/246/201/344/273/266/345/256/232/347/276/251.md +34 -0
- package/spec-runner/templates/.github/skills/docs-driven-seed/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/202/267/343/202/271/343/203/206/343/203/240/345/205/250/344/275/223/344/277/257/347/236/260.md +33 -0
- package/spec-runner/templates/.github/skills/docs-driven-seed/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/203/211/343/203/241/343/202/244/343/203/263/343/203/242/343/203/207/343/203/253.md +32 -0
- package/spec-runner/templates/.github/skills/docs-driven-seed/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/344/270/200/350/246/247.md +15 -0
- package/spec-runner/templates/.github/skills/docs-driven-seed/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/01_/343/203/211/343/203/241/343/202/244/343/203/263/{/343/203/211/343/203/241/343/202/244/343/203/263/345/220/215}.md +56 -0
- package/spec-runner/templates/.github/skills/docs-driven-seed/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/02_/343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/UC-{/346/227/245/346/234/254/350/252/236/345/220/215}.md +55 -0
- package/spec-runner/templates/.github/skills/existing-project-to-docs/SKILL.md +12 -9
- package/spec-runner/templates/.github/skills/harness-engineering/SKILL.md +4 -0
- package/spec-runner/templates/.github/skills/simple-seed/SKILL.md +105 -0
- package/spec-runner/templates/.github/skills/simple-seed/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/01_/343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/UC-{/346/227/245/346/234/254/350/252/236/345/220/215}.md +53 -0
- package/spec-runner/templates/.github/skills/test-driven-development/SKILL.md +104 -7
- package/spec-runner/templates/.spec-runner/scripts/scan.js +156 -0
- package/spec-runner/templates/.claude/skills/plugin-development/SKILL.md +0 -173
- package/spec-runner/templates/.claude/skills/plugin-development/templates/01_/350/246/201/344/273/266/345/256/232/347/276/251//346/246/202/350/246/201/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -88
- package/spec-runner/templates/.claude/skills/plugin-development/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210/90_ADR/ADR/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -81
- package/spec-runner/templates/.claude/skills/plugin-development/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/202/267/343/202/271/343/203/206/343/203/240/345/205/250/344/275/223/344/277/257/347/236/260/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -80
- package/spec-runner/templates/.claude/skills/plugin-development/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/344/270/200/350/246/247/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -57
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/aws.md +0 -53
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/database.md +0 -54
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/schema.dbml +0 -25
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/sequence//343/202/267/343/203/274/343/202/261/343/203/263/343/202/271/345/233/263/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -28
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/agent.md +0 -56
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/config.md +0 -47
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/domain.md +0 -67
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/prompts.md +0 -72
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/plugins/skills/{skill_name}/skill.md +0 -53
- package/spec-runner/templates/.claude/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/plugins/tools/{tool_name}/tool.md +0 -51
- package/spec-runner/templates/.github/skills/plugin-development/SKILL.md +0 -173
- package/spec-runner/templates/.github/skills/plugin-development/templates/01_/350/246/201/344/273/266/345/256/232/347/276/251//346/246/202/350/246/201/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -88
- package/spec-runner/templates/.github/skills/plugin-development/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210/90_ADR/ADR/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -81
- package/spec-runner/templates/.github/skills/plugin-development/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/202/267/343/202/271/343/203/206/343/203/240/345/205/250/344/275/223/344/277/257/347/236/260/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -80
- package/spec-runner/templates/.github/skills/plugin-development/templates/02_/346/246/202/350/246/201/350/250/255/350/250/210//343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/344/270/200/350/246/247/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -57
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/aws.md +0 -53
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/database.md +0 -54
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/schema.dbml +0 -25
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/infrastructure/sequence//343/202/267/343/203/274/343/202/261/343/203/263/343/202/271/345/233/263/343/203/206/343/203/263/343/203/227/343/203/254/343/203/274/343/203/210.md +0 -28
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/agent.md +0 -56
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/config.md +0 -47
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/domain.md +0 -67
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/agents/{agent_name}/prompts.md +0 -72
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/plugins/skills/{skill_name}/skill.md +0 -53
- package/spec-runner/templates/.github/skills/plugin-development/templates/03_/350/251/263/347/264/260/350/250/255/350/250/210/src/plugins/tools/{tool_name}/tool.md +0 -51
|
@@ -100,6 +100,55 @@ function filesEqual(a, b) {
|
|
|
100
100
|
return bufA.equals(bufB);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
function mergeJsonDeep(base, override) {
|
|
104
|
+
const result = { ...base };
|
|
105
|
+
for (const [key, val] of Object.entries(override)) {
|
|
106
|
+
if (Array.isArray(val) && Array.isArray(result[key])) {
|
|
107
|
+
// 配列は重複を避けてマージ
|
|
108
|
+
const existing = result[key].map((item) => JSON.stringify(item));
|
|
109
|
+
const additions = val.filter((item) => !existing.includes(JSON.stringify(item)));
|
|
110
|
+
result[key] = [...result[key], ...additions];
|
|
111
|
+
} else if (val && typeof val === "object" && result[key] && typeof result[key] === "object") {
|
|
112
|
+
result[key] = mergeJsonDeep(result[key], val);
|
|
113
|
+
} else {
|
|
114
|
+
result[key] = val;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function copySettingsJsonWithMerge(src, dest, archiveRoot) {
|
|
121
|
+
if (!exists(dest)) {
|
|
122
|
+
writeFileText(dest, readFileText(src));
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
let existing, incoming;
|
|
126
|
+
try {
|
|
127
|
+
existing = JSON.parse(readFileText(dest));
|
|
128
|
+
incoming = JSON.parse(readFileText(src));
|
|
129
|
+
} catch {
|
|
130
|
+
// JSON パース失敗時は通常の copyFileWithPolicy にフォールバック
|
|
131
|
+
copyFileWithPolicy(src, dest, archiveRoot);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const merged = mergeJsonDeep(existing, incoming);
|
|
135
|
+
if (JSON.stringify(merged) === JSON.stringify(existing)) return; // 変更なし
|
|
136
|
+
if (FORCE && archiveRoot) {
|
|
137
|
+
const ap = archivePathFor(dest, archiveRoot);
|
|
138
|
+
ensureDir(path.dirname(ap));
|
|
139
|
+
fs.copyFileSync(dest, ap);
|
|
140
|
+
}
|
|
141
|
+
writeFileText(dest, JSON.stringify(merged, null, 2) + "\n");
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function appendToGitignore(lines, dest) {
|
|
145
|
+
let content = exists(dest) ? readFileText(dest) : "";
|
|
146
|
+
const additions = lines.filter((line) => !content.split("\n").includes(line));
|
|
147
|
+
if (additions.length === 0) return;
|
|
148
|
+
const sep = content === "" || content.endsWith("\n") ? "" : "\n";
|
|
149
|
+
writeFileText(dest, content + sep + additions.join("\n") + "\n");
|
|
150
|
+
}
|
|
151
|
+
|
|
103
152
|
function normalizeTarget(t) {
|
|
104
153
|
if (!t) return "";
|
|
105
154
|
const x = String(t).trim().toLowerCase();
|
|
@@ -247,6 +296,11 @@ function mirrorTreeTo(destRootDir, templateDir, archiveRoot) {
|
|
|
247
296
|
walkFiles(templateDir, (srcFile) => {
|
|
248
297
|
const rel = path.relative(templateDir, srcFile);
|
|
249
298
|
const destFile = path.join(destRootDir, rel);
|
|
299
|
+
// settings.json は上書きではなくマージ
|
|
300
|
+
if (path.basename(srcFile) === "settings.json") {
|
|
301
|
+
copySettingsJsonWithMerge(srcFile, destFile, archiveRoot);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
250
304
|
copyFileWithPolicy(srcFile, destFile, archiveRoot);
|
|
251
305
|
});
|
|
252
306
|
}
|
|
@@ -381,6 +435,15 @@ function main() {
|
|
|
381
435
|
copyFileWithPolicy(claudeMdSrc, path.join(CWD, "CLAUDE.md"), archiveRoot);
|
|
382
436
|
}
|
|
383
437
|
|
|
438
|
+
// .spec-runner/scripts を導入(target によらず常に配置)
|
|
439
|
+
const specRunnerTemplateDir = path.join(TEMPLATE_ROOT, ".spec-runner");
|
|
440
|
+
if (exists(specRunnerTemplateDir)) {
|
|
441
|
+
mirrorTreeTo(path.join(CWD, ".spec-runner"), specRunnerTemplateDir, archiveRoot);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// .gitignore に scan キャッシュを追記
|
|
445
|
+
appendToGitignore([".spec-runner/scan/"], path.join(CWD, ".gitignore"));
|
|
446
|
+
|
|
384
447
|
console.log("");
|
|
385
448
|
if (target === "claude" || target === "both") {
|
|
386
449
|
mirrorTreeTo(DEST_CLAUDE_DIR, CLAUDE_TEMPLATE_DIR, archiveRoot);
|
package/package.json
CHANGED
|
@@ -11,12 +11,12 @@ docs/ 配下の設計書と src/ 配下の実装コードを突合し、乖離
|
|
|
11
11
|
|
|
12
12
|
## 手順
|
|
13
13
|
|
|
14
|
-
1. docs
|
|
14
|
+
1. `docs/` 配下の設計書ファイルを一覧取得する
|
|
15
15
|
2. 各設計書の frontmatter を読み、`spec_runner.node_id` / `kind` / `depends_on` / `maps_to` を確認する
|
|
16
|
-
3. `docs/02_概要設計/**`
|
|
17
|
-
4. `docs/03_
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
3. `docs/02_概要設計/**` の各ファイルを読む。ユースケース・責務・外部 IF が実装に反映されているか確認するために、`maps_to` から対応する `src/` ファイルを特定して実際に読んで比較する
|
|
17
|
+
4. `docs/03_詳細設計/**` の各ファイルを読む。`maps_to` に列挙された `src/` / `tests/` ファイルを**実際に読み**、責務・入出力・判断条件・テスト観点を設計書と行レベルで比較する
|
|
18
|
+
- `maps_to` が空または未設定の場合はフロントマターの問題として報告する(パス推定は行わない)
|
|
19
|
+
5. 乖離を報告する
|
|
20
20
|
|
|
21
21
|
## チェック項目
|
|
22
22
|
|
|
@@ -28,13 +28,13 @@ docs/ 配下の設計書と src/ 配下の実装コードを突合し、乖離
|
|
|
28
28
|
|
|
29
29
|
### 概要設計
|
|
30
30
|
|
|
31
|
-
- **ユースケース整合**: `ユースケース一覧.md`
|
|
31
|
+
- **ユースケース整合**: `ユースケース一覧.md` の各 UC が実装のエンドポイント・コマンド・画面遷移と一致しているか
|
|
32
32
|
- **全体俯瞰**: `システム全体俯瞰.md` の責務分割・連携フロー・外部 IF が実装構造と一致しているか
|
|
33
33
|
- **ADR 反映**: `docs/02_概要設計/90_ADR/**` の採用方針が概要設計・詳細設計に反映されているか
|
|
34
34
|
|
|
35
35
|
### 詳細設計
|
|
36
36
|
|
|
37
|
-
- **責務整合**: `docs/03_
|
|
37
|
+
- **責務整合**: `docs/03_詳細設計/**` の責務記述が `maps_to` 先コードの責務と一致しているか
|
|
38
38
|
- **入出力整合**: 関数シグネチャ、設定値、エラー処理、外部依存の扱いが設計どおりか
|
|
39
39
|
- **テスト整合**: `maps_to` に含まれる `tests/**` が設計上の主要シナリオをカバーしているか
|
|
40
40
|
- **不足 / 過剰**: 設計書にあるがコードにない、またはコードにあるが設計書にない要素があるか
|
|
@@ -62,4 +62,4 @@ docs/ 配下の設計書と src/ 配下の実装コードを突合し、乖離
|
|
|
62
62
|
- 読み取り専用(コードや設計書の変更は行わない)
|
|
63
63
|
- 日本語で報告する
|
|
64
64
|
- ADR はコードと 1 対 1 の突合対象ではないが、配置先と反映有無は確認する
|
|
65
|
-
-
|
|
65
|
+
- `maps_to` を唯一の参照先とする。パス推定は行わない
|
|
@@ -1,25 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: impact-analyzer
|
|
3
|
-
description: design-change で影響範囲を調査するときに呼ぶ。変更対象の node_id
|
|
4
|
-
tools:
|
|
3
|
+
description: design-change で影響範囲を調査するときに呼ぶ。変更対象の node_id またはファイルパスを受け取り、.spec-runner/scan/graph.json のキャッシュを参照して影響ファイルを一覧化し、maps_to の参照整合性も報告する。
|
|
4
|
+
tools: Bash
|
|
5
5
|
model: sonnet
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# 影響範囲分析エージェント
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
`.spec-runner/scan/graph.json`(`scan.js` が生成するキャッシュ)を読み、変更対象の node_id から連鎖する影響ファイルを一覧化する。
|
|
11
11
|
|
|
12
12
|
## 入力
|
|
13
13
|
|
|
14
|
-
- 変更対象の `node_id`(例: `usecase.order_registration`)またはファイルパス
|
|
14
|
+
- 変更対象の `node_id`(例: `detail.usecase.order_registration`)またはファイルパス
|
|
15
15
|
|
|
16
16
|
## 手順
|
|
17
17
|
|
|
18
|
-
1.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
### 1. グラフキャッシュの確認・更新
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
node .spec-runner/scripts/scan.js
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
キャッシュが古い場合や存在しない場合は再生成する。
|
|
25
|
+
|
|
26
|
+
### 2. 影響範囲をグラフから取得
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
node -e "
|
|
30
|
+
const g = require('./.spec-runner/scan/graph.json');
|
|
31
|
+
const id = '{node_id}';
|
|
32
|
+
const node = g.nodes[id] || {};
|
|
33
|
+
const direct = g.reverse_index[id] || [];
|
|
34
|
+
const indirect = [...new Set(
|
|
35
|
+
direct.flatMap(n => g.reverse_index[n] || []).filter(n => !direct.includes(n) && n !== id)
|
|
36
|
+
)];
|
|
37
|
+
console.log(JSON.stringify({ node, direct: direct.map(n => ({id: n, ...g.nodes[n]})), indirect: indirect.map(n => ({id: n, ...g.nodes[n]})), missing: g.missing_maps_to }, null, 2));
|
|
38
|
+
"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 3. 結果を一覧化して報告する
|
|
23
42
|
|
|
24
43
|
## 報告フォーマット
|
|
25
44
|
|
|
@@ -29,8 +48,9 @@ model: sonnet
|
|
|
29
48
|
### 起点
|
|
30
49
|
- node_id: {node_id}
|
|
31
50
|
- ファイル: {ファイルパス}
|
|
51
|
+
- kind: {kind}
|
|
32
52
|
|
|
33
|
-
### 直接影響(
|
|
53
|
+
### 直接影響(1階層目)
|
|
34
54
|
- [ファイルパス] — node_id: {node_id}, kind: {kind}
|
|
35
55
|
|
|
36
56
|
### 間接影響(2階層目)
|
|
@@ -39,6 +59,10 @@ model: sonnet
|
|
|
39
59
|
### 実装影響(maps_to で対応)
|
|
40
60
|
- [src/ または tests/ のファイルパス]
|
|
41
61
|
|
|
62
|
+
### maps_to 整合性チェック
|
|
63
|
+
- OK: 全参照ファイルが存在する
|
|
64
|
+
- MISSING: {missing} — {source} ({node_id}) に記載されているが存在しない
|
|
65
|
+
|
|
42
66
|
### 影響なし(確認済みで変更不要)
|
|
43
67
|
- [ファイルパス] — 理由: {理由}
|
|
44
68
|
```
|
|
@@ -47,5 +71,5 @@ model: sonnet
|
|
|
47
71
|
|
|
48
72
|
- 読み取り専用(ファイルの変更は行わない)
|
|
49
73
|
- 日本語で報告する
|
|
50
|
-
-
|
|
74
|
+
- graph.json が存在しない場合は scan.js を実行してから進む
|
|
51
75
|
- 影響ファイルが多い場合は kind 別にグループ化する
|
|
@@ -24,6 +24,7 @@ paths: ["src/**", "tests/**"]
|
|
|
24
24
|
- **言語**: 日本語
|
|
25
25
|
- **docstring**: モジュール先頭に1行で概要を書く。関数・クラスには原則不要(名前で意図が伝わる場合)
|
|
26
26
|
- **インラインコメント**: ビジネスロジックの「なぜ」を説明する場合のみ。処理内容の「何」は書かない
|
|
27
|
+
- **変更履歴コメント禁止**: `# 新機能追加`, `# ここを修正`, `# v2 で変更` のような変更経緯はコードに書かない。git の commit message で管理する
|
|
27
28
|
|
|
28
29
|
```python
|
|
29
30
|
# 良い例
|
|
@@ -89,6 +90,16 @@ truncated_json = '[{"account_name": "売掛金", ...'
|
|
|
89
90
|
|
|
90
91
|
- **英語コメント禁止**: `Arrange` / `Act` / `Assert` 等の英語は使わない
|
|
91
92
|
|
|
93
|
+
## 後方互換ハックの禁止
|
|
94
|
+
|
|
95
|
+
使われなくなったコードは完全に削除する。互換性維持のための温存は行わない。
|
|
96
|
+
|
|
97
|
+
禁止パターン:
|
|
98
|
+
- 未使用の引数・変数を `_` プレフィックスで残す(`_old_param`)
|
|
99
|
+
- 削除した型・関数を `from x import Y` で再公開する
|
|
100
|
+
- `# removed`, `# deprecated`, `# 旧実装` コメントとともにコードを残す
|
|
101
|
+
- 後方互換用のラッパー関数・エイリアスを追加する
|
|
102
|
+
|
|
92
103
|
## 検索ルール
|
|
93
104
|
|
|
94
105
|
- コードの検索・置換は `src/` と `tests/` の両方を対象にする
|
|
@@ -20,44 +20,78 @@ paths: ["docs/**"]
|
|
|
20
20
|
- **`docs/**` の全設計書に frontmatter を付ける**
|
|
21
21
|
- 正本の必須項目は `spec_runner.node_id` / `spec_runner.kind` / `spec_runner.depends_on` / `spec_runner.maps_to`
|
|
22
22
|
- `depends_on` はまず文字列配列でよい。依存理由が必要な場合のみオブジェクト形式を使う
|
|
23
|
-
- `maps_to` には見直し対象となる `src/` / `tests/` / IaC /
|
|
23
|
+
- `maps_to` には見直し対象となる `src/` / `tests/` / IaC / 設定ファイルを列挙する。**必ず設定する(空にしない)**。ただし ADR は決定の記録であり実装トレーサビリティの連鎖に乗らないため `depends_on` / `maps_to` は不要。ADR の frontmatter は `node_id` と `kind` のみ
|
|
24
24
|
- `modules` / `source_files` などの拡張項目を足す場合でも、`maps_to` と矛盾させない
|
|
25
25
|
|
|
26
26
|
```yaml
|
|
27
27
|
---
|
|
28
28
|
spec_runner:
|
|
29
|
-
node_id: detail.
|
|
29
|
+
node_id: detail.usecase.注文確定
|
|
30
30
|
kind: detailed_design
|
|
31
31
|
depends_on:
|
|
32
|
-
- overview.
|
|
33
|
-
-
|
|
32
|
+
- overview.use_case_list
|
|
33
|
+
- detail.domain.注文
|
|
34
34
|
maps_to:
|
|
35
|
-
- src/
|
|
36
|
-
-
|
|
35
|
+
- src/application/order/confirm.py
|
|
36
|
+
- src/domain/order/aggregate.py
|
|
37
|
+
- tests/application/order/test_confirm.py
|
|
37
38
|
---
|
|
38
39
|
```
|
|
39
40
|
|
|
41
|
+
### node_id 体系
|
|
42
|
+
|
|
43
|
+
| 対象 | node_id 形式 | 例 |
|
|
44
|
+
|------|-------------|-----|
|
|
45
|
+
| 要件定義 | `requirement.{名前}` | `requirement.要件定義` |
|
|
46
|
+
| システム全体俯瞰 | `overview.system_context` | — |
|
|
47
|
+
| ドメインモデル | `overview.domain_model` | — |
|
|
48
|
+
| ユースケース一覧 | `overview.use_case_list` | — |
|
|
49
|
+
| ADR | `overview.adr.{slug}` | `overview.adr.0404-ドメイン-注文集約` |
|
|
50
|
+
| ドメイン詳細設計 | `detail.domain.{ドメイン名}` | `detail.domain.注文` |
|
|
51
|
+
| UC 詳細設計 | `detail.usecase.{UC名}` | `detail.usecase.注文確定` |
|
|
52
|
+
| DB・外部サービス | `detail.db.{名前}` | `detail.db.スキーマ定義` |
|
|
53
|
+
|
|
40
54
|
## 命名規則
|
|
41
55
|
|
|
42
56
|
| 対象 | 規則 | 例 |
|
|
43
57
|
|------|------|-----|
|
|
44
|
-
| `docs/01_要件定義` | 日本語 | `要件定義.md` |
|
|
45
|
-
| `docs/02_概要設計` | 日本語 | `ユースケース一覧.md`, `システム全体俯瞰.md` |
|
|
46
|
-
| `docs/02_
|
|
47
|
-
| `
|
|
48
|
-
| `docs/03_詳細設計/
|
|
49
|
-
| `docs/03_詳細設計/
|
|
58
|
+
| `docs/01_要件定義` | 日本語 | `要件定義.md`, `ユビキタス言語辞書.md` |
|
|
59
|
+
| `docs/02_概要設計` | 日本語 | `ユースケース一覧.md`, `システム全体俯瞰.md`, `ドメインモデル.md` |
|
|
60
|
+
| `docs/02_概要設計/90_ADR/{対象}/` | `mmdd-{日本語タイトル}.md` | `0404-注文集約の設計.md` |
|
|
61
|
+
| `{対象}` の選択肢 | `全体` / `ドメイン` / `UC` / `DB` | — |
|
|
62
|
+
| `docs/03_詳細設計/01_ドメイン` | 日本語 | `注文.md`, `在庫.md` |
|
|
63
|
+
| `docs/03_詳細設計/02_ユースケース` | `UC-{日本語名}.md` | `UC-注文確定.md` |
|
|
64
|
+
| `docs/03_詳細設計/03_DB・外部サービス` | 日本語 | `スキーマ定義.dbml`, `外部サービス.md` |
|
|
50
65
|
|
|
51
66
|
## ADR
|
|
52
67
|
|
|
53
|
-
- **ADR
|
|
54
|
-
- ADR
|
|
55
|
-
-
|
|
68
|
+
- **ADR は提案時に必ず 3 案を比較してから採用案を決める。ドキュメントには採用案と採用理由のみ記録する**
|
|
69
|
+
- ADR は `docs/02_概要設計/90_ADR/{対象}/` で管理する(`全体` / `ドメイン` / `UC` / `DB`)
|
|
70
|
+
- ファイル名は `mmdd-{日本語タイトル}.md`。対象はフォルダで表す
|
|
56
71
|
- ADR は理由の記録であり、詳細設計の代わりにしない
|
|
72
|
+
- 廃止 UC の理由も ADR に記録する(UC ファイル本体は削除)
|
|
57
73
|
|
|
58
74
|
## 文書品質
|
|
59
75
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
76
|
+
- **docs にコードを書かない。コード片・DDL・クラス定義・プロンプト本文はすべて禁止。コードは `src/` / `tests/` に書く**
|
|
77
|
+
- **概要設計では「何をするか」を書き、実装の詳細は持ち込まない**
|
|
78
|
+
- **詳細設計ではドメインルール・UC の責務・入出力・判断条件・テスト観点を書く**
|
|
79
|
+
- **`maps_to` を唯一の src 対応として使う。パス推定に頼らない**
|
|
63
80
|
- **Markdown に HTML タグ(details, summary, br など)を使わない**
|
|
81
|
+
- **設計書に絵文字を使わない**
|
|
82
|
+
- **`概要.md` のような汎用的な名前のファイルは作らない。内容を具体的に示す名前(`要件定義.md`、`ユースケース一覧.md`、`システム全体俯瞰.md` など)を使う**
|
|
83
|
+
- **「関連ドキュメント」セクションを設計書に作らない。依存関係は frontmatter の `depends_on` で管理する**
|
|
84
|
+
- **「スケジュール」セクションを設計書に作らない。進捗管理は設計書の責務ではない**
|
|
85
|
+
|
|
86
|
+
## ドメインモデルとデータモデルの分離
|
|
87
|
+
|
|
88
|
+
ドメインモデルとデータモデルは**別物**であり、置き場所も内容も分ける。
|
|
89
|
+
|
|
90
|
+
| 種別 | 内容 | 置き場所 |
|
|
91
|
+
|------|------|---------|
|
|
92
|
+
| ドメインモデル | ビジネスルール・集約・値オブジェクト・不変条件 | `docs/03_詳細設計/01_ドメイン/` |
|
|
93
|
+
| データモデル | DBスキーマ・テーブル定義・カラム定義・インデックス | `docs/03_詳細設計/03_DB・外部サービス/` |
|
|
94
|
+
|
|
95
|
+
- **`01_ドメイン/` にDBスキーマ・テーブル定義・カラム定義を書かない**
|
|
96
|
+
- **`03_DB・外部サービス/` にビジネスルール・ドメインロジックを書かない**
|
|
97
|
+
- 概要設計の `ドメインモデル.md` も同様。集約と境界コンテキストの概念図であり、永続化の構造ではない
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: rules・agents・skills ファイルのフォーマット定義。harness-engineering や architecture-skill-development で新規作成・修正するときに参照する。
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# ハーネスファイルフォーマット
|
|
6
|
+
|
|
7
|
+
`harness-engineering` や `architecture-skill-development` で rules / agents / skills を作成・修正するときは、このフォーマットに従う。
|
|
8
|
+
|
|
9
|
+
## rule ファイル(`.claude/rules/*.md`)
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
---
|
|
13
|
+
description: このルールの概要(1行)
|
|
14
|
+
paths: ["対象パス/**"] # 省略すると全ファイルに適用
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# ルール名
|
|
18
|
+
|
|
19
|
+
本文...
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- `description` は必須。Claude がルールを選択するときに使う
|
|
23
|
+
- `paths` は省略可。省略すると `**` 相当(全ファイルに適用)
|
|
24
|
+
- `integrations` に `github` が含まれる場合、対応する `.github/instructions/{name}.instructions.md` も作成・更新する
|
|
25
|
+
- `.github/` 版の frontmatter は `applyTo: "対象パス/**"` 形式に変換する
|
|
26
|
+
|
|
27
|
+
## agent ファイル(`.claude/agents/*.md`)
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
---
|
|
31
|
+
name: agent-name
|
|
32
|
+
description: いつ・何のために呼ぶかを具体的に書く(トリガー型)
|
|
33
|
+
tools: Read, Grep, Glob # 必要最小限のツールだけ付与
|
|
34
|
+
model: sonnet # 通常は sonnet
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# エージェント名
|
|
38
|
+
|
|
39
|
+
本文...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- `description` はトリガー型で書く(「〇〇のときに自動で呼ぶ」形式)
|
|
43
|
+
- `tools` は最小権限原則。読み取りのみなら `Read, Grep, Glob`
|
|
44
|
+
- 書き込みが必要な場合のみ `Edit, Write` を追加する
|
|
45
|
+
- `integrations` に `github` が含まれる場合、対応する `.github/agents/{name}.agent.md` も作成・更新する
|
|
46
|
+
|
|
47
|
+
## skill ファイル(`.claude/skills/{name}/SKILL.md`)
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
---
|
|
51
|
+
name: skill-name
|
|
52
|
+
description: このスキルの目的と使うタイミング(1〜2行)
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
# スキル名
|
|
56
|
+
|
|
57
|
+
本文...
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- `description` は Claude がスキルを選択するときに使う。「いつ使うか」を含める
|
|
61
|
+
- `integrations` に `github` が含まれる場合、対応する `.github/skills/{name}/SKILL.md` も作成・更新する
|
|
62
|
+
|
|
63
|
+
## CLAUDE.md
|
|
64
|
+
|
|
65
|
+
CLAUDE.md は**全会話で常にコンテキストに読み込まれる**。書くほどコストが増えるため、最小に保つ。
|
|
66
|
+
|
|
67
|
+
### 書いてよいもの
|
|
68
|
+
|
|
69
|
+
- よく使う skill の名前と起動タイミング(開発ワークフローの入口)
|
|
70
|
+
- プロジェクト全体に常時適用すべき制約(例: 言語、承認フロー)
|
|
71
|
+
|
|
72
|
+
### 書いてはいけないもの(代わりの置き場所)
|
|
73
|
+
|
|
74
|
+
| 内容 | 正しい置き場所 |
|
|
75
|
+
|------|--------------|
|
|
76
|
+
| コーディング規約の詳細 | `.claude/rules/coding.md` |
|
|
77
|
+
| フォーマット定義・手順 | `.claude/rules/*.md` |
|
|
78
|
+
| スキルの詳細フロー | `.claude/skills/*/SKILL.md` |
|
|
79
|
+
| 過去の決定・背景 | `docs/02_概要設計/90_ADR/` |
|
|
80
|
+
|
|
81
|
+
### 目安
|
|
82
|
+
|
|
83
|
+
- 20行を超えたら見直しを検討する
|
|
84
|
+
- 新しい内容を追加する前に「rules / skills に移せないか」を先に考える
|
|
85
|
+
|
|
86
|
+
## 共通原則
|
|
87
|
+
|
|
88
|
+
- **更新する連携先は `architecture.yaml` の `integrations` に従う**
|
|
89
|
+
- `claude` のみ → `.claude/` だけ更新する。`.github/` を作成しない
|
|
90
|
+
- `github` のみ → `.github/` だけ更新する。`.claude/` を作成しない
|
|
91
|
+
- 両方 → `.claude/` と `.github/` を対で更新する
|
|
92
|
+
- `description` は「何をするか」より「**いつ・なぜ使うか**」を優先して書く
|
|
93
|
+
- 新規作成時は既存ファイルを参考にフォーマットを確認してから作る
|
|
@@ -6,43 +6,69 @@ description: 新規プロジェクトで docs と `.spec-runner/architecture/arc
|
|
|
6
6
|
# architecture-definition
|
|
7
7
|
|
|
8
8
|
新規プロジェクト向けの初期化フロー。
|
|
9
|
-
|
|
9
|
+
要件定義・フォルダ構造の決定・architecture contract の作成までを先に固め、スキル整備を経てから概要設計へ進む。
|
|
10
10
|
|
|
11
11
|
## 全体フロー
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
Phase 1: 要件整理
|
|
15
|
-
Phase 2:
|
|
15
|
+
Phase 2: フォルダ構造の決定(対話)
|
|
16
16
|
Phase 3: アーキテクチャ判断の明文化
|
|
17
17
|
Phase 4: architecture contract 作成
|
|
18
|
-
Phase 5:
|
|
18
|
+
Phase 5: architecture-skill-development へ自動移行
|
|
19
|
+
└→ スキル整備完了後、プロジェクト専用スキルで概要設計へ進む
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
## Phase 1: 要件整理
|
|
22
23
|
|
|
24
|
+
テンプレート: `.claude/skills/docs-driven-seed/templates/01_要件定義/`
|
|
25
|
+
|
|
23
26
|
1. ユーザーから背景、提供価値、制約、スコープ外を確認する
|
|
24
|
-
2. `docs/01_要件定義/要件定義.md` を作る
|
|
25
|
-
3.
|
|
26
|
-
4.
|
|
27
|
+
2. テンプレートをコピーして `docs/01_要件定義/要件定義.md` を作る
|
|
28
|
+
3. ドメイン用語が出てきたら `docs/01_要件定義/ユビキタス言語辞書.md` に随時追記する
|
|
29
|
+
4. アーキテクチャスタイルを選択する
|
|
30
|
+
|
|
31
|
+
| スタイル | 選ぶ基準 |
|
|
32
|
+
|---------|---------|
|
|
33
|
+
| `ddd` | 複雑なビジネスドメインがある。集約・境界コンテキストで設計する必要がある |
|
|
34
|
+
| `layered` | CRUD 中心またはビジネスロジックがシンプル。UC・サービス層で設計すれば十分 |
|
|
35
|
+
|
|
36
|
+
5. 使用する AI 連携を確認する
|
|
37
|
+
|
|
38
|
+
| 連携 | フォルダ |
|
|
39
|
+
|------|---------|
|
|
40
|
+
| `claude` | `.claude/`(Claude Code) |
|
|
41
|
+
| `github` | `.github/`(GitHub Copilot) |
|
|
42
|
+
| 両方 | `.claude/` と `.github/` |
|
|
27
43
|
|
|
28
|
-
|
|
44
|
+
6. ユーザーに確認・承認を得る
|
|
29
45
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
## Phase 2: フォルダ構造の決定
|
|
47
|
+
|
|
48
|
+
対話でプロジェクトのフォルダ構造を決める。この段階で決めた構造がテンプレートの `maps_to` パスに焼き込まれるため、概要設計より前に確定させる。
|
|
49
|
+
|
|
50
|
+
1. 以下をユーザーと対話しながら決める
|
|
51
|
+
- `src/` 配下のパッケージ・モジュール構成
|
|
52
|
+
- `tests/` の種別ディレクトリ構成(`unit/` / `integration/` / `e2e/` など)
|
|
53
|
+
- `docs/` の構成(デフォルトから変える場合)
|
|
54
|
+
- その他プロジェクト固有のディレクトリ(IaC、設定ファイルなど)
|
|
55
|
+
2. 決定した構造を箇条書きでまとめてユーザーに提示する
|
|
56
|
+
3. ユーザーに確認・承認を得る
|
|
34
57
|
|
|
35
58
|
## Phase 3: アーキテクチャ判断の明文化
|
|
36
59
|
|
|
37
60
|
1. ドメイン分割、責務境界、実装単位、インフラ方針を整理する
|
|
38
|
-
2.
|
|
61
|
+
2. 必要なら対象フォルダに ADR を作る(`90_ADR/全体/` / `ドメイン/` / `UC/` / `DB/`)
|
|
39
62
|
3. ユーザーに確認・承認を得る
|
|
40
63
|
|
|
41
64
|
## Phase 4: architecture contract 作成
|
|
42
65
|
|
|
43
66
|
1. `.spec-runner/architecture/architecture.yaml` を作る
|
|
44
67
|
2. 最低限、以下を構造化する
|
|
45
|
-
-
|
|
68
|
+
- **integrations**: Phase 1 で確認した連携(`[claude]` / `[github]` / `[claude, github]`)
|
|
69
|
+
- **style**: Phase 1 で選択したスタイル(`ddd` / `layered`)
|
|
70
|
+
- **folder_structure**: Phase 2 で決定した構造
|
|
71
|
+
- domain_structure(style: ddd のときのみ)
|
|
46
72
|
- runtime_units
|
|
47
73
|
- design_policy
|
|
48
74
|
- testing_policy
|
|
@@ -52,12 +78,14 @@ Phase 5: 次の skill へ引き渡し
|
|
|
52
78
|
|
|
53
79
|
Phase 4 が承認されたら、**ユーザーにコマンドを打たせずに `architecture-skill-development` を続けて開始する**。
|
|
54
80
|
|
|
55
|
-
1. `architecture-skill-development` に渡す前提(docs
|
|
81
|
+
1. `architecture-skill-development` に渡す前提(docs・architecture.yaml・確定済みフォルダ構造)を要約する
|
|
56
82
|
2. project 専用 skill に切り出すべき反復フローを列挙する
|
|
57
83
|
3. 確認なしに `architecture-skill-development` Phase 1 へ進む
|
|
84
|
+
4. **スキル整備完了後、プロジェクト専用スキルを使って概要設計へ進む**
|
|
58
85
|
|
|
59
86
|
## 原則
|
|
60
87
|
|
|
61
|
-
-
|
|
88
|
+
- フォルダ構造を概要設計より前に確定する
|
|
89
|
+
- スキル整備が完了してから概要設計へ進む(テンプレートの `maps_to` を確定済み構造で焼き込むため)
|
|
62
90
|
- `.spec-runner/` は補助情報として扱う
|
|
63
91
|
- project 専用 skill を作る前にアーキテクチャを固める
|
|
@@ -15,14 +15,13 @@ Phase 1: 入力の確認
|
|
|
15
15
|
Phase 2: 反復フローの抽出
|
|
16
16
|
Phase 3: skill / rule / template へ分解
|
|
17
17
|
Phase 4: 基盤 skill のプロジェクト固有化
|
|
18
|
-
Phase 5:
|
|
19
|
-
Phase 6:
|
|
20
|
-
Phase 7: セットアップ専用 skill のアーカイブ提案
|
|
18
|
+
Phase 5: 一貫性の検証
|
|
19
|
+
Phase 6: セットアップ専用 skill のアーカイブ提案
|
|
21
20
|
```
|
|
22
21
|
|
|
23
22
|
## Phase 1: 入力の確認
|
|
24
23
|
|
|
25
|
-
1. `docs/01_
|
|
24
|
+
1. `docs/01_要件定義/**` を読む
|
|
26
25
|
2. `.spec-runner/architecture/architecture.yaml` を読む
|
|
27
26
|
3. 固定化すべき判断と project 固有判断を切り分ける
|
|
28
27
|
|
|
@@ -35,22 +34,30 @@ Phase 7: セットアップ専用 skill のアーカイブ提案
|
|
|
35
34
|
|
|
36
35
|
## Phase 3: skill / rule / template へ分解
|
|
37
36
|
|
|
37
|
+
ファイルを作成する前に **`.claude/rules/harness-formats.md`** を読み、フォーマットを確認する。
|
|
38
|
+
|
|
38
39
|
1. 会話フローは skill にする
|
|
39
40
|
2. 常時守る約束は rule にする
|
|
40
41
|
3. 毎回コピーする設計書は template にする
|
|
41
42
|
|
|
42
|
-
###
|
|
43
|
+
### seed の選択
|
|
44
|
+
|
|
45
|
+
`architecture.yaml` の `style` を読み、使う seed を決める。
|
|
46
|
+
|
|
47
|
+
| style | 使う seed | 説明 |
|
|
48
|
+
|-------|----------|------|
|
|
49
|
+
| `ddd` | `docs-driven-seed` | ドメイン層(集約・値オブジェクト)を持つ DDD 向けフロー |
|
|
50
|
+
| `layered` | `simple-seed` | ドメイン層を持たない UC・サービス層中心のフロー |
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
`plugin-development` はプラグイン型アーキテクチャ向けの reference workflow であり、
|
|
46
|
-
そのまま使うのではなく、**このプロジェクトのアーキテクチャに合わせて書き換えた project 専用 skill を作る**ことを目的とする。
|
|
52
|
+
選んだ seed の SKILL.md をコピーして、**このプロジェクトのアーキテクチャに合わせて書き換えた project 専用 skill を作る**ことを目的とする。
|
|
47
53
|
|
|
48
54
|
具体的には:
|
|
49
|
-
-
|
|
55
|
+
- 選んだ seed の SKILL.md をコピーして、project 専用の開発 skill の土台にする
|
|
50
56
|
- フェーズ構成・テンプレートパス・用語をこのプロジェクトの実態に合わせて書き換える
|
|
51
|
-
-
|
|
57
|
+
- **Phase 1(要件定義)は architecture-definition で完了済みのため削除する**
|
|
58
|
+
- 元の seed は書き換え完了後にアーカイブ候補とする(Phase 6 で提案する)
|
|
52
59
|
|
|
53
|
-
ユーザーに確認・承認を得る
|
|
60
|
+
4. ユーザーに確認・承認を得る
|
|
54
61
|
|
|
55
62
|
## Phase 4: 基盤 skill のプロジェクト固有化
|
|
56
63
|
|
|
@@ -86,19 +93,14 @@ Phase 7: セットアップ専用 skill のアーカイブ提案
|
|
|
86
93
|
|
|
87
94
|
同様のプレースホルダーや汎用記述が他の skill にあれば、同じ要領で書き換える。
|
|
88
95
|
|
|
89
|
-
ユーザーに確認・承認を得る
|
|
90
|
-
|
|
91
|
-
## Phase 5: Claude / Copilot テンプレートへ反映
|
|
92
|
-
|
|
93
|
-
1. `.claude/` と `.github/` の両方へ反映する
|
|
94
|
-
2. path や naming がずれないよう対応ファイルを揃える
|
|
96
|
+
5. ユーザーに確認・承認を得る
|
|
95
97
|
|
|
96
|
-
## Phase
|
|
98
|
+
## Phase 5: 一貫性の検証
|
|
97
99
|
|
|
98
100
|
1. 既存 skill / rule / agent と矛盾しないか確認する
|
|
99
101
|
2. `harness-engineering` が必要な改善点を洗い出す
|
|
100
102
|
|
|
101
|
-
## Phase
|
|
103
|
+
## Phase 6: セットアップ専用 skill のアーカイブ提案
|
|
102
104
|
|
|
103
105
|
セットアップ時にしか使わない skill は、開発ループに入ると不要になる。
|
|
104
106
|
**ユーザーの承認を得てから** 整理する。絶対に自動で削除・移動しない。
|
|
@@ -109,7 +111,7 @@ Phase 7: セットアップ専用 skill のアーカイブ提案
|
|
|
109
111
|
|---|---|
|
|
110
112
|
| `architecture-definition` | 新規プロジェクト初期化専用。アーキテクチャ確定後は不要 |
|
|
111
113
|
| `existing-project-to-docs` | 既存プロジェクト取り込み専用。docs 生成後は不要 |
|
|
112
|
-
| `
|
|
114
|
+
| `docs-driven-seed` | Phase 3 で project 専用 skill の種として使い終えたら不要 |
|
|
113
115
|
| `architecture-skill-development`(このファイル自身) | project 専用 skill が安定したら不要。ただしアーキテクチャが大きく変わる場合は再利用する可能性があるため、削除ではなくアーカイブを推奨 |
|
|
114
116
|
|
|
115
117
|
### 手順
|
|
@@ -117,7 +119,10 @@ Phase 7: セットアップ専用 skill のアーカイブ提案
|
|
|
117
119
|
1. 上記の候補をユーザーに提示し、整理してよいか確認する
|
|
118
120
|
2. 承認を得た skill を `.claude/skills/` と `.github/skills/` から削除する
|
|
119
121
|
3. 必要であれば削除前にバックアップ先をユーザーに伝える
|
|
120
|
-
4.
|
|
122
|
+
4. `.spec-runner/` の不要ファイルも整理する
|
|
123
|
+
- `intake/current-system-inventory.md` — docs に昇格済みなら削除してよい
|
|
124
|
+
- `architecture/architecture.yaml` — project 専用 skill が完成し、参照不要になったら削除してよい
|
|
125
|
+
5. `CLAUDE.md` を更新する
|
|
121
126
|
- 「初回自動起動」セクション(spec-runner インストール時に生成されたもの)を削除する
|
|
122
127
|
- 作成した project 専用 skill の名前と使いどころを記載する
|
|
123
128
|
- 例:
|