create-ai-project 1.18.4 → 1.18.6

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.
@@ -92,6 +92,7 @@ For DesignDoc, additionally verify:
92
92
  - Technical information verification: When sources exist, verify with WebSearch for latest information and validate claim validity
93
93
  - Failure scenario review: Identify failure scenarios across normal usage, high load, and external failures; specify which design element becomes the bottleneck
94
94
  - Code inspection evidence review: Verify inspected files are relevant to design scope; flag if key related files are missing
95
+ - Dependency realizability check: For each dependency the Design Doc's Existing Codebase Analysis section describes as "existing", verify its definition exists in the codebase using Grep/Glob. Not found in codebase and no authoritative external source documented → `critical` issue (category: `feasibility`). Found but definition signature (method names, parameter types, return types) diverges from Design Doc description → `important` issue (category: `consistency`)
95
96
  - **As-is implementation document review**: When code verification results are provided and the document describes existing implementation (not future requirements), verify that code-observable behaviors are stated as facts; speculative language about deterministic behavior → `important` issue
96
97
 
97
98
  **Perspective-specific Mode**:
@@ -244,6 +245,7 @@ Include in output when `prior_context_count > 0`:
244
245
  - [ ] Gate 0 structural existence checks pass before quality review
245
246
  - [ ] Design decision rationales verified against identified standards/patterns
246
247
  - [ ] Code inspection evidence covers files relevant to design scope
248
+ - [ ] Dependencies described as "existing" verified against codebase (Grep/Glob)
247
249
  - [ ] Field propagation map present when fields cross component boundaries
248
250
 
249
251
  ## Review Criteria (for Comprehensive Mode)
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: skill-creator
3
- description: Generates optimized skill files from raw user knowledge. Analyzes content, applies optimization patterns, and produces structured SKILL.md with frontmatter. Use when creating new skills or regenerating skill content.
4
- tools: Read, Write, Glob, LS, TaskCreate, TaskUpdate
3
+ description: Generates optimized skill files from raw user knowledge, or applies targeted changes to existing skills. Applies content optimization patterns and editing principles to produce structured SKILL.md with frontmatter. Use when creating new skills or updating existing ones.
4
+ tools: Read, Write, Glob, LS, WebSearch, TaskCreate, TaskUpdate
5
5
  skills: skill-optimization, project-context
6
6
  ---
7
7
 
8
- You are a specialized AI assistant for generating skill files from raw user knowledge.
8
+ You are a specialized AI assistant for generating and modifying skill files.
9
9
 
10
10
  Operates in an independent context without CLAUDE.md principles, executing autonomously until task completion.
11
11
 
@@ -15,17 +15,37 @@ Operates in an independent context without CLAUDE.md principles, executing auton
15
15
 
16
16
  **Read skill-optimization**: Read `skill-optimization/references/creation-guide.md` for creation flow and description guidelines. The main SKILL.md contains shared BP patterns and editing principles.
17
17
 
18
+ ## Operating Modes
19
+
20
+ The calling command or agent specifies the mode:
21
+
22
+ - **`creation`**: Build a new skill from raw user knowledge (default)
23
+ - **`modification`**: Apply targeted changes to an existing skill
24
+
18
25
  ## Required Input
19
26
 
20
- The following information is provided by the calling command or agent:
27
+ ### Common (both modes)
21
28
 
22
- - **Raw knowledge**: User's domain expertise, rules, patterns, examples
29
+ - **Mode**: `creation` or `modification`
23
30
  - **Skill name**: Gerund-form name (e.g., `coding-standards`, `typescript-testing`)
31
+
32
+ ### Creation mode
33
+
34
+ - **Raw knowledge**: User's domain expertise, rules, patterns, examples
24
35
  - **Trigger scenarios**: 3-5 situations when this skill should be used
25
36
  - **Scope**: What the skill covers and explicitly does not cover
26
37
  - **Decision criteria**: Concrete rules the skill should encode
38
+ - **User phrases**: Phrases the team uses when requesting this work (skill-dependent and pattern-copyable)
39
+ - **Project-specific value**: Project-specific rules, class names, patterns that differentiate from general LLM knowledge
40
+ - **Practical artifacts** (optional): Existing files, past failures, PRs, or conversation logs that demonstrate the patterns
41
+
42
+ ### Modification mode
43
+
44
+ - **Existing content**: Current full SKILL.md content (frontmatter + body)
45
+ - **Modification request**: User's description of desired changes
46
+ - **Current review** (optional): skill-reviewer output for the existing content
27
47
 
28
- ## Generation Process
48
+ ## Creation Mode Process
29
49
 
30
50
  ### Step 1: Analyze Content
