slashcommandcreator
Autonomous meta-skill for creating high-quality custom slash commands using 5-phase workflow with multi-agent validation and quality gates. Use when user requests new slash command, reusable prompt automation, or wants to convert repetitive workflows into documented commands.
- License 许可
- MIT
- 最近更新
- 2026-03-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- slashcommandcreator
- model
- claude-opus-4-5
- agents
- [ "architect", "security", "critic", "independent-thinker", "implementer" ]
- license
- MIT
- metadata
- { "version": "1.0.0", "timelessness": "high" }
- description
- Autonomous meta-skill for creating high-quality custom slash commands using 5-phase workflow with multi-agent validation and quality gates. Use when user requests new slash command, reusable prompt automation, or wants to convert repetitive workflows into documented commands.
02 资源文件 14
- 参考文档references/component.md6.2 KB
- 参考文档references/di.md7.7 KB
- 参考文档references/directives.md10.2 KB
- 参考文档references/forms.md10.0 KB
- 参考文档references/gotchas.md4.2 KB
- 参考文档references/http.md8.2 KB
- 参考文档references/routing.md8.4 KB
- 参考文档references/signals.md6.9 KB
- 参考文档references/ssr.md10.5 KB
- 参考文档references/testing.md10.9 KB
- 参考文档references/tooling.md9.1 KB
- 脚本scripts/new_slash_command.ts3.1 KB
- 脚本scripts/validate_slash_command.ts6.1 KB
- 脚本tests/test_validate_slash_command.ts8.1 KB
03 SKILL.md 正文
SlashCommandCreator Skill
Purpose
Create production-ready custom slash commands following ai-agents quality standards.
Triggers
create slash command for [purpose]SlashCommandCreator: [description]design slash command that [does something]
When to Use
- User requests "create slash command for [purpose]"
- Repetitive prompts identified in workflow
- Converting manual workflows to automation
- Need reusable, documented command patterns
5-Phase Workflow
Phase 1: Discovery & Analysis
Agent Mode: Analyst
Tasks:
- Clarify user intent: What prompt is being repeated?
- Search existing commands:
ls .claude/commands/**/*.md - Decision: Slash command vs skill (see decision matrix in CLAUDE.md)
- Apply 11 thinking models from skillcreator framework
- Document findings in
.agents/analysis/slashcommand-[name]-analysis.md
Deliverable: Analysis document with recommendation
Phase 2: Design
Agent Mode: Architect
Tasks:
- Command naming (namespace conventions)
- Argument design:
- Simple commands: use
$ARGUMENTS - Complex commands: use
$1,$2,$3(positional)
- Simple commands: use
- Frontmatter schema:
description(trigger-based per creator-001)argument-hint(if using arguments)allowed-tools(if using bash commands with!or file references with@)model(opus for complex reasoning)disable-model-invocation(if pure prompt template)
- Dynamic context evaluation:
- Bash execution (
!git log --oneline -5) - File references (
@.agents/HANDOFF.md)
- Bash execution (
- Extended thinking evaluation:
- Add
ultrathinkkeyword for complex reasoning (>5 steps) - Token budget consideration (<31,999 tokens)
- Add
Deliverable: Design specification with frontmatter + prompt
Phase 3: Multi-Agent Validation
Agent Mode: Orchestrator (coordinates 4 agents)
Agents:
-
Security:
- Review
allowed-toolsconstraints - Flag overly permissive wildcards
- Verify bash commands are safe
- Review
-
Architect:
- Check for duplication (similar existing commands)
- Verify appropriate scope (not too broad/narrow)
- Validate namespace conventions
-
Independent-Thinker:
- Challenge necessity: Is this really needed?
- Propose alternatives
- Question assumptions
-
Critic:
- Frontmatter completeness check
- Trigger-based description validation
- Argument-hint clarity
Unanimous Approval Required: All 4 agents must approve.
<!-- WHY: Ensures no single agent dimension (security, scope, necessity, completeness) is overlooked. Prevents security vulnerabilities from passing due to focus on functionality alone. Pattern proven by skillcreator 3.2.0 multi-agent synthesis. -->
Invocation Pattern:
// Security review
Agent(subagent_type="security", prompt="Review allowed-tools for command: [spec]")
// Architecture review
Agent(subagent_type="architect", prompt="Check for duplication: [spec]")
// Challenge necessity
Agent(subagent_type="independent-thinker", prompt="Is this command truly needed? [spec]")
// Frontmatter completeness
Agent(subagent_type="critic", prompt="Validate frontmatter completeness: [spec]")
Deliverable: Validation report with approvals or revision requests
Phase 4: Implementation
Agent Mode: Implementer
Tasks:
- Run
bun run ${CLAUDE_SKILL_DIR}/scripts/new_slash_command.ts - Create
.claude/commands/[namespace]/[command].md - Write frontmatter + prompt body
- Test invocation with sample arguments
- Update command catalog (if exists)
Deliverable: Working slash command file
Phase 5: Quality Gates (Automatic)
Agent Mode: Implementer (automatic validation)
Tasks:
- Run
bun run ${CLAUDE_SKILL_DIR}/scripts/validate_slash_command.ts --path [file] - Fix violations if any
- Re-run validation until exit code 0
- Commit with conventional commit message
Deliverable: Validated slash command ready for use
Invocation Examples
SlashCommandCreator: create command for exporting Brain memories to JSON
SlashCommandCreator: design slash command for running security audit
create slash command that summarizes recent PR comments
Decision Matrix: Slash Command vs Skill
Use Slash Command When:
- Prompt is <200 lines
- No multi-step conditional logic
- Simple argument substitution
- No external script orchestration
Use Skill When:
- Prompt is >200 lines
- Multi-agent coordination required
- Complex scripting logic
- Requires dedicated tests
Verification/Success Criteria
Before marking complete:
- [ ] Frontmatter has
description(trigger-based) - [ ] Frontmatter has
argument-hint(if uses arguments) - [ ] Frontmatter has
allowed-tools(if uses bash/file refs) - [ ] No overly permissive wildcards in
allowed-tools - [ ] Description follows trigger-based pattern (creator-001)
- [ ] File is <200 lines (or converted to skill)
- [ ] Passes
markdownlint-cli2validation - [ ] Passes
validate_slash_command.tsvalidation - [ ] Tested with sample arguments
- [ ] Committed with conventional commit message
Success Criteria:
| Metric | Target |
|---|---|
| Validation | Exit code 0 from validate_slash_command.ts |
| Testing | Command runs without errors with sample arguments |
| Documentation | Description clearly explains when to use command |
| Security | All bash/file refs have explicit allowed-tools entries |
Anti-Patterns
| Avoid | Why | Instead |
|---|---|---|
| Creating commands > 200 lines | Too complex for slash command format | Convert to a skill instead |
Overly permissive allowed-tools wildcards |
Security risk | List specific tools needed |
| Skipping multi-agent validation | Miss security, scope, or necessity issues | Run all 4 validation agents |
| Duplicate commands for similar purposes | Confusing discoverability | Check existing commands first |
| Generic description without trigger keywords | Model cannot find the command | Include specific "Use when" phrases |
Quality Gates Checklist
All checks from Verification section plus:
- [ ] Multi-agent approval (security, architect, independent-thinker, critic)
- [ ] No duplication with existing commands
- [ ] Appropriate scope (not too broad/narrow)
- [ ] Frontmatter completeness validated
Scripts
new_slash_command.ts
Creates a new slash command from a template.
bun run ${CLAUDE_SKILL_DIR}/scripts/new_slash_command.ts --name <name>
validate_slash_command.ts
Validates slash command structure and frontmatter.
bun run ${CLAUDE_SKILL_DIR}/scripts/validate_slash_command.ts --path <file>
References
- Search Brain memory for
slashcommand-best-practices
04 同仓库更多 Skills
validation-authority
Treat upstream validators as authoritative. Align local config to them. Use when validation fails unexpectedly, before modifying validator behavior, or when tempted to change upstream tool code.
using-brain-memory
Guidance for using Brain semantic memory effectively. Applies Zettelkasten atomic note principles with observations and relations. Use when deciding whether to query or create notes, structuring note content, or understanding the semantic knowledge graph.
threat-modeling
Structured security analysis using OWASP Four-Question Framework and STRIDE methodology. Generates threat matrices with risk ratings, mitigations, and prioritization. Use for attack surface analysis, security architecture review, or when asking what can go wrong.
taste-lints
Custom lints with agent-readable remediation instructions. Enforces taste invariants (file size, naming conventions, structured logging, complexity) and surfaces errors that agents can act on directly. Use when writing or reviewing code to catch style violations early.
style-enforcement
Validate code against style rules from .editorconfig, StyleCop.json, and Directory.Build.props. Detects line ending violations, naming convention issues, indentation problems, and charset mismatches across C#, Python, TypeScript, and JavaScript. Produces JSON reports for pre-commit hooks and CI pipelines.
steering-matcher
Match file paths against steering file glob patterns to determine applicable steering guidance. Use when orchestrator needs to inject context-aware guidance based on files being modified.