ai-eng-system 0.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.
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/.claude-plugin/agents/agent-creator.md +206 -0
- package/dist/.claude-plugin/agents/ai_engineer.md +187 -0
- package/dist/.claude-plugin/agents/api_builder_enhanced.md +82 -0
- package/dist/.claude-plugin/agents/architect-advisor.md +88 -0
- package/dist/.claude-plugin/agents/backend_architect.md +88 -0
- package/dist/.claude-plugin/agents/code_reviewer.md +208 -0
- package/dist/.claude-plugin/agents/command-creator.md +331 -0
- package/dist/.claude-plugin/agents/cost_optimizer.md +284 -0
- package/dist/.claude-plugin/agents/database_optimizer.md +175 -0
- package/dist/.claude-plugin/agents/deployment_engineer.md +186 -0
- package/dist/.claude-plugin/agents/docs-writer.md +99 -0
- package/dist/.claude-plugin/agents/documentation_specialist.md +212 -0
- package/dist/.claude-plugin/agents/frontend-reviewer.md +51 -0
- package/dist/.claude-plugin/agents/full_stack_developer.md +391 -0
- package/dist/.claude-plugin/agents/infrastructure_builder.md +77 -0
- package/dist/.claude-plugin/agents/java-pro.md +182 -0
- package/dist/.claude-plugin/agents/ml_engineer.md +176 -0
- package/dist/.claude-plugin/agents/monitoring_expert.md +79 -0
- package/dist/.claude-plugin/agents/performance_engineer.md +193 -0
- package/dist/.claude-plugin/agents/plugin-validator.md +378 -0
- package/dist/.claude-plugin/agents/prompt-optimizer.md +63 -0
- package/dist/.claude-plugin/agents/security_scanner.md +332 -0
- package/dist/.claude-plugin/agents/seo-specialist.md +73 -0
- package/dist/.claude-plugin/agents/skill-creator.md +311 -0
- package/dist/.claude-plugin/agents/test-docs-writer-2.md +46 -0
- package/dist/.claude-plugin/agents/test-docs-writer-usage.md +40 -0
- package/dist/.claude-plugin/agents/test-docs-writer.md +98 -0
- package/dist/.claude-plugin/agents/test_generator.md +260 -0
- package/dist/.claude-plugin/agents/tool-creator.md +474 -0
- package/dist/.claude-plugin/commands/compound.md +26 -0
- package/dist/.claude-plugin/commands/context.md +318 -0
- package/dist/.claude-plugin/commands/create-agent.md +48 -0
- package/dist/.claude-plugin/commands/create-command.md +48 -0
- package/dist/.claude-plugin/commands/create-plugin.md +400 -0
- package/dist/.claude-plugin/commands/create-skill.md +48 -0
- package/dist/.claude-plugin/commands/create-tool.md +53 -0
- package/dist/.claude-plugin/commands/deploy.md +35 -0
- package/dist/.claude-plugin/commands/optimize.md +79 -0
- package/dist/.claude-plugin/commands/plan.md +215 -0
- package/dist/.claude-plugin/commands/recursive-init.md +217 -0
- package/dist/.claude-plugin/commands/research.md +199 -0
- package/dist/.claude-plugin/commands/review.md +73 -0
- package/dist/.claude-plugin/commands/seo.md +40 -0
- package/dist/.claude-plugin/commands/work.md +460 -0
- package/dist/.claude-plugin/hooks.json +15 -0
- package/dist/.claude-plugin/marketplace.json +54 -0
- package/dist/.claude-plugin/plugin.json +24 -0
- package/dist/.claude-plugin/skills/AGENTS.md +37 -0
- package/dist/.claude-plugin/skills/devops/coolify-deploy/SKILL.md +8 -0
- package/dist/.claude-plugin/skills/devops/git-worktree/SKILL.md +11 -0
- package/dist/.claude-plugin/skills/plugin-dev/SKILL.md +322 -0
- package/dist/.claude-plugin/skills/plugin-dev/references/agent-format.md +248 -0
- package/dist/.claude-plugin/skills/plugin-dev/references/claude-code-plugins.md +372 -0
- package/dist/.claude-plugin/skills/plugin-dev/references/command-format.md +312 -0
- package/dist/.claude-plugin/skills/plugin-dev/references/opencode-plugins.md +406 -0
- package/dist/.claude-plugin/skills/plugin-dev/references/opencode-tools.md +470 -0
- package/dist/.claude-plugin/skills/plugin-dev/references/skill-format.md +328 -0
- package/dist/.claude-plugin/skills/prompting/incentive-prompting/SKILL.md +162 -0
- package/dist/.claude-plugin/skills/research/comprehensive-research/SKILL.md +343 -0
- package/dist/.opencode/agent/ai-eng/ai-innovation/ai_engineer.md +186 -0
- package/dist/.opencode/agent/ai-eng/ai-innovation/ml_engineer.md +175 -0
- package/dist/.opencode/agent/ai-eng/ai-innovation/prompt-optimizer.md +62 -0
- package/dist/.opencode/agent/ai-eng/business-analytics/seo-specialist.md +72 -0
- package/dist/.opencode/agent/ai-eng/development/api_builder_enhanced.md +81 -0
- package/dist/.opencode/agent/ai-eng/development/architect-advisor.md +87 -0
- package/dist/.opencode/agent/ai-eng/development/backend_architect.md +87 -0
- package/dist/.opencode/agent/ai-eng/development/database_optimizer.md +174 -0
- package/dist/.opencode/agent/ai-eng/development/docs-writer.md +98 -0
- package/dist/.opencode/agent/ai-eng/development/documentation_specialist.md +211 -0
- package/dist/.opencode/agent/ai-eng/development/frontend-reviewer.md +50 -0
- package/dist/.opencode/agent/ai-eng/development/full_stack_developer.md +390 -0
- package/dist/.opencode/agent/ai-eng/development/java-pro.md +181 -0
- package/dist/.opencode/agent/ai-eng/development/test-docs-writer-2.md +45 -0
- package/dist/.opencode/agent/ai-eng/development/test-docs-writer-usage.md +39 -0
- package/dist/.opencode/agent/ai-eng/development/test-docs-writer.md +97 -0
- package/dist/.opencode/agent/ai-eng/meta/agent-creator.md +208 -0
- package/dist/.opencode/agent/ai-eng/meta/command-creator.md +333 -0
- package/dist/.opencode/agent/ai-eng/meta/skill-creator.md +313 -0
- package/dist/.opencode/agent/ai-eng/meta/tool-creator.md +476 -0
- package/dist/.opencode/agent/ai-eng/operations/cost_optimizer.md +283 -0
- package/dist/.opencode/agent/ai-eng/operations/deployment_engineer.md +185 -0
- package/dist/.opencode/agent/ai-eng/operations/infrastructure_builder.md +76 -0
- package/dist/.opencode/agent/ai-eng/operations/monitoring_expert.md +78 -0
- package/dist/.opencode/agent/ai-eng/quality-testing/code_reviewer.md +207 -0
- package/dist/.opencode/agent/ai-eng/quality-testing/performance_engineer.md +192 -0
- package/dist/.opencode/agent/ai-eng/quality-testing/plugin-validator.md +380 -0
- package/dist/.opencode/agent/ai-eng/quality-testing/security_scanner.md +331 -0
- package/dist/.opencode/agent/ai-eng/quality-testing/test_generator.md +259 -0
- package/dist/.opencode/command/ai-eng/compound.md +26 -0
- package/dist/.opencode/command/ai-eng/context.md +318 -0
- package/dist/.opencode/command/ai-eng/create-agent.md +48 -0
- package/dist/.opencode/command/ai-eng/create-command.md +48 -0
- package/dist/.opencode/command/ai-eng/create-plugin.md +400 -0
- package/dist/.opencode/command/ai-eng/create-skill.md +48 -0
- package/dist/.opencode/command/ai-eng/create-tool.md +53 -0
- package/dist/.opencode/command/ai-eng/deploy.md +35 -0
- package/dist/.opencode/command/ai-eng/optimize.md +79 -0
- package/dist/.opencode/command/ai-eng/plan.md +215 -0
- package/dist/.opencode/command/ai-eng/recursive-init.md +217 -0
- package/dist/.opencode/command/ai-eng/research.md +199 -0
- package/dist/.opencode/command/ai-eng/review.md +73 -0
- package/dist/.opencode/command/ai-eng/seo.md +40 -0
- package/dist/.opencode/command/ai-eng/work.md +460 -0
- package/dist/.opencode/opencode.jsonc +8 -0
- package/dist/.opencode/plugin/ai-eng-system.ts +10 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -0
- package/dist/skills/AGENTS.md +37 -0
- package/dist/skills/devops/coolify-deploy/SKILL.md +8 -0
- package/dist/skills/devops/git-worktree/SKILL.md +11 -0
- package/dist/skills/plugin-dev/SKILL.md +322 -0
- package/dist/skills/plugin-dev/references/agent-format.md +248 -0
- package/dist/skills/plugin-dev/references/claude-code-plugins.md +372 -0
- package/dist/skills/plugin-dev/references/command-format.md +312 -0
- package/dist/skills/plugin-dev/references/opencode-plugins.md +406 -0
- package/dist/skills/plugin-dev/references/opencode-tools.md +470 -0
- package/dist/skills/plugin-dev/references/skill-format.md +328 -0
- package/dist/skills/prompting/incentive-prompting/SKILL.md +162 -0
- package/dist/skills/research/comprehensive-research/SKILL.md +343 -0
- package/package.json +73 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# Skill Format Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Skills follow Anthropic's Agent Skills Specification and work identically in both Claude Code and OpenCode. The opencode-skills plugin provides automatic discovery and registration of skills as tools.
|
|
6
|
+
|
|
7
|
+
## Universal Skill Structure
|
|
8
|
+
|
|
9
|
+
Both platforms use the same skill format:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
skill-name/
|
|
13
|
+
├── SKILL.md (required)
|
|
14
|
+
│ ├── YAML frontmatter (required)
|
|
15
|
+
│ │ ├── name: (required)
|
|
16
|
+
│ │ └── description: (required)
|
|
17
|
+
│ └── Markdown instructions (required)
|
|
18
|
+
└── Bundled Resources (optional)
|
|
19
|
+
├── scripts/ # Executable code
|
|
20
|
+
├── references/ # Documentation
|
|
21
|
+
└── assets/ # Files used in output
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## SKILL.md Format
|
|
25
|
+
|
|
26
|
+
### Required Frontmatter
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
---
|
|
30
|
+
name: skill-name
|
|
31
|
+
description: This skill should be used when...
|
|
32
|
+
version: 1.0.0
|
|
33
|
+
---
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Name Requirements:**
|
|
37
|
+
- Lowercase alphanumeric with hyphens only
|
|
38
|
+
- Must match directory name
|
|
39
|
+
- 3-50 characters
|
|
40
|
+
|
|
41
|
+
**Description Requirements:**
|
|
42
|
+
- Minimum 20 characters for discoverability
|
|
43
|
+
- Third-person: "This skill should be used when..."
|
|
44
|
+
- Include specific trigger phrases
|
|
45
|
+
- Concrete examples of user queries
|
|
46
|
+
|
|
47
|
+
### Content Guidelines
|
|
48
|
+
|
|
49
|
+
**Word Count**: 1,000-3,000 words (ideally 1,500-2,000)
|
|
50
|
+
**Writing Style**: Imperative/infinitive form
|
|
51
|
+
**Organization**: Clear sections, logical flow
|
|
52
|
+
|
|
53
|
+
## Progressive Disclosure
|
|
54
|
+
|
|
55
|
+
### Three-Level Loading
|
|
56
|
+
|
|
57
|
+
1. **Metadata** (always loaded): Name + description (~100 words)
|
|
58
|
+
2. **SKILL.md body** (when triggered): Core instructions (<5k words)
|
|
59
|
+
3. **Bundled Resources** (as needed): Scripts, references, assets
|
|
60
|
+
|
|
61
|
+
### Benefits
|
|
62
|
+
|
|
63
|
+
- **Context Efficiency**: Lean core content
|
|
64
|
+
- **Detailed Knowledge**: Comprehensive references
|
|
65
|
+
- **Executable Code**: Deterministic scripts
|
|
66
|
+
- **Output Assets**: Templates and examples
|
|
67
|
+
|
|
68
|
+
## Skill Types by Platform
|
|
69
|
+
|
|
70
|
+
| Platform | Skill Discovery | Skill Loading |
|
|
71
|
+
|----------|----------------|---------------|
|
|
72
|
+
| **Claude Code** | Built-in | Built-in |
|
|
73
|
+
| **OpenCode** | opencode-skills plugin | opencode-skills plugin |
|
|
74
|
+
|
|
75
|
+
## OpenCode Skill Integration
|
|
76
|
+
|
|
77
|
+
### Auto-Discovery
|
|
78
|
+
|
|
79
|
+
The opencode-skills plugin automatically:
|
|
80
|
+
1. Scans `.opencode/skills/`, `~/.opencode/skills/`, `~/.config/opencode/skills/`
|
|
81
|
+
2. Validates YAML frontmatter
|
|
82
|
+
3. Registers tools as `skills_{{skill_name}}`
|
|
83
|
+
4. Loads skill content via silent message insertion
|
|
84
|
+
|
|
85
|
+
### Skill Usage
|
|
86
|
+
|
|
87
|
+
Skills become available as tools:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Use skill
|
|
91
|
+
skills_git_worktree
|
|
92
|
+
|
|
93
|
+
# Skill with arguments
|
|
94
|
+
skills_incentive_prompting "how to improve prompts"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Skill Loading Process
|
|
98
|
+
|
|
99
|
+
1. **Tool Registration**: `skills_git_worktree` tool appears
|
|
100
|
+
2. **Content Delivery**: Skill content inserted into session
|
|
101
|
+
3. **No Context Pollution**: Uses `noReply` pattern
|
|
102
|
+
4. **Base Directory**: Skill knows its location
|
|
103
|
+
|
|
104
|
+
## Best Practices
|
|
105
|
+
|
|
106
|
+
### Description Writing
|
|
107
|
+
|
|
108
|
+
**Good Examples:**
|
|
109
|
+
```yaml
|
|
110
|
+
description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "validate tool use", or mentions hook events (PreToolUse, PostToolUse, Stop).
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Bad Examples:**
|
|
114
|
+
```yaml
|
|
115
|
+
description: Use this skill for hooks. # Too vague
|
|
116
|
+
description: Load when user needs hooks. # Second person
|
|
117
|
+
description: Helps with hook development. # No trigger phrases
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Content Organization
|
|
121
|
+
|
|
122
|
+
#### SKILL.md Body
|
|
123
|
+
|
|
124
|
+
**Include:**
|
|
125
|
+
- Core concepts and procedures
|
|
126
|
+
- Quick reference tables
|
|
127
|
+
- Pointers to detailed resources
|
|
128
|
+
|
|
129
|
+
**Exclude:**
|
|
130
|
+
- Detailed API documentation (>2k words)
|
|
131
|
+
- Extensive examples
|
|
132
|
+
- Reference material
|
|
133
|
+
|
|
134
|
+
#### References Directory
|
|
135
|
+
|
|
136
|
+
**Use for:**
|
|
137
|
+
- Detailed documentation (>2k words)
|
|
138
|
+
- API specifications
|
|
139
|
+
- Comprehensive examples
|
|
140
|
+
- Background knowledge
|
|
141
|
+
|
|
142
|
+
**File Naming:**
|
|
143
|
+
- `patterns.md` - Common patterns
|
|
144
|
+
- `advanced.md` - Advanced techniques
|
|
145
|
+
- `examples.md` - Working examples
|
|
146
|
+
- `troubleshooting.md` - Issue resolution
|
|
147
|
+
|
|
148
|
+
#### Scripts Directory
|
|
149
|
+
|
|
150
|
+
**Use for:**
|
|
151
|
+
- Repeatedly executed code
|
|
152
|
+
- Deterministic operations
|
|
153
|
+
- Complex calculations
|
|
154
|
+
- External tool integration
|
|
155
|
+
|
|
156
|
+
**Examples:**
|
|
157
|
+
- `validate-skill.py` - Skill validation
|
|
158
|
+
- `generate-template.sh` - Template generation
|
|
159
|
+
- `install-dependencies.sh` - Setup automation
|
|
160
|
+
|
|
161
|
+
#### Assets Directory
|
|
162
|
+
|
|
163
|
+
**Use for:**
|
|
164
|
+
- Template files
|
|
165
|
+
- Configuration examples
|
|
166
|
+
- Code snippets
|
|
167
|
+
- Documentation templates
|
|
168
|
+
|
|
169
|
+
**Examples:**
|
|
170
|
+
- `template.md` - Document template
|
|
171
|
+
- `config.yaml` - Configuration example
|
|
172
|
+
- `boilerplate.py` - Code starter
|
|
173
|
+
|
|
174
|
+
## Validation
|
|
175
|
+
|
|
176
|
+
### Frontmatter Validation
|
|
177
|
+
|
|
178
|
+
The opencode-skills plugin validates:
|
|
179
|
+
- Name format (regex: `^[a-z0-9-]+$`)
|
|
180
|
+
- Description length (min 20 chars)
|
|
181
|
+
- Required fields present
|
|
182
|
+
|
|
183
|
+
### Content Quality
|
|
184
|
+
|
|
185
|
+
- **Triggering**: Description includes specific user phrases
|
|
186
|
+
- **Progressive Disclosure**: Core content lean, details in references
|
|
187
|
+
- **Writing Style**: Imperative form throughout
|
|
188
|
+
- **References**: All referenced files exist
|
|
189
|
+
|
|
190
|
+
## Integration with Ferg System
|
|
191
|
+
|
|
192
|
+
### Existing Skills
|
|
193
|
+
|
|
194
|
+
- `skills/prompting/incentive-prompting` - Research-backed techniques
|
|
195
|
+
- `skills/devops/git-worktree` - Git worktree management
|
|
196
|
+
- `skills/devops/coolify-deploy` - Coolify deployment
|
|
197
|
+
|
|
198
|
+
### Plugin-Dev Skill
|
|
199
|
+
|
|
200
|
+
- `skills/plugin-dev/SKILL.md` - Extension development knowledge
|
|
201
|
+
- References for both platforms
|
|
202
|
+
- Comprehensive documentation
|
|
203
|
+
|
|
204
|
+
## Development Workflow
|
|
205
|
+
|
|
206
|
+
### 1. Create Skill Structure
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
mkdir -p skills/my-skill/{references,scripts,assets}
|
|
210
|
+
touch skills/my-skill/SKILL.md
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 2. Write Core Content
|
|
214
|
+
|
|
215
|
+
Focus on essential procedures in SKILL.md (1,500-2,000 words)
|
|
216
|
+
|
|
217
|
+
### 3. Add Detailed Resources
|
|
218
|
+
|
|
219
|
+
Move comprehensive content to references/ files
|
|
220
|
+
|
|
221
|
+
### 4. Test Discovery
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Test skill loading
|
|
225
|
+
opencode # Restart to reload skills
|
|
226
|
+
|
|
227
|
+
# Check tool availability
|
|
228
|
+
skills_my_skill
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 5. Validate Quality
|
|
232
|
+
|
|
233
|
+
Use skill-reviewer agent for quality assessment
|
|
234
|
+
|
|
235
|
+
## Security Considerations
|
|
236
|
+
|
|
237
|
+
### Input Validation
|
|
238
|
+
|
|
239
|
+
- Validate user inputs in skill logic
|
|
240
|
+
- Sanitize file paths
|
|
241
|
+
- Check permissions before access
|
|
242
|
+
|
|
243
|
+
### Safe Operations
|
|
244
|
+
|
|
245
|
+
- Avoid dangerous shell commands in scripts
|
|
246
|
+
- Use environment variables for secrets
|
|
247
|
+
- Follow principle of least privilege
|
|
248
|
+
|
|
249
|
+
### Code Quality
|
|
250
|
+
|
|
251
|
+
- Validate external dependencies
|
|
252
|
+
- Use secure coding practices
|
|
253
|
+
- Handle errors gracefully
|
|
254
|
+
|
|
255
|
+
## Troubleshooting
|
|
256
|
+
|
|
257
|
+
### Common Issues
|
|
258
|
+
|
|
259
|
+
**Skill Not Loading:**
|
|
260
|
+
- Check YAML frontmatter syntax
|
|
261
|
+
- Verify directory structure
|
|
262
|
+
- Restart OpenCode to reload
|
|
263
|
+
|
|
264
|
+
**Tool Not Available:**
|
|
265
|
+
- Check opencode-skills plugin is installed
|
|
266
|
+
- Verify skill discovery path
|
|
267
|
+
- Review skill validation logs
|
|
268
|
+
|
|
269
|
+
**Content Not Inserting:**
|
|
270
|
+
- Check skill content length
|
|
271
|
+
- Verify message insertion format
|
|
272
|
+
- Test with simple skill first
|
|
273
|
+
|
|
274
|
+
### Debug Mode
|
|
275
|
+
|
|
276
|
+
Run OpenCode with debug flag to see skill loading:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
opencode --debug
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Advanced Features
|
|
283
|
+
|
|
284
|
+
### Conditional Logic
|
|
285
|
+
|
|
286
|
+
Skills can include conditional logic based on context:
|
|
287
|
+
|
|
288
|
+
```markdown
|
|
289
|
+
## Context Detection
|
|
290
|
+
|
|
291
|
+
First, detect the project type:
|
|
292
|
+
- If svelte.config.js exists → Svelte project
|
|
293
|
+
- If package.json with "express" → Node.js API
|
|
294
|
+
- If go.mod present → Go application
|
|
295
|
+
|
|
296
|
+
## Project-Specific Actions
|
|
297
|
+
|
|
298
|
+
Based on detected project type:
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Dynamic Content
|
|
302
|
+
|
|
303
|
+
Skills can generate content dynamically:
|
|
304
|
+
|
|
305
|
+
```markdown
|
|
306
|
+
## Template Generation
|
|
307
|
+
|
|
308
|
+
Generate a [component] with the following structure:
|
|
309
|
+
!`generate-template.sh $ARGUMENTS`
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### External Integration
|
|
313
|
+
|
|
314
|
+
Skills can integrate with external services:
|
|
315
|
+
|
|
316
|
+
```markdown
|
|
317
|
+
## API Integration
|
|
318
|
+
|
|
319
|
+
Connect to external API:
|
|
320
|
+
!`curl -s "$API_URL/api/data"`
|
|
321
|
+
|
|
322
|
+
## Database Queries
|
|
323
|
+
|
|
324
|
+
Execute database query:
|
|
325
|
+
!`psql "$DATABASE_URL" -c "SELECT * FROM users LIMIT 10"`
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Skills provide a powerful way to package domain expertise and make it available across both platforms with consistent behavior and quality standards.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: incentive-prompting
|
|
3
|
+
description: Research-backed prompting techniques for improved AI response quality
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [prompting, optimization, ai-enhancement]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Incentive-Based Prompting Skill
|
|
9
|
+
|
|
10
|
+
Research-backed techniques that leverage statistical pattern-matching to elicit higher-quality AI responses. Based on peer-reviewed research from MBZUAI (Bsharat et al.), Google DeepMind (Yang et al.), and ICLR 2024 (Li et al.).
|
|
11
|
+
|
|
12
|
+
## How It Works
|
|
13
|
+
|
|
14
|
+
LLMs don't understand incentives, but they **pattern-match** on language associated with high-effort training examples. Stakes language triggers selection from distributions of higher-quality text patterns.
|
|
15
|
+
|
|
16
|
+
## Core Techniques
|
|
17
|
+
|
|
18
|
+
### 1. Monetary Incentive Framing (+45% quality)
|
|
19
|
+
**Source:** Bsharat et al. (2023, MBZUAI) - Principle #6
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
"I'll tip you $200 for a perfect solution to this problem."
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**When to use:** Complex technical problems, optimization tasks, debugging
|
|
26
|
+
|
|
27
|
+
### 2. Step-by-Step Reasoning (34% → 80% accuracy)
|
|
28
|
+
**Source:** Yang et al. (2023, Google DeepMind OPRO)
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
"Take a deep breath and solve this step by step."
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**When to use:** Multi-step reasoning, math problems, logical analysis
|
|
35
|
+
|
|
36
|
+
### 3. Challenge Framing (+115% on hard tasks)
|
|
37
|
+
**Source:** Li et al. (2023, ICLR 2024)
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
"I bet you can't solve this, but if you do..."
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**When to use:** Difficult problems, edge cases, problems where simpler approaches failed
|
|
44
|
+
|
|
45
|
+
### 4. Stakes Language
|
|
46
|
+
**Source:** Bsharat et al. (2023) - Principle #10
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
"This is critical to my career."
|
|
50
|
+
"You will be penalized for incomplete answers."
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**When to use:** High-importance tasks, comprehensive requirements
|
|
54
|
+
|
|
55
|
+
### 5. Expert Persona Assignment (24% → 84% accuracy)
|
|
56
|
+
**Source:** Kong et al. (2023), Bsharat et al. Principle #16
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
# Instead of:
|
|
60
|
+
"You are a helpful assistant."
|
|
61
|
+
|
|
62
|
+
# Use:
|
|
63
|
+
"You are a senior database architect with 15 years of PostgreSQL optimization experience who has worked at companies like Netflix and Stripe."
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**When to use:** Domain-specific tasks, technical implementations
|
|
67
|
+
|
|
68
|
+
### 6. Self-Evaluation Request
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
"Rate your confidence in this answer from 0-1 and explain your reasoning."
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**When to use:** Ambiguous problems, when you need quality assessment
|
|
75
|
+
|
|
76
|
+
### 7. Combined Approach (Kitchen Sink)
|
|
77
|
+
|
|
78
|
+
Combine multiple techniques for maximum effect:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
"You are a senior [ROLE] with [X] years of experience at [NOTABLE_COMPANIES].
|
|
82
|
+
|
|
83
|
+
I bet you can't solve this, but it's critical to my career and worth $200 if you get it perfect. Take a deep breath and solve step by step.
|
|
84
|
+
|
|
85
|
+
[PROBLEM DESCRIPTION]
|
|
86
|
+
|
|
87
|
+
Rate your confidence 0-1 after providing your solution."
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Implementation Patterns
|
|
91
|
+
|
|
92
|
+
### For OpenCode Agents
|
|
93
|
+
|
|
94
|
+
Add to agent prompts:
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
**Prompting Enhancement:**
|
|
98
|
+
Before responding to complex tasks, frame your internal reasoning with:
|
|
99
|
+
- Stakes awareness: Treat each task as critical to the user's success
|
|
100
|
+
- Step-by-step approach: Break down complex problems systematically
|
|
101
|
+
- Expert persona: Embody deep domain expertise for the task at hand
|
|
102
|
+
- Self-evaluation: Assess confidence and identify uncertainties
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### For Slash Commands
|
|
106
|
+
|
|
107
|
+
Structure command prompts to include:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
---
|
|
111
|
+
name: my-command
|
|
112
|
+
description: Description here
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# Context
|
|
116
|
+
You are a senior [expert role] with extensive experience in [domain].
|
|
117
|
+
|
|
118
|
+
# Stakes
|
|
119
|
+
This task is critical. Incomplete or incorrect results will cause significant issues.
|
|
120
|
+
|
|
121
|
+
# Approach
|
|
122
|
+
Take a deep breath. Analyze the problem step by step before providing solutions.
|
|
123
|
+
|
|
124
|
+
# Task
|
|
125
|
+
[Actual task instructions]
|
|
126
|
+
|
|
127
|
+
# Quality Check
|
|
128
|
+
Before finalizing, rate your confidence and identify any assumptions or limitations.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Research References
|
|
132
|
+
|
|
133
|
+
1. **Bsharat et al. (2023)** - "Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4" - MBZUAI
|
|
134
|
+
- 26 principled prompting instructions
|
|
135
|
+
- Average 57.7% quality improvement on GPT-4
|
|
136
|
+
- arxiv.org/abs/2312.16171
|
|
137
|
+
|
|
138
|
+
2. **Yang et al. (2023)** - "Large Language Models as Optimizers" (OPRO) - Google DeepMind
|
|
139
|
+
- "Take a deep breath" phrase origin
|
|
140
|
+
- Up to 50% improvement over human-designed prompts
|
|
141
|
+
- arxiv.org/abs/2309.03409
|
|
142
|
+
|
|
143
|
+
3. **Li et al. (2023)** - Challenge framing research - ICLR 2024
|
|
144
|
+
- +115% improvement on hard tasks
|
|
145
|
+
|
|
146
|
+
4. **Kong et al. (2023)** - Persona prompting research
|
|
147
|
+
- 24% to 84% accuracy improvement with detailed personas
|
|
148
|
+
|
|
149
|
+
## Caveats
|
|
150
|
+
|
|
151
|
+
- **Model-dependent:** Results may vary across Claude versions
|
|
152
|
+
- **Research vintage:** Original research from 2023; newer models may be more steerable
|
|
153
|
+
- **Task-dependent:** Not all tasks benefit equally; most effective for complex problems
|
|
154
|
+
- **Not actual motivation:** This is statistical pattern-matching, not AI understanding incentives
|
|
155
|
+
|
|
156
|
+
## Integration with Ferg Engineering System
|
|
157
|
+
|
|
158
|
+
Use this skill to enhance:
|
|
159
|
+
- `/plan` command prompts
|
|
160
|
+
- `/review` multi-agent coordination
|
|
161
|
+
- Subagent persona definitions
|
|
162
|
+
- Complex debugging sessions
|