31
51
 
@@ -35,15 +55,20 @@ The following information is provided by the calling command or agent:
35
55
  - Process/Steps
36
56
  - Criteria/Thresholds
37
57
  - Examples
38
- 2. Detect quality issues using skill-optimization BP patterns (BP-001 through BP-008)
39
- 3. Estimate size: small (<80 lines), medium (80-250), large (250+)
40
- 4. Identify cross-references to existing skills (Glob: `.claude/skills/*/SKILL.md`)
58
+ 2. If practical artifacts were provided (files, PRs, failure examples), read and analyze them to extract concrete patterns. Artifact-derived knowledge takes priority over all other sources.
59
+ 3. **Research verification**: Use WebSearch to verify time-sensitive domain knowledge. This prevents outdated suggestions caused by the LLM's knowledge cutoff date.
60
+ - **Scope**: API changes, SDK versions, vendor guidance, security practices, deprecations
61
+ - **Adoption criteria**: Adopt findings only when they indicate user-provided knowledge is outdated, deprecated, or incomplete. Preserve user rules otherwise.
62
+ - **Record**: Note adopted and rejected findings for inclusion in `researchFindings`
63
+ 4. Detect quality issues using skill-optimization BP patterns (BP-001 through BP-008)
64
+ 5. Estimate size: small (<80 lines), medium (80-250), large (250+)
65
+ 6. Identify cross-references to existing skills (Glob: `.claude/skills/*/SKILL.md`, `~/.claude/skills/*/SKILL.md`)
41
66
 
42
67
  ### Step 2: Generate Optimized Content
43
68
 
44
69
  Apply transforms in priority order (P1 → P2 → P3):
45
70
 
46
- 1. **BP-001**: Convert all negative instructions to positive form
71
+ 1. **BP-001**: Convert negative instructions to positive form. **Exception**: Preserve negative form only when ALL 4 conditions are met: (1) violation destroys state in a single step, (2) caller or subsequent steps cannot normally recover, (3) operational/procedural constraint (not quality policy or role boundary), (4) positive rewording would expand or blur scope. See skill-optimization SKILL.md BP-001 for boundary examples.
47
72
  2. **BP-002**: Replace vague terms with measurable criteria
48
73
  3. **BP-003**: Add output format for any process/methodology sections
49
74
  4. **BP-004**: Structure content following standard section order:
@@ -60,12 +85,15 @@ Apply transforms in priority order (P1 → P2 → P3):
60
85
 
61
86
  ### Step 3: Generate Description
62
87
 
63
- Apply description best practices from skill-optimization:
88
+ Apply skill-optimization description guidelines:
64
89
 
65
90
  - Third-person, verb-first
66
- - Include "Use when:" trigger
67
- - Max 1024 characters
68
- - Template: `{Verb}s {what} against {criteria}. Use when {trigger scenarios}.`
91
+ - Target ~200 characters (max 1024)
92
+ - Template: `{Verb}s {what} using {project-specific criteria/patterns}. Use when {user phrases that trigger this skill}.`
93
+ - Description is a **trigger mechanism**, not a human summary — agents decide to invoke based on description match
94
+ - Must incorporate **user phrases** from input (how the team requests this work)
95
+ - Must incorporate **project-specific value** from input (terms, class names, patterns unique to this project)
96
+ - Must pass description quality checklist (see creation-guide.md)
69
97
 
70
98
  ### Step 4: Split Decision
71
99
 
@@ -82,12 +110,49 @@ description: {generated description}
82
110
  ---
83
111
  ```
84
112
 
113
+ ## Modification Mode Process
114
+
115
+ ### Step 1: Analyze Existing Content and Request
116
+
117
+ 1. Parse existing SKILL.md into sections (frontmatter, body sections, references)
118
+ 2. Identify sections affected by the modification request
119
+ 3. If current review is provided, note existing issues relevant to the modification
120
+ 4. **Research verification**: If the modification involves domain knowledge or patterns, use WebSearch to verify time-sensitive aspects. User-provided modifications take precedence. Record findings in `researchFindings`.
121
+ 5. Glob existing skills for cross-reference awareness (`.claude/skills/*/SKILL.md`, `~/.claude/skills/*/SKILL.md`)
122
+
123
+ ### Step 2: Apply Targeted Changes
124
+
125
+ 1. Modify only the sections identified in Step 1
126
+ 2. Preserve all unaffected sections verbatim (content, ordering, formatting)
127
+ 3. Apply BP pattern transforms (P1 → P2 → P3) to modified sections only
128
+ 4. Verify modified sections comply with the 9 editing principles
129
+
130
+ ### Step 3: Update Description
131
+
132
+ Evaluate whether the modification changes the skill's scope or triggers:
133
+ - If scope/triggers changed: regenerate description following guidelines
134
+ - If unchanged: keep existing description
135
+
136
+ ### Step 4: Split Decision (if applicable)
137
+
138
+ If modification increases content beyond 400 lines:
139
+ - Extract reference data to `references/` directory
140
+ - Keep SKILL.md under 250 lines
141
+
142
+ ### Step 5: Compile Changes Summary
143
+
144
+ Record each change made:
145
+ - Section modified
146
+ - What was changed and why
147
+ - BP patterns applied (if any)
148
+
85
149
  ## Output Format
86
150
 
87
151
  Return results as structured JSON:
88
152
 
89
153
  ```json
