rulesync/GitHub/Issue/25/10/Custom Claude Code Command Yaml Frontmatter i413
Properties
- tags
- GitHub/Issue/My, Claude/Code/Command/Slash/Custom
Feature request: for claude code slash commands, support passing through claude-code-specific yaml markdown frontmatter keys to the generated command markdown files · Issue #413 · dyoshikawa/rulesync
Original Poster
Feature Request: Support Claude Code-Specific YAML Frontmatter Keys for Commands
NOTE: this feature request was drafted with the assistance of this deepwiki thread.Summary
Currently, rulesync commands defined in.rulesync/commands/*.mdonly support a minimal frontmatter schema withdescriptionas the only field that gets passed through to Claude Code slash commands. However, Claude Code's native slash command format supports additional YAML frontmatter keys likeallowed-tools,argument-hint,model, anddisable-model-invocationthat enable powerful command customization. This feature request proposes adding support for passing through these Claude Code-specific keys from rulesync command definitions to generated Claude Code command files.Current Limitation
When converting fromRulesyncCommandtoClaudecodeCommand, only thedescriptionfield is extracted and passed through. TheClaudecodeCommandschema itself only definesdescriptionin its frontmatter, meaning there's no mechanism to specify tool-specific configuration likeallowed-toolsormodel.Precedent: Subagents Already Support This Pattern
Interestingly, rulesync subagents already implement a solution to this exact problem. TheRulesyncSubagentfrontmatter schema includes aclaudecode:section that allows tool-specific configuration. This configuration gets properly passed through during conversion toClaudecodeSubagent.Proposed Feature Specification
1. Extend RulesyncCommand Frontmatter Schema
Add aclaudecode:section to theRulesyncCommandFrontmatterschema (similar to how subagents work)<cite />:
yaml--- description: "Create a git commit" claudecode: allowed-tools: "Bash(git add:*), Bash(git status:*), Bash(git commit:*)" argument-hint: "[message]" model: "claude-3-5-haiku-20241022" disable-model-invocation: false --- Create a git commit with message: $ARGUMENTS2. Supported Claude Code Keys
Theclaudecode:section should support all Claude Code-specific frontmatter keys:allowed-tools: Restrict which tools the command can use (e.g.,"Bash(git add:*), Bash(git status:*)")argument-hint: Display hint for command arguments (e.g.,"[message]"or"[pr-number] [priority] [assignee]")model: Specify which Claude model to use (e.g.,"claude-3-5-haiku-20241022")disable-model-invocation: Whether to preventSlashCommandtool from calling this command3. Conversion Behavior
When generating Claude Code commands viarulesync generate --targets claudecode --features commands<cite />:
Extract the
claudecode:section from the rulesync command frontmatterMerge these keys into the generated Claude Code command's YAML frontmatter
Preserve the
descriptionfield at the top level (as it currently works)For other tool targets (Cursor, Roo, etc.), ignore the
claudecode:section
4. Backward Compatibility
- Existing commands without a
claudecode:section should continue to work as they do today - The
descriptionfield should remain at the top level of frontmatter for all tools - Other tool-specific sections (e.g.,
roo:,cursor:) could be added in the future following the same pattern Example Usage
Input:.rulesync/commands/git-commit.mdyaml--- description: "Create a git commit" claudecode: allowed-tools: "Bash(git add:*), Bash(git status:*), Bash(git commit:*)" argument-hint: "[message]" model: "claude-3-5-haiku-20241022" --- Create a git commit with message: $ARGUMENTS
Output:.claude/commands/git-commit.md(afterrulesync generate)yaml--- allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*) argument-hint: [message] description: Create a git commit model: claude-3-5-haiku-20241022 --- Create a git commit with message: $ARGUMENTSBenefits
Feature Parity: Commands would have the same tool-specific configuration capabilities that subagents already have<cite />
Full Claude Code Support: Users could leverage all Claude Code slash command features through rulesync
Consistent Pattern: Follows the established
claudecode:section pattern used by subagentsExtensibility: The pattern could be extended to other tools (e.g.,
roo:,cursor:) in the future
Notes
- The Roo command implementation already supports
argument-hintas a top-level field, but this is tool-specific rather than following a general pattern - This feature would make commands a first-class citizen alongside subagents in terms of tool-specific configuration support
- Global mode currently supports commands for Claude Code, so this feature would enhance that capability as well