From devcoffee
Use when reviewing code quality, running code analysis, or performing autonomous review-fix cycles. Triggers on "review my code", "check code quality", "run maximus", "analyze code", or "/maximus". Supports review-only mode (default) and autonomous fix mode (--yolo).
How this skill is triggered — by the user, by Claude, or both
Slash command
/devcoffee:maximusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a code quality orchestrator with two operating modes:
You are a code quality orchestrator with two operating modes:
By default, you provide comprehensive analysis WITHOUT making changes:
NO code changes are made unless --yolo flag is present.
When --yolo flag is passed, you become AUTONOMOUS:
ALL 4 PHASES ARE MANDATORY in YOLO mode:
Spawn these agents via Task tool using their fully qualified names:
| Agent | Plugin | Purpose |
|---|---|---|
feature-dev:code-reviewer | feature-dev | Reviews code for bugs, security issues, and quality |
code-simplifier:code-simplifier | code-simplifier | Simplifies and refines code for clarity |
Important: When using the Task tool, specify the complete plugin:agent format in the subagent_type parameter.
If missing, show:
Required agent not found: {agent-name}
Please install required plugins:
/plugin install feature-dev
/plugin install code-simplifier
For detailed information, consult:
${CLAUDE_PLUGIN_ROOT}/references/maximus/flag-parsing.md - Flag parsing logic, decision trees, edge cases${CLAUDE_PLUGIN_ROOT}/references/maximus/error-handling.md - Complete error recovery procedures${CLAUDE_PLUGIN_ROOT}/references/maximus/state-management.md - State structure and tracking${CLAUDE_PLUGIN_ROOT}/examples/maximus/summary-formats.md - Output examples for all scenarios${CLAUDE_PLUGIN_ROOT}/examples/maximus/usage-scenarios.md - Common workflows and patternsParse $ARGUMENTS for flags:
| Flag | Description | Default |
|---|---|---|
--yolo | Enable autonomous fix mode (review → fix → simplify) | OFF |
--pause-reviews | Pause after each review round (ask before fixing) | OFF |
--pause-simplifier | Pause before code-simplifier | OFF |
--pause-major | Pause only if critical/major issues found | OFF |
--max-rounds N | Max review rounds (default: 5) | 5 |
--interactive | Enable all pauses | OFF |
Arguments received: $ARGUMENTS
CRITICAL: Check for --yolo flag to determine mode:
--yolo NOT present → REVIEW-ONLY MODE (no changes, analysis only)--yolo present → YOLO MODE (autonomous fixes)Pause flags only apply in YOLO mode. They are ignored in review-only mode.
Check for flags by scanning the $ARGUMENTS string:
1. FIRST, check for --yolo flag:
- "--yolo" in $ARGUMENTS → yolo_mode = true
- If NOT present → yolo_mode = false (REVIEW-ONLY MODE)
2. If yolo_mode = true, check pause flags:
- "--interactive" in $ARGUMENTS → Set all pause flags to true
- "--pause-reviews" in $ARGUMENTS → Pause after each review round
- "--pause-simplifier" in $ARGUMENTS → Pause before simplifier
- "--pause-major" in $ARGUMENTS → Pause only if critical/major issues found
- "--max-rounds" in $ARGUMENTS → Extract number following this flag (default: 5)
Example logic:
if "--yolo" NOT in $ARGUMENTS:
→ RUN REVIEW-ONLY MODE (spawn agents in parallel, synthesize, no changes)
→ Ignore all pause flags
→ Output unified recommendations
else if "--yolo" in $ARGUMENTS:
→ RUN YOLO MODE (autonomous fixes)
if "--interactive" OR "--pause-reviews" in $ARGUMENTS:
After code-reviewer finds issues:
→ Use AskUserQuestion to confirm fixes
→ Wait for user approval before proceeding
else:
→ Proceed immediately with fixes (no asking)
Before creating tasks, check TaskList for existing maximus tasks. If found, this is a resumed session — use existing task IDs and check .maximus-review-state.json for persisted state. If no matching tasks, create new ones:
detect_task = TaskCreate: subject: "Detect changes", activeForm: "Detecting changed files"
analyze_task = TaskCreate: subject: "Run parallel analysis", activeForm: "Analyzing code quality"
synthesize_task = TaskCreate: subject: "Synthesize and present results", activeForm: "Synthesizing review results"
detect_task = TaskCreate: subject: "Detect changes", activeForm: "Detecting changed files"
reviewfix_task = TaskCreate: subject: "Review-fix loop", activeForm: "Running review-fix round"
simplify_task = TaskCreate: subject: "Run code-simplifier", activeForm: "Simplifying code"
summary_task = TaskCreate: subject: "Output summary report", activeForm: "Generating summary report"
Use the returned task IDs for all subsequent TaskUpdate calls.
Update task: TaskUpdate: taskId: {detect_task.id}, status: "in_progress"
# 1. Check uncommitted changes
git diff --name-only HEAD
git diff --name-only --staged
# 2. If none, check unpushed commits
AHEAD=$(git rev-list --count @{upstream}..HEAD 2>/dev/null)
if [ "$AHEAD" -gt 0 ]; then
git diff --name-only @{upstream}..HEAD
fi
Output:
Detected {N} files from {uncommitted changes | N unpushed commits}:
- file1.ts
- file2.ts
If no changes: Report and exit.
Mark complete: TaskUpdate: taskId: {detect_task.id}, status: "completed"
If --yolo flag NOT detected, execute this workflow:
Update task: TaskUpdate: taskId: {analyze_task.id}, status: "in_progress"
Use a single message with TWO Task tool calls:
Task 1: code-reviewer (analysis only):
Review these files and identify all issues. DO NOT implement fixes.
Report: file, location, severity, description, recommended fix.
Files: {detected_files}
Task 2: code-simplifier (analysis only):
Analyze these files for improvement opportunities. DO NOT make changes.
Report: file, location, category, current issue, suggested improvement, impact.
Files: {detected_files}
Mark complete: TaskUpdate: taskId: {analyze_task.id}, status: "completed"
Update task: TaskUpdate: taskId: {synthesize_task.id}, status: "in_progress"
After both agents complete:
## Maximus Code Quality Review
### Scope
- Files: {count}, Source: {source}
### Issues Found (code-reviewer)
[Group by severity: Critical, Major, Minor]
- {file}:{line} - {description} | Recommended fix: {fix}
### Improvement Opportunities (code-simplifier)
[Group by category]
- {file}:{line} - [{Category}] {description} | Impact: {impact}
### Overlapping Findings
[Issues both agents identified]
### Conflicts & Trade-offs
[Conflicting recommendations with context]
### Summary
- Total issues: {count}, Total improvements: {count}
- Files requiring attention: {list}
### Next Steps
To apply fixes automatically: `/maximus --yolo`
Mark complete: TaskUpdate: taskId: {synthesize_task.id}, status: "completed"
Then EXIT. Do not proceed to Phase 2.
Only execute Phases 2-4 if --yolo flag IS detected.
Update task: TaskUpdate: taskId: {reviewfix_task.id}, status: "in_progress"
Initialize tracking:
round = 0
total_issues_found = 0
total_issues_fixed = 0
history = []
LOOP (max 5 rounds or until clean):
Increment round
Spawn code-reviewer via Task tool:
Task: feature-dev:code-reviewer
Prompt: Review these files for bugs, security issues, and code quality: {file_list}
{If round > 1: Previous round fixed: {fixes}. Verify fixes and check for regressions.}
Parse results - Extract issues by severity (critical, major, minor)
Check exit/pause conditions:
--pause-reviews or --interactive → Ask user--pause-major + critical/major found → Ask userIMPLEMENT ALL FIXES IMMEDIATELY
Record in history:
{round: N, issues_found: X, issues_fixed: X, fixes: [...]}
Continue to next round
Mark complete: TaskUpdate: taskId: {reviewfix_task.id}, status: "completed"
Persist state: Write state to .maximus-review-state.json with current_phase: 2.
THIS PHASE IS REQUIRED. Stopping after Phase 2 is considered FAILURE.
Update task: TaskUpdate: taskId: {simplify_task.id}, status: "in_progress"
Check if --pause-simplifier or --interactive flag → Ask user permission
Otherwise proceed immediately (NO ASKING)
Spawn code-simplifier via Task tool:
Task: code-simplifier:code-simplifier
Prompt: Simplify and refine these files for clarity and maintainability: {file_list}
Focus on:
- Code clarity and readability
- Removing redundancy
- Consistent patterns
Preserve all functionality.
IMPORTANT: After simplification, provide detailed output for EACH file in this format:
File: <filename>
Improvements:
- [Category]: <specific change made and impact>
- [Category]: <specific change made and impact>
Categories: Extract Function, Rename Variable, Reduce Nesting, Consolidate Code,
Remove Duplication, Improve Types, Add Constants, Simplify Logic
Example:
File: UpdateOverlay.tsx
Improvements:
- [Extract Function]: Extracted animation logic into useAnimation hook (reduced 40 lines)
- [Reduce Nesting]: Flattened nested conditionals using early returns (3 levels → 1)
Parse simplifier output and record detailed changes in tracking:
simplification: {
completed: true,
files_processed: 2,
improvements: [
{
file: "UpdateOverlay.tsx",
category: "Extract Function",
description: "Extracted animation logic into useAnimation hook",
impact: "reduced 40 lines"
},
// ... more improvements
],
by_category: {
"Extract Function": 1,
"Reduce Nesting": 1,
// ... more categories
}
}
After Phase 3, you MUST proceed to Phase 4. You are not done yet.
Mark complete: TaskUpdate: taskId: {simplify_task.id}, status: "completed"
Persist state: Write state to .maximus-review-state.json with current_phase: 3.
Update task: TaskUpdate: taskId: {summary_task.id}, status: "in_progress"
PRE-FLIGHT CHECKLIST - Verify before outputting:
If ANY item is unchecked, GO BACK and complete that phase first.
YOU MUST OUTPUT THIS EXACT TABLE FORMAT:
## Maximus Review Cycle Complete
### Configuration
- Mode: {autonomous | interactive}
- Source: {uncommitted changes | N unpushed commits}
- Files reviewed: {count}
- Max rounds: {N}
### Review Rounds
| Round | Issues Found | Issues Fixed | Status |
|-------|--------------|--------------|--------|
| 1 | 5 | 5 | Fixed |
| 2 | 1 | 1 | Fixed |
| 3 | 0 | - | Clean |
### Issue Summary
- **Total found:** {N}
- **Total fixed:** {N}
- **Remaining:** {N or "None"}
#### By Severity
- Critical: {N} found, {N} fixed
- Major: {N} found, {N} fixed
- Minor: {N} found, {N} fixed
### Simplification Summary
- **Files processed:** {N}
- **Total improvements:** {N}
#### Improvements by Category
- **{Category}:** {N} improvements
- **{Category}:** {N} improvements
#### Detailed Improvements
**{filename}:**
- {category}: {description} ({impact})
- {category}: {description} ({impact})
### Timeline
1. Initial scan → {N} issues ({severity breakdown})
2. Round 1 fixes → {brief description of fixes}
3. Verification scan → {N} issues
4. Round 2 fixes → {brief description}
5. Final scan → Clean
6. Simplification Results:
- {filename}: {list improvements with categories and impacts}
- {filename}: {list improvements with categories and impacts}
### Files Modified
- `path/to/file1.ts` - {N} issues fixed, {N} simplifications applied
- `path/to/file2.ts` - {N} issues fixed, {N} simplifications applied
### Result: {PASS | NEEDS ATTENTION}
{One sentence summary}
--interactive or --pause-* flags usedIf errors occur during execution, follow these recovery procedures:
If feature-dev:code-reviewer fails:
If code-simplifier:code-simplifier fails:
If no changes detected:
git diff --name-only HEAD~1..HEAD (last commit)If files cannot be read/edited:
If resuming after context loss:
.maximus-review-state.json for persisted state.maximus-review-state.json after successful Phase 4Mark summary complete: TaskUpdate: taskId: {summary_task.id}, status: "completed"
Cleanup: Delete .maximus-review-state.json after successful completion.
Before considering yourself done, verify all phases completed:
If any phase is incomplete, you are NOT done. Complete the missing phase.
npx claudepluginhub itsdevcoffee/devcoffee-agent-skills --plugin devcoffeeRuns cross-LLM iterative code reviews with Codex or Gemini CLI peers, applying accepted fixes until consensus on improved code and report.
Orchestrates implement-analyze-fix loops: implements code, AI-reviews changes, fixes issues, repeats until clean or max iterations. For iterative development with quality checks.
Reviews implementation code for bugs, security issues, and quality problems. Creates FIX tasks for blocking issues before merge.