/fix-workflow
Retrospective analysis and improvement of workflow components with self-evolving patterns
$ npx -y skills add athola/claude-night-market --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/fix-workflow
Context preview
What this command does when you run it.
Retrospective analysis and improvement of workflow components with self-evolving patterns
Command definition
fix-workflow.mdname: fix-workflow
description: Retrospective analysis and improvement of workflow components with self-evolving patterns
usage: /fix-workflow [--scope sanctum|repo] [--dry-run] [--focus skills|agents|commands|hooks|all] [--difficulty auto|simple|complex]
Fix Workflow
Run a lightweight retrospective on the **most recent command or session slice** visible in the current context window, then implement targeted improvements to the workflow components involved (skills, agents, commands, hooks).
When To Use
Use this command when you need to:
- Workflow execution felt inefficient or needs optimization
- Post-session improvement of skills/agents/commands/hooks
When NOT To Use
- Simple changes that don't need the full workflow
- Work already completed through another sanctum command
Self-Improvement Architecture
This command implements research-backed self-improvement patterns:
| Pattern | Purpose | When Applied | |---------|---------|--------------| | **Reflexion** | Self-critique before applying fixes | Phase 1.5 (after analysis) | | **PDCA Loops** | Plan-Do-Check-Act validation | Each phase transition | | **Difficulty-Aware** | Adjust depth based on complexity | Phase 0 (auto-detected) | | **Outcome Feedback** | Learn from validation results | Phase 2 (close loop) |
Usage
/fix-workflow [--scope sanctum|repo] [--dry-run] [--focus skills|agents|commands|hooks|all] [--difficulty auto|simple|complex]
- `--scope sanctum|repo`: Default `sanctum`. If `repo`, improvements may touch non-plugin code and project docs/tests as needed.
- `--dry-run`: Produce an improvement plan without making changes.
- `--focus`: Default `all`. Limit to a component type to keep the change set small.
- `--difficulty auto|simple|complex`: Default `auto`. Controls orchestration depth:
- `simple`: Single-pass improvement (1-2 files, clear fix)
- `complex`: Full PDCA cycle with reflexion (multi-file, architectural)
- `auto`: Detect from workflow complexity score
Workflow
Phase 0: Gather Improvement Context (Automatic)
Before starting retrospective analysis, automatically gather existing improvement data:
Step 0.1: Check Skill Execution Metrics
Identify performance issues in workflow components:
# Get recent skill executions (last 7 days)
/skill-logs --last 7d --format json > /tmp/recent-skills.json
# Check for failures in workflow components
/skill-logs --failures-only --last 7d
**Extract:**
- Skills that failed during the workflow slice
- Skills with high stability_gap (> 0.3) indicating instability
- Common error patterns
- Performance degradation signals
Step 0.2: Query Memory Palace for Lessons
Check if similar workflow issues have been captured:
# Search review-chamber for workflow-related lessons
# (If memory-palace commands are available)
/review-room search "workflow" --room lessons --limit 5
/review-room search "efficiency" --room patterns --limit 5
**Look for:**
- Previously identified workflow inefficiencies
- Patterns from past PR reviews
- Architectural decisions affecting workflows
Step 0.3: Check Recent Git History
Look for recent fixes to workflow components:
# Find recent improvements to the workflow components
git log --oneline --grep="improve\|fix\|optimize\|refactor" --since="30 days ago" \
-- plugins/sanctum/skills/ plugins/sanctum/commands/ plugins/sanctum/agents/
# Check if similar workflows were fixed recently
git log -p --since="30 days ago" --grep="workflow" -- plugins/sanctum/
**Identify:**
- Recurring issues that keep getting fixed
- Components with frequent changes (instability signals)
- Patterns in fix commit messages
Phase 1: Retrospective Analysis
1. **Capture the target slice and key evidence:**
- Load workflow-improvement skill: `Skill(sanctum:workflow-improvement)` or read `plugins/sanctum/skills/workflow-improvement/SKILL.md`
- **Include Phase 0 findings** as additional context
2. **Recreate the workflow and surface inefficiencies:**
- Use `workflow-recreate-agent` to restate the steps, identify friction, and list involved components
- **Cross-reference with Phase 0 data** to identify recurring patterns
3. **Analyze improvement options:**
- Use `workflow-improvement-analysis-agent` to generate candidate improvements with trade-offs and expected impact
- **Prioritize fixes** for components with high failure rates or stability gaps
4. **Plan collaboratively (converge on a small, high-use patch):**
- Use `workflow-improvement-planner-agent` to choose the best approach, define acceptance criteria, and assign work
- **Create TodoWrite items** referencing Phase 0 metrics
Phase 1.5: Reflexion (Self-Critique Loop)
Before implementing, the agent evaluates its own improvement plan:
Reflexion Checklist
## Self-Critique Questions
1. **Root Cause**: Does this fix address the root cause or just symptoms?
- [ ] Verified root cause in Phase 0 data
- [ ] Fix targets cause, not effect
2. **Unintended Consequences**: Could this improvement break something else?
- [ ] Checked dependent workflows
- [ ] Reviewed similar past fixes for side effects
3. **Reversibility**: Can this be easily rolled back?
- [ ] Changes are incremental
- [ ] No destructive modifications
4. **Recurrence Prevention**: Will this prevent future similar issues?
- [ ] Addresses pattern, not just instance
- [ ] Adds guardrails for detection
Difficulty-Aware Orchestration
Based on complexity score from Phase 0:
| Score | Difficulty | Orchestration | |-------|------------|---------------| | 1-3 | Simple | Skip reflexion, direct implement | | 4-6 | Medium | Quick reflexion (2 questions) | | 7-10 | Complex | Full reflexion and PDCA cycle |
**Complexity Score Factors:**
- Files affected (1 point per file)
- Cross-plugin changes (+2 points)
- Architectural changes (+3 points)
- Prior failures in component (+1 per failure)
Read more
name: fix-workflow description: Retrospective analysis and improvement of workflow components with self-evolving patterns usage: /fix-workflow [--scope sanctum|repo] [--dry-run] [--focus skills|agents|commands|hooks|all] [--difficulty auto|simple|complex]
Fix Workflow
Run a lightweight retrospective on the **most recent command or session slice** visible in the current context window, then implement targeted improvements to the workflow components involved (skills, agents, commands, hooks).
When To Use
Use this command when you need to:
- Workflow execution felt inefficient or needs optimization
- Post-session improvement of skills/agents/commands/hooks
When NOT To Use
- Simple changes that don't need the full workflow
- Work already completed through another sanctum command
Self-Improvement Architecture
This command implements research-backed self-improvement patterns:
| Pattern | Purpose | When Applied | |---------|---------|--------------| | **Reflexion** | Self-critique before applying fixes | Phase 1.5 (after analysis) | | **PDCA Loops** | Plan-Do-Check-Act validation | Each phase transition | | **Difficulty-Aware** | Adjust depth based on complexity | Phase 0 (auto-detected) | | **Outcome Feedback** | Learn from validation results | Phase 2 (close loop) |
Usage
/fix-workflow [--scope sanctum|repo] [--dry-run] [--focus skills|agents|commands|hooks|all] [--difficulty auto|simple|complex]
- `--scope sanctum|repo`: Default `sanctum`. If `repo`, improvements may touch non-plugin code and project docs/tests as needed.
- `--dry-run`: Produce an improvement plan without making changes.
- `--focus`: Default `all`. Limit to a component type to keep the change set small.
- `--difficulty auto|simple|complex`: Default `auto`. Controls orchestration depth:
- `simple`: Single-pass improvement (1-2 files, clear fix)
- `complex`: Full PDCA cycle with reflexion (multi-file, architectural)
- `auto`: Detect from workflow complexity score
Workflow
Phase 0: Gather Improvement Context (Automatic)
Before starting retrospective analysis, automatically gather existing improvement data:
Step 0.1: Check Skill Execution Metrics
Identify performance issues in workflow components:
# Get recent skill executions (last 7 days) /skill-logs --last 7d --format json > /tmp/recent-skills.json # Check for failures in workflow components /skill-logs --failures-only --last 7d
**Extract:**
- Skills that failed during the workflow slice
- Skills with high stability_gap (> 0.3) indicating instability
- Common error patterns
- Performance degradation signals
Step 0.2: Query Memory Palace for Lessons
Check if similar workflow issues have been captured:
# Search review-chamber for workflow-related lessons # (If memory-palace commands are available) /review-room search "workflow" --room lessons --limit 5 /review-room search "efficiency" --room patterns --limit 5
**Look for:**
- Previously identified workflow inefficiencies
- Patterns from past PR reviews
- Architectural decisions affecting workflows
Step 0.3: Check Recent Git History
Look for recent fixes to workflow components:
# Find recent improvements to the workflow components git log --oneline --grep="improve\|fix\|optimize\|refactor" --since="30 days ago" \ -- plugins/sanctum/skills/ plugins/sanctum/commands/ plugins/sanctum/agents/ # Check if similar workflows were fixed recently git log -p --since="30 days ago" --grep="workflow" -- plugins/sanctum/
**Identify:**
- Recurring issues that keep getting fixed
- Components with frequent changes (instability signals)
- Patterns in fix commit messages
Phase 1: Retrospective Analysis
1. **Capture the target slice and key evidence:**
- Load workflow-improvement skill: `Skill(sanctum:workflow-improvement)` or read `plugins/sanctum/skills/workflow-improvement/SKILL.md`
- **Include Phase 0 findings** as additional context
2. **Recreate the workflow and surface inefficiencies:**
- Use `workflow-recreate-agent` to restate the steps, identify friction, and list involved components
- **Cross-reference with Phase 0 data** to identify recurring patterns
3. **Analyze improvement options:**
- Use `workflow-improvement-analysis-agent` to generate candidate improvements with trade-offs and expected impact
- **Prioritize fixes** for components with high failure rates or stability gaps
4. **Plan collaboratively (converge on a small, high-use patch):**
- Use `workflow-improvement-planner-agent` to choose the best approach, define acceptance criteria, and assign work
- **Create TodoWrite items** referencing Phase 0 metrics
Phase 1.5: Reflexion (Self-Critique Loop)
Before implementing, the agent evaluates its own improvement plan:
Reflexion Checklist
## Self-Critique Questions 1. **Root Cause**: Does this fix address the root cause or just symptoms? - [ ] Verified root cause in Phase 0 data - [ ] Fix targets cause, not effect 2. **Unintended Consequences**: Could this improvement break something else? - [ ] Checked dependent workflows - [ ] Reviewed similar past fixes for side effects 3. **Reversibility**: Can this be easily rolled back? - [ ] Changes are incremental - [ ] No destructive modifications 4. **Recurrence Prevention**: Will this prevent future similar issues? - [ ] Addresses pattern, not just instance - [ ] Adds guardrails for detection
Difficulty-Aware Orchestration
Based on complexity score from Phase 0:
| Score | Difficulty | Orchestration | |-------|------------|---------------| | 1-3 | Simple | Skip reflexion, direct implement | | 4-6 | Medium | Quick reflexion (2 questions) | | 7-10 | Complex | Full reflexion and PDCA cycle |
**Complexity Score Factors:**
- Files affected (1 point per file)
- Cross-plugin changes (+2 points)
- Architectural changes (+3 points)
- Prior failures in component (+1 per failure)
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Other commands on claude-night-market.
- /aggregate-logs
Generate LEARNINGS.md from skill execution logs.
Open command - /analyze-skill
Analyze skill file complexity metrics and generate modularization recommendations for splitting or progressive loading.
Open command - /bulletproof-skill
Harden skills against rationalization and bypass behaviors
Open command - /context-report
Generate context optimization report for skill directories
Open command - /create-command
Create slash commands with brainstorming and best practices
Open command - /create-hook
Create hooks with brainstorming and security-first design
Open command

