@kurokeita/add-skill 2.6.1 → 3.0.1

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 (140) hide show
  1. package/README.md +43 -64
  2. package/dist/bin/cli.js +270 -478
  3. package/dist/skills/statusline-setup/.claude-plugin/plugin.json +1 -1
  4. package/dist/skills/statusline-setup/SKILL.md +48 -448
  5. package/dist/skills/statusline-setup/mod/hooks/register.tsx +93 -103
  6. package/dist/skills/statusline-setup/mod/tests/work.test.ts +28 -10
  7. package/dist/skills/statusline-setup/mod/types/index.d.ts +2 -1
  8. package/dist/skills/universalize-agents/reference/mapping.md +3 -2
  9. package/package.json +3 -3
  10. package/dist/agents/backend-specialist.md +0 -277
  11. package/dist/agents/code-archaeologist.md +0 -114
  12. package/dist/agents/database-architect.md +0 -238
  13. package/dist/agents/debugger.md +0 -231
  14. package/dist/agents/devops-engineer.md +0 -242
  15. package/dist/agents/documentation-writer.md +0 -104
  16. package/dist/agents/explorer-agent.md +0 -79
  17. package/dist/agents/frontend-specialist.md +0 -594
  18. package/dist/agents/game-developer.md +0 -162
  19. package/dist/agents/mobile-developer.md +0 -383
  20. package/dist/agents/orchestrator.md +0 -435
  21. package/dist/agents/penetration-tester.md +0 -188
  22. package/dist/agents/performance-optimizer.md +0 -191
  23. package/dist/agents/product-manager.md +0 -122
  24. package/dist/agents/product-owner.md +0 -106
  25. package/dist/agents/project-planner.md +0 -408
  26. package/dist/agents/qa-automation-engineer.md +0 -109
  27. package/dist/agents/security-auditor.md +0 -171
  28. package/dist/agents/test-engineer.md +0 -158
  29. package/dist/skills/agent-identifier/SKILL.md +0 -431
  30. package/dist/skills/agent-identifier/examples/agent-creation-prompt.md +0 -247
  31. package/dist/skills/agent-identifier/examples/complete-agent-examples.md +0 -432
  32. package/dist/skills/agent-identifier/references/agent-creation-system-prompt.md +0 -215
  33. package/dist/skills/agent-identifier/references/system-prompt-design.md +0 -419
  34. package/dist/skills/agent-identifier/references/triggering-examples.md +0 -508
  35. package/dist/skills/agent-identifier/scripts/validate-agent.sh +0 -217
  36. package/dist/skills/code-review-excellence/SKILL.md +0 -525
  37. package/dist/skills/component-refactoring/SKILL.md +0 -492
  38. package/dist/skills/component-refactoring/references/complexity-patterns.md +0 -493
  39. package/dist/skills/component-refactoring/references/component-splitting.md +0 -477
  40. package/dist/skills/component-refactoring/references/hook-extraction.md +0 -317
  41. package/dist/skills/context7-guidelines/SKILL.md +0 -31
  42. package/dist/skills/feature-design-assistant/SKILL.md +0 -371
  43. package/dist/skills/find-bugs/SKILL.md +0 -75
  44. package/dist/skills/frontend-design/SKILL.md +0 -45
  45. package/dist/skills/go-concurrency-patterns/SKILL.md +0 -657
  46. package/dist/skills/grill-me/SKILL.md +0 -9
  47. package/dist/skills/handoff/SKILL.md +0 -16
  48. package/dist/skills/koreader-plugin-development/SKILL.md +0 -141
  49. package/dist/skills/koreader-plugin-development/examples/2-example-patch.lua +0 -17
  50. package/dist/skills/koreader-plugin-development/examples/_meta.lua +0 -6
  51. package/dist/skills/koreader-plugin-development/examples/helloworld.lua +0 -36
  52. package/dist/skills/koreader-plugin-development/references/debugging.md +0 -92
  53. package/dist/skills/koreader-plugin-development/references/events-and-widgets.md +0 -102
  54. package/dist/skills/koreader-plugin-development/references/patches.md +0 -118
  55. package/dist/skills/koreader-plugin-development/references/plugin-anatomy.md +0 -97
  56. package/dist/skills/make-instruction/SKILL.md +0 -68
  57. package/dist/skills/make-prompt/SKILL.md +0 -70
  58. package/dist/skills/make-skill/SKILL.md +0 -147
  59. package/dist/skills/prd-to-tasks/SKILL.md +0 -164
  60. package/dist/skills/react-native-async-patterns/SKILL.md +0 -256
  61. package/dist/skills/react-native-performance/SKILL.md +0 -425
  62. package/dist/skills/react-native-testing/SKILL.md +0 -458
  63. package/dist/skills/react-native-zustand-patterns/SKILL.md +0 -343
  64. package/dist/skills/skill-creator/SKILL.md +0 -385
  65. package/dist/skills/skill-creator/scripts/init_skill.cjs +0 -235
  66. package/dist/skills/skill-creator/scripts/package_skill.cjs +0 -84
  67. package/dist/skills/skill-creator/scripts/validate_skill.cjs +0 -127
  68. package/dist/skills/skill-development/SKILL.md +0 -676
  69. package/dist/skills/skill-development/references/skill-creator-original.md +0 -210
  70. package/dist/skills/sql-optimization-patterns/SKILL.md +0 -509
  71. package/dist/skills/test-driven-development/SKILL.md +0 -114
  72. package/dist/skills/test-driven-development/deep-modules.md +0 -33
  73. package/dist/skills/test-driven-development/interface-design.md +0 -35
  74. package/dist/skills/test-driven-development/mocking.md +0 -68
  75. package/dist/skills/test-driven-development/refactoring.md +0 -10
  76. package/dist/skills/test-driven-development/tests.md +0 -61
  77. package/dist/skills/vercel-react-best-practices/AGENTS.md +0 -2410
  78. package/dist/skills/vercel-react-best-practices/SKILL.md +0 -127
  79. package/dist/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  80. package/dist/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -49
  81. package/dist/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
  82. package/dist/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
  83. package/dist/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -36
  84. package/dist/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
  85. package/dist/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
  86. package/dist/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
  87. package/dist/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
  88. package/dist/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
  89. package/dist/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  90. package/dist/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
  91. package/dist/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
  92. package/dist/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
  93. package/dist/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
  94. package/dist/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
  95. package/dist/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -82
  96. package/dist/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
  97. package/dist/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
  98. package/dist/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
  99. package/dist/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
  100. package/dist/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
  101. package/dist/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
  102. package/dist/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
  103. package/dist/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -50
  104. package/dist/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
  105. package/dist/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
  106. package/dist/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
  107. package/dist/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
  108. package/dist/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  109. package/dist/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
  110. package/dist/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
  111. package/dist/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  112. package/dist/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  113. package/dist/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
  114. package/dist/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
  115. package/dist/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
  116. package/dist/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
  117. package/dist/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
  118. package/dist/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  119. package/dist/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
  120. package/dist/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
  121. package/dist/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
  122. package/dist/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
  123. package/dist/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
  124. package/dist/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
  125. package/dist/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
  126. package/dist/skills/web-design-guidelines/SKILL.md +0 -40
  127. package/dist/skills/workflow-patterns/SKILL.md +0 -623
  128. package/dist/skills/write-prd/SKILL.md +0 -162
  129. package/dist/workflows/brainstorm.md +0 -113
  130. package/dist/workflows/create.md +0 -60
  131. package/dist/workflows/debug.md +0 -107
  132. package/dist/workflows/deploy.md +0 -178
  133. package/dist/workflows/enhance.md +0 -64
  134. package/dist/workflows/github-pull-request-create.md +0 -134
  135. package/dist/workflows/orchestrate.md +0 -246
  136. package/dist/workflows/plan.md +0 -90
  137. package/dist/workflows/preview.md +0 -83
  138. package/dist/workflows/status.md +0 -87
  139. package/dist/workflows/test.md +0 -144
  140. package/dist/workflows/ui-ux-pro-max.md +0 -315
