@@ -578,6 +578,35 @@ api-toolkit lint openapi.yaml
578578
579579---
580580
581+ ### 📋 Frontmatter Fields (YAML Metadata)
582+
583+ All slash commands support frontmatter metadata (inspired by [Claude Code slash commands](https://code.claude.com/docs/en/slash-commands)):
584+
585+ | Field | Required | Description | Example |
586+ |-------|----------|-------------|---------|
587+ | `description` | ✅ Yes | Brief description (shown in `/help`) | `"Create feature specification"` |
588+ | `argument-hint` | ⚠️ Recommended | Show expected arguments | `[feature-description]` or `[pr-number] [priority]` |
589+ | `scripts` | Optional | Cross-platform scripts | `sh: scripts/bash/script.sh`<br >`ps: scripts/powershell/script.ps1` |
590+ | `allowed-tools` | Optional | Restrict tools (security) | `Bash(git:*), FileEdit(specs/*)` |
591+ | `model` | Optional | Specify AI model | `claude-3-5-sonnet-20241022` |
592+
593+ **Argument Access Patterns**:
594+ - `$ARGUMENTS` - All arguments as single string (e.g., "arg1 arg2 arg3")
595+ - `$1`, `$2`, `$3` - Individual positional arguments (like shell scripts)
596+ - `{ARGS}` - Escaped for safe script execution
597+
598+ **Example frontmatter**:
599+ \```yaml
600+ ---
601+ description: Review pull request with priority
602+ argument-hint: [pr-number] [priority] [assignee]
603+ allowed-tools: Bash(git:*), FileEdit(docs/*)
604+ model: claude-3-5-sonnet-20241022
605+ ---
606+ \```
607+
608+ ---
609+
581610### 🎯 Dual-Source Architecture (Composable Spec Systems)
582611
583612**IMPORTANT**: Slash Commands come from **TWO sources** and can be **composed**:
@@ -942,8 +971,27 @@ Based on your toolkit functions (from **Component 3, STEP 1: Define Toolkit Type
942971##### Template 1: Pure-Execution Slash Commands (Most Common)
943972
944973```markdown
974+ ---
975+ description: Brief description of what this command does
976+ argument-hint: [arg1] [arg2] # Optional: show expected arguments
977+ allowed-tools: Bash(git:*), FileEdit(specs/*) # Optional: restrict tools
978+ model: claude-3-5-sonnet-20241022 # Optional: specify model
979+ ---
980+
945981# /{toolkit-name}.{command}
946982
983+ ## User Input
984+
985+ \```text
986+ $ARGUMENTS
987+ \```
988+
989+ You **MUST** consider the user input before proceeding (if not empty).
990+
991+ **Argument Access**:
992+ - `$ARGUMENTS` - All arguments as single string
993+ - `$1`, `$2`, `$3` - Individual positional arguments
994+
947995## Purpose
948996[What protocol-compliant output to produce]
949997
@@ -1005,14 +1053,43 @@ User can validate output independently:
10051053##### Template 2: Script-Assisted Slash Commands (Spec-Kit Pattern)
10061054
10071055```markdown
1056+ ---
1057+ description: Brief description of what this command does
1058+ argument-hint: [arg1] [arg2] # Optional: show expected arguments
1059+ scripts:
1060+ sh: scripts/bash/{script-name}.sh --json "{ARGS}"
1061+ ps: scripts/powershell/{script-name}.ps1 -Json "{ARGS}"
1062+ allowed-tools: Bash(*), FileEdit(*) # Scripts need broader permissions
1063+ model: claude-3-5-sonnet-20241022 # Optional: specify model
1064+ ---
1065+
10081066# /{toolkit-name}.{command}
10091067
1068+ ## User Input
1069+
1070+ \```text
1071+ $ARGUMENTS
1072+ \```
1073+
1074+ You **MUST** consider the user input before proceeding (if not empty).
1075+
1076+ **Argument Access**:
1077+ - `$ARGUMENTS` - All arguments as single string
1078+ - `$1`, `$2`, `$3` - Individual positional arguments
1079+ - `{ARGS}` - Escaped for script execution
1080+
10101081## Purpose
10111082[What to produce, with script handling setup]
10121083
10131084## Helper Script
1085+
1086+ **Cross-platform execution**:
10141087\```bash
1015- scripts/{script-name}.sh --args
1088+ # Linux/Mac
1089+ scripts/bash/{script-name}.sh --json "$ARGUMENTS"
1090+
1091+ # Windows
1092+ scripts/powershell/{script-name}.ps1 -Json "$ARGUMENTS"
10161093\```
10171094
10181095**Script Purpose**: Set up file structure, create skeleton
@@ -1056,8 +1133,25 @@ scripts/{script-name}.sh --args
10561133**Purpose**: Remind AI to suggest CLI validation after production
10571134
10581135```markdown
1136+ ---
1137+ description: Validate output against protocol specifications
1138+ argument-hint: [file-to-validate] # Optional: show expected arguments
1139+ allowed-tools: Bash({toolkit-name}:validate:*) # Only allow validation tools
1140+ model: claude-3-5-haiku-20241022 # Can use lighter model for simple reminders
1141+ ---
1142+
10591143# /{toolkit-name}.validate
10601144
1145+ ## User Input
1146+
1147+ \```text
1148+ $ARGUMENTS
1149+ \```
1150+
1151+ **Argument Access**:
1152+ - `$1` - File to validate (if provided)
1153+ - `$ARGUMENTS` - All arguments
1154+
10611155## Purpose
10621156Remind AI to suggest validation after producing content
10631157
0 commit comments