Skill File Conventions
Intermediate
Standardize Claude Code skill files in .claude/skills/ with consistent structure, naming, parameter documentation, and expected output sections for reliable team-wide usage.
File Patterns
**/.claude/skills/**
This rule applies to files matching the patterns above.
Rule Content
rule-content.md
# Skill File Conventions
## Rule
All Claude Code skill files in `.claude/skills/` MUST follow the standard template with required sections. Use kebab-case filenames.
## Format
```
.claude/skills/
scaffold-component.md
generate-api-route.md
run-migration.md
write-tests.md
```
## Required Sections
```markdown
# Skill Name
## Description
One sentence explaining what this skill does.
## Parameters
- `name` (required): Description with expected format
- `path` (optional, default: src/): Target directory
## Preconditions
- [ ] Required tool/dependency is installed
- [ ] Target directory exists
## Steps
1. Step one with explanation
2. Step two with code example
3. Final step with verification
## Expected Output
- List of files created or modified
- Expected state after skill execution
```
## Naming Rules
1. **Filenames**: kebab-case, descriptive verb-noun: `scaffold-component.md`
2. **Skill names**: Title case, action-oriented: "Scaffold React Component"
3. **Parameters**: camelCase with type and default noted
## Good Example
```markdown
# Scaffold React Component
## Description
Creates a new React component with TypeScript, tests, and barrel export.
## Parameters
- `name` (required): Component name in PascalCase (e.g., UserProfile)
- `path` (optional, default: src/components): Target directory
## Preconditions
- [ ] Target directory exists
- [ ] No existing component with the same name
## Steps
1. Create component directory at {path}/{name}/
2. Generate {name}.tsx with typed props interface
3. Generate {name}.test.tsx with React Testing Library
4. Update or create index.ts barrel export
## Expected Output
- `{path}/{name}/{name}.tsx` — component file
- `{path}/{name}/{name}.test.tsx` — test file
- `{path}/{name}/index.ts` — barrel export
```
## Bad Example
- A skill file with just "Make a component" and no parameters
- Missing Expected Output section (user can't verify success)
- Hardcoded paths that only work on one developer's machine
- No precondition checks (skill fails silently)
## Enforcement
Review skill files during code review. Skills without all required sections should be rejected.FAQ
Discussion
Loading comments...