Skill Tracer
Skills › Knowledge Work Plugins › create-cowork-plugin › component-schemas.md

component-schemas.md

396 lines · cowork-plugin-management/skills/create-cowork-plugin/references/component-schemas.md at 2574e29

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Component Schemas
2
3Detailed format specifications for every plugin component type. Reference this when implementing components in Phase 4.
4

Component Schemas

Detailed format specifications for every plugin component type. Reference this when implementing components in Phase 4.

Raw lines 1 to 4
5## Skills
6
7**Location**: `skills/skill-name/SKILL.md`
8**Format**: Markdown with YAML frontmatter
9

Skills

Location: skills/skill-name/SKILL.md Format: Markdown with YAML frontmatter

Raw lines 5 to 9
10### Frontmatter Fields
12| Field | Required | Type | Description |
13| ------------- | -------- | ------ | ------------------------------------------------------- |
14| `name` | Yes | String | Skill identifier (lowercase, hyphens; matches dir name) |
15| `description` | Yes | String | Third-person description with trigger phrases |
16| `metadata` | No | Map | Arbitrary key-value pairs (e.g., `version`, `author`) |

Frontmatter Fields

FieldRequiredTypeDescription
nameYesStringSkill identifier (lowercase, hyphens; matches dir name)
descriptionYesStringThird-person description with trigger phrases
metadataNoMapArbitrary key-value pairs (e.g., version, author)
Raw lines 10 to 17
18### Example Skill
20```yaml
21---
22name: api-design
23description: >
24 This skill should be used when the user asks to "design an API",
25 "create API endpoints", "review API structure", or needs guidance
26 on REST API best practices, endpoint naming, or request/response design.
27metadata:
28 version: "0.1.0"
29---
30```

Example Skill

---
name: api-design
description: >
  This skill should be used when the user asks to "design an API",
  "create API endpoints", "review API structure", or needs guidance
  on REST API best practices, endpoint naming, or request/response design.
metadata:
  version: "0.1.0"
---
Raw lines 18 to 31
32### Writing Style Rules
34- **Frontmatter description**: Third-person ("This skill should be used when..."), with specific trigger phrases in quotes.
35- **Body**: Imperative/infinitive form ("Parse the config file," not "You should parse the config file").
36- **Length**: Keep SKILL.md body under 3,000 words (ideally 1,500-2,000). Move detailed content to `references/`.

Writing Style Rules

  • Frontmatter description: Third-person ("This skill should be used when..."), with specific trigger phrases in quotes.
  • Body: Imperative/infinitive form ("Parse the config file," not "You should parse the config file").
  • Length: Keep SKILL.md body under 3,000 words (ideally 1,500-2,000). Move detailed content to references/.
Raw lines 32 to 37
38### Skill Directory Structure
40```
41skill-name/
42├── SKILL.md # Core knowledge (required)
43├── references/ # Detailed docs loaded on demand
44│ ├── patterns.md
45│ └── advanced.md
46├── examples/ # Working code examples
47│ └── sample-config.json
48└── scripts/ # Utility scripts
49 └── validate.sh
50```

Skill Directory Structure

skill-name/
├── SKILL.md              # Core knowledge (required)
├── references/           # Detailed docs loaded on demand
│   ├── patterns.md
│   └── advanced.md
├── examples/             # Working code examples
│   └── sample-config.json
└── scripts/              # Utility scripts
    └── validate.sh
Raw lines 38 to 51
52### Progressive Disclosure Levels
541. **Metadata** (always in context): name + description (~100 words)
552. **SKILL.md body** (when skill triggers): core knowledge (<5k words)
563. **Bundled resources** (as needed): references, examples, scripts (unlimited)

Progressive Disclosure Levels

  1. Metadata (always in context): name + description (~100 words)
  2. SKILL.md body (when skill triggers): core knowledge (<5k words)
  3. Bundled resources (as needed): references, examples, scripts (unlimited)
Raw lines 52 to 57
58## Agents
60**Location**: `agents/agent-name.md`
61**Format**: Markdown with YAML frontmatter

Agents

Location: agents/agent-name.md Format: Markdown with YAML frontmatter

Raw lines 58 to 62
63### Frontmatter Fields
65| Field | Required | Type | Description |
66| ------------- | -------- | ------ | --------------------------------------------------- |
67| `name` | Yes | String | Lowercase, hyphens, 3-50 chars |
68| `description` | Yes | String | Triggering conditions with `<example>` blocks |
69| `model` | Yes | String | `inherit`, `sonnet`, `opus`, or `haiku` |
70| `color` | Yes | String | `blue`, `cyan`, `green`, `yellow`, `magenta`, `red` |
71| `tools` | No | Array | Restrict to specific tools |

