Create new agents or commands using discovered patterns and templates
Creates new agents or commands using discovered patterns and templates from the workflow catalog.
/plugin marketplace add coalesce-labs/catalyst/plugin install catalyst-meta@catalystinheritYou are tasked with helping users create new agents or commands by leveraging discovered patterns, templates, and examples from the workflow catalog.
This command guides users through creating well-structured, standardized workflows by showing relevant examples and enforcing frontmatter consistency.
When invoked:
I'll help you create a new agent or command.
What would you like to create?
1. Agent (for Task tool sub-agents)
2. Command (for slash commands)
Or provide details:
- Name: (e.g., code-reviewer, test-generator)
- Purpose: (brief description)
- Similar to: (optional - name of existing workflow to model after)
Ask the user:
IMPORTANT: Spawn 3 parallel tasks to gather comprehensive examples.
Use TodoWrite to track parallel research.
Task 1 - Local Examples:
Use codebase-pattern-finder agent:
"Find all {agents/commands} in our workspace that are similar to {user-description}. Focus on {category} workflows. Return file paths and brief descriptions."
Tools: Glob, Grep, Read
Path: /Users/ryan/code-repos/ryan-claude-workspace
Return: List of similar local workflows with their frontmatter and key patterns
Task 2 - Catalog Examples:
Use thoughts-analyzer agent:
"Search the workflow catalog at thoughts/shared/workflows/ for workflows similar to {user-description}. Find examples from external repositories that match the {category} category."
Tools: Grep, Read
Path: thoughts/shared/workflows/
Return: External workflow examples with their implementations
Task 3 - Frontmatter Standards:
Use codebase-analyzer agent:
"Analyze all existing {agents/commands} in the workspace to extract the frontmatter standard. What fields are required? What patterns are used? What categories exist?"
Tools: Glob, Grep, Read
Path: /Users/ryan/code-repos/ryan-claude-workspace/{agents,commands}/
Return: Frontmatter standard with field definitions and examples
WAIT for all 3 tasks to complete.
Combine results from parallel tasks:
Mark all tasks complete in TodoWrite.
Analyze:
Show analysis and options:
# Create {workflow-type}: {name}
## Similar Workflows Found
### From Our Workspace
1. **{local-workflow-1}**
- Purpose: {description}
- Tools: {tools}
- File: {path}
2. **{local-workflow-2}** [....]
### From Catalog
1. **{external-workflow-1}** (from {repo})
- Purpose: {description}
- Tools: {tools}
## Frontmatter Standard
Based on existing workflows, here's the standard format:
```yaml
---
{ required-fields }
---
```
Based on similar workflows, I recommend:
Would you like me to:
### Step 5: Generate Workflow Template
Based on user selection, generate the appropriate template:
#### 5a. For Agents
```markdown
---
name: {workflow-name}
description: |
{Clear description from user input}
Use this agent when:
- {use case 1}
- {use case 2}
This agent will:
- {action 1}
- {action 2}
tools: {validated-tool-list}
model: inherit
category: {selected-category}
version: 1.0.0
---
# {Agent Name}
You are a specialized agent for {purpose}.
## Your Role
{Detailed role description}
## Process
### Step 1: {First Step}
{Instructions for first step}
### Step 2: {Second Step}
{Instructions for second step}
[Continue with all steps...]
## Output Format
Return your findings in this format:
{Expected output structure}
## Important Notes
- {Guideline 1}
- {Guideline 2}
- {Guideline 3}
## Examples
### Example 1: {Scenario}
**Input**: {example input}
**Expected output**: {example output}
[More examples...]
---
description: { One-line summary }
category: { category }
argument-hint: { if applicable }
tools: { tool-list }
model: inherit
version: 1.0.0
---
# {Command Name}
You are tasked with {command purpose}.
## Purpose
{Detailed explanation of what this command does and why it exists}
## Initial Response
When invoked:
\`\`\` {Default message to show user} \`\`\`
## Process
### Step 1: {First Step Name}
{Instructions for first step}
### Step 2: {Second Step Name}
{Instructions for second step}
[Continue with all steps...]
## Configuration
This command uses configuration from `.claude/config.json`:
```json
{
"catalyst": {
"project": {
"ticketPrefix": "PROJ"
}
}
}
```
{Example usage}
{Example usage}
### Step 6: Validate Template
Before showing to user, validate:
1. **Frontmatter**:
- All required fields present?
- Tools list valid?
- Category matches existing categories?
- Name in kebab-case?
- Version starts at 1.0.0?
2. **Structure**:
- Clear purpose statement?
- Step-by-step process?
- Output format specified (for agents)?
- Error handling included?
3. **Consistency**:
- Matches patterns from similar workflows?
- Uses workspace conventions?
- References config.json for project-specific values?
If validation fails, fix issues before proceeding.
### Step 7: Present Draft
Show the user the generated template:
```markdown
# Generated Workflow: {name}
I've created a draft based on {source-pattern}.
**Type**: {Agent/Command}
**File**: {target-path}
## Frontmatter
```yaml
{frontmatter}
Would you like me to:
### Step 8: Iterate on Feedback
Be ready to adjust:
- Add/remove steps
- Change tools
- Adjust frontmatter
- Modify structure
- Add examples
- Update descriptions
Continue iterating until user is satisfied.
### Step 9: Save Workflow
Determine save location:
**If Agent**:
- Save to: `agents/{workflow-name}.md`
**If Command**:
- Save to: `commands/{workflow-name}.md`
### Step 10: Create Creation Record
Save creation details to `thoughts/shared/workflows/created.md`:
```markdown
## {workflow-name}
- **Created**: {date}
- **Type**: {agent/command}
- **Location**: {file-path}
- **Modeled After**:
- {local-example if any}
- {catalog-example if any}
- **Purpose**: {brief-description}
- **Tools**: {tool-list}
- **Category**: {category}
**Creation Notes**: {any special notes about decisions made}
Present success summary:
✅ Workflow created successfully!
**Saved to**: {file-path}
**What's included**:
- Standardized frontmatter
- Clear step-by-step process
- {Type-specific features}
- Error handling guidelines
**Next steps**:
1. Review: `{file-path}`
2. Test: Try using the workflow
3. Customize: Adjust for your specific needs
4. Commit: `git add {file-path} && git commit -m "Add {workflow-name} {type}"`
Creation recorded in: thoughts/shared/workflows/created.md
/create-workflow from catalog wshobson/commands/code-review
Creates a new workflow based on a specific catalog entry.
/create-workflow agent data-analyzer --template minimal
Uses predefined templates:
minimal: Basic structure onlystandard: Full featured (default)advanced: Includes sub-agent patterns/create-workflow command quick-commit "Create conventional commits"
Skips interactive steps, uses defaults.
---
name: {name}
description: {description}
tools: Read, Grep
model: inherit
category: general
version: 1.0.0
---
# {Name}
You are a specialized agent for {purpose}.
## Process
[Your implementation]
## Output
Return: {what you return}
---
description: {description}
category: general
tools: Read, Write
model: inherit
version: 1.0.0
---
# {Name}
You are tasked with {purpose}.
## Process
[Your implementation]
Standard categories found in workspace:
For Agents:
research - Finding and analyzing informationanalysis - Deep code/data analysissearch - Locating files/patternsexecution - Running commands/operationsvalidation - Checking and verifyinggeneral - Multi-purpose agentsFor Commands:
workflow - Development workflowsplanning - Planning and designimplementation - Code changesvalidation - Testing and verificationlinear - Linear integrationgit - Version controlworkflow-discovery - Meta-workflowsgeneral - Miscellaneousdescription: One-line summary (commands) or longer explanation (agents)tools: Array of Claude Code tools usedmodel: Usually "inherit"version: Start with "1.0.0"name: Agent identifier in kebab-casecategory: Agent category from list abovecategory: Command category from list aboveargument-hint: (optional) Hint for command argumentssource: URL of origin if imported/adaptedadapted: Date if modified from external sourceoriginal-author: Credit for original creator/discover-workflows → find examples to model after/import-workflow → import external workflow as starting point/create-workflow (this command) → create new workflow/validate-frontmatter → ensure consistencyThis command helps you create high-quality workflows following workspace standards!