codingbuddy-rules 4.2.0 → 4.4.0

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.
@@ -1,263 +1,254 @@
1
1
  # OpenCode Skills Integration Guide
2
2
 
3
- This guide explains how to integrate `.ai-rules/skills/` with OpenCode/Crush's Agent Skills system.
3
+ This guide explains how skills work in OpenCode/Crush and how to access them through codingbuddy.
4
4
 
5
- ## Overview
5
+ > **Note:** The original OpenCode project has been archived and continued as **"Crush"** by Charm Bracelet. This guide supports both versions. See [opencode.md](opencode.md) for full context.
6
6
 
7
- OpenCode/Crush supports Agent Skills standard for structured AI capabilities. This guide maps existing `.ai-rules/skills/` to OpenCode-compatible format and provides usage patterns.
7
+ ## Overview
8
8
 
9
- ## Skills Mapping
9
+ Skills are structured AI instructions following the [Agent Skills specification](https://agentskills.io/specification). They help AI agents perform better at specialized tasks like brainstorming, TDD, debugging, and planning.
10
10
 
11
- | .ai-rules Skill | OpenCode Usage | Agent Integration |
12
- |----------------|----------------|-------------------|
13
- | `brainstorming` | `/skill brainstorming` | plan agent |
14
- | `test-driven-development` | `/skill tdd` | build agent |
15
- | `systematic-debugging` | `/skill debug` | build agent |
16
- | `writing-plans` | `/skill planning` | plan agent |
17
- | `executing-plans` | `/skill execute` | build agent |
18
- | `frontend-design` | `/skill frontend` | build agent |
19
- | `dispatching-parallel-agents` | `/skill parallel` | plan agent |
20
- | `subagent-driven-development` | `/skill subagent` | plan agent |
11
+ In OpenCode/Crush, there are **two mechanisms** for accessing skills:
21
12
 
22
- ## Skills Configuration
13
+ | Priority | Mechanism | How It Works |
14
+ |----------|-----------|-------------|
15
+ | **Primary** | codingbuddy MCP Tools | `recommend_skills` → `get_skill` — cross-platform, programmatic |
16
+ | **Supplementary** | Crush Native Discovery | Disk-based auto-discovery → `<available_skills>` system prompt injection |
23
17
 
24
- ### For OpenCode (.opencode.json)
25
- ```json
26
- {
27
- "skills": {
28
- "paths": [
29
- "packages/rules/.ai-rules/skills"
30
- ],
31
- "auto_load": true
32
- }
33
- }
34
- ```
18
+ ## Skills Access: Precedence
35
19
 
36
- ### For Crush (crush.json)
37
- ```json
38
- {
39
- "options": {
40
- "skills_paths": [
41
- "packages/rules/.ai-rules/skills"
42
- ],
43
- "auto_suggest_skills": true
44
- }
45
- }
46
- ```
20
+ ### 1. codingbuddy MCP Tools (Primary)
47
21
 
48
- ## Usage Patterns
22
+ The codingbuddy MCP server provides skill recommendation and loading tools that work identically across all AI assistants (Claude Code, Cursor, OpenCode/Crush, etc.).
49
23
 
50
- ### 1. Direct Skill Invocation
51
- ```bash
52
- # In OpenCode CLI
53
- /skill brainstorming "new feature ideas"
54
- /skill tdd "user authentication implementation"
55
- /skill debug "fix login bug"
56
- ```
24
+ **Available tools:**
57
25
 
58
- ### 2. Agent + Skill Combination
59
- ```bash
60
- # Planning with brainstorming skill
61
- /agent plan
62
- /skill brainstorming "improve dashboard UI"
26
+ | Tool | Description |
27
+ |------|-------------|
28
+ | `recommend_skills` | Analyze user prompt and recommend matching skills with confidence scores |
29
+ | `get_skill` | Load full skill content by name |
30
+ | `list_skills` | List all available skills with optional priority filtering |
63
31
 
64
- # Implementation with TDD skill
65
- /agent build
66
- /skill tdd "implement API integration"
32
+ **Usage pattern:**
67
33
 
68
- # Review with debugging skill
69
- /agent reviewer
70
- /skill debug "analyze performance issues"
34
+ ```
35
+ User prompt → recommend_skills(prompt) → get_skill(recommended skillName) → follow instructions
71
36
  ```
72
37
 
73
- ### 3. Automatic Skill Recommendation
74
-
75
- OpenCode can automatically recommend skills based on prompts using the `recommend_skills` MCP tool:
38
+ **Why primary?**
39
+ - Works across all AI assistants — not limited to Crush
40
+ - Programmatic keyword matching for reliable recommendations
41
+ - Returns structured data (confidence scores, matched patterns)
42
+ - Consistent behavior regardless of platform
76
43
 
77
- ```typescript
78
- // Auto-triggered when user enters certain keywords
79
- "there's a bug" → recommends: systematic-debugging
80
- "create a plan" → recommends: writing-plans
81
- "build the UI" → recommends: frontend-design
82
- ```
44
+ ### 2. Crush Native Skill Discovery (Supplementary)
83
45
 
84
- ## Skill Conversion Process
46
+ Crush automatically discovers skills from the filesystem and injects them into the AI's system prompt.
85
47
 
86
- ### 1. SKILL.md Format Compatibility
48
+ **How it works:**
49
+ 1. Crush scans configured skill directories for `SKILL.md` files
50
+ 2. Extracts `name` and `description` from each skill's frontmatter
51
+ 3. Injects an `<available_skills>` block into the system prompt
52
+ 4. The AI decides when to activate a skill based on natural language context
87
53
 
88
- Existing `.ai-rules/skills/*/SKILL.md` files are already compatible with Agent Skills standard:
54
+ **Default skill directory:**
55
+ - Unix: `~/.config/crush/skills/`
56
+ - Windows: `%LOCALAPPDATA%\crush\skills\`
89
57
 
90
- ```markdown
91
- # Skill Name
58
+ **Important:** There is no `/skill` slash command. Skills are activated through natural language — ask the AI to use a specific skill or describe a task that matches a skill's description.
92
59
 
93
- ## Description
94
- Brief description of the skill's purpose
60
+ **Reference:** [charmbracelet/crush#1972](https://github.com/charmbracelet/crush/issues/1972)
95
61
 
96
- ## Usage
97
- When and how to use this skill
62
+ ## Configuration
98
63
 
99
- ## Steps
100
- 1. Step 1
101
- 2. Step 2
102
- 3. Step 3
64
+ ### Crush Configuration (crush.json)
103
65
 
104
- ## Examples
105
- Example scenarios and outputs
66
+ ```json
67
+ {
68
+ "options": {
69
+ "skills_paths": [
70
+ "packages/rules/.ai-rules/skills",
71
+ "~/.config/crush/skills"
72
+ ]
73
+ }
74
+ }
106
75
  ```
107
76
 
108
- ### 2. No Conversion Required
109
-
110
- The existing skills can be used directly in OpenCode without modification:
77
+ | Field | Location | Description |
78
+ |-------|----------|-------------|
79
+ | `skills_paths` | `options.skills_paths` | Array of additional directories to scan for skills |
111
80
 
112
- - **brainstorming/SKILL.md** ✅ Ready
113
- - **test-driven-development/SKILL.md** ✅ Ready
114
- - **systematic-debugging/SKILL.md** ✅ Ready
115
- - **writing-plans/SKILL.md** ✅ Ready
116
- - **executing-plans/SKILL.md** ✅ Ready
117
- - **frontend-design/SKILL.md** ✅ Ready
118
- - **dispatching-parallel-agents/SKILL.md** ✅ Ready
119
- - **subagent-driven-development/SKILL.md** ✅ Ready
81
+ **Environment variable:**
120
82
 
121
- ## Integration with MCP
83
+ | Variable | Description |
84
+ |----------|-------------|
85
+ | `CRUSH_SKILLS_DIR` | Override default skills directory path |
122
86
 
123
- ### Codingbuddy MCP Skills
87
+ ### MCP Server Configuration
124
88
 
125
- The `codingbuddy` MCP server provides skill recommendation:
89
+ Add codingbuddy MCP server for programmatic skill access:
126
90
 
127
91
  ```json
128
92
  {
129
93
  "mcp": {
130
94
  "codingbuddy": {
131
- "type": "stdio",
132
- "command": ["npx", "codingbuddy@latest", "mcp"]
95
+ "type": "local",
96
+ "command": ["npx", "codingbuddy@latest", "mcp"],
97
+ "env": {
98
+ "CODINGBUDDY_PROJECT_ROOT": "/absolute/path/to/your/project"
99
+ }
133
100
  }
134
101
  }
135
102
  }
136
103
  ```
137
104
 
138
- **Available MCP tools:**
139
- - `recommend_skills`: Get skill recommendations based on user prompt
140
- - `get_skill`: Load specific skill content
141
- - `list_skills`: List all available skills
105
+ ## SKILL.md Format
142
106
 
143
- ### Automatic Skill Loading
107
+ Skills follow the [Agent Skills specification](https://agentskills.io/specification).
144
108
 
145
- OpenCode agents can automatically load relevant skills:
109
+ ### Required Structure
146
110
 
147
- ```json
148
- {
149
- "agent": {
150
- "plan": {
151
- "auto_skills": ["brainstorming", "writing-plans"],
152
- "systemPrompt": "You have access to brainstorming and planning skills..."
153
- },
154
- "build": {
155
- "auto_skills": ["test-driven-development", "executing-plans", "frontend-design"],
156
- "systemPrompt": "You have access to TDD, execution, and frontend skills..."
157
- }
158
- }
159
- }
111
+ ```
112
+ skill-name/
113
+ ├── SKILL.md # Required
114
+ ├── scripts/ # Optional — executable code
115
+ ├── references/ # Optional — additional documentation
116
+ └── assets/ # Optional static resources
160
117
  ```
161
118
 
162
- ## Workflow Integration
119
+ ### Frontmatter Schema
120
+
121
+ ```yaml
122
+ ---
123
+ name: skill-name # Required. Lowercase + hyphens, max 64 chars, must match directory name
124
+ description: ... # Required. Max 1024 chars. What it does + when to use it
125
+ license: Apache-2.0 # Optional. License name or reference
126
+ compatibility: ... # Optional. Max 500 chars. Environment requirements
127
+ metadata: # Optional. Arbitrary key-value map
128
+ author: example-org
129
+ version: "1.0"
130
+ allowed-tools: Bash Read # Optional. Space-delimited pre-approved tools (experimental)
131
+ ---
132
+ ```
163
133
 
164
- ### PLAN Mode Skills
165
- When using `plan` agent, automatically suggest:
166
- - **brainstorming**: For ideation and requirements exploration
167
- - **writing-plans**: For structured implementation planning
168
- - **dispatching-parallel-agents**: For complex multi-component features
169
-
170
- ### ACT Mode Skills
171
- When using `build` agent, automatically suggest:
172
- - **test-driven-development**: For core logic implementation
173
- - **executing-plans**: For systematic plan execution
174
- - **frontend-design**: For UI component development
175
- - **systematic-debugging**: When encountering issues
134
+ | Field | Required | Description |
135
+ |-------|----------|-------------|
136
+ | `name` | Yes | Lowercase alphanumeric + hyphens, max 64 chars |
137
+ | `description` | Yes | What the skill does and when to use it, max 1024 chars |
138
+ | `license` | No | License name or file reference |
139
+ | `compatibility` | No | Environment requirements, max 500 chars |
140
+ | `metadata` | No | Arbitrary key-value pairs |
141
+ | `allowed-tools` | No | Pre-approved tools list (experimental) |
176
142
 
177
- ### EVAL Mode Skills
178
- When using `reviewer` agent, automatically suggest:
179
- - **systematic-debugging**: For error analysis
180
- - **subagent-driven-development**: For improvement strategies
143
+ ## Available Skills
181
144
 
182
- ## Korean Language Support
145
+ The table below shows representative skills by mode. Use `list_skills` MCP tool for the complete list.
183
146
 
184
- All skills support Korean language through MCP integration:
147
+ ### PLAN Mode Skills
185
148
 
186
- ```bash
187
- # Korean skill invocation
188
- /skill 브레인스토밍 "새로운 기능"
189
- /skill TDD개발 "사용자 관리"
190
- /skill 디버깅 "성능 문제"
191
- ```
149
+ | Skill | Description |
150
+ |-------|-------------|
151
+ | `brainstorming` | Ideation and requirements exploration |
152
+ | `writing-plans` | Structured implementation planning |
153
+ | `dispatching-parallel-agents` | Multi-component parallel work |
154
+ | `subagent-driven-development` | Subagent-per-task execution |
155
+ | `context-management` | Context window optimization |
156
+
157
+ ### ACT Mode Skills
158
+
159
+ | Skill | Description |
160
+ |-------|-------------|
161
+ | `test-driven-development` | Red-Green-Refactor TDD cycle |
162
+ | `executing-plans` | Systematic plan execution |
163
+ | `frontend-design` | UI component development |
164
+ | `systematic-debugging` | Root cause analysis and bug fixing |
165
+ | `api-design` | API design and documentation |
166
+ | `refactoring` | Code restructuring |
167
+ | `mcp-builder` | MCP server development |
168
+ | `database-migration` | Database schema migration |
169
+ | `dependency-management` | Package dependency management |
170
+ | `widget-slot-architecture` | Widget/slot pattern implementation |
192
171
 
193
- The MCP server handles Korean→English skill name mapping automatically.
172
+ ### EVAL Mode Skills
194
173
 
195
- ## Examples
174
+ | Skill | Description |
175
+ |-------|-------------|
176
+ | `security-audit` | Security vulnerability analysis |
177
+ | `performance-optimization` | Performance profiling and improvement |
178
+ | `pr-review` | Pull request review |
179
+ | `pr-all-in-one` | Comprehensive PR workflow |
180
+ | `tech-debt` | Technical debt identification |
181
+
182
+ ### General Skills
183
+
184
+ | Skill | Description |
185
+ |-------|-------------|
186
+ | `code-explanation` | Code walkthrough and documentation |
187
+ | `documentation-generation` | Auto-generate project documentation |
188
+ | `error-analysis` | Error pattern analysis |
189
+ | `incident-response` | Production incident handling |
190
+ | `prompt-engineering` | AI prompt optimization |
191
+ | `rule-authoring` | Custom AI rules creation |
192
+ | `agent-design` | Custom agent design |
193
+ | `legacy-modernization` | Legacy code modernization |
194
+ | `deployment-checklist` | Deployment readiness verification |
196
195
 
197
- ### Planning a New Feature
196
+ ## Workflow Integration
198
197
 
199
- ```bash
200
- # Start planning session
201
- /agent plan
198
+ ### PLAN Mode — Planning Skills
202
199
 
203
- # Use brainstorming skill
204
- /skill brainstorming "improve user dashboard"
200
+ When working with the `plan-mode` agent, use MCP tools to load planning skills:
205
201
 
206
- # Generate implementation plan
207
- Create a plan for me
208
202
  ```
209
-
210
- ### Implementing with TDD
211
-
212
- ```bash
213
- # Switch to build agent
214
- /agent build
215
-
216
- # Load TDD skill
217
- /skill test-driven-development "implement login API"
218
-
219
- # Start TDD cycle
220
- ACT
203
+ User: "I want to build a new feature"
204
+ AI calls: recommend_skills("build a new feature")
205
+ AI receives: brainstorming (high), writing-plans (medium)
206
+ AI calls: get_skill("brainstorming")
207
+ AI follows: brainstorming skill instructions
221
208
  ```
222
209
 
223
- ### Debugging Issues
210
+ ### ACT Mode — Implementation Skills
224
211
 
225
- ```bash
226
- # Use systematic debugging
227
- /skill systematic-debugging "screen not showing after login"
212
+ When working with the `act-mode` agent:
228
213
 
229
- # Apply debugging methodology
230
- Debug this for me
214
+ ```
215
+ User: "ACT implement the login API"
216
+ AI calls: recommend_skills("implement the login API")
217
+ AI receives: test-driven-development (high)
218
+ AI calls: get_skill("test-driven-development")
219
+ AI follows: TDD Red-Green-Refactor cycle
231
220
  ```
232
221
 
233
- ## Benefits
222
+ ### EVAL Mode — Review Skills
234
223
 
235
- ### Advantages
236
- - **No Migration Required**: Existing skills work as-is
237
- - **Automatic Recommendations**: MCP-powered skill suggestions
238
- - **Korean Support**: Full Korean language integration
239
- - **Agent Integration**: Skills work seamlessly with agent modes
240
- - **Workflow Enhancement**: Skills enhance PLAN/ACT/EVAL workflow
224
+ When working with the `eval-mode` agent:
241
225
 
242
- ### ✅ Enhanced Capabilities
243
- - **Context-Aware**: Skills adapt to current agent mode
244
- - **Progressive Enhancement**: Skills complement agent capabilities
245
- - **Structured Approach**: Consistent methodology across skills
246
- - **Quality Focus**: Skills reinforce .ai-rules standards
226
+ ```
227
+ User: "EVAL review the implementation"
228
+ AI calls: recommend_skills("review the implementation")
229
+ AI receives: pr-review (high), security-audit (medium)
230
+ AI calls: get_skill("pr-review")
231
+ AI follows: PR review checklist
232
+ ```
247
233
 
248
234
  ## Maintenance
249
235
 
250
236
  ### Adding New Skills
251
237
 
252
- 1. Create new skill directory: `packages/rules/.ai-rules/skills/new-skill/`
253
- 2. Add `SKILL.md` file following Agent Skills format
254
- 3. Skills automatically available in OpenCode
255
- 4. Update skill mappings in this guide
238
+ 1. Create skill directory: `packages/rules/.ai-rules/skills/new-skill/`
239
+ 2. Add `SKILL.md` with required frontmatter (`name`, `description`)
240
+ 3. Skills are automatically available via MCP tools (`recommend_skills`, `get_skill`)
241
+ 4. For Crush native discovery, ensure skills are in a configured `skills_paths` directory
256
242
 
257
243
  ### Updating Existing Skills
258
244
 
259
- 1. Modify skill content in `packages/rules/.ai-rules/skills/*/SKILL.md`
260
- 2. Changes automatically reflected in OpenCode
261
- 3. No configuration updates required
245
+ 1. Modify `SKILL.md` content in `packages/rules/.ai-rules/skills/*/`
246
+ 2. Changes are automatically reflected no configuration updates needed
247
+
248
+ ### Validation
262
249
 
263
- This integration provides seamless skills access within OpenCode while maintaining consistency with the broader `.ai-rules` ecosystem.
250
+ Use the [skills-ref](https://github.com/agentskills/agentskills/tree/main/skills-ref) library to validate skills:
251
+
252
+ ```bash
253
+ skills-ref validate ./my-skill
254
+ ```