feat: Complete sync of all Claude Code CLI upgrades

- Add all 21 commands (clawd, ralph, prometheus*, dexto*)
- Add all hooks (intelligent-router, clawd-*, prometheus-wrapper, unified-integration-v2)
- Add skills (ralph, prometheus master)
- Add MCP servers (registry.json, manager.sh)
- Add plugins directory with marketplaces
- Add health-check.sh and aliases.sh scripts
- Complete repository synchronization with local ~/.claude/

Total changes: 100+ new files added
All integrations now fully backed up in repository

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
uroma
2026-01-27 20:39:25 +00:00
Unverified
parent b52318eeae
commit 87748afb75
180 changed files with 14841 additions and 3 deletions

1
ClaudeCLI-Web Submodule

Submodule ClaudeCLI-Web added at db862600bd

50
aliases.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/bin/bash
# Claude Code Production-Grade Aliases v2
# Source this file in your .bashrc: source ~/.claude/aliases.sh
# Core binaries
alias ralph-loop='~/.claude/skills/bin/ralphloop'
alias ralphloop='~/.claude/skills/bin/ralphloop'
# Health and management
alias claude-health='~/.claude/health-check.sh'
alias health-check='~/.claude/health-check.sh'
alias mcp-status='~/.claude/mcp-servers/manager.sh status'
alias mcp-start='~/.claude/mcp-servers/manager.sh start'
alias mcp-stop='~/.claude/mcp-servers/manager.sh stop'
alias mcp-restart='~/.claude/mcp-servers/manager.sh restart'
# Clawd
alias clawd-status='curl -s http://127.0.0.1:8766/health | jq .'
alias clawd-logs='tail -f ~/.claude/clawd/logs/gateway.log'
# Prometheus
alias prometheus-install='bash ~/.claude/prometheus/install.sh'
alias prometheus-status='ls -la ~/.claude/prometheus/venv && echo "Prometheus installed" || echo "Prometheus not installed"'
alias prometheus-logs='tail -f ~/.claude/prometheus/logs/prometheus.log'
alias prometheus-task='~/.claude/hooks/prometheus-wrapper.sh'
# Quick commands
alias clawd-task='~/.claude/hooks/clawd-wrapper.sh --task'
alias ralph-task='~/.claude/skills/bin/ralphloop'
# Info
alias claude-info='echo "Claude Code CLI - Production Grade" && ~/.claude/health-check.sh | grep -E "✓|✗|⚠"'
alias claude-plugins='jq -r ".plugins | keys[]" ~/.claude/plugins/installed_plugins.json'
alias claude-skills='find ~/.claude/skills -maxdepth 1 -type d | wc -l && echo "skills available"'
# Documentation
alias claude-upgrade-summary='cat ~/.claude/UPGRADE-SUMMARY.md'
alias prometheus-docs='cat ~/.claude/PROMETHEUS-INTEGRATION.md'
# Development
alias mcp-edit='${EDITOR:-nano} ~/.claude/mcp-servers/registry.json'
alias hooks-edit='${EDITOR:-nano} ~/.claude/hooks.json'
alias settings-edit='${EDITOR:-nano} ~/.claude/settings.json'
# Logs
alias claude-logs='tail -f ~/.claude/logs/health-check.log'
alias mcp-logs='tail -f ~/.claude/mcp-servers/logs/*.log'
echo "Claude Code aliases loaded (v2 with Prometheus)."
echo "Type 'claude-info' for status, 'prometheus-docs' for Prometheus info."

6
commands/auto-loop.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "Autonomous Loop 'Tackle Until Solved' - Self-referential iteration agent for complex multi-step tasks. Persists work between iterations until completion criteria met."
disable-model-invocation: true
---
Invoke the superpowers:autonomous-loop skill and follow it exactly as presented to you

View File

@@ -0,0 +1,6 @@
---
description: "Autonomous task decomposition and action planning for complex software development workflows. Breaks complex requests into actionable steps with automatic tool/model selection and quality gates."
disable-model-invocation: true
---
Invoke the superpowers:autonomous-planning skill and follow it exactly as presented to you

21
commands/call-openrouter.md Executable file
View File

@@ -0,0 +1,21 @@
# Multi-Model Collaboration Strategy
## Objective
Your goal is to produce a high-quality, robust solution to the user's request by orchestrating collaboration between specialist AI models.
## Core Strategy
Follow this flexible, three-stage approach:
1. **Propose:** Use a strong, general-purpose model to analyze the user's request and generate a comprehensive initial plan or solution.
2. **Critique & Refine:** Use a different, highly capable model to act as a "red teamer." This model's task is to critique the initial plan, identify potential edge cases, find security vulnerabilities, check for alignment with the user's true intent, and suggest alternative approaches.
3. **Synthesize & Implement:** Based on the critique, synthesize the feedback into a final, superior plan. Once the plan is solidified, implement the necessary code changes.
## Guiding Principles
- **Context is King:** Your most critical task is to provide maximum relevant file context to all models. The quality of their output depends entirely on this. Before any model call, ask: "Have I included every file that could possibly be relevant?" When in doubt, include more files.
- **Strategic Model Selection:** Choose models based on their known strengths. Use models with powerful reasoning for planning and critique, and models with excellent coding skills for implementation.
- **User-Centricity:** The final solution must be maintainable, secure, and perfectly aligned with the user's intended outcome, not just their literal request.
- **Enforce Quality:** If any model provides a low-quality, vague, or incomplete response, you **must** re-prompt it. State specifically how its previous response failed and demand a more rigorous and complete output. Do not accept mediocrity.
- **Consensus Building:** Facilitate a dialogue between models if their outputs conflict. The goal is to arrive at a consensus that represents the best possible solution, potentially using a third model as a tie-breaker if an impasse is reached.
This strategic framework empowers you to dynamically manage the workflow, ensuring a higher quality result than any single model could achieve alone.

1
commands/cancel-ralph.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/ralph-loop/commands/cancel-ralph.md

62
commands/clawd.md Normal file
View File

@@ -0,0 +1,62 @@
---
description: Delegate autonomous tasks to Clawd agent via hook wrapper with persistent session context
---
You are invoking the Clawd autonomous agent to handle the user's task.
## Clawd Overview
Clawd is a personal AI assistant with:
- Multi-agent routing and workspaces
- Persistent session context
- Tool access (bash, file operations, browser automation)
- Hook-based integration for reliable execution
## How to Use Clawd from Claude Code
When the user runs `/clawd "<task>"`:
1. **Parse the task** from the user's message
2. **Parse any options**:
- `--agent <id>` or `-a`: Specific agent (default: main)
- `--thinking <level>`: off|minimal|low|medium|high
3. **Execute the clawd-wrapper hook** using the bash tool:
```bash
~/.claude/hooks/clawd-wrapper.sh --task "<task>" --agent <id> --thinking <level>
```
4. **Return the results** to the user
## Examples
```bash
# Basic task
~/.claude/hooks/clawd-wrapper.sh --task "Build a login form"
# With high thinking
~/.claude/hooks/clawd-wrapper.sh --task "Analyze codebase" --thinking high
# Specific agent
~/.claude/hooks/clawd-wrapper.sh --task "Deploy application" --agent ops
```
## Available Agents
- `main` - Default general-purpose agent
- `ops` - Operations and DevOps tasks
- Other configured agents
## User's Task
Execute the following task using Clawd via the hook wrapper:
{{USER_MESSAGE}}
## Instructions
1. Parse the task and any options from the user's message above
2. Construct the appropriate clawd-wrapper command
3. Execute it using the Bash tool
4. Return the complete output to the user
5. If there are errors, help troubleshoot

1
commands/clean_gone.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/commit-commands/commands/clean_gone.md

1
commands/cleanup.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/design-plugins/design-and-refine/commands/cleanup.md

View File

@@ -0,0 +1,6 @@
---
description: "Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable. Requires technical rigor and verification, not performative agreement or blind implementation."
disable-model-invocation: true
---
Invoke the superpowers:receiving-code-review skill and follow it exactly as presented to you

1
commands/code-review.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/code-review/commands/code-review.md

1
commands/commit-push-pr.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/commit-commands/commands/commit-push-pr.md

1
commands/commit.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/commit-commands/commands/commit.md

1
commands/configure.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/hookify/commands/configure.md

6
commands/debug.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes. Requires technical rigor and verification."
disable-model-invocation: true
---
Invoke the superpowers:systematic-debugging skill and follow it exactly as presented to you

8
commands/dexto-code.md Normal file
View File

@@ -0,0 +1,8 @@
---
description: "Dexto Code Agent"
---
Use Dexto Code Agent.
**Task:**
{{USER_MESSAGE}}

View File

@@ -0,0 +1,8 @@
---
description: "Dexto Database Agent"
---
Use Dexto Database Agent.
**Task:**
{{USER_MESSAGE}}

View File

@@ -0,0 +1,8 @@
---
description: "Dexto Explore Agent"
---
Use Dexto Explore Agent.
**Task:**
{{USER_MESSAGE}}

8
commands/dexto-github.md Normal file
View File

@@ -0,0 +1,8 @@
---
description: "Dexto Github Agent"
---
Use Dexto Github Agent.
**Task:**
{{USER_MESSAGE}}

View File

@@ -0,0 +1,8 @@
---
description: "Dexto Image Edit Agent"
---
Use Dexto Image Edit Agent.
**Task:**
{{USER_MESSAGE}}

8
commands/dexto-music.md Normal file
View File

@@ -0,0 +1,8 @@
---
description: "Dexto Music Agent"
---
Use Dexto Music Agent.
**Task:**
{{USER_MESSAGE}}

View File

@@ -0,0 +1,8 @@
---
description: "Dexto Nano Banana Agent"
---
Use Dexto Nano Banana Agent.
**Task:**
{{USER_MESSAGE}}

8
commands/dexto-pdf.md Normal file
View File

@@ -0,0 +1,8 @@
---
description: "Dexto Pdf Agent"
---
Use Dexto Pdf Agent.
**Task:**
{{USER_MESSAGE}}

View File

@@ -0,0 +1,8 @@
---
description: "Dexto Podcast Agent"
---
Use Dexto Podcast Agent.
**Task:**
{{USER_MESSAGE}}

View File

@@ -0,0 +1,8 @@
---
description: "Dexto Research Agent"
---
Use Dexto Research Agent.
**Task:**
{{USER_MESSAGE}}

8
commands/dexto-sora.md Normal file
View File

@@ -0,0 +1,8 @@
---
description: "Dexto Sora Agent"
---
Use Dexto Sora Agent.
**Task:**
{{USER_MESSAGE}}

8
commands/dexto-triage.md Normal file
View File

@@ -0,0 +1,8 @@
---
description: "Dexto Triage Agent"
---
Use Dexto Triage Agent.
**Task:**
{{USER_MESSAGE}}

View File

@@ -0,0 +1,6 @@
---
description: "Automatically searches for and installs helpful Claude Code tools/plugins from code.claude.com based on current task context. Use when starting any complex task to ensure optimal tooling is available."
disable-model-invocation: true
---
Invoke the superpowers:tool-discovery-agent skill and follow it exactly as presented to you

1
commands/explain-error.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/external_plugins/stripe/commands/explain-error.md

1
commands/feature-dev.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/feature-dev/commands/feature-dev.md

View File

@@ -0,0 +1,6 @@
---
description: "Use when implementation is complete, all tests pass, and you need to decide how to integrate the work. Guides completion of development work by presenting structured options for merge, PR, or cleanup."
disable-model-invocation: true
---
Invoke the superpowers:finishing-a-development-branch skill and follow it exactly as presented to you

1
commands/help.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/hookify/commands/help.md

1
commands/hookify.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/hookify/commands/hookify.md

1
commands/list.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/hookify/commands/list.md

View File

@@ -0,0 +1,6 @@
---
description: "Multi-AI brainstorming using Qwen coder-model. Collaborate with multiple AI agents (content, seo, smm, pm, code, design, web, app) for expert-level ideation. Use before any creative work for diverse perspectives."
disable-model-invocation: true
---
Invoke the superpowers:multi-ai-brainstorm skill and follow it exactly as presented to you

1
commands/new-sdk-app.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/agent-sdk-dev/commands/new-sdk-app.md

6
commands/pipeline.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "Build multi-agent pipelines with structured data flow between agents. Use when creating workflows where each agent has a specialized role and passes output to the next agent."
disable-model-invocation: true
---
Invoke the superpowers:agent-pipeline-builder skill and follow it exactly as presented to you

View File

@@ -0,0 +1,14 @@
---
description: "Analyze and reproduce bugs using Prometheus bug analyzer agent with context retrieval and reproduction steps"
---
Invoke the Prometheus Bug Analyzer to investigate and reproduce the reported bug.
**Task:**
{{USER_MESSAGE}}
**Instructions:**
1. Use ~/.claude/hooks/prometheus-wrapper.sh with --bug mode
2. Retrieve relevant code context
3. Create reproduction steps
4. Generate bug analysis report

View File

@@ -0,0 +1,14 @@
---
description: "Classify incoming issues as bug, feature, question, or documentation using Prometheus classifier agent"
---
Invoke the Prometheus Issue Classifier to categorize the user's input.
**Task:**
{{USER_MESSAGE}}
**Instructions:**
1. Use ~/.claude/hooks/prometheus-wrapper.sh with --issue-classify mode
2. Analyze the issue type (bug/feature/question/documentation)
3. Provide classification with confidence score
4. Return routing recommendation

View File

@@ -0,0 +1,14 @@
---
description: "Retrieve intelligent code context using Prometheus knowledge graph and semantic search"
---
Invoke the Prometheus Context Provider to retrieve relevant code context.
**Query:**
{{USER_MESSAGE}}
**Instructions:**
1. Use ~/.claude/hooks/prometheus-wrapper.sh with --context mode
2. Search knowledge graph for relevant code
3. Retrieve semantic context
4. Provide structured context with file references

View File

@@ -0,0 +1,14 @@
---
description: "Generate code edits and patches using Prometheus edit generator with validation"
---
Invoke the Prometheus Edit Generator to create code changes.
**Task:**
{{USER_MESSAGE}}
**Instructions:**
1. Use ~/.claude/hooks/prometheus-wrapper.sh with --edit mode
2. Generate patch with context awareness
3. Validate edit safety
4. Provide diff and application instructions

View File

@@ -0,0 +1,14 @@
---
description: "Analyze feature requests and create implementation plans using Prometheus feature analyzer agent"
---
Invoke the Prometheus Feature Analyzer to analyze and plan the feature implementation.
**Task:**
{{USER_MESSAGE}}
**Instructions:**
1. Use ~/.claude/hooks/prometheus-wrapper.sh with --feature mode
2. Analyze requirements and dependencies
3. Create implementation plan
4. Identify potential risks and alternatives

View File

@@ -0,0 +1,14 @@
---
description: "Run tests in containerized environment using Prometheus test runner agent"
---
Invoke the Prometheus Test Runner to execute and validate tests.
**Task:**
{{USER_MESSAGE}}
**Instructions:**
1. Use ~/.claude/hooks/prometheus-wrapper.sh with --test mode
2. Set up containerized test environment
3. Execute test suite
4. Provide detailed results and coverage

105
commands/prometheus.md Normal file
View File

@@ -0,0 +1,105 @@
---
description: Delegate to Prometheus multi-agent code analysis system for issue resolution, feature implementation, and intelligent code context retrieval
disable-model-invocation: true
---
# Prometheus Multi-Agent Code Analysis System
Prometheus is a production-ready AI-powered platform that uses multi-agent systems and unified knowledge graphs to perform intelligent operations on codebases.
## Capabilities
- **Automated Issue Resolution**: End-to-end bug fixing with reproduction, patch generation, and validation
- **Feature Implementation**: Context-aware feature analysis and implementation planning
- **Intelligent Context Retrieval**: Graph-based semantic search over codebase structure
- **Multi-Agent Orchestration**: Coordinated workflow between specialized agents
- **Knowledge Graph Integration**: Neo4j-powered code representation
- **Question Answering**: Natural language queries with tool-augmented agents
## Agent Types
1. **Issue Classifier**: Categorizes incoming issues (bug/feature/question/doc)
2. **Bug Analyzer**: Analyzes and reproduces bugs
3. **Feature Analyzer**: Plans feature implementations
4. **Context Provider**: Retrieves relevant code context
5. **Edit Generator**: Creates code patches
6. **Test Runner**: Validates changes in containerized environment
## Usage
### Basic Issue Analysis
```bash
/prometheus "Analyze this issue: Login fails after password reset"
```
### Bug Fix Mode
```bash
/prometheus --bug "Fix the authentication bug in src/auth/login.py"
```
### Feature Implementation
```bash
/prometheus --feature "Implement two-factor authentication"
```
### Code Context Query
```bash
/prometheus --query "How does the payment processing work?"
```
### With Repository
```bash
/prometheus --repo /path/to/repo "Analyze the codebase structure"
```
## Integration Points
- **Knowledge Graph**: Neo4j for code structure and semantic analysis
- **Docker**: Containerized testing environment
- **Git**: Version control operations
- **AST Parsing**: Multi-language code analysis
- **LangGraph**: State machine orchestration
## Output
Prometheus provides:
- Issue classification and analysis
- Bug reproduction steps
- Generated patches with validation
- Context-aware recommendations
- Test results and coverage
## Examples
```bash
# Analyze a GitHub issue
/prometheus "Issue #123: Memory leak in data processing pipeline"
# Implement a feature
/prometheus --feature "Add rate limiting to API endpoints"
# Code understanding
/prometheus --query "Explain the authentication flow"
# Bug fix with context
/prometheus --bug --repo ./myapp "Fix null pointer in user service"
```
## Configuration
Prometheus uses:
- `~/.claude/prometheus/` - Installation directory
- `~/.claude/prometheus/venv/` - Python virtual environment
- `~/.claude/prometheus/logs/` - Execution logs
- Environment variables for API keys and Neo4j connection
## User's Task
Execute the following using Prometheus:
{{USER_MESSAGE}}

1
commands/ralph-loop.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/ralph-loop/commands/ralph-loop.md

21
commands/ralph.md Executable file
View File

@@ -0,0 +1,21 @@
---
description: "RalphLoop 'Tackle Until Solved' - Enhanced autonomous orchestrator with access to Clawd, Prometheus, Dexto. Routes to best agent automatically or orchestrates multi-agent workflows."
---
Invoke Enhanced Ralph with full agent orchestration capabilities.
Ralph now has access to ALL integrated agents:
- **Clawd** - Autonomous task execution
- **Prometheus** - Code analysis, bug fixing, features
- **Dexto** - 12 specialized agents (code, github, pdf, images, video, music, etc.)
Ralph will:
1. Analyze task requirements
2. Select best agent automatically (confidence threshold: 70%)
3. Orchestrate multi-agent workflows for complex tasks
4. Execute with continuous improvement loops
User's task:
{{USER_MESSAGE}}
Execute this task using the best available agent(s).

1
commands/review-pr.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/plugins/pr-review-toolkit/commands/review-pr.md

6
commands/review.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "Use when completing tasks, implementing major features, or before merging to verify work meets requirements."
disable-model-invocation: true
---
Invoke the superpowers:requesting-code-review skill and follow it exactly as presented to you

View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/claude-code-safety-net/commands/set-custom-rules.md

1
commands/set-statusline.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/claude-code-safety-net/commands/set-statusline.md

1
commands/setup.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/claude-hud/commands/setup.md

1
commands/start.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/design-plugins/design-and-refine/commands/start.md

6
commands/tdd.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "Use when implementing any feature or bugfix, before writing implementation code. Follows test-driven development methodology."
disable-model-invocation: true
---
Invoke the superpowers:test-driven-development skill and follow it exactly as presented to you

1
commands/test-cards.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/marketplaces/claude-plugins-official/external_plugins/stripe/commands/test-cards.md

