@careerchain/stdd 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +44 -0
  2. package/assets/.claude/agents/code-reviewer.md +170 -0
  3. package/assets/.claude/agents/implementer.md +96 -0
  4. package/assets/.claude/agents/plan-writer.md +124 -0
  5. package/assets/.claude/agents/qa-engineer.md +133 -0
  6. package/assets/.claude/agents/spec-reviewer.md +173 -0
  7. package/assets/.claude/agents/spec-writer.md +194 -0
  8. package/assets/.claude/agents/test-reviewer.md +218 -0
  9. package/assets/.claude/docs/spec-driven-development-guide.md +436 -0
  10. package/assets/.claude/hooks/pre-push-check.sh +160 -0
  11. package/assets/.claude/settings.json +67 -0
  12. package/assets/.claude/skills/auto-implement/SKILL.md +168 -0
  13. package/assets/.claude/skills/auto-implement/references/github-project.md +54 -0
  14. package/assets/.claude/skills/auto-implement/references/phases.md +244 -0
  15. package/assets/.claude/skills/create-pr/SKILL.md +112 -0
  16. package/assets/.claude/skills/documenting-plans/SKILL.md +217 -0
  17. package/assets/.claude/skills/documenting-plans/templates/plan.md +182 -0
  18. package/assets/.claude/skills/documenting-specifications/SKILL.md +300 -0
  19. package/assets/.claude/skills/documenting-specifications/guides/error-handling.md +78 -0
  20. package/assets/.claude/skills/documenting-specifications/guides/stdd-violations.md +237 -0
  21. package/assets/.claude/skills/documenting-specifications/templates/requirements.md +184 -0
  22. package/assets/.claude/skills/documenting-specifications/templates/screen-items-definition.md +179 -0
  23. package/assets/.claude/skills/documenting-specifications/templates/tech-design.md +241 -0
  24. package/assets/.claude/skills/generating-wireframes/SKILL.md +121 -0
  25. package/assets/.claude/skills/generating-wireframes/examples/tob-form.html +497 -0
  26. package/assets/.claude/skills/generating-wireframes/examples/tob-list.html +536 -0
  27. package/assets/.claude/skills/generating-wireframes/examples/toc-form.html +493 -0
  28. package/assets/.claude/skills/generating-wireframes/examples/toc-list.html +538 -0
  29. package/assets/.claude/skills/generating-wireframes/guides/from-requirements.md +53 -0
  30. package/assets/.claude/skills/generating-wireframes/templates/index.html +472 -0
  31. package/assets/.claude/skills/generating-wireframes/templates/screen.html +480 -0
  32. package/assets/.claude/skills/introducing-stdd/SKILL.md +185 -0
  33. package/assets/.claude/skills/introducing-stdd/templates/introduction-plan.md +64 -0
  34. package/assets/.claude/skills/kaizen/SKILL.md +129 -0
  35. package/assets/.claude/skills/kaizen/references/code-examples.md +233 -0
  36. package/assets/.claude/skills/reverse-engineering-common-spec/SKILL.md +137 -0
  37. package/assets/.claude/skills/reverse-engineering-feature-spec/SKILL.md +463 -0
  38. package/assets/.claude/skills/reverse-engineering-feature-spec/guides/accuracy.md +215 -0
  39. package/assets/.claude/skills/reverse-engineering-feature-spec/guides/figma-capture.md +313 -0
  40. package/assets/.claude/skills/review-pr-with-agents/SKILL.md +159 -0
  41. package/assets/.claude/skills/searching-existing-solutions/SKILL.md +110 -0
  42. package/assets/.claude/skills/setup-stdd/SKILL.md +82 -0
  43. package/assets/.claude/skills/software-architecture/SKILL.md +260 -0
  44. package/assets/.claude/skills/starting-new-with-stdd/SKILL.md +142 -0
  45. package/assets/.claude/skills/starting-new-with-stdd/templates/bootstrap-plan.md +73 -0
  46. package/assets/.claude/skills/tailoring-spec-format/SKILL.md +103 -0
  47. package/assets/.claude/skills/verifying-consistency/SKILL.md +90 -0
  48. package/assets/stdd.config.yml.tpl +34 -0
  49. package/dist/cli.js +148 -0
  50. package/dist/cli.js.map +1 -0
  51. package/dist/install.js +121 -0
  52. package/dist/install.js.map +1 -0
  53. package/package.json +48 -0
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: software-architecture
3
+ description: |-
4
+ Clean Architecture・DDD ベースのソフトウェア設計ガイドライン。Library-First アプローチ、命名規則、アンチパターン回避を提供する。
5
+ when_to_use: |-
6
+ 「アーキテクチャ」「設計」「Clean Architecture」「DDD」「ドメイン駆動設計」「リファクタリング」「コード品質」「命名規則」「責務分離」に関する作業のとき。
7
+ allowed-tools: Read, Edit, Grep, Glob
8
+ ---
9
+
10
+ # ソフトウェアアーキテクチャ
11
+
12
+ Clean ArchitectureとDDD(ドメイン駆動設計)の原則に基づく、対象プロジェクトの設計ガイドライン。
13
+
14
+ ## Domain層の実装パターン
15
+
16
+ 対象プロジェクトのデータフローは以下の4層構造に従う:
17
+
18
+ ```
19
+ DB型(database.types.ts) → Entity型(models/) → Service(service/) → Server Actions(app/*/actions.ts)
20
+
21
+ Repository(repository/)
22
+ ```
23
+
24
+ ### 1. Entity層(models/)
25
+
26
+ **型定義とクラスの併用パターン**: 型で構造定義、クラスでビジネスロジックを実装する。
27
+
28
+ ```typescript
29
+ // domain/models/opportunity/index.ts
30
+
31
+ // 構造定義(Type)
32
+ export type OpportunityEntity = {
33
+ id: string;
34
+ title: string;
35
+ salary_min: number;
36
+ salary_max: number | null;
37
+ deleted_at: string | null;
38
+ };
39
+
40
+ // ロジック実装(Class)
41
+ export class Opportunity {
42
+ public readonly id: string;
43
+ public readonly salaryMin: number;
44
+
45
+ constructor(entity: OpportunityEntity) {
46
+ this.id = entity.id;
47
+ this.salaryMin = entity.salary_min;
48
+ }
49
+
50
+ isHighPay(): boolean {
51
+ return this.salaryMin >= 1000000;
52
+ }
53
+
54
+ isDeleted(): boolean {
55
+ return this.deletedAt !== null;
56
+ }
57
+
58
+ // Entity型 → UI型への変換
59
+ toJob(): Job {
60
+ return {
61
+ id: this.id,
62
+ salary: this.formatSalary(),
63
+ highPay: this.isHighPay(),
64
+ };
65
+ }
66
+ }
67
+ ```
68
+
69
+ **判断基準**: ビジネスルールが含まれる場合はClass、単純なデータ構造ならTypeのみで十分。
70
+
71
+ ### 2. Repository層(repository/)
72
+
73
+ **Interface + 実装クラスパターン**: テスト時のモック差し替えを可能にする。
74
+
75
+ ```typescript
76
+ // domain/repository/saved-agent/index.ts
77
+
78
+ export interface ISavedAgentRepository {
79
+ create(userId: string, agentId: string): Promise<SavedAgent>;
80
+ findByUserAndAgent(
81
+ userId: string,
82
+ agentId: string,
83
+ ): Promise<SavedAgent | null>;
84
+ softDeleteByUserAndAgent(
85
+ userId: string,
86
+ agentId: string,
87
+ ): Promise<SavedAgent | null>;
88
+ }
89
+
90
+ export class SavedAgentRepository implements ISavedAgentRepository {
91
+ private admin = createSupabaseAdmin();
92
+
93
+ async create(userId: string, agentId: string): Promise<SavedAgent> {
94
+ const { data, error } = await this.admin
95
+ .from('saved_agents')
96
+ .insert({ user_id: userId, agent_id: agentId })
97
+ .select()
98
+ .single();
99
+
100
+ if (error?.code === '23505') {
101
+ throw new Error('既に保存済みです');
102
+ }
103
+ if (error) throw error;
104
+ return SavedAgent.fromDatabase(data);
105
+ }
106
+ }
107
+ ```
108
+
109
+ **パフォーマンス最適化の定石**:
110
+
111
+ | 手法 | 実装例 |
112
+ | ---------- | ------------------------------------------------------------ |
113
+ | N+1回避 | 一括取得後にMapで結合: `new Map(agents.map(a => [a.id, a]))` |
114
+ | 計数最適化 | `.select('*', { count: 'exact', head: true })` |
115
+ | 並列化 | `Promise.all([countQuery, dataQuery])` |
116
+ | 論理削除 | `.is('deleted_at', null)` を常に付与 |
117
+
118
+ ### 3. Service層(service/)
119
+
120
+ **Repository間の連携とビジネスロジックの集約場所**。
121
+
122
+ ```typescript
123
+ // domain/service/saved-agent/index.ts
124
+ export class SavedAgentService {
125
+ private repository: ISavedAgentRepository;
126
+
127
+ constructor(repo?: ISavedAgentRepository) {
128
+ this.repository = repo || new SavedAgentRepository();
129
+ }
130
+
131
+ async toggle(userId: string, agentId: string): Promise<{ isSaved: boolean }> {
132
+ const existing = await this.repository.findByUserAndAgent(userId, agentId);
133
+
134
+ if (existing && !existing.isDeleted()) {
135
+ await this.repository.softDeleteByUserAndAgent(userId, agentId);
136
+ return { isSaved: false };
137
+ }
138
+
139
+ if (existing && existing.isDeleted()) {
140
+ await this.repository.restore(userId, agentId);
141
+ return { isSaved: true };
142
+ }
143
+
144
+ await this.repository.create(userId, agentId);
145
+ return { isSaved: true };
146
+ }
147
+ }
148
+ ```
149
+
150
+ **Service層の役割判断**:
151
+
152
+ - ビジネスロジックがない場合: Repositoryを直接呼んでもよい(不要な委譲層は作らない)
153
+ - 複数Repositoryの連携が必要な場合: Serviceで集約する
154
+ - 型変換(Entity → UI型): Entity自身の`toXxx()`メソッド、またはServiceで実装
155
+
156
+ ### 4. Server Actions
157
+
158
+ **APIルートよりServer Actionsを優先**する。戻り値は `{ success, error?, data? }` 形式で統一。
159
+
160
+ ```typescript
161
+ // app/feature/actions.ts
162
+ 'use server';
163
+
164
+ export async function approveCertification(id: string) {
165
+ try {
166
+ const certification = await certificationRepository.getById(id);
167
+ if (!certification) {
168
+ return { success: false, error: '証明書が見つかりません' };
169
+ }
170
+
171
+ if (!certification.canApprove()) {
172
+ return { success: false, error: '承認できない状態です' };
173
+ }
174
+
175
+ const approved = certification.approve();
176
+ await certificationRepository.update(approved);
177
+ await sendApprovalNotification(certification.userId);
178
+
179
+ return { success: true };
180
+ } catch (error) {
181
+ console.error('Approval error:', error);
182
+ return { success: false, error: '承認処理中にエラーが発生しました' };
183
+ }
184
+ }
185
+ ```
186
+
187
+ ## コードスタイルルール
188
+
189
+ ### 基本原則
190
+
191
+ - **Early return**: ネストを減らすため、ガード節で早期リターンする
192
+ - **Arrow functions**: function宣言よりアロー関数を優先
193
+ - **関数の長さ**: 50行を超えたら分割を検討
194
+ - **ファイルの長さ**: 200行を超えたら分割を検討
195
+ - **ネストの深さ**: 最大3レベル
196
+ - **コード重複回避**: 再利用可能な関数・モジュールに切り出す
197
+
198
+ ### Library-Firstアプローチ
199
+
200
+ カスタムコードを書く前に、既存のライブラリ・サービスを検討する。すべてのカスタムコードは保守・テスト・ドキュメントのコストを伴うため、ライブラリで解決できるならそちらを優先する。
201
+
202
+ **カスタムコードが正当化される場合**:
203
+
204
+ - ドメイン固有のビジネスロジック
205
+ - パフォーマンスクリティカルな処理
206
+ - 既存ライブラリが要件を満たさない場合
207
+
208
+ ### 命名規則
209
+
210
+ | 対象 | ルール | 例 |
211
+ | ----------------- | ---------------------------------- | ----------------------------- |
212
+ | Entity型 | `XxxEntity` | `UserEntity`, `ProjectEntity` |
213
+ | Repository | `IXxxRepository` / `XxxRepository` | `IProjectRepository` |
214
+ | Service | `XxxService` | `OpportunityService` |
215
+ | Server Action関数 | camelCase + 動詞 | `createProject`, `updateUser` |
216
+ | ファイル/フォルダ | kebab-case | `saved-agent/index.ts` |
217
+
218
+ **避けるべき名前**: `utils`, `helpers`, `common`, `shared`, `misc`
219
+ → ドメイン固有の名前を使う: `SalaryFormatter`, `CertificationValidator`
220
+
221
+ ### アンチパターン
222
+
223
+ | アンチパターン | 代わりに |
224
+ | ---------------------------- | -------------------------------------------- |
225
+ | `utils.ts`に雑多な関数を集約 | ドメインごとにモジュール分割 |
226
+ | Repositoryにビジネスロジック | Service層に分離 |
227
+ | UIコンポーネント内でDB操作 | Server Actions経由 |
228
+ | 使用箇所1つで抽象化 | Rule of Three: 3箇所以上で重複してから抽象化 |
229
+ | `as`型キャスト | 型注釈、`satisfies`、明示的マッピング関数 |
230
+ | `!`非nullアサーション | `assert()`で明示チェック |
231
+
232
+ > コーディング規約の詳細は `.claude/docs/coding-conventions.md`(存在する場合)を参照
233
+
234
+ ## 設計判断のガイドライン
235
+
236
+ ### サーバーコンポーネント vs クライアントコンポーネント
237
+
238
+ | 基準 | サーバーコンポーネント | クライアントコンポーネント |
239
+ | ---------------- | ---------------------- | ---------------------------- |
240
+ | データ取得 | DB直接アクセス可能 | Server Actions経由 |
241
+ | インタラクション | なし | フォーム、モーダル、状態管理 |
242
+ | SEO | 対応 | 非対応 |
243
+
244
+ **原則**: デフォルトはサーバーコンポーネント。`'use client'`はインタラクションが必要な場合のみ。
245
+
246
+ ### 責務の配置判断
247
+
248
+ ```
249
+ Q1. 単純なCRUD操作? → Repository
250
+ Q2. 複数Entity間のロジック? → Service
251
+ Q3. Entity自身の状態チェック/変換? → Entity(Model)のメソッド
252
+ Q4. UI操作のエントリーポイント? → Server Action
253
+ Q5. 表示のための計算/整形? → コンポーネント or Entity.toXxx()
254
+ ```
255
+
256
+ ## When NOT to Use This Skill
257
+
258
+ - **UI実装のみ**: `implementing-ui` skillを使用
259
+ - **DBマイグレーション**: `migrating-supabase` skillを使用
260
+ - **テスト作成**: `e2e-testing` skillを使用
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: starting-new-with-stdd
3
+ description: |-
4
+ 新規(コードがまだ無い)プロジェクトを STDD で立ち上げる作業を、Claude セッションで段階的に駆動する。立ち上げガイドに従い、アプリ骨組み生成→common ティアの前方設計→最初の feature→フォーマット策定→feature ループ→通常運用への移行までを、既存スキル(documenting-specifications / generating-wireframes / tailoring-spec-format / documenting-plans / auto-implement / verifying-consistency)を順に呼びながら進める。進捗は立ち上げPLANで保持し、セッションを跨いで再開できる。既に稼働しているコードへの導入は introducing-stdd を使う。
5
+ when_to_use: |-
6
+ 新規(コードがまだ無い)プロジェクトの立ち上げを進める/再開するとき。「新規プロジェクトをstddで立ち上げる」「立ち上げの続き」「greenfield stdd」など、新規フローと確定している場合。新規/既存が未確定の最初の入口は setup-stdd(ルーター)が判定して本スキルへ委譲する。
7
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash
8
+ ---
9
+
10
+ # STDD 立ち上げドライバー(新規プロジェクト)
11
+
12
+ 新規プロジェクトの STDD 立ち上げを、セッションで 1 ステップずつ進めるための**薄い駆動役**。
13
+ 自前の実装ロジックは持たず、各ステップで**既存スキルを順に呼び**、人間判断ポイントで停止し、進捗を**立ち上げPLAN**に記録する。
14
+
15
+ > 「なぜ」「各ステップで何を判断するか」は [`guide-for-new-project.md`](../../../packages/core/docs/guide-for-new-project.md) を参照。
16
+ > 本スキルはその operational な実行役。既存(稼働中)プロジェクトへの導入は [`introducing-stdd`](../introducing-stdd/SKILL.md)。
17
+
18
+ ## 設計方針(重要)
19
+
20
+ - **agent オーケストレーションはしない**。Claude がメインセッションで手順を進める軽量ドライバー。
21
+ - 立ち上げは判断主体のため、**人間を常にループに入れる**(アーキ判断・フォーマット策定・粒度は必ず確認)。
22
+ - 状態は立ち上げPLAN(`docs/common/plans/stdd-bootstrap.md`)にのみ持つ。本スキルはステートレス。
23
+ - 新規は**最初から順行**(Spec → Test → 実装)。`reverse-engineering-*`(遡行)は使わない。
24
+
25
+ ---
26
+
27
+ ## 起動時の動作
28
+
29
+ ### 1. 立ち上げPLAN の有無を確認
30
+
31
+ ```
32
+ docs/common/plans/stdd-bootstrap.md
33
+ ```
34
+
35
+ - **無い場合 → 初回**: 下記「初回フロー」を実行し、立ち上げPLAN を作成する。
36
+ - **ある場合 → 再開**: 立ち上げPLAN を読み、最初の未チェック項目(`- [ ]`)を「次にやること」として提示し、該当ステップを実行する。
37
+
38
+ ### 2. 設定確認
39
+
40
+ `.stdd.config.yml` を読み、`apps[]` / `commands` / `docs.layout`(`common_requirements` / `common_architecture` 含む)を把握する。
41
+ `npx @careerchain/stdd init` で導入済みなら揃っている。無ければ step 0 を案内する。
42
+
43
+ ---
44
+
45
+ ## ステップ実行表
46
+
47
+ 各ステップは「呼ぶスキル」と「停止して人間に確認すること」を持つ。
48
+
49
+ | step | 実行内容 | 呼ぶスキル | ★停止して確認 |
50
+ | ---- | -------- | ---------- | ------------- |
51
+ | 0 | scaffold / `.stdd.config.yml` 点検(common ティア前提) | — | 構成(単一/複数アプリ・パス規約) |
52
+ | 1 | **アプリ骨組みを対話駆動**(stack 固有) | (stack 手順へ委譲。下記「step 1」詳細) | ★ 構成・コマンド疎通 |
53
+ | 2 | **common ティアを前方設計**(docs/common を埋める) | `documenting-specifications` | ★ 目的・アクター・初期アーキ |
54
+ | 3 | 最初の feature を順行 spec 化(P0 コアから 1 本) | `documenting-specifications` → `generating-wireframes` | ★ Spec 粒度・スコープ |
55
+ | 4 | フォーマット策定 → テンプレ特化 | `tailoring-spec-format` | ★★ フォーマット決定 |
56
+ | 5 | feature を順行 STDD でループ | `documenting-plans` → `auto-implement` | ★ 機能ごとの粒度 |
57
+ | 6 | 通常運用へ移行 | `auto-implement`(以降) | 立ち上げ完了の確認 |
58
+
59
+ 各 feature 実装後は `verifying-consistency` で spec ⇔ test ⇔ 実装 の整合を確認する。
60
+
61
+ ---
62
+
63
+ ## 初回フロー(立ち上げPLAN が無いとき)
64
+
65
+ 1. **scaffold 確認**: `npx @careerchain/stdd init` の導入物(`.stdd.config.yml`・`.claude/`・`docs/`)が揃っているか点検。未導入なら `npx @careerchain/stdd init` を案内。
66
+ 2. **step 1(アプリ骨組み)**: 下記「step 1」手順で stack 固有の骨組み生成を対話駆動。
67
+ 3. **step 2(★人間判断)**: `documenting-specifications` で `docs/common/REQUIREMENTS.md` + `ARCHITECTURE.md` を**前方設計**(仮説として埋める)。
68
+ 4. **step 3(★人間判断)**: P0 コア機能を 1 つ選び、順行で feature spec を作る。
69
+ 5. **立ち上げPLAN 生成**: `templates/bootstrap-plan.md` を雛形に `docs/common/plans/stdd-bootstrap.md` を作成し、想定 feature を優先順で並べる。
70
+ 6. 「次は step 4(フォーマット策定)」を提示して停止。
71
+
72
+ ---
73
+
74
+ ## 再開フロー(立ち上げPLAN があるとき)
75
+
76
+ 1. 立ち上げPLAN を読み、完了済み(`- [x]`)と未着手(`- [ ]`)を把握。
77
+ 2. 最初の未着手項目を「次にやること」として 1 つ提示。
78
+ 3. ユーザーの了承後、該当ステップのスキルを呼んで実行。
79
+ 4. 完了したら立ち上げPLAN の該当項目を `- [x]` に更新し、フォーマット決定があれば「決定ログ」に追記。
80
+ 5. 次の未着手を提示して停止(**一度に 1 ステップ**。バッチ全自動にしない)。
81
+
82
+ ---
83
+
84
+ ## step 1: アプリ骨組みの対話駆動(詳細)
85
+
86
+ 新規はアプリ本体がまだ無いので、stack 固有の骨組み(フレームワーク・DB・E2E)を立てる。
87
+ **本スキルは stack 非依存**なので、コマンドの実体は持たず、使用中の stack 手順を SSoT として参照・実行支援する。
88
+
89
+ ### 1-1. stack の特定
90
+
91
+ `.stdd.config.yml` の `plugins` / `apps[].framework` を読み、骨組み手順の所在を決める。
92
+
93
+ ```
94
+ □ plugins に "nextjs-supabase" / "playwright" → nextjs+supabase+playwright スターター手順
95
+ (生成元テンプレートの README「次の手順」が SSoT)
96
+ □ それ以外 / 不明 → ユーザーに stack と骨組み手順を確認
97
+ ```
98
+
99
+ ### 1-2. 骨組み生成を対話駆動
100
+
101
+ 該当手順のコマンド(例: `create-next-app` / `supabase init` / Playwright 導入)を**1つずつ提示し、ユーザーの確認のもと実行**する。具体コマンドは本スキルに書かず、参照先(テンプレート README / プラグイン guide)の記述に従う。
102
+
103
+ ### 1-3. 設定の実体合わせ(★確認)
104
+
105
+ ```
106
+ □ apps[].path / apps[].port が実体と一致
107
+ □ commands.test / typecheck / build / db_* が実際に動く
108
+ ```
109
+
110
+ > 骨組みが既に用意されている場合は step 1 を飛ばして step 2 へ。
111
+
112
+ ---
113
+
114
+ ## 守ること
115
+
116
+ - **一度に 1 ステップ**。複数 feature を無確認で連続処理しない。
117
+ - **★ポイントでは必ず停止**してユーザーに聞く(アーキ判断・粒度・フォーマット)。
118
+ - common ティアは**前方設計=仮説**。作り込みすぎず、feature 開発で検証して更新する。確定しない箇所は `<!-- 未決: ... -->` で残す。
119
+ - 立ち上げPLAN 以外に進捗・履歴を持たない(SSOT 原則。spec 本体に「今回」「変更前」等を書かない)。
120
+ - 遡行スキル(`reverse-engineering-*`)は使わない(新規にはコードが無い)。
121
+
122
+ ---
123
+
124
+ ## When NOT to Use This Skill
125
+
126
+ - **既に稼働しているコード**への STDD 導入: `introducing-stdd` を使う
127
+ - **単一機能の spec を書く / 実装する**だけ: `documenting-specifications` / `auto-implement` を直接使う
128
+ - **フォーマット策定だけ**やり直したい: `tailoring-spec-format` を直接使う
129
+
130
+ ---
131
+
132
+ ## 参照ファイル
133
+
134
+ - **立ち上げガイド(なぜ/判断基準)**: [guide-for-new-project.md](../../../packages/core/docs/guide-for-new-project.md)
135
+ - **立ち上げPLAN テンプレート**: [templates/bootstrap-plan.md](templates/bootstrap-plan.md)
136
+ - **common / feature spec 作成**: [documenting-specifications skill](../documenting-specifications/SKILL.md)
137
+ - **ワイヤーフレーム**: [generating-wireframes skill](../generating-wireframes/SKILL.md)
138
+ - **フォーマット策定・テーラリング**: [tailoring-spec-format skill](../tailoring-spec-format/SKILL.md)
139
+ - **PLAN 作成**: [documenting-plans skill](../documenting-plans/SKILL.md)
140
+ - **順行実装**: [auto-implement skill](../auto-implement/SKILL.md)
141
+ - **整合性チェック**: [verifying-consistency skill](../verifying-consistency/SKILL.md)
142
+ - **既存プロジェクトへの導入**: [introducing-stdd skill](../introducing-stdd/SKILL.md)
@@ -0,0 +1,73 @@
1
+ <!--
2
+ 立ち上げPLAN — STDD 新規立ち上げの進捗を保持するプロジェクト単位の生きたチェックリスト。
3
+
4
+ 位置づけ:
5
+ - feature/session 単位の通常 PLAN とは別。プロジェクト全体の「立ち上げ」進捗を 1 ファイルで追跡する。
6
+ - starting-new-with-stdd スキルがこのファイルを読み書きしながら立ち上げを駆動する。
7
+ - 立ち上げが一巡(通常運用へ移行)したら役目を終える。
8
+ - 既存プロジェクト導入の導入PLAN(stdd-introduction.md)とは排他(新規 or 既存のどちらか)。
9
+
10
+ 配置:
11
+ docs/common/plans/stdd-bootstrap.md
12
+
13
+ 書き換え方:
14
+ プレースホルダを実値に置換。feature は想定機能を優先順(P0→P1→P2)で並べる。
15
+ 完了した項目は [ ] → [x] にする。フォーマット決定は「決定ログ」に追記する。
16
+ -->
17
+
18
+ # STDD 立ち上げPLAN — [サービス名]
19
+
20
+ > 進捗トラッカー。詳細手順は `starting-new-with-stdd` スキル / `guide-for-new-project.md` を参照。
21
+ > **開始**: [yyyy-mm-dd] / **基準ブランチ**: [main / develop 等]
22
+
23
+ ---
24
+
25
+ ## 進捗
26
+
27
+ ### 基盤
28
+
29
+ - [ ] step 0: `.stdd.config.yml` 点検(common ティア前提)
30
+ - [ ] step 1: アプリ骨組み生成(stack 固有。`apps[].path` / `commands.*` 疎通確認)
31
+ - [ ] step 2: common ティアを前方設計(`docs/common/REQUIREMENTS.md` + `ARCHITECTURE.md`。仮説)
32
+ - [ ] step 3: 最初の feature を順行 spec 化([機能名])
33
+ - [ ] step 4: フォーマット策定 → テンプレ特化(下記「決定ログ」へ)
34
+
35
+ ### feature ループ(step 5)
36
+
37
+ 優先順(P0 → P1 → P2)。各 feature = `documenting-plans` → `auto-implement` → `verifying-consistency`。
38
+
39
+ - [ ] [機能A] (P0)
40
+ - [ ] [機能B] (P0)
41
+ - [ ] [機能C] (P1)
42
+ - [ ] [機能D] (P2)
43
+
44
+ ### 移行
45
+
46
+ - [ ] step 6: feature が回り始めた → 以降は `auto-implement`(通常運用)へ
47
+
48
+ ---
49
+
50
+ ## フォーマット決定ログ(step 4 / 運用中のブラッシュアップ)
51
+
52
+ このプロジェクト固有に決めた spec フォーマットの方針を記録する。
53
+
54
+ - 必須 spec ファイル: [REQUIREMENTS / TECH_DESIGN / ...]
55
+ - common ARCHITECTURE に追加した固有セクション: [認証・認可 / RLS / ...]
56
+ - docs.layout パス規約: [docs/<app>/<feature>/...]
57
+ - Priority 基準: [このプロジェクトでの P0/P1/P2 の定義]
58
+ - テスト層の責務分担: [E2E は P0 のみ 等]
59
+
60
+ ---
61
+
62
+ ## 前方設計の未決事項(common ティア)
63
+
64
+ 前方設計で仮置きした・確定していない事項。feature 開発で検証して埋める。
65
+
66
+ - [ ] [未決事項1]
67
+ - [ ] [未決事項2]
68
+
69
+ ---
70
+
71
+ ## メモ・引き継ぎ
72
+
73
+ - (セッションを跨ぐ際の注意点・保留事項)
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: tailoring-spec-format
3
+ description: |-
4
+ このプロジェクト固有の spec フォーマット / ラインナップを策定し、テンプレートや設定へ反映する。STDD 導入(既存)・立ち上げ(新規)の初期フォーマット策定と、運用中のブラッシュアップの両方を担う。common spec と最初の feature spec を素材に、必須/任意の spec ファイル構成・固有セクション・docs.layout・Priority 基準・テスト層責務・命名を決め、決定を導入PLAN / 立ち上げPLANに記録してテンプレ/設定へ反映する。個別機能の spec 作成は documenting-specifications を使う。
5
+ when_to_use: |-
6
+ 「specフォーマット策定」「テンプレ特化」「テーラリング」「spec構成を決める」「specフォーマットのブラッシュアップ」「STDDをプロジェクトに合わせる」に関する作業のとき。
7
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash
8
+ ---
9
+
10
+ # spec フォーマットのテーラリング
11
+
12
+ STDD のテンプレートを**このプロジェクト固有**に仕立て直す(テーラリング)。
13
+ STDD 導入(既存プロジェクト, step 3-4)・立ち上げ(新規プロジェクト, step 4)の **初期フォーマット策定** と、運用中の **ブラッシュアップ**(step 7)を担う。
14
+
15
+ > 導入/立ち上げフロー全体は [`guide-for-existing-project.md`](../../../packages/core/docs/guide-for-existing-project.md) / [`guide-for-new-project.md`](../../../packages/core/docs/guide-for-new-project.md)、
16
+ > 駆動役は [`introducing-stdd`](../introducing-stdd/SKILL.md)(既存)/ [`starting-new-with-stdd`](../starting-new-with-stdd/SKILL.md)(新規)を参照。本スキルは単体でも呼べる。
17
+
18
+ ## 設計方針(重要)
19
+
20
+ - **フォーマットの決定そのものは人間**(ビジネス・チーム判断)。本スキルはそれを**促し・記録し・反映する**手続きに徹する。
21
+ - **agent オーケストレーションはしない**。Claude がメインセッションで決定ポイントを 1 つずつ提示し、人間に決めてもらう。
22
+ - 決定は **導入PLAN / 立ち上げPLAN の「フォーマット決定ログ」** に集約(SSOT)。spec 本体に経緯・履歴を書かない。
23
+
24
+ ## 前提(素材)
25
+
26
+ - **初期**: `docs/common/`(common spec)と最初の feature spec 1 つが既にある(既存導入なら reverse、新規立ち上げなら順行で作成)。
27
+ - **ブラッシュアップ**: 既に複数の feature spec が運用されている。
28
+
29
+ ---
30
+
31
+ ## 手順
32
+
33
+ ### 1. 素材レビュー
34
+
35
+ 現状を把握する。
36
+
37
+ ```
38
+ □ docs/common/REQUIREMENTS.md / ARCHITECTURE.md(common ティアの構成)
39
+ □ 代表 feature spec(REQUIREMENTS.md / TECH_DESIGN.md)の実物
40
+ □ 現在の .stdd.config.yml(docs.layout / apps / commands)
41
+ □ 利用中のテンプレ(packages/core/templates/ または プロジェクト側コピー)
42
+ □ (step 7 のみ) 運用中の全 feature spec のばらつき・過不足
43
+ ```
44
+
45
+ ### 2. 決定ポイントを 1 つずつ提示(★人間が決める)
46
+
47
+ 各項目について **現状 → 選択肢 → 推奨** を提示し、ユーザーに決めてもらう。一度に押し付けない。
48
+
49
+ | 決定ポイント | 論点 | 反映先 |
50
+ | ------------ | ---- | ------ |
51
+ | **spec ファイル構成** | 必須/任意(REQUIREMENTS / TECH_DESIGN / SCREEN_ITEMS_DEFINITION / wireframes)をどう組むか | プロジェクトのテンプレ・運用ルール |
52
+ | **common 固有セクション** | common ARCHITECTURE に足す横断トピック(認証・認可 / RLS・権限 / 通知 / 監査ログ 等) | `docs/common/ARCHITECTURE.md` |
53
+ | **docs.layout パス規約** | 単一/複数アプリ、`feature_path` の切り方、common の置き場 | `.stdd.config.yml` の `docs.layout` |
54
+ | **Priority 基準** | このプロジェクトでの P0/P1/P2 の具体定義(何を Critical とするか) | テンプレ注記 + 決定ログ |
55
+ | **テスト層の責務分担** | E2E/Integration/Unit の線引き(既存テスト資産に合わせる) | TECH_DESIGN テンプレのテスト戦略節 |
56
+ | **命名・用語** | プロジェクト固有語彙(アクター名・ドメイン用語)、テンプレのプレースホルダ実値化 | テンプレ・common spec |
57
+
58
+ ### 3. 決定を記録
59
+
60
+ `docs/common/plans/` の PLAN(既存導入: `stdd-introduction.md` / 新規立ち上げ: `stdd-bootstrap.md`)の **「フォーマット決定ログ」** に各決定を追記する。
61
+ PLAN が無い文脈(ブラッシュアップ単体実行など)では、プロジェクトの spec 規約ドキュメント(例: `docs/common/SPEC_CONVENTIONS.md`)に記録してよい。
62
+
63
+ ### 4. テンプレ・設定へ反映(機械的)
64
+
65
+ 決定に従って、**プロジェクト側**の成果物を更新する(STDD core の `packages/core/templates/` 本体は壊さない)。
66
+
67
+ ```
68
+ □ .stdd.config.yml の docs.layout を更新(必要なら common_* を追加/変更)
69
+ □ docs/common/ARCHITECTURE.md に固有セクションを追加
70
+ □ プロジェクト側テンプレ(コピーを持つ場合)の不要セクション削除 / 固有セクション追加 / プレースホルダ実値化
71
+ □ プロジェクト側テンプレを持たない場合は、決定ログに「次に作る feature spec へ適用する方針」として明記
72
+ ```
73
+
74
+ ### 5. (step 7 のみ)既存 spec への影響を洗い出す
75
+
76
+ フォーマットを変えた場合、運用中の feature spec に差分が出る。影響範囲を一覧化してユーザーに提示し、修正は別タスク(必要なら PLAN を切る)として扱う。一括自動修正はしない。
77
+
78
+ ---
79
+
80
+ ## 守ること
81
+
82
+ - **決定は人間**。skill は選択肢提示・記録・反映に徹する。
83
+ - 一度に全項目を片付けず、**決定ポイントごとに合意**を取る。
84
+ - **STDD core テンプレ(`packages/core/templates/`)を直接編集しない**。反映先はプロジェクト側。
85
+ - 決定は決定ログに集約し、spec 本体に経緯・「変更前/後」を書かない(SSOT)。
86
+
87
+ ---
88
+
89
+ ## When NOT to Use This Skill
90
+
91
+ - **個別機能の spec を書く**: `documenting-specifications` を使う
92
+ - **既存実装から spec を起こす**: `reverse-engineering-feature-spec` / `reverse-engineering-common-spec` を使う
93
+ - **導入フロー全体を進める**: `introducing-stdd`(本スキルを step 3-4 / 7 で呼ぶ)
94
+
95
+ ---
96
+
97
+ ## 参照ファイル
98
+
99
+ - **導入ガイド(なぜ/判断基準)**: [guide-for-existing-project.md](../../../packages/core/docs/guide-for-existing-project.md) §step 3-4
100
+ - **導入ドライバー**: [introducing-stdd skill](../introducing-stdd/SKILL.md)
101
+ - **spec テンプレ**: `packages/core/templates/`(feature) / `packages/core/templates/common/`(common)
102
+ - **spec 作成スキル**: [documenting-specifications skill](../documenting-specifications/SKILL.md)
103
+ - **設定スキーマ**: `packages/core/schema/.stdd.config.schema.json`
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: verifying-consistency
3
+ description: |-
4
+ Spec(REQUIREMENTS.md / TECH_DESIGN.md)⇔ テスト ⇔ 実装 の整合性を機能単位でチェックする。ブランチ分岐点からの差分を抽出し、要件・設計・テスト・実装の不整合(機能漏れ、テスト漏れ、設計と実装の乖離など)を検出する。
5
+ when_to_use: |-
6
+ 「整合性チェック」「verify consistency」「Spec準拠確認」「テスト漏れ確認」「STDD整合性」「要件と実装の乖離」「Specと実装の差分」など、STDD に基づく品質確認の依頼があったとき。
7
+ allowed-tools: Read, Grep, Glob, Bash
8
+ ---
9
+
10
+ # Spec・テスト・実装の整合性チェック
11
+
12
+ このセッション/ブランチで作成・修正した機能について、Spec・テスト・実装の整合性を確認する。
13
+
14
+ ## 1. 対象ファイルの特定
15
+
16
+ ### ブランチ分岐点からの差分を特定
17
+
18
+ `.stdd.config.yml` の `project.primary_branch`(PR/統合先ブランチ)を読み、その分岐点からの差分を特定する。
19
+
20
+ ```bash
21
+ # <primary_branch> は .stdd.config.yml の project.primary_branch(例: main / develop)
22
+ git fetch origin <primary_branch>
23
+ git log --oneline origin/<primary_branch>...HEAD
24
+ git diff origin/<primary_branch>...HEAD --name-only
25
+ ```
26
+
27
+ 以下を特定:
28
+
29
+ - **Specドキュメント**: `docs/` 配下の `REQUIREMENTS.md`, `TECH_DESIGN.md`
30
+ - **テスト**: `*.test.ts`, `*.test.tsx`, `e2e/tests/**/*.spec.ts`
31
+ - **実装**: `app/`, `components/`, `lib/`, `actions/`, `domain/` 配下のファイル
32
+
33
+ ## 2. 整合性チェック項目
34
+
35
+ ### A. REQUIREMENTS.md ⇔ 実装
36
+
37
+ - [ ] REQUIREMENTS.md の User Journey が実装で網羅されているか
38
+ - [ ] REQUIREMENTS.md の画面仕様(ボタン、フォーム、表示項目)が実装と一致しているか
39
+ - [ ] REQUIREMENTS.md に記載された機能要件が全て実装されているか
40
+
41
+ ### B. TECH_DESIGN.md ⇔ 実装
42
+
43
+ - [ ] TECH_DESIGN.md の「Technical Implementation」セクションの設計方針に従っているか
44
+ - [ ] TECH_DESIGN.md の「Decision」セクションの決定事項が実装に反映されているか
45
+ - [ ] TECH_DESIGN.md に記載されたファイル構成と実際のファイル構成が一致しているか
46
+
47
+ ### C. TECH_DESIGN.md ⇔ テスト
48
+
49
+ - [ ] TECH_DESIGN.md に記載されたテスト総数と、実際のテストケース数が一致しているか
50
+ - [ ] TECH_DESIGN.md の「Test Strategy」セクションに記載された全テストケースが実装されているか
51
+ - [ ] 実装されたテストで、TECH_DESIGN.md に記載されていないものがないか
52
+
53
+ ### D. テスト ⇔ 実装
54
+
55
+ - [ ] テストが実装を正しく検証しているか(実装の変更でテストが壊れていないか)
56
+ - [ ] テストのモック設定が実装の実際の動作と一致しているか
57
+
58
+ ## 3. 出力形式
59
+
60
+ 以下の形式で結果を報告:
61
+
62
+ ```
63
+ ## 整合性チェック結果
64
+
65
+ ### 対象機能: [機能名]
66
+
67
+ ### チェック結果サマリ
68
+ | 項目 | 状態 | 備考 |
69
+ |------|------|------|
70
+ | REQUIREMENTS.md ⇔ 実装 | OK / WARN / NG | |
71
+ | TECH_DESIGN.md ⇔ 実装 | OK / WARN / NG | |
72
+ | TECH_DESIGN.md ⇔ テスト | OK / WARN / NG | |
73
+ | テスト ⇔ 実装 | OK / WARN / NG | |
74
+
75
+ ### 検出された不整合
76
+ 1. [不整合の内容]
77
+ - 期待: [Specの記載内容]
78
+ - 実際: [テスト/実装の内容]
79
+ - 推奨アクション: [修正方法]
80
+
81
+ ### 推奨事項
82
+ - [改善提案があれば記載]
83
+ ```
84
+
85
+ ## 4. 注意事項
86
+
87
+ - Specドキュメントが存在しない場合は、その旨を報告
88
+ - 軽微な不整合(コメントの差異など)は WARN として報告
89
+ - 重大な不整合(機能の欠落、テスト漏れなど)は NG として報告
90
+ - 不整合が見つかった場合、修正の優先度も提示