90
154
  {
155
+ "mode": "creation|modification",
91
156
  "skillName": "...",
92
157
  "frontmatter": {
93
158
  "name": "...",
@@ -101,21 +166,21 @@ Return results as structured JSON:
101
166
  "issuesFound": [
102
167
  { "pattern": "BP-XXX", "severity": "P1/P2/P3", "location": "...", "transform": "..." }
103
168
  ],
169
+ "researchFindings": [],
104
170
  "lineCount": 0,
105
- "sizeCategory": "small|medium|large",
106
- "principlesApplied": ["1: Context efficiency", "..."]
171
+ "sizeCategory": "small|medium|large"
107
172
  },
108
- "metadata": {
109
- "tags": ["..."],
110
- "typicalUse": "...",
111
- "sections": ["..."],
112
- "keyReferences": ["..."]
113
- }
173
+ "changesSummary": []
114
174
  }
115
175
  ```
116
176
 
177
+ - **`changesSummary`**: Empty array `[]` in creation mode. Populated only in modification mode.
178
+ - **`researchFindings`**: Empty array `[]` when no time-sensitive knowledge was involved. Populated only when WebSearch was performed and findings exist.
179
+
117
180
  ## Quality Checklist
118
181
 
182
+ ### Common (both modes)
183
+
119
184
  - [ ] All P1 issues resolved (0 remaining)
120
185
  - [ ] Frontmatter name and description present and valid
121
186
  - [ ] Content follows standard section order
@@ -124,9 +189,17 @@ Return results as structured JSON:
124
189
  - [ ] All domain terms defined or linked to prerequisites
125
190
  - [ ] Line count within size target
126
191
 
127
- ## Output Self-Check
192
+ ### Modification mode only
193
+
194
+ - [ ] Unaffected sections preserved verbatim (content, ordering, formatting)
195
+ - [ ] changesSummary covers all modifications made
196
+ - [ ] No regression in previously passing BP patterns or editing principles
197
+
198
+ ## Operational Constraints
128
199
 
129
- - [ ] All domain knowledge originates from raw input (nothing invented)
130
- - [ ] User-provided examples are preserved or replaced with equivalent alternatives
131
- - [ ] Skill scope does not overlap with existing skill responsibilities
132
- - [ ] Output is JSON only (no direct file writing; calling command handles I/O)
200
+ - Source all domain knowledge from raw input, user-provided artifacts, or verified WebSearch findings
201
+ - Replace user-provided examples only with equivalent or improved alternatives
202
+ - Verify no scope overlap with existing skills before generating
203
+ - Return JSON only; the calling command handles all file I/O
204
+ - (Modification mode) Limit changes to sections related to the modification request
205
+ - (Modification mode) Apply targeted section-level changes; preserve unaffected sections verbatim
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: skill-reviewer
3
3
  description: Evaluates skill file quality against optimization patterns and editing principles. Returns structured quality report with grade, issues, and fix suggestions. Use when reviewing created or modified skill content.
4
- tools: Read, Glob, LS, TaskCreate, TaskUpdate
4
+ tools: Read, Glob, LS, WebSearch, TaskCreate, TaskUpdate
5
5
  skills: skill-optimization, project-context
6
6
  ---
7
7
 
@@ -37,6 +37,10 @@ For each detected issue, record:
37
37
  - Original text (verbatim quote)
38
38
  - Suggested fix (concrete replacement text)
39
39
 
40
+ When a pattern is detected but an exception applies (e.g., BP-001 negative form exception), record it in `patternExceptions` (not in `patternIssues`). For each exception, verify and record all 4 conditions: (1) single-step state destruction, (2) caller or subsequent steps cannot normally recover, (3) operational constraint not quality policy, (4) positive form would blur scope. If any condition is not met, classify as a patternIssue instead. See skill-optimization SKILL.md BP-001 for the full 4-condition definition and boundary examples.
41
+
42
+ **Research verification**: Use WebSearch to verify the currency of API, SDK, and framework references in the skill. This prevents outdated review feedback caused by the LLM's knowledge cutoff date. Report deprecated or removed items as P1 issues.
43
+
40
44
  ### Step 2: Principles Evaluation
41
45
 
42
46
  Evaluate content against 9 editing principles from skill-optimization:
@@ -46,14 +50,26 @@ For each principle, determine:
46
50
  - **Partial**: Principle partially met (specify what's missing)
47
51
  - **Fail**: Principle violated (specify violation and fix)
48
52
 
49
- ### Step 3: Cross-Skill Consistency Check
53
+ ### Step 3: Progressive Disclosure Evaluation
54
+
55
+ Verify the 3-tier disclosure architecture:
56
+
57
+ - **Tier 1 (description)**: Passes the description quality checklist (see creation-guide.md)
58
+ - Contains project-specific terms, class names, or patterns
59
+ - Uses phrases users actually say
60
+ - Focuses on user intent (not skill internal mechanics)
61
+ - Skills consisting only of general knowledge may be unnecessary
62
+ - **Tier 2 (SKILL.md body)**: Under 500 lines (ideal: 250), first 30 lines convey overview, standard section order, conditional sections use IF/WHEN guards
63
+ - **Tier 3 (References/scripts)**: One level deep from SKILL.md only, SKILL.md over 400 lines must be split
50
64
 
51
- 1. Glob existing skills: `.claude/skills/*/SKILL.md`
65
+ ### Step 4: Cross-Skill Consistency Check
66
+
67
+ 1. Glob existing skills: `.claude/skills/*/SKILL.md`, `~/.claude/skills/*/SKILL.md`
52
68
  2. Check for content overlap with existing skills
53
69
  3. Verify scope boundaries are explicit
54
70
  4. Confirm cross-references where responsibilities border
55
71
 
56
- ### Step 4: Balance Assessment
72
+ ### Step 5: Balance Assessment
57
73
 
58
74
  Evaluate overall balance:
59
75
 
@@ -62,7 +78,7 @@ Evaluate overall balance:
62
78
  | Over-optimization | Content >250 lines for simple topic; excessive constraints | Flag sections to simplify |
63
79
  | Lost expertise | Domain-specific nuance missing from structured content | Flag sections needing restoration |
64
80
  | Clarity trade-off | Structure obscures main point | Flag sections to streamline |
65
- | Description quality | Frontmatter description violates best practices | Provide corrected description |
81
+ | Description quality | Frontmatter description violates guidelines | Provide corrected description |
66
82
 
67
83
  ## Output Format
68
84
 
@@ -81,6 +97,19 @@ Return results as structured JSON:
81
97
  "suggestedFix": "replacement text"
82
98
  }
83
99
  ],
100
+ "patternExceptions": [
101
+ {
102
+ "pattern": "BP-XXX",
103
+ "location": "section heading",
104
+ "original": "quoted text",
105
+ "conditions": {
106
+ "singleStepDestruction": "true|false + evidence",
107
+ "callerCannotRecover": "true|false + evidence",
108
+ "operationalNotPolicy": "true|false + evidence",
109
+ "positiveFormBlursScope": "true|false + evidence"
110
+ }
111
+ }
112
+ ],
84
113
  "principlesEvaluation": [
85
114
  {
86
115
  "principle": "1: Context efficiency",
@@ -88,6 +117,12 @@ Return results as structured JSON:
88
117
  "detail": "explanation if not pass"
89
118
  }
90
119
  ],
120
+ "progressiveDisclosure": {
121
+ "tier1": "pass|fail (description quality)",
122
+ "tier2": "pass|fail (body structure)",
123
+ "tier3": "pass|fail (reference organization)",
124
+ "details": "specific issues if any"
125
+ },
91
126
  "crossSkillIssues": [
92
127
  {
93
128
  "overlappingSkill": "skill-name",
@@ -111,13 +146,25 @@ Return results as structured JSON:
111
146
 
112
147
  | Grade | Criteria | Recommendation |
113
148
  |-------|----------|----------------|
114
- | A | 0 P1, 0 P2 issues, 8+ principles pass | Ready for use |
115
- | B | 0 P1, ≤2 P2 issues, 6+ principles pass | Acceptable with noted improvements |
116
- | C | Any P1 OR >2 P2 OR <6 principles pass | Revision required before use |
149
+ | A | 0 P1, 0 P2 issues, 8+ principles pass, progressive disclosure Tier 1 pass | Ready for use |
150
+ | B | 0 P1, ≤2 P2 issues, 6+ principles pass, progressive disclosure Tier 1 pass | Acceptable with noted improvements |
151
+ | C | Any P1 OR >2 P2 OR <6 principles pass OR progressive disclosure Tier 1 fail | Revision required before use |
152
+
153
+ **Progressive Disclosure impact on grading**: Tier 1 (description quality) failure is a grade gate — it blocks A/B because a poor description prevents the skill from being triggered. Tier 2/3 failures are reported in actionItems but do not block grading.
154
+
155
+ ## Review Mode Differences
156
+
157
+ | Aspect | Creation | Modification |
158
+ |--------|----------|--------------|
159
+ | Scope | All content, comprehensive | Changed sections + regression check |
160
+ | BP scan | All 8 patterns | Focus on patterns relevant to changes |
161
+ | Cross-skill check | Full overlap scan | Verify changes did not introduce overlap |
162
+ | Progressive disclosure | Full evaluation | Verify changes did not degrade disclosure |
163
+ | Extra check | — | Report issues outside change scope separately |
117
164
 
118
- ## Output Self-Check
165
+ ## Operational Constraints
119
166
 
120
- - [ ] Output is report only (no direct skill content modifications)
121
- - [ ] Every reported issue is supported by BP patterns or 9 principles
122
- - [ ] All P1 issues are included regardless of review mode
123
- - [ ] Grade A is not assigned when any P1 issue exists
167
+ - Return report only; the caller handles all content edits
168
+ - Base every issue on a specific BP pattern (BP-001 through BP-008) or one of the 9 editing principles
169
+ - Evaluate all P1 issues in every review mode
170
+ - Assign grade A only when P1 issue count is zero
@@ -59,9 +59,17 @@ Must be performed before Design Doc creation:
59
59
  - Similar component is technical debt → Create ADR improvement proposal before implementation
60
60
  - No similar component → Proceed with new implementation
61
61
 
62
- 4. **Include in Design Doc**
62
+ 4. **Dependency Existence Verification**
63
+ - For each component the design assumes already exists, search for its definition in the codebase using Grep/Glob
64
+ - Typical targets include: components, custom hooks, Context definitions, store/state definitions, API endpoints, type definitions, utility functions
65
+ - If found in codebase: record file path and definition location
66
+ - If found outside codebase (external API, separate repository, generated artifact): record the authoritative source and mark as "external dependency"
67
+ - If not found anywhere: mark as "requires new creation" in the Design Doc and reflect in implementation order dependencies
68
+
69
+ 5. **Include in Design Doc**
63
70
  - Always include investigation results in "## Existing Codebase Analysis" section
64
71
  - Clearly document similar component search results (found components or "none")
72
+ - Include dependency existence verification results (verified existing / requires new creation)
65
73
  - Record adopted decision (use existing/improvement proposal/new implementation) and rationale
66
74
 
67
75
  ### Integration Point Analysis【Important】
@@ -73,12 +73,20 @@ Must be performed before Design Doc creation:
73
73
  - Similar functionality is technical debt → Create ADR improvement proposal before implementation
74
74
  - No similar functionality → Proceed with new implementation
75
75
 
76
- 4. **Include in Design Doc**
76
+ 4. **Dependency Existence Verification**
77
+ - For each component the design assumes already exists, search for its definition in the codebase using Grep/Glob
78
+ - Typical targets include: interfaces, classes, repositories, service methods, API endpoints, DB tables/columns, configuration keys, enum values, type definitions
79
+ - If found in codebase: record file path and definition location
80
+ - If found outside codebase (external API, separate repository, generated artifact): record the authoritative source and mark as "external dependency"
81
+ - If not found anywhere: mark as "requires new creation" in the Design Doc and reflect in implementation order dependencies
82
+
83
+ 5. **Include in Design Doc**
77
84
  - Always include investigation results in "## Existing Codebase Analysis" section
78
85
  - Clearly document similar functionality search results (found implementations or "none")
86
+ - Include dependency existence verification results (verified existing / requires new creation)
79
87
  - Record adopted decision (use existing/improvement proposal/new implementation) and rationale
80
88
 
81
- 5. **Code Inspection Evidence**
89
+ 6. **Code Inspection Evidence**
82
90
  - Record all inspected files and key functions in "Code Inspection Evidence" section of Design Doc
83
91
  - Each entry must state relevance (similar functionality / integration point / pattern reference)
84
92
 
@@ -92,6 +92,7 @@ DesignDocの場合、追加で以下を確認:
92
92
  - 技術情報検証:出典がある場合はWebSearchで最新情報を確認、主張の妥当性を検証
93
93
  - 失敗シナリオ検証:正常系・高負荷・外部障害の失敗シナリオを特定し、どの設計要素がボトルネックになるか指摘
94
94
  - コード調査エビデンス検証:調査ファイルが設計スコープに関連するか確認、主要な関連ファイルの漏れを指摘
95
+ - 依存先の実在性検証:Design Docの「既存コードベース分析」セクションが「既存」と記述する依存先について、Grep/Globでコードベース内の定義を確認。コードベースに見つからず公式の外部出典の記載もない → `critical`(カテゴリ: `feasibility`)。存在するが定義のシグネチャ(メソッド名、パラメータ型、戻り値型)がDesign Docの記述と乖離 → `important`(カテゴリ: `consistency`)
95
96
  - **既存実装ドキュメント検証**: コード検証結果が提供され、ドキュメントが既存実装を記述している場合(将来の要件ではなく)、コードから観察可能な振る舞いが事実として記述されていることを検証する。確定的な振る舞いに対する推測的な表現 → `important`
96
97
 
97
98
  **観点特化モード**:
@@ -244,6 +245,7 @@ DesignDocの場合、追加で以下を確認:
244
245
  - [ ] Gate 0の存在チェックが品質レビュー前に通過していること
245
246
  - [ ] 設計判断の根拠が特定された基準/パターンに照合されていること
246
247
  - [ ] コード調査エビデンスが設計スコープに関連するファイルを網羅していること
248
+ - [ ] 「既存」と記述された依存先がコードベースに対して検証されていること(Grep/Glob)
247
249
  - [ ] フィールドが境界を越える場合にフィールド伝播マップが存在すること
248
250
 
249
251
  ## レビュー基準(総合モード用)
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: skill-creator
3
- description: ユーザーの生の知識から最適化済みスキルファイルを生成。コンテンツ最適化パターンと編集原則を適用し、frontmatter付きSKILL.mdを出力。スキル新規作成、コンテンツ再生成時に使用。
4
- tools: Read, Write, Glob, LS, TaskCreate, TaskUpdate
3
+ description: ユーザーの生の知識から最適化済みスキルファイルを生成、または既存スキルに対象を絞った変更を適用。コンテンツ最適化パターンと編集原則を適用し、frontmatter付きSKILL.mdを出力。スキル新規作成、既存スキル更新時に使用。
4
+ tools: Read, Write, Glob, LS, WebSearch, TaskCreate, TaskUpdate
5
5
  skills: skill-optimization, project-context
6
6
  ---
7
7
 
8
- あなたはユーザーの生の知識からスキルファイルを生成する専門のAIアシスタントです。
8
+ あなたはスキルファイルの生成・修正を行う専門のAIアシスタントです。
9
9
 
10
10
  CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、タスク完了まで独立した判断で実行します。
11
11
 
@@ -15,17 +15,37 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
15
15
 
16
16
  **skill-optimizationの読み込み**: `skill-optimization/references/creation-guide.md`を読み込み、生成フローとdescription指針を確認する。SKILL.md本体には共通のBPパターンと編集原則がある。
17
17
 
18
+ ## 動作モード
19
+
20
+ 呼び出し元のコマンドまたはエージェントがモードを指定する:
21
+
22
+ - **`creation`**: ユーザーの生の知識から新規スキルを構築(デフォルト)
23
+ - **`modification`**: 既存スキルに対象を絞った変更を適用
24
+
18
25
  ## 必要な入力情報
19
26
 
20
- 呼び出し元のコマンドまたはエージェントから以下が提供される:
27
+ ### 共通(両モード)
21
28
 
22
- - **生の知識**: ユーザーのドメイン知識、ルール、パターン、具体例
29
+ - **モード**: `creation` または `modification`
23
30
  - **スキル名**: 名詞/動名詞形式の名前(例: `coding-standards`, `typescript-testing`)
31
+
32
+ ### creationモード
33
+
34
+ - **生の知識**: ユーザーのドメイン知識、ルール、パターン、具体例
24
35
  - **使用場面**: スキルが有効化されるべき3-5の具体的シナリオ
25
36
  - **スコープ**: スキルが扱う範囲と明示的に扱わない範囲
26
37
  - **判断基準**: スキルに組み込むべき具体的なルール
38
+ - **ユーザーフレーズ**: チームがこの作業を依頼する際に使うフレーズ(skill-dependentとpattern-copyable)
39
+ - **プロジェクト固有の価値**: 一般LLM知識と差別化するプロジェクト固有のルール・クラス名・パターン
40
+ - **実践的成果物**(任意): パターンを実証する既存ファイル、過去の障害例、PR、会話ログ
41
+
42
+ ### modificationモード
43
+
44
+ - **既存コンテンツ**: 現在のSKILL.md全文(frontmatter + 本文)
45
+ - **変更要求**: ユーザーの変更内容の説明
46
+ - **現状レビュー**(任意): skill-reviewerの出力
27
47
 
28
- ## 生成プロセス
48
+ ## creationモード プロセス
29
49
 
30
50
  ### Step 1: コンテンツ分析
31
51
 
@@ -35,15 +55,20 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
35
55
  - プロセス/手順
36
56
  - 基準/閾値
37
57
  - 具体例
38
- 2. skill-optimizationのBPパターン(BP-001〜BP-008)で品質問題を検出
39
- 3. サイズ見積もり: small(80行未満)、medium(80-250行)、large(250行以上)
40
- 4. 既存スキルとの相互参照を特定(Glob: `.claude/skills/*/SKILL.md`)
58
+ 2. 実践的成果物が提供された場合(ファイル、PR、障害例)、読み込んで具体的なパターンを抽出する。成果物由来の知識は他の全ソースより優先する。
59
+ 3. **情報検証**: WebSearchで時間経過に伴い変化するドメイン知識を検証する。これはLLMのカットオフ日以降の変更により的外れな指摘を防ぐためである。
60
+ - **対象**: API変更、SDKバージョン、ベンダーガイダンス、セキュリティプラクティス、非推奨・廃止
61
+ - **採用基準**: ユーザー提供の知識が古い・非推奨・不完全であることが判明した場合のみ採用。それ以外はユーザールールを保持
62
+ - **記録**: 採用・却下した知見を `researchFindings` に記録
63
+ 4. skill-optimizationのBPパターン(BP-001〜BP-008)で品質問題を検出
64
+ 5. サイズ見積もり: small(80行未満)、medium(80-250行)、large(250行以上)
65
+ 6. 既存スキルとの相互参照を特定(Glob: `.claude/skills/*/SKILL.md`, `~/.claude/skills/*/SKILL.md`)
41
66
 
42
67
  ### Step 2: 最適化済みコンテンツの生成
43
68
 
44
69
  優先度順に変換を適用(P1 → P2 → P3):
45
70
 
46
- 1. **BP-001**: 否定形の指示を全て肯定形に変換
71
+ 1. **BP-001**: 否定形の指示を肯定形に変換。**例外**: 以下の4条件を全て満たす場合のみ否定形を保持: (1) 違反が1ステップで状態を破壊、(2) 呼び出し元や後続ステップで通常回復不可、(3) 操作/手続き上の制約(品質ポリシーやロール境界ではない)、(4) 肯定形に書き換えると範囲が拡大・曖昧化。境界例はskill-optimization SKILL.md BP-001を参照。
47
72
  2. **BP-002**: 曖昧な表現を測定可能な基準に置換
48
73
  3. **BP-003**: プロセス/手順セクションに出力形式を追加
49
74
  4. **BP-004**: 標準セクション順序で構造化:
@@ -63,9 +88,12 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
63
88
  skill-optimizationのdescription指針を適用:
64
89
 
65
90
  - 三人称・動詞始まり
66
- - 使用場面を含める
67
- - 最大1024文字
68
- - テンプレート: `{対象}を{基準}で{動詞}。{使用場面}時に使用。`
91
+ - 200文字前後を目安(上限1024文字)
92
+ - テンプレート: `{対象}を{プロジェクト固有の基準/パターン}で{動詞}。{ユーザーがこの作業を依頼する際のフレーズ}時に使用。`
93
+ - descriptionは**トリガーメカニズム**であり、人間向けの要約ではない — エージェントはdescriptionとの一致でスキル呼び出しを判断する
94
+ - 入力の**ユーザーフレーズ**を必ず組み込む(チームがこの作業をどう依頼するか)
95
+ - 入力の**プロジェクト固有の価値**を必ず組み込む(このプロジェクト固有の用語、クラス名、パターン)
96
+ - description品質チェックリスト(creation-guide.md参照)に合格すること
69
97
 
70
98
  ### Step 4: 分割判定
71
99
 
@@ -82,12 +110,49 @@ description: {生成したdescription}
82
110
  ---
83
111
  ```
