@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,508 +0,0 @@
1
- # Agent Triggering Examples: Best Practices
2
-
3
- Complete guide to writing effective `<example>` blocks in agent descriptions for reliable triggering.
4
-
5
- ## Example Block Format
6
-
7
- The standard format for triggering examples:
8
-
9
- ```markdown
10
- <example>
11
- Context: [Describe the situation - what led to this interaction]
12
- user: "[Exact user message or request]"
13
- assistant: "[How Claude should respond before triggering]"
14
- <commentary>
15
- [Explanation of why this agent should be triggered in this scenario]
16
- </commentary>
17
- assistant: "[How Claude triggers the agent - usually 'I'll use the [agent-name] agent...']"
18
- </example>
19
- ```
20
-
21
- ## Anatomy of a Good Example
22
-
23
- ### Context
24
-
25
- **Purpose:** Set the scene - what happened before the user's message
26
-
27
- **Good contexts:**
28
-
29
- ```
30
- Context: User just implemented a new authentication feature
31
- Context: User has created a PR and wants it reviewed
32
- Context: User is debugging a test failure
33
- Context: After writing several functions without documentation
34
- ```
35
-
36
- **Bad contexts:**
37
-
38
- ```
39
- Context: User needs help (too vague)
40
- Context: Normal usage (not specific)
41
- ```
42
-
43
- ### User Message
44
-
45
- **Purpose:** Show the exact phrasing that should trigger the agent
46
-
47
- **Good user messages:**
48
-
49
- ```
50
- user: "I've added the OAuth flow, can you check it?"
51
- user: "Review PR #123"
52
- user: "Why is this test failing?"
53
- user: "Add docs for these functions"
54
- ```
55
-
56
- **Vary the phrasing:**
57
- Include multiple examples with different phrasings for the same intent:
58
-
59
- ```
60
- Example 1: user: "Review my code"
61
- Example 2: user: "Can you check this implementation?"
62
- Example 3: user: "Look over my changes"
63
- ```
64
-
65
- ### Assistant Response (Before Triggering)
66
-
67
- **Purpose:** Show what Claude says before launching the agent
68
-
69
- **Good responses:**
70
-
71
- ```
72
- assistant: "I'll analyze your OAuth implementation."
73
- assistant: "Let me review that PR for you."
74
- assistant: "I'll investigate the test failure."
75
- ```
76
-
77
- **Proactive example:**
78
-
79
- ```
80
- assistant: "Great! Now let me review the code quality."
81
- <commentary>
82
- Code was just written, proactively trigger review agent.
83
- </commentary>
84
- ```
85
-
86
- ### Commentary
87
-
88
- **Purpose:** Explain the reasoning - WHY this agent should trigger
89
-
90
- **Good commentary:**
91
-
92
- ```
93
- <commentary>
94
- User explicitly requested code review, trigger the code-reviewer agent.
95
- </commentary>
96
-
97
- <commentary>
98
- After code implementation, proactively use review agent to check quality.
99
- </commentary>
100
-
101
- <commentary>
102
- PR analysis request matches pr-analyzer agent's expertise.
103
- </commentary>
104
- ```
105
-
106
- **Include decision logic:**
107
-
108
- ```
109
- <commentary>
110
- User wrote tests (Test tool used). The test-analyzer agent should check
111
- test quality and coverage before continuing.
112
- </commentary>
113
- ```
114
-
115
- ### Assistant Response (Triggering)
116
-
117
- **Purpose:** Show how Claude invokes the agent
118
-
119
- **Standard pattern:**
120
-
121
- ```
122
- assistant: "I'll use the [agent-name] agent to [what it will do]."
123
- ```
124
-
125
- **Examples:**
126
-
127
- ```
128
- assistant: "I'll use the code-reviewer agent to analyze the changes."
129
- assistant: "Let me use the test-generator agent to create comprehensive tests."
130
- assistant: "I'll use the security-analyzer agent to check for vulnerabilities."
131
- ```
132
-
133
- ## Example Types
134
-
135
- ### Type 1: Explicit Request
136
-
137
- User directly asks for what the agent does:
138
-
139
- ```markdown
140
- <example>
141
- Context: User explicitly requests security analysis
142
- user: "Check my code for security vulnerabilities"
143
- assistant: "I'll use the security-analyzer agent to perform a thorough security review."
144
- <commentary>
145
- Direct security analysis request triggers the security-analyzer agent.
146
- </commentary>
147
- </example>
148
- ```
149
-
150
- ### Type 2: Proactive Triggering
151
-
152
- Agent triggers after relevant work without explicit request:
153
-
154
- ```markdown
155
- <example>
156
- Context: User just implemented database queries
157
- user: "I've added the user search functionality"
158
- assistant: "Great! Let me review it for security."
159
- <commentary>
160
- Database code written. Proactively trigger security-analyzer to check
161
- for SQL injection and other database security issues.
162
- </commentary>
163
- assistant: "I'll use the security-analyzer agent to check the database code."
164
- </example>
165
- ```
166
-
167
- ### Type 3: Implicit Request
168
-
169
- User implies need without stating it directly:
170
-
171
- ```markdown
172
- <example>
173
- Context: User mentions code is hard to understand
174
- user: "This code is confusing and hard to follow"
175
- assistant: "I can help improve the code clarity."
176
- <commentary>
177
- User indicates complexity issues. Trigger code-simplifier agent to refactor
178
- for better readability.
179
- </commentary>
180
- assistant: "I'll use the code-simplifier agent to suggest improvements."
181
- </example>
182
- ```
183
-
184
- ### Type 4: Tool Usage Pattern
185
-
186
- Agent triggers based on prior tool usage:
187
-
188
- ```markdown
189
- <example>
190
- Context: User made multiple edits to test files
191
- user: "I've updated all the tests"
192
- assistant: "Great! Let me verify test quality."
193
- <commentary>
194
- Multiple Edit tools used on test files. Proactively trigger test-quality-analyzer
195
- to ensure tests follow best practices.
196
- </commentary>
197
- assistant: "I'll use the test-quality-analyzer agent to review the tests."
198
- </example>
199
- ```
200
-
201
- ## Multiple Examples Strategy
202
-
203
- ### Cover Different Phrasings
204
-
205
- ```markdown
206
- <example>
207
- user: "Review my code"
208
- [...]
209
- </example>
210
-
211
- <example>
212
- user: "Can you check my implementation?"
213
- [...]
214
- </example>
215
-
216
- <example>
217
- user: "Look over these changes"
218
- [...]
219
- </example>
220
- ```
221
-
222
- ### Cover Proactive and Reactive
223
-
224
- ```markdown
225
- <example>
226
- Context: User explicitly requests review
227
- user: "Review my code for issues"
228
- [...]
229
- </example>
230
-
231
- <example>
232
- Context: After user writes code
233
- user: "I've implemented the feature"
234
- assistant: "Great! Now let me review it."
235
- <commentary>
236
- Code written, proactively review.
237
- </commentary>
238
- [...]
239
- </example>
240
- ```
241
-
242
- ### Cover Edge Cases
243
-
244
- ```markdown
245
- <example>
246
- Context: Typical usage
247
- user: "Check my PR"
248
- [...]
249
- </example>
250
-
251
- <example>
252
- Context: Large PR that needs thorough analysis
253
- user: "This is a big PR, can you do a deep review?"
254
- [...]
255
- <commentary>
256
- Large PR mentioned, use thorough analysis mode.
257
- </commentary>
258
- </example>
259
- ```
260
-
261
- ## Common Mistakes
262
-
263
- ### ❌ Missing Context
264
-
265
- ```markdown
266
- <example>
267
- user: "Review my code"
268
- assistant: "I'll use the code-reviewer agent."
269
- </example>
270
- ```
271
-
272
- **Why bad:** No context about what led to this request.
273
-
274
- ### ✅ With Context
275
-
276
- ```markdown
277
- <example>
278
- Context: User just finished implementing authentication
279
- user: "Review my code"
280
- assistant: "I'll use the code-reviewer agent to analyze the auth implementation."
281
- <commentary>
282
- Auth code written, review for security and best practices.
283
- </commentary>
284
- </example>
285
- ```
286
-
287
- ### ❌ No Commentary
288
-
289
- ```markdown
290
- <example>
291
- Context: User requests review
292
- user: "Check my changes"
293
- assistant: "I'll use the reviewer agent."
294
- </example>
295
- ```
296
-
297
- **Why bad:** Doesn't explain WHY agent triggers.
298
-
299
- ### ✅ With Commentary
300
-
301
- ```markdown
302
- <example>
303
- Context: User requests review after making changes
304
- user: "Check my changes"
305
- assistant: "I'll use the code-reviewer agent to analyze the modifications."
306
- <commentary>
307
- Code review request triggers agent to check quality, security, and adherence to standards.
308
- </commentary>
309
- </example>
310
- ```
311
-
312
- ### ❌ Agent Responds Directly
313
-
314
- ```markdown
315
- <example>
316
- user: "Review my code"
317
- assistant: "I found the following issues: [lists issues]"
318
- </example>
319
- ```
320
-
321
- **Why bad:** Shows agent's output, not triggering.
322
-
323
- ### ✅ Shows Triggering
324
-
325
- ```markdown
326
- <example>
327
- user: "Review my code"
328
- assistant: "I'll use the code-reviewer agent to perform the review."
329
- <commentary>
330
- Review request triggers the agent.
331
- </commentary>
332
- </example>
333
- ```
334
-
335
- ## How Many Examples?
336
-
337
- ### Minimum: 2 Examples
338
-
339
- Cover at least:
340
-
341
- 1. Explicit request
342
- 2. One variation or proactive trigger
343
-
344
- ### Recommended: 3-4 Examples
345
-
346
- Cover:
347
-
348
- 1. Explicit request (direct ask)
349
- 2. Implicit request (user implies need)
350
- 3. Proactive trigger (after relevant work)
351
- 4. Edge case or specific scenario
352
-
353
- ### Maximum: 6 Examples
354
-
355
- More than 6 makes description too long. Focus on most important scenarios.
356
-
357
- ## Template Library
358
-
359
- ### Code Review Agent
360
-
361
- ```markdown
362
- <example>
363
- Context: User just implemented a new feature
364
- user: "I've added the user registration feature"
365
- assistant: "Great! Let me review the code quality."
366
- <commentary>
367
- Code written, proactively trigger code-reviewer agent.
368
- </commentary>
369
- assistant: "I'll use the code-reviewer agent to analyze the implementation."
370
- </example>
371
-
372
- <example>
373
- Context: User explicitly requests review
374
- user: "Can you review my changes for issues?"
375
- assistant: "I'll use the code-reviewer agent to perform a thorough review."
376
- <commentary>
377
- Explicit review request triggers the agent.
378
- </commentary>
379
- </example>
380
- ```
381
-
382
- ### Test Generation Agent
383
-
384
- ```markdown
385
- <example>
386
- Context: User implemented functions without tests
387
- user: "I've added the data processing functions"
388
- assistant: "Great! Let me generate tests for these."
389
- <commentary>
390
- New code without tests, proactively trigger test-generator agent.
391
- </commentary>
392
- assistant: "I'll use the test-generator agent to create comprehensive tests."
393
- </example>
394
-
395
- <example>
396
- Context: User explicitly asks for tests
397
- user: "Generate tests for my code"
398
- assistant: "I'll use the test-generator agent to create a complete test suite."
399
- <commentary>
400
- Direct test generation request triggers the agent.
401
- </commentary>
402
- </example>
403
- ```
404
-
405
- ### Documentation Agent
406
-
407
- ```markdown
408
- <example>
409
- Context: User added new API endpoints
410
- user: "I've implemented the REST API endpoints"
411
- assistant: "I'll document these endpoints."
412
- <commentary>
413
- New API code, proactively generate documentation.
414
- </commentary>
415
- assistant: "I'll use the api-docs-writer agent to create comprehensive documentation."
416
- </example>
417
-
418
- <example>
419
- Context: User requests documentation
420
- user: "Write docs for this API"
421
- assistant: "I'll use the api-docs-writer agent to generate clear documentation."
422
- <commentary>
423
- Documentation request triggers the agent.
424
- </commentary>
425
- </example>
426
- ```
427
-
428
- ### Validation Agent
429
-
430
- ```markdown
431
- <example>
432
- Context: User ready to commit changes
433
- user: "I'm ready to commit this code"
434
- assistant: "Let me validate it first."
435
- <commentary>
436
- Before commit, proactively validate with validation-agent.
437
- </commentary>
438
- assistant: "I'll use the code-validator agent to check for issues."
439
- </example>
440
-
441
- <example>
442
- Context: User asks for validation
443
- user: "Validate my implementation"
444
- assistant: "I'll use the code-validator agent to verify correctness."
445
- <commentary>
446
- Explicit validation request triggers the agent.
447
- </commentary>
448
- </example>
449
- ```
450
-
451
- ## Debugging Triggering Issues
452
-
453
- ### Agent Not Triggering
454
-
455
- **Check:**
456
-
457
- 1. Examples include relevant keywords from user message
458
- 2. Context matches actual usage scenarios
459
- 3. Commentary explains triggering logic clearly
460
- 4. Assistant shows use of Agent tool in examples
461
-
462
- **Fix:**
463
- Add more examples covering different phrasings.
464
-
465
- ### Agent Triggers Too Often
466
-
467
- **Check:**
468
-
469
- 1. Examples are too broad or generic
470
- 2. Triggering conditions overlap with other agents
471
- 3. Commentary doesn't distinguish when NOT to use
472
-
473
- **Fix:**
474
- Make examples more specific, add negative examples.
475
-
476
- ### Agent Triggers in Wrong Scenarios
477
-
478
- **Check:**
479
-
480
- 1. Examples don't match actual intended use
481
- 2. Commentary suggests inappropriate triggering
482
-
483
- **Fix:**
484
- Revise examples to show only correct triggering scenarios.
485
-
486
- ## Best Practices Summary
487
-
488
- ✅ **DO:**
489
-
490
- - Include 2-4 concrete, specific examples
491
- - Show both explicit and proactive triggering
492
- - Provide clear context for each example
493
- - Explain reasoning in commentary
494
- - Vary user message phrasing
495
- - Show Claude using Agent tool
496
-
497
- ❌ **DON'T:**
498
-
499
- - Use generic, vague examples
500
- - Omit context or commentary
501
- - Show only one type of triggering
502
- - Skip the agent invocation step
503
- - Make examples too similar
504
- - Forget to explain why agent triggers
505
-
506
- ## Conclusion
507
-
508
- Well-crafted examples are crucial for reliable agent triggering. Invest time in creating diverse, specific examples that clearly demonstrate when and why the agent should be used.
@@ -1,217 +0,0 @@
1
- #!/bin/bash
2
- # Agent File Validator
3
- # Validates agent markdown files for correct structure and content
4
-
5
- set -euo pipefail
6
-
7
- # Usage
8
- if [ $# -eq 0 ]; then
9
- echo "Usage: $0 <path/to/agent.md>"
10
- echo ""
11
- echo "Validates agent file for:"
12
- echo " - YAML frontmatter structure"
13
- echo " - Required fields (name, description, model, color)"
14
- echo " - Field formats and constraints"
15
- echo " - System prompt presence and length"
16
- echo " - Example blocks in description"
17
- exit 1
18
- fi
19
-
20
- AGENT_FILE="$1"
21
-
22
- echo "🔍 Validating agent file: $AGENT_FILE"
23
- echo ""
24
-
25
- # Check 1: File exists
26
- if [ ! -f "$AGENT_FILE" ]; then
27
- echo "❌ File not found: $AGENT_FILE"
28
- exit 1
29
- fi
30
- echo "✅ File exists"
31
-
32
- # Check 2: Starts with ---
33
- FIRST_LINE=$(head -1 "$AGENT_FILE")
34
- if [ "$FIRST_LINE" != "---" ]; then
35
- echo "❌ File must start with YAML frontmatter (---)"
36
- exit 1
37
- fi
38
- echo "✅ Starts with frontmatter"
39
-
40
- # Check 3: Has closing ---
41
- if ! tail -n +2 "$AGENT_FILE" | grep -q '^---$'; then
42
- echo "❌ Frontmatter not closed (missing second ---)"
43
- exit 1
44
- fi
45
- echo "✅ Frontmatter properly closed"
46
-
47
- # Extract frontmatter and system prompt
48
- FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$AGENT_FILE")
49
- SYSTEM_PROMPT=$(awk '/^---$/{i++; next} i>=2' "$AGENT_FILE")
50
-
51
- # Check 4: Required fields
52
- echo ""
53
- echo "Checking required fields..."
54
-
55
- error_count=0
56
- warning_count=0
57
-
58
- # Check name field
59
- NAME=$(echo "$FRONTMATTER" | grep '^name:' | sed 's/name: *//' | sed 's/^"\(.*\)"$/\1/')
60
-
61
- if [ -z "$NAME" ]; then
62
- echo "❌ Missing required field: name"
63
- ((error_count++))
64
- else
65
- echo "✅ name: $NAME"
66
-
67
- # Validate name format
68
- if ! [[ "$NAME" =~ ^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$ ]]; then
69
- echo "❌ name must start/end with alphanumeric and contain only letters, numbers, hyphens"
70
- ((error_count++))
71
- fi
72
-
73
- # Validate name length
74
- name_length=${#NAME}
75
- if [ $name_length -lt 3 ]; then
76
- echo "❌ name too short (minimum 3 characters)"
77
- ((error_count++))
78
- elif [ $name_length -gt 50 ]; then
79
- echo "❌ name too long (maximum 50 characters)"
80
- ((error_count++))
81
- fi
82
-
83
- # Check for generic names
84
- if [[ "$NAME" =~ ^(helper|assistant|agent|tool)$ ]]; then
85
- echo "⚠️ name is too generic: $NAME"
86
- ((warning_count++))
87
- fi
88
- fi
89
-
90
- # Check description field
91
- DESCRIPTION=$(echo "$FRONTMATTER" | grep '^description:' | sed 's/description: *//')
92
-
93
- if [ -z "$DESCRIPTION" ]; then
94
- echo "❌ Missing required field: description"
95
- ((error_count++))
96
- else
97
- desc_length=${#DESCRIPTION}
98
- echo "✅ description: ${desc_length} characters"
99
-
100
- if [ $desc_length -lt 10 ]; then
101
- echo "⚠️ description too short (minimum 10 characters recommended)"
102
- ((warning_count++))
103
- elif [ $desc_length -gt 5000 ]; then
104
- echo "⚠️ description very long (over 5000 characters)"
105
- ((warning_count++))
106
- fi
107
-
108
- # Check for example blocks
109
- if ! echo "$DESCRIPTION" | grep -q '<example>'; then
110
- echo "⚠️ description should include <example> blocks for triggering"
111
- ((warning_count++))
112
- fi
113
-
114
- # Check for "Use this agent when" pattern
115
- if ! echo "$DESCRIPTION" | grep -qi 'use this agent when'; then
116
- echo "⚠️ description should start with 'Use this agent when...'"
117
- ((warning_count++))
118
- fi
119
- fi
120
-
121
- # Check model field
122
- MODEL=$(echo "$FRONTMATTER" | grep '^model:' | sed 's/model: *//')
123
-
124
- if [ -z "$MODEL" ]; then
125
- echo "❌ Missing required field: model"
126
- ((error_count++))
127
- else
128
- echo "✅ model: $MODEL"
129
-
130
- case "$MODEL" in
131
- inherit|sonnet|opus|haiku)
132
- # Valid model
133
- ;;
134
- *)
135
- echo "⚠️ Unknown model: $MODEL (valid: inherit, sonnet, opus, haiku)"
136
- ((warning_count++))
137
- ;;
138
- esac
139
- fi
140
-
141
- # Check color field
142
- COLOR=$(echo "$FRONTMATTER" | grep '^color:' | sed 's/color: *//')
143
-
144
- if [ -z "$COLOR" ]; then
145
- echo "❌ Missing required field: color"
146
- ((error_count++))
147
- else
148
- echo "✅ color: $COLOR"
149
-
150
- case "$COLOR" in
151
- blue|cyan|green|yellow|magenta|red)
152
- # Valid color
153
- ;;
154
- *)
155
- echo "⚠️ Unknown color: $COLOR (valid: blue, cyan, green, yellow, magenta, red)"
156
- ((warning_count++))
157
- ;;
158
- esac
159
- fi
160
-
161
- # Check tools field (optional)
162
- TOOLS=$(echo "$FRONTMATTER" | grep '^tools:' | sed 's/tools: *//')
163
-
164
- if [ -n "$TOOLS" ]; then
165
- echo "✅ tools: $TOOLS"
166
- else
167
- echo "💡 tools: not specified (agent has access to all tools)"
168
- fi
169
-
170
- # Check 5: System prompt
171
- echo ""
172
- echo "Checking system prompt..."
173
-
174
- if [ -z "$SYSTEM_PROMPT" ]; then
175
- echo "❌ System prompt is empty"
176
- ((error_count++))
177
- else
178
- prompt_length=${#SYSTEM_PROMPT}
179
- echo "✅ System prompt: $prompt_length characters"
180
-
181
- if [ $prompt_length -lt 20 ]; then
182
- echo "❌ System prompt too short (minimum 20 characters)"
183
- ((error_count++))
184
- elif [ $prompt_length -gt 10000 ]; then
185
- echo "⚠️ System prompt very long (over 10,000 characters)"
186
- ((warning_count++))
187
- fi
188
-
189
- # Check for second person
190
- if ! echo "$SYSTEM_PROMPT" | grep -q "You are\|You will\|Your"; then
191
- echo "⚠️ System prompt should use second person (You are..., You will...)"
192
- ((warning_count++))
193
- fi
194
-
195
- # Check for structure
196
- if ! echo "$SYSTEM_PROMPT" | grep -qi "responsibilities\|process\|steps"; then
197
- echo "💡 Consider adding clear responsibilities or process steps"
198
- fi
199
-
200
- if ! echo "$SYSTEM_PROMPT" | grep -qi "output"; then
201
- echo "💡 Consider defining output format expectations"
202
- fi
203
- fi
204
-
205
- echo ""
206
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
207
-
208
- if [ $error_count -eq 0 ] && [ $warning_count -eq 0 ]; then
209
- echo "✅ All checks passed!"
210
- exit 0
211
- elif [ $error_count -eq 0 ]; then
212
- echo "⚠️ Validation passed with $warning_count warning(s)"
213
- exit 0
214
- else
215
- echo "❌ Validation failed with $error_count error(s) and $warning_count warning(s)"
216
- exit 1
217
- fi