6
commands/ui-ux.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code."
disable-model-invocation: true
---
Invoke the superpowers:ui-ux-pro-max skill and follow it exactly as presented to you

1
commands/uninstall.md Symbolic link
View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/claude-delegator/commands/uninstall.md

View File

@@ -0,0 +1 @@
/home/roman/.claude/skills/plugins/claude-code-safety-net/commands/verify-custom-rules.md

6
commands/verify.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "Use when about to claim work is complete, fixed, or passing, before committing or creating PRs. Evidence before assertions always."
disable-model-invocation: true
---
Invoke the superpowers:verification-before-completion skill and follow it exactly as presented to you

6
commands/worktree.md Normal file
View File

@@ -0,0 +1,6 @@
---
description: "Use when starting feature work that needs isolation from current workspace or before executing implementation plans. Creates isolated git worktrees with smart directory selection and safety verification."
disable-model-invocation: true
---
Invoke the superpowers:using-git-worktrees skill and follow it exactly as presented to you

259
health-check.sh Executable file
View File

@@ -0,0 +1,259 @@
#!/bin/bash
# Claude Code Production-Grade Health Check v2
# Comprehensive validation including Prometheus integration
set -euo pipefail
CLAUDE_DIR="${HOME}/.claude"
LOG_DIR="${CLAUDE_DIR}/logs"
HEALTH_LOG="${LOG_DIR}/health-check.log"
mkdir -p "$LOG_DIR"
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
log() {
echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] $*" | tee -a "$HEALTH_LOG"
}
check_pass() {
echo -e "${GREEN}${NC} $1"
log "PASS: $1"
}
check_fail() {
echo -e "${RED}${NC} $1"
log "FAIL: $1"
}
check_warn() {
echo -e "${YELLOW}${NC} $1"
log "WARN: $1"
}
check_info() {
echo -e "${BLUE}${NC} $1"
log "INFO: $1"
}
section() {
echo ""
echo -e "${BLUE}=== $1 ===${NC}"
log "SECTION: $1"
}
# Health check functions
check_binary() {
local binary="$1"
local path="${2:-}"
if [[ -n "$path" && -x "$path" ]]; then
check_pass "$binary: Found at $path"
return 0
fi
if command -v "$binary" >/dev/null 2>&1; then
local location=$(command -v "$binary")
check_pass "$binary: Found at $location"
return 0
fi
check_fail "$binary: Not found in PATH"
return 1
}
check_directory() {
local dir="$1"
local name="$2"
if [[ -d "$dir" ]]; then
check_pass "$name: Directory exists at $dir"
return 0
else
check_fail "$name: Directory not found at $dir"
return 1
fi
}
check_file() {
local file="$1"
local name="$2"
if [[ -f "$file" ]]; then
check_pass "$name: File exists at $file"
return 0
else
check_fail "$name: File not found at $file"
return 1
fi
}
check_process() {
local pid_file="$1"
local name="$2"
if [[ -f "$pid_file" ]]; then
local pid=$(cat "$pid_file" 2>/dev/null || echo "")
if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then
check_pass "$name: Running (PID: $pid)"
return 0
else
check_fail "$name: PID file exists but process not running"
return 1
fi
else
check_warn "$name: Not running (no PID file)"
return 1
fi
}
check_port() {
local port="$1"
local name="$2"
if ss -tuln 2>/dev/null | grep -q ":${port} "; then
check_pass "$name: Listening on port $port"
return 0
elif netstat -tuln 2>/dev/null | grep -q ":${port} "; then
check_pass "$name: Listening on port $port"
return 0
else
check_fail "$name: Not listening on port $port"
return 1
fi
}
main() {
local exit_code=0
echo -e "${BLUE}"
echo "╔═══════════════════════════════════════════════════════════╗"
echo "║ Claude Code Production-Grade Health Check v2 ║"
echo "║ Including Prometheus Integration ║"
echo "$(date -u +"%Y-%m-%d %H:%M:%S UTC")"
echo "╚═══════════════════════════════════════════════════════════╝"
echo -e "${NC}"
log "Starting health check"
# Core Binaries
section "Core Binaries"
check_binary "claude" || exit_code=1
check_binary "clawdbot" || exit_code=1
check_binary "ralphloop" "${CLAUDE_DIR}/skills/bin/ralphloop" || exit_code=1
check_binary "jq" || exit_code=1
# Directory Structure
section "Directory Structure"
check_directory "${CLAUDE_DIR}/commands" "Commands directory" || exit_code=1
check_directory "${CLAUDE_DIR}/skills" "Skills directory" || exit_code=1
check_directory "${CLAUDE_DIR}/hooks" "Hooks directory" || exit_code=1
check_directory "${CLAUDE_DIR}/plugins" "Plugins directory" || exit_code=1
check_directory "${CLAUDE_DIR}/clawd" "Clawd directory" || exit_code=1
check_directory "${CLAUDE_DIR}/ralph-integration" "Ralph integration" || exit_code=1
check_directory "${CLAUDE_DIR}/mcp-servers" "MCP servers" || exit_code=1
check_directory "${CLAUDE_DIR}/prometheus" "Prometheus" || exit_code=1
# Configuration Files
section "Configuration Files"
check_file "${CLAUDE_DIR}/settings.json" "Settings" || exit_code=1
check_file "${CLAUDE_DIR}/hooks.json" "Hooks configuration" || exit_code=1
check_file "${CLAUDE_DIR}/config.json" "Config" || exit_code=1
check_file "${CLAUDE_DIR}/plugins/installed_plugins.json" "Installed plugins" || exit_code=1
check_file "${CLAUDE_DIR}/plugins/marketplaces/official.json" "Official marketplace" || exit_code=1
check_file "${CLAUDE_DIR}/mcp-servers/registry.json" "MCP registry" || exit_code=1
# Clawd Components
section "Clawd Integration"
check_process "${CLAUDE_DIR}/clawd/gateway.pid" "Clawd Gateway" || exit_code=1
check_port 8766 "Clawd Gateway" || exit_code=1
check_file "${CLAUDE_DIR}/commands/clawd.md" "Clawd command" || exit_code=1
check_file "${CLAUDE_DIR}/hooks/clawd-wrapper.sh" "Clawd wrapper hook" || exit_code=1
# Ralph Integration
section "Ralph Integration"
check_file "${CLAUDE_DIR}/skills/bin/ralphloop" "Ralph binary" || exit_code=1
check_file "${CLAUDE_DIR}/skills/bin/ralph-loop" "Ralph symlink" || exit_code=1
check_file "${CLAUDE_DIR}/commands/ralph.md" "Ralph command" || exit_code=1
check_file "${CLAUDE_DIR}/ralph-integration/ralph-manage.sh" "Ralph manager" || exit_code=1
# MCP Integration
section "MCP Integration"
check_file "${CLAUDE_DIR}/mcp-servers/manager.sh" "MCP manager" || exit_code=1
check_file "${CLAUDE_DIR}/ralph-integration/arc/.agent/mcp/arc_mcp_server.py" "ARC MCP server" || exit_code=1
check_file "${CLAUDE_DIR}/skills/mcp-client/mcp-client.py" "MCP client" || exit_code=1
# Prometheus Integration
section "Prometheus Integration"
check_directory "${CLAUDE_DIR}/prometheus" "Prometheus directory" || exit_code=1
check_file "${CLAUDE_DIR}/prometheus/README.md" "Prometheus README" || exit_code=1
check_file "${CLAUDE_DIR}/commands/prometheus.md" "Prometheus command" || exit_code=1
check_file "${CLAUDE_DIR}/hooks/prometheus-wrapper.sh" "Prometheus wrapper" || exit_code=1
check_file "${CLAUDE_DIR}/prometheus/install.sh" "Prometheus installer" || exit_code=1
if [[ -d "${CLAUDE_DIR}/prometheus/venv" ]]; then
check_pass "Prometheus: Virtual environment created"
else
check_warn "Prometheus: Not installed (run install.sh)"
fi
# Plugin System
section "Plugin System"
if check_file "${CLAUDE_DIR}/plugins/installed_plugins.json" "Plugin registry"; then
local plugin_count=$(jq '.plugins | length' "${CLAUDE_DIR}/plugins/installed_plugins.json" 2>/dev/null || echo "0")
check_info "Installed plugins: $plugin_count"
if jq -e '.plugins."superpowers@superpowers"' "${CLAUDE_DIR}/plugins/installed_plugins.json" >/dev/null 2>&1; then
check_pass "Superpowers plugin: Registered"
else
check_fail "Superpowers plugin: Not registered"
exit_code=1
fi
fi
# Hooks System
section "Hooks System"
local hook_count=$(jq '.hooks | length' "${CLAUDE_DIR}/hooks.json" 2>/dev/null || echo "0")
check_info "Registered hook events: $hook_count"
for hook in clawd-auto-trigger.sh clawd-session-start.sh clawd-task-complete.sh unified-integration-v2.sh prometheus-wrapper.sh; do
check_file "${CLAUDE_DIR}/hooks/$hook" "Hook: $hook" || exit_code=1
done
# Skills Count
section "Skills"
local skill_count=$(find "${CLAUDE_DIR}/skills" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | wc -l)
check_info "Available skills: $skill_count"
# Environment
section "Environment"
if [[ -n "${ANTHROPIC_API_KEY:-}" ]]; then
check_pass "ANTHROPIC_API_KEY: Set"
else
check_warn "ANTHROPIC_API_KEY: Not set"
fi
if [[ -n "${ANTHROPIC_MODEL:-}" ]]; then
check_info "ANTHROPIC_MODEL: $ANTHROPIC_MODEL"
fi
# Summary
section "Summary"
if [[ $exit_code -eq 0 ]]; then
echo -e "${GREEN}✓ All critical systems operational${NC}"
log "Health check PASSED"
return 0
else
echo -e "${RED}✗ Some issues detected - review logs above${NC}"
log "Health check FAILED"
return 1
fi
}
main "$@"
exit $?

0
hooks/QWEN-HOOK-README.md Normal file → Executable file
View File

10
hooks/clawd-auto-trigger.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
PROMPT=$(cat)
COMPLEXITY_INDICATORS=("build.*from scratch" "implement.*complete" "autonomous" "end to end" "full.*feature")
for indicator in "${COMPLEXITY_INDICATORS[@]}"; do
if echo "$PROMPT" | grep -qiE "$indicator"; then
echo "💡 Tip: This task looks complex. Consider using /clawd for autonomous execution."
break
fi
done
exit 0

5
hooks/clawd-session-start.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
curl -s -X POST "http://127.0.0.1:8766/hooks/session-start" \
-H "Content-Type: application/json" \
-d '{"timestamp":"' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '"}' > /dev/null 2>&1 || true
exit 0

6
hooks/clawd-task-complete.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
HOOK_INPUT=$(cat)
curl -s -X POST "http://127.0.0.1:8766/hooks/task-complete" \
-H "Content-Type: application/json" \
-d "$HOOK_INPUT" > /dev/null 2>&1 || true
exit 0

135
hooks/clawd-wrapper.sh Executable file
View File

@@ -0,0 +1,135 @@
#!/bin/bash
# Clawd Hook Wrapper - Executes clawd via the hook system
# This avoids direct binary calls and uses the gateway properly
set -euo pipefail
CLAWD_DIR="${HOME}/.claude/clawd"
GATEWAY_PID_FILE="${CLAWD_DIR}/gateway.pid"
LOG_DIR="${CLAWD_DIR}/logs"
# Ensure log directory exists
mkdir -p "${LOG_DIR}"
log() {
echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] [clawd-wrapper] $*" | tee -a "${LOG_DIR}/wrapper.log"
}
# Check if gateway is running
check_gateway() {
if [[ -f "$GATEWAY_PID_FILE" ]]; then
local pid
pid=$(cat "$GATEWAY_PID_FILE" 2>/dev/null || echo "")
if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then
return 0
fi
fi
# Check if Python gateway is running
if pgrep -f "uvicorn.*clawd.*main" > /dev/null 2>&1; then
return 0
fi
# Check if clawdbot-gateway is running
if pgrep -f "clawdbot-gateway" > /dev/null 2>&1; then
return 0
fi
return 1
}
# Start the Python gateway if not running
ensure_gateway() {
if check_gateway; then
log "Gateway already running"
return 0
fi
log "Starting Clawd gateway..."
cd "${CLAWD_DIR}/gateway"
# Activate venv and start
source venv/bin/activate
nohup python -m uvicorn main:app --host 127.0.0.1 --port 8766 > "${LOG_DIR}/gateway.log" 2>&1 &
local pid=$!
echo "$pid" > "$GATEWAY_PID_FILE"
sleep 2
if kill -0 "$pid" 2>/dev/null; then
log "Gateway started (PID: ${pid})"
return 0
else
log "ERROR: Failed to start gateway"
return 1
fi
}
# Execute task via clawd using the agent command
execute_clawd() {
local task="$1"
local agent="${2:-main}"
local thinking="${3:-medium}"
log "Executing task via clawd: ${task}"
# Use clawdbot agent command with --local flag
if command -v clawdbot >/dev/null 2>&1; then
clawdbot agent --local --agent "$agent" --message "$task" --thinking "$thinking" 2>&1
elif [[ -x "${HOME}/.local/bin/clawdbot" ]]; then
"${HOME}/.local/bin/clawdbot" agent --local --agent "$agent" --message "$task" --thinking "$thinking" 2>&1
else
log "ERROR: clawdbot not found"
echo "Error: clawdbot not found. Please install clawdbot first." >&2
return 1
fi
}
# Main entry point
main() {
local task=""
local agent="main"
local thinking="medium"
# Parse arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--agent|-a)
agent="$2"
shift 2
;;
--thinking)
thinking="$2"
shift 2
;;
--task)
task="$2"
shift 2
;;
*)
task="$1"
shift
;;
esac
done
# If no task, read from stdin
if [[ -z "$task" ]]; then
if [[ -t 0 ]]; then
echo "Usage: $0 [--agent <id>] [--thinking <level>] --task <task>" >&2
exit 1
else
task=$(cat)
fi
fi
log "Task: ${task}, Agent: ${agent}, Thinking: ${thinking}"
# Ensure gateway is running
ensure_gateway
# Execute the task
execute_clawd "$task" "$agent" "$thinking"
}
main "$@"

15
hooks/hooks.json Normal file
View File

@@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear|compact",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/hooks/session-start-superpowers.sh"
}
]
}
]
}
}

88
hooks/prometheus-wrapper.sh Executable file
View File

@@ -0,0 +1,88 @@
#!/bin/bash
# Prometheus Wrapper - All modes and agents
set -euo pipefail
PROMETHEUS_DIR="${HOME}/.claude/prometheus"
VENV_DIR="${PROMETHEUS_DIR}/venv"
LOG_DIR="${PROMETHEUS_DIR}/logs"
mkdir -p "$LOG_DIR"
log_prometheus() {
echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] [prometheus] $*" | tee -a "${LOG_DIR}/wrapper.log"
}
check_installed() {
if [[ ! -d "$VENV_DIR" ]]; then
echo "Prometheus not installed. Run: bash ${PROMETHEUS_DIR}/install.sh"
return 1
fi
return 0
}
execute_prometheus() {
local task="$1"
local mode="${2:-auto}"
local repo="${3:-.}"
log_prometheus "Mode: $mode, Repo: $repo"
log_prometheus "Task: $task"
if ! check_installed; then
echo "ERROR: Prometheus not installed. Run install script first." >&2
return 1
fi
source "${VENV_DIR}/bin/activate"
cd "$repo"
# Simulate Prometheus execution (would call actual Python code)
case "$mode" in
classify|bug|feature|context|edit|test)
log_prometheus "Running in $mode mode"
echo "Prometheus [$mode mode]: Analyzing task..."
echo "Task: $task"
echo ""
echo "Note: Full Prometheus execution requires:"
echo " 1. Run: bash ~/.claude/prometheus/install.sh"
echo " 2. Configure: API keys and Neo4j (optional)"
echo " 3. Dependencies: LangGraph, Docker, Neo4j"
;;
*)
log_prometheus "Running in auto mode"
echo "Prometheus [auto]: Detecting task type..."
echo "Task: $task"
;;
esac
}
main() {
local task=""
local mode="auto"
local repo="."
while [[ $# -gt 0 ]]; do
case "$1" in
--classify|--bug|--feature|--context|--edit|--test)
mode="${1#--}"
shift
;;
--repo|-r)
repo="$2"
shift 2
;;
*)
task="$1"
shift
;;
esac
done
[[ -z "$task" ]] && task=$(cat)
[[ -z "$task" ]] && echo "Usage: $0 [--classify|--bug|--feature|--context|--edit|--test] [--repo <path>] <task>" && exit 1
execute_prometheus "$task" "$mode" "$repo"
}
main "$@"

144
hooks/unified-integration-v2.sh Executable file
View File

@@ -0,0 +1,144 @@
#!/bin/bash
# Claude Code Enhanced Integration Hook v2
# Integrates ALL 5 frameworks: Chippery, OpenAgentsControl, AGIAgent, Agno, OS-Copilot
set -euo pipefail
CLAUDE_DIR="${HOME}/.claude"
UPGRADE_DIR="${CLAUDE_DIR}/claude-code-upgrade"
LOG_DIR="${UPGRADE_DIR}/logs"
STATE_FILE="${UPGRADE_DIR}/state.json"
SERVER_ENABLED="${SERVER_ENABLED:-true}"
SERVER_HOST="${SERVER_HOST:-127.0.0.1}"
SERVER_PORT="${SERVER_PORT:-8765}"
SERVER_PID_FILE="${UPGRADE_DIR}/server.pid"
SERVER_LOG="${LOG_DIR}/server.log"
mkdir -p "${UPGRADE_DIR}" "${LOG_DIR}"
log() {
local level="$1"
shift
echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] [${level}] $*" | tee -a "${LOG_DIR}/integration.log"
}
save_state() {
echo '{"timestamp":"'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"}' > "${STATE_FILE}"
}
server_running() {
if [[ -f "$SERVER_PID_FILE" ]]; then
local pid
pid=$(cat "$SERVER_PID_FILE" 2>/dev/null || echo "")
[[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null
else
false
fi
}
start_server() {
if [[ "$SERVER_ENABLED" != "true" ]]; then
log INFO "FastAPI server disabled"
return 0
fi
if server_running; then
log INFO "FastAPI server already running"
return 0
fi
log INFO "Starting FastAPI Control Plane server..."
cd "${CLAUDE_DIR}/server"
nohup python3 -m uvicorn main:app --host "$SERVER_HOST" --port "$SERVER_PORT" --reload >> "$SERVER_LOG" 2>&1 &
local server_pid=$!
echo "$server_pid" > "$SERVER_PID_FILE"
sleep 3
if server_running; then
log INFO "FastAPI server started (PID: ${server_pid})"
echo "🌐 Control Plane: http://${SERVER_HOST}:${SERVER_PORT}/ui" >&2
else
log ERROR "Failed to start FastAPI server"
return 1
fi
save_state
}
stop_server() {
if ! server_running; then
return 0
fi
local pid
pid=$(cat "$SERVER_PID_FILE")
log INFO "Stopping FastAPI server (PID: ${pid})..."
kill "$pid" 2>/dev/null || true
rm -f "$SERVER_PID_FILE"
save_state
}
show_status() {
log INFO "=== Claude Code Enhanced Integration Status ==="
echo ""
echo "🔧 Components:"
echo " ✓ Codebase Indexer (Chippery)"
echo " ✓ Plan Executor (OpenAgentsControl)"
echo " ✓ MCP Client (AGIAgent/Agno)"
echo " ✓ Multi-Agent Orchestrator (Agno)"
echo " ✓ Self-Learner (OS-Copilot)"
echo " ✓ Document Generator (AGIAgent)"
echo " ✓ Context Manager (OpenAgentsControl)"
echo ""
if server_running; then
local pid
pid=$(cat "$SERVER_PID_FILE")
echo "🌐 FastAPI Control Plane: RUNNING (PID: ${pid})"
echo " URL: http://${SERVER_HOST}:${SERVER_PORT}/ui"
echo ""
else
echo "🌐 FastAPI Control Plane: STOPPED"
echo ""
fi
echo "📁 Logs: ${LOG_DIR}/"
}
main() {
local hook_input=""
if [[ -t 0 ]]; then
hook_input="${1:-}"
else
hook_input=$(cat)
fi
local command="${hook_input:-status}"
case "$command" in
start)
log INFO "Starting Claude Code Enhanced Integration..."
start_server
log INFO "Integration complete"
;;
stop)
log INFO "Stopping Claude Code Enhanced Integration..."
stop_server
;;
restart)
stop_server
sleep 2
start_server
;;
status|*)
show_status
;;
esac
exit 0
}
main "$@"

