Commit 73b8a6d
feat: Add task classification to prevent tool vs skill confusion (#1443)
* feat: Add task classification to prevent tool vs skill confusion
Fixes #1435
Implements keyword-based classification system in prompt-writer agent to prevent
amplihack from confusing "create a tool" (executable code) with "create a Claude Code Skill" (documentation).
**Changes:**
- Enhanced prompt-writer.md with classification logic (+84 lines)
- Three classifications: EXECUTABLE, DOCUMENTATION, AMBIGUOUS
- Keyword-based detection (< 5 seconds, deterministic)
- Context warning generation for builder agent
- Updated builder.md with context awareness warning (+26 lines)
- Clear guidance: .claude/skills/ contains DOCUMENTATION only
- DO NOT use skills as code templates
- Clarified DEFAULT_WORKFLOW.md Step 1 (+4 lines)
- Classification embedded in prompt-writer step
- Added comprehensive test suite (14 tests, all passing)
**Expected Impact:**
+15-20 points on eval-recipes benchmarks
- LinkedIn task: 6.5 → 30-40 (create actual CLI instead of skill)
- Email task: 26 → 45 (consistent executable creation)
**Philosophy Compliance:**
- Ruthless simplicity: Keyword-based, no AI/LLM calls
- Zero-BS: All logic functional, no placeholders
- Modular design: Self-contained changes in each file
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Default to AMBIGUOUS for fail-secure classification
Addresses security review feedback (Priority 1):
- Changed default classification from EXECUTABLE to AMBIGUOUS when no clear keywords found
- Implements fail-secure behavior: ask user when uncertain rather than assuming executable
- Reduces risk of creating wrong artifact type
Security review: LOW risk, approved with this fix
Code review: 9/10, approved
* fix: Align test default classification with agent spec (AMBIGUOUS)
Completes the fail-secure implementation from commit 69f5ccc:
- Test now defaults to AMBIGUOUS matching agent spec
- Previously test had EXECUTABLE while agent had AMBIGUOUS
- Ensures test validates actual agent behavior correctly
All tests pass with this alignment.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Default 'tool' to EXECUTABLE for eval compatibility
* feat: Add explicit tool vs skill classification to context
Critical: prompt-writer classification wasn't working because it's not
invoked in eval-recipes (uses 'claude -p' directly, not /ultrathink).
Solution: Add explicit context file that ALL Claude sessions see.
This prevents skill creation when user asks for tools by making the
distinction clear upfront in the base context.
* fix: Make tool vs skill classification prominent in CLAUDE.md
Root cause: Classification in prompt-writer.md wasn't applied in evals
because prompt-writer agent isn't invoked (evals use 'claude -p' directly).
Fix: Add classification to CLAUDE.md at the very top so ALL Claude Code
sessions see it immediately, before exploring .claude/skills/ directory.
Test showed agent still created skill (3.25/100). This fix ensures
classification is applied upfront.
* fix: Update classification to prefer tool+skill pattern
User feedback: Best solution is usually BOTH tool AND skill.
Changes:
- Preferred pattern: Build executable tool first, then skill that uses it
- Tool provides testable functionality
- Skill provides convenient interface
- In evals: Tool required (executable), skill optional
This gives best of both worlds - executable code + convenient UX.
---------
Co-authored-by: Ubuntu <azureuser@azlin-vm-1763091888.xh24nwhiyviedbtbx54dafh01e.dx.internal.cloudapp.net>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 688f67e commit 73b8a6d
File tree
6 files changed
+511
-13
lines changed- .claude
- agents/amplihack
- core
- specialized
- context
- workflow
- tests/unit
6 files changed
+511
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
39 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
40 | 54 | | |
41 | | - | |
| 55 | + | |
42 | 56 | | |
43 | | - | |
| 57 | + | |
44 | 58 | | |
45 | 59 | | |
46 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
48 | 130 | | |
49 | 131 | | |
50 | 132 | | |
| |||
55 | 137 | | |
56 | 138 | | |
57 | 139 | | |
58 | | - | |
| 140 | + | |
59 | 141 | | |
60 | 142 | | |
61 | 143 | | |
| |||
205 | 287 | | |
206 | 288 | | |
207 | 289 | | |
208 | | - | |
| 290 | + | |
209 | 291 | | |
210 | 292 | | |
211 | 293 | | |
| |||
235 | 317 | | |
236 | 318 | | |
237 | 319 | | |
238 | | - | |
| 320 | + | |
239 | 321 | | |
240 | 322 | | |
241 | 323 | | |
| |||
269 | 351 | | |
270 | 352 | | |
271 | 353 | | |
272 | | - | |
| 354 | + | |
273 | 355 | | |
274 | 356 | | |
275 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
107 | | - | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| 23 | + | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
| |||
0 commit comments