Skip to main content
ClaudeWave
Skill801 estrellas del repoactualizado 7mo ago

slash-command-factory

The Slash Command Factory generates custom Claude Code slash commands through an intelligent question-based workflow that captures user requirements and outputs production-ready command files. Use this skill when you need to create tailored slash commands for specific tasks like business research, content analysis, API integration, or documentation automation without manually writing YAML frontmatter and command syntax.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/alirezarezvani/claude-code-skill-factory /tmp/slash-command-factory && cp -r /tmp/slash-command-factory/generated-skills/slash-command-factory ~/.claude/skills/slash-command-factory
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Slash Command Factory

A comprehensive system for generating production-ready Claude Code slash commands through a simple question-based workflow.

---

## What This Skill Does

This skill helps you create custom slash commands for Claude Code by:
- Asking 5-7 straightforward questions about your command needs
- Generating complete command .md files with proper YAML frontmatter
- Providing 10 powerful preset commands for common use cases
- Validating command format and syntax
- Creating well-organized folder structures
- Offering installation guidance

**Output**: Complete slash commands ready to use in Claude Code

---

## Official Command Structure Patterns

This skill generates commands following **three official patterns** from Anthropic documentation:

### Pattern A: Simple (Context → Task)

**Best for**: Straightforward tasks with clear input/output
**Example**: Code review, file updates, simple analysis
**Official Reference**: code-review.md

**Structure**:
```markdown
---
allowed-tools: Bash(git diff:*), Bash(git log:*)
description: Purpose description
---

## Context
- Current state: !`bash command`
- Additional data: !`another command`

## Your task
[Clear instructions with numbered steps]
[Success criteria]
```

**When to use**:
- Simple, focused tasks
- Quick analysis or reviews
- Straightforward workflows
- 1-3 bash commands for context

---

### Pattern B: Multi-Phase (Discovery → Analysis → Task)

**Best for**: Complex discovery and documentation tasks
**Example**: Codebase analysis, comprehensive audits, system mapping
**Official Reference**: codebase-analysis.md

**Structure**:
```markdown
---
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(grep:*), Bash(wc:*), Bash(du:*)
description: Comprehensive purpose
---

# Command Title

## Phase 1: Project Discovery
### Directory Structure
!`find . -type d | sort`

### File Count Analysis
!`find . -type f | wc -l`

## Phase 2: Detailed Analysis
[More discovery commands]
[File references with @]

## Phase 3: Your Task
Based on all discovered information, create:

1. **Deliverable 1**
   - Subsection
   - Details

2. **Deliverable 2**
   - Subsection
   - Details

At the end, write output to [filename].md
```

**When to use**:
- Comprehensive analysis needed
- Multiple discovery phases
- Large amounts of context gathering
- 10+ bash commands for data collection
- Generate detailed documentation files

---

### Pattern C: Agent-Style (Role → Process → Guidelines)

**Best for**: Specialized expert roles and coordination
**Example**: Domain experts, orchestrators, specialized advisors
**Official Reference**: openapi-expert.md

**Structure**:
```markdown
---
name: command-name
description: |
  Multi-line description for complex purpose
  explaining specialized role
color: yellow
---

You are a [specialized role] focusing on [domain expertise].

**Core Responsibilities:**

1. **Responsibility Area 1**
   - Specific tasks
   - Expected outputs

2. **Responsibility Area 2**
   - Specific tasks
   - Expected outputs

**Working Process:**

1. [Step 1 in workflow]
2. [Step 2 in workflow]
3. [Step 3 in workflow]

**Important Considerations:**

- [Guideline 1]
- [Guideline 2]
- [Constraint or best practice]

When you encounter [scenario], [action to take].
```

**When to use**:
- Need specialized domain expertise
- Orchestrating complex workflows
- Coordinating multiple sub-processes
- Acting as expert advisor
- Require specific procedural guidelines

---

## Comprehensive Naming Convention

### Command File Naming Rules

All slash command files MUST follow kebab-case convention:

**Format**: `[verb]-[noun].md`, `[noun]-[verb].md`, or `[domain]-[action].md`

**Rules**:
1. **Case**: Lowercase only with hyphens as separators
2. **Length**: 2-4 words maximum
3. **Characters**: Only `[a-z0-9-]` allowed (letters, numbers, hyphens)
4. **Start/End**: Must begin and end with letter or number (not hyphen)
5. **No**: Spaces, underscores, camelCase, TitleCase, or special characters

---

### Conversion Algorithm

**User Input** → **Command Name**

```
Input: "Analyze customer feedback and generate insights"
↓
1. Extract action: "analyze"
2. Extract target: "feedback"
3. Combine: "analyze-feedback"
4. Validate: Matches [a-z0-9-]+ pattern ✓
5. Output: analyze-feedback.md
```

**More Examples**:
- "Review pull requests" → `pr-review.md` or `review-pr.md`
- "Generate API documentation" → `api-document.md` or `document-api.md`
- "Update README files" → `update-readme.md` or `readme-update.md`
- "Audit security compliance" → `security-audit.md` or `compliance-audit.md`
- "Research market trends" → `research-market.md` or `market-research.md`
- "Analyze code quality" → `code-analyze.md` or `analyze-code.md`

---

### Official Examples (From Anthropic Docs)

**Correct**:
- ✅ `code-review.md` (verb-noun)
- ✅ `codebase-analysis.md` (noun-noun compound)
- ✅ `update-claude-md.md` (verb-noun-qualifier)
- ✅ `openapi-expert.md` (domain-role)

**Incorrect**:
- ❌ `code_review.md` (snake_case - wrong)
- ❌ `CodeReview.md` (PascalCase - wrong)
- ❌ `codeReview.md` (camelCase - wrong)
- ❌ `review.md` (too vague - needs target)
- ❌ `analyze-customer-feedback-data.md` (too long - >4 words)

---

## Bash Permission Patterns

### Critical Rule: No Wildcards

**❌ NEVER ALLOWED**:
```yaml
allowed-tools: Bash
```
This wildcard permission is **prohibited** per official Anthropic patterns.

**✅ ALWAYS REQUIRED**:
```yaml
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*)
```
Must specify **exact commands** with wildcards only for subcommands.

---

### Official Permission Patterns

Based on Anthropic's documented examples:

**Git Operations** (code-review, update-docs):
```yaml
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git branch:*), Bash(git add:*), Bash(git commit:*)
```

**File Discovery** (codebase-analysis):
```yaml
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(du:*)
```

**Content Analysis** (compreh
agents-guideSubagent

Interactive guide for building custom Claude Code Agents and subagents. Asks straightforward questions, generates enhanced YAML frontmatter with tools/model/color/field/expertise, creates agent .md files, validates format, and helps install to .claude/agents/ or ~/.claude/agents/. Use when user wants to build workflow specialist agents.

factory-guideSubagent

Main navigation guide for Claude Code Skills Factory. Use when user wants to build custom Skills, Prompts, or Agents. Orchestrates and delegates to specialized guide agents.

hooks-guideSubagent

Interactive guide for building custom Claude Code hooks. Asks straightforward questions, uses hook-factory skill, generates complete hooks with validation, and provides installation instructions.

prompts-guideSubagent

Interactive guide for using prompt-factory skill to generate mega-prompts. Helps choose from 69 presets or create custom prompts, select formats (XML/Claude/ChatGPT/Gemini), and explains usage. Use when user wants to generate production-ready prompts for any LLM.

skills-guideSubagent

Interactive guide for building custom Claude Skills. Asks straightforward questions, uses SKILLS_FACTORY_PROMPT template, generates complete skill files, validates format, creates ZIP, and helps install. Use when user wants to build multi-file skill capabilities.

ci-guardSlash Command

Trigger the Commit & Branch Guard workflow on demand.

cmSlash Command

Stage working tree changes and create a Conventional Commit (no push).

cpSlash Command

Stage, commit, and push the current branch following git governance rules.