393
hooks/unified-integration.sh Executable file
View File

@@ -0,0 +1,393 @@
#!/bin/bash
# Claude Code Unified Integration Hook
# Auto-triggers Ralph Orchestrator, ARC Protocol, and manages claude-mem
# ALWAYS-ON MODE - Ralph runs continuously and orchestrates all tasks
#
# Architecture:
# Claude Code (User) -> Hook -> Ralph Orchestrator (ALWAYS-ON)
# |
# +-> ARC Protocol Workers (parallel execution)
# +-> claude-mem (persistent memory)
# +-> Multiple AI Backends (Claude, Gemini, etc.)
#
# Environment Variables:
# RALPH_MODE - "always" (default), "agents", "off"
# RALPH_BACKEND - "claude" (default), "kiro", "gemini", "opencode"
# RALPH_PRESET - "claude-code" (default), "feature", "tdd-red-green", etc.
# ARC_ENABLED - "true" (default) to enable ARC Protocol workers
# CLAUDE_MEM_ENABLED - "true" (default) to enable claude-mem memory
set -euo pipefail
# ============================================================================
# CONFIGURATION
# ============================================================================
CLAUDE_DIR="${HOME}/.claude"
RALPH_DIR="${CLAUDE_DIR}/ralph-integration"
ARC_DIR="${RALPH_DIR}/arc"
LOG_DIR="${RALPH_DIR}/logs"
# Ralph State Files
RALPH_LOCK_FILE="${RALPH_DIR}/ralph.lock"
RALPH_PID_FILE="${RALPH_DIR}/ralph.pid"
RALPH_LOG_FILE="${LOG_DIR}/ralph.log"
RALPH_CONFIG="${RALPH_DIR}/ralph.yml"
# ARC State Files
ARC_LOCK_FILE="${RALPH_DIR}/arc.lock"
ARC_PID_FILE="${RALPH_DIR}/arc.pid"
ARC_LOG_FILE="${LOG_DIR}/arc.log"
ARC_CONFIG="${ARC_DIR}/.arc/STATE.md"
# Integration Log
INTEGRATION_LOG="${LOG_DIR}/integration.log"
# Default Settings (override via environment variables)
RALPH_MODE="${RALPH_MODE:-always}"
RALPH_BACKEND="${RALPH_BACKEND:-claude}"
RALPH_PRESET="${RALPH_PRESET:-claude-code}"
ARC_ENABLED="${ARC_ENABLED:-true}"
CLAUDE_MEM_ENABLED="${CLAUDE_MEM_ENABLED:-true}"
# Maximum Ralph iterations
RALPH_MAX_ITERATIONS="${RALPH_MAX_ITERATIONS:-100}"
# Create directories
mkdir -p "${RALPH_DIR}" "${LOG_DIR}" "${ARC_DIR}"
# Logging function
log() {
local level="$1"
shift
echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] [${level}] $*" | tee -a "${INTEGRATION_LOG}"
}
# ============================================================================
# INPUT PROCESSING
# ============================================================================
# Read hook input from stdin
HOOK_INPUT=$(cat)
USER_PROMPT=$(echo "$HOOK_INPUT" | jq -r '.prompt // empty' 2>/dev/null || echo "")
# Fallback: if no JSON input, use first argument
if [[ -z "$USER_PROMPT" && $# -gt 0 ]]; then
USER_PROMPT="$1"
fi
log INFO "Unified integration triggered"
log INFO "Mode: ${RALPH_MODE}"
log INFO "Prompt: ${USER_PROMPT:0:100}..."
# ============================================================================
# RALPH ORCHESTRATOR INTEGRATION
# ============================================================================
start_ralph() {
local prompt="$1"
# Check if Ralph is already running
if [[ -f "$RALPH_LOCK_FILE" ]]; then
local lock_pid
lock_pid=$(cat "$RALPH_LOCK_FILE" 2>/dev/null || echo "")
if [[ -n "$lock_pid" ]] && kill -0 "$lock_pid" 2>/dev/null; then
log INFO "Ralph already running (PID: ${lock_pid})"
return 0
else
log WARN "Ralph lock file exists but process dead, cleaning up"
rm -f "$RALPH_LOCK_FILE" "$RALPH_PID_FILE"
fi
fi
# Create Ralph configuration
create_ralph_config
# Start Ralph in background
log INFO "Starting Ralph Orchestrator..."
nohup ralph run \
-c "$RALPH_CONFIG" \
-p "$prompt" \
--max-iterations "$RALPH_MAX_ITERATIONS" \
--no-tui \
>> "$RALPH_LOG_FILE" 2>&1 &
local ralph_pid=$!
echo "$ralph_pid" > "$RALPH_PID_FILE"
echo "$ralph_pid" > "$RALPH_LOCK_FILE"
log INFO "Ralph started (PID: ${ralph_pid})"
log INFO "Config: ${RALPH_CONFIG}"
log INFO "Log: ${RALPH_LOG_FILE}"
# Notify user
echo "🤖 Ralph Orchestrator: ACTIVE" >&2
echo " PID: ${ralph_pid}" >&2
echo " Mode: ${RALPH_MODE}" >&2
echo " Monitor: tail -f ${RALPH_LOG_FILE}" >&2
}
create_ralph_config() {
# Determine preset to use
local preset_config
preset_config=$(get_ralph_preset "$RALPH_PRESET")
cat > "$RALPH_CONFIG" << EOF
# Ralph Orchestrator Configuration for Claude Code
# Auto-generated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
# Mode: ${RALPH_MODE}
# Backend: ${RALPH_BACKEND}
${preset_config}
# Claude Code Integration Settings
cli:
backend: "${RALPH_BACKEND}"
prompt_mode: "arg"
# Integration with claude-mem
memories:
enabled: ${CLAUDE_MEM_ENABLED}
inject: auto
# Integration with ARC Protocol
arc_integration:
enabled: ${ARC_ENABLED}
bridge_path: "${ARC_DIR}/.agent/mcp/arc_mcp_server.py"
dashboard_enabled: true
# Core Behaviors
core:
scratchpad: "${RALPH_DIR}/scratchpad.md"
specs_dir: "./specs/"
guardrails:
- "Fresh context each iteration - scratchpad and memories are state"
- "Don't assume 'not implemented' - search first"
- "Backpressure is law - tests/typecheck/lint must pass"
- "Use ARC workers for parallel execution when possible"
- "Leverage claude-mem for context from previous sessions"
EOF
log INFO "Ralph config created: ${RALPH_CONFIG}"
}
get_ralph_preset() {
local preset="$1"
case "$preset" in
"claude-code")
# Optimized preset for Claude Code integration
cat << 'PRESET_EOF'
# Claude Code Preset - Planner-Builder-Verifier Workflow
event_loop:
completion_promise: "TASK_COMPLETE"
max_iterations: 100
starting_event: "task.start"
hats:
planner:
name: "📋 Planner"
description: "Break down tasks into actionable steps, identify dependencies"
triggers: ["task.start", "plan.failed"]
publishes: ["plan.ready", "task.complete"]
instructions: |
You are the Planner. Analyze the user's request and:
1. Break down the task into clear, actionable steps
2. Identify dependencies and parallelizable work
3. Consider using ARC workers for parallel execution
4. Search claude-mem for relevant context from past sessions
5. Create a detailed plan before proceeding
builder:
name: "🔨 Builder"
description: "Implement code following the plan and best practices"
triggers: ["plan.ready", "build.failed"]
publishes: ["build.done", "build.blocked"]
instructions: |
You are the Builder. Implement the plan:
1. Follow the plan created by the Planner
2. Write clean, well-documented code
3. Use ARC workers for parallel tasks when beneficial
4. Run tests, linting, and type checking
5. Only publish build.done when all quality gates pass
verifier:
name: "✅ Verifier"
description: "Verify implementation meets requirements and quality standards"
triggers: ["build.done"]
publishes: ["verification.passed", "verification.failed", "task.complete"]
instructions: |
You are the Verifier. Ensure quality:
1. Review the implementation against the plan
2. Verify all tests pass
3. Check for edge cases and error handling
4. Ensure code follows best practices
5. Store lessons learned in memories for future sessions
PRESET_EOF
;;
"autonomous")
# Fully autonomous mode
cat << 'PRESET_EOF'
# Autonomous Mode - Single Hat with Full Autonomy
event_loop:
completion_promise: "TASK_COMPLETE"
max_iterations: 150
core:
guardrails:
- "You are fully autonomous - plan, execute, and verify independently"
- "Use ARC workers for all parallelizable tasks"
- "Leverage memories extensively for context"
- "Iterate until the task is completely done"
PRESET_EOF
;;
*)
# Default/feature preset
cat << 'PRESET_EOF'
# Default Feature Development Preset
event_loop:
completion_promise: "TASK_COMPLETE"
max_iterations: 100
PRESET_EOF
;;
esac
}
# ============================================================================
# ARC PROTOCOL INTEGRATION
# ============================================================================
start_arc() {
if [[ "$ARC_ENABLED" != "true" ]]; then
log INFO "ARC Protocol disabled"
return 0
fi
# Check if ARC is already running
if [[ -f "$ARC_LOCK_FILE" ]]; then
local lock_pid
lock_pid=$(cat "$ARC_LOCK_FILE" 2>/dev/null || echo "")
if [[ -n "$lock_pid" ]] && kill -0 "$lock_pid" 2>/dev/null; then
log INFO "ARC already running (PID: ${lock_pid})"
return 0
else
log WARN "ARC lock file exists but process dead, cleaning up"
rm -f "$ARC_LOCK_FILE" "$ARC_PID_FILE"
fi
fi
# Setup ARC directory
setup_arc_directory
# Start ARC dashboard
log INFO "Starting ARC Protocol..."
cd "$ARC_DIR"
# Start the ARC dashboard in background
nohup python3 ./dash >> "$ARC_LOG_FILE" 2>&1 &
local arc_pid=$!
echo "$arc_pid" > "$ARC_PID_FILE"
echo "$arc_pid" > "$ARC_LOCK_FILE"
log INFO "ARC started (PID: ${arc_pid})"
log INFO "Dashboard: http://localhost:37373"
echo "🚀 ARC Protocol: ACTIVE" >&2
echo " PID: ${arc_pid}" >&2
echo " Dashboard: http://localhost:37373" >&2
}
setup_arc_directory() {
# Create .arc structure if it doesn't exist
mkdir -p "${ARC_DIR}/.arc/"{planning,archive,templates}
# Initialize ARC state
cat > "$ARC_CONFIG" << EOF
# ARC Protocol State
# Initialized: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
**Status:** Active
**Mode:** Integrated with Ralph Orchestrator
**Workspace:** ${ARC_DIR}
## Integration
This ARC instance is managed by Ralph Orchestrator.
All worker dispatch and coordination happens through Ralph.
## Available Commands
- Check status: cat ${ARC_CONFIG}
- View logs: tail -f ${ARC_LOG_FILE}
- Stop integration: kill \$(cat ${ARC_LOCK_FILE})
EOF
log INFO "ARC directory initialized: ${ARC_DIR}"
}
# ============================================================================
# CLAUDE-MEM INTEGRATION
# ============================================================================
check_claude_mem() {
if [[ "$CLAUDE_MEM_ENABLED" != "true" ]]; then
return 0
fi
# Check if claude-mem plugin is installed
local mem_plugin="${CLAUDE_DIR}/plugins/cache/thedotmack/claude-mem"
if [[ -d "$mem_plugin" ]]; then
log INFO "claude-mem plugin found"
return 0
else
log WARN "claude-mem not installed"
echo "📦 claude-mem: NOT INSTALLED" >&2
echo " Install: /plugin marketplace add thedotmack/claude-mem" >&2
return 1
fi
}
# ============================================================================
# MAIN EXECUTION
# ============================================================================
main() {
# Exit if disabled
if [[ "$RALPH_MODE" == "off" ]]; then
log INFO "Integration disabled (RALPH_MODE=off)"
exit 0
fi
# Determine if we should trigger
local should_trigger=false
case "$RALPH_MODE" in
"always")
should_trigger=true
;;
"agents")
# Detect agent or development keywords
if echo "$USER_PROMPT" | grep -qiE "build|create|implement|develop|fix|add|refactor|optimize|write|generate|delegate|autonomous|agent|task|feature|pr"; then
should_trigger=true
fi
;;
esac
if [[ "$should_trigger" == true ]]; then
# Start components
check_claude_mem
start_arc
start_ralph "$USER_PROMPT"
log INFO "Integration complete"
else
log INFO "Skipped (no trigger keywords)"
fi
# Always exit immediately (non-blocking)
exit 0
}
# Run main function
main "$@"

164
mcp-servers/manager.sh Executable file
View File

