Skip to content

Commit 789a17c

Browse files
cuipinghuoclaude
andcommitted
docs(EC-2039): document expected skill format in AGENTS.md
Adds a "Claude Code Skills" section to AGENTS.md documenting the expected format for .claude/skills/ definitions: YAML frontmatter with trigger phrases, numbered step-based runbook sections with bash commands, and a final report step. Lists anti-patterns (how-to guides, missing triggers, no commands) and points to run-tests as the canonical example. This prevents future skill authors from writing prose documentation instead of executable workflows, which caused a multi-day rewrite cycle on PR #3434. Resolves: https://redhat.atlassian.net/browse/EC-2039 Upstream: #3451 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent af3fe00 commit 789a17c

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,58 @@ Read these before modifying the corresponding areas:
9292
- [internal/validate/vsa/DESIGN.md](internal/validate/vsa/DESIGN.md) — VSA: storage backends, DSSE signing rationale, expiration model
9393
- [acceptance/README.md](acceptance/README.md) — acceptance test framework, Testcontainers, WireMock, snapshot testing
9494

95+
## Claude Code Skills
96+
97+
Skills live in `.claude/skills/<name>/SKILL.md`. They are **step-by-step executable workflows**
98+
that Claude Code follows to complete a task — not reference documentation, how-to guides, or
99+
API descriptions.
100+
101+
### Format
102+
103+
Every skill file has two parts:
104+
105+
**1. YAML frontmatter** with `name` (kebab-case, matches directory name) and `description`
106+
(multi-line string listing trigger phrases so Claude Code knows when to invoke the skill):
107+
108+
```yaml
109+
---
110+
name: my-skill
111+
description: >
112+
Short description. Use when users ask "trigger phrase 1", "trigger phrase 2",
113+
or need help with <topic>.
114+
---
115+
```
116+
117+
**2. Numbered step sections** — each `## Step N: Action` contains a brief explanation and
118+
fenced `bash` code blocks with the actual commands to run. The final step is always
119+
`## Step N: Report`, describing what to summarize to the user:
120+
121+
````markdown
122+
## Step 1: Do the first thing
123+
124+
Explanation of what this step accomplishes.
125+
126+
```bash
127+
make build
128+
```
129+
130+
## Step 2: Report
131+
132+
Summarize:
133+
- What happened
134+
- Pass/fail status
135+
- What needs attention
136+
````
137+
138+
### Anti-patterns
139+
140+
- **How-to guides or reference docs.** Skills are not documentation — they are runbooks.
141+
"Here's how you could run tests" is wrong; "Run these tests and report the results" is right.
142+
- **Missing trigger phrases.** Without them, Claude Code won't know when to invoke the skill.
143+
- **No bash code blocks.** Every action step should have concrete commands, not just prose.
144+
145+
See [.claude/skills/run-tests/SKILL.md](.claude/skills/run-tests/SKILL.md) as the canonical example.
146+
95147
## Troubleshooting
96148

97149
System-level issues that surface in acceptance tests:

0 commit comments

Comments
 (0)