@amsterdamdatalabs/enact-extensions 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -21
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +171 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +402 -49
- package/dist/install.js.map +1 -1
- package/dist/internal/codex.d.ts.map +1 -1
- package/dist/internal/codex.js +7 -1
- package/dist/internal/codex.js.map +1 -1
- package/dist/internal/platform.d.ts +8 -0
- package/dist/internal/platform.d.ts.map +1 -1
- package/dist/internal/platform.js +46 -2
- package/dist/internal/platform.js.map +1 -1
- package/dist/provision.d.ts +30 -0
- package/dist/provision.d.ts.map +1 -0
- package/dist/provision.js +202 -0
- package/dist/provision.js.map +1 -0
- package/dist/validate/index.d.ts +44 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +157 -0
- package/dist/validate/index.js.map +1 -1
- package/extensions/cmux/.agents/plugin.json +37 -0
- package/extensions/cmux/skills/cmux/SKILL.md +82 -0
- package/extensions/cmux/skills/cmux/agents/openai.yaml +4 -0
- package/extensions/cmux/skills/cmux/references/handles-and-identify.md +35 -0
- package/extensions/cmux/skills/cmux/references/panes-surfaces.md +37 -0
- package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +23 -0
- package/extensions/cmux/skills/cmux/references/windows-workspaces.md +31 -0
- package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +122 -0
- package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +4 -0
- package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +66 -0
- package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +45 -0
- package/extensions/cmux/skills/cmux-workspace/SKILL.md +93 -0
- package/extensions/dev-state/.agents/plugin.json +35 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/SKILL.md +194 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/agents/openai.yaml +4 -0
- package/extensions/dev-state/skills/dev-state-plan-graduation/references/reference.md +130 -0
- package/extensions/devops/.agents/plugin.json +36 -0
- package/extensions/devops/skills/azure-devops-cli/SKILL.md +431 -0
- package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +4 -0
- package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +217 -0
- package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +4 -0
- package/extensions/enact-context/.agents/plugin.json +40 -0
- package/extensions/enact-context/.mcp.json +8 -0
- package/extensions/enact-context/README.md +25 -0
- package/extensions/enact-context/assets/icon.png +0 -0
- package/extensions/enact-context/assets/logo.png +0 -0
- package/extensions/enact-context/hooks/hooks.json +115 -0
- package/extensions/enact-context/skills/enact-context/SKILL.md +149 -0
- package/extensions/enact-context/skills/enact-context/scripts/install.sh +69 -0
- package/extensions/enact-factory/.agents/plugin.json +42 -0
- package/extensions/enact-factory/.mcp.json +8 -0
- package/extensions/enact-factory/assets/icon.png +0 -0
- package/extensions/enact-factory/assets/logo.png +0 -0
- package/extensions/enact-factory/hooks/user-prompt-submit.mjs +67 -0
- package/extensions/enact-factory/skills/testing-strategy/SKILL.md +167 -0
- package/extensions/enact-factory/skills/workitem-triage/SKILL.md +22 -0
- package/extensions/enact-operator/.agents/plugin.json +57 -0
- package/extensions/enact-operator/.app.json +3 -0
- package/extensions/enact-operator/.mcp.json +10 -0
- package/extensions/enact-operator/_taxonomy.md +86 -0
- package/extensions/enact-operator/agents/README.md +5 -0
- package/extensions/enact-operator/agents/architect.toml +25 -0
- package/extensions/enact-operator/agents/code-reviewer.toml +24 -0
- package/extensions/enact-operator/agents/critic.toml +30 -0
- package/extensions/enact-operator/agents/executor.toml +24 -0
- package/extensions/enact-operator/agents/explore.toml +23 -0
- package/extensions/enact-operator/agents/planner.toml +24 -0
- package/extensions/enact-operator/agents/verifier.toml +24 -0
- package/extensions/enact-operator/assets/icon.png +0 -0
- package/extensions/enact-operator/assets/logo.png +0 -0
- package/extensions/enact-operator/commands/doctor.md +39 -0
- package/extensions/enact-operator/commands/setup.md +51 -0
- package/extensions/enact-operator/hooks/hooks.json +146 -0
- package/extensions/enact-operator/skills/_variants.md +44 -0
- package/extensions/enact-operator/skills/ai-slop-cleaner/SKILL.md +50 -0
- package/extensions/enact-operator/skills/analyze/SKILL.md +91 -0
- package/extensions/enact-operator/skills/ask/SKILL.md +47 -0
- package/extensions/enact-operator/skills/autopilot/SKILL.md +170 -0
- package/extensions/enact-operator/skills/autoresearch-goal/SKILL.md +79 -0
- package/extensions/enact-operator/skills/cancel/SKILL.md +99 -0
- package/extensions/enact-operator/skills/configure-notifications/SKILL.md +77 -0
- package/extensions/enact-operator/skills/deep-interview/SKILL.md +80 -0
- package/extensions/enact-operator/skills/doctor/SKILL.md +48 -0
- package/extensions/enact-operator/skills/hud/SKILL.md +49 -0
- package/extensions/enact-operator/skills/hyperplan/SKILL.md +47 -0
- package/extensions/enact-operator/skills/plan/SKILL.md +78 -0
- package/extensions/enact-operator/skills/ralph/SKILL.md +201 -0
- package/extensions/enact-operator/skills/ralph/gemini.md +18 -0
- package/extensions/enact-operator/skills/ralplan/SKILL.md +151 -0
- package/extensions/enact-operator/skills/remove-deadcode/SKILL.md +45 -0
- package/extensions/enact-operator/skills/research/SKILL.md +74 -0
- package/extensions/enact-operator/skills/review/SKILL.md +58 -0
- package/extensions/enact-operator/skills/security-research/SKILL.md +54 -0
- package/extensions/enact-operator/skills/setup/SKILL.md +91 -0
- package/extensions/enact-operator/skills/setup/scripts/install.sh +50 -0
- package/extensions/enact-operator/skills/skill/SKILL.md +82 -0
- package/extensions/enact-operator/skills/tdd/SKILL.md +59 -0
- package/extensions/enact-operator/skills/team/SKILL.md +199 -0
- package/extensions/enact-operator/skills/trace/SKILL.md +41 -0
- package/extensions/enact-operator/skills/ultragoal/SKILL.md +99 -0
- package/extensions/enact-operator/skills/ultraqa/SKILL.md +113 -0
- package/extensions/enact-operator/skills/ultrawork/SKILL.md +145 -0
- package/extensions/enact-operator/skills/ultrawork/planner.md +28 -0
- package/extensions/enact-operator/skills/wiki/SKILL.md +41 -0
- package/extensions/enact-operator/skills/work-with-workitem/SKILL.md +51 -0
- package/extensions/enact-wiki/.agents/plugin.json +42 -0
- package/extensions/enact-wiki/.mcp.json +15 -0
- package/extensions/enact-wiki/README.md +44 -0
- package/extensions/enact-wiki/assets/icon.png +0 -0
- package/extensions/enact-wiki/assets/logo.png +0 -0
- package/extensions/enact-wiki/skills/document-parser/SKILL.md +17 -0
- package/extensions/enact-wiki/skills/document-parser/scripts/parse.sh +60 -0
- package/extensions/enact-wiki/skills/document-parser/skill.json +9 -0
- package/extensions/enact-wiki/skills/enact-wiki/SKILL.md +30 -0
- package/extensions/enact-wiki/skills/enact-wiki/references/ingest.md +62 -0
- package/extensions/enact-wiki/skills/enact-wiki/references/manage.md +34 -0
- package/extensions/enact-wiki/skills/enact-wiki/references/query.md +59 -0
- package/extensions/enact-wiki/skills/search-lab/SKILL.md +57 -0
- package/extensions/enact-wiki/skills/search-lab/scripts/analyze.ts +23 -0
- package/{plugins/net-revenue-management/.codex-plugin → extensions/net-revenue-management/.agents}/plugin.json +10 -6
- package/extensions/plugin-dev/.agents/plugin.json +42 -0
- package/extensions/plugin-dev/.mcp.json +3 -0
- package/extensions/plugin-dev/agents/agent-creator.md +199 -0
- package/extensions/plugin-dev/agents/plugin-validator.md +91 -0
- package/extensions/plugin-dev/agents/skill-reviewer.md +212 -0
- package/extensions/plugin-dev/commands/_archive/create-marketplace.md +427 -0
- package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +12 -0
- package/extensions/plugin-dev/commands/create-plugin.md +498 -0
- package/extensions/plugin-dev/commands/start.md +81 -0
- package/extensions/plugin-dev/hooks/hooks.json +3 -0
- package/extensions/plugin-dev/skills/agent-development/SKILL.md +641 -0
- package/extensions/plugin-dev/skills/agent-development/examples/agent-creation-prompt.md +250 -0
- package/extensions/plugin-dev/skills/agent-development/examples/complete-agent-examples.md +461 -0
- package/extensions/plugin-dev/skills/agent-development/references/advanced-agent-fields.md +246 -0
- package/extensions/plugin-dev/skills/agent-development/references/agent-creation-system-prompt.md +216 -0
- package/extensions/plugin-dev/skills/agent-development/references/permission-modes-rules.md +226 -0
- package/extensions/plugin-dev/skills/agent-development/references/system-prompt-design.md +464 -0
- package/extensions/plugin-dev/skills/agent-development/references/triggering-examples.md +474 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/create-agent-skeleton.sh +176 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/test-agent-trigger.sh +227 -0
- package/extensions/plugin-dev/skills/agent-development/scripts/validate-agent.sh +227 -0
- package/extensions/plugin-dev/skills/command-development/SKILL.md +763 -0
- package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +612 -0
- package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +527 -0
- package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +762 -0
- package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +769 -0
- package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +508 -0
- package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +966 -0
- package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +943 -0
- package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +637 -0
- package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +191 -0
- package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +447 -0
- package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +723 -0
- package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +234 -0
- package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +160 -0
- package/extensions/plugin-dev/skills/hook-development/SKILL.md +861 -0
- package/extensions/plugin-dev/skills/hook-development/examples/load-context.sh +55 -0
- package/extensions/plugin-dev/skills/hook-development/examples/validate-bash.sh +57 -0
- package/extensions/plugin-dev/skills/hook-development/examples/validate-write.sh +48 -0
- package/extensions/plugin-dev/skills/hook-development/references/advanced.md +871 -0
- package/extensions/plugin-dev/skills/hook-development/references/hook-input-schemas.md +145 -0
- package/extensions/plugin-dev/skills/hook-development/references/migration.md +392 -0
- package/extensions/plugin-dev/skills/hook-development/references/patterns.md +430 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/README.md +181 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/hook-linter.sh +153 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/test-hook.sh +276 -0
- package/extensions/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
- package/extensions/plugin-dev/skills/mcp-integration/SKILL.md +775 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/http-server.json +20 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/sse-server.json +19 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/stdio-server.json +38 -0
- package/extensions/plugin-dev/skills/mcp-integration/examples/ws-server.json +26 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/authentication.md +601 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/server-discovery.md +190 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/server-types.md +572 -0
- package/extensions/plugin-dev/skills/mcp-integration/references/tool-usage.md +623 -0
- package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +222 -0
- package/extensions/plugin-dev/skills/plugin-structure/SKILL.md +705 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md +774 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/minimal-plugin.md +83 -0
- package/extensions/plugin-dev/skills/plugin-structure/examples/standard-plugin.md +611 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/advanced-topics.md +289 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/component-patterns.md +592 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/github-actions.md +233 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/headless-ci-mode.md +193 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/manifest-reference.md +625 -0
- package/extensions/plugin-dev/skills/plugin-structure/references/output-styles.md +116 -0
- package/extensions/plugin-dev/skills/skill-development/SKILL.md +564 -0
- package/extensions/plugin-dev/skills/skill-development/examples/complete-skill.md +465 -0
- package/extensions/plugin-dev/skills/skill-development/examples/frontmatter-templates.md +167 -0
- package/extensions/plugin-dev/skills/skill-development/examples/minimal-skill.md +111 -0
- package/extensions/plugin-dev/skills/skill-development/references/advanced-frontmatter.md +225 -0
- package/extensions/plugin-dev/skills/skill-development/references/commands-vs-skills.md +39 -0
- package/extensions/plugin-dev/skills/skill-development/references/skill-creation-workflow.md +379 -0
- package/extensions/plugin-dev/skills/skill-development/references/skill-creator-original.md +210 -0
- package/package.json +8 -11
- package/scripts/enact-extensions.mjs +823 -21
- package/scripts/hooks/session-start-drift-check.mjs +58 -0
- package/scripts/lib/build-index.mjs +50 -0
- package/scripts/lib/bundle-hash.mjs +137 -0
- package/scripts/lib/hooks.mjs +741 -0
- package/scripts/lib/ledger.mjs +163 -0
- package/scripts/lib/list-bundles.mjs +70 -0
- package/scripts/lib/outdated.mjs +144 -0
- package/scripts/lib/provision-mcp.mjs +16 -0
- package/scripts/lib/resolve-bundle.mjs +121 -0
- package/scripts/lib/run-install.mjs +402 -38
- package/scripts/lib/run-prune.mjs +73 -0
- package/scripts/lib/run-sync.mjs +9 -1
- package/scripts/lib/run-uninstall.mjs +244 -0
- package/scripts/lib/run-update.mjs +152 -0
- package/scripts/lib/run-validate.mjs +21 -18
- package/scripts/lib/serve.mjs +472 -0
- package/scripts/postinstall.mjs +63 -0
- package/scripts/setup-enact-context.sh +2 -2
- package/scripts/version-bump.sh +463 -0
- package/spec/codex.json +1 -11
- package/spec/index.json +59 -0
- package/web/assets/README.md +111 -0
- package/web/assets/logo-full.png +0 -0
- package/web/assets/logo-slim.png +0 -0
- package/web/assets/tokens/base.css +45 -0
- package/web/assets/tokens/colors.css +248 -0
- package/web/assets/tokens/effects.css +24 -0
- package/web/assets/tokens/fonts.css +8 -0
- package/web/assets/tokens/index.css +18 -0
- package/web/assets/tokens/spacing.css +50 -0
- package/web/index.html +1188 -0
- package/.agents/plugins/marketplace.json +0 -20
- package/catalog/enact-context.json +0 -9
- package/catalog/enact-factory.json +0 -7
- package/catalog/enact-operator.json +0 -7
- package/catalog/enact-wiki.json +0 -7
- package/catalog/net-revenue-management.json +0 -8
- package/scripts/rename-supervisor-to-operator.pl +0 -66
- package/scripts/sync-manifests.mjs +0 -23
- package/scripts/validate-catalog.mjs +0 -37
- package/scripts/validate-plugin.mjs +0 -10
- /package/{plugins → extensions}/net-revenue-management/.mcp.json +0 -0
- /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-risks/SKILL.md +0 -0
- /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-scenario/SKILL.md +0 -0
|
@@ -0,0 +1,474 @@
|
|
|
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 (aligned with official Claude Code documentation):
|
|
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 invokes the agent - 'I'll use the [agent-name] agent to [action]']"
|
|
14
|
+
<commentary>
|
|
15
|
+
[Explanation of why this agent should be triggered in this scenario]
|
|
16
|
+
</commentary>
|
|
17
|
+
</example>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Anatomy of a Good Example
|
|
21
|
+
|
|
22
|
+
### Context
|
|
23
|
+
|
|
24
|
+
**Purpose:** Set the scene - what happened before the user's message
|
|
25
|
+
|
|
26
|
+
**Good contexts:**
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Context: User just implemented a new authentication feature
|
|
30
|
+
Context: User has created a PR and wants it reviewed
|
|
31
|
+
Context: User is debugging a test failure
|
|
32
|
+
Context: After writing several functions without documentation
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Bad contexts:**
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Context: User needs help (too vague)
|
|
39
|
+
Context: Normal usage (not specific)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### User Message
|
|
43
|
+
|
|
44
|
+
**Purpose:** Show the exact phrasing that should trigger the agent
|
|
45
|
+
|
|
46
|
+
**Good user messages:**
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
user: "I've added the OAuth flow, can you check it?"
|
|
50
|
+
user: "Review PR #123"
|
|
51
|
+
user: "Why is this test failing?"
|
|
52
|
+
user: "Add docs for these functions"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Vary the phrasing:**
|
|
56
|
+
Include multiple examples with different phrasings for the same intent:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Example 1: user: "Review my code"
|
|
60
|
+
Example 2: user: "Can you check this implementation?"
|
|
61
|
+
Example 3: user: "Look over my changes"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Assistant Response
|
|
65
|
+
|
|
66
|
+
**Purpose:** Show Claude invoking the agent
|
|
67
|
+
|
|
68
|
+
**Good responses:**
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
assistant: "I'll use the code-reviewer agent to analyze your OAuth implementation."
|
|
72
|
+
assistant: "I'll use the pr-analyzer agent to review that PR for you."
|
|
73
|
+
assistant: "I'll use the test-analyzer agent to investigate the test failure."
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Commentary
|
|
77
|
+
|
|
78
|
+
**Purpose:** Explain the reasoning - WHY this agent should trigger
|
|
79
|
+
|
|
80
|
+
**Good commentary:**
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
<commentary>
|
|
84
|
+
User explicitly requested code review, trigger the code-reviewer agent.
|
|
85
|
+
</commentary>
|
|
86
|
+
|
|
87
|
+
<commentary>
|
|
88
|
+
After code implementation, proactively use review agent to check quality.
|
|
89
|
+
</commentary>
|
|
90
|
+
|
|
91
|
+
<commentary>
|
|
92
|
+
PR analysis request matches pr-analyzer agent's expertise.
|
|
93
|
+
</commentary>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Include decision logic:**
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
<commentary>
|
|
100
|
+
User wrote tests (Test tool used). The test-analyzer agent should check
|
|
101
|
+
test quality and coverage before continuing.
|
|
102
|
+
</commentary>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Example Types
|
|
106
|
+
|
|
107
|
+
### Type 1: Explicit Request
|
|
108
|
+
|
|
109
|
+
User directly asks for what the agent does:
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
<example>
|
|
113
|
+
Context: User explicitly requests security analysis
|
|
114
|
+
user: "Check my code for security vulnerabilities"
|
|
115
|
+
assistant: "I'll use the security-analyzer agent to perform a thorough security review."
|
|
116
|
+
<commentary>
|
|
117
|
+
Direct security analysis request triggers the security-analyzer agent.
|
|
118
|
+
</commentary>
|
|
119
|
+
</example>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Type 2: Proactive Triggering
|
|
123
|
+
|
|
124
|
+
Agent triggers after relevant work without explicit request:
|
|
125
|
+
|
|
126
|
+
```markdown
|
|
127
|
+
<example>
|
|
128
|
+
Context: User just implemented database queries
|
|
129
|
+
user: "I've added the user search functionality"
|
|
130
|
+
assistant: "I'll use the security-analyzer agent to review the database code for security issues."
|
|
131
|
+
<commentary>
|
|
132
|
+
Database code written. Proactively trigger security-analyzer to check
|
|
133
|
+
for SQL injection and other database security issues.
|
|
134
|
+
</commentary>
|
|
135
|
+
</example>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Type 3: Implicit Request
|
|
139
|
+
|
|
140
|
+
User implies need without stating it directly:
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
<example>
|
|
144
|
+
Context: User mentions code is hard to understand
|
|
145
|
+
user: "This code is confusing and hard to follow"
|
|
146
|
+
assistant: "I'll use the code-simplifier agent to refactor for better readability."
|
|
147
|
+
<commentary>
|
|
148
|
+
User indicates complexity issues. Trigger code-simplifier agent to improve clarity.
|
|
149
|
+
</commentary>
|
|
150
|
+
</example>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Type 4: Tool Usage Pattern
|
|
154
|
+
|
|
155
|
+
Agent triggers based on prior tool usage:
|
|
156
|
+
|
|
157
|
+
```markdown
|
|
158
|
+
<example>
|
|
159
|
+
Context: User made multiple edits to test files
|
|
160
|
+
user: "I've updated all the tests"
|
|
161
|
+
assistant: "I'll use the test-quality-analyzer agent to verify the tests follow best practices."
|
|
162
|
+
<commentary>
|
|
163
|
+
Multiple Edit tools used on test files. Proactively trigger test-quality-analyzer
|
|
164
|
+
to ensure tests follow best practices.
|
|
165
|
+
</commentary>
|
|
166
|
+
</example>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Multiple Examples Strategy
|
|
170
|
+
|
|
171
|
+
### Cover Different Phrasings
|
|
172
|
+
|
|
173
|
+
```markdown
|
|
174
|
+
<example>
|
|
175
|
+
user: "Review my code"
|
|
176
|
+
[...]
|
|
177
|
+
</example>
|
|
178
|
+
|
|
179
|
+
<example>
|
|
180
|
+
user: "Can you check my implementation?"
|
|
181
|
+
[...]
|
|
182
|
+
</example>
|
|
183
|
+
|
|
184
|
+
<example>
|
|
185
|
+
user: "Look over these changes"
|
|
186
|
+
[...]
|
|
187
|
+
</example>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Cover Proactive and Reactive
|
|
191
|
+
|
|
192
|
+
```markdown
|
|
193
|
+
<example>
|
|
194
|
+
Context: User explicitly requests review
|
|
195
|
+
user: "Review my code for issues"
|
|
196
|
+
assistant: "I'll use the code-reviewer agent to analyze the code."
|
|
197
|
+
<commentary>
|
|
198
|
+
Explicit review request triggers the agent.
|
|
199
|
+
</commentary>
|
|
200
|
+
</example>
|
|
201
|
+
|
|
202
|
+
<example>
|
|
203
|
+
Context: After user writes code
|
|
204
|
+
user: "I've implemented the feature"
|
|
205
|
+
assistant: "I'll use the code-reviewer agent to review the implementation."
|
|
206
|
+
<commentary>
|
|
207
|
+
Code written, proactively review for quality and issues.
|
|
208
|
+
</commentary>
|
|
209
|
+
</example>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Cover Edge Cases
|
|
213
|
+
|
|
214
|
+
```markdown
|
|
215
|
+
<example>
|
|
216
|
+
Context: Typical usage
|
|
217
|
+
user: "Check my PR"
|
|
218
|
+
[...]
|
|
219
|
+
</example>
|
|
220
|
+
|
|
221
|
+
<example>
|
|
222
|
+
Context: Large PR that needs thorough analysis
|
|
223
|
+
user: "This is a big PR, can you do a deep review?"
|
|
224
|
+
[...]
|
|
225
|
+
<commentary>
|
|
226
|
+
Large PR mentioned, use thorough analysis mode.
|
|
227
|
+
</commentary>
|
|
228
|
+
</example>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Common Mistakes
|
|
232
|
+
|
|
233
|
+
### ❌ Missing Context
|
|
234
|
+
|
|
235
|
+
```markdown
|
|
236
|
+
<example>
|
|
237
|
+
user: "Review my code"
|
|
238
|
+
assistant: "I'll use the code-reviewer agent."
|
|
239
|
+
</example>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Why bad:** No context about what led to this request.
|
|
243
|
+
|
|
244
|
+
### ✅ With Context
|
|
245
|
+
|
|
246
|
+
```markdown
|
|
247
|
+
<example>
|
|
248
|
+
Context: User just finished implementing authentication
|
|
249
|
+
user: "Review my code"
|
|
250
|
+
assistant: "I'll use the code-reviewer agent to analyze the auth implementation for security and best practices."
|
|
251
|
+
<commentary>
|
|
252
|
+
Auth code written. Review for security and best practices.
|
|
253
|
+
</commentary>
|
|
254
|
+
</example>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### ❌ No Commentary
|
|
258
|
+
|
|
259
|
+
```markdown
|
|
260
|
+
<example>
|
|
261
|
+
Context: User requests review
|
|
262
|
+
user: "Check my changes"
|
|
263
|
+
assistant: "I'll use the reviewer agent."
|
|
264
|
+
</example>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Why bad:** Doesn't explain WHY agent triggers.
|
|
268
|
+
|
|
269
|
+
### ✅ With Commentary
|
|
270
|
+
|
|
271
|
+
```markdown
|
|
272
|
+
<example>
|
|
273
|
+
Context: User requests review after making changes
|
|
274
|
+
user: "Check my changes"
|
|
275
|
+
assistant: "I'll use the code-reviewer agent to analyze the modifications."
|
|
276
|
+
<commentary>
|
|
277
|
+
Code review request triggers agent to check quality, security, and adherence to standards.
|
|
278
|
+
</commentary>
|
|
279
|
+
</example>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### ❌ Agent Responds Directly
|
|
283
|
+
|
|
284
|
+
```markdown
|
|
285
|
+
<example>
|
|
286
|
+
user: "Review my code"
|
|
287
|
+
assistant: "I found the following issues: [lists issues]"
|
|
288
|
+
</example>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Why bad:** Shows agent's output, not triggering.
|
|
292
|
+
|
|
293
|
+
### ✅ Shows Triggering
|
|
294
|
+
|
|
295
|
+
```markdown
|
|
296
|
+
<example>
|
|
297
|
+
user: "Review my code"
|
|
298
|
+
assistant: "I'll use the code-reviewer agent to perform the review."
|
|
299
|
+
<commentary>
|
|
300
|
+
Review request triggers the agent.
|
|
301
|
+
</commentary>
|
|
302
|
+
</example>
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## How Many Examples?
|
|
306
|
+
|
|
307
|
+
### Minimum: 2 Examples
|
|
308
|
+
|
|
309
|
+
Cover at least:
|
|
310
|
+
|
|
311
|
+
1. Explicit request
|
|
312
|
+
2. One variation or proactive trigger
|
|
313
|
+
|
|
314
|
+
### Recommended: 3-4 Examples
|
|
315
|
+
|
|
316
|
+
Cover:
|
|
317
|
+
|
|
318
|
+
1. Explicit request (direct ask)
|
|
319
|
+
2. Implicit request (user implies need)
|
|
320
|
+
3. Proactive trigger (after relevant work)
|
|
321
|
+
4. Edge case or specific scenario
|
|
322
|
+
|
|
323
|
+
### Maximum: 6 Examples
|
|
324
|
+
|
|
325
|
+
More than 6 makes description too long. Focus on most important scenarios.
|
|
326
|
+
|
|
327
|
+
## Template Library
|
|
328
|
+
|
|
329
|
+
### Code Review Agent
|
|
330
|
+
|
|
331
|
+
```markdown
|
|
332
|
+
<example>
|
|
333
|
+
Context: User just implemented a new feature
|
|
334
|
+
user: "I've added the user registration feature"
|
|
335
|
+
assistant: "I'll use the code-reviewer agent to analyze the implementation."
|
|
336
|
+
<commentary>
|
|
337
|
+
Code written, proactively trigger code-reviewer agent.
|
|
338
|
+
</commentary>
|
|
339
|
+
</example>
|
|
340
|
+
|
|
341
|
+
<example>
|
|
342
|
+
Context: User explicitly requests review
|
|
343
|
+
user: "Can you review my changes for issues?"
|
|
344
|
+
assistant: "I'll use the code-reviewer agent to perform a thorough review."
|
|
345
|
+
<commentary>
|
|
346
|
+
Explicit review request triggers the agent.
|
|
347
|
+
</commentary>
|
|
348
|
+
</example>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Test Generation Agent
|
|
352
|
+
|
|
353
|
+
```markdown
|
|
354
|
+
<example>
|
|
355
|
+
Context: User implemented functions without tests
|
|
356
|
+
user: "I've added the data processing functions"
|
|
357
|
+
assistant: "I'll use the test-generator agent to create comprehensive tests."
|
|
358
|
+
<commentary>
|
|
359
|
+
New code without tests, proactively trigger test-generator agent.
|
|
360
|
+
</commentary>
|
|
361
|
+
</example>
|
|
362
|
+
|
|
363
|
+
<example>
|
|
364
|
+
Context: User explicitly asks for tests
|
|
365
|
+
user: "Generate tests for my code"
|
|
366
|
+
assistant: "I'll use the test-generator agent to create a complete test suite."
|
|
367
|
+
<commentary>
|
|
368
|
+
Direct test generation request triggers the agent.
|
|
369
|
+
</commentary>
|
|
370
|
+
</example>
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Documentation Agent
|
|
374
|
+
|
|
375
|
+
```markdown
|
|
376
|
+
<example>
|
|
377
|
+
Context: User added new API endpoints
|
|
378
|
+
user: "I've implemented the REST API endpoints"
|
|
379
|
+
assistant: "I'll use the api-docs-writer agent to create comprehensive documentation."
|
|
380
|
+
<commentary>
|
|
381
|
+
New API code, proactively generate documentation.
|
|
382
|
+
</commentary>
|
|
383
|
+
</example>
|
|
384
|
+
|
|
385
|
+
<example>
|
|
386
|
+
Context: User requests documentation
|
|
387
|
+
user: "Write docs for this API"
|
|
388
|
+
assistant: "I'll use the api-docs-writer agent to generate clear documentation."
|
|
389
|
+
<commentary>
|
|
390
|
+
Documentation request triggers the agent.
|
|
391
|
+
</commentary>
|
|
392
|
+
</example>
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Validation Agent
|
|
396
|
+
|
|
397
|
+
```markdown
|
|
398
|
+
<example>
|
|
399
|
+
Context: User ready to commit changes
|
|
400
|
+
user: "I'm ready to commit this code"
|
|
401
|
+
assistant: "I'll use the code-validator agent to check for issues before committing."
|
|
402
|
+
<commentary>
|
|
403
|
+
Before commit, proactively validate with validation-agent.
|
|
404
|
+
</commentary>
|
|
405
|
+
</example>
|
|
406
|
+
|
|
407
|
+
<example>
|
|
408
|
+
Context: User asks for validation
|
|
409
|
+
user: "Validate my implementation"
|
|
410
|
+
assistant: "I'll use the code-validator agent to verify correctness."
|
|
411
|
+
<commentary>
|
|
412
|
+
Explicit validation request triggers the agent.
|
|
413
|
+
</commentary>
|
|
414
|
+
</example>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
## Debugging Triggering Issues
|
|
418
|
+
|
|
419
|
+
### Agent Not Triggering
|
|
420
|
+
|
|
421
|
+
**Check:**
|
|
422
|
+
|
|
423
|
+
1. Examples include relevant keywords from user message
|
|
424
|
+
2. Context matches actual usage scenarios
|
|
425
|
+
3. Commentary explains triggering logic clearly
|
|
426
|
+
4. Assistant shows use of Agent tool in examples
|
|
427
|
+
|
|
428
|
+
**Fix:**
|
|
429
|
+
Add more examples covering different phrasings.
|
|
430
|
+
|
|
431
|
+
### Agent Triggers Too Often
|
|
432
|
+
|
|
433
|
+
**Check:**
|
|
434
|
+
|
|
435
|
+
1. Examples are too broad or generic
|
|
436
|
+
2. Triggering conditions overlap with other agents
|
|
437
|
+
3. Commentary doesn't distinguish when NOT to use
|
|
438
|
+
|
|
439
|
+
**Fix:**
|
|
440
|
+
Make examples more specific, add negative examples.
|
|
441
|
+
|
|
442
|
+
### Agent Triggers in Wrong Scenarios
|
|
443
|
+
|
|
444
|
+
**Check:**
|
|
445
|
+
|
|
446
|
+
1. Examples don't match actual intended use
|
|
447
|
+
2. Commentary suggests inappropriate triggering
|
|
448
|
+
|
|
449
|
+
**Fix:**
|
|
450
|
+
Revise examples to show only correct triggering scenarios.
|
|
451
|
+
|
|
452
|
+
## Best Practices Summary
|
|
453
|
+
|
|
454
|
+
✅ **DO:**
|
|
455
|
+
|
|
456
|
+
- Include 2-4 concrete, specific examples
|
|
457
|
+
- Show both explicit and proactive triggering
|
|
458
|
+
- Provide clear context for each example
|
|
459
|
+
- Explain reasoning in commentary
|
|
460
|
+
- Vary user message phrasing
|
|
461
|
+
- Show Claude using Agent tool
|
|
462
|
+
|
|
463
|
+
❌ **DON'T:**
|
|
464
|
+
|
|
465
|
+
- Use generic, vague examples
|
|
466
|
+
- Omit context or commentary
|
|
467
|
+
- Show only one type of triggering
|
|
468
|
+
- Skip the agent invocation step
|
|
469
|
+
- Make examples too similar
|
|
470
|
+
- Forget to explain why agent triggers
|
|
471
|
+
|
|
472
|
+
## Conclusion
|
|
473
|
+
|
|
474
|
+
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.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Agent Skeleton Generator
|
|
3
|
+
# Creates a new agent file with correct structure
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
# Usage
|
|
8
|
+
if [ $# -eq 0 ]; then
|
|
9
|
+
echo "Usage: $0 <agent-name> [output-dir]"
|
|
10
|
+
echo ""
|
|
11
|
+
echo "Creates a skeleton agent file with:"
|
|
12
|
+
echo " - Valid YAML frontmatter"
|
|
13
|
+
echo " - Placeholder description with example block"
|
|
14
|
+
echo " - Basic system prompt structure"
|
|
15
|
+
echo ""
|
|
16
|
+
echo "Arguments:"
|
|
17
|
+
echo " agent-name Agent identifier (lowercase, numbers, hyphens)"
|
|
18
|
+
echo " output-dir Directory to create file in (default: current directory)"
|
|
19
|
+
echo ""
|
|
20
|
+
echo "Examples:"
|
|
21
|
+
echo " $0 code-reviewer agents/"
|
|
22
|
+
echo " $0 test-generator"
|
|
23
|
+
echo ""
|
|
24
|
+
echo "After creation:"
|
|
25
|
+
echo " 1. Edit the file to fill in placeholders"
|
|
26
|
+
echo " 2. Add 2-4 triggering examples"
|
|
27
|
+
echo " 3. Write detailed system prompt"
|
|
28
|
+
echo " 4. Validate: ./scripts/validate-agent.sh <output-file>"
|
|
29
|
+
echo " 5. Test triggers: ./scripts/test-agent-trigger.sh <output-file>"
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
AGENT_NAME="$1"
|
|
34
|
+
OUTPUT_DIR="${2:-.}"
|
|
35
|
+
OUTPUT_FILE="$OUTPUT_DIR/$AGENT_NAME.md"
|
|
36
|
+
|
|
37
|
+
echo "🔍 Creating agent skeleton: $AGENT_NAME"
|
|
38
|
+
echo ""
|
|
39
|
+
|
|
40
|
+
# Validate name format (lowercase alphanumeric + hyphens, 3-50 chars)
|
|
41
|
+
if ! [[ "$AGENT_NAME" =~ ^[a-z0-9][a-z0-9-]*[a-z0-9]$ ]]; then
|
|
42
|
+
echo "❌ Invalid name: $AGENT_NAME"
|
|
43
|
+
echo ""
|
|
44
|
+
echo "Agent names must:"
|
|
45
|
+
echo " - Start with a lowercase letter or number"
|
|
46
|
+
echo " - End with a lowercase letter or number"
|
|
47
|
+
echo " - Contain only lowercase letters, numbers, and hyphens"
|
|
48
|
+
echo " - Be at least 3 characters long"
|
|
49
|
+
echo ""
|
|
50
|
+
echo "Valid examples: code-reviewer, test-gen, my-agent-123"
|
|
51
|
+
echo "Invalid examples: Code-Reviewer, -agent, agent-, a"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
echo "✅ Name format valid"
|
|
55
|
+
|
|
56
|
+
# Validate name length
|
|
57
|
+
name_length=${#AGENT_NAME}
|
|
58
|
+
if [ "$name_length" -lt 3 ]; then
|
|
59
|
+
echo "❌ Name too short: $name_length characters (minimum 3)"
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
if [ "$name_length" -gt 50 ]; then
|
|
63
|
+
echo "❌ Name too long: $name_length characters (maximum 50)"
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
echo "✅ Name length valid ($name_length characters)"
|
|
67
|
+
|
|
68
|
+
# Check output directory exists
|
|
69
|
+
if [ ! -d "$OUTPUT_DIR" ]; then
|
|
70
|
+
echo "❌ Directory does not exist: $OUTPUT_DIR"
|
|
71
|
+
echo ""
|
|
72
|
+
echo "Create it first with: mkdir -p $OUTPUT_DIR"
|
|
73
|
+
exit 1
|
|
74
|
+
fi
|
|
75
|
+
echo "✅ Output directory exists"
|
|
76
|
+
|
|
77
|
+
# Check file doesn't already exist
|
|
78
|
+
if [ -f "$OUTPUT_FILE" ]; then
|
|
79
|
+
echo "❌ File already exists: $OUTPUT_FILE"
|
|
80
|
+
echo ""
|
|
81
|
+
echo "Options:"
|
|
82
|
+
echo " - Choose a different name"
|
|
83
|
+
echo " - Delete the existing file: rm $OUTPUT_FILE"
|
|
84
|
+
echo " - Edit the existing file directly"
|
|
85
|
+
exit 1
|
|
86
|
+
fi
|
|
87
|
+
echo "✅ Output path available"
|
|
88
|
+
|
|
89
|
+
echo ""
|
|
90
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
91
|
+
echo "📝 Creating agent file..."
|
|
92
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
93
|
+
echo ""
|
|
94
|
+
|
|
95
|
+
# Create the agent skeleton file
|
|
96
|
+
cat > "$OUTPUT_FILE" << EOF
|
|
97
|
+
---
|
|
98
|
+
name: $AGENT_NAME
|
|
99
|
+
description: Use this agent when [describe triggering conditions]. Examples:
|
|
100
|
+
|
|
101
|
+
<example>
|
|
102
|
+
Context: [Describe the situation]
|
|
103
|
+
user: "[What the user says]"
|
|
104
|
+
assistant: "[How Claude responds before triggering]"
|
|
105
|
+
<commentary>
|
|
106
|
+
[Why this agent should trigger]
|
|
107
|
+
</commentary>
|
|
108
|
+
assistant: "I'll use the $AGENT_NAME agent to [action]."
|
|
109
|
+
</example>
|
|
110
|
+
|
|
111
|
+
<example>
|
|
112
|
+
Context: [Second example situation]
|
|
113
|
+
user: "[Another user request]"
|
|
114
|
+
assistant: "[Claude's response]"
|
|
115
|
+
<commentary>
|
|
116
|
+
[Explanation of why this triggers the agent]
|
|
117
|
+
</commentary>
|
|
118
|
+
</example>
|
|
119
|
+
|
|
120
|
+
model: inherit
|
|
121
|
+
color: blue
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
You are [describe the agent's role and expertise].
|
|
125
|
+
|
|
126
|
+
**Your Core Responsibilities:**
|
|
127
|
+
|
|
128
|
+
1. [Primary responsibility]
|
|
129
|
+
2. [Secondary responsibility]
|
|
130
|
+
3. [Additional responsibility]
|
|
131
|
+
|
|
132
|
+
**Process:**
|
|
133
|
+
|
|
134
|
+
1. [First step]
|
|
135
|
+
2. [Second step]
|
|
136
|
+
3. [Third step]
|
|
137
|
+
|
|
138
|
+
**Quality Standards:**
|
|
139
|
+
|
|
140
|
+
- [Standard 1]
|
|
141
|
+
- [Standard 2]
|
|
142
|
+
- [Standard 3]
|
|
143
|
+
|
|
144
|
+
**Output Format:**
|
|
145
|
+
|
|
146
|
+
Provide results as:
|
|
147
|
+
|
|
148
|
+
- [What to include]
|
|
149
|
+
- [How to structure]
|
|
150
|
+
EOF
|
|
151
|
+
|
|
152
|
+
echo "✅ Created agent skeleton: $OUTPUT_FILE"
|
|
153
|
+
echo ""
|
|
154
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
155
|
+
echo "📋 Next Steps"
|
|
156
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
157
|
+
echo ""
|
|
158
|
+
echo "1. Edit the file to fill in placeholders:"
|
|
159
|
+
echo " - Replace [bracketed text] with actual content"
|
|
160
|
+
echo " - Update description to explain when agent triggers"
|
|
161
|
+
echo " - Write 2-4 triggering examples"
|
|
162
|
+
echo " - Develop detailed system prompt"
|
|
163
|
+
echo ""
|
|
164
|
+
echo "2. Choose appropriate settings:"
|
|
165
|
+
echo " - model: inherit (default), sonnet, opus, or haiku"
|
|
166
|
+
echo " - color: blue (default), cyan, green, yellow, magenta, or red"
|
|
167
|
+
echo " - tools: Add array if restricting tools (optional)"
|
|
168
|
+
echo ""
|
|
169
|
+
echo "3. Validate the agent:"
|
|
170
|
+
echo " ./scripts/validate-agent.sh $OUTPUT_FILE"
|
|
171
|
+
echo ""
|
|
172
|
+
echo "4. Test triggering:"
|
|
173
|
+
echo " ./scripts/test-agent-trigger.sh $OUTPUT_FILE"
|
|
174
|
+
echo ""
|
|
175
|
+
echo "5. Load in Claude Code:"
|
|
176
|
+
echo " claude --plugin-dir /path/to/plugin"
|