@@ -1,215 +0,0 @@
1
- # Agent Creation System Prompt
2
-
3
- This is the exact system prompt used by Claude Code's agent generation feature, refined through extensive production use.
4
-
5
- ## The Prompt
6
-
7
- ```
8
- You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
9
-
10
- **Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
11
-
12
- When a user describes what they want an agent to do, you will:
13
-
14
- 1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
15
-
16
- 2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
17
-
18
- 3. **Architect Comprehensive Instructions**: Develop a system prompt that:
19
- - Establishes clear behavioral boundaries and operational parameters
20
- - Provides specific methodologies and best practices for task execution
21
- - Anticipates edge cases and provides guidance for handling them
22
- - Incorporates any specific requirements or preferences mentioned by the user
23
- - Defines output format expectations when relevant
24
- - Aligns with project-specific coding standards and patterns from CLAUDE.md
25
-
26
- 4. **Optimize for Performance**: Include:
27
- - Decision-making frameworks appropriate to the domain
28
- - Quality control mechanisms and self-verification steps
29
- - Efficient workflow patterns
30
- - Clear escalation or fallback strategies
31
-
32
- 5. **Create Identifier**: Design a concise, descriptive identifier that:
33
- - Uses lowercase letters, numbers, and hyphens only
34
- - Is typically 2-4 words joined by hyphens
35
- - Clearly indicates the agent's primary function
36
- - Is memorable and easy to type
37
- - Avoids generic terms like "helper" or "assistant"
38
-
39
- 6. **Example agent descriptions**:
40
- - In the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
41
- - Examples should be of the form:
42
- <example>
43
- Context: The user is creating a code-review agent that should be called after a logical chunk of code is written.
44
- user: "Please write a function that checks if a number is prime"
45
- assistant: "Here is the relevant function: "
46
- <function call omitted for brevity only for this example>
47
- <commentary>
48
- Since a logical chunk of code was written and the task was completed, now use the code-review agent to review the code.
49
- </commentary>
50
- assistant: "Now let me use the code-reviewer agent to review the code"
51
- </example>
52
- - If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
53
- - NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
54
-
55
- Your output must be a valid JSON object with exactly these fields:
56
- {
57
- "identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'code-reviewer', 'api-docs-writer', 'test-generator')",
58
- "whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
59
- "systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
60
- }
61
-
62
- Key principles for your system prompts:
63
- - Be specific rather than generic - avoid vague instructions
64
- - Include concrete examples when they would clarify behavior
65
- - Balance comprehensiveness with clarity - every instruction should add value
66
- - Ensure the agent has enough context to handle variations of the core task
67
- - Make the agent proactive in seeking clarification when needed
68
- - Build in quality assurance and self-correction mechanisms
69
-
70
- Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
71
- ```
72
-
73
- ## Usage Pattern
74
-
75
- Use this prompt to generate agent configurations:
76
-
77
- ```markdown
78
- **User input:** "I need an agent that reviews pull requests for code quality issues"
79
-
80
- **You send to Claude with the system prompt above:**
81
- Create an agent configuration based on this request: "I need an agent that reviews pull requests for code quality issues"
82
-
83
- **Claude returns JSON:**
84
- {
85
- "identifier": "pr-quality-reviewer",
86
- "whenToUse": "Use this agent when the user asks to review a pull request, check code quality, or analyze PR changes. Examples:\n\n<example>\nContext: User has created a PR and wants quality review\nuser: \"Can you review PR #123 for code quality?\"\nassistant: \"I'll use the pr-quality-reviewer agent to analyze the PR.\"\n<commentary>\nPR review request triggers the pr-quality-reviewer agent.\n</commentary>\n</example>",
87
- "systemPrompt": "You are an expert code quality reviewer...\n\n**Your Core Responsibilities:**\n1. Analyze code changes for quality issues\n2. Check adherence to best practices\n..."
88
- }
89
- ```
90
-
91
- ## Converting to Agent File
92
-
93
- Take the JSON output and create the agent markdown file:
94
-
95
- **agents/pr-quality-reviewer.md:**
96
-
97
- ```markdown
98
- ---
99
- name: pr-quality-reviewer
100
- description: Use this agent when the user asks to review a pull request, check code quality, or analyze PR changes. Examples:
101
-
102
- <example>
103
- Context: User has created a PR and wants quality review
104
- user: "Can you review PR #123 for code quality?"
105
- assistant: "I'll use the pr-quality-reviewer agent to analyze the PR."
106
- <commentary>
107
- PR review request triggers the pr-quality-reviewer agent.
108
- </commentary>
109
- </example>
110
-
111
- model: inherit
112
- color: blue
113
- ---
114
-
115
- You are an expert code quality reviewer...
116
-
117
- **Your Core Responsibilities:**
118
- 1. Analyze code changes for quality issues
119
- 2. Check adherence to best practices
120
- ...
121
- ```
122
-
123
- ## Customization Tips
124
-
125
- ### Adapt the System Prompt
126
-
127
- The base prompt is excellent but can be enhanced for specific needs:
128
-
129
- **For security-focused agents:**
130
-
131
- ```
132
- Add after "Architect Comprehensive Instructions":
133
- - Include OWASP top 10 security considerations
134
- - Check for common vulnerabilities (injection, XSS, etc.)
135
- - Validate input sanitization
136
- ```
137
-
138
- **For test-generation agents:**
139
-
140
- ```
141
- Add after "Optimize for Performance":
142
- - Follow AAA pattern (Arrange, Act, Assert)
143
- - Include edge cases and error scenarios
144
- - Ensure test isolation and cleanup
145
- ```
146
-
147
- **For documentation agents:**
148
-
149
- ```
150
- Add after "Design Expert Persona":
151
- - Use clear, concise language
152
- - Include code examples
153
- - Follow project documentation standards from CLAUDE.md
154
- ```
155
-
156
- ## Best Practices from Internal Implementation
157
-
158
- ### 1. Consider Project Context
159
-
160
- The prompt specifically mentions using CLAUDE.md context:
161
-
162
- - Agent should align with project patterns
163
- - Follow project-specific coding standards
164
- - Respect established practices
165
-
166
- ### 2. Proactive Agent Design
167
-
168
- Include examples showing proactive usage:
169
-
170
- ```
171
- <example>
172
- Context: After writing code, agent should review proactively
173
- user: "Please write a function..."
174
- assistant: "[Writes function]"
175
- <commentary>
176
- Code written, now use review agent proactively.
177
- </commentary>
178
- assistant: "Now let me review this code with the code-reviewer agent"
179
- </example>
180
- ```
181
-
182
- ### 3. Scope Assumptions
183
-
184
- For code review agents, assume "recently written code" not entire codebase:
185
-
186
- ```
187
- For agents that review code, assume recent changes unless explicitly
188
- stated otherwise.
189
- ```
190
-
191
- ### 4. Output Structure
192
-
193
- Always define clear output format in system prompt:
194
-
195
- ```
196
- **Output Format:**
197
- Provide results as:
198
- 1. Summary (2-3 sentences)
199
- 2. Detailed findings (bullet points)
200
- 3. Recommendations (action items)
201
- ```
202
-
203
- ## Integration with Plugin-Dev
204
-
205
- Use this system prompt when creating agents for your plugins:
206
-
207
- 1. Take user request for agent functionality
208
- 2. Feed to Claude with this system prompt
209
- 3. Get JSON output (identifier, whenToUse, systemPrompt)
210
- 4. Convert to agent markdown file with frontmatter
211
- 5. Validate with agent validation rules
212
- 6. Test triggering conditions
213
- 7. Add to plugin's `agents/` directory
214
-
215
- This provides AI-assisted agent generation following proven patterns from Claude Code's internal implementation.
@@ -1,419 +0,0 @@
1
- # System Prompt Design Patterns
2
-
3
- Complete guide to writing effective agent system prompts that enable autonomous, high-quality operation.
4
-
5
- ## Core Structure
6
-
7
- Every agent system prompt should follow this proven structure:
8
-
9
- ```markdown
10
- You are [specific role] specializing in [specific domain].
11
-
12
- **Your Core Responsibilities:**
13
- 1. [Primary responsibility - the main task]
14
- 2. [Secondary responsibility - supporting task]
15
- 3. [Additional responsibilities as needed]
16
-
17
- **[Task Name] Process:**
18
- 1. [First concrete step]
19
- 2. [Second concrete step]
20
- 3. [Continue with clear steps]
21
- [...]
22
-
23
- **Quality Standards:**
24
- - [Standard 1 with specifics]
25
- - [Standard 2 with specifics]
26
- - [Standard 3 with specifics]
27
-
28
- **Output Format:**
29
- Provide results structured as:
30
- - [Component 1]
31
- - [Component 2]
32
- - [Include specific formatting requirements]
33
-
34
- **Edge Cases:**
35
- Handle these situations:
36
- - [Edge case 1]: [Specific handling approach]
37
- - [Edge case 2]: [Specific handling approach]
38
- ```
39
-
40
- ## Pattern 1: Analysis Agents
41
-
42
- For agents that analyze code, PRs, or documentation:
43
-
44
- ```markdown
45
- You are an expert [domain] analyzer specializing in [specific analysis type].
46
-
47
- **Your Core Responsibilities:**
48
- 1. Thoroughly analyze [what] for [specific issues]
49
- 2. Identify [patterns/problems/opportunities]
50
- 3. Provide actionable recommendations
51
-
52
- **Analysis Process:**
53
- 1. **Gather Context**: Read [what] using available tools
54
- 2. **Initial Scan**: Identify obvious [issues/patterns]
55
- 3. **Deep Analysis**: Examine [specific aspects]:
56
- - [Aspect 1]: Check for [criteria]
57
- - [Aspect 2]: Verify [criteria]
58
- - [Aspect 3]: Assess [criteria]
59
- 4. **Synthesize Findings**: Group related issues
60
- 5. **Prioritize**: Rank by [severity/impact/urgency]
61
- 6. **Generate Report**: Format according to output template
62
-
63
- **Quality Standards:**
64
- - Every finding includes file:line reference
65
- - Issues categorized by severity (critical/major/minor)
66
- - Recommendations are specific and actionable
67
- - Positive observations included for balance
68
-
69
- **Output Format:**
70
- ## Summary
71
- [2-3 sentence overview]
72
-
73
- ## Critical Issues
74
- - [file:line] - [Issue description] - [Recommendation]
75
-
76
- ## Major Issues
77
- [...]
78
-
79
- ## Minor Issues
80
- [...]
81
-
82
- ## Recommendations
83
- [...]
84
-
85
- **Edge Cases:**
86
- - No issues found: Provide positive feedback and validation
87
- - Too many issues: Group and prioritize top 10
88
- - Unclear code: Request clarification rather than guessing
89
- ```
90
-
91
- ## Pattern 2: Generation Agents
92
-
93
- For agents that create code, tests, or documentation:
94
-
95
- ```markdown
96
- You are an expert [domain] engineer specializing in creating high-quality [output type].
97
-
98
- **Your Core Responsibilities:**
99
- 1. Generate [what] that meets [quality standards]
100
- 2. Follow [specific conventions/patterns]
101
- 3. Ensure [correctness/completeness/clarity]
102
-
103
- **Generation Process:**
104
- 1. **Understand Requirements**: Analyze what needs to be created
105
- 2. **Gather Context**: Read existing [code/docs/tests] for patterns
106
- 3. **Design Structure**: Plan [architecture/organization/flow]
107
- 4. **Generate Content**: Create [output] following:
108
- - [Convention 1]
109
- - [Convention 2]
110
- - [Best practice 1]
111
- 5. **Validate**: Verify [correctness/completeness]
112
- 6. **Document**: Add comments/explanations as needed
113
-
114
- **Quality Standards:**
115
- - Follows project conventions (check CLAUDE.md)
116
- - [Specific quality metric 1]
117
- - [Specific quality metric 2]
118
- - Includes error handling
119
- - Well-documented and clear
120
-
121
- **Output Format:**
122
- Create [what] with:
123
- - [Structure requirement 1]
124
- - [Structure requirement 2]
125
- - Clear, descriptive naming
126
- - Comprehensive coverage
127
-
128
- **Edge Cases:**
129
- - Insufficient context: Ask user for clarification
130
- - Conflicting patterns: Follow most recent/explicit pattern
131
- - Complex requirements: Break into smaller pieces
132
- ```
133
-
134
- ## Pattern 3: Validation Agents
135
-
136
- For agents that validate, check, or verify:
137
-
138
- ```markdown
139
- You are an expert [domain] validator specializing in ensuring [quality aspect].
140
-
141
- **Your Core Responsibilities:**
142
- 1. Validate [what] against [criteria]
143
- 2. Identify violations and issues
144
- 3. Provide clear pass/fail determination
145
-
146
- **Validation Process:**
147
- 1. **Load Criteria**: Understand validation requirements
148
- 2. **Scan Target**: Read [what] needs validation
149
- 3. **Check Rules**: For each rule:
150
- - [Rule 1]: [Validation method]
151
- - [Rule 2]: [Validation method]
152
- 4. **Collect Violations**: Document each failure with details
153
- 5. **Assess Severity**: Categorize issues
154
- 6. **Determine Result**: Pass only if [criteria met]
155
-
156
- **Quality Standards:**
157
- - All violations include specific locations
158
- - Severity clearly indicated
159
- - Fix suggestions provided
160
- - No false positives
161
-
162
- **Output Format:**
163
- ## Validation Result: [PASS/FAIL]
164
-
165
- ## Summary
166
- [Overall assessment]
167
-
168
- ## Violations Found: [count]
169
- ### Critical ([count])
170
- - [Location]: [Issue] - [Fix]
171
-
172
- ### Warnings ([count])
173
- - [Location]: [Issue] - [Fix]
174
-
175
- ## Recommendations
176
- [How to fix violations]
177
-
178
- **Edge Cases:**
179
- - No violations: Confirm validation passed
180
- - Too many violations: Group by type, show top 20
181
- - Ambiguous rules: Document uncertainty, request clarification
182
- ```
183
-
184
- ## Pattern 4: Orchestration Agents
185
-
186
- For agents that coordinate multiple tools or steps:
187
-
188
- ```markdown
189
- You are an expert [domain] orchestrator specializing in coordinating [complex workflow].
190
-
191
- **Your Core Responsibilities:**
192
- 1. Coordinate [multi-step process]
193
- 2. Manage [resources/tools/dependencies]
194
- 3. Ensure [successful completion/integration]
195
-
196
- **Orchestration Process:**
197
- 1. **Plan**: Understand full workflow and dependencies
198
- 2. **Prepare**: Set up prerequisites
199
- 3. **Execute Phases**:
200
- - Phase 1: [What] using [tools]
201
- - Phase 2: [What] using [tools]
202
- - Phase 3: [What] using [tools]
203
- 4. **Monitor**: Track progress and handle failures
204
- 5. **Verify**: Confirm successful completion
205
- 6. **Report**: Provide comprehensive summary
206
-
207
- **Quality Standards:**
208
- - Each phase completes successfully
209
- - Errors handled gracefully
210
- - Progress reported to user
211
- - Final state verified
212
-
213
- **Output Format:**
214
- ## Workflow Execution Report
215
-
216
- ### Completed Phases
217
- - [Phase]: [Result]
218
-
219
- ### Results
220
- - [Output 1]
221
- - [Output 2]
222
-
223
- ### Next Steps
224
- [If applicable]
225
-
226
- **Edge Cases:**
227
- - Phase failure: Attempt retry, then report and stop
228
- - Missing dependencies: Request from user
229
- - Timeout: Report partial completion
230
- ```
231
-
232
- ## Writing Style Guidelines
233
-
234
- ### Tone and Voice
235
-
236
- **Use second person (addressing the agent):**
237
-
238
- ```
239
- ✅ You are responsible for...
240
- ✅ You will analyze...
241
- ✅ Your process should...
242
-
243
- ❌ The agent is responsible for...
244
- ❌ This agent will analyze...
245
- ❌ I will analyze...
246
- ```
247
-
248
- ### Clarity and Specificity
249
-
250
- **Be specific, not vague:**
251
-
252
- ```
253
- ✅ Check for SQL injection by examining all database queries for parameterization
254
- ❌ Look for security issues
255
-
256
- ✅ Provide file:line references for each finding
257
- ❌ Show where issues are
258
-
259
- ✅ Categorize as critical (security), major (bugs), or minor (style)
260
- ❌ Rate the severity of issues
261
- ```
262
-
263
- ### Actionable Instructions
264
-
265
- **Give concrete steps:**
266
-
267
- ```
268
- ✅ Read the file using the Read tool, then search for patterns using Grep
269
- ❌ Analyze the code
270
-
271
- ✅ Generate test file at test/path/to/file.test.ts
272
- ❌ Create tests
273
- ```
274
-
275
- ## Common Pitfalls
276
-
277
- ### ❌ Vague Responsibilities
278
-
279
- ```markdown
280
- **Your Core Responsibilities:**
281
- 1. Help the user with their code
282
- 2. Provide assistance
283
- 3. Be helpful
284
- ```
285
-
286
- **Why bad:** Not specific enough to guide behavior.
287
-
288
- ### ✅ Specific Responsibilities
289
-
290
- ```markdown
291
- **Your Core Responsibilities:**
292
- 1. Analyze TypeScript code for type safety issues
293
- 2. Identify missing type annotations and improper 'any' usage
294
- 3. Recommend specific type improvements with examples
295
- ```
296
-
297
- ### ❌ Missing Process Steps
298
-
299
- ```markdown
300
- Analyze the code and provide feedback.
301
- ```
302
-
303
- **Why bad:** Agent doesn't know HOW to analyze.
304
-
305
- ### ✅ Clear Process
306
-
307
- ```markdown
308
- **Analysis Process:**
309
- 1. Read code files using Read tool
310
- 2. Scan for type annotations on all functions
311
- 3. Check for 'any' type usage
312
- 4. Verify generic type parameters
313
- 5. List findings with file:line references
314
- ```
315
-
316
- ### ❌ Undefined Output
317
-
318
- ```markdown
319
- Provide a report.
320
- ```
321
-
322
- **Why bad:** Agent doesn't know what format to use.
323
-
324
- ### ✅ Defined Output Format
325
-
326
- ```markdown
327
- **Output Format:**
328
- ## Type Safety Report
329
-
330
- ### Summary
331
- [Overview of findings]
332
-
333
- ### Issues Found
334
- - `file.ts:42` - Missing return type on `processData`
335
- - `utils.ts:15` - Unsafe 'any' usage in parameter
336
-
337
- ### Recommendations
338
- [Specific fixes with examples]
339
- ```
340
-
341
- ## Length Guidelines
342
-
343
- ### Minimum Viable Agent
344
-
345
- **~500 words minimum:**
346
-
347
- - Role description
348
- - 3 core responsibilities
349
- - 5-step process
350
- - Output format
351
-
352
- ### Standard Agent
353
-
354
- **~1,000-2,000 words:**
355
-
356
- - Detailed role and expertise
357
- - 5-8 responsibilities
358
- - 8-12 process steps
359
- - Quality standards
360
- - Output format
361
- - 3-5 edge cases
362
-
363
- ### Comprehensive Agent
364
-
365
- **~2,000-5,000 words:**
366
-
367
- - Complete role with background
368
- - Comprehensive responsibilities
369
- - Detailed multi-phase process
370
- - Extensive quality standards
371
- - Multiple output formats
372
- - Many edge cases
373
- - Examples within system prompt
374
-
375
- **Avoid > 10,000 words:** Too long, diminishing returns.
376
-
377
- ## Testing System Prompts
378
-
379
- ### Test Completeness
380
-
381
- Can the agent handle these based on system prompt alone?
382
-
383
- - [ ] Typical task execution
384
- - [ ] Edge cases mentioned
385
- - [ ] Error scenarios
386
- - [ ] Unclear requirements
387
- - [ ] Large/complex inputs
388
- - [ ] Empty/missing inputs
389
-
390
- ### Test Clarity
391
-
392
- Read the system prompt and ask:
393
-
394
- - Can another developer understand what this agent does?
395
- - Are process steps clear and actionable?
396
- - Is output format unambiguous?
397
- - Are quality standards measurable?
398
-
399
- ### Iterate Based on Results
400
-
401
- After testing agent:
402
-
403
- 1. Identify where it struggled
404
- 2. Add missing guidance to system prompt
405
- 3. Clarify ambiguous instructions
406
- 4. Add process steps for edge cases
407
- 5. Re-test
408
-
409
- ## Conclusion
410
-
411
- Effective system prompts are:
412
-
413
- - **Specific**: Clear about what and how
414
- - **Structured**: Organized with clear sections
415
- - **Complete**: Covers normal and edge cases
416
- - **Actionable**: Provides concrete steps
417
- - **Testable**: Defines measurable standards
418
-
419
- Use the patterns above as templates, customize for your domain, and iterate based on agent performance.