Import and adapt a workflow from external repositories
Imports and adapts workflows from external repositories into your workspace.
/plugin marketplace add coalesce-labs/catalyst/plugin install catalyst-meta@catalystinheritYou are tasked with importing and adapting workflows from external Claude Code repositories into this workspace.
This command helps you import discovered workflows, adapt them to your workspace standards, validate frontmatter consistency, and integrate with your configuration.
When invoked:
I'll help you import a workflow from an external repository.
Please provide:
1. Repository name (e.g., wshobson/commands)
2. Workflow name (e.g., code-review)
Or, if you've already run /discover-workflows:
- Check the catalog: thoughts/shared/workflows/catalog.md
- Pick from discovered workflows
Get the repository and workflow name from user or parameters.
IMPORTANT: Spawn 3 parallel tasks for comprehensive analysis.
Use TodoWrite to track parallel research.
Task 1 - External Research:
Use external-research agent:
"Research {repo}/{workflow}. Explain what this workflow does, how it works, what tools it uses, and provide the complete implementation including frontmatter."
Tools: mcp__deepwiki__ask_question
Return: Full workflow understanding and implementation
Task 2 - Local Pattern Check:
Use codebase-pattern-finder agent:
"Find similar workflows in our workspace (agents/ and commands/ directories). Look for workflows that serve similar purposes or use similar patterns."
Tools: Grep, Glob, Read
Path: /Users/ryan/code-repos/ryan-claude-workspace
Return: Similar local workflows for comparison
Task 3 - Historical Context:
Use thoughts-locator agent:
"Search for any previous research, notes, or attempts related to this type of workflow. Search for keywords: {workflow-name}, {workflow-purpose}."
Tools: Grep, Glob
Path: thoughts/
Return: Any historical context or previous attempts
WAIT for all 3 tasks to complete.
Combine results from parallel tasks:
Mark all tasks complete in TodoWrite.
Analyze:
Show comprehensive analysis:
# Import Analysis: {workflow-name}
## What It Does
[Summary from external research]
## External Implementation
- **Repository**: {repo}
- **Tools used**: [list]
- **Frontmatter**:
```yaml
[original frontmatter]
```
[From Task 2 - what we already have]
[From Task 3 - any previous attempts or notes]
[Import as-is / Import with modifications / Skip (we have similar)]
Proceed with import? (Y/n)
### Step 5: Adapt to Workspace Standards
If user approves, adapt the workflow:
#### 5a. Standardize Frontmatter
Apply consistent frontmatter based on type:
**For Agents**:
```yaml
---
name: {workflow-name}
description: |
{Clear description from research}
{When to invoke}
tools: {validated tool list}
model: inherit
category: {appropriate category}
version: 1.0.0
source: {repo-url} # Track origin
---
For Commands:
---
description: { One-line summary }
category: { appropriate category }
argument-hint: { if applicable }
tools: { tool list }
model: inherit
version: 1.0.0
source: { repo-url } # Track origin
---
Check for and replace:
.claude/config.json)Add source attribution in frontmatter and as comment:
---
source: https://github.com/{repo}
adapted: { date }
original-author: { if known }
---
<!--
Adapted from: {repo}/{workflow-name}
Original: {URL}
Modifications:
- {change 1}
- {change 2}
-->
Before saving, validate against standard:
If validation fails, show issues and fix.
Determine type and save location:
If Agent:
agents/{workflow-name}.mdIf Command:
commands/{workflow-name}.mdSave import details to thoughts/shared/workflows/imports.md:
## {workflow-name}
- **Imported**: {date}
- **Source**: {repo}/{workflow}
- **Type**: {agent/command}
- **Location**: {file-path}
- **Adaptations**:
- {adaptation 1}
- {adaptation 2}
- **Status**: Active
**Why imported**: {reason}
Present success summary:
✅ Workflow imported successfully!
**Saved to**: {file-path}
**Adaptations made**:
- Standardized frontmatter
- Updated ticket prefix: ENG → PROJ
- Added source attribution
- Validated tools list
**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 "Import {workflow-name} from {repo}"`
Import recorded in: thoughts/shared/workflows/imports.md
/import-workflow wshobson/commands code-review --adapt "Use our custom linting rules"
/import-workflow wshobson/commands code-review refactor test-gen
Imports all 3 in sequence (with parallel validation for each).
/import-workflow wshobson/commands code-review --dry-run
Shows what would be imported without actually saving files.
/discover-workflows → catalog workflows/import-workflow (this command)/validate-frontmatter ensures consistency/create-workflow for new workflows/discover-workflows {repo} firstThis command bridges external workflows into your workspace with proper adaptation and validation!