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,372 @@
|
|
|
1
|
+
# Claude Code Plugin Structure
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Claude Code plugins follow a standardized directory structure with automatic component discovery. Understanding this structure enables creating well-organized, maintainable plugins that integrate seamlessly with Claude Code.
|
|
6
|
+
|
|
7
|
+
## Directory Structure
|
|
8
|
+
|
|
9
|
+
Every Claude Code plugin follows this organizational pattern:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
plugin-name/
|
|
13
|
+
├── .claude-plugin/
|
|
14
|
+
│ └── plugin.json # Required: Plugin manifest
|
|
15
|
+
├── commands/ # Slash commands (.md files)
|
|
16
|
+
├── agents/ # Subagent definitions (.md files)
|
|
17
|
+
├── skills/ # Agent skills (subdirectories)
|
|
18
|
+
│ └── skill-name/
|
|
19
|
+
│ └── SKILL.md # Required for each skill
|
|
20
|
+
├── hooks/
|
|
21
|
+
│ └── hooks.json # Event handler configuration
|
|
22
|
+
├── .mcp.json # MCP server definitions
|
|
23
|
+
└── scripts/ # Helper scripts and utilities
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Critical Rules
|
|
27
|
+
|
|
28
|
+
1. **Manifest Location**: The `plugin.json` manifest MUST be in `.claude-plugin/` directory
|
|
29
|
+
2. **Component Locations**: All component directories (commands, agents, skills, hooks) MUST be at plugin root level, NOT nested inside `.claude-plugin/`
|
|
30
|
+
3. **Optional Components**: Only create directories for components that plugin actually uses
|
|
31
|
+
4. **Naming Convention**: Use kebab-case for all directory and file names
|
|
32
|
+
|
|
33
|
+
## Plugin Manifest (plugin.json)
|
|
34
|
+
|
|
35
|
+
The manifest defines plugin metadata and configuration. Located at `.claude-plugin/plugin.json`:
|
|
36
|
+
|
|
37
|
+
### Required Fields
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"name": "plugin-name"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Name Requirements:**
|
|
46
|
+
- Use kebab-case format (lowercase with hyphens)
|
|
47
|
+
- Must be unique across installed plugins
|
|
48
|
+
- No spaces or special characters
|
|
49
|
+
- Example: `code-review-assistant`, `test-runner`, `api-docs`
|
|
50
|
+
|
|
51
|
+
### Recommended Metadata
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"name": "plugin-name",
|
|
56
|
+
"version": "1.0.0",
|
|
57
|
+
"description": "Brief explanation of plugin purpose",
|
|
58
|
+
"author": {
|
|
59
|
+
"name": "Author Name",
|
|
60
|
+
"email": "author@example.com",
|
|
61
|
+
"url": "https://example.com"
|
|
62
|
+
},
|
|
63
|
+
"homepage": "https://docs.example.com",
|
|
64
|
+
"repository": "https://github.com/user/plugin-name",
|
|
65
|
+
"license": "MIT",
|
|
66
|
+
"keywords": ["testing", "automation", "ci-cd"]
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Version Format**: Follow semantic versioning (MAJOR.MINOR.PATCH)
|
|
71
|
+
**Keywords**: Use for plugin discovery and categorization
|
|
72
|
+
|
|
73
|
+
### Component Path Configuration
|
|
74
|
+
|
|
75
|
+
Specify custom paths for components (supplements default directories):
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"name": "plugin-name",
|
|
80
|
+
"commands": "./custom-commands",
|
|
81
|
+
"agents": ["./agents", "./specialized-agents"],
|
|
82
|
+
"hooks": "./config/hooks.json",
|
|
83
|
+
"mcpServers": "./.mcp.json"
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Important**: Custom paths supplement defaults—they don't replace them. Components in both default directories and custom paths will load.
|
|
88
|
+
|
|
89
|
+
## Commands
|
|
90
|
+
|
|
91
|
+
### Command Format
|
|
92
|
+
|
|
93
|
+
Commands are Markdown files with YAML frontmatter:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
---
|
|
97
|
+
name: my-command
|
|
98
|
+
description: What this command does
|
|
99
|
+
agent: build # Optional: which agent handles this
|
|
100
|
+
subtask: true # Optional: run as subtask
|
|
101
|
+
model: sonnet # Optional: override model
|
|
102
|
+
temperature: 0.3 # Optional: temperature
|
|
103
|
+
tools: # Optional: tool restrictions
|
|
104
|
+
read: true
|
|
105
|
+
write: true
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
# Command Content
|
|
109
|
+
|
|
110
|
+
Command instructions here with $ARGUMENTS placeholder...
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Frontmatter Fields
|
|
114
|
+
|
|
115
|
+
- **name** (required): Command identifier (kebab-case)
|
|
116
|
+
- **description** (required): Brief description shown in `/help`
|
|
117
|
+
- **agent** (optional): Which agent should handle this command
|
|
118
|
+
- **subtask** (optional): Run as subtask (default: false)
|
|
119
|
+
- **model** (optional): Override default model
|
|
120
|
+
- **temperature** (optional): Override default temperature
|
|
121
|
+
- **tools** (optional): Restrict available tools
|
|
122
|
+
|
|
123
|
+
### Dynamic Arguments
|
|
124
|
+
|
|
125
|
+
- `$ARGUMENTS`: All arguments as single string
|
|
126
|
+
- `$1`, `$2`, `$3`: Positional arguments
|
|
127
|
+
- `@file.txt`: Include file content
|
|
128
|
+
- `!`command``: Include shell command output
|
|
129
|
+
|
|
130
|
+
## Agents
|
|
131
|
+
|
|
132
|
+
### Agent Format
|
|
133
|
+
|
|
134
|
+
Agents are Markdown files with YAML frontmatter:
|
|
135
|
+
|
|
136
|
+
```markdown
|
|
137
|
+
---
|
|
138
|
+
name: my-agent
|
|
139
|
+
description: Use this agent when... <example>...</example>
|
|
140
|
+
mode: subagent
|
|
141
|
+
model: sonnet
|
|
142
|
+
color: cyan
|
|
143
|
+
temperature: 0.3
|
|
144
|
+
tools:
|
|
145
|
+
read: true
|
|
146
|
+
write: true
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
# System Prompt
|
|
150
|
+
|
|
151
|
+
Agent system prompt here...
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Frontmatter Fields
|
|
155
|
+
|
|
156
|
+
- **name** (required): Agent identifier (kebab-case, 3-50 chars)
|
|
157
|
+
- **description** (required): Triggering conditions with examples
|
|
158
|
+
- **mode** (required): "primary" or "subagent"
|
|
159
|
+
- **model** (optional): "inherit", "sonnet", "opus", "haiku"
|
|
160
|
+
- **color** (optional): "blue", "cyan", "green", "yellow", "magenta", "red"
|
|
161
|
+
- **temperature** (optional): 0.0-1.0 (default: model-specific)
|
|
162
|
+
- **tools** (optional): Tool access control
|
|
163
|
+
|
|
164
|
+
### Triggering Examples
|
|
165
|
+
|
|
166
|
+
Include 2-4 `<example>` blocks in description:
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
description: Use this agent when user asks to "create an agent", "generate an agent", or describes agent functionality. Examples:
|
|
170
|
+
|
|
171
|
+
<example>
|
|
172
|
+
Context: User wants to create a code review agent
|
|
173
|
+
user: "Create an agent that reviews code for quality issues"
|
|
174
|
+
assistant: "I'll use the agent-creator to generate a code review agent."
|
|
175
|
+
<commentary>
|
|
176
|
+
User requesting new agent creation, trigger agent-creator.
|
|
177
|
+
</commentary>
|
|
178
|
+
</example>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Skills
|
|
182
|
+
|
|
183
|
+
### Skill Format
|
|
184
|
+
|
|
185
|
+
Skills follow Anthropic's Agent Skills Specification:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
skill-name/
|
|
189
|
+
├── SKILL.md (required)
|
|
190
|
+
│ ├── YAML frontmatter (required)
|
|
191
|
+
│ │ ├── name: (required)
|
|
192
|
+
│ │ └── description: (required)
|
|
193
|
+
│ └── Markdown instructions (required)
|
|
194
|
+
└── Bundled Resources (optional)
|
|
195
|
+
├── scripts/ # Executable code
|
|
196
|
+
├── references/ # Documentation
|
|
197
|
+
└── assets/ # Files used in output
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### SKILL.md Frontmatter
|
|
201
|
+
|
|
202
|
+
```yaml
|
|
203
|
+
---
|
|
204
|
+
name: skill-name
|
|
205
|
+
description: This skill should be used when...
|
|
206
|
+
version: 1.0.0
|
|
207
|
+
---
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Progressive Disclosure
|
|
211
|
+
|
|
212
|
+
- **Metadata** (name + description): Always in context (~100 words)
|
|
213
|
+
- **SKILL.md body**: When skill triggers (<5k words, ideally 1.5-2k)
|
|
214
|
+
- **Bundled resources**: Loaded as needed by Claude
|
|
215
|
+
|
|
216
|
+
## Hooks
|
|
217
|
+
|
|
218
|
+
### Hook Configuration
|
|
219
|
+
|
|
220
|
+
Hooks are defined in `hooks/hooks.json`:
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"hooks": {
|
|
225
|
+
"SessionStart": [
|
|
226
|
+
{
|
|
227
|
+
"description": "Initialize plugin on session start",
|
|
228
|
+
"hooks": [
|
|
229
|
+
{
|
|
230
|
+
"type": "notification",
|
|
231
|
+
"message": "Plugin loaded successfully"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Hook Types
|
|
241
|
+
|
|
242
|
+
- **SessionStart**: Triggered when Claude session starts
|
|
243
|
+
- **SessionEnd**: Triggered when Claude session ends
|
|
244
|
+
- **PreToolUse**: Before tool execution
|
|
245
|
+
- **PostToolUse**: After tool execution
|
|
246
|
+
- **Stop**: When user stops generation
|
|
247
|
+
- **SubagentStop**: When subagent finishes
|
|
248
|
+
- **UserPromptSubmit**: Before processing user input
|
|
249
|
+
- **PreCompact**: Before session compaction
|
|
250
|
+
- **Notification**: For sending notifications
|
|
251
|
+
|
|
252
|
+
### Hook Implementation
|
|
253
|
+
|
|
254
|
+
Two hook types:
|
|
255
|
+
|
|
256
|
+
1. **Command Hooks**: Execute shell scripts
|
|
257
|
+
2. **Prompt Hooks**: LLM evaluates conditions
|
|
258
|
+
|
|
259
|
+
## MCP Servers
|
|
260
|
+
|
|
261
|
+
### MCP Configuration
|
|
262
|
+
|
|
263
|
+
Define in `.mcp.json` (root level) or `mcpServers` in manifest:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"mcpServers": {
|
|
268
|
+
"database": {
|
|
269
|
+
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/db_server.py",
|
|
270
|
+
"args": ["--port", "5432"],
|
|
271
|
+
"env": {
|
|
272
|
+
"DB_HOST": "localhost",
|
|
273
|
+
"DB_PORT": "5432"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Server Types
|
|
281
|
+
|
|
282
|
+
- **stdio**: Local command execution
|
|
283
|
+
- **sse**: Hosted server with OAuth
|
|
284
|
+
- **http**: REST API server
|
|
285
|
+
- **ws**: WebSocket real-time connection
|
|
286
|
+
|
|
287
|
+
### Portable Paths
|
|
288
|
+
|
|
289
|
+
Use `${CLAUDE_PLUGIN_ROOT}` for portable paths:
|
|
290
|
+
- Scripts: `${CLAUDE_PLUGIN_ROOT}/scripts/myscript.py`
|
|
291
|
+
- Config: `${CLAUDE_PLUGIN_ROOT}/config/settings.json`
|
|
292
|
+
|
|
293
|
+
## Security Best Practices
|
|
294
|
+
|
|
295
|
+
- No hardcoded credentials
|
|
296
|
+
- Use HTTPS/WSS for external connections
|
|
297
|
+
- Validate user inputs in hooks
|
|
298
|
+
- Follow principle of least privilege
|
|
299
|
+
- Use environment variables for secrets
|
|
300
|
+
|
|
301
|
+
## File Organization
|
|
302
|
+
|
|
303
|
+
### Required Files
|
|
304
|
+
|
|
305
|
+
- `plugin.json`: Plugin manifest
|
|
306
|
+
- Component files: At least one component (command, agent, or skill)
|
|
307
|
+
|
|
308
|
+
### Recommended Files
|
|
309
|
+
|
|
310
|
+
- `README.md`: Documentation and usage
|
|
311
|
+
- `LICENSE`: License file
|
|
312
|
+
- `.gitignore`: Exclude unnecessary files
|
|
313
|
+
|
|
314
|
+
### GitIgnore Pattern
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
# Claude Code
|
|
318
|
+
.claude-plugin/node_modules/
|
|
319
|
+
.claude-plugin/.env
|
|
320
|
+
.claude-plugin/*.local.md
|
|
321
|
+
|
|
322
|
+
# General
|
|
323
|
+
node_modules/
|
|
324
|
+
.DS_Store
|
|
325
|
+
*.log
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Auto-Discovery
|
|
329
|
+
|
|
330
|
+
Claude Code automatically discovers components:
|
|
331
|
+
|
|
332
|
+
1. **Commands**: All `.md` files in `commands/`
|
|
333
|
+
2. **Agents**: All `.md` files in `agents/`
|
|
334
|
+
3. **Skills**: All `SKILL.md` files in `skills/*/`
|
|
335
|
+
4. **Hooks**: `hooks/hooks.json` if present
|
|
336
|
+
5. **MCP Servers**: `.mcp.json` or manifest `mcpServers`
|
|
337
|
+
|
|
338
|
+
## Testing
|
|
339
|
+
|
|
340
|
+
### Local Testing
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
# Test plugin locally
|
|
344
|
+
claude plugin add /path/to/plugin-name
|
|
345
|
+
|
|
346
|
+
# Or use NPX
|
|
347
|
+
npx /path/to/plugin-name
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Validation
|
|
351
|
+
|
|
352
|
+
Use Claude Code's built-in validation:
|
|
353
|
+
- Check manifest syntax
|
|
354
|
+
- Verify component formats
|
|
355
|
+
- Test auto-discovery
|
|
356
|
+
- Validate hook schemas
|
|
357
|
+
|
|
358
|
+
## Distribution
|
|
359
|
+
|
|
360
|
+
### Marketplace Publishing
|
|
361
|
+
|
|
362
|
+
1. Create marketplace entry in repository
|
|
363
|
+
2. Submit to Claude Code marketplace
|
|
364
|
+
3. Include version changelog
|
|
365
|
+
4. Provide documentation
|
|
366
|
+
|
|
367
|
+
### Version Management
|
|
368
|
+
|
|
369
|
+
- Use semantic versioning
|
|
370
|
+
- Update manifest version
|
|
371
|
+
- Document breaking changes
|
|
372
|
+
- Maintain backward compatibility
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Command Format Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Commands are the primary way to provide reusable workflows in both Claude Code and OpenCode. While the frontmatter format differs between platforms, the core concepts and best practices remain the same.
|
|
6
|
+
|
|
7
|
+
## Platform Comparison
|
|
8
|
+
|
|
9
|
+
| Aspect | Claude Code | OpenCode | Canonical (content/) |
|
|
10
|
+
|---------|-------------|----------|------------------|
|
|
11
|
+
| **Frontmatter** | YAML block | YAML table | YAML block |
|
|
12
|
+
| **File Extension** | `.md` | `.md` | `.md` |
|
|
13
|
+
| **Arguments** | `$ARGUMENTS`, `$1`, `$2` | `$ARGUMENTS`, `$1`, `$2` | `$ARGUMENTS`, `$1`, `$2` |
|
|
14
|
+
| **File References** | `@file.txt` | `@file.txt` | `@file.txt` |
|
|
15
|
+
| **Shell Output** | Triple backticks | Exclamation marks | Exclamation marks |
|
|
16
|
+
| **Agent Specification** | `agent: name` | `agent: name` | `agent: name` |
|
|
17
|
+
| **Model Override** | `model: sonnet` | `model: sonnet` | `model: sonnet` |
|
|
18
|
+
| **Tool Restrictions** | `allowed-tools: [...]` | `tools: { read: true }` | `tools: { read: true }` |
|
|
19
|
+
|
|
20
|
+
## Canonical Format (content/)
|
|
21
|
+
|
|
22
|
+
Use this format in `content/commands/` for maximum compatibility:
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
---
|
|
26
|
+
name: my-command
|
|
27
|
+
description: Brief description of what this command does
|
|
28
|
+
agent: build # Optional: which agent handles this
|
|
29
|
+
subtask: true # Optional: run as subtask
|
|
30
|
+
model: sonnet # Optional: override model
|
|
31
|
+
temperature: 0.3 # Optional: override temperature
|
|
32
|
+
tools: # Optional: tool restrictions
|
|
33
|
+
read: true
|
|
34
|
+
write: true
|
|
35
|
+
---
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Claude Code Output
|
|
39
|
+
|
|
40
|
+
Build.ts transforms canonical to Claude Code format (YAML frontmatter):
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
---
|
|
44
|
+
name: my-command
|
|
45
|
+
description: Brief description of what this command does
|
|
46
|
+
agent: build
|
|
47
|
+
subtask: true
|
|
48
|
+
model: sonnet
|
|
49
|
+
temperature: 0.3
|
|
50
|
+
tools:
|
|
51
|
+
read: true
|
|
52
|
+
write: true
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
# Command Content
|
|
56
|
+
|
|
57
|
+
Command instructions here with $ARGUMENTS placeholder...
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## OpenCode Output
|
|
61
|
+
|
|
62
|
+
Build.ts transforms canonical to OpenCode format (table frontmatter):
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
| description | agent |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Brief description | build |
|
|
68
|
+
|
|
69
|
+
# Command Content
|
|
70
|
+
|
|
71
|
+
Command instructions here with $ARGUMENTS placeholder...
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Argument Handling
|
|
75
|
+
|
|
76
|
+
### Positional Arguments
|
|
77
|
+
|
|
78
|
+
Both platforms support positional arguments:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
/command arg1 arg2 arg3
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
- `$1` = "arg1"
|
|
85
|
+
- `$2` = "arg2"
|
|
86
|
+
- `$3` = "arg3"
|
|
87
|
+
|
|
88
|
+
### All Arguments String
|
|
89
|
+
|
|
90
|
+
Both platforms support the full arguments string:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
/command "multiple words as one argument"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- `$ARGUMENTS` = "multiple words as one argument"
|
|
97
|
+
|
|
98
|
+
### File References
|
|
99
|
+
|
|
100
|
+
Include file content in commands:
|
|
101
|
+
|
|
102
|
+
```markdown
|
|
103
|
+
---
|
|
104
|
+
name: review-config
|
|
105
|
+
description: Review configuration file
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
Review the configuration in @config.json:
|
|
109
|
+
|
|
110
|
+
Current settings:
|
|
111
|
+
!`cat config.json`
|
|
112
|
+
|
|
113
|
+
Recommendations:
|
|
114
|
+
...
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Shell Output
|
|
118
|
+
|
|
119
|
+
#### Claude Code
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
---
|
|
123
|
+
name: list-files
|
|
124
|
+
description: List files in directory
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
Files in current directory:
|
|
128
|
+
```bash
|
|
129
|
+
ls -la
|
|
130
|
+
```
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### OpenCode
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
| description | agent |
|
|
137
|
+
|---|---|
|
|
138
|
+
| List files in directory | build |
|
|
139
|
+
|
|
140
|
+
# List Files Command
|
|
141
|
+
|
|
142
|
+
Files in current directory:
|
|
143
|
+
!`ls -la`
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Agent Specification
|
|
147
|
+
|
|
148
|
+
### Claude Code
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
agent: build
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### OpenCode
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
| description | agent |
|
|
158
|
+
|---|---|
|
|
159
|
+
| Description here | build |
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Tool Restrictions
|
|
163
|
+
|
|
164
|
+
### Claude Code
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
tools:
|
|
168
|
+
- Read
|
|
169
|
+
- Write
|
|
170
|
+
- Bash
|
|
171
|
+
- Grep
|
|
172
|
+
- Glob
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### OpenCode
|
|
176
|
+
|
|
177
|
+
```yaml
|
|
178
|
+
tools:
|
|
179
|
+
read: true
|
|
180
|
+
write: true
|
|
181
|
+
bash: true
|
|
182
|
+
grep: true
|
|
183
|
+
glob: true
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Best Practices
|
|
187
|
+
|
|
188
|
+
### Command Design
|
|
189
|
+
|
|
190
|
+
1. **Clear Description**: Explain what command does in one sentence
|
|
191
|
+
2. **Specific Arguments**: Document expected arguments
|
|
192
|
+
3. **Agent Assignment**: Assign to appropriate agent when needed
|
|
193
|
+
4. **Error Handling**: Provide helpful error messages
|
|
194
|
+
5. **Examples**: Include usage examples in command content
|
|
195
|
+
|
|
196
|
+
### Writing Style
|
|
197
|
+
|
|
198
|
+
1. **Instructions FOR Claude**: Write as directives to Claude, not explanations to user
|
|
199
|
+
2. **Imperative Mood**: Use command form, not suggestive language
|
|
200
|
+
3. **Structured Output**: Define clear output format
|
|
201
|
+
4. **Context Awareness**: Reference project context when helpful
|
|
202
|
+
|
|
203
|
+
### Security
|
|
204
|
+
|
|
205
|
+
1. **Input Validation**: Validate arguments before processing
|
|
206
|
+
2. **Safe Shell**: Avoid dangerous shell commands
|
|
207
|
+
3. **File Access**: Check file permissions before reading
|
|
208
|
+
4. **No Secrets**: Never log or expose sensitive data
|
|
209
|
+
|
|
210
|
+
## Examples
|
|
211
|
+
|
|
212
|
+
### Simple Command
|
|
213
|
+
|
|
214
|
+
```yaml
|
|
215
|
+
---
|
|
216
|
+
name: status
|
|
217
|
+
description: Show git repository status
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
Check current git status:
|
|
221
|
+
|
|
222
|
+
!`git status`
|
|
223
|
+
|
|
224
|
+
Summary: [brief analysis]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Command with Agent
|
|
228
|
+
|
|
229
|
+
```yaml
|
|
230
|
+
---
|
|
231
|
+
name: analyze
|
|
232
|
+
description: Analyze code for performance issues
|
|
233
|
+
agent: performance-engineer
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
Analyze the current codebase for performance bottlenecks:
|
|
237
|
+
|
|
238
|
+
1. Check database queries
|
|
239
|
+
2. Review algorithmic complexity
|
|
240
|
+
3. Identify slow operations
|
|
241
|
+
|
|
242
|
+
Provide optimization recommendations.
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Interactive Command
|
|
246
|
+
|
|
247
|
+
```yaml
|
|
248
|
+
---
|
|
249
|
+
name: configure
|
|
250
|
+
description: Interactive project configuration
|
|
251
|
+
subtask: true
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
Let's configure your project step by step:
|
|
255
|
+
|
|
256
|
+
1. What type of project? (web/api/cli)
|
|
257
|
+
2. Which database? (postgres/mysql/nosql)
|
|
258
|
+
3. Deployment target? (aws/gcp/azure)
|
|
259
|
+
|
|
260
|
+
Configuration will be saved to config.json.
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Advanced Features
|
|
264
|
+
|
|
265
|
+
### Conditional Logic
|
|
266
|
+
|
|
267
|
+
```markdown
|
|
268
|
+
---
|
|
269
|
+
name: deploy
|
|
270
|
+
description: Deploy with environment-specific logic
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
!`if [ "$ENV" = "production" ]; then
|
|
274
|
+
echo "Deploying to production..."
|
|
275
|
+
# Production deployment steps
|
|
276
|
+
else
|
|
277
|
+
echo "Deploying to staging..."
|
|
278
|
+
# Staging deployment steps
|
|
279
|
+
fi
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Multiple Commands
|
|
283
|
+
|
|
284
|
+
```markdown
|
|
285
|
+
---
|
|
286
|
+
name: full-test
|
|
287
|
+
description: Run complete test suite
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
!`npm run lint
|
|
291
|
+
npm run test:unit
|
|
292
|
+
npm run test:integration
|
|
293
|
+
npm run test:e2e`
|
|
294
|
+
|
|
295
|
+
All tests completed with coverage report.
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Integration with Ferg System
|
|
299
|
+
|
|
300
|
+
### Existing Commands
|
|
301
|
+
|
|
302
|
+
- `/ai-eng/plan` - Implementation planning
|
|
303
|
+
- `/ai-eng/review` - Multi-perspective code review
|
|
304
|
+
- `/ai-eng/deploy` - Deployment automation
|
|
305
|
+
|
|
306
|
+
### Plugin-Dev Commands
|
|
307
|
+
|
|
308
|
+
- `/ai-eng/create-command` - Quick command creation
|
|
309
|
+
- `/ai-eng/create-agent` - Quick agent creation
|
|
310
|
+
- `/ai-eng/create-plugin` - Full plugin development workflow
|
|
311
|
+
|
|
312
|
+
All commands follow the same quality standards and use the build.ts transformation system.
|