Generate project-specific workflow commands (research, plan, implement, qa) by asking questions about the project and creating customized commands
Limited to specific tools
Additional assets for this skill
This skill is limited to using the following tools:
templates/analyzer-agent-template.mdtemplates/finder-agent-template.mdtemplates/implement-template.mdtemplates/interview-template.mdtemplates/oneshot-template.mdtemplates/plan-template.mdtemplates/qa-template.mdtemplates/research-template.mdThis skill generates a complete set of project-specific workflow commands by asking questions about your project and creating customized /research, /plan, /implement, and /qa commands.
Create a standardized workflow system adapted to any project's:
Templates are stored in plugins/meta/skills/workflow-generator/templates/. When this skill uses the Read tool:
plugins/meta/skills/workflow-generator/templates/<template-name>.mdTemplates use two types of variable substitution:
1. Simple Variable Substitution
Replace {{VARIABLE}} with actual values:
{{PROJECT_TYPE}} → "Phoenix Application"
{{DOCS_LOCATION}} → ".thoughts"
{{TEST_COMMAND}} → "mix test"
2. Handlebars Conditionals (in some templates) Templates may use Handlebars syntax for conditional content:
{{#if PLANNING_STYLE equals "Detailed phases"}}
Phase-based content
{{/if}}
{{#if PLANNING_STYLE equals "Task checklist"}}
Checklist-based content
{{/if}}
How to handle Handlebars syntax:
When invoked, this skill will:
Analyze the current directory to understand the project:
# Check for common project markers
ls package.json 2>/dev/null && echo "nodejs"
ls mix.exs 2>/dev/null && echo "elixir"
ls Cargo.toml 2>/dev/null && echo "rust"
ls go.mod 2>/dev/null && echo "go"
ls setup.py pyproject.toml 2>/dev/null && echo "python"
ls pom.xml build.gradle 2>/dev/null && echo "java"
# Check for existing .claude directory
ls .claude/commands/*.md 2>/dev/null | wc -l
ls .claude/agents/*.md 2>/dev/null | wc -l
Look for common build/test patterns:
Use TodoWrite to track progress:
1. [in_progress] Discover project context
2. [pending] Ask customization questions
3. [pending] Generate /research command
4. [pending] Generate /plan command
5. [pending] Generate /implement command
6. [pending] Generate /qa command
7. [pending] Generate /oneshot command
8. [pending] Generate /interview command
9. [pending] Create documentation
10. [pending] Present usage instructions
Mark step 1 completed, step 2 in progress.
Header: "Project Type" Question: "What type of Elixir project is this?" multiSelect: false Options:
Header: "Testing" Question: "How do you run tests?" multiSelect: false Options:
Header: "Docs Location" Question: "Where should workflow documents (research, plans) be saved?" multiSelect: false Options:
Header: "Quality Tools" Question: "Which Elixir quality tools do you use?" multiSelect: true Options:
Header: "Planning" Question: "How detailed should implementation plans be?" multiSelect: false Options:
Header: "Workflows Doc" Question: "Where should the WORKFLOWS.md documentation file be saved?" multiSelect: false Options:
Mark step 3 as in_progress in TodoWrite.
Read the template:
plugins/meta/skills/workflow-generator/templates/research-template.mdPerform variable substitution:
Replace these variables in the template:
{{PROJECT_TYPE}} → Answer from Question 1 (e.g., "Phoenix Application"){{DOCS_LOCATION}} → Answer from Question 3 (e.g., ".thoughts"){{PROJECT_TYPE_TAGS}} → Tags based on project type:
{{PROJECT_TYPE_SPECIFIC}} → Project-specific component types for agent prompts:
Write customized command:
.claude/commands/research.mdMark step 3 completed in TodoWrite.
Mark step 4 as in_progress in TodoWrite.
Read the template:
plugins/meta/skills/workflow-generator/templates/plan-template.mdPerform variable substitution:
Replace these variables in the template:
{{PLANNING_STYLE}} → Answer from Question 5 (e.g., "Detailed phases"){{DOCS_LOCATION}} → Answer from Question 3 (e.g., ".thoughts"){{TEST_COMMAND}} → Answer from Question 2, map to actual command:
{{PROJECT_TYPE}} → Answer from Question 1{{PROJECT_TYPE_TAGS}} → Same tags as research command{{QUALITY_TOOLS_CHECKS}} → Expand based on Question 4 answers:
mix credo --strict passes"mix dialyzer passes"mix sobelow --exit Low passes"mix format --check-formatted passes"mix docs succeeds (no warnings)"mix deps.audit passes"{{QUALITY_TOOLS_EXAMPLES}} → Same expansion as checks but as examplesWrite customized command:
.claude/commands/plan.mdMark step 4 completed in TodoWrite.
Mark step 5 as in_progress in TodoWrite.
Read the template:
plugins/meta/skills/workflow-generator/templates/implement-template.mdPerform variable substitution:
Replace these variables in the template:
{{DOCS_LOCATION}} → Answer from Question 3{{TEST_COMMAND}} → Actual test command from Question 2{{VERIFICATION_COMMANDS}} → Per-phase verification commands:
# Always include:
mix compile --warnings-as-errors
{{TEST_COMMAND}}
mix format --check-formatted
# Add if selected in Question 4:
mix credo --strict # if Credo
mix dialyzer # if Dialyzer
{{FULL_VERIFICATION_SUITE}} → All quality checks expanded:
{{QUALITY_TOOLS_SUMMARY}} → Summary line for each enabled tool{{OPTIONAL_QUALITY_CHECKS}} → Per-phase optional checks if tools enabledWrite customized command:
.claude/commands/implement.mdMark step 5 completed in TodoWrite.
Mark step 6 as in_progress in TodoWrite.
Read the template:
plugins/meta/skills/workflow-generator/templates/qa-template.mdPerform variable substitution:
Replace these variables in the template:
{{PROJECT_TYPE}} → Answer from Question 1{{TEST_COMMAND}} → Actual test command from Question 2{{DOCS_LOCATION}} → Answer from Question 3{{PROJECT_TYPE_TAGS}} → Same tags as research command{{QUALITY_TOOL_COMMANDS}} → Expand quality tool commands based on Question 4:
# Add for each selected tool:
mix credo --strict # if Credo
mix dialyzer # if Dialyzer
mix sobelow --exit Low # if Sobelow
mix format --check-formatted # if Format check
mix docs # if ExDoc
mix deps.audit # if mix_audit
{{QUALITY_TOOLS_RESULTS_SUMMARY}} → Summary lines for report template{{QUALITY_TOOLS_DETAILED_RESULTS}} → Detailed result sections for enabled tools{{SUCCESS_CRITERIA_CHECKLIST}} → Checklist items for each enabled tool{{PROJECT_TYPE_SPECIFIC_OBSERVATIONS}} → Phoenix/Ecto/OTP observations based on project type{{QUALITY_TOOL_INTEGRATION_GUIDE}} → Integration guidance for enabled tools{{QUALITY_TOOLS_SUMMARY_DISPLAY}} → Display format for enabled tools in final outputWrite customized command:
.claude/commands/qa.mdMark step 6 completed in TodoWrite.
Mark step 7 as in_progress in TodoWrite.
Read the template:
plugins/meta/skills/workflow-generator/templates/oneshot-template.mdPerform variable substitution:
Replace these variables in the template:
{{FEATURE_DESCRIPTION}} → User's feature description (from $ARGUMENTS){{DOCS_LOCATION}} → Answer from Question 3{{TEST_COMMAND}} → Actual test command from Question 2{{PROJECT_TYPE}} → Answer from Question 1{{QUALITY_TOOLS}} → Boolean check if any quality tools selected{{QUALITY_TOOLS_SUMMARY}} → Comma-separated list of enabled tools{{QUALITY_TOOLS_STATUS}} → Status summary for each tool{{QUALITY_TOOLS_LIST}} → List format of enabled tools{{QA_PASSED}} → Conditional variable for success/failure branchingWrite customized command:
.claude/commands/oneshot.mdMark step 7 completed in TodoWrite.
Mark step 8 as in_progress in TodoWrite.
Read the template:
plugins/meta/skills/workflow-generator/templates/interview-template.mdPerform variable substitution:
Replace these variables in the template:
{{PROJECT_TYPE}} → Answer from Question 1 (e.g., "Phoenix Application"){{DOCS_LOCATION}} → Answer from Question 3 (e.g., ".thoughts")The interview command is designed to be project-agnostic with dynamic question generation, so it needs minimal customization compared to other commands.
Write customized command:
.claude/commands/interview.mdMark step 8 completed in TodoWrite.
Mark step 9 as in_progress in TodoWrite.
Create WORKFLOWS.md file at the location specified in Question 6.
File Location (based on Question 6 answer):
.claude/WORKFLOWS.mdWORKFLOWS.mddocs/WORKFLOWS.mdREADME-WORKFLOWS.mdIf the answer is "docs/WORKFLOWS.md", create the docs directory first:
mkdir -p docs
Content for the WORKFLOWS.md file:
# Elixir Project Workflows
This project uses a standardized workflow system for research, planning, implementation, and quality assurance.
## Generated for: {{PROJECT_TYPE}} (Elixir)
---
## Available Commands
### /research
Research the codebase to answer questions and document existing implementations.
**Usage**:
```bash
/research "How does authentication work?"
/research "What is the API structure?"
Output: Research documents saved to {{DOCS_LOCATION}}/research-YYYY-MM-DD-topic.md
Create detailed implementation plans with success criteria.
Usage:
/plan "Add user profile page"
/plan "Refactor database layer"
Output: Plans saved to {{DOCS_LOCATION}}/plans/YYYY-MM-DD-description.md
Plan Structure: {{PLANNING_STYLE}}
Execute implementation plans with automated verification.
Usage:
/implement "2025-01-23-user-profile"
/implement # Will prompt for plan selection
Verification Commands:
mix compile --warnings-as-errors{{TEST_COMMAND}}mix format --check-formatted
{{#each QUALITY_TOOLS}}Validate implementation against success criteria and project quality standards.
Usage:
/qa # General health check
/qa "plan-name" # Validate specific plan implementation
Quality Gates: {{#each VALIDATION_CRITERIA}}
Fix Workflow (automatic): When critical issues are detected, /qa offers to automatically generate and execute a fix plan.
When /qa detects critical issues, it automatically offers to generate a fix plan and execute it.
Automatic Fix Flow:
/qa → ❌ Critical issues detected
↓
"Generate fix plan?" → Yes
↓
/plan "Fix critical issues from QA report: ..."
↓
Fix plan created at {{DOCS_LOCATION}}/plans/plan-YYYY-MM-DD-fix-*.md
↓
"Execute fix plan?" → Yes
↓
/implement fix-plan-name
↓
/qa → Re-validation
↓
✅ Pass or iterate
Manual Fix Flow:
/qa → ❌ Critical issues detected → Decline auto-fix
↓
Review QA report manually
↓
Fix issues manually or create plan: /plan "Fix [specific issue]"
↓
/qa → Re-validation
Oneshot with Auto-Fix:
The /oneshot command automatically attempts fix workflows when QA fails:
/oneshot "Feature" → Research → Plan → Implement → QA
↓
❌ Fails with critical issues
↓
"Auto-fix and re-validate?" → Yes
↓
/plan "Fix..." → /implement fix → /qa
↓
✅ Pass → Complete oneshot
Benefits of Fix Workflow:
{{DOCS_LOCATION}}/plans//qa to generate new fix plansThe recommended workflow for new features:
/research) - Understand current implementation/plan) - Create detailed implementation plan/implement) - Execute plan with verification/qa) - Validate against success criteriaThese commands were generated based on your project configuration. You can edit them directly:
.claude/commands/research.md.claude/commands/plan.md.claude/commands/implement.md.claude/commands/qa.md.claude/commands/oneshot.mdTo regenerate: /meta:workflow-generator
Project Type: {{PROJECT_TYPE}} Tech Stack: Elixir Test Command: {{TEST_COMMAND}} Documentation: {{DOCS_LOCATION}} Planning Style: {{PLANNING_STYLE}}
Quality Tools: {{#each QUALITY_TOOLS}}
**Variable Substitution** for WORKFLOWS.md:
- `{{PROJECT_TYPE}}` → Answer from Question 1
- `{{DOCS_LOCATION}}` → Answer from Question 3
- `{{TEST_COMMAND}}` → Actual test command from Question 2
- `{{PLANNING_STYLE}}` → Answer from Question 5
- `{{QUALITY_TOOLS}}` → List from Question 4
- `{{VALIDATION_CRITERIA}}` → Expanded from Question 4
Use Write tool to create the file at the location determined above.
### 9.2 Create Documentation Directory
```bash
mkdir -p {{DOCS_LOCATION}}/research
mkdir -p {{DOCS_LOCATION}}/plans
mkdir -p {{DOCS_LOCATION}}/interview
Mark step 9 completed in TodoWrite.
Mark step 10 as in_progress in TodoWrite.
Present a comprehensive summary to the user:
✅ Workflow commands generated successfully!
## Created Commands
.claude/ ├── commands/ │ ├── interview.md # Interactive context gathering │ ├── research.md # Research and document codebase │ ├── plan.md # Create implementation plans │ ├── implement.md # Execute plans with verification │ ├── qa.md # Validate implementation quality │ └── oneshot.md # Complete workflow in one command {{WORKFLOWS_MD_LOCATION}} # Complete workflow documentation
**Note**: Show the actual file path where WORKFLOWS.md was created based on Question 6 answer.
## Documentation Structure
{{DOCS_LOCATION}}/ ├── interview/ # Interview context documents ├── research/ # Research documents └── plans/ # Implementation plans
---
## Configuration Summary
**Project**: {{PROJECT_TYPE}} (Elixir)
**Commands Configured**:
- Compile: `mix compile --warnings-as-errors`
- Test: `{{TEST_COMMAND}}`
- Format: `mix format --check-formatted`
**Quality Tools Enabled**:
{{#each QUALITY_TOOLS}}
- {{this}}
{{/each}}
**Planning Style**: {{PLANNING_STYLE}}
---
## Quick Start
### 1. Research the Codebase
```bash
/research "How does [feature] work?"
This will:
{{DOCS_LOCATION}}/research-YYYY-MM-DD-topic.md/plan "Add new feature X"
This will:
{{DOCS_LOCATION}}/plans/YYYY-MM-DD-feature-x.md/implement "2025-01-23-feature-x"
This will:
mix compile, {{TEST_COMMAND}})/qa "feature-x"
This will:
Scenario: Adding a new Phoenix context
# 1. Research existing patterns
/research "How are contexts structured in this Phoenix app?"
# 2. Create implementation plan
/plan "Add Accounts context with user management"
# 3. Execute the plan
/implement "2025-01-23-accounts-context"
# 4. Validate implementation
/qa "accounts-context"
All generated commands are fully editable. Customize them to match your exact workflow:
.claude/commands/qa.md.claude/commands/plan.md.claude/commands/research.md.claude/commands/implement.mdTo regenerate these commands with different settings:
/workflow-generator
This will ask questions again and regenerate all commands.
Full workflow documentation: {{WORKFLOWS_MD_LOCATION}}
Note: Show the actual file path where WORKFLOWS.md was created.
/research "project structure"{{WORKFLOWS_MD_LOCATION}}.claude/commands/*.md)Note: Replace {{WORKFLOWS_MD_LOCATION}} with the actual file path.
Need help? Each command has detailed instructions in its markdown file.
Mark step 10 completed in TodoWrite.
Mark all todos as completed and present final summary to user.
---
## Important Notes
### Generic Core Components
The generated commands maintain these universal patterns:
- TodoWrite for progress tracking
- Parallel agent spawning (finder, analyzer)
- YAML frontmatter with git metadata
- file:line reference format
- Documentation vs evaluation separation
- Success criteria framework (automated vs manual)
### Elixir-Specific Customizations
Commands are customized based on:
- Elixir project type (Phoenix, Library, CLI, Umbrella)
- Test commands (mix test, make test, custom)
- Documentation location preferences
- Quality tools enabled (Credo, Dialyzer, Sobelow, etc.)
- Planning methodology
### Extensibility
All generated commands are templates that users can:
- Edit directly to add project-specific logic
- Extend with additional validation
- Modify to match team conventions
- Enhance with custom agent types
### Agent Types Referenced
Generated commands use these standard agents:
- `finder`: Locate files and patterns
- `analyzer`: Deep technical analysis
- `general-purpose`: Flexible research tasks
Projects can define custom agents in `.claude/agents/` for specialized behavior.
---
## Error Handling
If generation fails at any step:
1. Report which step failed
2. Show the error
3. Offer to retry just that step
4. Provide manual instructions if needed
---
## Validation
After generating all commands:
1. Check that all files were created
2. Validate markdown structure
3. Verify template variables were replaced
4. Confirm documentation directory exists
5. Present final status to user