Add new frontmatter fields from Claude Code 2.1.0
Update documentation and apply new frontmatter capabilities: Documentation: - Add user-invocable, context, agent, hooks fields to writing-skills.md - Add disallowedTools, permissionMode, hooks fields to writing-agents.md - Add model, context, hooks, allowed-tools fields to writing-commands.md - Document skill hot-reload, built-in agents, background execution Skills: - Add user-invocable: false to gitea (CLI reference) - Add user-invocable: false to repo-conventions (standards reference) Commands: - Add context: fork to heavy exploration commands (improve, plan-issues, create-repo, update-claude-md) - Add missing argument-hint to roadmap, manifesto, improve Agents: - Add disallowedTools: [Edit, Write] to code-reviewer for safety Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,10 +43,21 @@ argument-hint: <required-arg> [optional-arg]
|
||||
---
|
||||
```
|
||||
|
||||
| Field | Purpose | Required |
|
||||
|-------|---------|----------|
|
||||
| `description` | One-line summary for help/listings | Yes |
|
||||
| `argument-hint` | Shows expected arguments | If arguments needed |
|
||||
#### Required Fields
|
||||
|
||||
| Field | Purpose |
|
||||
|-------|---------|
|
||||
| `description` | One-line summary for help/listings |
|
||||
|
||||
#### Optional Fields
|
||||
|
||||
| Field | Purpose |
|
||||
|-------|---------|
|
||||
| `argument-hint` | Shows expected arguments (e.g., `<issue-number>`, `[title]`) |
|
||||
| `model` | Model to use: `haiku`, `sonnet`, `opus`. Overrides session default. |
|
||||
| `context` | Execution context. Use `fork` to run in isolated sub-agent context. |
|
||||
| `hooks` | Define PreToolUse, PostToolUse, or Stop hooks scoped to this command. |
|
||||
| `allowed-tools` | Restrict which tools the command can use. |
|
||||
|
||||
### 2. Body (Markdown Instructions)
|
||||
|
||||
@@ -83,6 +94,50 @@ argument-hint: <issue-number>
|
||||
7. **Create PR** with title "[Issue #$1] <title>" and body "Closes #$1"
|
||||
```
|
||||
|
||||
## Advanced Frontmatter Examples
|
||||
|
||||
**Command with specific model:**
|
||||
```yaml
|
||||
---
|
||||
description: Plan complex feature implementation.
|
||||
argument-hint: <feature-description>
|
||||
model: opus
|
||||
---
|
||||
```
|
||||
|
||||
**Command with isolated context (prevents context pollution):**
|
||||
```yaml
|
||||
---
|
||||
description: Analyze codebase architecture deeply.
|
||||
context: fork
|
||||
model: haiku
|
||||
---
|
||||
```
|
||||
|
||||
**Command with hooks:**
|
||||
```yaml
|
||||
---
|
||||
description: Deploy to production environment.
|
||||
hooks:
|
||||
- type: PreToolUse
|
||||
matcher: Bash
|
||||
command: echo "Validating deployment command..."
|
||||
- type: Stop
|
||||
command: ./scripts/notify-deployment.sh
|
||||
---
|
||||
```
|
||||
|
||||
**Read-only command with tool restrictions:**
|
||||
```yaml
|
||||
---
|
||||
description: Generate codebase report without modifications.
|
||||
allowed-tools:
|
||||
- Read
|
||||
- Glob
|
||||
- Grep
|
||||
---
|
||||
```
|
||||
|
||||
## Argument Handling
|
||||
|
||||
Commands can accept arguments from the user. Arguments are passed via positional variables: `$1`, `$2`, etc.
|
||||
@@ -643,16 +698,29 @@ Update references:
|
||||
|
||||
## Checklist: Before Submitting a New Command
|
||||
|
||||
### Structure
|
||||
- [ ] File is at `commands/<name>.md`
|
||||
- [ ] Name follows kebab-case verb convention
|
||||
- [ ] Frontmatter includes description
|
||||
- [ ] Frontmatter includes argument-hint (if arguments needed)
|
||||
|
||||
### Frontmatter (Required)
|
||||
- [ ] `description` is set with clear one-line summary
|
||||
- [ ] `argument-hint` is set (if command takes arguments)
|
||||
|
||||
### Frontmatter (Consider)
|
||||
- [ ] `model` if command benefits from specific model (e.g., `opus` for complex planning)
|
||||
- [ ] `context: fork` if command does heavy exploration that would pollute context
|
||||
- [ ] `allowed-tools` if command should be restricted to certain tools
|
||||
- [ ] `hooks` if command needs validation or post-execution actions
|
||||
|
||||
### Content
|
||||
- [ ] Workflow steps are clear and numbered
|
||||
- [ ] Commands and tools are specified explicitly
|
||||
- [ ] Skills are included via `@~/.claude/skills/<name>/SKILL.md` file references
|
||||
- [ ] Approval points exist before significant actions
|
||||
- [ ] Edge cases are handled (no data, invalid input)
|
||||
- [ ] Output formatting is specified
|
||||
|
||||
### Integration
|
||||
- [ ] ARCHITECTURE.md is updated with new command
|
||||
|
||||
## See Also
|
||||
|
||||
Reference in New Issue
Block a user