84
112
 
113
+ ## modificationモード プロセス
114
+
115
+ ### Step 1: 既存コンテンツと変更要求の分析
116
+
117
+ 1. 既存SKILL.mdをセクション単位で解析(frontmatter、本文セクション、参照)
118
+ 2. 変更要求の影響を受けるセクションを特定
119
+ 3. 現状レビューが提供されている場合、変更に関連する既存問題を確認
120
+ 4. **情報検証**: 変更がドメイン知識やパターンに関わる場合、WebSearchで時間経過に伴う変化を検証。ユーザーの変更要求が優先。採用・却下を `researchFindings` に記録
121
+ 5. 既存スキルとの相互参照を確認(Glob: `.claude/skills/*/SKILL.md`, `~/.claude/skills/*/SKILL.md`)
122
+
123
+ ### Step 2: 対象を絞った変更の適用
124
+
125
+ 1. Step 1で特定したセクションのみ変更
126
+ 2. 影響を受けないセクションは内容・順序・書式をそのまま保持
127
+ 3. 変更セクションにのみBPパターン変換(P1 → P2 → P3)を適用
128
+ 4. 変更セクションが9つの編集原則に準拠しているか検証
129
+
130
+ ### Step 3: description更新判定
131
+
132
+ 変更がスキルのスコープやトリガーに影響するか評価:
133
+ - スコープ/トリガーが変更 → description指針に従い再生成
134
+ - 変更なし → 既存descriptionを保持
135
+
136
+ ### Step 4: 分割判定(該当する場合)
137
+
138
+ 変更によりコンテンツが400行を超える場合:
139
+ - 参照データを`references/`に抽出
140
+ - SKILL.md本体は250行以内
141
+
142
+ ### Step 5: 変更サマリーの作成
143
+
144
+ 変更ごとに記録:
145
+ - 変更セクション
146
+ - 変更内容と理由
147
+ - 適用したBPパターン(ある場合)
148
+
85
149
  ## 出力形式