Frontmatter Fields

FieldRequiredTypeDescription
nameYesStringLowercase, hyphens, 3-50 chars
descriptionYesStringTriggering conditions with <example> blocks
modelYesStringinherit, sonnet, opus, or haiku
colorYesStringblue, cyan, green, yellow, magenta, red
toolsNoArrayRestrict to specific tools
Raw lines 63 to 72
73### Example Agent
75```markdown
76---
77name: code-reviewer
78description: Use this agent when the user asks for a thorough code review or wants detailed analysis of code quality, security, and best practices.
80<example>
81Context: User has just written a new module
82user: "Can you do a deep review of this code?"
83assistant: "I'll use the code-reviewer agent to provide a thorough analysis."
84<commentary>
85User explicitly requested a detailed review, which matches this agent's specialty.
86</commentary>
87</example>
89<example>
90Context: User is about to merge a PR
91user: "Review this before I merge"
92assistant: "Let me run a comprehensive review using the code-reviewer agent."
93<commentary>
94Pre-merge review benefits from the agent's structured analysis process.
95</commentary>
96</example>
98model: inherit
99color: blue
100tools: ["Read", "Grep", "Glob"]
101---
103You are a code review specialist focused on identifying issues across security, performance, maintainability, and correctness.
105**Your Core Responsibilities:**
1071. Analyze code structure and organization
1082. Identify security vulnerabilities
1093. Flag performance concerns
1104. Check adherence to best practices
112**Analysis Process:**
1141. Read all files in scope
1152. Identify patterns and anti-patterns
1163. Categorize findings by severity
1174. Provide specific remediation suggestions
119**Output Format:**
120Present findings grouped by severity (Critical, Warning, Info) with:
122- File path and line number
123- Description of the issue
124- Suggested fix
125```

Example Agent

---
name: code-reviewer
description: Use this agent when the user asks for a thorough code review or wants detailed analysis of code quality, security, and best practices.

<example>
Context: User has just written a new module
user: "Can you do a deep review of this code?"
assistant: "I'll use the code-reviewer agent to provide a thorough analysis."
<commentary>
User explicitly requested a detailed review, which matches this agent's specialty.
</commentary>
</example>

<example>
Context: User is about to merge a PR
user: "Review this before I merge"
assistant: "Let me run a comprehensive review using the code-reviewer agent."
<commentary>
Pre-merge review benefits from the agent's structured analysis process.
</commentary>
</example>

model: inherit
color: blue
tools: ["Read", "Grep", "Glob"]
---

You are a code review specialist focused on identifying issues across security, performance, maintainability, and correctness.

**Your Core Responsibilities:**

1. Analyze code structure and organization
2. Identify security vulnerabilities
3. Flag performance concerns
4. Check adherence to best practices

**Analysis Process:**

1. Read all files in scope
2. Identify patterns and anti-patterns
3. Categorize findings by severity
4. Provide specific remediation suggestions

**Output Format:**
Present findings grouped by severity (Critical, Warning, Info) with:

- File path and line number
- Description of the issue
- Suggested fix
Raw lines 73 to 126
127### Agent Naming Rules
129- 3-50 characters
130- Lowercase letters, numbers, hyphens only
131- Must start and end with alphanumeric
132- No underscores, spaces, or special characters

Agent Naming Rules

  • 3-50 characters
  • Lowercase letters, numbers, hyphens only
  • Must start and end with alphanumeric
  • No underscores, spaces, or special characters
Raw lines 127 to 133
134### Color Guidelines
136- Blue/Cyan: Analysis, review
137- Green: Success-oriented tasks
138- Yellow: Caution, validation
139- Red: Critical, security
140- Magenta: Creative, generation

Color Guidelines

  • Blue/Cyan: Analysis, review
  • Green: Success-oriented tasks
  • Yellow: Caution, validation
  • Red: Critical, security
  • Magenta: Creative, generation
Raw lines 134 to 141
142## Hooks
144**Location**: `hooks/hooks.json`
145**Format**: JSON

Hooks

Location: hooks/hooks.json Format: JSON

