spec-runner 1.0.3 → 1.0.4
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/README.md +36 -35
- package/bin/spec-runner.js +19 -18
- package/package.json +1 -1
- package/templates/base/.github/PULL_REQUEST_TEMPLATE.md +1 -1
- package/templates/base/.github/workflows/phase-gate-check.yml +1 -1
- package/templates/base/scripts/spec-runner.sh +59 -52
- package/templates/base/templates//345/210/235/346/234/237/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/03_/347/224/250/350/252/236/351/233/206.md +1 -1
- package/templates/base/templates//345/210/235/346/234/237/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210//346/214/257/343/202/212/350/277/224/343/202/212//350/262/240/345/202/265.md +1 -1
- package/templates/claude/.claude/commands/sr-/343/202/262/343/203/274/343/203/210/350/250/255/345/256/232.md +1 -1
- package/templates/claude/.claude/commands/sr-/343/203/206/343/202/271/343/203/210/350/250/255/350/250/210.md +1 -1
- package/templates/claude/.claude/commands/sr-/343/203/254/343/203/223/343/203/245/343/203/274.md +1 -1
- package/templates/claude/.claude/commands/sr-/344/277/256/346/255/243.md +1 -1
- package/templates/claude/.claude/commands/sr-/345/210/235/346/234/237/345/214/226.md +1 -1
- package/templates/claude/.claude/commands/sr-/345/256/214/344/272/206.md +1 -1
- package/templates/claude/.claude/commands/sr-/345/256/237/350/243/205.md +1 -1
- package/templates/claude/.claude/commands/sr-/346/246/202/350/246/201/350/250/255/350/250/210.md +1 -1
- package/templates/claude/.claude/commands/sr-/347/212/266/346/205/213.md +1 -1
- package/templates/claude/.claude/commands/sr-/347/267/212/346/200/245/344/277/256/346/255/243.md +1 -1
- package/templates/claude/.claude/commands/sr-/350/250/255/345/256/232.md +1 -1
- package/templates/claude/.claude/commands/sr-/350/251/263/347/264/260/350/250/255/350/250/210.md +1 -1
- package/templates/claude/.claude/hooks/pre-tool-use.sh +1 -1
- package/templates/claude/CLAUDE.md +10 -10
- package/templates/copilot/.github/copilot-instructions.md +7 -7
- package/templates/copilot/.github/prompts/sr-/343/202/262/343/203/274/343/203/210/350/250/255/345/256/232.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/343/203/206/343/202/271/343/203/210/350/250/255/350/250/210.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/343/203/254/343/203/223/343/203/245/343/203/274.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/344/277/256/346/255/243.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/345/210/235/346/234/237/345/214/226.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/345/256/214/344/272/206.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/345/256/237/350/243/205.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/346/246/202/350/246/201/350/250/255/350/250/210.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/347/212/266/346/205/213.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/347/267/212/346/200/245/344/277/256/346/255/243.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/350/250/255/345/256/232.prompt.md +1 -1
- package/templates/copilot/.github/prompts/sr-/350/251/263/347/264/260/350/250/255/350/250/210.prompt.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/343/202/262/343/203/274/343/203/210/350/250/255/345/256/232.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/343/203/206/343/202/271/343/203/210/350/250/255/350/250/210.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/343/203/254/343/203/223/343/203/245/343/203/274.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/344/277/256/346/255/243.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/345/210/235/346/234/237/345/214/226.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/345/256/214/344/272/206.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/345/256/237/350/243/205.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/346/246/202/350/246/201/350/250/255/350/250/210.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/347/212/266/346/205/213.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/347/267/212/346/200/245/344/277/256/346/255/243.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/350/250/255/345/256/232.md +1 -1
- package/templates/cursor/.cursor/commands/sr-/350/251/263/347/264/260/350/250/255/350/250/210.md +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ npx spec-runner
|
|
|
43
43
|
### 4. init で詳細設定と最初のユースケースを開始する
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
|
|
46
|
+
./.spec-runner/scripts/spec-runner.sh init "会員登録" "会員"
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
**init を実行すると対話が始まる**(初回のみ)。AI と相談して決めた次の内容を入力する:
|
|
@@ -56,7 +56,7 @@ npx spec-runner
|
|
|
56
56
|
|
|
57
57
|
設定後、`docs/01_要件/会員登録.md` ができ、ブランチ `feature/uc-会員登録` が作られる。
|
|
58
58
|
|
|
59
|
-
- 引数なしで
|
|
59
|
+
- 引数なしで `./.spec-runner/scripts/spec-runner.sh init` だけ実行すると、**設定対話のみ**(ユースケースは作らない)。
|
|
60
60
|
- すでに設定済みの場合は対話をスキップし、そのままユースケース作成に進む。
|
|
61
61
|
|
|
62
62
|
### 5. 開発フロー(この順で進める)
|
|
@@ -66,32 +66,32 @@ npx spec-runner
|
|
|
66
66
|
docs/01_要件/会員登録.md を書く
|
|
67
67
|
|
|
68
68
|
② 要件レビュー通過
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
./.spec-runner/scripts/spec-runner.sh review-pass docs/01_要件/会員登録.md
|
|
70
|
+
./.spec-runner/scripts/spec-runner.sh set-gate glossary_checked
|
|
71
71
|
|
|
72
72
|
③ 概要設計
|
|
73
|
-
|
|
73
|
+
./.spec-runner/scripts/spec-runner.sh design-high
|
|
74
74
|
docs/02_概要設計/会員登録.md を書く → review-pass
|
|
75
75
|
|
|
76
76
|
④ 詳細設計(この順)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
./.spec-runner/scripts/spec-runner.sh design-detail domain → ドメイン.md を書く → review-pass
|
|
78
|
+
./.spec-runner/scripts/spec-runner.sh design-detail usecase → ユースケース.md を書く → review-pass
|
|
79
|
+
./.spec-runner/scripts/spec-runner.sh design-detail table → テーブル.md を書く → review-pass
|
|
80
|
+
./.spec-runner/scripts/spec-runner.sh design-detail infra → インフラ.md を書く → review-pass
|
|
81
81
|
|
|
82
82
|
⑤ テスト設計
|
|
83
|
-
|
|
83
|
+
./.spec-runner/scripts/spec-runner.sh test-design
|
|
84
84
|
docs/04_テスト設計/会員登録.md を書く
|
|
85
85
|
テストコードを先に書く(Red)→ コミット
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
./.spec-runner/scripts/spec-runner.sh set-gate test_code_committed
|
|
87
|
+
./.spec-runner/scripts/spec-runner.sh review-pass docs/04_テスト設計/会員登録.md
|
|
88
88
|
|
|
89
89
|
⑥ 実装
|
|
90
|
-
|
|
90
|
+
./.spec-runner/scripts/spec-runner.sh implement
|
|
91
91
|
テストを Green にする実装を書く
|
|
92
92
|
|
|
93
93
|
⑦ 完了
|
|
94
|
-
|
|
94
|
+
./.spec-runner/scripts/spec-runner.sh complete
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
TDD はデフォルトで有効。実装に進むには「テスト設計ドキュメント」と「テストコードのコミット」が必須。無効にしたいときは `.spec-runner/config.sh` で `export TDD_ENABLED="false"`。
|
|
@@ -158,29 +158,30 @@ curl -sSL https://raw.githubusercontent.com/spec-runner/spec-runner/main/install
|
|
|
158
158
|
|
|
159
159
|
```
|
|
160
160
|
<プロジェクトルート>/
|
|
161
|
-
├── .spec-runner/
|
|
162
|
-
│ ├── config.sh
|
|
163
|
-
│
|
|
161
|
+
├── .spec-runner/ # npx で入れたスクリプト・テンプレートをここに集約
|
|
162
|
+
│ ├── config.sh # パス・拡張子・TDD 等
|
|
163
|
+
│ ├── state.json # 現在のフェーズ(gitignore 推奨)
|
|
164
|
+
│ ├── scripts/
|
|
165
|
+
│ │ └── spec-runner.sh
|
|
166
|
+
│ └── templates/ # 生成用+初期ドキュメント(DDD用語・付番は日本語)
|
|
167
|
+
│ ├── 01_要件定義/ひな形.md # init で docs/01_要件/<UC>.md を生成
|
|
168
|
+
│ ├── 03_詳細設計/ # design-detail で docs/03_詳細設計/<UC>/*.md を生成
|
|
169
|
+
│ │ ├── ドメイン.md
|
|
170
|
+
│ │ ├── ユースケース.md
|
|
171
|
+
│ │ ├── テーブル.md
|
|
172
|
+
│ │ └── インフラ.md
|
|
173
|
+
│ ├── 99_設計判断記録/ひな形.md # ADR ひな形(docs/99_設計判断記録/ にもコピー)
|
|
174
|
+
│ └── 初期ドキュメント/ # deploy 時に docs/ に展開
|
|
175
|
+
│ ├── 01_憲章.md
|
|
176
|
+
│ ├── 02_仕様.md
|
|
177
|
+
│ ├── 03_用語集.md
|
|
178
|
+
│ ├── テンプレート一覧.md
|
|
179
|
+
│ ├── 振り返り/負債.md
|
|
180
|
+
│ └── 99_設計判断記録/.gitkeep
|
|
164
181
|
├── .github/
|
|
165
182
|
│ ├── workflows/phase-gate-check.yml
|
|
166
183
|
│ └── PULL_REQUEST_TEMPLATE.md
|
|
167
|
-
|
|
168
|
-
├── scripts/spec-runner.sh
|
|
169
|
-
└── templates/ # すべてのテンプレート(DDD用語・付番は日本語)
|
|
170
|
-
├── 01_要件定義/ひな形.md # init で docs/01_要件/<UC>.md を生成
|
|
171
|
-
├── 03_詳細設計/ # design-detail で docs/03_詳細設計/<UC>/*.md を生成
|
|
172
|
-
│ ├── ドメイン.md
|
|
173
|
-
│ ├── ユースケース.md
|
|
174
|
-
│ ├── テーブル.md
|
|
175
|
-
│ └── インフラ.md
|
|
176
|
-
├── 99_設計判断記録/ひな形.md # ADR ひな形(docs/99_設計判断記録/ にもコピー)
|
|
177
|
-
└── 初期ドキュメント/ # deploy 時に docs/ に展開
|
|
178
|
-
├── 01_憲章.md
|
|
179
|
-
├── 02_仕様.md
|
|
180
|
-
├── 03_用語集.md
|
|
181
|
-
├── テンプレート一覧.md
|
|
182
|
-
├── 振り返り/負債.md
|
|
183
|
-
└── 99_設計判断記録/.gitkeep
|
|
184
|
+
└── docs/ # 付番済み(01_〜04_、99_)要件・概要・詳細設計・テスト設計・設計判断記録
|
|
184
185
|
```
|
|
185
186
|
|
|
186
187
|
選択した AI ツールに応じて `.claude/` や `.cursorrules` や `.github/copilot-instructions.md` などが追加される。
|
|
@@ -193,7 +194,7 @@ curl -sSL https://raw.githubusercontent.com/spec-runner/spec-runner/main/install
|
|
|
193
194
|
npx spec-runner --update
|
|
194
195
|
```
|
|
195
196
|
|
|
196
|
-
|
|
197
|
+
`.spec-runner/scripts/spec-runner.sh` と `.claude/hooks/` が更新される。ドキュメントや config は上書きしない。
|
|
197
198
|
|
|
198
199
|
---
|
|
199
200
|
|
package/bin/spec-runner.js
CHANGED
|
@@ -186,7 +186,7 @@ async function main() {
|
|
|
186
186
|
if (fs.existsSync(CONFIG_SH)) {
|
|
187
187
|
warn('既に spec-runner が導入されています。');
|
|
188
188
|
info('更新するには: npx spec-runner --update');
|
|
189
|
-
info('再設定するには:
|
|
189
|
+
info('再設定するには: ./.spec-runner/scripts/spec-runner.sh init(対話でパス等を設定)');
|
|
190
190
|
process.exit(0);
|
|
191
191
|
}
|
|
192
192
|
|
|
@@ -285,7 +285,7 @@ async function main() {
|
|
|
285
285
|
log(' チャットで /sr-憲章 または /sr-仕様 と入力すると編集を案内できます。');
|
|
286
286
|
log('');
|
|
287
287
|
log(' • パス・TDD 等の設定と最初のユースケース開始:');
|
|
288
|
-
log(chalk.cyan('
|
|
288
|
+
log(chalk.cyan(' ./.spec-runner/scripts/spec-runner.sh init "ユースケース名" "集約名"'));
|
|
289
289
|
log(' またはチャットで: ' + chalk.cyan('/sr-初期化 ユースケース名 集約名'));
|
|
290
290
|
log('');
|
|
291
291
|
log(' init を実行すると対話で Domain/UseCase のパスやテスト設定を聞かれます。');
|
|
@@ -302,7 +302,7 @@ async function main() {
|
|
|
302
302
|
}
|
|
303
303
|
log('');
|
|
304
304
|
log(chalk.bold('コマンド一覧:'));
|
|
305
|
-
log(chalk.cyan('
|
|
305
|
+
log(chalk.cyan(' ./.spec-runner/scripts/spec-runner.sh help'));
|
|
306
306
|
log('');
|
|
307
307
|
log(chalk.gray('💡 構造を変えたいときは .spec-runner/config.sh を編集してください'));
|
|
308
308
|
}
|
|
@@ -370,17 +370,18 @@ async function deployFiles(answers) {
|
|
|
370
370
|
log('');
|
|
371
371
|
log(chalk.bold('展開するファイル:'));
|
|
372
372
|
|
|
373
|
-
// 1. 共通(base): scripts
|
|
374
|
-
|
|
375
|
-
copyPathFrom(baseDir, '
|
|
376
|
-
|
|
377
|
-
|
|
373
|
+
// 1. 共通(base): .spec-runner/ に scripts と templates をまとめて配置
|
|
374
|
+
const specRunnerDir = path.join(CWD, '.spec-runner');
|
|
375
|
+
copyPathFrom(baseDir, 'scripts', specRunnerDir);
|
|
376
|
+
copyPathFrom(baseDir, 'templates', specRunnerDir);
|
|
377
|
+
// .spec-runner/templates/初期ドキュメント/ の中身を docs/ に展開(憲章・仕様・用語集等)
|
|
378
|
+
const docsInitialSrc = path.join(specRunnerDir, 'templates', '初期ドキュメント');
|
|
378
379
|
const docsDest = path.join(CWD, 'docs');
|
|
379
380
|
if (fs.existsSync(docsInitialSrc)) {
|
|
380
381
|
copyDir(docsInitialSrc, docsDest, vars);
|
|
381
382
|
}
|
|
382
383
|
// 生成用テンプレートのうち設計判断記録ひな形は docs/99_設計判断記録/ にも置く(新規 ADR 作成時のコピー元)
|
|
383
|
-
const adrTemplateSrc = path.join(
|
|
384
|
+
const adrTemplateSrc = path.join(specRunnerDir, 'templates', '99_設計判断記録', 'ひな形.md');
|
|
384
385
|
const adrTemplateDest = path.join(CWD, 'docs', '99_設計判断記録', 'ひな形.md');
|
|
385
386
|
if (fs.existsSync(adrTemplateSrc)) {
|
|
386
387
|
fs.mkdirSync(path.dirname(adrTemplateDest), { recursive: true });
|
|
@@ -410,8 +411,8 @@ async function deployFiles(answers) {
|
|
|
410
411
|
// 6. .gitignore に .spec-runner/state.json を追加
|
|
411
412
|
appendGitignore();
|
|
412
413
|
|
|
413
|
-
// 7. scripts/spec-runner.sh に実行権限を付与
|
|
414
|
-
const devShPath = path.join(
|
|
414
|
+
// 7. .spec-runner/scripts/spec-runner.sh に実行権限を付与
|
|
415
|
+
const devShPath = path.join(specRunnerDir, 'scripts', 'spec-runner.sh');
|
|
415
416
|
if (fs.existsSync(devShPath) && !isDryRun) {
|
|
416
417
|
fs.chmodSync(devShPath, '755');
|
|
417
418
|
}
|
|
@@ -427,7 +428,7 @@ async function deployFiles(answers) {
|
|
|
427
428
|
function generateConfigSh(vars) {
|
|
428
429
|
const content = `# =============================================================================
|
|
429
430
|
# .spec-runner/config.sh — spec-runner 設定
|
|
430
|
-
# このファイルは scripts/spec-runner.sh が読み込む設定ファイルです
|
|
431
|
+
# このファイルは .spec-runner/scripts/spec-runner.sh が読み込む設定ファイルです
|
|
431
432
|
# npx spec-runner / init 時の対話で生成・更新されます
|
|
432
433
|
# =============================================================================
|
|
433
434
|
# 詳細設定済みか(init で対話すると true になる)
|
|
@@ -674,7 +675,7 @@ async function runUpdate() {
|
|
|
674
675
|
info(`現在の構造: ${cfg.DOMAIN_PATH || d.domainPath} → ${cfg.USECASE_PATH || d.usecasePath} → ${cfg.INFRA_PATH || d.infraPath}`);
|
|
675
676
|
log('');
|
|
676
677
|
|
|
677
|
-
const updateTargets = [{ rel: 'scripts/spec-runner.sh', from: 'base' }];
|
|
678
|
+
const updateTargets = [{ rel: '.spec-runner/scripts/spec-runner.sh', from: 'base', srcRel: 'scripts/spec-runner.sh' }];
|
|
678
679
|
if (fs.existsSync(path.join(CWD, '.claude'))) {
|
|
679
680
|
updateTargets.push(
|
|
680
681
|
{ rel: '.claude/hooks/pre-tool-use.sh', from: 'claude' },
|
|
@@ -707,7 +708,7 @@ async function runUpdate() {
|
|
|
707
708
|
};
|
|
708
709
|
|
|
709
710
|
// 要件定義テンプレートが無ければ追加(init で必須のため)
|
|
710
|
-
const requirementTemplateDest = path.join(CWD, 'templates', '01_要件定義', 'ひな形.md');
|
|
711
|
+
const requirementTemplateDest = path.join(CWD, '.spec-runner', 'templates', '01_要件定義', 'ひな形.md');
|
|
711
712
|
if (!fs.existsSync(requirementTemplateDest)) {
|
|
712
713
|
const requirementTemplateSrc = path.join(templatesDir, 'base', 'templates', '01_要件定義', 'ひな形.md');
|
|
713
714
|
if (fs.existsSync(requirementTemplateSrc)) {
|
|
@@ -716,9 +717,9 @@ async function runUpdate() {
|
|
|
716
717
|
}
|
|
717
718
|
|
|
718
719
|
log(chalk.bold('更新するファイル:'));
|
|
719
|
-
for (const { rel, from } of updateTargets) {
|
|
720
|
+
for (const { rel, from, srcRel } of updateTargets) {
|
|
720
721
|
const srcDir = path.join(templatesDir, from);
|
|
721
|
-
const src = path.join(srcDir, rel);
|
|
722
|
+
const src = path.join(srcDir, srcRel || rel);
|
|
722
723
|
const dest = path.join(CWD, rel);
|
|
723
724
|
if (fs.existsSync(src)) {
|
|
724
725
|
// バックアップ
|
|
@@ -730,12 +731,12 @@ async function runUpdate() {
|
|
|
730
731
|
}
|
|
731
732
|
|
|
732
733
|
// 実行権限
|
|
733
|
-
const devShPath = path.join(CWD, 'scripts', 'spec-runner.sh');
|
|
734
|
+
const devShPath = path.join(CWD, '.spec-runner', 'scripts', 'spec-runner.sh');
|
|
734
735
|
if (fs.existsSync(devShPath) && !isDryRun) fs.chmodSync(devShPath, '755');
|
|
735
736
|
|
|
736
737
|
log('');
|
|
737
738
|
log(chalk.bold.green('✅ 更新完了'));
|
|
738
|
-
info('バックアップ: scripts/spec-runner.sh.bak など');
|
|
739
|
+
info('バックアップ: .spec-runner/scripts/spec-runner.sh.bak など');
|
|
739
740
|
}
|
|
740
741
|
|
|
741
742
|
// ── エントリー ────────────────────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -7,25 +7,32 @@
|
|
|
7
7
|
# このスクリプトはシェルレベルで実行を拒否するため、AIも人間もスキップできない。
|
|
8
8
|
#
|
|
9
9
|
# 使い方:
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
10
|
+
# ./.spec-runner/scripts/spec-runner.sh init … 詳細設定の対話のみ
|
|
11
|
+
# ./.spec-runner/scripts/spec-runner.sh init <ユースケース名> [集約名] … 設定後ユースケース作成
|
|
12
|
+
# ./.spec-runner/scripts/spec-runner.sh require
|
|
13
|
+
# ./.spec-runner/scripts/spec-runner.sh design-high
|
|
14
|
+
# ./.spec-runner/scripts/spec-runner.sh design-detail <サブフェーズ: domain|usecase|table|infra>
|
|
15
|
+
# ./.spec-runner/scripts/spec-runner.sh test-design
|
|
16
|
+
# ./.spec-runner/scripts/spec-runner.sh implement
|
|
17
|
+
# ./.spec-runner/scripts/spec-runner.sh status
|
|
18
|
+
# ./.spec-runner/scripts/spec-runner.sh fix <修正内容>
|
|
19
|
+
# ./.spec-runner/scripts/spec-runner.sh hotfix <内容>
|
|
20
|
+
# ./.spec-runner/scripts/spec-runner.sh review-pass <ドキュメントパス>
|
|
21
|
+
# ./.spec-runner/scripts/spec-runner.sh complete
|
|
22
22
|
# =============================================================================
|
|
23
23
|
|
|
24
24
|
set -euo pipefail
|
|
25
25
|
|
|
26
26
|
# ── 定数 ──────────────────────────────────────────────────────────────────────
|
|
27
27
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
28
|
-
PROJECT_ROOT
|
|
28
|
+
# .spec-runner/scripts/ にいる場合は PROJECT_ROOT は 2 階層上、そうでなければ 1 階層上(旧レイアウト)
|
|
29
|
+
if [[ "$SCRIPT_DIR" == */.spec-runner/scripts ]]; then
|
|
30
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
31
|
+
SPEC_RUNNER_DIR="$PROJECT_ROOT/.spec-runner"
|
|
32
|
+
else
|
|
33
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
34
|
+
SPEC_RUNNER_DIR="$PROJECT_ROOT"
|
|
35
|
+
fi
|
|
29
36
|
STATE_FILE="$PROJECT_ROOT/.spec-runner/state.json"
|
|
30
37
|
DEBT_FILE="$PROJECT_ROOT/docs/振り返り/負債.md"
|
|
31
38
|
GLOSSARY="$PROJECT_ROOT/docs/03_用語集.md"
|
|
@@ -119,7 +126,7 @@ state_push_history() {
|
|
|
119
126
|
|
|
120
127
|
# ── ステートファイル必須チェック ───────────────────────────────────────────
|
|
121
128
|
require_state() {
|
|
122
|
-
[[ -f "$STATE_FILE" ]] || die "作業中のユースケースがありません。まず:
|
|
129
|
+
[[ -f "$STATE_FILE" ]] || die "作業中のユースケースがありません。まず: ./.spec-runner/scripts/spec-runner.sh init <ユースケース名>"
|
|
123
130
|
local phase
|
|
124
131
|
phase=$(state_get "phase")
|
|
125
132
|
[[ -n "$phase" ]] || die "ステートファイルが壊れています: $STATE_FILE"
|
|
@@ -156,7 +163,7 @@ check_status() {
|
|
|
156
163
|
return 0
|
|
157
164
|
else
|
|
158
165
|
fail "$label のステータスが '$status' です。'$required_status' が必要です"
|
|
159
|
-
info " レビュー後:
|
|
166
|
+
info " レビュー後: ./.spec-runner/scripts/spec-runner.sh review-pass $file"
|
|
160
167
|
return 1
|
|
161
168
|
fi
|
|
162
169
|
}
|
|
@@ -227,7 +234,7 @@ cmd_init() {
|
|
|
227
234
|
if [[ -z "$usecase" ]]; then
|
|
228
235
|
info "設定が完了しました。最初のユースケースを開始するには:"
|
|
229
236
|
echo ""
|
|
230
|
-
echo "
|
|
237
|
+
echo " ./.spec-runner/scripts/spec-runner.sh init \"ユースケース名\" \"集約名\""
|
|
231
238
|
echo ""
|
|
232
239
|
return 0
|
|
233
240
|
fi
|
|
@@ -282,7 +289,7 @@ cmd_init() {
|
|
|
282
289
|
# 要件定義ファイルをテンプレートから生成(templates/requirement/template.md を必須とする)
|
|
283
290
|
local req_file tmpl
|
|
284
291
|
req_file=$(uc_req)
|
|
285
|
-
tmpl="$
|
|
292
|
+
tmpl="$SPEC_RUNNER_DIR/templates/01_要件定義/ひな形.md"
|
|
286
293
|
[[ -f "$tmpl" ]] || die "要件テンプレートがありません: $tmpl (npx spec-runner でセットアップしてください)"
|
|
287
294
|
|
|
288
295
|
mkdir -p "$(dirname "$req_file")"
|
|
@@ -298,8 +305,8 @@ cmd_init() {
|
|
|
298
305
|
info "次のステップ:"
|
|
299
306
|
info " 1. $req_file を編集する"
|
|
300
307
|
info " 2. チームに確認してもらう"
|
|
301
|
-
info " 3.
|
|
302
|
-
info " 4.
|
|
308
|
+
info " 3. ./.spec-runner/scripts/spec-runner.sh review-pass $req_file"
|
|
309
|
+
info " 4. ./.spec-runner/scripts/spec-runner.sh design-high"
|
|
303
310
|
info "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
304
311
|
}
|
|
305
312
|
|
|
@@ -314,7 +321,7 @@ cmd_require() {
|
|
|
314
321
|
req_file=$(uc_req)
|
|
315
322
|
info "要件定義ファイル: $req_file"
|
|
316
323
|
info "編集後、チームに確認してもらい:"
|
|
317
|
-
info "
|
|
324
|
+
info " ./.spec-runner/scripts/spec-runner.sh review-pass $req_file"
|
|
318
325
|
}
|
|
319
326
|
|
|
320
327
|
# ── design-high ───────────────────────────────────────────────────────────────
|
|
@@ -410,8 +417,8 @@ TMPL
|
|
|
410
417
|
info "次のステップ:"
|
|
411
418
|
info " 1. $high_file を編集する"
|
|
412
419
|
info " 2. チームにレビューしてもらう"
|
|
413
|
-
info " 3.
|
|
414
|
-
info " 4.
|
|
420
|
+
info " 3. ./.spec-runner/scripts/spec-runner.sh review-pass $high_file"
|
|
421
|
+
info " 4. ./.spec-runner/scripts/spec-runner.sh design-detail domain"
|
|
415
422
|
}
|
|
416
423
|
|
|
417
424
|
# ── design-detail ─────────────────────────────────────────────────────────────
|
|
@@ -449,9 +456,9 @@ cmd_design_detail() {
|
|
|
449
456
|
|
|
450
457
|
echo ""
|
|
451
458
|
if $all_ok; then
|
|
452
|
-
info "全サブフェーズ完了。次:
|
|
459
|
+
info "全サブフェーズ完了。次: ./.spec-runner/scripts/spec-runner.sh test-design"
|
|
453
460
|
else
|
|
454
|
-
info "次のサブフェーズ:
|
|
461
|
+
info "次のサブフェーズ: ./.spec-runner/scripts/spec-runner.sh design-detail <domain|usecase|table|infra>"
|
|
455
462
|
fi
|
|
456
463
|
return
|
|
457
464
|
fi
|
|
@@ -520,7 +527,7 @@ cmd_design_detail() {
|
|
|
520
527
|
dest_file="$detail_dir/${sub_ja}.md"
|
|
521
528
|
mkdir -p "$detail_dir"
|
|
522
529
|
|
|
523
|
-
local tmpl="$
|
|
530
|
+
local tmpl="$SPEC_RUNNER_DIR/templates/03_詳細設計/${sub_ja}.md"
|
|
524
531
|
if [[ ! -f "$dest_file" ]]; then
|
|
525
532
|
if [[ -f "$tmpl" ]]; then
|
|
526
533
|
sed "s/{{USECASE}}/$usecase/g; s/{{DATE}}/$(date +%Y-%m-%d)/g" "$tmpl" > "$dest_file"
|
|
@@ -542,12 +549,12 @@ updated: $(date +%Y-%m-%d)
|
|
|
542
549
|
info "次のステップ:"
|
|
543
550
|
info " 1. $dest_file を編集する"
|
|
544
551
|
info " 2. チームにレビューしてもらう"
|
|
545
|
-
info " 3.
|
|
552
|
+
info " 3. ./.spec-runner/scripts/spec-runner.sh review-pass $dest_file"
|
|
546
553
|
case "$sub" in
|
|
547
|
-
domain) info " 4.
|
|
548
|
-
usecase) info " 4.
|
|
549
|
-
table) info " 4.
|
|
550
|
-
infra) info " 4.
|
|
554
|
+
domain) info " 4. ./.spec-runner/scripts/spec-runner.sh design-detail usecase" ;;
|
|
555
|
+
usecase) info " 4. ./.spec-runner/scripts/spec-runner.sh design-detail table" ;;
|
|
556
|
+
table) info " 4. ./.spec-runner/scripts/spec-runner.sh design-detail infra" ;;
|
|
557
|
+
infra) info " 4. ./.spec-runner/scripts/spec-runner.sh test-design" ;;
|
|
551
558
|
esac
|
|
552
559
|
}
|
|
553
560
|
|
|
@@ -637,8 +644,8 @@ TMPL
|
|
|
637
644
|
info " 1. $test_file を編集する(テスト設計)"
|
|
638
645
|
info " 2. テストコードを書く(実装前。Red状態でOK)"
|
|
639
646
|
info " 3. git commit でテストコードをコミット"
|
|
640
|
-
info " 4.
|
|
641
|
-
info " 5.
|
|
647
|
+
info " 4. ./.spec-runner/scripts/spec-runner.sh review-pass $test_file"
|
|
648
|
+
info " 5. ./.spec-runner/scripts/spec-runner.sh implement"
|
|
642
649
|
}
|
|
643
650
|
|
|
644
651
|
# ── implement ─────────────────────────────────────────────────────────────────
|
|
@@ -670,7 +677,7 @@ cmd_implement() {
|
|
|
670
677
|
((errors++))
|
|
671
678
|
else
|
|
672
679
|
warn "テストコードがコミット済みか未確認です"
|
|
673
|
-
warn "確認後:
|
|
680
|
+
warn "確認後: ./.spec-runner/scripts/spec-runner.sh set-gate test_code_committed"
|
|
674
681
|
fi
|
|
675
682
|
else
|
|
676
683
|
check_gate "test_code_committed" "テストコードのコミット確認" || ((errors++))
|
|
@@ -701,7 +708,7 @@ cmd_implement() {
|
|
|
701
708
|
info " 1. テストを Green にする実装を書く"
|
|
702
709
|
info " 2. 設計と乖離した場合は先にドキュメントを更新する"
|
|
703
710
|
info " 3. コードとドキュメントを同一コミットに含める"
|
|
704
|
-
info " 4. 完了後:
|
|
711
|
+
info " 4. 完了後: ./.spec-runner/scripts/spec-runner.sh complete"
|
|
705
712
|
warn "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
706
713
|
}
|
|
707
714
|
|
|
@@ -753,7 +760,7 @@ cmd_complete() {
|
|
|
753
760
|
# ── review-pass ───────────────────────────────────────────────────────────────
|
|
754
761
|
cmd_review_pass() {
|
|
755
762
|
local file="${1:-}"
|
|
756
|
-
[[ -n "$file" ]] || die "使い方:
|
|
763
|
+
[[ -n "$file" ]] || die "使い方: ./.spec-runner/scripts/spec-runner.sh review-pass <ファイルパス>"
|
|
757
764
|
[[ -f "$file" ]] || die "ファイルが存在しません: $file"
|
|
758
765
|
|
|
759
766
|
# frontmatterのstatusを更新
|
|
@@ -788,39 +795,39 @@ cmd_review_pass() {
|
|
|
788
795
|
tmp2="${file}.tmp.$$"
|
|
789
796
|
sed "s/^status: .*/status: approved/" "$file" > "$tmp2" && mv "$tmp2" "$file"
|
|
790
797
|
ok "ゲート更新: require_approved = true"
|
|
791
|
-
info "次: docs/03_用語集.md を確認後
|
|
792
|
-
info "
|
|
798
|
+
info "次: docs/03_用語集.md を確認後 ./.spec-runner/scripts/spec-runner.sh set-gate glossary_checked"
|
|
799
|
+
info " ./.spec-runner/scripts/spec-runner.sh design-high"
|
|
793
800
|
;;
|
|
794
801
|
*02_概要設計*)
|
|
795
802
|
state_set_bool "gates.high_level_reviewed" true
|
|
796
803
|
ok "ゲート更新: high_level_reviewed = true"
|
|
797
|
-
info "次:
|
|
804
|
+
info "次: ./.spec-runner/scripts/spec-runner.sh design-detail domain"
|
|
798
805
|
;;
|
|
799
806
|
*ドメイン*)
|
|
800
807
|
state_set_bool "gates.domain_model_reviewed" true
|
|
801
808
|
ok "ゲート更新: domain_model_reviewed = true"
|
|
802
|
-
info "次:
|
|
809
|
+
info "次: ./.spec-runner/scripts/spec-runner.sh design-detail usecase"
|
|
803
810
|
;;
|
|
804
811
|
*ユースケース*)
|
|
805
812
|
state_set_bool "gates.usecase_design_reviewed" true
|
|
806
813
|
ok "ゲート更新: usecase_design_reviewed = true"
|
|
807
|
-
info "次:
|
|
814
|
+
info "次: ./.spec-runner/scripts/spec-runner.sh design-detail table"
|
|
808
815
|
;;
|
|
809
816
|
*テーブル*)
|
|
810
817
|
state_set_bool "gates.table_design_reviewed" true
|
|
811
818
|
ok "ゲート更新: table_design_reviewed = true"
|
|
812
|
-
info "次:
|
|
819
|
+
info "次: ./.spec-runner/scripts/spec-runner.sh design-detail infra"
|
|
813
820
|
;;
|
|
814
821
|
*インフラ*)
|
|
815
822
|
state_set_bool "gates.infra_design_reviewed" true
|
|
816
823
|
ok "ゲート更新: infra_design_reviewed = true"
|
|
817
|
-
info "次:
|
|
824
|
+
info "次: ./.spec-runner/scripts/spec-runner.sh test-design"
|
|
818
825
|
;;
|
|
819
826
|
*04_テスト設計*)
|
|
820
827
|
state_set_bool "gates.test_design_reviewed" true
|
|
821
828
|
ok "ゲート更新: test_design_reviewed = true"
|
|
822
|
-
info "テストコードをコミット後:
|
|
823
|
-
info "その後:
|
|
829
|
+
info "テストコードをコミット後: ./.spec-runner/scripts/spec-runner.sh set-gate test_code_committed"
|
|
830
|
+
info "その後: ./.spec-runner/scripts/spec-runner.sh implement"
|
|
824
831
|
;;
|
|
825
832
|
esac
|
|
826
833
|
}
|
|
@@ -829,7 +836,7 @@ cmd_review_pass() {
|
|
|
829
836
|
cmd_set_gate() {
|
|
830
837
|
require_state
|
|
831
838
|
local gate="${1:-}"
|
|
832
|
-
[[ -n "$gate" ]] || die "使い方:
|
|
839
|
+
[[ -n "$gate" ]] || die "使い方: ./.spec-runner/scripts/spec-runner.sh set-gate <ゲート名>"
|
|
833
840
|
state_set_bool "gates.$gate" true
|
|
834
841
|
ok "ゲートフラグ設定: $gate = true"
|
|
835
842
|
}
|
|
@@ -909,7 +916,7 @@ cmd_status() {
|
|
|
909
916
|
status_show_foundation_reminder no_state
|
|
910
917
|
info "開始するには: チャットで /sr-初期化 <ユースケース名> またはターミナルで下記を実行してください。"
|
|
911
918
|
info " 例(チャット): /sr-初期化 会員登録 会員"
|
|
912
|
-
info " 例(ターミナル):
|
|
919
|
+
info " 例(ターミナル): ./.spec-runner/scripts/spec-runner.sh init 会員登録 会員"
|
|
913
920
|
return
|
|
914
921
|
fi
|
|
915
922
|
|
|
@@ -1000,7 +1007,7 @@ cmd_status() {
|
|
|
1000
1007
|
echo -e " 案内に従って該当ドキュメントを修正し、必要なら /sr-詳細設計 等から再実行。"
|
|
1001
1008
|
;;
|
|
1002
1009
|
*)
|
|
1003
|
-
echo -e "
|
|
1010
|
+
echo -e " ./.spec-runner/scripts/spec-runner.sh help でコマンド一覧を確認"
|
|
1004
1011
|
;;
|
|
1005
1012
|
esac
|
|
1006
1013
|
echo ""
|
|
@@ -1024,7 +1031,7 @@ cmd_status() {
|
|
|
1024
1031
|
# ── fix ───────────────────────────────────────────────────────────────────────
|
|
1025
1032
|
cmd_fix() {
|
|
1026
1033
|
local content="${1:-}"
|
|
1027
|
-
[[ -n "$content" ]] || die "使い方:
|
|
1034
|
+
[[ -n "$content" ]] || die "使い方: ./.spec-runner/scripts/spec-runner.sh fix <修正内容>"
|
|
1028
1035
|
|
|
1029
1036
|
echo ""
|
|
1030
1037
|
step "修正フロー: $content"
|
|
@@ -1068,7 +1075,7 @@ cmd_fix() {
|
|
|
1068
1075
|
;;
|
|
1069
1076
|
5)
|
|
1070
1077
|
info "テストを追加して実装を修正します"
|
|
1071
|
-
info " テストコード追加 → git commit →
|
|
1078
|
+
info " テストコード追加 → git commit → ./.spec-runner/scripts/spec-runner.sh implement"
|
|
1072
1079
|
;;
|
|
1073
1080
|
*)
|
|
1074
1081
|
die "無効な選択です"
|
|
@@ -1082,7 +1089,7 @@ cmd_fix() {
|
|
|
1082
1089
|
# ── hotfix ────────────────────────────────────────────────────────────────────
|
|
1083
1090
|
cmd_hotfix() {
|
|
1084
1091
|
local content="${1:-}"
|
|
1085
|
-
[[ -n "$content" ]] || die "使い方:
|
|
1092
|
+
[[ -n "$content" ]] || die "使い方: ./.spec-runner/scripts/spec-runner.sh hotfix <内容>"
|
|
1086
1093
|
|
|
1087
1094
|
local slug branch
|
|
1088
1095
|
slug=$(echo "$content" | tr ' ' '-' | tr -cd '[:alnum:]-' | cut -c1-30)
|
|
@@ -1134,7 +1141,7 @@ main() {
|
|
|
1134
1141
|
help|--help|-h)
|
|
1135
1142
|
echo ""
|
|
1136
1143
|
echo -e "${BOLD}使い方:${NC}"
|
|
1137
|
-
echo "
|
|
1144
|
+
echo " ./.spec-runner/scripts/spec-runner.sh <コマンド> [引数]"
|
|
1138
1145
|
echo ""
|
|
1139
1146
|
echo -e "${BOLD}新規開発フロー:${NC}"
|
|
1140
1147
|
echo " init [ユースケース名] [集約名] 引数なしで設定対話。名前を渡すとユースケース作成"
|
|
@@ -1158,7 +1165,7 @@ main() {
|
|
|
1158
1165
|
echo ""
|
|
1159
1166
|
;;
|
|
1160
1167
|
*)
|
|
1161
|
-
die "不明なコマンド: $cmd\n使い方:
|
|
1168
|
+
die "不明なコマンド: $cmd\n使い方: ./.spec-runner/scripts/spec-runner.sh help"
|
|
1162
1169
|
;;
|
|
1163
1170
|
esac
|
|
1164
1171
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**チャットで使うコマンド**。$ARGUMENTS にゲート名を指定し、以下を**ターミナルで実行**してください(例: `/sr-ゲート設定 glossary_checked`)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh set-gate $ARGUMENTS
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
引数が空の場合は、ユーザーに「ゲート名を指定してください(例: glossary_checked, test_code_committed)」と伝えてください。
|
package/templates/claude/.claude/commands/sr-/343/203/254/343/203/223/343/203/245/343/203/274.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**チャットで使うコマンド**。$ARGUMENTS にレビュー通過させるファイルパスを指定し、以下を**ターミナルで実行**してください(例: `/sr-レビュー docs/01_要件/顧客登録.md`)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh review-pass $ARGUMENTS
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
引数が空の場合は、ユーザーに「レビュー通過させるファイルパスを指定してください(例: docs/01_要件/顧客登録.md)」と伝えてください。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**チャットで使うコマンド**。$ARGUMENTS にはユーザーがスラッシュの後に続けて入力した文字列が入ります。以下を**ターミナルで実行**してください(例: ユーザーが `/sr-初期化 顧客登録 顧客管理` と入力した場合)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh init $ARGUMENTS
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
- **引数あり**(例: `顧客登録 顧客管理`): 未設定なら詳細設定の対話 → 続けてユースケース作成。
|
package/templates/claude/.claude/commands/sr-/350/251/263/347/264/260/350/250/255/350/250/210.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
以下を**必ずターミナルで実行**してください。$ARGUMENTS にはサブフェーズ(domain / usecase / table / infra)のいずれかを指定します(例: `/sr-詳細設計 domain`)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh design-detail $ARGUMENTS
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
引数が空、または domain / usecase / table / infra 以外の場合は、ユーザーに「サブフェーズを指定してください: domain, usecase, table, infra」と伝えてください。
|
|
@@ -69,7 +69,7 @@ if [[ "$should_block" == "true" ]]; then
|
|
|
69
69
|
cat <<MSG
|
|
70
70
|
{
|
|
71
71
|
"decision": "block",
|
|
72
|
-
"reason": "【フェーズゲート】現在のフェーズは '$phase' です。実装コードの生成は 'implement' フェーズでのみ許可されています。\n\n現在の状態を確認:
|
|
72
|
+
"reason": "【フェーズゲート】現在のフェーズは '$phase' です。実装コードの生成は 'implement' フェーズでのみ許可されています。\n\n現在の状態を確認: ./.spec-runner/scripts/spec-runner.sh status\n次のフェーズへ: ./.spec-runner/scripts/spec-runner.sh $next_cmd"
|
|
73
73
|
}
|
|
74
74
|
MSG
|
|
75
75
|
exit 2
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 開発ルール(Claude Code 向け)
|
|
2
2
|
|
|
3
|
-
このプロジェクトは
|
|
4
|
-
本ファイルは AI
|
|
3
|
+
このプロジェクトは **.spec-runner/scripts/spec-runner.sh** によるフェーズゲートで運用している。
|
|
4
|
+
本ファイルは AI 向けの指示であり、**.spec-runner/scripts/spec-runner.sh** はフェーズが通過していないと実行を拒否するため、設計をスキップできない。
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
**何かを実装する前に必ず実行せよ:**
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
`./.spec-runner/scripts/spec-runner.sh status`(チャットでは `/sr-状態`)で現在のフェーズを確認する。
|
|
13
13
|
|
|
14
14
|
`phase` が `implement` でない場合、実装コードを生成してはならない。
|
|
15
15
|
代わりに「現在のフェーズを確認してください」と伝えてユーザーに委ねよ。
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
1. **テスト設計** … `docs/04_テスト設計/<UC名>.md` を書く
|
|
24
24
|
2. **テストを先に書く(Red)** … 実装より前にテストコードを書き、失敗することを確認する
|
|
25
|
-
3. **テストコードをコミット** …
|
|
25
|
+
3. **テストコードをコミット** … `./.spec-runner/scripts/spec-runner.sh set-gate test_code_committed` でゲート通過
|
|
26
26
|
4. **実装で Green** … `implement` フェーズでテストを通す実装を書く
|
|
27
27
|
|
|
28
28
|
ドキュメントだけでなく**テストコードも必須**。テストを書かずに実装に進むことはできない。ゲートが `TEST_DIR` 配下の未コミットを検出し、コミットするまで `implement` に進めない。
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
### 自然言語・短いスラッシュでの依頼
|
|
42
42
|
|
|
43
|
-
ユーザーが `/init`・`/status`・`/design-high` などの短いスラッシュ、または「init して」「顧客登録で design-high まで進めて」などの自然言語で依頼した場合も、**必ず** 対応する
|
|
43
|
+
ユーザーが `/init`・`/status`・`/design-high` などの短いスラッシュ、または「init して」「顧客登録で design-high まで進めて」などの自然言語で依頼した場合も、**必ず** 対応する `./.spec-runner/scripts/spec-runner.sh` をターミナルで実行すること(上記の `/sr-*` と同じ動作)。
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
### require(要件定義)フェーズ
|
|
50
50
|
- `docs/01_要件/<UC名>.md` を編集する
|
|
51
51
|
- 実装・設計・テーブル定義は書かない
|
|
52
|
-
- 完了後:
|
|
52
|
+
- 完了後: `./.spec-runner/scripts/spec-runner.sh review-pass docs/01_要件/<UC名>.md`
|
|
53
53
|
|
|
54
54
|
### design-high(概要設計)フェーズ
|
|
55
55
|
- `docs/02_概要設計/<UC名>.md` を編集する
|
|
56
56
|
- ユースケース記述とドメインモデル候補の洗い出しのみ
|
|
57
57
|
- **具体的なメソッド定義・テーブルカラムは書かない**
|
|
58
58
|
- 新しい概念が出たら先に `docs/03_用語集.md` に追加する
|
|
59
|
-
- 完了後:
|
|
59
|
+
- 完了後: `./.spec-runner/scripts/spec-runner.sh review-pass docs/02_概要設計/<UC名>.md`
|
|
60
60
|
|
|
61
61
|
### design-detail(詳細設計)フェーズ
|
|
62
62
|
この順序で作業する:
|
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
### test-design(テスト設計)フェーズ
|
|
86
86
|
- `docs/04_テスト設計/<UC名>.md` を編集する
|
|
87
87
|
- **TDD: テストコードを実装より先に書く(Red 状態で OK)**
|
|
88
|
-
- テストコードをコミットしてから次へ:
|
|
89
|
-
- 完了後:
|
|
88
|
+
- テストコードをコミットしてから次へ: `./.spec-runner/scripts/spec-runner.sh set-gate test_code_committed`
|
|
89
|
+
- 完了後: `./.spec-runner/scripts/spec-runner.sh review-pass docs/04_テスト設計/<UC名>.md`
|
|
90
90
|
|
|
91
91
|
### implement(実装)フェーズ
|
|
92
92
|
- **TDD: テストを Green にする実装を書く**
|
|
93
93
|
- 設計と乖離した場合は先にドキュメントを更新する
|
|
94
94
|
- コードとドキュメントを同一コミットに含める
|
|
95
|
-
- 完了後:
|
|
95
|
+
- 完了後: `./.spec-runner/scripts/spec-runner.sh complete`
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# spec-runner(GitHub Copilot 用指示)
|
|
2
2
|
|
|
3
|
-
このプロジェクトは
|
|
3
|
+
このプロジェクトは **.spec-runner/scripts/spec-runner.sh** によるフェーズゲートで運用している。実装前に必ずフェーズを確認すること。
|
|
4
4
|
|
|
5
5
|
## 最優先
|
|
6
6
|
|
|
7
|
-
- 実装コードを書く前に **必ず**
|
|
7
|
+
- 実装コードを書く前に **必ず** `./.spec-runner/scripts/spec-runner.sh status` を実行する。
|
|
8
8
|
- `phase` が `implement` でないときは実装コードを生成しない。ユーザーに「現在のフェーズを確認してください」と伝える。
|
|
9
|
-
- ユーザーが「init して」「status 確認して」「design-high で進めて」などと言ったら、対応する
|
|
9
|
+
- ユーザーが「init して」「status 確認して」「design-high で進めて」などと言ったら、対応する `./.spec-runner/scripts/spec-runner.sh` をターミナルで実行する。
|
|
10
10
|
- スラッシュコマンド `/sr-初期化` などは `.github/prompts/*.prompt.md` に定義済み(コマンド名は日本語)。`tools: [shell]` でシェル実行される。
|
|
11
11
|
|
|
12
12
|
## TDD(テスト駆動)— デフォルトで有効
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
## フェーズとコマンド
|
|
18
18
|
|
|
19
19
|
- require → design-high → design-detail (domain → usecase → table → infra) → test-design → implement
|
|
20
|
-
- 各フェーズ完了時:
|
|
21
|
-
- ゲート:
|
|
22
|
-
- 実装完了:
|
|
23
|
-
- 修正:
|
|
20
|
+
- 各フェーズ完了時: `./.spec-runner/scripts/spec-runner.sh review-pass <該当ファイル>`
|
|
21
|
+
- ゲート: `./.spec-runner/scripts/spec-runner.sh set-gate glossary_checked` など
|
|
22
|
+
- 実装完了: `./.spec-runner/scripts/spec-runner.sh complete`
|
|
23
|
+
- 修正: `./.spec-runner/scripts/spec-runner.sh fix "内容"` / `./.spec-runner/scripts/spec-runner.sh hotfix "内容"`
|
|
24
24
|
|
|
25
25
|
詳細はプロジェクトの README を参照。
|
|
@@ -8,7 +8,7 @@ tools: ['shell']
|
|
|
8
8
|
**チャットで /sr-初期化 と入力して使う**。以下を**必ずシェルで実行**してください。
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
|
|
11
|
+
./.spec-runner/scripts/spec-runner.sh init ${input:args:ユースケース名 集約名(スペース区切り。集約名は省略可)}
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
- **引数あり**: 未設定なら詳細設定の対話 → ユースケース作成。
|
|
@@ -8,7 +8,7 @@ tools: ['shell']
|
|
|
8
8
|
以下を**必ずシェルで実行**してください。
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
|
|
11
|
+
./.spec-runner/scripts/spec-runner.sh design-detail ${input:sub:サブフェーズ(domain, usecase, table, infra)}
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
引数が無効な場合は、ユーザーに「domain, usecase, table, infra のいずれかを指定してください」と伝えてください。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**チャットで使うコマンド**。ユーザーが `/sr-ゲート設定` の後に続けて入力したゲート名で、以下を**ターミナルで実行**してください(例: `/sr-ゲート設定 glossary_checked`)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh set-gate <ユーザーが入力したゲート名>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
引数が空の場合は、ユーザーに「ゲート名を指定してください(例: glossary_checked, test_code_committed)」と伝えてください。
|
package/templates/cursor/.cursor/commands/sr-/343/203/254/343/203/223/343/203/245/343/203/274.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**チャットで使うコマンド**。ユーザーが `/sr-レビュー` の後に続けて入力したファイルパスで、以下を**ターミナルで実行**してください(例: `/sr-レビュー docs/01_要件/顧客登録.md`)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh review-pass <ユーザーが入力したファイルパス>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
引数が空の場合は、ユーザーに「レビュー通過させるファイルパスを指定してください」と伝えてください。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**チャットで使うコマンド**。ユーザーが `/sr-初期化` の後に続けて入力した文字列を引数として、以下を**ターミナルで実行**してください(例: ユーザーが `/sr-初期化 顧客登録 顧客管理` と入力した場合)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh init <ユーザーが入力した引数>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
- **引数あり**(例: `顧客登録 顧客管理`): 未設定なら詳細設定の対話 → 続けてユースケース作成。
|
package/templates/cursor/.cursor/commands/sr-/350/251/263/347/264/260/350/250/255/350/250/210.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
以下を**必ずターミナルで実行**してください。ユーザーが続けて入力したサブフェーズ(domain / usecase / table / infra)を渡します(例: `/sr-詳細設計 domain`)。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
6
|
+
./.spec-runner/scripts/spec-runner.sh design-detail <ユーザーが入力したサブフェーズ>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
引数が空、または domain / usecase / table / infra 以外の場合は、ユーザーに「サブフェーズを指定してください: domain, usecase, table, infra」と伝えてください。
|