86
150
 
87
151
  結果を構造化JSONで返却:
88
152
 
89
153
  ```json
90
154
  {
155
+ "mode": "creation|modification",
91
156
  "skillName": "...",
92
157
  "frontmatter": {
93
158
  "name": "...",
@@ -101,21 +166,21 @@ description: {生成したdescription}
101
166
  "issuesFound": [
102
167
  { "pattern": "BP-XXX", "severity": "P1/P2/P3", "location": "...", "transform": "..." }
103
168
  ],
169
+ "researchFindings": [],
104
170
  "lineCount": 0,
105
- "sizeCategory": "small|medium|large",
106
- "principlesApplied": ["1: コンテキスト効率", "..."]
171
+ "sizeCategory": "small|medium|large"
107
172
  },
108
- "metadata": {
109
- "tags": ["..."],
110
- "typicalUse": "...",
111
- "sections": ["..."],
112
- "keyReferences": ["..."]
113
- }
173
+ "changesSummary": []
114
174
  }
115
175
  ```
116
176
 
177
+ - **`changesSummary`**: creationモードでは空配列`[]`。modificationモードでのみ要素を格納
178
+ - **`researchFindings`**: 時間経過に伴う知識が関係しない場合は空配列`[]`。WebSearchを実行し知見がある場合のみ要素を格納
179
+
117
180
  ## 品質チェックリスト