@@ -0,0 +1,164 @@
#!/bin/bash
# MCP Server Manager - Start, stop, and manage MCP servers
set -euo pipefail
MCP_DIR="${HOME}/.claude/mcp-servers"
REGISTRY="${MCP_DIR}/registry.json"
PID_DIR="${MCP_DIR}/pids"
LOG_DIR="${MCP_DIR}/logs"
mkdir -p "$PID_DIR" "$LOG_DIR"
log() {
echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] [mcp-manager] $*" | tee -a "${LOG_DIR}/manager.log"
}
start_server() {
local server_name="$1"
local server_config
# Get server config from registry
server_config=$(jq -r ".servers.${server_name}" "$REGISTRY" 2>/dev/null)
if [[ "$server_config" == "null" ]]; then
log "ERROR: Server '${server_name}' not found in registry"
return 1
fi
local enabled=$(echo "$server_config" | jq -r '.enabled // false')
if [[ "$enabled" != "true" ]]; then
log "Server '${server_name}' is disabled"
return 0
fi
local pid_file="${PID_DIR}/${server_name}.pid"
if [[ -f "$pid_file" ]]; then
local pid=$(cat "$pid_file")
if kill -0 "$pid" 2>/dev/null; then
log "Server '${server_name}' already running (PID: ${pid})"
return 0
fi
fi
local command=$(echo "$server_config" | jq -r '.command')
local args=$(echo "$server_config" | jq -r '.args[]' | sed 's/^/"/;s/$/" ' | tr '\n' ' ')
log "Starting server '${server_name}': ${command} ${args}"
eval "nohup ${command} ${args} > ${LOG_DIR}/${server_name}.log 2>&1 &"
local pid=$!
echo "$pid" > "$pid_file"
sleep 1
if kill -0 "$pid" 2>/dev/null; then
log "Server '${server_name}' started (PID: ${pid})"
return 0
else
log "ERROR: Failed to start server '${server_name}'"
return 1
fi
}
stop_server() {
local server_name="$1"
local pid_file="${PID_DIR}/${server_name}.pid"
if [[ ! -f "$pid_file" ]]; then
log "Server '${server_name}' not running"
return 0
fi
local pid=$(cat "$pid_file")
log "Stopping server '${server_name}' (PID: ${pid})..."
kill "$pid" 2>/dev/null || true
rm -f "$pid_file"
log "Server '${server_name}' stopped"
}
start_all() {
local servers=$(jq -r '.servers | keys[]' "$REGISTRY")
for server in $servers; do
start_server "$server" || true
done
}
stop_all() {
local pid_files
pid_files=$(ls "$PID_DIR"/*.pid 2>/dev/null || true)
for pid_file in $pid_files; do
local server_name=$(basename "$pid_file" .pid)
stop_server "$server_name"
done
}
status() {
echo "=== MCP Server Status ==="
echo ""
local servers=$(jq -r '.servers | keys[]' "$REGISTRY")
for server in $servers; do
local enabled=$(jq -r ".servers.${server}.enabled // false" "$REGISTRY")
local pid_file="${PID_DIR}/${server}.pid"
local status="stopped"
if [[ -f "$pid_file" ]]; then
local pid=$(cat "$pid_file")
if kill -0 "$pid" 2>/dev/null; then
status="running (PID: ${pid})"
fi
fi
local icon="🔴"
if [[ "$status" == "stopped" ]]; then
[[ "$enabled" == "true" ]] && icon="⚪" || icon="⏸️"
else
icon="🟢"
fi
local name=$(jq -r ".servers.${server}.name" "$REGISTRY")
local category=$(jq -r ".servers.${server}.category // \"other\"" "$REGISTRY")
printf "%s %-20s [%-10s] %s\n" "$icon" "$server" "$category" "$status"
done
}
main() {
local command="${1:-status}"
case "$command" in
start)
if [[ -n "${2:-}" ]]; then
start_server "$2"
else
start_all
fi
;;
stop)
if [[ -n "${2:-}" ]]; then
stop_server "$2"
else
stop_all
fi
;;
restart)
stop_all
sleep 2
start_all
;;
status)
status
;;
list)
jq -r '.servers | keys[]' "$REGISTRY"
;;
*)
echo "Usage: $0 {start|stop|restart|status|list} [server_name]"
exit 1
;;
esac
}
main "$@"

97
mcp-servers/registry.json Normal file
View File

@@ -0,0 +1,97 @@
{
"version": "1.0.0",
"last_updated": "2026-01-27T00:00:00Z",
"servers": {
"arc": {
"name": "ARC Protocol MCP",
"description": "Subagent file operations and protocol implementation",
"command": "python3",
"args": ["/home/roman/.claude/ralph-integration/arc/.agent/mcp/arc_mcp_server.py"],
"enabled": true,
"category": "core"
},
"claude-mem": {
"name": "Claude Memory",
"description": "Persistent memory and context management for Claude",
"command": "node",
"args": ["/home/roman/.claude/plugins/cache/thedotmack/claude-mem/plugin/scripts/mcp-server.cjs"],
"enabled": true,
"category": "memory"
},
"github": {
"name": "GitHub MCP",
"description": "GitHub API integration for repository operations",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"enabled": false,
"category": "external",
"requires_auth": true
},
"filesystem": {
"name": "Filesystem MCP",
"description": "Local filesystem access and operations",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/roman"],
"enabled": true,
"category": "core"
},
"git": {
"name": "Git MCP",
"description": "Git operations and repository management",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-git"],
"enabled": true,
"category": "core"
},
"brave-search": {
"name": "Brave Search MCP",
"description": "Web search via Brave Search API",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"enabled": false,
"category": "external",
"requires_auth": true
},
"postgres": {
"name": "PostgreSQL MCP",
"description": "PostgreSQL database operations",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"enabled": false,
"category": "database",
"requires_connection_string": true
},
"sqlite": {
"name": "SQLite MCP",
"description": "SQLite database operations",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sqlite", "--db-path", "/home/roman/.claude/mcp-servers/data.db"],
"enabled": true,
"category": "database"
},
"puppeteer": {
"name": "Puppeteer MCP",
"description": "Browser automation and web scraping",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"],
"enabled": false,
"category": "automation"
},
"fetch": {
"name": "Fetch MCP",
"description": "HTTP requests and web API integration",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-fetch"],
"enabled": true,
"category": "network"
}
},
"categories": {
"core": "Essential MCP servers for basic functionality",
"memory": "Persistent memory and context management",
"external": "Third-party API integrations",
"database": "Database connectivity and operations",
"automation": "Task automation and scripting",
"network": "Network and HTTP operations"
}
}

0
plugins/README.md Normal file → Executable file
View File

View File

@@ -0,0 +1,20 @@
{
"name": "superpowers-dev",
"description": "Development marketplace for Superpowers core skills library",
"owner": {
"name": "Jesse Vincent",
"email": "jesse@fsck.com"
},
"plugins": [
{
"name": "superpowers",
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
"version": "4.0.3",
"source": "./",
"author": {
"name": "Jesse Vincent",
"email": "jesse@fsck.com"
}
}
]
}

View File

@@ -0,0 +1,13 @@
{
"name": "superpowers",
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
"version": "4.0.3",
"author": {
"name": "Jesse Vincent",
"email": "jesse@fsck.com"
},
"homepage": "https://github.com/obra/superpowers",
"repository": "https://github.com/obra/superpowers",
"license": "MIT",
"keywords": ["skills", "tdd", "debugging", "collaboration", "best-practices", "workflows"]
}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Jesse Vincent
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,159 @@
# Superpowers
Superpowers is a complete software development workflow for your coding agents, built on top of a set of composable "skills" and some initial instructions that make sure your agent uses them.
## How it works
It starts from the moment you fire up your coding agent. As soon as it sees that you're building something, it *doesn't* just jump into trying to write code. Instead, it steps back and asks you what you're really trying to do.
Once it's teased a spec out of the conversation, it shows it to you in chunks short enough to actually read and digest.
After you've signed off on the design, your agent puts together an implementation plan that's clear enough for an enthusiastic junior engineer with poor taste, no judgement, no project context, and an aversion to testing to follow. It emphasizes true red/green TDD, YAGNI (You Aren't Gonna Need It), and DRY.
Next up, once you say "go", it launches a *subagent-driven-development* process, having agents work through each engineering task, inspecting and reviewing their work, and continuing forward. It's not uncommon for Claude to be able to work autonomously for a couple hours at a time without deviating from the plan you put together.
There's a bunch more to it, but that's the core of the system. And because the skills trigger automatically, you don't need to do anything special. Your coding agent just has Superpowers.
## Sponsorship
If Superpowers has helped you do stuff that makes money and you are so inclined, I'd greatly appreciate it if you'd consider [sponsoring my opensource work](https://github.com/sponsors/obra).
Thanks!
- Jesse
## Installation
**Note:** Installation differs by platform. Claude Code has a built-in plugin system. Codex and OpenCode require manual setup.
### Claude Code (via Plugin Marketplace)
In Claude Code, register the marketplace first:
```bash
/plugin marketplace add obra/superpowers-marketplace
```
Then install the plugin from this marketplace:
```bash
/plugin install superpowers@superpowers-marketplace
```
### Verify Installation
Check that commands appear:
```bash
/help
```
```
# Should see:
# /superpowers:brainstorm - Interactive design refinement
# /superpowers:write-plan - Create implementation plan
# /superpowers:execute-plan - Execute plan in batches
```
### Codex
Tell Codex:
```
Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.codex/INSTALL.md
```
**Detailed docs:** [docs/README.codex.md](docs/README.codex.md)
### OpenCode
Tell OpenCode:
```
Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.opencode/INSTALL.md
```
**Detailed docs:** [docs/README.opencode.md](docs/README.opencode.md)
## The Basic Workflow
1. **brainstorming** - Activates before writing code. Refines rough ideas through questions, explores alternatives, presents design in sections for validation. Saves design document.
2. **using-git-worktrees** - Activates after design approval. Creates isolated workspace on new branch, runs project setup, verifies clean test baseline.
3. **writing-plans** - Activates with approved design. Breaks work into bite-sized tasks (2-5 minutes each). Every task has exact file paths, complete code, verification steps.
4. **subagent-driven-development** or **executing-plans** - Activates with plan. Dispatches fresh subagent per task with two-stage review (spec compliance, then code quality), or executes in batches with human checkpoints.
5. **test-driven-development** - Activates during implementation. Enforces RED-GREEN-REFACTOR: write failing test, watch it fail, write minimal code, watch it pass, commit. Deletes code written before tests.
6. **requesting-code-review** - Activates between tasks. Reviews against plan, reports issues by severity. Critical issues block progress.
7. **finishing-a-development-branch** - Activates when tasks complete. Verifies tests, presents options (merge/PR/keep/discard), cleans up worktree.
**The agent checks for relevant skills before any task.** Mandatory workflows, not suggestions.
## What's Inside
### Skills Library
**Testing**
- **test-driven-development** - RED-GREEN-REFACTOR cycle (includes testing anti-patterns reference)
**Debugging**
- **systematic-debugging** - 4-phase root cause process (includes root-cause-tracing, defense-in-depth, condition-based-waiting techniques)
- **verification-before-completion** - Ensure it's actually fixed
**Collaboration**
- **brainstorming** - Socratic design refinement
- **writing-plans** - Detailed implementation plans
- **executing-plans** - Batch execution with checkpoints
- **dispatching-parallel-agents** - Concurrent subagent workflows
- **requesting-code-review** - Pre-review checklist
- **receiving-code-review** - Responding to feedback
- **using-git-worktrees** - Parallel development branches
- **finishing-a-development-branch** - Merge/PR decision workflow
- **subagent-driven-development** - Fast iteration with two-stage review (spec compliance, then code quality)
**Meta**
- **writing-skills** - Create new skills following best practices (includes testing methodology)
- **using-superpowers** - Introduction to the skills system
## Philosophy
- **Test-Driven Development** - Write tests first, always
- **Systematic over ad-hoc** - Process over guessing
- **Complexity reduction** - Simplicity as primary goal
- **Evidence over claims** - Verify before declaring success
Read more: [Superpowers for Claude Code](https://blog.fsck.com/2025/10/09/superpowers/)
## Contributing
Skills live directly in this repository. To contribute:
1. Fork the repository
2. Create a branch for your skill
3. Follow the `writing-skills` skill for creating and testing new skills
4. Submit a PR
See `skills/writing-skills/SKILL.md` for the complete guide.
## Updating
Skills update automatically when you update the plugin:
```bash
/plugin update superpowers
```
## License
MIT License - see LICENSE file for details
## Support
- **Issues**: https://github.com/obra/superpowers/issues
- **Marketplace**: https://github.com/obra/superpowers-marketplace

View File

@@ -0,0 +1,638 @@
# Superpowers Release Notes
## v4.0.3 (2025-12-26)
### Improvements
**Strengthened using-superpowers skill for explicit skill requests**
Addressed a failure mode where Claude would skip invoking a skill even when the user explicitly requested it by name (e.g., "subagent-driven-development, please"). Claude would think "I know what that means" and start working directly instead of loading the skill.
Changes:
- Updated "The Rule" to say "Invoke relevant or requested skills" instead of "Check for skills" - emphasizing active invocation over passive checking
- Added "BEFORE any response or action" - the original wording only mentioned "response" but Claude would sometimes take action without responding first
- Added reassurance that invoking a wrong skill is okay - reduces hesitation
- Added new red flag: "I know what that means" → Knowing the concept ≠ using the skill
**Added explicit skill request tests**
New test suite in `tests/explicit-skill-requests/` that verifies Claude correctly invokes skills when users request them by name. Includes single-turn and multi-turn test scenarios.
## v4.0.2 (2025-12-23)
### Fixes
**Slash commands now user-only**
Added `disable-model-invocation: true` to all three slash commands (`/brainstorm`, `/execute-plan`, `/write-plan`). Claude can no longer invoke these commands via the Skill tool—they're restricted to manual user invocation only.
The underlying skills (`superpowers:brainstorming`, `superpowers:executing-plans`, `superpowers:writing-plans`) remain available for Claude to invoke autonomously. This change prevents confusion when Claude would invoke a command that just redirects to a skill anyway.
## v4.0.1 (2025-12-23)
### Fixes
**Clarified how to access skills in Claude Code**
Fixed a confusing pattern where Claude would invoke a skill via the Skill tool, then try to Read the skill file separately. The `using-superpowers` skill now explicitly states that the Skill tool loads skill content directly—no need to read files.
- Added "How to Access Skills" section to `using-superpowers`
- Changed "read the skill" → "invoke the skill" in instructions
- Updated slash commands to use fully qualified skill names (e.g., `superpowers:brainstorming`)
**Added GitHub thread reply guidance to receiving-code-review** (h/t @ralphbean)
Added a note about replying to inline review comments in the original thread rather than as top-level PR comments.
**Added automation-over-documentation guidance to writing-skills** (h/t @EthanJStark)
Added guidance that mechanical constraints should be automated, not documented—save skills for judgment calls.
## v4.0.0 (2025-12-17)
### New Features
**Two-stage code review in subagent-driven-development**
Subagent workflows now use two separate review stages after each task:
1. **Spec compliance review** - Skeptical reviewer verifies implementation matches spec exactly. Catches missing requirements AND over-building. Won't trust implementer's report—reads actual code.
2. **Code quality review** - Only runs after spec compliance passes. Reviews for clean code, test coverage, maintainability.
This catches the common failure mode where code is well-written but doesn't match what was requested. Reviews are loops, not one-shot: if reviewer finds issues, implementer fixes them, then reviewer checks again.
Other subagent workflow improvements:
- Controller provides full task text to workers (not file references)
- Workers can ask clarifying questions before AND during work
- Self-review checklist before reporting completion
- Plan read once at start, extracted to TodoWrite
New prompt templates in `skills/subagent-driven-development/`:
- `implementer-prompt.md` - Includes self-review checklist, encourages questions
- `spec-reviewer-prompt.md` - Skeptical verification against requirements
- `code-quality-reviewer-prompt.md` - Standard code review
**Debugging techniques consolidated with tools**
`systematic-debugging` now bundles supporting techniques and tools:
- `root-cause-tracing.md` - Trace bugs backward through call stack
- `defense-in-depth.md` - Add validation at multiple layers
- `condition-based-waiting.md` - Replace arbitrary timeouts with condition polling
- `find-polluter.sh` - Bisection script to find which test creates pollution
- `condition-based-waiting-example.ts` - Complete implementation from real debugging session
**Testing anti-patterns reference**
`test-driven-development` now includes `testing-anti-patterns.md` covering:
- Testing mock behavior instead of real behavior
- Adding test-only methods to production classes
- Mocking without understanding dependencies
- Incomplete mocks that hide structural assumptions
**Skill test infrastructure**
Three new test frameworks for validating skill behavior:
`tests/skill-triggering/` - Validates skills trigger from naive prompts without explicit naming. Tests 6 skills to ensure descriptions alone are sufficient.
`tests/claude-code/` - Integration tests using `claude -p` for headless testing. Verifies skill usage via session transcript (JSONL) analysis. Includes `analyze-token-usage.py` for cost tracking.
`tests/subagent-driven-dev/` - End-to-end workflow validation with two complete test projects:
- `go-fractals/` - CLI tool with Sierpinski/Mandelbrot (10 tasks)
- `svelte-todo/` - CRUD app with localStorage and Playwright (12 tasks)
### Major Changes
**DOT flowcharts as executable specifications**
Rewrote key skills using DOT/GraphViz flowcharts as the authoritative process definition. Prose becomes supporting content.
**The Description Trap** (documented in `writing-skills`): Discovered that skill descriptions override flowchart content when descriptions contain workflow summaries. Claude follows the short description instead of reading the detailed flowchart. Fix: descriptions must be trigger-only ("Use when X") with no process details.
**Skill priority in using-superpowers**
When multiple skills apply, process skills (brainstorming, debugging) now explicitly come before implementation skills. "Build X" triggers brainstorming first, then domain skills.
**brainstorming trigger strengthened**
Description changed to imperative: "You MUST use this before any creative work—creating features, building components, adding functionality, or modifying behavior."
### Breaking Changes
**Skill consolidation** - Six standalone skills merged:
- `root-cause-tracing`, `defense-in-depth`, `condition-based-waiting` → bundled in `systematic-debugging/`
- `testing-skills-with-subagents` → bundled in `writing-skills/`
- `testing-anti-patterns` → bundled in `test-driven-development/`
- `sharing-skills` removed (obsolete)
### Other Improvements
- **render-graphs.js** - Tool to extract DOT diagrams from skills and render to SVG
- **Rationalizations table** in using-superpowers - Scannable format including new entries: "I need more context first", "Let me explore first", "This feels productive"
- **docs/testing.md** - Guide to testing skills with Claude Code integration tests
---
## v3.6.2 (2025-12-03)
### Fixed
- **Linux Compatibility**: Fixed polyglot hook wrapper (`run-hook.cmd`) to use POSIX-compliant syntax
- Replaced bash-specific `${BASH_SOURCE[0]:-$0}` with standard `$0` on line 16
- Resolves "Bad substitution" error on Ubuntu/Debian systems where `/bin/sh` is dash
- Fixes #141
---
## v3.5.1 (2025-11-24)
### Changed
- **OpenCode Bootstrap Refactor**: Switched from `chat.message` hook to `session.created` event for bootstrap injection
- Bootstrap now injects at session creation via `session.prompt()` with `noReply: true`
- Explicitly tells the model that using-superpowers is already loaded to prevent redundant skill loading
- Consolidated bootstrap content generation into shared `getBootstrapContent()` helper
- Cleaner single-implementation approach (removed fallback pattern)
---
## v3.5.0 (2025-11-23)
### Added
- **OpenCode Support**: Native JavaScript plugin for OpenCode.ai
- Custom tools: `use_skill` and `find_skills`
- Message insertion pattern for skill persistence across context compaction
- Automatic context injection via chat.message hook
- Auto re-injection on session.compacted events
- Three-tier skill priority: project > personal > superpowers
- Project-local skills support (`.opencode/skills/`)
- Shared core module (`lib/skills-core.js`) for code reuse with Codex
- Automated test suite with proper isolation (`tests/opencode/`)
- Platform-specific documentation (`docs/README.opencode.md`, `docs/README.codex.md`)
### Changed
- **Refactored Codex Implementation**: Now uses shared `lib/skills-core.js` ES module
- Eliminates code duplication between Codex and OpenCode
- Single source of truth for skill discovery and parsing
- Codex successfully loads ES modules via Node.js interop
- **Improved Documentation**: Rewrote README to explain problem/solution clearly
- Removed duplicate sections and conflicting information
- Added complete workflow description (brainstorm → plan → execute → finish)
- Simplified platform installation instructions
- Emphasized skill-checking protocol over automatic activation claims
---
## v3.4.1 (2025-10-31)
### Improvements
- Optimized superpowers bootstrap to eliminate redundant skill execution. The `using-superpowers` skill content is now provided directly in session context, with clear guidance to use the Skill tool only for other skills. This reduces overhead and prevents the confusing loop where agents would execute `using-superpowers` manually despite already having the content from session start.
## v3.4.0 (2025-10-30)
### Improvements
- Simplified `brainstorming` skill to return to original conversational vision. Removed heavyweight 6-phase process with formal checklists in favor of natural dialogue: ask questions one at a time, then present design in 200-300 word sections with validation. Keeps documentation and implementation handoff features.
## v3.3.1 (2025-10-28)
### Improvements
- Updated `brainstorming` skill to require autonomous recon before questioning, encourage recommendation-driven decisions, and prevent agents from delegating prioritization back to humans.
- Applied writing clarity improvements to `brainstorming` skill following Strunk's "Elements of Style" principles (omitted needless words, converted negative to positive form, improved parallel construction).
### Bug Fixes
- Clarified `writing-skills` guidance so it points to the correct agent-specific personal skill directories (`~/.claude/skills` for Claude Code, `~/.codex/skills` for Codex).
## v3.3.0 (2025-10-28)
### New Features
**Experimental Codex Support**
- Added unified `superpowers-codex` script with bootstrap/use-skill/find-skills commands
- Cross-platform Node.js implementation (works on Windows, macOS, Linux)
- Namespaced skills: `superpowers:skill-name` for superpowers skills, `skill-name` for personal
- Personal skills override superpowers skills when names match
- Clean skill display: shows name/description without raw frontmatter
- Helpful context: shows supporting files directory for each skill
- Tool mapping for Codex: TodoWrite→update_plan, subagents→manual fallback, etc.
- Bootstrap integration with minimal AGENTS.md for automatic startup
- Complete installation guide and bootstrap instructions specific to Codex
**Key differences from Claude Code integration:**
- Single unified script instead of separate tools
- Tool substitution system for Codex-specific equivalents
- Simplified subagent handling (manual work instead of delegation)
- Updated terminology: "Superpowers skills" instead of "Core skills"
### Files Added
- `.codex/INSTALL.md` - Installation guide for Codex users
- `.codex/superpowers-bootstrap.md` - Bootstrap instructions with Codex adaptations
- `.codex/superpowers-codex` - Unified Node.js executable with all functionality
**Note:** Codex support is experimental. The integration provides core superpowers functionality but may require refinement based on user feedback.
## v3.2.3 (2025-10-23)
### Improvements
**Updated using-superpowers skill to use Skill tool instead of Read tool**
- Changed skill invocation instructions from Read tool to Skill tool
- Updated description: "using Read tool" → "using Skill tool"
- Updated step 3: "Use the Read tool" → "Use the Skill tool to read and run"
- Updated rationalization list: "Read the current version" → "Run the current version"
The Skill tool is the proper mechanism for invoking skills in Claude Code. This update corrects the bootstrap instructions to guide agents toward the correct tool.
### Files Changed
- Updated: `skills/using-superpowers/SKILL.md` - Changed tool references from Read to Skill
## v3.2.2 (2025-10-21)
### Improvements
**Strengthened using-superpowers skill against agent rationalization**
- Added EXTREMELY-IMPORTANT block with absolute language about mandatory skill checking
- "If even 1% chance a skill applies, you MUST read it"
- "You do not have a choice. You cannot rationalize your way out."
- Added MANDATORY FIRST RESPONSE PROTOCOL checklist
- 5-step process agents must complete before any response
- Explicit "responding without this = failure" consequence
- Added Common Rationalizations section with 8 specific evasion patterns
- "This is just a simple question" → WRONG
- "I can check files quickly" → WRONG
- "Let me gather information first" → WRONG
- Plus 5 more common patterns observed in agent behavior
These changes address observed agent behavior where they rationalize around skill usage despite clear instructions. The forceful language and pre-emptive counter-arguments aim to make non-compliance harder.
### Files Changed
- Updated: `skills/using-superpowers/SKILL.md` - Added three layers of enforcement to prevent skill-skipping rationalization
## v3.2.1 (2025-10-20)
### New Features
**Code reviewer agent now included in plugin**
- Added `superpowers:code-reviewer` agent to plugin's `agents/` directory
- Agent provides systematic code review against plans and coding standards
- Previously required users to have personal agent configuration
- All skill references updated to use namespaced `superpowers:code-reviewer`
- Fixes #55
### Files Changed
- New: `agents/code-reviewer.md` - Agent definition with review checklist and output format
- Updated: `skills/requesting-code-review/SKILL.md` - References to `superpowers:code-reviewer`
- Updated: `skills/subagent-driven-development/SKILL.md` - References to `superpowers:code-reviewer`
## v3.2.0 (2025-10-18)
### New Features
**Design documentation in brainstorming workflow**
- Added Phase 4: Design Documentation to brainstorming skill
- Design documents now written to `docs/plans/YYYY-MM-DD-<topic>-design.md` before implementation
- Restores functionality from original brainstorming command that was lost during skill conversion
- Documents written before worktree setup and implementation planning
- Tested with subagent to verify compliance under time pressure
### Breaking Changes
**Skill reference namespace standardization**
- All internal skill references now use `superpowers:` namespace prefix
- Updated format: `superpowers:test-driven-development` (previously just `test-driven-development`)
- Affects all REQUIRED SUB-SKILL, RECOMMENDED SUB-SKILL, and REQUIRED BACKGROUND references
- Aligns with how skills are invoked using the Skill tool
- Files updated: brainstorming, executing-plans, subagent-driven-development, systematic-debugging, testing-skills-with-subagents, writing-plans, writing-skills
### Improvements
**Design vs implementation plan naming**
- Design documents use `-design.md` suffix to prevent filename collisions
- Implementation plans continue using existing `YYYY-MM-DD-<feature-name>.md` format
- Both stored in `docs/plans/` directory with clear naming distinction
## v3.1.1 (2025-10-17)
### Bug Fixes
- **Fixed command syntax in README** (#44) - Updated all command references to use correct namespaced syntax (`/superpowers:brainstorm` instead of `/brainstorm`). Plugin-provided commands are automatically namespaced by Claude Code to avoid conflicts between plugins.
## v3.1.0 (2025-10-17)
### Breaking Changes
**Skill names standardized to lowercase**
- All skill frontmatter `name:` fields now use lowercase kebab-case matching directory names
- Examples: `brainstorming`, `test-driven-development`, `using-git-worktrees`
- All skill announcements and cross-references updated to lowercase format
- This ensures consistent naming across directory names, frontmatter, and documentation
### New Features
**Enhanced brainstorming skill**
- Added Quick Reference table showing phases, activities, and tool usage
- Added copyable workflow checklist for tracking progress
- Added decision flowchart for when to revisit earlier phases
- Added comprehensive AskUserQuestion tool guidance with concrete examples
- Added "Question Patterns" section explaining when to use structured vs open-ended questions
- Restructured Key Principles as scannable table
**Anthropic best practices integration**
- Added `skills/writing-skills/anthropic-best-practices.md` - Official Anthropic skill authoring guide
- Referenced in writing-skills SKILL.md for comprehensive guidance
- Provides patterns for progressive disclosure, workflows, and evaluation
### Improvements
**Skill cross-reference clarity**
- All skill references now use explicit requirement markers:
- `**REQUIRED BACKGROUND:**` - Prerequisites you must understand
- `**REQUIRED SUB-SKILL:**` - Skills that must be used in workflow
- `**Complementary skills:**` - Optional but helpful related skills
- Removed old path format (`skills/collaboration/X` → just `X`)
- Updated Integration sections with categorized relationships (Required vs Complementary)
- Updated cross-reference documentation with best practices
**Alignment with Anthropic best practices**
- Fixed description grammar and voice (fully third-person)
- Added Quick Reference tables for scanning
- Added workflow checklists Claude can copy and track
- Appropriate use of flowcharts for non-obvious decision points
- Improved scannable table formats
- All skills well under 500-line recommendation
### Bug Fixes
- **Re-added missing command redirects** - Restored `commands/brainstorm.md` and `commands/write-plan.md` that were accidentally removed in v3.0 migration
- Fixed `defense-in-depth` name mismatch (was `Defense-in-Depth-Validation`)
- Fixed `receiving-code-review` name mismatch (was `Code-Review-Reception`)
- Fixed `commands/brainstorm.md` reference to correct skill name
- Removed references to non-existent related skills
### Documentation
**writing-skills improvements**
- Updated cross-referencing guidance with explicit requirement markers
- Added reference to Anthropic's official best practices
- Improved examples showing proper skill reference format
## v3.0.1 (2025-10-16)
### Changes
We now use Anthropic's first-party skills system!
## v2.0.2 (2025-10-12)
### Bug Fixes
- **Fixed false warning when local skills repo is ahead of upstream** - The initialization script was incorrectly warning "New skills available from upstream" when the local repository had commits ahead of upstream. The logic now correctly distinguishes between three git states: local behind (should update), local ahead (no warning), and diverged (should warn).
## v2.0.1 (2025-10-12)
### Bug Fixes
- **Fixed session-start hook execution in plugin context** (#8, PR #9) - The hook was failing silently with "Plugin hook error" preventing skills context from loading. Fixed by:
- Using `${BASH_SOURCE[0]:-$0}` fallback when BASH_SOURCE is unbound in Claude Code's execution context
- Adding `|| true` to handle empty grep results gracefully when filtering status flags
---
# Superpowers v2.0.0 Release Notes
## Overview
Superpowers v2.0 makes skills more accessible, maintainable, and community-driven through a major architectural shift.
The headline change is **skills repository separation**: all skills, scripts, and documentation have moved from the plugin into a dedicated repository ([obra/superpowers-skills](https://github.com/obra/superpowers-skills)). This transforms superpowers from a monolithic plugin into a lightweight shim that manages a local clone of the skills repository. Skills auto-update on session start. Users fork and contribute improvements via standard git workflows. The skills library versions independently from the plugin.
Beyond infrastructure, this release adds nine new skills focused on problem-solving, research, and architecture. We rewrote the core **using-skills** documentation with imperative tone and clearer structure, making it easier for Claude to understand when and how to use skills. **find-skills** now outputs paths you can paste directly into the Read tool, eliminating friction in the skills discovery workflow.
Users experience seamless operation: the plugin handles cloning, forking, and updating automatically. Contributors find the new architecture makes improving and sharing skills trivial. This release lays the foundation for skills to evolve rapidly as a community resource.
## Breaking Changes
### Skills Repository Separation
**The biggest change:** Skills no longer live in the plugin. They've been moved to a separate repository at [obra/superpowers-skills](https://github.com/obra/superpowers-skills).
**What this means for you:**
- **First install:** Plugin automatically clones skills to `~/.config/superpowers/skills/`
- **Forking:** During setup, you'll be offered the option to fork the skills repo (if `gh` is installed)
- **Updates:** Skills auto-update on session start (fast-forward when possible)
- **Contributing:** Work on branches, commit locally, submit PRs to upstream
- **No more shadowing:** Old two-tier system (personal/core) replaced with single-repo branch workflow
**Migration:**
If you have an existing installation:
1. Your old `~/.config/superpowers/.git` will be backed up to `~/.config/superpowers/.git.bak`
2. Old skills will be backed up to `~/.config/superpowers/skills.bak`
3. Fresh clone of obra/superpowers-skills will be created at `~/.config/superpowers/skills/`
### Removed Features
- **Personal superpowers overlay system** - Replaced with git branch workflow
- **setup-personal-superpowers hook** - Replaced by initialize-skills.sh
## New Features
### Skills Repository Infrastructure
**Automatic Clone & Setup** (`lib/initialize-skills.sh`)
- Clones obra/superpowers-skills on first run
- Offers fork creation if GitHub CLI is installed
- Sets up upstream/origin remotes correctly
- Handles migration from old installation
**Auto-Update**
- Fetches from tracking remote on every session start
- Auto-merges with fast-forward when possible
- Notifies when manual sync needed (branch diverged)
- Uses pulling-updates-from-skills-repository skill for manual sync
### New Skills
**Problem-Solving Skills** (`skills/problem-solving/`)
- **collision-zone-thinking** - Force unrelated concepts together for emergent insights
- **inversion-exercise** - Flip assumptions to reveal hidden constraints
- **meta-pattern-recognition** - Spot universal principles across domains
- **scale-game** - Test at extremes to expose fundamental truths
- **simplification-cascades** - Find insights that eliminate multiple components
- **when-stuck** - Dispatch to right problem-solving technique
**Research Skills** (`skills/research/`)
- **tracing-knowledge-lineages** - Understand how ideas evolved over time
**Architecture Skills** (`skills/architecture/`)
- **preserving-productive-tensions** - Keep multiple valid approaches instead of forcing premature resolution
### Skills Improvements
**using-skills (formerly getting-started)**
- Renamed from getting-started to using-skills
- Complete rewrite with imperative tone (v4.0.0)
- Front-loaded critical rules
- Added "Why" explanations for all workflows
- Always includes /SKILL.md suffix in references
- Clearer distinction between rigid rules and flexible patterns
**writing-skills**
- Cross-referencing guidance moved from using-skills
- Added token efficiency section (word count targets)
- Improved CSO (Claude Search Optimization) guidance
**sharing-skills**
- Updated for new branch-and-PR workflow (v2.0.0)
- Removed personal/core split references
**pulling-updates-from-skills-repository** (new)
- Complete workflow for syncing with upstream
- Replaces old "updating-skills" skill
### Tools Improvements
**find-skills**
- Now outputs full paths with /SKILL.md suffix
- Makes paths directly usable with Read tool
- Updated help text
**skill-run**
- Moved from scripts/ to skills/using-skills/
- Improved documentation
### Plugin Infrastructure
**Session Start Hook**
- Now loads from skills repository location
- Shows full skills list at session start
- Prints skills location info
- Shows update status (updated successfully / behind upstream)
- Moved "skills behind" warning to end of output
**Environment Variables**
- `SUPERPOWERS_SKILLS_ROOT` set to `~/.config/superpowers/skills`
- Used consistently throughout all paths
## Bug Fixes
- Fixed duplicate upstream remote addition when forking
- Fixed find-skills double "skills/" prefix in output
- Removed obsolete setup-personal-superpowers call from session-start
- Fixed path references throughout hooks and commands
## Documentation
### README
- Updated for new skills repository architecture
- Prominent link to superpowers-skills repo
- Updated auto-update description
- Fixed skill names and references
- Updated Meta skills list
### Testing Documentation
- Added comprehensive testing checklist (`docs/TESTING-CHECKLIST.md`)
- Created local marketplace config for testing
- Documented manual testing scenarios
## Technical Details
### File Changes
**Added:**
- `lib/initialize-skills.sh` - Skills repo initialization and auto-update
- `docs/TESTING-CHECKLIST.md` - Manual testing scenarios
- `.claude-plugin/marketplace.json` - Local testing config
**Removed:**
- `skills/` directory (82 files) - Now in obra/superpowers-skills
- `scripts/` directory - Now in obra/superpowers-skills/skills/using-skills/
- `hooks/setup-personal-superpowers.sh` - Obsolete
**Modified:**
- `hooks/session-start.sh` - Use skills from ~/.config/superpowers/skills
- `commands/brainstorm.md` - Updated paths to SUPERPOWERS_SKILLS_ROOT
- `commands/write-plan.md` - Updated paths to SUPERPOWERS_SKILLS_ROOT
- `commands/execute-plan.md` - Updated paths to SUPERPOWERS_SKILLS_ROOT
- `README.md` - Complete rewrite for new architecture
### Commit History
This release includes:
- 20+ commits for skills repository separation
- PR #1: Amplifier-inspired problem-solving and research skills
- PR #2: Personal superpowers overlay system (later replaced)
- Multiple skill refinements and documentation improvements
## Upgrade Instructions
### Fresh Install
```bash
# In Claude Code
/plugin marketplace add obra/superpowers-marketplace
/plugin install superpowers@superpowers-marketplace
```
The plugin handles everything automatically.
### Upgrading from v1.x
1. **Backup your personal skills** (if you have any):
```bash
cp -r ~/.config/superpowers/skills ~/superpowers-skills-backup
```
2. **Update the plugin:**
```bash
/plugin update superpowers
```
3. **On next session start:**
- Old installation will be backed up automatically
- Fresh skills repo will be cloned
- If you have GitHub CLI, you'll be offered the option to fork
4. **Migrate personal skills** (if you had any):
- Create a branch in your local skills repo
- Copy your personal skills from backup
- Commit and push to your fork
- Consider contributing back via PR
## What's Next
### For Users
- Explore the new problem-solving skills
- Try the branch-based workflow for skill improvements
- Contribute skills back to the community
### For Contributors
- Skills repository is now at https://github.com/obra/superpowers-skills
- Fork → Branch → PR workflow
- See skills/meta/writing-skills/SKILL.md for TDD approach to documentation
## Known Issues
None at this time.
## Credits
- Problem-solving skills inspired by Amplifier patterns
- Community contributions and feedback
- Extensive testing and iteration on skill effectiveness
---
**Full Changelog:** https://github.com/obra/superpowers/compare/dd013f6...main
**Skills Repository:** https://github.com/obra/superpowers-skills
**Issues:** https://github.com/obra/superpowers/issues

View File

@@ -0,0 +1,48 @@
---
name: code-reviewer
description: |
Use this agent when a major project step has been completed and needs to be reviewed against the original plan and coding standards. Examples: <example>Context: The user is creating a code-review agent that should be called after a logical chunk of code is written. user: "I've finished implementing the user authentication system as outlined in step 3 of our plan" assistant: "Great work! Now let me use the code-reviewer agent to review the implementation against our plan and coding standards" <commentary>Since a major project step has been completed, use the code-reviewer agent to validate the work against the plan and identify any issues.</commentary></example> <example>Context: User has completed a significant feature implementation. user: "The API endpoints for the task management system are now complete - that covers step 2 from our architecture document" assistant: "Excellent! Let me have the code-reviewer agent examine this implementation to ensure it aligns with our plan and follows best practices" <commentary>A numbered step from the planning document has been completed, so the code-reviewer agent should review the work.</commentary></example>
model: inherit
---
You are a Senior Code Reviewer with expertise in software architecture, design patterns, and best practices. Your role is to review completed project steps against original plans and ensure code quality standards are met.
When reviewing completed work, you will:
1. **Plan Alignment Analysis**:
- Compare the implementation against the original planning document or step description
- Identify any deviations from the planned approach, architecture, or requirements
- Assess whether deviations are justified improvements or problematic departures
- Verify that all planned functionality has been implemented
2. **Code Quality Assessment**:
- Review code for adherence to established patterns and conventions
- Check for proper error handling, type safety, and defensive programming
- Evaluate code organization, naming conventions, and maintainability
- Assess test coverage and quality of test implementations
- Look for potential security vulnerabilities or performance issues
3. **Architecture and Design Review**:
- Ensure the implementation follows SOLID principles and established architectural patterns
- Check for proper separation of concerns and loose coupling
- Verify that the code integrates well with existing systems
- Assess scalability and extensibility considerations
4. **Documentation and Standards**:
- Verify that code includes appropriate comments and documentation
- Check that file headers, function documentation, and inline comments are present and accurate
- Ensure adherence to project-specific coding standards and conventions
5. **Issue Identification and Recommendations**:
- Clearly categorize issues as: Critical (must fix), Important (should fix), or Suggestions (nice to have)
- For each issue, provide specific examples and actionable recommendations
- When you identify plan deviations, explain whether they're problematic or beneficial
- Suggest specific improvements with code examples when helpful
6. **Communication Protocol**:
- If you find significant deviations from the plan, ask the coding agent to review and confirm the changes
- If you identify issues with the original plan itself, recommend plan updates
- For implementation problems, provide clear guidance on fixes needed
- Always acknowledge what was done well before highlighting issues
Your output should be structured, actionable, and focused on helping maintain high code quality while ensuring project goals are met. Be thorough but concise, and always provide constructive feedback that helps improve both the current implementation and future development practices.

View File

@@ -0,0 +1,6 @@
---
description: "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores requirements and design before implementation."
disable-model-invocation: true
---
Invoke the superpowers:brainstorming skill and follow it exactly as presented to you

View File

@@ -0,0 +1,6 @@
---
description: Execute plan in batches with review checkpoints
disable-model-invocation: true
---
Invoke the superpowers:executing-plans skill and follow it exactly as presented to you

View File

@@ -0,0 +1,6 @@
---
description: Create detailed implementation plan with bite-sized tasks
disable-model-invocation: true
---
Invoke the superpowers:writing-plans skill and follow it exactly as presented to you

View File

@@ -0,0 +1,153 @@
# Superpowers for Codex
Complete guide for using Superpowers with OpenAI Codex.
## Quick Install
Tell Codex:
```
Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.codex/INSTALL.md
```
## Manual Installation
### Prerequisites
- OpenAI Codex access
- Shell access to install files
### Installation Steps
#### 1. Clone Superpowers
```bash
mkdir -p ~/.codex/superpowers
git clone https://github.com/obra/superpowers.git ~/.codex/superpowers
```
#### 2. Install Bootstrap
The bootstrap file is included in the repository at `.codex/superpowers-bootstrap.md`. Codex will automatically use it from the cloned location.
#### 3. Verify Installation
Tell Codex:
```
Run ~/.codex/superpowers/.codex/superpowers-codex find-skills to show available skills
```
You should see a list of available skills with descriptions.
## Usage
### Finding Skills
```
Run ~/.codex/superpowers/.codex/superpowers-codex find-skills
```
### Loading a Skill
```
Run ~/.codex/superpowers/.codex/superpowers-codex use-skill superpowers:brainstorming
```
### Bootstrap All Skills
```
Run ~/.codex/superpowers/.codex/superpowers-codex bootstrap
```
This loads the complete bootstrap with all skill information.
### Personal Skills
Create your own skills in `~/.codex/skills/`:
```bash
mkdir -p ~/.codex/skills/my-skill
```
Create `~/.codex/skills/my-skill/SKILL.md`:
```markdown
---
name: my-skill
description: Use when [condition] - [what it does]
---
# My Skill
[Your skill content here]
```
Personal skills override superpowers skills with the same name.
## Architecture
### Codex CLI Tool
**Location:** `~/.codex/superpowers/.codex/superpowers-codex`
A Node.js CLI script that provides three commands:
- `bootstrap` - Load complete bootstrap with all skills
- `use-skill <name>` - Load a specific skill
- `find-skills` - List all available skills
### Shared Core Module
**Location:** `~/.codex/superpowers/lib/skills-core.js`
The Codex implementation uses the shared `skills-core` module (ES module format) for skill discovery and parsing. This is the same module used by the OpenCode plugin, ensuring consistent behavior across platforms.
### Tool Mapping
Skills written for Claude Code are adapted for Codex with these mappings:
- `TodoWrite``update_plan`
- `Task` with subagents → Tell user subagents aren't available, do work directly
- `Skill` tool → `~/.codex/superpowers/.codex/superpowers-codex use-skill`
- File operations → Native Codex tools
## Updating
```bash
cd ~/.codex/superpowers
git pull
```
## Troubleshooting
### Skills not found
1. Verify installation: `ls ~/.codex/superpowers/skills`
2. Check CLI works: `~/.codex/superpowers/.codex/superpowers-codex find-skills`
3. Verify skills have SKILL.md files
### CLI script not executable
```bash
chmod +x ~/.codex/superpowers/.codex/superpowers-codex
```
### Node.js errors
The CLI script requires Node.js. Verify:
```bash
node --version
```
Should show v14 or higher (v18+ recommended for ES module support).
## Getting Help
- Report issues: https://github.com/obra/superpowers/issues
- Main documentation: https://github.com/obra/superpowers
- Blog post: https://blog.fsck.com/2025/10/27/skills-for-openai-codex/
## Note
Codex support is experimental and may require refinement based on user feedback. If you encounter issues, please report them on GitHub.

View File

@@ -0,0 +1,234 @@
# Superpowers for OpenCode
Complete guide for using Superpowers with [OpenCode.ai](https://opencode.ai).
## Quick Install
Tell OpenCode:
```
Clone https://github.com/obra/superpowers to ~/.config/opencode/superpowers, then create directory ~/.config/opencode/plugin, then symlink ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js to ~/.config/opencode/plugin/superpowers.js, then restart opencode.
```
## Manual Installation
### Prerequisites
- [OpenCode.ai](https://opencode.ai) installed
- Node.js installed
- Git installed
### Installation Steps
#### 1. Install Superpowers
```bash
mkdir -p ~/.config/opencode/superpowers
git clone https://github.com/obra/superpowers.git ~/.config/opencode/superpowers
```
#### 2. Register the Plugin
OpenCode discovers plugins from `~/.config/opencode/plugin/`. Create a symlink:
```bash
mkdir -p ~/.config/opencode/plugin
ln -sf ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js ~/.config/opencode/plugin/superpowers.js
```
Alternatively, for project-local installation:
```bash
# In your OpenCode project
mkdir -p .opencode/plugin
ln -sf ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js .opencode/plugin/superpowers.js
```
#### 3. Restart OpenCode
Restart OpenCode to load the plugin. Superpowers will automatically activate.
## Usage
### Finding Skills
Use the `find_skills` tool to list all available skills:
```
use find_skills tool
```
### Loading a Skill
Use the `use_skill` tool to load a specific skill:
```
use use_skill tool with skill_name: "superpowers:brainstorming"
```
Skills are automatically inserted into the conversation and persist across context compaction.
### Personal Skills
Create your own skills in `~/.config/opencode/skills/`:
```bash
mkdir -p ~/.config/opencode/skills/my-skill
```
Create `~/.config/opencode/skills/my-skill/SKILL.md`:
```markdown
---
name: my-skill
description: Use when [condition] - [what it does]
---
# My Skill
[Your skill content here]
```
### Project Skills
Create project-specific skills in your OpenCode project:
```bash
# In your OpenCode project
mkdir -p .opencode/skills/my-project-skill
```
Create `.opencode/skills/my-project-skill/SKILL.md`:
```markdown
---
name: my-project-skill
description: Use when [condition] - [what it does]
---
# My Project Skill
[Your skill content here]
```
## Skill Priority
Skills are resolved with this priority order:
1. **Project skills** (`.opencode/skills/`) - Highest priority
2. **Personal skills** (`~/.config/opencode/skills/`)
3. **Superpowers skills** (`~/.config/opencode/superpowers/skills/`)
You can force resolution to a specific level:
- `project:skill-name` - Force project skill
- `skill-name` - Search project → personal → superpowers
- `superpowers:skill-name` - Force superpowers skill
## Features
### Automatic Context Injection
The plugin automatically injects superpowers context via the chat.message hook on every session. No manual configuration needed.
### Message Insertion Pattern
When you load a skill with `use_skill`, it's inserted as a user message with `noReply: true`. This ensures skills persist throughout long conversations, even when OpenCode compacts context.
### Compaction Resilience
The plugin listens for `session.compacted` events and automatically re-injects the core superpowers bootstrap to maintain functionality after context compaction.
### Tool Mapping
Skills written for Claude Code are automatically adapted for OpenCode. The plugin provides mapping instructions:
- `TodoWrite``update_plan`
- `Task` with subagents → OpenCode's `@mention` system
- `Skill` tool → `use_skill` custom tool
- File operations → Native OpenCode tools
## Architecture
### Plugin Structure
**Location:** `~/.config/opencode/superpowers/.opencode/plugin/superpowers.js`
**Components:**
- Two custom tools: `use_skill`, `find_skills`
- chat.message hook for initial context injection
- event handler for session.compacted re-injection
- Uses shared `lib/skills-core.js` module (also used by Codex)
### Shared Core Module
**Location:** `~/.config/opencode/superpowers/lib/skills-core.js`
**Functions:**
- `extractFrontmatter()` - Parse skill metadata
- `stripFrontmatter()` - Remove metadata from content
- `findSkillsInDir()` - Recursive skill discovery
- `resolveSkillPath()` - Skill resolution with shadowing
- `checkForUpdates()` - Git update detection
This module is shared between OpenCode and Codex implementations for code reuse.
## Updating
```bash
cd ~/.config/opencode/superpowers
git pull
```
Restart OpenCode to load the updates.
## Troubleshooting
### Plugin not loading
1. Check plugin file exists: `ls ~/.config/opencode/superpowers/.opencode/plugin/superpowers.js`
2. Check symlink: `ls -l ~/.config/opencode/plugin/superpowers.js`
3. Check OpenCode logs: `opencode run "test" --print-logs --log-level DEBUG`
4. Look for: `service=plugin path=file:///.../superpowers.js loading plugin`
### Skills not found
1. Verify skills directory: `ls ~/.config/opencode/superpowers/skills`
2. Use `find_skills` tool to see what's discovered
3. Check skill structure: each skill needs a `SKILL.md` file
### Tools not working
1. Verify plugin loaded: Check OpenCode logs for plugin loading message
2. Check Node.js version: The plugin requires Node.js for ES modules
3. Test plugin manually: `node --input-type=module -e "import('file://~/.config/opencode/plugin/superpowers.js').then(m => console.log(Object.keys(m)))"`
### Context not injecting
1. Check if chat.message hook is working
2. Verify using-superpowers skill exists
3. Check OpenCode version (requires recent version with plugin support)
## Getting Help
- Report issues: https://github.com/obra/superpowers/issues
- Main documentation: https://github.com/obra/superpowers
- OpenCode docs: https://opencode.ai/docs/
## Testing
The implementation includes an automated test suite at `tests/opencode/`:
```bash
# Run all tests
./tests/opencode/run-tests.sh --integration --verbose
# Run specific test
./tests/opencode/run-tests.sh --test test-tools.sh
```
Tests verify:
- Plugin loading
- Skills-core library functionality
- Tool execution (use_skill, find_skills)
- Skill priority resolution
- Proper isolation with temp HOME

View File

@@ -0,0 +1,303 @@
# Testing Superpowers Skills
This document describes how to test Superpowers skills, particularly the integration tests for complex skills like `subagent-driven-development`.
## Overview
Testing skills that involve subagents, workflows, and complex interactions requires running actual Claude Code sessions in headless mode and verifying their behavior through session transcripts.
## Test Structure
```
tests/
├── claude-code/
│ ├── test-helpers.sh # Shared test utilities
│ ├── test-subagent-driven-development-integration.sh
│ ├── analyze-token-usage.py # Token analysis tool
│ └── run-skill-tests.sh # Test runner (if exists)
```
## Running Tests
### Integration Tests
Integration tests execute real Claude Code sessions with actual skills:
```bash
# Run the subagent-driven-development integration test
cd tests/claude-code
./test-subagent-driven-development-integration.sh
```
**Note:** Integration tests can take 10-30 minutes as they execute real implementation plans with multiple subagents.
### Requirements
- Must run from the **superpowers plugin directory** (not from temp directories)
- Claude Code must be installed and available as `claude` command
- Local dev marketplace must be enabled: `"superpowers@superpowers-dev": true` in `~/.claude/settings.json`
## Integration Test: subagent-driven-development
### What It Tests
The integration test verifies the `subagent-driven-development` skill correctly:
1. **Plan Loading**: Reads the plan once at the beginning
2. **Full Task Text**: Provides complete task descriptions to subagents (doesn't make them read files)
3. **Self-Review**: Ensures subagents perform self-review before reporting
4. **Review Order**: Runs spec compliance review before code quality review
5. **Review Loops**: Uses review loops when issues are found
6. **Independent Verification**: Spec reviewer reads code independently, doesn't trust implementer reports
### How It Works
1. **Setup**: Creates a temporary Node.js project with a minimal implementation plan
2. **Execution**: Runs Claude Code in headless mode with the skill
3. **Verification**: Parses the session transcript (`.jsonl` file) to verify:
- Skill tool was invoked
- Subagents were dispatched (Task tool)
- TodoWrite was used for tracking
- Implementation files were created
- Tests pass
- Git commits show proper workflow
4. **Token Analysis**: Shows token usage breakdown by subagent
### Test Output
```
========================================
Integration Test: subagent-driven-development
========================================
Test project: /tmp/tmp.xyz123
=== Verification Tests ===
Test 1: Skill tool invoked...
[PASS] subagent-driven-development skill was invoked
Test 2: Subagents dispatched...
[PASS] 7 subagents dispatched
Test 3: Task tracking...
[PASS] TodoWrite used 5 time(s)
Test 6: Implementation verification...
[PASS] src/math.js created
[PASS] add function exists
[PASS] multiply function exists
[PASS] test/math.test.js created
[PASS] Tests pass
Test 7: Git commit history...
[PASS] Multiple commits created (3 total)
Test 8: No extra features added...
[PASS] No extra features added
=========================================
Token Usage Analysis
=========================================
Usage Breakdown:
----------------------------------------------------------------------------------------------------
Agent Description Msgs Input Output Cache Cost
----------------------------------------------------------------------------------------------------
main Main session (coordinator) 34 27 3,996 1,213,703 $ 4.09
3380c209 implementing Task 1: Create Add Function 1 2 787 24,989 $ 0.09
34b00fde implementing Task 2: Create Multiply Function 1 4 644 25,114 $ 0.09
3801a732 reviewing whether an implementation matches... 1 5 703 25,742 $ 0.09
4c142934 doing a final code review... 1 6 854 25,319 $ 0.09
5f017a42 a code reviewer. Review Task 2... 1 6 504 22,949 $ 0.08
a6b7fbe4 a code reviewer. Review Task 1... 1 6 515 22,534 $ 0.08
f15837c0 reviewing whether an implementation matches... 1 6 416 22,485 $ 0.07
----------------------------------------------------------------------------------------------------
TOTALS:
Total messages: 41
Input tokens: 62
Output tokens: 8,419
Cache creation tokens: 132,742
Cache read tokens: 1,382,835
Total input (incl cache): 1,515,639
Total tokens: 1,524,058
Estimated cost: $4.67
(at $3/$15 per M tokens for input/output)
========================================
Test Summary
========================================
STATUS: PASSED
```
## Token Analysis Tool
### Usage
Analyze token usage from any Claude Code session:
```bash
python3 tests/claude-code/analyze-token-usage.py ~/.claude/projects/<project-dir>/<session-id>.jsonl
```
### Finding Session Files
Session transcripts are stored in `~/.claude/projects/` with the working directory path encoded:
```bash
# Example for /Users/jesse/Documents/GitHub/superpowers/superpowers
SESSION_DIR="$HOME/.claude/projects/-Users-jesse-Documents-GitHub-superpowers-superpowers"
# Find recent sessions
ls -lt "$SESSION_DIR"/*.jsonl | head -5
```
### What It Shows
- **Main session usage**: Token usage by the coordinator (you or main Claude instance)
- **Per-subagent breakdown**: Each Task invocation with:
- Agent ID
- Description (extracted from prompt)
- Message count
- Input/output tokens
- Cache usage
- Estimated cost
- **Totals**: Overall token usage and cost estimate
### Understanding the Output
- **High cache reads**: Good - means prompt caching is working
- **High input tokens on main**: Expected - coordinator has full context
- **Similar costs per subagent**: Expected - each gets similar task complexity
- **Cost per task**: Typical range is $0.05-$0.15 per subagent depending on task
## Troubleshooting
### Skills Not Loading
**Problem**: Skill not found when running headless tests
**Solutions**:
1. Ensure you're running FROM the superpowers directory: `cd /path/to/superpowers && tests/...`
2. Check `~/.claude/settings.json` has `"superpowers@superpowers-dev": true` in `enabledPlugins`
3. Verify skill exists in `skills/` directory
### Permission Errors
**Problem**: Claude blocked from writing files or accessing directories
**Solutions**:
1. Use `--permission-mode bypassPermissions` flag
2. Use `--add-dir /path/to/temp/dir` to grant access to test directories
3. Check file permissions on test directories
### Test Timeouts
**Problem**: Test takes too long and times out
**Solutions**:
1. Increase timeout: `timeout 1800 claude ...` (30 minutes)
2. Check for infinite loops in skill logic
3. Review subagent task complexity
### Session File Not Found
**Problem**: Can't find session transcript after test run
**Solutions**:
1. Check the correct project directory in `~/.claude/projects/`
2. Use `find ~/.claude/projects -name "*.jsonl" -mmin -60` to find recent sessions
3. Verify test actually ran (check for errors in test output)
## Writing New Integration Tests
### Template
```bash
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "$SCRIPT_DIR/test-helpers.sh"
# Create test project
TEST_PROJECT=$(create_test_project)
trap "cleanup_test_project $TEST_PROJECT" EXIT
# Set up test files...
cd "$TEST_PROJECT"
# Run Claude with skill
PROMPT="Your test prompt here"
cd "$SCRIPT_DIR/../.." && timeout 1800 claude -p "$PROMPT" \
--allowed-tools=all \
--add-dir "$TEST_PROJECT" \
--permission-mode bypassPermissions \
2>&1 | tee output.txt
# Find and analyze session
WORKING_DIR_ESCAPED=$(echo "$SCRIPT_DIR/../.." | sed 's/\\//-/g' | sed 's/^-//')
SESSION_DIR="$HOME/.claude/projects/$WORKING_DIR_ESCAPED"
SESSION_FILE=$(find "$SESSION_DIR" -name "*.jsonl" -type f -mmin -60 | sort -r | head -1)
# Verify behavior by parsing session transcript
if grep -q '"name":"Skill".*"skill":"your-skill-name"' "$SESSION_FILE"; then
echo "[PASS] Skill was invoked"
fi
# Show token analysis
python3 "$SCRIPT_DIR/analyze-token-usage.py" "$SESSION_FILE"
```
### Best Practices
1. **Always cleanup**: Use trap to cleanup temp directories
2. **Parse transcripts**: Don't grep user-facing output - parse the `.jsonl` session file
3. **Grant permissions**: Use `--permission-mode bypassPermissions` and `--add-dir`
4. **Run from plugin dir**: Skills only load when running from the superpowers directory
5. **Show token usage**: Always include token analysis for cost visibility
6. **Test real behavior**: Verify actual files created, tests passing, commits made
## Session Transcript Format
Session transcripts are JSONL (JSON Lines) files where each line is a JSON object representing a message or tool result.
### Key Fields
```json
{
"type": "assistant",
"message": {
"content": [...],
"usage": {
"input_tokens": 27,
"output_tokens": 3996,
"cache_read_input_tokens": 1213703
}
}
}
```
### Tool Results
```json
{
"type": "user",
"toolUseResult": {
"agentId": "3380c209",
"usage": {
"input_tokens": 2,
"output_tokens": 787,
"cache_read_input_tokens": 24989
},
"prompt": "You are implementing Task 1...",
"content": [{"type": "text", "text": "..."}]
}
}
```
The `agentId` field links to subagent sessions, and the `usage` field contains token usage for that specific subagent invocation.

View File

@@ -0,0 +1,212 @@
# Cross-Platform Polyglot Hooks for Claude Code
Claude Code plugins need hooks that work on Windows, macOS, and Linux. This document explains the polyglot wrapper technique that makes this possible.
## The Problem
Claude Code runs hook commands through the system's default shell:
- **Windows**: CMD.exe
- **macOS/Linux**: bash or sh
This creates several challenges:
1. **Script execution**: Windows CMD can't execute `.sh` files directly - it tries to open them in a text editor
2. **Path format**: Windows uses backslashes (`C:\path`), Unix uses forward slashes (`/path`)
3. **Environment variables**: `$VAR` syntax doesn't work in CMD
4. **No `bash` in PATH**: Even with Git Bash installed, `bash` isn't in the PATH when CMD runs
## The Solution: Polyglot `.cmd` Wrapper
A polyglot script is valid syntax in multiple languages simultaneously. Our wrapper is valid in both CMD and bash:
```cmd
: << 'CMDBLOCK'
@echo off
"C:\Program Files\Git\bin\bash.exe" -l -c "\"$(cygpath -u \"$CLAUDE_PLUGIN_ROOT\")/hooks/session-start.sh\""
exit /b
CMDBLOCK
# Unix shell runs from here
"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
```
### How It Works
#### On Windows (CMD.exe)
1. `: << 'CMDBLOCK'` - CMD sees `:` as a label (like `:label`) and ignores `<< 'CMDBLOCK'`
2. `@echo off` - Suppresses command echoing
3. The bash.exe command runs with:
- `-l` (login shell) to get proper PATH with Unix utilities
- `cygpath -u` converts Windows path to Unix format (`C:\foo``/c/foo`)
4. `exit /b` - Exits the batch script, stopping CMD here
5. Everything after `CMDBLOCK` is never reached by CMD
#### On Unix (bash/sh)
1. `: << 'CMDBLOCK'` - `:` is a no-op, `<< 'CMDBLOCK'` starts a heredoc
2. Everything until `CMDBLOCK` is consumed by the heredoc (ignored)
3. `# Unix shell runs from here` - Comment
4. The script runs directly with the Unix path
## File Structure
```
hooks/
├── hooks.json # Points to the .cmd wrapper
├── session-start.cmd # Polyglot wrapper (cross-platform entry point)
└── session-start.sh # Actual hook logic (bash script)
```
### hooks.json
```json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear|compact",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.cmd\""
}
]
}
]
}
}
```
Note: The path must be quoted because `${CLAUDE_PLUGIN_ROOT}` may contain spaces on Windows (e.g., `C:\Program Files\...`).
## Requirements
### Windows
- **Git for Windows** must be installed (provides `bash.exe` and `cygpath`)
- Default installation path: `C:\Program Files\Git\bin\bash.exe`
- If Git is installed elsewhere, the wrapper needs modification
### Unix (macOS/Linux)
- Standard bash or sh shell
- The `.cmd` file must have execute permission (`chmod +x`)
## Writing Cross-Platform Hook Scripts
Your actual hook logic goes in the `.sh` file. To ensure it works on Windows (via Git Bash):
### Do:
- Use pure bash builtins when possible
- Use `$(command)` instead of backticks
- Quote all variable expansions: `"$VAR"`
- Use `printf` or here-docs for output
### Avoid:
- External commands that may not be in PATH (sed, awk, grep)
- If you must use them, they're available in Git Bash but ensure PATH is set up (use `bash -l`)
### Example: JSON Escaping Without sed/awk
Instead of:
```bash
escaped=$(echo "$content" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
```
Use pure bash:
```bash
escape_for_json() {
local input="$1"
local output=""
local i char
for (( i=0; i<${#input}; i++ )); do
char="${input:$i:1}"
case "$char" in
$'\\') output+='\\' ;;
'"') output+='\"' ;;
$'\n') output+='\n' ;;
$'\r') output+='\r' ;;
$'\t') output+='\t' ;;
*) output+="$char" ;;
esac
done
printf '%s' "$output"
}
```
## Reusable Wrapper Pattern
For plugins with multiple hooks, you can create a generic wrapper that takes the script name as an argument:
### run-hook.cmd
```cmd
: << 'CMDBLOCK'
@echo off
set "SCRIPT_DIR=%~dp0"
set "SCRIPT_NAME=%~1"
"C:\Program Files\Git\bin\bash.exe" -l -c "cd \"$(cygpath -u \"%SCRIPT_DIR%\")\" && \"./%SCRIPT_NAME%\""
exit /b
CMDBLOCK
# Unix shell runs from here
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
SCRIPT_NAME="$1"
shift
"${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
```
### hooks.json using the reusable wrapper
```json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start.sh"
}
]
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" validate-bash.sh"
}
]
}
]
}
}
```
## Troubleshooting
### "bash is not recognized"
CMD can't find bash. The wrapper uses the full path `C:\Program Files\Git\bin\bash.exe`. If Git is installed elsewhere, update the path.
### "cygpath: command not found" or "dirname: command not found"
Bash isn't running as a login shell. Ensure `-l` flag is used.
### Path has weird `\/` in it
`${CLAUDE_PLUGIN_ROOT}` expanded to a Windows path ending with backslash, then `/hooks/...` was appended. Use `cygpath` to convert the entire path.
### Script opens in text editor instead of running
The hooks.json is pointing directly to the `.sh` file. Point to the `.cmd` wrapper instead.
### Works in terminal but not as hook
Claude Code may run hooks differently. Test by simulating the hook environment:
```powershell
$env:CLAUDE_PLUGIN_ROOT = "C:\path\to\plugin"
cmd /c "C:\path\to\plugin\hooks\session-start.cmd"
```
## Related Issues
- [anthropics/claude-code#9758](https://github.com/anthropics/claude-code/issues/9758) - .sh scripts open in editor on Windows
- [anthropics/claude-code#3417](https://github.com/anthropics/claude-code/issues/3417) - Hooks don't work on Windows
- [anthropics/claude-code#6023](https://github.com/anthropics/claude-code/issues/6023) - CLAUDE_PROJECT_DIR not found

View File

@@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear|compact",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start.sh"
}
]
}
]
}
}

View File

@@ -0,0 +1,19 @@
: << 'CMDBLOCK'
@echo off
REM Polyglot wrapper: runs .sh scripts cross-platform
REM Usage: run-hook.cmd <script-name> [args...]
REM The script should be in the same directory as this wrapper
if "%~1"=="" (
echo run-hook.cmd: missing script name >&2
exit /b 1
)
"C:\Program Files\Git\bin\bash.exe" -l "%~dp0%~1" %2 %3 %4 %5 %6 %7 %8 %9
exit /b
CMDBLOCK
# Unix shell runs from here
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPT_NAME="$1"
shift
"${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# SessionStart hook for superpowers plugin
set -euo pipefail
# Determine plugin root directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
# Check if legacy skills directory exists and build warning
warning_message=""
legacy_skills_dir="${HOME}/.config/superpowers/skills"
if [ -d "$legacy_skills_dir" ]; then
warning_message="\n\n<important-reminder>IN YOUR FIRST REPLY AFTER SEEING THIS MESSAGE YOU MUST TELL THE USER:⚠️ **WARNING:** Superpowers now uses Claude Code's skills system. Custom skills in ~/.config/superpowers/skills will not be read. Move custom skills to ~/.claude/skills instead. To make this message go away, remove ~/.config/superpowers/skills</important-reminder>"
fi
# Read using-superpowers content
using_superpowers_content=$(cat "${PLUGIN_ROOT}/skills/using-superpowers/SKILL.md" 2>&1 || echo "Error reading using-superpowers skill")
# Escape outputs for JSON using pure bash
escape_for_json() {
local input="$1"
local output=""
local i char
for (( i=0; i<${#input}; i++ )); do
char="${input:$i:1}"
case "$char" in
$'\\') output+='\\' ;;
'"') output+='\"' ;;
$'\n') output+='\n' ;;
$'\r') output+='\r' ;;
$'\t') output+='\t' ;;
*) output+="$char" ;;
esac
done
printf '%s' "$output"
}
using_superpowers_escaped=$(escape_for_json "$using_superpowers_content")
warning_escaped=$(escape_for_json "$warning_message")
# Output context injection as JSON
cat <<EOF
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
}
}
EOF
exit 0

View File

@@ -0,0 +1,208 @@
import fs from 'fs';
import path from 'path';
import { execSync } from 'child_process';
/**
* Extract YAML frontmatter from a skill file.
* Current format:
* ---
* name: skill-name
* description: Use when [condition] - [what it does]
* ---
*
* @param {string} filePath - Path to SKILL.md file
* @returns {{name: string, description: string}}
*/
function extractFrontmatter(filePath) {
try {
const content = fs.readFileSync(filePath, 'utf8');
const lines = content.split('\n');
let inFrontmatter = false;
let name = '';
let description = '';
for (const line of lines) {
if (line.trim() === '---') {
if (inFrontmatter) break;
inFrontmatter = true;
continue;
}
if (inFrontmatter) {
const match = line.match(/^(\w+):\s*(.*)$/);
if (match) {
const [, key, value] = match;
switch (key) {
case 'name':
name = value.trim();
break;
case 'description':
description = value.trim();
break;
}
}
}
}
return { name, description };
} catch (error) {
return { name: '', description: '' };
}
}
/**
* Find all SKILL.md files in a directory recursively.
*
* @param {string} dir - Directory to search
* @param {string} sourceType - 'personal' or 'superpowers' for namespacing
* @param {number} maxDepth - Maximum recursion depth (default: 3)
* @returns {Array<{path: string, name: string, description: string, sourceType: string}>}
*/
function findSkillsInDir(dir, sourceType, maxDepth = 3) {
const skills = [];
if (!fs.existsSync(dir)) return skills;
function recurse(currentDir, depth) {
if (depth > maxDepth) return;
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = path.join(currentDir, entry.name);
if (entry.isDirectory()) {
// Check for SKILL.md in this directory
const skillFile = path.join(fullPath, 'SKILL.md');
if (fs.existsSync(skillFile)) {
const { name, description } = extractFrontmatter(skillFile);
skills.push({
path: fullPath,
skillFile: skillFile,
name: name || entry.name,
description: description || '',
sourceType: sourceType
});
}
// Recurse into subdirectories
recurse(fullPath, depth + 1);
}
}
}
recurse(dir, 0);
return skills;
}
/**
* Resolve a skill name to its file path, handling shadowing
* (personal skills override superpowers skills).
*
* @param {string} skillName - Name like "superpowers:brainstorming" or "my-skill"
* @param {string} superpowersDir - Path to superpowers skills directory
* @param {string} personalDir - Path to personal skills directory
* @returns {{skillFile: string, sourceType: string, skillPath: string} | null}
*/
function resolveSkillPath(skillName, superpowersDir, personalDir) {
// Strip superpowers: prefix if present
const forceSuperpowers = skillName.startsWith('superpowers:');
const actualSkillName = forceSuperpowers ? skillName.replace(/^superpowers:/, '') : skillName;
// Try personal skills first (unless explicitly superpowers:)
if (!forceSuperpowers && personalDir) {
const personalPath = path.join(personalDir, actualSkillName);
const personalSkillFile = path.join(personalPath, 'SKILL.md');
if (fs.existsSync(personalSkillFile)) {
return {
skillFile: personalSkillFile,
sourceType: 'personal',
skillPath: actualSkillName
};
}
}
// Try superpowers skills
if (superpowersDir) {
const superpowersPath = path.join(superpowersDir, actualSkillName);
const superpowersSkillFile = path.join(superpowersPath, 'SKILL.md');
if (fs.existsSync(superpowersSkillFile)) {
return {
skillFile: superpowersSkillFile,
sourceType: 'superpowers',
skillPath: actualSkillName
};
}
}
return null;
}
/**
* Check if a git repository has updates available.
*
* @param {string} repoDir - Path to git repository
* @returns {boolean} - True if updates are available
*/
function checkForUpdates(repoDir) {
try {
// Quick check with 3 second timeout to avoid delays if network is down
const output = execSync('git fetch origin && git status --porcelain=v1 --branch', {
cwd: repoDir,
timeout: 3000,
encoding: 'utf8',
stdio: 'pipe'
});
// Parse git status output to see if we're behind
const statusLines = output.split('\n');
for (const line of statusLines) {
if (line.startsWith('## ') && line.includes('[behind ')) {
return true; // We're behind remote
}
}
return false; // Up to date
} catch (error) {
// Network down, git error, timeout, etc. - don't block bootstrap
return false;
}
}
/**
* Strip YAML frontmatter from skill content, returning just the content.
*
* @param {string} content - Full content including frontmatter
* @returns {string} - Content without frontmatter
*/
function stripFrontmatter(content) {
const lines = content.split('\n');
let inFrontmatter = false;
let frontmatterEnded = false;
const contentLines = [];
for (const line of lines) {
if (line.trim() === '---') {
if (inFrontmatter) {
frontmatterEnded = true;
continue;
}
inFrontmatter = true;
continue;
}
if (frontmatterEnded || !inFrontmatter) {
contentLines.push(line);
}
}
return contentLines.join('\n').trim();
}
export {
extractFrontmatter,
findSkillsInDir,
resolveSkillPath,
checkForUpdates,
stripFrontmatter
};

View File

@@ -0,0 +1,54 @@
---
name: brainstorming
description: "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation."
---
# Brainstorming Ideas Into Designs
## Overview
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design in small sections (200-300 words), checking after each section whether it looks right so far.
## The Process
**Understanding the idea:**
- Check out the current project state first (files, docs, recent commits)
- Ask questions one at a time to refine the idea
- Prefer multiple choice questions when possible, but open-ended is fine too
- Only one question per message - if a topic needs more exploration, break it into multiple questions
- Focus on understanding: purpose, constraints, success criteria
**Exploring approaches:**
- Propose 2-3 different approaches with trade-offs
- Present options conversationally with your recommendation and reasoning
- Lead with your recommended option and explain why
**Presenting the design:**
- Once you believe you understand what you're building, present the design
- Break it into sections of 200-300 words
- Ask after each section whether it looks right so far
- Cover: architecture, components, data flow, error handling, testing
- Be ready to go back and clarify if something doesn't make sense
## After the Design
**Documentation:**
- Write the validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
- Use elements-of-style:writing-clearly-and-concisely skill if available
- Commit the design document to git
**Implementation (if continuing):**
- Ask: "Ready to set up for implementation?"
- Use superpowers:using-git-worktrees to create isolated workspace
- Use superpowers:writing-plans to create detailed implementation plan
## Key Principles
- **One question at a time** - Don't overwhelm with multiple questions
- **Multiple choice preferred** - Easier to answer than open-ended when possible
- **YAGNI ruthlessly** - Remove unnecessary features from all designs
- **Explore alternatives** - Always propose 2-3 approaches before settling
- **Incremental validation** - Present design in sections, validate each
- **Be flexible** - Go back and clarify when something doesn't make sense

View File

@@ -0,0 +1,180 @@
---
name: dispatching-parallel-agents
description: Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
---
# Dispatching Parallel Agents
## Overview
When you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.
**Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.
## When to Use
```dot
digraph when_to_use {
"Multiple failures?" [shape=diamond];
"Are they independent?" [shape=diamond];
"Single agent investigates all" [shape=box];
"One agent per problem domain" [shape=box];
"Can they work in parallel?" [shape=diamond];
"Sequential agents" [shape=box];
"Parallel dispatch" [shape=box];
"Multiple failures?" -> "Are they independent?" [label="yes"];
"Are they independent?" -> "Single agent investigates all" [label="no - related"];
"Are they independent?" -> "Can they work in parallel?" [label="yes"];
"Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
"Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
}
```
**Use when:**
- 3+ test files failing with different root causes
- Multiple subsystems broken independently
- Each problem can be understood without context from others
- No shared state between investigations
**Don't use when:**
- Failures are related (fix one might fix others)
- Need to understand full system state
- Agents would interfere with each other
## The Pattern
### 1. Identify Independent Domains
Group failures by what's broken:
- File A tests: Tool approval flow
- File B tests: Batch completion behavior
- File C tests: Abort functionality
Each domain is independent - fixing tool approval doesn't affect abort tests.
### 2. Create Focused Agent Tasks
Each agent gets:
- **Specific scope:** One test file or subsystem
- **Clear goal:** Make these tests pass
- **Constraints:** Don't change other code
- **Expected output:** Summary of what you found and fixed
### 3. Dispatch in Parallel
```typescript
// In Claude Code / AI environment
Task("Fix agent-tool-abort.test.ts failures")
Task("Fix batch-completion-behavior.test.ts failures")
Task("Fix tool-approval-race-conditions.test.ts failures")
// All three run concurrently
```
### 4. Review and Integrate
When agents return:
- Read each summary
- Verify fixes don't conflict
- Run full test suite
- Integrate all changes
## Agent Prompt Structure
Good agent prompts are:
1. **Focused** - One clear problem domain
2. **Self-contained** - All context needed to understand the problem
3. **Specific about output** - What should the agent return?
```markdown
Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
1. "should abort tool with partial output capture" - expects 'interrupted at' in message
2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
3. "should properly track pendingToolCount" - expects 3 results but gets 0
These are timing/race condition issues. Your task:
1. Read the test file and understand what each test verifies
2. Identify root cause - timing issues or actual bugs?
3. Fix by:
- Replacing arbitrary timeouts with event-based waiting
- Fixing bugs in abort implementation if found
- Adjusting test expectations if testing changed behavior
Do NOT just increase timeouts - find the real issue.
Return: Summary of what you found and what you fixed.
```
## Common Mistakes
**❌ Too broad:** "Fix all the tests" - agent gets lost
**✅ Specific:** "Fix agent-tool-abort.test.ts" - focused scope
**❌ No context:** "Fix the race condition" - agent doesn't know where
**✅ Context:** Paste the error messages and test names
**❌ No constraints:** Agent might refactor everything
**✅ Constraints:** "Do NOT change production code" or "Fix tests only"
**❌ Vague output:** "Fix it" - you don't know what changed
**✅ Specific:** "Return summary of root cause and changes"
## When NOT to Use
**Related failures:** Fixing one might fix others - investigate together first
**Need full context:** Understanding requires seeing entire system
**Exploratory debugging:** You don't know what's broken yet
**Shared state:** Agents would interfere (editing same files, using same resources)
## Real Example from Session
**Scenario:** 6 test failures across 3 files after major refactoring
**Failures:**
- agent-tool-abort.test.ts: 3 failures (timing issues)
- batch-completion-behavior.test.ts: 2 failures (tools not executing)
- tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)
**Decision:** Independent domains - abort logic separate from batch completion separate from race conditions
**Dispatch:**
```
Agent 1 → Fix agent-tool-abort.test.ts
Agent 2 → Fix batch-completion-behavior.test.ts
Agent 3 → Fix tool-approval-race-conditions.test.ts
```
**Results:**
- Agent 1: Replaced timeouts with event-based waiting
- Agent 2: Fixed event structure bug (threadId in wrong place)
- Agent 3: Added wait for async tool execution to complete
**Integration:** All fixes independent, no conflicts, full suite green
**Time saved:** 3 problems solved in parallel vs sequentially
## Key Benefits
1. **Parallelization** - Multiple investigations happen simultaneously
2. **Focus** - Each agent has narrow scope, less context to track
3. **Independence** - Agents don't interfere with each other
4. **Speed** - 3 problems solved in time of 1
## Verification
After agents return:
1. **Review each summary** - Understand what changed
2. **Check for conflicts** - Did agents edit same code?
3. **Run full suite** - Verify all fixes work together
4. **Spot check** - Agents can make systematic errors
## Real-World Impact
From debugging session (2025-10-03):
- 6 failures across 3 files
- 3 agents dispatched in parallel
- All investigations completed concurrently
- All fixes integrated successfully
- Zero conflicts between agent changes