Raw lines 142 to 146
147### Available Events
149| Event | When it fires |
150| ------------------ | ------------------------------- |
151| `PreToolUse` | Before a tool call executes |
152| `PostToolUse` | After a tool call completes |
153| `Stop` | When Claude finishes a response |
154| `SubagentStop` | When a subagent finishes |
155| `SessionStart` | When a session begins |
156| `SessionEnd` | When a session ends |
157| `UserPromptSubmit` | When the user sends a message |
158| `PreCompact` | Before context compaction |
159| `Notification` | When a notification fires |

Available Events

EventWhen it fires
PreToolUseBefore a tool call executes
PostToolUseAfter a tool call completes
StopWhen Claude finishes a response
SubagentStopWhen a subagent finishes
SessionStartWhen a session begins
SessionEndWhen a session ends
UserPromptSubmitWhen the user sends a message
PreCompactBefore context compaction
NotificationWhen a notification fires
Raw lines 147 to 160
Starts an agent subagent :154
161### Hook Types
163**Prompt-based** (recommended for complex logic):
165```json
167 "type": "prompt",
168 "prompt": "Evaluate whether this file write follows project conventions: $TOOL_INPUT",
169 "timeout": 30
171```
173Supported events: Stop, SubagentStop, UserPromptSubmit, PreToolUse.
175**Command-based** (deterministic checks):
177```json
179 "type": "command",
180 "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh",
181 "timeout": 60
183```

Hook Types

Prompt-based (recommended for complex logic):

{
  "type": "prompt",
  "prompt": "Evaluate whether this file write follows project conventions: $TOOL_INPUT",
  "timeout": 30
}

Supported events: Stop, SubagentStop, UserPromptSubmit, PreToolUse.

Command-based (deterministic checks):

{
  "type": "command",
  "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh",
  "timeout": 60
}
Raw lines 161 to 184
Runs code scripts/validate.sh :180
185### Example hooks.json
187```json
189 "PreToolUse": [
190 {
191 "matcher": "Write|Edit",
192 "hooks": [
193 {
194 "type": "prompt",
195 "prompt": "Check that this file write follows project coding standards. If it violates standards, explain why and block.",
196 "timeout": 30
197 }
198 ]
199 }
200 ],
201 "SessionStart": [
202 {
203 "matcher": "",
204 "hooks": [
205 {
206 "type": "command",
207 "command": "cat ${CLAUDE_PLUGIN_ROOT}/context/project-context.md",
208 "timeout": 10
209 }
210 ]
211 }
212 ]
214```

Example hooks.json

{
  "PreToolUse": [
    {
      "matcher": "Write|Edit",
      "hooks": [
        {
          "type": "prompt",
          "prompt": "Check that this file write follows project coding standards. If it violates standards, explain why and block.",
          "timeout": 30
        }
      ]
    }
  ],
  "SessionStart": [
    {
      "matcher": "",
      "hooks": [
        {
          "type": "command",
          "command": "cat ${CLAUDE_PLUGIN_ROOT}/context/project-context.md",
          "timeout": 10
        }
      ]
    }
  ]
}
Raw lines 185 to 215
216### Hook Output Format (Command Hooks)
218Command hooks return JSON to stdout:
220```json
222 "decision": "block",
223 "reason": "File write violates naming convention"
225```
227Decisions: `approve`, `block`, `ask_user` (ask for confirmation).

Hook Output Format (Command Hooks)

Command hooks return JSON to stdout:

{
  "decision": "block",
  "reason": "File write violates naming convention"
}

Decisions: approve, block, ask_user (ask for confirmation).

Raw lines 216 to 228
229## MCP Servers
231**Location**: `.mcp.json` at plugin root
232**Format**: JSON

MCP Servers

Location: .mcp.json at plugin root Format: JSON

Raw lines 229 to 233
Uses an outside tool MCP :229
234### Server Types
236**stdio** (local process):
238```json
240 "mcpServers": {
241 "my-server": {
242 "command": "node",
243 "args": ["${CLAUDE_PLUGIN_ROOT}/servers/server.js"],
244 "env": {
245 "API_KEY": "${API_KEY}"
246 }
247 }
248 }
250```
252**SSE** (remote server, server-sent events transport):
254```json
256 "mcpServers": {
257 "asana": {
258 "type": "sse",
259 "url": "https://mcp.asana.com/sse"
260 }
261 }
263```
265**HTTP** (remote server, streamable HTTP transport):
267```json
269 "mcpServers": {
270 "api-service": {
271 "type": "http",
272 "url": "https://api.example.com/mcp",
273 "headers": {
274 "Authorization": "Bearer ${API_TOKEN}"
275 }
276 }
277 }
279```

