added workflows for claude commands and skills
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# Commands Best Practice
|
||||
|
||||
<br>
|
||||
<br>
|
||||
[](../implementation/claude-commands-implementation.md)
|
||||
|
||||
Complete reference for Claude Code commands — command definitions, frontmatter fields, and current built-in slash commands.
|
||||
Claude Code commands — frontmatter fields and official built-in slash commands.
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
@@ -14,9 +14,7 @@ Complete reference for Claude Code commands — command definitions, frontmatter
|
||||
|
||||
---
|
||||
|
||||
## Frontmatter Fields
|
||||
|
||||
Custom commands are defined in `.claude/commands/<name>.md` with optional YAML frontmatter.
|
||||
## Frontmatter Fields (4)
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
@@ -27,162 +25,69 @@ Custom commands are defined in `.claude/commands/<name>.md` with optional YAML f
|
||||
|
||||
---
|
||||
|
||||
## String Substitutions
|
||||
##  **(56)**
|
||||
|
||||
Available inside command markdown for dynamic values:
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `$ARGUMENTS` | All arguments passed when invoking the command |
|
||||
| `$ARGUMENTS[N]` | Access a specific argument by 0-based index |
|
||||
| `$N` | Shorthand for `$ARGUMENTS[N]` (e.g., `$0`, `$1`) |
|
||||
| `${CLAUDE_SESSION_ID}` | Current session identifier |
|
||||
| `` !`command` `` | Dynamic context injection — shell command output replaces the placeholder before Claude sees it |
|
||||
|
||||
---
|
||||
|
||||
## Invocation
|
||||
|
||||
Custom commands are invoked by typing `/command-name` in Claude Code's interactive mode:
|
||||
|
||||
| Method | Description |
|
||||
|--------|-------------|
|
||||
| `/command-name` | Invoke directly from the command menu |
|
||||
| `/command-name [args]` | Pass arguments that map to `$ARGUMENTS` |
|
||||
| Autocomplete | Type `/` to see all available commands with descriptions |
|
||||
| Subdirectories | Commands in subdirectories use `/subdir:command-name` |
|
||||
|
||||
---
|
||||
|
||||
## Example: Minimal Command
|
||||
|
||||
```yaml
|
||||
---
|
||||
description: Fetch weather data for Dubai and create an SVG weather card
|
||||
model: haiku
|
||||
---
|
||||
|
||||
Fetch the current temperature for Dubai, UAE and create a visual SVG weather card.
|
||||
```
|
||||
|
||||
## Example: Full-Featured Command (All Fields)
|
||||
|
||||
```yaml
|
||||
---
|
||||
description: Fix a GitHub issue by number, following team coding standards
|
||||
argument-hint: [issue-number]
|
||||
allowed-tools: Read, Edit, Write, Bash(gh *), Bash(npm test *)
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
Fix GitHub issue $0 following our coding standards.
|
||||
|
||||
## Context
|
||||
- PR diff: !`gh pr diff`
|
||||
- Issue details: !`gh issue view $0`
|
||||
|
||||
## Steps
|
||||
1. Read the issue description
|
||||
2. Understand the requirements
|
||||
3. Implement the fix
|
||||
4. Write tests
|
||||
5. Create a commit
|
||||
|
||||
Session: ${CLAUDE_SESSION_ID}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Scope and Priority
|
||||
|
||||
When multiple commands share the same name, the higher-priority location wins:
|
||||
|
||||
| Location | Scope | Priority |
|
||||
|----------|-------|----------|
|
||||
| Project (`.claude/commands/`) | This project only | 1 (highest) |
|
||||
| Personal (`~/.claude/commands/`) | All your projects | 2 |
|
||||
| Plugin (`<plugin>/commands/`) | Where plugin is enabled | 3 (lowest) |
|
||||
|
||||
---
|
||||
|
||||
## Claude Commands
|
||||
|
||||
### All Commands
|
||||
|
||||
Built-in slash commands available in Claude Code's interactive mode:
|
||||
|
||||
| Command | Tag | Description |
|
||||
|---------|-----|-------------|
|
||||
| `/add-dir` |  | Add additional working directories to the current session |
|
||||
| `/agents` |  | Manage custom subagents — view, create, edit, delete |
|
||||
| `/bug [description]` |  | Alias for `/feedback` |
|
||||
| `/chrome` |  | Manage Claude in Chrome browser integration |
|
||||
| `/clear` |  | Clear conversation history and start fresh |
|
||||
| `/compact [prompt]` |  | Compress conversation to free context window. Optional prompt focuses the compaction |
|
||||
| `/config` |  | Open the interactive settings interface with search |
|
||||
| `/context` |  | Visualize current context usage as a colored grid with token counts |
|
||||
| `/copy` |  | Copy the last assistant response to the clipboard |
|
||||
| `/cost` |  | Show token usage statistics for the current session |
|
||||
| `/desktop` |  | Connect to or manage the desktop companion app |
|
||||
| `/diff` |  | Review the current git diff in the active repo |
|
||||
| `/doctor` |  | Check the health of your Claude Code installation |
|
||||
| `/exit` |  | Exit the REPL |
|
||||
| `/export [filename]` |  | Export the current conversation to a file or clipboard |
|
||||
| `/extra-usage` |  | Configure pay-as-you-go overflow billing for subscription plans |
|
||||
| `/fast` |  | Toggle fast mode — same Opus 4.6 model with faster output |
|
||||
| `/feedback [description]` |  | Generate a GitHub issue URL for reporting bugs or feedback |
|
||||
| `/fork` |  | Fork the current conversation into a new session |
|
||||
| `/help` |  | Show slash-command help |
|
||||
| `/ide` |  | Connect to IDE integration |
|
||||
| `/init [prompt]` |  | Initialize a new project with a CLAUDE.md guide |
|
||||
| `/install-github-app` |  | Install the GitHub app for PR-linked workflows |
|
||||
| `/install-slack-app` |  | Install the Slack app for notifications and sharing |
|
||||
| `/keybindings` |  | Customize keyboard shortcuts per context and create chord sequences |
|
||||
| `/login` |  | Authenticate with Claude Code via OAuth |
|
||||
| `/logout` |  | Log out from Claude Code |
|
||||
| `/mcp` |  | Manage MCP server connections |
|
||||
| `/memory` |  | View and edit memory files |
|
||||
| `/mobile` |  | Connect to or manage the mobile companion app |
|
||||
| `/model` |  | Switch models (haiku, sonnet, opus) and adjust effort level |
|
||||
| `/output-style` |  | Pick an output style preset |
|
||||
| `/passes [number]` |  | Set the number of review passes for certain workflows |
|
||||
| `/permissions` |  | View or update tool permissions |
|
||||
| `/plan` |  | Enter read-only planning mode — suggests approaches without making changes |
|
||||
| `/pr-comments` |  | Review or reply to pull-request comments |
|
||||
| `/privacy-settings` |  | Manage privacy and telemetry preferences |
|
||||
| `/release-notes` |  | Show recent Claude Code release notes |
|
||||
| `/reload-plugins` |  | Reload installed plugins without restarting |
|
||||
| `/remote-control` |  | Continue the current session from another device |
|
||||
| `/remote-env` |  | Inspect or copy the remote-control environment setup |
|
||||
| `/rename <name>` |  | Rename the current session for easier identification |
|
||||
| `/resume [session]` |  | Resume a previous conversation by ID or name, or open the session picker |
|
||||
| `/review` |  | Review the current code changes |
|
||||
| `/rewind` |  | Rewind conversation and/or code to an earlier point |
|
||||
| `/sandbox` |  | Configure sandboxing with dependency status |
|
||||
| `/security-review` |  | Run a focused security review on current changes |
|
||||
| `/status` |  | Show a concise session status summary |
|
||||
| `/stats` |  | Visualize daily usage, session history, streaks, and model preferences |
|
||||
| `/statusline` |  | Set up Claude Code's status line UI |
|
||||
| `/stickers` |  | Choose sticker packs shown in the UI |
|
||||
| `/tasks` |  | List and manage background tasks |
|
||||
| `/terminal-setup` |  | Enable shift+enter for newlines in IDE terminals |
|
||||
| `/theme` |  | Change the color theme |
|
||||
| `/usage` |  | Show plan usage limits and rate limit status (subscription plans only) |
|
||||
| `/vim` |  | Enable vim-style editing mode |
|
||||
| # | Command | Tag | Description |
|
||||
|---|---------|-----|-------------|
|
||||
| 1 | `/login` |  | Authenticate with Claude Code via OAuth |
|
||||
| 2 | `/logout` |  | Log out from Claude Code |
|
||||
| 3 | `/config` |  | Open the interactive settings interface with search |
|
||||
| 4 | `/keybindings` |  | Customize keyboard shortcuts per context and create chord sequences |
|
||||
| 5 | `/output-style` |  | Pick an output style preset |
|
||||
| 6 | `/permissions` |  | View or update tool permissions |
|
||||
| 7 | `/privacy-settings` |  | Manage privacy and telemetry preferences |
|
||||
| 8 | `/sandbox` |  | Configure sandboxing with dependency status |
|
||||
| 9 | `/statusline` |  | Set up Claude Code's status line UI |
|
||||
| 10 | `/stickers` |  | Choose sticker packs shown in the UI |
|
||||
| 11 | `/terminal-setup` |  | Enable shift+enter for newlines in IDE terminals |
|
||||
| 12 | `/theme` |  | Change the color theme |
|
||||
| 13 | `/vim` |  | Enable vim-style editing mode |
|
||||
| 14 | `/context` |  | Visualize current context usage as a colored grid with token counts |
|
||||
| 15 | `/cost` |  | Show token usage statistics for the current session |
|
||||
| 16 | `/extra-usage` |  | Configure pay-as-you-go overflow billing for subscription plans |
|
||||
| 17 | `/status` |  | Show a concise session status summary |
|
||||
| 18 | `/stats` |  | Visualize daily usage, session history, streaks, and model preferences |
|
||||
| 19 | `/usage` |  | Show plan usage limits and rate limit status (subscription plans only) |
|
||||
| 20 | `/bug [description]` |  | Alias for `/feedback` |
|
||||
| 21 | `/doctor` |  | Check the health of your Claude Code installation |
|
||||
| 22 | `/feedback [description]` |  | Generate a GitHub issue URL for reporting bugs or feedback |
|
||||
| 23 | `/help` |  | Show slash-command help |
|
||||
| 24 | `/release-notes` |  | Show recent Claude Code release notes |
|
||||
| 25 | `/tasks` |  | List and manage background tasks |
|
||||
| 26 | `/copy` |  | Copy the last assistant response to the clipboard |
|
||||
| 27 | `/export [filename]` |  | Export the current conversation to a file or clipboard |
|
||||
| 28 | `/agents` |  | Manage custom subagents — view, create, edit, delete |
|
||||
| 29 | `/chrome` |  | Manage Claude in Chrome browser integration |
|
||||
| 30 | `/ide` |  | Connect to IDE integration |
|
||||
| 31 | `/mcp` |  | Manage MCP server connections |
|
||||
| 32 | `/reload-plugins` |  | Reload installed plugins without restarting |
|
||||
| 33 | `/memory` |  | View and edit memory files |
|
||||
| 34 | `/fast` |  | Toggle fast mode — same Opus 4.6 model with faster output |
|
||||
| 35 | `/model` |  | Switch models (haiku, sonnet, opus) and adjust effort level |
|
||||
| 36 | `/passes [number]` |  | Set the number of review passes for certain workflows |
|
||||
| 37 | `/plan` |  | Enter read-only planning mode — suggests approaches without making changes |
|
||||
| 38 | `/add-dir` |  | Add additional working directories to the current session |
|
||||
| 39 | `/diff` |  | Review the current git diff in the active repo |
|
||||
| 40 | `/init [prompt]` |  | Initialize a new project with a CLAUDE.md guide |
|
||||
| 41 | `/pr-comments` |  | Review or reply to pull-request comments |
|
||||
| 42 | `/review` |  | Review the current code changes |
|
||||
| 43 | `/security-review` |  | Run a focused security review on current changes |
|
||||
| 44 | `/desktop` |  | Connect to or manage the desktop companion app |
|
||||
| 45 | `/install-github-app` |  | Install the GitHub app for PR-linked workflows |
|
||||
| 46 | `/install-slack-app` |  | Install the Slack app for notifications and sharing |
|
||||
| 47 | `/mobile` |  | Connect to or manage the mobile companion app |
|
||||
| 48 | `/remote-control` |  | Continue the current session from another device |
|
||||
| 49 | `/remote-env` |  | Inspect or copy the remote-control environment setup |
|
||||
| 50 | `/clear` |  | Clear conversation history and start fresh |
|
||||
| 51 | `/compact [prompt]` |  | Compress conversation to free context window. Optional prompt focuses the compaction |
|
||||
| 52 | `/exit` |  | Exit the REPL |
|
||||
| 53 | `/fork` |  | Fork the current conversation into a new session |
|
||||
| 54 | `/rename <name>` |  | Rename the current session for easier identification |
|
||||
| 55 | `/resume [session]` |  | Resume a previous conversation by ID or name, or open the session picker |
|
||||
| 56 | `/rewind` |  | Rewind conversation and/or code to an earlier point |
|
||||
|
||||
Bundled skills such as `/debug` can also appear in the slash-command menu, but they are not built-in commands.
|
||||
|
||||
### Commands in This Repository
|
||||
|
||||
Custom commands defined in `.claude/commands/` for this project:
|
||||
|
||||
| Command | Description | Model |
|
||||
|---------|-------------|-------|
|
||||
| [`weather-orchestrator`](../.claude/commands/weather-orchestrator.md) | Fetch weather data for Dubai and create an SVG weather card | haiku |
|
||||
| [`workflows/best-practice/workflow-claude-settings`](../.claude/commands/workflows/best-practice/workflow-claude-settings.md) | Track Claude Code settings report changes and find what needs updating | — |
|
||||
| [`workflows/best-practice/workflow-claude-subagents`](../.claude/commands/workflows/best-practice/workflow-claude-subagents.md) | Track Claude Code subagents report changes and find what needs updating | — |
|
||||
| [`workflows/best-practice/workflow-concepts`](../.claude/commands/workflows/best-practice/workflow-concepts.md) | Update the README CONCEPTS section with the latest Claude Code features and concepts | — |
|
||||
|
||||
---
|
||||
|
||||
## Sources
|
||||
|
||||
Reference in New Issue
Block a user