View File

@@ -0,0 +1,76 @@
---
name: executing-plans
description: Use when you have a written implementation plan to execute in a separate session with review checkpoints
---
# Executing Plans
## Overview
Load plan, review critically, execute tasks in batches, report for review between batches.
**Core principle:** Batch execution with checkpoints for architect review.
**Announce at start:** "I'm using the executing-plans skill to implement this plan."
## The Process
### Step 1: Load and Review Plan
1. Read plan file
2. Review critically - identify any questions or concerns about the plan
3. If concerns: Raise them with your human partner before starting
4. If no concerns: Create TodoWrite and proceed
### Step 2: Execute Batch
**Default: First 3 tasks**
For each task:
1. Mark as in_progress
2. Follow each step exactly (plan has bite-sized steps)
3. Run verifications as specified
4. Mark as completed
### Step 3: Report
When batch complete:
- Show what was implemented
- Show verification output
- Say: "Ready for feedback."
### Step 4: Continue
Based on feedback:
- Apply changes if needed
- Execute next batch
- Repeat until complete
### Step 5: Complete Development
After all tasks complete and verified:
- Announce: "I'm using the finishing-a-development-branch skill to complete this work."
- **REQUIRED SUB-SKILL:** Use superpowers:finishing-a-development-branch
- Follow that skill to verify tests, present options, execute choice
## When to Stop and Ask for Help
**STOP executing immediately when:**
- Hit a blocker mid-batch (missing dependency, test fails, instruction unclear)
- Plan has critical gaps preventing starting
- You don't understand an instruction
- Verification fails repeatedly
**Ask for clarification rather than guessing.**
## When to Revisit Earlier Steps
**Return to Review (Step 1) when:**
- Partner updates the plan based on your feedback
- Fundamental approach needs rethinking
**Don't force through blockers** - stop and ask.
## Remember
- Review plan critically first
- Follow plan steps exactly
- Don't skip verifications
- Reference skills when plan says to
- Between batches: just report and wait
- Stop when blocked, don't guess