Server Types

stdio (local process):

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["${CLAUDE_PLUGIN_ROOT}/servers/server.js"],
      "env": {
        "API_KEY": "${API_KEY}"
      }
    }
  }
}

SSE (remote server, server-sent events transport):

{
  "mcpServers": {
    "asana": {
      "type": "sse",
      "url": "https://mcp.asana.com/sse"
    }
  }
}

HTTP (remote server, streamable HTTP transport):

{
  "mcpServers": {
    "api-service": {
      "type": "http",
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${API_TOKEN}"
      }
    }
  }
}
Raw lines 234 to 280
281### Environment Variable Expansion
283All MCP configs support `${VAR_NAME}` substitution:
285- `${CLAUDE_PLUGIN_ROOT}` — plugin directory (always use for portability)
286- `${ANY_ENV_VAR}` — user environment variables
288Document all required environment variables in the plugin README.

Environment Variable Expansion

All MCP configs support ${VAR_NAME} substitution:

  • ${CLAUDE_PLUGIN_ROOT} — plugin directory (always use for portability)
  • ${ANY_ENV_VAR} — user environment variables

Document all required environment variables in the plugin README.

Raw lines 281 to 289
Uses an outside tool MCP :283
290### Directory Servers Without a URL
292Some MCP directory entries have no `url` because the endpoint is dynamic. Plugins can reference these servers by **name** instead — if the server name in the plugin's MCP config matches the directory entry name, it is treated the same as a URL match.

Directory Servers Without a URL

Some MCP directory entries have no url because the endpoint is dynamic. Plugins can reference these servers by name instead — if the server name in the plugin's MCP config matches the directory entry name, it is treated the same as a URL match.

Raw lines 290 to 293
Uses an outside tool MCP :292
294## Commands (Legacy)
296> **Prefer `skills/*/SKILL.md` for new plugins.** The Cowork UI now presents commands and skills as a single "Skills" concept. The `commands/` format still works, but only use it if you specifically need the single-file format with `$ARGUMENTS`/`$1` substitution and inline bash execution.
298**Location**: `commands/command-name.md`
299**Format**: Markdown with optional YAML frontmatter

Commands (Legacy)

