create-ai-project 1.11.2 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/acceptance-test-generator.md +179 -245
- package/.claude/agents/code-reviewer.md +3 -9
- package/.claude/agents/design-sync.md +221 -0
- package/.claude/agents/document-reviewer.md +15 -10
- package/.claude/agents/integration-test-reviewer.md +192 -0
- package/.claude/agents/prd-creator.md +10 -6
- package/.claude/agents/quality-fixer-frontend.md +324 -0
- package/.claude/agents/quality-fixer.md +48 -62
- package/.claude/agents/requirement-analyzer.md +8 -8
- package/.claude/agents/rule-advisor.md +84 -103
- package/.claude/agents/task-decomposer.md +21 -27
- package/.claude/agents/task-executor-frontend.md +264 -0
- package/.claude/agents/task-executor.md +4 -16
- package/.claude/agents/technical-designer-frontend.md +444 -0
- package/.claude/agents/technical-designer.md +52 -27
- package/.claude/agents/work-planner.md +41 -14
- package/.claude/agents-en/acceptance-test-generator.md +13 -13
- package/.claude/agents-en/code-reviewer.md +8 -10
- package/.claude/agents-en/design-sync.md +6 -5
- package/.claude/agents-en/document-reviewer.md +8 -7
- package/.claude/agents-en/integration-test-reviewer.md +5 -4
- package/.claude/agents-en/prd-creator.md +7 -6
- package/.claude/agents-en/quality-fixer-frontend.md +3 -14
- package/.claude/agents-en/quality-fixer.md +9 -20
- package/.claude/agents-en/requirement-analyzer.md +8 -7
- package/.claude/agents-en/rule-advisor.md +57 -128
- package/.claude/agents-en/task-decomposer.md +4 -10
- package/.claude/agents-en/task-executor-frontend.md +4 -16
- package/.claude/agents-en/task-executor.md +5 -16
- package/.claude/agents-en/technical-designer-frontend.md +17 -15
- package/.claude/agents-en/technical-designer.md +13 -15
- package/.claude/agents-en/work-planner.md +9 -14
- package/.claude/agents-ja/acceptance-test-generator.md +9 -15
- package/.claude/agents-ja/code-reviewer.md +3 -11
- package/.claude/agents-ja/design-sync.md +2 -6
- package/.claude/agents-ja/document-reviewer.md +4 -9
- package/.claude/agents-ja/integration-test-reviewer.md +2 -5
- package/.claude/agents-ja/prd-creator.md +3 -7
- package/.claude/agents-ja/quality-fixer-frontend.md +2 -13
- package/.claude/agents-ja/quality-fixer.md +7 -18
- package/.claude/agents-ja/requirement-analyzer.md +5 -8
- package/.claude/agents-ja/rule-advisor.md +57 -128
- package/.claude/agents-ja/task-decomposer.md +4 -10
- package/.claude/agents-ja/task-executor-frontend.md +3 -15
- package/.claude/agents-ja/task-executor.md +3 -17
- package/.claude/agents-ja/technical-designer-frontend.md +17 -15
- package/.claude/agents-ja/technical-designer.md +13 -15
- package/.claude/agents-ja/work-planner.md +9 -14
- package/.claude/commands/build.md +7 -10
- package/.claude/commands/design.md +15 -5
- package/.claude/commands/front-build.md +103 -0
- package/.claude/commands/front-design.md +42 -0
- package/.claude/commands/front-plan.md +40 -0
- package/.claude/commands/implement.md +23 -29
- package/.claude/commands/plan.md +4 -4
- package/.claude/commands/project-inject.md +4 -4
- package/.claude/{commands-ja/refine-rule.md → commands/refine-skill.md} +25 -25
- package/.claude/{commands-ja/sync-rules.md → commands/sync-skills.md} +28 -28
- package/.claude/commands/task.md +1 -1
- package/.claude/commands-en/build.md +2 -2
- package/.claude/commands-en/design.md +1 -1
- package/.claude/commands-en/implement.md +8 -8
- package/.claude/commands-en/plan.md +3 -3
- package/.claude/commands-en/project-inject.md +4 -4
- package/.claude/commands-en/{refine-rule.md → refine-skill.md} +47 -48
- package/.claude/commands-en/{sync-rules.md → sync-skills.md} +29 -29
- package/.claude/commands-ja/build.md +2 -2
- package/.claude/commands-ja/design.md +1 -1
- package/.claude/commands-ja/implement.md +8 -8
- package/.claude/commands-ja/plan.md +3 -3
- package/.claude/commands-ja/project-inject.md +4 -4
- package/.claude/{commands/refine-rule.md → commands-ja/refine-skill.md} +25 -25
- package/.claude/{commands/sync-rules.md → commands-ja/sync-skills.md} +28 -28
- package/.claude/settings.local.json +21 -1
- package/{docs/rules/ai-development-guide.md → .claude/skills/coding-standards/SKILL.md} +94 -108
- package/{docs/rules/documentation-criteria.md → .claude/skills/documentation-criteria/SKILL.md} +19 -6
- package/.claude/skills/documentation-criteria/references/adr-template.md +64 -0
- package/.claude/skills/documentation-criteria/references/design-template.md +242 -0
- package/.claude/skills/documentation-criteria/references/plan-template.md +130 -0
- package/.claude/skills/documentation-criteria/references/prd-template.md +109 -0
- package/.claude/skills/frontend/technical-spec/SKILL.md +147 -0
- package/.claude/skills/frontend/typescript-rules/SKILL.md +315 -0
- package/.claude/skills/frontend/typescript-testing/SKILL.md +212 -0
- package/{docs/rules-ja/architecture/implementation-approach.md → .claude/skills/implementation-approach/SKILL.md} +10 -5
- package/.claude/skills/integration-e2e-testing/SKILL.md +146 -0
- package/{docs/rules-ja/project-context.md → .claude/skills/project-context/SKILL.md} +7 -3
- package/.claude/skills/subagents-orchestration-guide/SKILL.md +212 -0
- package/.claude/skills/task-analyzer/SKILL.md +142 -0
- package/.claude/skills/task-analyzer/references/skills-index.yaml +211 -0
- package/.claude/skills/technical-spec/SKILL.md +86 -0
- package/{docs/rules/typescript.md → .claude/skills/typescript-rules/SKILL.md} +22 -67
- package/.claude/skills/typescript-testing/SKILL.md +155 -0
- package/{docs/rules-en/coding-standards.md → .claude/skills-en/coding-standards/SKILL.md} +21 -108
- package/{docs/rules-en/documentation-criteria.md → .claude/skills-en/documentation-criteria/SKILL.md} +40 -42
- package/{docs/adr/template-en.md → .claude/skills-en/documentation-criteria/references/adr-template.md} +1 -1
- package/{docs/design/template-en.md → .claude/skills-en/documentation-criteria/references/design-template.md} +11 -31
- package/{docs/plans/template-en.md → .claude/skills-en/documentation-criteria/references/plan-template.md} +4 -4
- package/{docs/prd/template-en.md → .claude/skills-en/documentation-criteria/references/prd-template.md} +1 -1
- package/{docs/rules-en/frontend/technical-spec.md → .claude/skills-en/frontend/technical-spec/SKILL.md} +17 -13
- package/{docs/rules-en/frontend/typescript.md → .claude/skills-en/frontend/typescript-rules/SKILL.md} +17 -12
- package/{docs/rules-en/frontend/typescript-testing.md → .claude/skills-en/frontend/typescript-testing/SKILL.md} +11 -6
- package/{docs/rules-en/architecture/implementation-approach.md → .claude/skills-en/implementation-approach/SKILL.md} +7 -2
- package/{docs/rules-en/integration-e2e-testing.md → .claude/skills-en/integration-e2e-testing/SKILL.md} +15 -18
- package/{docs/rules-en/project-context.md → .claude/skills-en/project-context/SKILL.md} +7 -3
- package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +224 -0
- package/.claude/skills-en/task-analyzer/SKILL.md +131 -0
- package/{docs/rules-en/rules-index.yaml → .claude/skills-en/task-analyzer/references/skills-index.yaml} +34 -20
- package/{docs/rules-en/technical-spec.md → .claude/skills-en/technical-spec/SKILL.md} +6 -6
- package/{docs/rules-en/typescript.md → .claude/skills-en/typescript-rules/SKILL.md} +15 -10
- package/{docs/rules-en/typescript-testing.md → .claude/skills-en/typescript-testing/SKILL.md} +10 -4
- package/{docs/rules-ja/coding-standards.md → .claude/skills-ja/coding-standards/SKILL.md} +12 -99
- package/{docs/rules-ja/documentation-criteria.md → .claude/skills-ja/documentation-criteria/SKILL.md} +18 -5
- package/.claude/skills-ja/documentation-criteria/references/adr-template.md +64 -0
- package/.claude/skills-ja/documentation-criteria/references/design-template.md +261 -0
- package/{docs/plans/template-ja.md → .claude/skills-ja/documentation-criteria/references/plan-template.md} +38 -38
- package/{docs/prd/template-ja.md → .claude/skills-ja/documentation-criteria/references/prd-template.md} +33 -33
- package/{docs/rules-ja/frontend/technical-spec.md → .claude/skills-ja/frontend/technical-spec/SKILL.md} +13 -9
- package/.claude/skills-ja/frontend/typescript-rules/SKILL.md +315 -0
- package/{docs/rules-ja/frontend/typescript-testing.md → .claude/skills-ja/frontend/typescript-testing/SKILL.md} +93 -5
- package/{docs/rules/architecture/implementation-approach.md → .claude/skills-ja/implementation-approach/SKILL.md} +10 -5
- package/{docs/rules-ja/integration-e2e-testing.md → .claude/skills-ja/integration-e2e-testing/SKILL.md} +5 -8
- package/{docs/rules/project-context.md → .claude/skills-ja/project-context/SKILL.md} +7 -3
- package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +212 -0
- package/.claude/skills-ja/task-analyzer/SKILL.md +131 -0
- package/{docs/rules-ja/rules-index.yaml → .claude/skills-ja/task-analyzer/references/skills-index.yaml} +34 -19
- package/{docs/rules-ja/technical-spec.md → .claude/skills-ja/technical-spec/SKILL.md} +6 -6
- package/{docs/rules-ja/typescript.md → .claude/skills-ja/typescript-rules/SKILL.md} +16 -11
- package/{docs/rules-ja/typescript-testing.md → .claude/skills-ja/typescript-testing/SKILL.md} +11 -5
- package/CLAUDE.en.md +6 -6
- package/CLAUDE.ja.md +6 -6
- package/CLAUDE.md +19 -28
- package/README.ja.md +39 -10
- package/README.md +39 -10
- package/package.json +1 -1
- package/scripts/set-language.js +35 -53
- package/scripts/setup-project.js +4 -1
- package/docs/adr/template-ja.md +0 -64
- package/docs/design/template-ja.md +0 -285
- package/docs/guides/en/sub-agents.md +0 -343
- package/docs/guides/ja/sub-agents.md +0 -343
- package/docs/guides/sub-agents.md +0 -306
- package/docs/plans/20250123-integration-test-improvement.md +0 -993
- package/docs/rules/rules-index.yaml +0 -137
- package/docs/rules/technical-spec.md +0 -47
- package/docs/rules/typescript-testing.md +0 -188
- package/docs/rules-ja/frontend/typescript.md +0 -131
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: スキル修正後のメタデータ同期とrule-advisor精度最適化
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
**コマンドコンテキスト**:
|
|
5
|
+
**コマンドコンテキスト**: スキルファイル編集後のメンテナンス作業
|
|
6
6
|
|
|
7
7
|
**Think deeply** rule-advisorの実行精度を最大化するための同期作業:
|
|
8
8
|
|
|
9
9
|
## 実行フロー
|
|
10
10
|
|
|
11
|
-
### 1.
|
|
11
|
+
### 1. スキルファイルのスキャン
|
|
12
12
|
```bash
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
INDEX_FILE="
|
|
13
|
+
# 実行時のスキルディレクトリ
|
|
14
|
+
SKILLS_DIR=".claude/skills"
|
|
15
|
+
INDEX_FILE=".claude/skills/task-analyzer/references/skills-index.yaml"
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
find "${
|
|
17
|
+
# 全スキルファイルを解析
|
|
18
|
+
find "${SKILLS_DIR}" -name "SKILL.md" -type f | sort
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
### 2. メタデータ同期と最適化
|
|
22
22
|
|
|
23
23
|
#### セクション自動同期
|
|
24
|
-
-
|
|
25
|
-
-
|
|
24
|
+
- 各SKILL.mdの`## `セクションを抽出
|
|
25
|
+
- skills-index.yamlのsectionsを自動更新
|
|
26
26
|
|
|
27
27
|
#### タグの最適化
|
|
28
28
|
- ファイル内容からキーワードを分析
|
|
@@ -39,23 +39,23 @@ find "${RULES_DIR}" -name "*.md" -type f | sort
|
|
|
39
39
|
|
|
40
40
|
### 3. rule-advisor向け最適化
|
|
41
41
|
|
|
42
|
-
メタデータの質を向上させ、rule-advisor
|
|
42
|
+
メタデータの質を向上させ、rule-advisorが正確にスキルを選択できるよう調整:
|
|
43
43
|
|
|
44
44
|
```
|
|
45
|
-
===
|
|
46
|
-
対象:
|
|
45
|
+
=== スキルメタデータ同期 ===
|
|
46
|
+
対象: .claude/skills
|
|
47
47
|
|
|
48
48
|
実行した更新:
|
|
49
49
|
✅ sections同期
|
|
50
|
-
- typescript-testing
|
|
51
|
-
-
|
|
50
|
+
- typescript-testing: 2セクション追加
|
|
51
|
+
- coding-standards: 1セクション更新
|
|
52
52
|
|
|
53
53
|
✅ tags最適化
|
|
54
|
-
- typescript
|
|
55
|
-
- technical-spec
|
|
54
|
+
- typescript-rules: [functional-programming]タグ追加を提案
|
|
55
|
+
- technical-spec: [deprecated]タグ削除を提案
|
|
56
56
|
|
|
57
57
|
✅ typical-use改善
|
|
58
|
-
- 3
|
|
58
|
+
- 3スキルの説明をより具体的に更新
|
|
59
59
|
|
|
60
60
|
最終結果: rule-advisor精度向上のための最適化完了
|
|
61
61
|
```
|
|
@@ -64,7 +64,7 @@ find "${RULES_DIR}" -name "*.md" -type f | sort
|
|
|
64
64
|
|
|
65
65
|
**本質的な目的**:
|
|
66
66
|
- 単なる整合性維持ではなく、rule-advisorの選択精度向上
|
|
67
|
-
-
|
|
67
|
+
- スキル編集作業の仕上げとしてのメタデータ最適化
|
|
68
68
|
|
|
69
69
|
**品質基準**:
|
|
70
70
|
- sectionsは100%同期必須
|
|
@@ -83,23 +83,23 @@ find "${RULES_DIR}" -name "*.md" -type f | sort
|
|
|
83
83
|
|
|
84
84
|
## 実行タイミング
|
|
85
85
|
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
86
|
+
- スキルファイル編集後(必須)
|
|
87
|
+
- 新しいスキルファイル追加時
|
|
88
|
+
- 大規模なスキル改訂後
|
|
89
89
|
- rule-advisorの選択精度が低下したと感じた時
|
|
90
90
|
|
|
91
91
|
## 出力例
|
|
92
92
|
|
|
93
93
|
```
|
|
94
|
-
===
|
|
95
|
-
対象:
|
|
94
|
+
=== スキルメタデータ同期開始 ===
|
|
95
|
+
対象: .claude/skills (13スキル)
|
|
96
96
|
|
|
97
|
-
[1/
|
|
97
|
+
[1/13] typescript-rules
|
|
98
98
|
✅ sections: 7件同期完了
|
|
99
99
|
💡 tags提案: +[functional-programming, dependency-injection]
|
|
100
100
|
💡 typical-use: "TypeScript実装全般" → "型安全性重視の実装とモダンTypeScript機能活用"
|
|
101
101
|
|
|
102
|
-
[2/
|
|
102
|
+
[2/13] typescript-testing
|
|
103
103
|
✅ sections: 2件追加(テストの粒度、モックの型安全性)
|
|
104
104
|
✅ tags: 変更なし
|
|
105
105
|
✅ typical-use: 現状維持
|
|
@@ -107,10 +107,10 @@ find "${RULES_DIR}" -name "*.md" -type f | sort
|
|
|
107
107
|
...
|
|
108
108
|
|
|
109
109
|
=== 同期完了 ===
|
|
110
|
-
更新: 3
|
|
110
|
+
更新: 3スキル
|
|
111
111
|
提案: 5件(承認してください)
|
|
112
112
|
|
|
113
113
|
rule-advisor精度向上: 推定15%改善
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
**スコープ**:
|
|
116
|
+
**スコープ**: スキル修正作業後のメタデータ同期とrule-advisor精度最適化。
|
|
@@ -65,7 +65,27 @@
|
|
|
65
65
|
"Bash(npm pack:*)",
|
|
66
66
|
"Bash(npm view:*)",
|
|
67
67
|
"Bash(npx:*)",
|
|
68
|
-
"
|
|
68
|
+
"WebFetch(domain:zenn.dev)",
|
|
69
|
+
"Bash(npm version:*)",
|
|
70
|
+
"Bash(xargs -I {} sh -c 'echo \"\"\"\"=== {} ===\"\"\"\" && head -60 \"\"\"\"{}\"\"\"\"')",
|
|
71
|
+
"Bash(npm run lang:status:*)",
|
|
72
|
+
"Bash(npm run lang:en:*)",
|
|
73
|
+
"Bash(gh pr list:*)",
|
|
74
|
+
"Bash(xargs:*)",
|
|
75
|
+
"Bash(npm pkg:*)",
|
|
76
|
+
"Bash(head:*)",
|
|
77
|
+
"Bash(for agent in acceptance-test-generator code-reviewer design-sync document-reviewer integration-test-reviewer prd-creator quality-fixer quality-fixer-frontend requirement-analyzer rule-advisor task-decomposer task-executor task-executor-frontend technical-designer technical-designer-frontend work-planner)",
|
|
78
|
+
"Bash(do)",
|
|
79
|
+
"Bash(echo:*)",
|
|
80
|
+
"Bash(while read skill)",
|
|
81
|
+
"Bash(do if [ -f \".claude/skills-en/$skill/SKILL.md\" ])",
|
|
82
|
+
"Bash(then echo \"✅ $skill\" else echo \"❌ $skill \\(NOT FOUND\\)\" fi done)",
|
|
83
|
+
"Bash(for agent in acceptance-test-generator document-reviewer)",
|
|
84
|
+
"Bash(__NEW_LINE__ echo \"\")",
|
|
85
|
+
"WebFetch(domain:docs.anthropic.com)",
|
|
86
|
+
"Bash(git tag:*)",
|
|
87
|
+
"Bash(npm run build:*)",
|
|
88
|
+
"Bash(npm run check:*)"
|
|
69
89
|
],
|
|
70
90
|
"deny": [],
|
|
71
91
|
"ask": [],
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: coding-standards
|
|
3
|
+
description: 保守性、可読性、品質のための言語非依存コーディング原則。機能実装、リファクタリング、コードレビュー時に使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 普遍的コーディング規約
|
|
2
7
|
|
|
3
8
|
## 技術的アンチパターン(赤信号パターン)
|
|
4
9
|
|
|
@@ -20,22 +25,24 @@
|
|
|
20
25
|
- **対処療法的修正** - 根本原因を解決しない表面的な修正
|
|
21
26
|
- **無計画な大規模変更** - 段階的アプローチの欠如
|
|
22
27
|
|
|
23
|
-
##
|
|
28
|
+
## 基本原則
|
|
29
|
+
|
|
30
|
+
- **積極的なリファクタリング** - 技術的負債を防ぎ、健全性を維持
|
|
31
|
+
- **使われない「念のため」のコード禁止** - YAGNI原則(Kent Beck)に反する
|
|
32
|
+
|
|
33
|
+
## コメント記述ルール
|
|
24
34
|
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
- **機能説明重視**: コードが「何をするか」を記述
|
|
36
|
+
- **履歴情報禁止**: 開発履歴は記載しない
|
|
37
|
+
- **タイムレス**: いつ読んでも有効な内容のみ記述
|
|
38
|
+
- **簡潔性**: 必要最小限の説明にとどめる
|
|
27
39
|
|
|
28
|
-
|
|
29
|
-
- **原則禁止**: エラー時の無条件フォールバックは実装しない
|
|
30
|
-
- **例外的許可**: Design Docで明示的に定義された場合のみ実装
|
|
31
|
-
- **レイヤー責務**:
|
|
32
|
-
- インフラ層: エラーを必ず上位に投げる(フォールバック判断なし)
|
|
33
|
-
- アプリケーション層: ビジネス要件に基づく判断を実装
|
|
40
|
+
## エラーハンドリングの基本原則
|
|
34
41
|
|
|
35
|
-
###
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
### Fail-Fast原則
|
|
43
|
+
エラー時は速やかに失敗させ、不正な状態での処理継続を防ぐ。エラーの握りつぶしは禁止。
|
|
44
|
+
|
|
45
|
+
詳細な実装方法(Result型、カスタムエラークラス、層別エラー処理など)は各言語・フレームワークのルールを参照。
|
|
39
46
|
|
|
40
47
|
## Rule of Three - コード重複の判断基準
|
|
41
48
|
|
|
@@ -61,16 +68,6 @@ Martin Fowler「Refactoring」に基づく重複コードの扱い方:
|
|
|
61
68
|
- 共通化により可読性が著しく低下
|
|
62
69
|
- テストコード内の簡単なヘルパー
|
|
63
70
|
|
|
64
|
-
### 実装例
|
|
65
|
-
```typescript
|
|
66
|
-
// ❌ 1回目の重複で即共通化
|
|
67
|
-
function validateUserEmail(email: string) { /* ... */ }
|
|
68
|
-
function validateContactEmail(email: string) { /* ... */ }
|
|
69
|
-
|
|
70
|
-
// ✅ 3回目で共通化
|
|
71
|
-
function validateEmail(email: string, context: 'user' | 'contact' | 'admin') { /* ... */ }
|
|
72
|
-
```
|
|
73
|
-
|
|
74
71
|
## よくある失敗パターンと回避方法
|
|
75
72
|
|
|
76
73
|
### パターン1: エラー修正の連鎖
|
|
@@ -91,20 +88,14 @@ function validateEmail(email: string, context: 'user' | 'contact' | 'admin') { /
|
|
|
91
88
|
### パターン4: 技術的不確実性の無視
|
|
92
89
|
**症状**: 新技術導入時の想定外エラー多発
|
|
93
90
|
**原因**: 事前調査なしで「公式ドキュメント通りなら動くはず」
|
|
94
|
-
**回避方法**:
|
|
91
|
+
**回避方法**:
|
|
95
92
|
- タスクファイル冒頭に確実性評価を記載
|
|
96
|
-
```
|
|
97
|
-
確実性: low(理由: MCP接続の実例がない)
|
|
98
|
-
探索的実装: true
|
|
99
|
-
フォールバック: 従来APIを使用
|
|
100
|
-
```
|
|
101
93
|
- 確実性lowの場合、最初に最小限の動作確認コードを作成
|
|
102
|
-
- 動作確認できたら本実装、できなければフォールバック実行
|
|
103
94
|
|
|
104
95
|
### パターン5: 既存コード調査不足
|
|
105
96
|
**症状**: 重複実装、アーキテクチャ不整合、結合時の障害
|
|
106
97
|
**原因**: 実装前の既存コード理解不足
|
|
107
|
-
**回避方法**:
|
|
98
|
+
**回避方法**:
|
|
108
99
|
- 実装前に類似機能の存在を必ず検索(同じドメイン、責務、設定パターンをキーワードに)
|
|
109
100
|
- 類似機能を発見 → その実装を使用する(新規実装は行わない)
|
|
110
101
|
- 類似機能が技術的負債 → ADRで改善提案を作成してから実装
|
|
@@ -133,85 +124,40 @@ Why5: 破壊的変更を含むメジャーバージョンアップ
|
|
|
133
124
|
- モックで外部依存を置き換え
|
|
134
125
|
- 問題が再現する最小構成を作成
|
|
135
126
|
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
console.log('DEBUG:', {
|
|
139
|
-
context: 'user-creation',
|
|
140
|
-
input: { email, name },
|
|
141
|
-
state: currentState,
|
|
142
|
-
timestamp: new Date().toISOString()
|
|
143
|
-
})
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## 品質チェックコマンドリファレンス
|
|
147
|
-
|
|
148
|
-
### Phase 1-3: 基本チェック
|
|
149
|
-
```bash
|
|
150
|
-
# Biome総合チェック(lint + format)
|
|
151
|
-
npm run check
|
|
152
|
-
|
|
153
|
-
# 未使用エクスポートの検出
|
|
154
|
-
npm run check:unused
|
|
155
|
-
|
|
156
|
-
# TypeScriptビルド
|
|
157
|
-
npm run build
|
|
158
|
-
```
|
|
127
|
+
## 型安全性の基礎
|
|
159
128
|
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
# テスト実行
|
|
163
|
-
npm test
|
|
129
|
+
**型安全の原則**: `unknown`型と型ガードを使用する。`any`型は型チェックを無効化し、実行時エラーの原因となる。
|
|
164
130
|
|
|
165
|
-
|
|
166
|
-
|
|
131
|
+
**any型の代替手段(優先順位順)**
|
|
132
|
+
1. **unknown型 + 型ガード**: 外部入力の検証に使用
|
|
133
|
+
2. **ジェネリクス**: 型の柔軟性が必要な場合
|
|
134
|
+
3. **ユニオン型・インターセクション型**: 複数の型の組み合わせ
|
|
135
|
+
4. **型アサーション(最終手段)**: 型が確実な場合のみ
|
|
167
136
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
# カバレッジレポート確認
|
|
175
|
-
open coverage/index.html
|
|
176
|
-
|
|
177
|
-
# Vitestプロセスのクリーンアップ(テスト後必須)
|
|
178
|
-
npm run cleanup:processes
|
|
179
|
-
|
|
180
|
-
# 安全なテスト実行(自動クリーンアップ付き)
|
|
181
|
-
npm run test:safe
|
|
182
|
-
|
|
183
|
-
# 自動修正
|
|
184
|
-
npm run format # フォーマット修正
|
|
185
|
-
npm run lint:fix # Lint修正
|
|
137
|
+
**型ガードの実装パターン**
|
|
138
|
+
```typescript
|
|
139
|
+
function isUser(value: unknown): value is User {
|
|
140
|
+
return typeof value === 'object' && value !== null && 'id' in value && 'name' in value
|
|
141
|
+
}
|
|
186
142
|
```
|
|
187
143
|
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
144
|
+
**型の複雑性管理**
|
|
145
|
+
- フィールド数: 20個まで(超えたら責務で分割、外部API型は例外)
|
|
146
|
+
- オプショナル率: 30%まで(超えたら必須/任意で分離)
|
|
147
|
+
- ネスト深さ: 3階層まで(超えたらフラット化)
|
|
148
|
+
- 型アサーション: 3回以上使用したら設計見直し
|
|
149
|
+
- **外部API型の扱い**: 制約を緩和し、実態に合わせて定義(内部では適切に変換)
|
|
194
150
|
|
|
195
|
-
|
|
196
|
-
- 具体的な実装を3回書いてからパターンを抽出
|
|
197
|
-
- YAGNIを意識し、現在必要な機能のみ実装
|
|
198
|
-
- 将来の拡張性より現在のシンプルさを優先
|
|
151
|
+
## リファクタリング手法
|
|
199
152
|
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
153
|
+
**基本方針**
|
|
154
|
+
- 小さなステップ: 段階的改善により、常に動作する状態を維持
|
|
155
|
+
- 安全な変更: 一度に変更する範囲を最小限に抑制
|
|
156
|
+
- 動作保証: 既存の動作を変えないことを確認しながら進める
|
|
204
157
|
|
|
205
|
-
|
|
206
|
-
- 過度に細かい型は保守性を低下させる
|
|
207
|
-
- ドメインを適切に表現する型を設計
|
|
208
|
-
- ユーティリティ型を活用して重複を削減
|
|
158
|
+
**実施手順**: 現状把握 → 段階的変更 → 動作確認 → 最終検証
|
|
209
159
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
- **謙虚**: 完璧なコードは存在しない、フィードバック歓迎
|
|
213
|
-
- **勇気**: 必要なリファクタリングは大胆に実行
|
|
214
|
-
- **透明性**: 技術的な判断理由を明確に記録
|
|
160
|
+
**優先順位**: 重複コード削除 > 長大な関数分割 > 複雑な条件分岐簡素化 > 型安全性向上
|
|
215
161
|
|
|
216
162
|
## 実装作業の完全性担保
|
|
217
163
|
|
|
@@ -251,10 +197,50 @@ Grep -n "targetData\|SetData\|UpdateData" -o content
|
|
|
251
197
|
|
|
252
198
|
対象: コード・ドキュメント・設定ファイル
|
|
253
199
|
|
|
254
|
-
|
|
200
|
+
## Red-Green-Refactorプロセス(テストファースト開発)
|
|
255
201
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
202
|
+
**推奨原則**: コード変更は必ずテストから始める
|
|
203
|
+
|
|
204
|
+
**開発ステップ**:
|
|
205
|
+
1. **Red**: 期待する動作のテストを書く(失敗する)
|
|
206
|
+
2. **Green**: 最小限の実装でテストを通す
|
|
207
|
+
3. **Refactor**: テストが通る状態を維持しながらコード改善
|
|
208
|
+
|
|
209
|
+
**NGケース(テストファースト不要)**:
|
|
210
|
+
- 純粋な設定ファイル変更(.env、config等)
|
|
211
|
+
- ドキュメントのみの更新(README、コメント等)
|
|
212
|
+
- 緊急本番障害対応(ただし事後テスト必須)
|
|
213
|
+
|
|
214
|
+
## テスト設計原則
|
|
215
|
+
|
|
216
|
+
### テストケースの構造
|
|
217
|
+
- テストは「準備(Arrange)」「実行(Act)」「検証(Assert)」の3段階で構成
|
|
218
|
+
- 各テストの目的が明確に分かる命名
|
|
219
|
+
- 1つのテストケースでは1つの振る舞いのみを検証
|
|
220
|
+
|
|
221
|
+
### テストデータ管理
|
|
222
|
+
- テストデータは専用ディレクトリで管理
|
|
223
|
+
- 環境変数はテスト用の値を定義
|
|
224
|
+
- 機密情報は必ずモック化
|
|
225
|
+
- テストデータは最小限に保ち、テストケースの検証目的に直接関連するデータのみ使用
|
|
226
|
+
|
|
227
|
+
### モックとスタブの使用方針
|
|
228
|
+
|
|
229
|
+
**推奨: 単体テストでの外部依存モック化**
|
|
230
|
+
- メリット: テストの独立性と再現性を確保
|
|
231
|
+
- 実践: DB、API、ファイルシステム等の外部依存をモック化
|
|
232
|
+
|
|
233
|
+
**避けるべき: 単体テストでの実際の外部接続**
|
|
234
|
+
- 理由: テスト速度が遅くなり、環境依存の問題が発生するため
|
|
235
|
+
|
|
236
|
+
### テスト失敗時の対応判断基準
|
|
237
|
+
|
|
238
|
+
**テストを修正**: 間違った期待値、存在しない機能参照、実装詳細への依存、テストのためだけの実装
|
|
239
|
+
**実装を修正**: 妥当な仕様、ビジネスロジック、重要なエッジケース
|
|
240
|
+
**判断に迷ったら**: ユーザーに確認
|
|
241
|
+
|
|
242
|
+
## テストの粒度原則
|
|
243
|
+
|
|
244
|
+
### 原則:観測可能な振る舞いのみ
|
|
245
|
+
**テスト対象**:公開API、戻り値、例外、外部呼び出し、永続化された状態
|
|
246
|
+
**テスト対象外**:privateメソッド、内部状態、アルゴリズム詳細
|
package/{docs/rules/documentation-criteria.md → .claude/skills/documentation-criteria/SKILL.md}
RENAMED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-criteria
|
|
3
|
+
description: PRD、ADR、Design Doc、作業計画書を含むドキュメント作成基準とテンプレート。
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# ドキュメント作成基準
|
|
2
7
|
|
|
3
8
|
## 作成判定マトリクス
|
|
@@ -87,7 +92,7 @@
|
|
|
87
92
|
- インターフェース定義と型定義
|
|
88
93
|
- データフローとコンポーネント設計
|
|
89
94
|
- **統合ポイントでのE2E確認手順**
|
|
90
|
-
-
|
|
95
|
+
- **受入条件(EARS形式: When/While/If-then/無印)**
|
|
91
96
|
- 変更影響マップ(直接影響/間接影響/波及なしを明記)
|
|
92
97
|
- 統合点の完全な列挙
|
|
93
98
|
- データ契約の明確化
|
|
@@ -147,10 +152,10 @@
|
|
|
147
152
|
|
|
148
153
|
| ドキュメント | パス | 命名規則 | テンプレート |
|
|
149
154
|
|------------|-----|---------|------------|
|
|
150
|
-
| PRD | `docs/prd/` | `[機能名]-prd.md` | `template
|
|
151
|
-
| ADR | `docs/adr/` | `ADR-[4桁]-[タイトル].md` | `template
|
|
152
|
-
| Design Doc | `docs/design/` | `[機能名]-design.md` | `template
|
|
153
|
-
| 作業計画書 | `docs/plans/` | `YYYYMMDD-{type}-{description}.md` | `template
|
|
155
|
+
| PRD | `docs/prd/` | `[機能名]-prd.md` | `prd-template.md` |
|
|
156
|
+
| ADR | `docs/adr/` | `ADR-[4桁]-[タイトル].md` | `adr-template.md` |
|
|
157
|
+
| Design Doc | `docs/design/` | `[機能名]-design.md` | `design-template.md` |
|
|
158
|
+
| 作業計画書 | `docs/plans/` | `YYYYMMDD-{type}-{description}.md` | `plan-template.md` |
|
|
154
159
|
|
|
155
160
|
※作業計画書は`.gitignore`で除外
|
|
156
161
|
|
|
@@ -177,4 +182,12 @@
|
|
|
177
182
|
1. **作成時**: 共通技術領域(ログ、エラーハンドリング、非同期処理等)を特定し、既存共通ADRを参照
|
|
178
183
|
2. **不足時**: 必要な共通ADRが存在しない場合は作成を検討
|
|
179
184
|
3. **Design Doc**: 「前提となるADR」セクションで共通ADRを明記
|
|
180
|
-
4. **準拠確認**: 設計が共通ADRの決定事項と整合しているかを検証
|
|
185
|
+
4. **準拠確認**: 設計が共通ADRの決定事項と整合しているかを検証
|
|
186
|
+
|
|
187
|
+
## テンプレート
|
|
188
|
+
|
|
189
|
+
テンプレートは`references/`ディレクトリにあります:
|
|
190
|
+
- [Design Documentテンプレート](references/design-template.md)
|
|
191
|
+
- [PRDテンプレート](references/prd-template.md)
|
|
192
|
+
- [作業計画書テンプレート](references/plan-template.md)
|
|
193
|
+
- [ADRテンプレート](references/adr-template.md)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# [ADR番号] [タイトル]
|
|
2
|
+
|
|
3
|
+
## ステータス
|
|
4
|
+
|
|
5
|
+
[Proposed | Accepted | Deprecated | Superseded]
|
|
6
|
+
|
|
7
|
+
## 経緯
|
|
8
|
+
|
|
9
|
+
[この決定が必要になった背景と理由を説明。問題の本質、現在の課題、制約を含む]
|
|
10
|
+
|
|
11
|
+
## 決定事項
|
|
12
|
+
|
|
13
|
+
[実際に行った決定を説明。具体的で明確な記述を心がける]
|
|
14
|
+
|
|
15
|
+
### 決定の詳細
|
|
16
|
+
|
|
17
|
+
| 項目 | 内容 |
|
|
18
|
+
|-----|-----|
|
|
19
|
+
| **決定** | [一文で決定内容] |
|
|
20
|
+
| **なぜ今か** | [今このタイミングで必要な理由] |
|
|
21
|
+
| **なぜこれか** | [代替案との比較理由(1-3行)] |
|
|
22
|
+
| **既知の不確実性** | [現時点で少なくとも1つの不確実性] |
|
|
23
|
+
| **撤回基準** | [この決定を見直すべきシグナル1つ] |
|
|
24
|
+
|
|
25
|
+
## 根拠
|
|
26
|
+
|
|
27
|
+
[なぜこの決定を行ったか、代替案と比較して最善である理由を説明]
|
|
28
|
+
|
|
29
|
+
### 検討した選択肢
|
|
30
|
+
|
|
31
|
+
1. **選択肢1**: [説明]
|
|
32
|
+
- メリット: [利点をリストアップ]
|
|
33
|
+
- デメリット: [欠点をリストアップ]
|
|
34
|
+
|
|
35
|
+
2. **選択肢2**: [説明]
|
|
36
|
+
- メリット: [利点をリストアップ]
|
|
37
|
+
- デメリット: [欠点をリストアップ]
|
|
38
|
+
|
|
39
|
+
3. **選択肢3(採用)**: [説明]
|
|
40
|
+
- メリット: [利点をリストアップ]
|
|
41
|
+
- デメリット: [欠点をリストアップ]
|
|
42
|
+
|
|
43
|
+
## 影響
|
|
44
|
+
|
|
45
|
+
### ポジティブな影響
|
|
46
|
+
|
|
47
|
+
- [プロジェクトやシステムへの良い影響をリストアップ]
|
|
48
|
+
|
|
49
|
+
### ネガティブな影響
|
|
50
|
+
|
|
51
|
+
- [受け入れる必要のある負の影響やトレードオフをリストアップ]
|
|
52
|
+
|
|
53
|
+
### 中立的な影響
|
|
54
|
+
|
|
55
|
+
- [良くも悪くもない変化をリストアップ]
|
|
56
|
+
|
|
57
|
+
## 実装指針
|
|
58
|
+
|
|
59
|
+
[原則的な方向性のみ。実装手順はDesign Docへ]
|
|
60
|
+
例: 「依存性注入を使用」○、「Phase 1で実装」×
|
|
61
|
+
|
|
62
|
+
## 関連情報
|
|
63
|
+
|
|
64
|
+
- [関連するADR、ドキュメント、Issue、PRなどへのリンク]
|