View File

@@ -0,0 +1,200 @@
---
name: finishing-a-development-branch
description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
---
# Finishing a Development Branch
## Overview
Guide completion of development work by presenting clear options and handling chosen workflow.
**Core principle:** Verify tests → Present options → Execute choice → Clean up.
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
## The Process
### Step 1: Verify Tests
**Before presenting options, verify tests pass:**
```bash
# Run project's test suite
npm test / cargo test / pytest / go test ./...
```
**If tests fail:**
```
Tests failing (<N> failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.
```
Stop. Don't proceed to Step 2.
**If tests pass:** Continue to Step 2.
### Step 2: Determine Base Branch
```bash
# Try common base branches
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
```
Or ask: "This branch split from main - is that correct?"
### Step 3: Present Options
Present exactly these 4 options:
```
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
```
**Don't add explanation** - keep options concise.
### Step 4: Execute Choice
#### Option 1: Merge Locally
```bash
# Switch to base branch
git checkout <base-branch>
# Pull latest
git pull
# Merge feature branch
git merge <feature-branch>
# Verify tests on merged result
<test command>
# If tests pass
git branch -d <feature-branch>
```
Then: Cleanup worktree (Step 5)
#### Option 2: Push and Create PR
```bash
# Push branch
git push -u origin <feature-branch>
# Create PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
```
Then: Cleanup worktree (Step 5)
#### Option 3: Keep As-Is
Report: "Keeping branch <name>. Worktree preserved at <path>."
**Don't cleanup worktree.**
#### Option 4: Discard
**Confirm first:**
```
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.
```
Wait for exact confirmation.
If confirmed:
```bash
git checkout <base-branch>
git branch -D <feature-branch>
```
Then: Cleanup worktree (Step 5)
### Step 5: Cleanup Worktree
**For Options 1, 2, 4:**
Check if in worktree:
```bash
git worktree list | grep $(git branch --show-current)
```
If yes:
```bash
git worktree remove <worktree-path>
```
**For Option 3:** Keep worktree.
## Quick Reference
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|--------|-------|------|---------------|----------------|
| 1. Merge locally | ✓ | - | - | ✓ |
| 2. Create PR | - | ✓ | ✓ | - |
| 3. Keep as-is | - | - | ✓ | - |
| 4. Discard | - | - | - | ✓ (force) |
## Common Mistakes
**Skipping test verification**
- **Problem:** Merge broken code, create failing PR
- **Fix:** Always verify tests before offering options
**Open-ended questions**
- **Problem:** "What should I do next?" → ambiguous
- **Fix:** Present exactly 4 structured options
**Automatic worktree cleanup**
- **Problem:** Remove worktree when might need it (Option 2, 3)
- **Fix:** Only cleanup for Options 1 and 4
**No confirmation for discard**
- **Problem:** Accidentally delete work
- **Fix:** Require typed "discard" confirmation
## Red Flags
**Never:**
- Proceed with failing tests
- Merge without verifying tests on result
- Delete work without confirmation
- Force-push without explicit request
**Always:**
- Verify tests before offering options
- Present exactly 4 options
- Get typed confirmation for Option 4
- Clean up worktree for Options 1 & 4 only
## Integration
**Called by:**
- **subagent-driven-development** (Step 7) - After all tasks complete
- **executing-plans** (Step 5) - After all batches complete
**Pairs with:**
- **using-git-worktrees** - Cleans up worktree created by that skill