**Prefer skills/*/SKILL.md for new plugins.** The Cowork UI now presents commands and skills as a single "Skills" concept. The commands/ format still works, but only use it if you specifically need the single-file format with $ARGUMENTS/$1 substitution and inline bash execution.

Location: commands/command-name.md Format: Markdown with optional YAML frontmatter

Raw lines 294 to 300
301### Frontmatter Fields
303| Field | Required | Type | Description |
304| --------------- | -------- | --------------- | --------------------------------------------------- |
305| `description` | No | String | Brief description shown in `/help` (under 60 chars) |
306| `allowed-tools` | No | String or Array | Tools the command can use |
307| `model` | No | String | Model override: `sonnet`, `opus`, `haiku` |
308| `argument-hint` | No | String | Documents expected arguments for autocomplete |

Frontmatter Fields

FieldRequiredTypeDescription
descriptionNoStringBrief description shown in /help (under 60 chars)
allowed-toolsNoString or ArrayTools the command can use
modelNoStringModel override: sonnet, opus, haiku
argument-hintNoStringDocuments expected arguments for autocomplete
Raw lines 301 to 309
310### Example Command
312```markdown
313---
314description: Review code for security issues
315allowed-tools: Read, Grep, Bash(git:*)
316argument-hint: [file-path]
317---
319Review @$1 for security vulnerabilities including:
321- SQL injection
322- XSS attacks
323- Authentication bypass
324- Insecure data handling
326Provide specific line numbers, severity ratings, and remediation suggestions.
327```

Example Command

---
description: Review code for security issues
allowed-tools: Read, Grep, Bash(git:*)
argument-hint: [file-path]
---

Review @$1 for security vulnerabilities including:

- SQL injection
- XSS attacks
- Authentication bypass
- Insecure data handling

Provide specific line numbers, severity ratings, and remediation suggestions.
Raw lines 310 to 328
329### Key Rules
331- Commands are instructions FOR Claude, not messages for the user. Write them as directives.
332- `$ARGUMENTS` captures all arguments as a single string; `$1`, `$2`, `$3` capture positional arguments.
333- `@path` syntax includes file contents in the command context.
334- `!` backtick syntax executes bash inline for dynamic context (e.g., `` !`git diff --name-only` ``).
335- Use `${CLAUDE_PLUGIN_ROOT}` to reference plugin files portably.

Key Rules

  • Commands are instructions FOR Claude, not messages for the user. Write them as directives.
  • $ARGUMENTS captures all arguments as a single string; $1, $2, $3 capture positional arguments.
  • @path syntax includes file contents in the command context.
  • ! backtick syntax executes bash inline for dynamic context (e.g., ` !git diff --name-only `).
  • Use ${CLAUDE_PLUGIN_ROOT} to reference plugin files portably.
Raw lines 329 to 336
337### allowed-tools Patterns
339```yaml
340# Specific tools
341allowed-tools: Read, Write, Edit, Bash(git:*)
343# Bash with specific commands only
344allowed-tools: Bash(npm:*), Read
346# MCP tools (specific)
347allowed-tools: ["mcp__plugin_name_server__tool_name"]
348```

allowed-tools Patterns

# Specific tools
allowed-tools: Read, Write, Edit, Bash(git:*)

# Bash with specific commands only
allowed-tools: Bash(npm:*), Read

# MCP tools (specific)
allowed-tools: ["mcp__plugin_name_server__tool_name"]
Raw lines 337 to 349
Uses an outside tool MCP :346
Uses an outside tool mcp__plugin_name_server__tool_name :347
350## CONNECTORS.md
352**Location**: Plugin root
353**When to create**: When the plugin references external tools by category rather than specific product

CONNECTORS.md

Location: Plugin root When to create: When the plugin references external tools by category rather than specific product

Raw lines 350 to 354
355### Format
357```markdown
358# Connectors
360## How tool references work
362Plugin files use `~~category` as a placeholder for whatever tool the user
363connects in that category. For example, `~~project tracker` might mean
364Asana, Linear, Jira, or any other project tracker with an MCP server.
366Plugins are tool-agnostic — they describe workflows in terms of categories
367rather than specific products.
369## Connectors for this plugin
371| Category | Placeholder | Included servers | Other options |
372| --------------- | ------------------- | ---------------- | ------------------------ |
373| Chat | `~~chat` | Slack | Microsoft Teams, Discord |
374| Project tracker | `~~project tracker` | Linear | Asana, Jira, Monday |
375```

Format

# Connectors

## How tool references work

Plugin files use `~~category` as a placeholder for whatever tool the user
connects in that category. For example, `~~project tracker` might mean
Asana, Linear, Jira, or any other project tracker with an MCP server.

Plugins are tool-agnostic — they describe workflows in terms of categories
rather than specific products.

## Connectors for this plugin

| Category        | Placeholder         | Included servers | Other options            |
| --------------- | ------------------- | ---------------- | ------------------------ |
| Chat            | `~~chat`            | Slack            | Microsoft Teams, Discord |
| Project tracker | `~~project tracker` | Linear           | Asana, Jira, Monday      |
Raw lines 355 to 376
Uses an outside tool ~~category :362
Uses an outside tool ~~project :363
Uses an outside tool MCP :364
Uses an outside tool ~~chat :373
377### Using ~~ Placeholders
379In plugin files (skills, agents), reference tools generically:
381```markdown
382Check ~~project tracker for open tickets assigned to the user.
383Post a summary to ~~chat in the team channel.
384```
386During customization (via the cowork-plugin-customizer skill), these get replaced with specific tool names.

Using ~~ Placeholders

In plugin files (skills, agents), reference tools generically:

Check ~~project tracker for open tickets assigned to the user.
Post a summary to ~~chat in the team channel.

During customization (via the cowork-plugin-customizer skill), these get replaced with specific tool names.

Raw lines 377 to 387
Uses an outside tool ~~project :382
Uses an outside tool ~~chat :383
Names a skill cowork-plugin-customizer :386
388## README.md
390Every plugin should include a README with:
3921. **Overview** — what the plugin does
3932. **Components** — list of skills, agents, hooks, MCP servers
3943. **Setup** — any required environment variables or configuration
3954. **Usage** — how to trigger each skill
3965. **Customization** — if CONNECTORS.md exists, mention it

README.md

Every plugin should include a README with:

  1. Overview — what the plugin does
  2. Components — list of skills, agents, hooks, MCP servers
  3. Setup — any required environment variables or configuration
  4. Usage — how to trigger each skill
  5. Customization — if CONNECTORS.md exists, mention it
Raw lines 388 to 396
Uses an outside tool MCP :393