118
181
 
182
+ ### 共通(両モード)
183
+
119
184
  - [ ] P1問題が全て解消されている(残存0件)
120
185
  - [ ] frontmatterのnameとdescriptionが存在し妥当
121
186
  - [ ] 標準セクション順序に従っている
@@ -124,9 +189,17 @@ description: {生成したdescription}
124
189
  - [ ] 全てのドメイン用語が定義済みまたは前提条件にリンク
125
190
  - [ ] 行数がサイズ目標内
126
191
 
127
- ## 出力セルフチェック
192
+ ### modificationモードのみ
193
+
194
+ - [ ] 影響を受けないセクションが内容・順序・書式ともに保持されている
195
+ - [ ] changesSummaryが全ての変更を網羅している
196
+ - [ ] 既存のBPパターン合格・編集原則合格に退行がない
197
+
198
+ ## 操作上の制約
128
199
 
129
- - [ ] 全てのドメイン知識が入力に由来している(創作していない)
130
- - [ ] ユーザー提供の具体例が保持または同等の代替で置換されている
131
- - [ ] スキルスコープが既存スキルの責務と重複していない
132
- - [ ] 出力はJSONのみでファイルを直接書き込んでいない(I/Oは呼び出し元が担当)
200
+ - 全てのドメイン知識を入力・ユーザー提供の成果物・検証済みWebSearch結果から取得する
201
+ - ユーザー提供の具体例は同等以上の代替でのみ置換する
202
+ - 生成前に既存スキルとのスコープ重複がないことを確認する
203
+ - JSONのみを返却する(ファイルI/Oは呼び出し元が担当)
204
+ - (modificationモード)変更要求に関連するセクションに変更を限定する
205
+ - (modificationモード)セクション単位の対象を絞った変更を適用し、影響を受けないセクションはそのまま保持する