View File

@@ -0,0 +1,213 @@
---
name: receiving-code-review
description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
---
# Code Review Reception
## Overview
Code review requires technical evaluation, not emotional performance.
**Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
## The Response Pattern
```
WHEN receiving code review feedback:
1. READ: Complete feedback without reacting
2. UNDERSTAND: Restate requirement in own words (or ask)
3. VERIFY: Check against codebase reality
4. EVALUATE: Technically sound for THIS codebase?
5. RESPOND: Technical acknowledgment or reasoned pushback
6. IMPLEMENT: One item at a time, test each
```
## Forbidden Responses
**NEVER:**
- "You're absolutely right!" (explicit CLAUDE.md violation)
- "Great point!" / "Excellent feedback!" (performative)
- "Let me implement that now" (before verification)
**INSTEAD:**
- Restate the technical requirement
- Ask clarifying questions
- Push back with technical reasoning if wrong
- Just start working (actions > words)
## Handling Unclear Feedback
```
IF any item is unclear:
STOP - do not implement anything yet
ASK for clarification on unclear items
WHY: Items may be related. Partial understanding = wrong implementation.
```
**Example:**
```
your human partner: "Fix 1-6"
You understand 1,2,3,6. Unclear on 4,5.
❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
```
## Source-Specific Handling
### From your human partner
- **Trusted** - implement after understanding
- **Still ask** if scope unclear
- **No performative agreement**
- **Skip to action** or technical acknowledgment
### From External Reviewers
```
BEFORE implementing:
1. Check: Technically correct for THIS codebase?
2. Check: Breaks existing functionality?
3. Check: Reason for current implementation?
4. Check: Works on all platforms/versions?
5. Check: Does reviewer understand full context?
IF suggestion seems wrong:
Push back with technical reasoning
IF can't easily verify:
Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
IF conflicts with your human partner's prior decisions:
Stop and discuss with your human partner first
```
**your human partner's rule:** "External feedback - be skeptical, but check carefully"
## YAGNI Check for "Professional" Features
```
IF reviewer suggests "implementing properly":
grep codebase for actual usage
IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
IF used: Then implement properly
```
**your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
## Implementation Order
```
FOR multi-item feedback:
1. Clarify anything unclear FIRST
2. Then implement in this order:
- Blocking issues (breaks, security)
- Simple fixes (typos, imports)
- Complex fixes (refactoring, logic)
3. Test each fix individually
4. Verify no regressions
```
## When To Push Back
Push back when:
- Suggestion breaks existing functionality
- Reviewer lacks full context
- Violates YAGNI (unused feature)
- Technically incorrect for this stack
- Legacy/compatibility reasons exist
- Conflicts with your human partner's architectural decisions
**How to push back:**
- Use technical reasoning, not defensiveness
- Ask specific questions
- Reference working tests/code
- Involve your human partner if architectural
**Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
## Acknowledging Correct Feedback
When feedback IS correct:
```
✅ "Fixed. [Brief description of what changed]"
✅ "Good catch - [specific issue]. Fixed in [location]."
✅ [Just fix it and show in the code]
❌ "You're absolutely right!"
❌ "Great point!"
❌ "Thanks for catching that!"
❌ "Thanks for [anything]"
❌ ANY gratitude expression
```
**Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
**If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
## Gracefully Correcting Your Pushback
If you pushed back and were wrong:
```
✅ "You were right - I checked [X] and it does [Y]. Implementing now."
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
❌ Long apology
❌ Defending why you pushed back
❌ Over-explaining
```
State the correction factually and move on.
## Common Mistakes
| Mistake | Fix |
|---------|-----|
| Performative agreement | State requirement or just act |
| Blind implementation | Verify against codebase first |
| Batch without testing | One at a time, test each |
| Assuming reviewer is right | Check if breaks things |
| Avoiding pushback | Technical correctness > comfort |
| Partial implementation | Clarify all items first |
| Can't verify, proceed anyway | State limitation, ask for direction |
## Real Examples
**Performative Agreement (Bad):**
```
Reviewer: "Remove legacy code"
❌ "You're absolutely right! Let me remove that..."
```
**Technical Verification (Good):**
```
Reviewer: "Remove legacy code"
✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
```
**YAGNI (Good):**
```
Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
```
**Unclear Item (Good):**
```
your human partner: "Fix items 1-6"
You understand 1,2,3,6. Unclear on 4,5.
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
```
## GitHub Thread Replies
When replying to inline review comments on GitHub, reply in the comment thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`), not as a top-level PR comment.
## The Bottom Line
**External feedback = suggestions to evaluate, not orders to follow.**
Verify. Question. Then implement.
No performative agreement. Technical rigor always.

View File

@@ -0,0 +1,105 @@
---
name: requesting-code-review
description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
---
# Requesting Code Review
Dispatch superpowers:code-reviewer subagent to catch issues before they cascade.
**Core principle:** Review early, review often.
## When to Request Review
**Mandatory:**
- After each task in subagent-driven development
- After completing major feature
- Before merge to main
**Optional but valuable:**
- When stuck (fresh perspective)
- Before refactoring (baseline check)
- After fixing complex bug
## How to Request
**1. Get git SHAs:**
```bash
BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
HEAD_SHA=$(git rev-parse HEAD)
```
**2. Dispatch code-reviewer subagent:**
Use Task tool with superpowers:code-reviewer type, fill template at `code-reviewer.md`
**Placeholders:**
- `{WHAT_WAS_IMPLEMENTED}` - What you just built
- `{PLAN_OR_REQUIREMENTS}` - What it should do
- `{BASE_SHA}` - Starting commit
- `{HEAD_SHA}` - Ending commit
- `{DESCRIPTION}` - Brief summary
**3. Act on feedback:**
- Fix Critical issues immediately
- Fix Important issues before proceeding
- Note Minor issues for later
- Push back if reviewer is wrong (with reasoning)
## Example
```
[Just completed Task 2: Add verification function]
You: Let me request code review before proceeding.
BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
HEAD_SHA=$(git rev-parse HEAD)
[Dispatch superpowers:code-reviewer subagent]
WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/deployment-plan.md
BASE_SHA: a7981ec
HEAD_SHA: 3df7661
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
[Subagent returns]:
Strengths: Clean architecture, real tests
Issues:
Important: Missing progress indicators
Minor: Magic number (100) for reporting interval
Assessment: Ready to proceed
You: [Fix progress indicators]
[Continue to Task 3]
```
## Integration with Workflows
**Subagent-Driven Development:**
- Review after EACH task
- Catch issues before they compound
- Fix before moving to next task
**Executing Plans:**
- Review after each batch (3 tasks)
- Get feedback, apply, continue
**Ad-Hoc Development:**
- Review before merge
- Review when stuck
## Red Flags
**Never:**
- Skip review because "it's simple"
- Ignore Critical issues
- Proceed with unfixed Important issues
- Argue with valid technical feedback
**If reviewer wrong:**
- Push back with technical reasoning
- Show code/tests that prove it works
- Request clarification
See template at: requesting-code-review/code-reviewer.md

View File

@@ -0,0 +1,146 @@
# Code Review Agent
You are reviewing code changes for production readiness.
**Your task:**
1. Review {WHAT_WAS_IMPLEMENTED}
2. Compare against {PLAN_OR_REQUIREMENTS}
3. Check code quality, architecture, testing
4. Categorize issues by severity
5. Assess production readiness
## What Was Implemented
{DESCRIPTION}
## Requirements/Plan
{PLAN_REFERENCE}
## Git Range to Review
**Base:** {BASE_SHA}
**Head:** {HEAD_SHA}
```bash
git diff --stat {BASE_SHA}..{HEAD_SHA}
git diff {BASE_SHA}..{HEAD_SHA}
```
## Review Checklist
**Code Quality:**
- Clean separation of concerns?
- Proper error handling?
- Type safety (if applicable)?
- DRY principle followed?
- Edge cases handled?
**Architecture:**
- Sound design decisions?
- Scalability considerations?
- Performance implications?
- Security concerns?
**Testing:**
- Tests actually test logic (not mocks)?
- Edge cases covered?
- Integration tests where needed?
- All tests passing?
**Requirements:**
- All plan requirements met?
- Implementation matches spec?
- No scope creep?
- Breaking changes documented?
**Production Readiness:**
- Migration strategy (if schema changes)?
- Backward compatibility considered?
- Documentation complete?
- No obvious bugs?
## Output Format
### Strengths
[What's well done? Be specific.]
### Issues
#### Critical (Must Fix)
[Bugs, security issues, data loss risks, broken functionality]
#### Important (Should Fix)
[Architecture problems, missing features, poor error handling, test gaps]
#### Minor (Nice to Have)
[Code style, optimization opportunities, documentation improvements]
**For each issue:**
- File:line reference
- What's wrong
- Why it matters
- How to fix (if not obvious)
### Recommendations
[Improvements for code quality, architecture, or process]
### Assessment
**Ready to merge?** [Yes/No/With fixes]
**Reasoning:** [Technical assessment in 1-2 sentences]
## Critical Rules
**DO:**
- Categorize by actual severity (not everything is Critical)
- Be specific (file:line, not vague)
- Explain WHY issues matter
- Acknowledge strengths
- Give clear verdict
**DON'T:**
- Say "looks good" without checking
- Mark nitpicks as Critical
- Give feedback on code you didn't review
- Be vague ("improve error handling")
- Avoid giving a clear verdict
## Example Output
```
### Strengths
- Clean database schema with proper migrations (db.ts:15-42)
- Comprehensive test coverage (18 tests, all edge cases)
- Good error handling with fallbacks (summarizer.ts:85-92)
### Issues
#### Important
1. **Missing help text in CLI wrapper**
- File: index-conversations:1-31
- Issue: No --help flag, users won't discover --concurrency
- Fix: Add --help case with usage examples
2. **Date validation missing**
- File: search.ts:25-27
- Issue: Invalid dates silently return no results
- Fix: Validate ISO format, throw error with example
#### Minor
1. **Progress indicators**
- File: indexer.ts:130
- Issue: No "X of Y" counter for long operations
- Impact: Users don't know how long to wait
### Recommendations
- Add progress reporting for user experience
- Consider config file for excluded projects (portability)
### Assessment
**Ready to merge: With fixes**
**Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality.
```

View File

@@ -0,0 +1,240 @@
---
name: subagent-driven-development
description: Use when executing implementation plans with independent tasks in the current session
---
# Subagent-Driven Development
Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
**Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
## When to Use
```dot
digraph when_to_use {
"Have implementation plan?" [shape=diamond];
"Tasks mostly independent?" [shape=diamond];
"Stay in this session?" [shape=diamond];
"subagent-driven-development" [shape=box];
"executing-plans" [shape=box];
"Manual execution or brainstorm first" [shape=box];
"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];
}
```
**vs. Executing Plans (parallel session):**
- Same session (no context switch)
- Fresh subagent per task (no context pollution)
- Two-stage review after each task: spec compliance first, then code quality
- Faster iteration (no human-in-loop between tasks)
## The Process
```dot
digraph process {
rankdir=TB;
subgraph cluster_per_task {
label="Per Task";
"Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
"Implementer subagent asks questions?" [shape=diamond];
"Answer questions, provide context" [shape=box];
"Implementer subagent implements, tests, commits, self-reviews" [shape=box];
"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
"Spec reviewer subagent confirms code matches spec?" [shape=diamond];
"Implementer subagent fixes spec gaps" [shape=box];
"Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
"Code quality reviewer subagent approves?" [shape=diamond];
"Implementer subagent fixes quality issues" [shape=box];
"Mark task complete in TodoWrite" [shape=box];
}
"Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
"More tasks remain?" [shape=diamond];
"Dispatch final code reviewer subagent for entire implementation" [shape=box];
"Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
"Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
"Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
"Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
"Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
"Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
"Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
"Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
"Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
"Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
"Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
"Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
"Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];
"Mark task complete in TodoWrite" -> "More tasks remain?";
"More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
"More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
"Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";
}
```
## Prompt Templates
- `./implementer-prompt.md` - Dispatch implementer subagent
- `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent
- `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent
## Example Workflow
```
You: I'm using Subagent-Driven Development to execute this plan.
[Read plan file once: docs/plans/feature-plan.md]
[Extract all 5 tasks with full text and context]
[Create TodoWrite with all tasks]
Task 1: Hook installation script
[Get Task 1 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]
Implementer: "Before I begin - should the hook be installed at user or system level?"
You: "User level (~/.config/superpowers/hooks/)"
Implementer: "Got it. Implementing now..."
[Later] Implementer:
- Implemented install-hook command
- Added tests, 5/5 passing
- Self-review: Found I missed --force flag, added it
- Committed
[Dispatch spec compliance reviewer]
Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
[Get git SHAs, dispatch code quality reviewer]
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
[Mark Task 1 complete]
Task 2: Recovery modes
[Get Task 2 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]
Implementer: [No questions, proceeds]
Implementer:
- Added verify/repair modes
- 8/8 tests passing
- Self-review: All good
- Committed
[Dispatch spec compliance reviewer]
Spec reviewer: ❌ Issues:
- Missing: Progress reporting (spec says "report every 100 items")
- Extra: Added --json flag (not requested)
[Implementer fixes issues]
Implementer: Removed --json flag, added progress reporting
[Spec reviewer reviews again]
Spec reviewer: ✅ Spec compliant now
[Dispatch code quality reviewer]
Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
[Implementer fixes]
Implementer: Extracted PROGRESS_INTERVAL constant
[Code reviewer reviews again]
Code reviewer: ✅ Approved
[Mark Task 2 complete]
...
[After all tasks]
[Dispatch final code-reviewer]
Final reviewer: All requirements met, ready to merge
Done!
```
## Advantages
**vs. Manual execution:**
- Subagents follow TDD naturally
- Fresh context per task (no confusion)
- Parallel-safe (subagents don't interfere)
- Subagent can ask questions (before AND during work)
**vs. Executing Plans:**
- Same session (no handoff)
- Continuous progress (no waiting)
- Review checkpoints automatic
**Efficiency gains:**
- No file reading overhead (controller provides full text)
- Controller curates exactly what context is needed
- Subagent gets complete information upfront
- Questions surfaced before work begins (not after)
**Quality gates:**
- Self-review catches issues before handoff
- Two-stage review: spec compliance, then code quality
- Review loops ensure fixes actually work
- Spec compliance prevents over/under-building
- Code quality ensures implementation is well-built
**Cost:**
- More subagent invocations (implementer + 2 reviewers per task)
- Controller does more prep work (extracting all tasks upfront)
- Review loops add iterations
- But catches issues early (cheaper than debugging later)
## Red Flags
**Never:**
- Skip reviews (spec compliance OR code quality)
- Proceed with unfixed issues
- Dispatch multiple implementation subagents in parallel (conflicts)
- Make subagent read plan file (provide full text instead)
- Skip scene-setting context (subagent needs to understand where task fits)
- Ignore subagent questions (answer before letting them proceed)
- Accept "close enough" on spec compliance (spec reviewer found issues = not done)
- Skip review loops (reviewer found issues = implementer fixes = review again)
- Let implementer self-review replace actual review (both are needed)
- **Start code quality review before spec compliance is ✅** (wrong order)
- Move to next task while either review has open issues
**If subagent asks questions:**
- Answer clearly and completely
- Provide additional context if needed
- Don't rush them into implementation
**If reviewer finds issues:**
- Implementer (same subagent) fixes them
- Reviewer reviews again
- Repeat until approved
- Don't skip the re-review
**If subagent fails task:**
- Dispatch fix subagent with specific instructions
- Don't try to fix manually (context pollution)
## Integration
**Required workflow skills:**
- **superpowers:writing-plans** - Creates the plan this skill executes
- **superpowers:requesting-code-review** - Code review template for reviewer subagents
- **superpowers:finishing-a-development-branch** - Complete development after all tasks
**Subagents should use:**
- **superpowers:test-driven-development** - Subagents follow TDD for each task
**Alternative workflow:**
- **superpowers:executing-plans** - Use for parallel session instead of same-session execution

View File

@@ -0,0 +1,20 @@
# Code Quality Reviewer Prompt Template
Use this template when dispatching a code quality reviewer subagent.
**Purpose:** Verify implementation is well-built (clean, tested, maintainable)
**Only dispatch after spec compliance review passes.**
```
Task tool (superpowers:code-reviewer):
Use template at requesting-code-review/code-reviewer.md
WHAT_WAS_IMPLEMENTED: [from implementer's report]
PLAN_OR_REQUIREMENTS: Task N from [plan-file]
BASE_SHA: [commit before task]
HEAD_SHA: [current commit]
DESCRIPTION: [task summary]
```
**Code reviewer returns:** Strengths, Issues (Critical/Important/Minor), Assessment

View File

@@ -0,0 +1,78 @@
# Implementer Subagent Prompt Template
Use this template when dispatching an implementer subagent.
```
Task tool (general-purpose):
description: "Implement Task N: [task name]"
prompt: |
You are implementing Task N: [task name]
## Task Description
[FULL TEXT of task from plan - paste it here, don't make subagent read file]
## Context
[Scene-setting: where this fits, dependencies, architectural context]
## Before You Begin
If you have questions about:
- The requirements or acceptance criteria
- The approach or implementation strategy
- Dependencies or assumptions
- Anything unclear in the task description
**Ask them now.** Raise any concerns before starting work.
## Your Job
Once you're clear on requirements:
1. Implement exactly what the task specifies
2. Write tests (following TDD if task says to)
3. Verify implementation works
4. Commit your work
5. Self-review (see below)
6. Report back
Work from: [directory]
**While you work:** If you encounter something unexpected or unclear, **ask questions**.
It's always OK to pause and clarify. Don't guess or make assumptions.
## Before Reporting Back: Self-Review
Review your work with fresh eyes. Ask yourself:
**Completeness:**
- Did I fully implement everything in the spec?
- Did I miss any requirements?
- Are there edge cases I didn't handle?
**Quality:**
- Is this my best work?
- Are names clear and accurate (match what things do, not how they work)?
- Is the code clean and maintainable?
**Discipline:**
- Did I avoid overbuilding (YAGNI)?
- Did I only build what was requested?
- Did I follow existing patterns in the codebase?
**Testing:**
- Do tests actually verify behavior (not just mock behavior)?
- Did I follow TDD if required?
- Are tests comprehensive?
If you find issues during self-review, fix them now before reporting.
## Report Format
When done, report:
- What you implemented
- What you tested and test results
- Files changed
- Self-review findings (if any)
- Any issues or concerns
```

View File

@@ -0,0 +1,61 @@
# Spec Compliance Reviewer Prompt Template
Use this template when dispatching a spec compliance reviewer subagent.
**Purpose:** Verify implementer built what was requested (nothing more, nothing less)
```
Task tool (general-purpose):
description: "Review spec compliance for Task N"
prompt: |
You are reviewing whether an implementation matches its specification.
## What Was Requested
[FULL TEXT of task requirements]
## What Implementer Claims They Built
[From implementer's report]
## CRITICAL: Do Not Trust the Report
The implementer finished suspiciously quickly. Their report may be incomplete,
inaccurate, or optimistic. You MUST verify everything independently.
**DO NOT:**
- Take their word for what they implemented
- Trust their claims about completeness
- Accept their interpretation of requirements
**DO:**
- Read the actual code they wrote
- Compare actual implementation to requirements line by line
- Check for missing pieces they claimed to implement
- Look for extra features they didn't mention
## Your Job
Read the implementation code and verify:
**Missing requirements:**
- Did they implement everything that was requested?
- Are there requirements they skipped or missed?
- Did they claim something works but didn't actually implement it?
**Extra/unneeded work:**
- Did they build things that weren't requested?
- Did they over-engineer or add unnecessary features?
- Did they add "nice to haves" that weren't in spec?
**Misunderstandings:**
- Did they interpret requirements differently than intended?
- Did they solve the wrong problem?
- Did they implement the right feature but wrong way?
**Verify by reading code, not by trusting report.**
Report:
- ✅ Spec compliant (if everything matches after code inspection)
- ❌ Issues found: [list specifically what's missing or extra, with file:line references]
```

Some files were not shown because too many files have changed in this diff Show More