Workflows review

From ratacat/claude-skills · View interactive version

Workflows review is an AI agent skill from the GitHub repository ratacat/claude-skills. Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and worktrees

How to use this skill

Skill file

Arguments

[PR number, GitHub URL, branch name, or latest]

Review Command

<command_purpose> Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and Git worktrees for deep local inspection. </command_purpose>

Introduction

<role>Senior Code Review Architect with expertise in security, performance, architecture, and quality assurance</role>

Prerequisites

<requirements>

</requirements>

Main Tasks

1. Determine Review Target & Setup (ALWAYS FIRST)

<review_target> #$ARGUMENTS </review_target>

<thinking>

First, I need to determine the review target type and set up the code for analysis.

</thinking>

Immediate Actions:

<task_list>

Ensure that the code is ready for analysis (either in worktree or on current branch). ONLY then proceed to the next step.

</task_list>

Protected Artifacts

<protected_artifacts>

The following paths are compound-engineering pipeline artifacts and must never be flagged for deletion, removal, or gitignore by any review agent:

If a review agent flags any file in these directories for cleanup or removal, discard that finding during synthesis. Do not create a todo for it.

</protected_artifacts>

Parallel Agents to review the PR:

<parallel_tasks>

Run ALL or most of these agents at the same time:

  1. Task kieran-rails-reviewer(PR content)
  2. Task dhh-rails-reviewer(PR title)
  3. If turbo is used: Task rails-turbo-expert(PR content)
  4. Task git-history-analyzer(PR content)
  5. Task dependency-detective(PR content)
  6. Task pattern-recognition-specialist(PR content)
  7. Task architecture-strategist(PR content)
  8. Task code-philosopher(PR content)
  9. Task security-sentinel(PR content)
  10. Task performance-oracle(PR content)
  11. Task devops-harmony-analyst(PR content)
  12. Task data-integrity-guardian(PR content)
  13. Task agent-native-reviewer(PR content) - Verify new features are agent-accessible

</parallel_tasks>

Conditional Agents (Run if applicable):

<conditional_agents>

These agents are run ONLY when the PR matches specific criteria. Check the PR files list to determine if they apply:

If PR contains database migrations (db/migrate/*.rb files) or data backfills:

  1. Task data-migration-expert(PR content) - Validates ID mappings match production, checks for swapped values, verifies rollback safety
  2. Task deployment-verification-agent(PR content) - Creates Go/No-Go deployment checklist with SQL verification queries

When to run migration agents:

What these agents check:

</conditional_agents>

4. Ultra-Thinking Deep Dive Phases

<ultrathink_instruction> For each phase below, spend maximum cognitive effort. Think step by step. Consider all angles. Question assumptions. And bring all reviews in a synthesis to the user.</ultrathink_instruction>

<deliverable>

Complete system context map with component interactions

</deliverable>

Phase 3: Stakeholder Perspective Analysis

<thinking_prompt> ULTRA-THINK: Put yourself in each stakeholder's shoes. What matters to them? What are their pain points? </thinking_prompt>

<stakeholder_perspectives>

  1. Developer Perspective <questions>
  1. Operations Perspective <questions>
  1. End User Perspective <questions>
  1. Security Team Perspective <questions>
  1. Business Perspective <questions>
Phase 4: Scenario Exploration

<thinking_prompt> ULTRA-THINK: Explore edge cases and failure scenarios. What could go wrong? How does the system behave under stress? </thinking_prompt>

<scenario_checklist>

6. Multi-Angle Review Perspectives

Technical Excellence Angle
Business Value Angle
Risk Management Angle
Team Dynamics Angle

4. Simplification and Minimalism Review

Run the Task code-simplicity-reviewer() to see if we can simplify the code.

5. Findings Synthesis and Todo Creation Using file-todos Skill

<critical_requirement> ALL findings MUST be stored in the todos/ directory using the file-todos skill. Create todo files immediately after synthesis - do NOT present findings for user approval first. Use the skill for structured todo management. </critical_requirement>

Step 1: Synthesize All Findings

<thinking>

Consolidate all agent reports into a categorized list of findings.

Remove duplicates, prioritize by severity and impact.

</thinking>

<synthesis_tasks>

</synthesis_tasks>

Step 2: Create Todo Files Using file-todos Skill

<critical_instruction> Use the file-todos skill to create todo files for ALL findings immediately. Do NOT present findings one-by-one asking for user approval. Create all todo files in parallel using the skill, then summarize results to user. </critical_instruction>

Implementation Options:

Option A: Direct File Creation (Fast)

Option B: Sub-Agents in Parallel (Recommended for Scale) For large PRs with 15+ findings, use sub-agents to create finding files in parallel:

# Launch multiple finding-creator agents in parallel
Task() - Create todos for first finding
Task() - Create todos for second finding
Task() - Create todos for third finding
etc. for each finding.

Sub-agents can:

Execution Strategy:

  1. Synthesize all findings into categories (P1/P2/P3)
  2. Group findings by severity
  3. Launch 3 parallel sub-agents (one per severity level)
  4. Each sub-agent creates its batch of todos using the file-todos skill
  5. Consolidate results and present summary

Process (Using file-todos Skill):

  1. For each finding:
  1. Use file-todos skill for structured todo management:

```bash

skill: file-todos

```

The skill provides:

  1. Create todo files in parallel:

```bash

{next_id}-pending-{priority}-{description}.md

```

  1. Examples:

```

001-pending-p1-path-traversal-vulnerability.md

002-pending-p1-api-response-validation.md

003-pending-p2-concurrency-limit.md

004-pending-p3-unused-parameter.md

```

  1. Follow template structure from file-todos skill: .claude/skills/file-todos/assets/todo-template.md

Todo File Structure (from template):

Each todo must include:

File naming convention:

{issue_id}-{status}-{priority}-{description}.md

Examples:
- 001-pending-p1-security-vulnerability.md
- 002-pending-p2-performance-optimization.md
- 003-pending-p3-code-cleanup.md

Status values:

Priority values:

Tagging: Always add code-review tag, plus: security, performance, architecture, rails, quality, etc.

Step 3: Summary Report

After creating all todo files, present comprehensive summary:

## ✅ Code Review Complete

**Review Target:** PR #XXXX - [PR Title] **Branch:** [branch-name]

### Findings Summary:

- **Total Findings:** [X]
- **🔴 CRITICAL (P1):** [count] - BLOCKS MERGE
- **🟡 IMPORTANT (P2):** [count] - Should Fix
- **🔵 NICE-TO-HAVE (P3):** [count] - Enhancements

### Created Todo Files:

**P1 - Critical (BLOCKS MERGE):**

- `001-pending-p1-{finding}.md` - {description}
- `002-pending-p1-{finding}.md` - {description}

**P2 - Important:**

- `003-pending-p2-{finding}.md` - {description}
- `004-pending-p2-{finding}.md` - {description}

**P3 - Nice-to-Have:**

- `005-pending-p3-{finding}.md` - {description}

### Review Agents Used:

- kieran-rails-reviewer
- security-sentinel
- performance-oracle
- architecture-strategist
- agent-native-reviewer
- [other agents]

### Next Steps:

1. **Address P1 Findings**: CRITICAL - must be fixed before merge

   - Review each P1 todo in detail
   - Implement fixes or request exemption
   - Verify fixes before merging PR

2. **Triage All Todos**:
   ```bash
   ls todos/*-pending-*.md  # View all pending todos
   /triage                  # Use slash command for interactive triage
   ```
  1. Work on Approved Todos:

```bash

/resolve_todo_parallel # Fix all approved items efficiently

```

  1. Track Progress:

Severity Breakdown:

🔴 P1 (Critical - Blocks Merge):

🟡 P2 (Important - Should Fix):

🔵 P3 (Nice-to-Have):


### 7. End-to-End Testing (Optional)

<detect_project_type>

**First, detect the project type from PR files:**

| Indicator | Project Type |
|-----------|--------------|
| `*.xcodeproj`, `*.xcworkspace`, `Package.swift` (iOS) | iOS/macOS |
| `Gemfile`, `package.json`, `app/views/*`, `*.html.*` | Web |
| Both iOS files AND web files | Hybrid (test both) |

</detect_project_type>

<offer_testing>

After presenting the Summary Report, offer appropriate testing based on project type:

**For Web Projects:**

"Want to run browser tests on the affected pages?"

  1. Yes - run /test-browser
  2. No - skip

**For iOS Projects:**

"Want to run Xcode simulator tests on the app?"

  1. Yes - run /xcode-test
  2. No - skip

**For Hybrid Projects (e.g., Rails + Hotwire Native):**

"Want to run end-to-end tests?"

  1. Web only - run /test-browser
  2. iOS only - run /xcode-test
  3. Both - run both commands
  4. No - skip

</offer_testing>

#### If User Accepts Web Testing:

Spawn a subagent to run browser tests (preserves main context):

Task general-purpose("Run /test-browser for PR #[number]. Test all affected pages, check for console errors, handle failures by creating todos and fixing.")


The subagent will:
1. Identify pages affected by the PR
2. Navigate to each page and capture snapshots (using Playwright MCP or agent-browser CLI)
3. Check for console errors
4. Test critical interactions
5. Pause for human verification on OAuth/email/payment flows
6. Create P1 todos for any failures
7. Fix and retry until all tests pass

**Standalone:** `/test-browser [PR number]`

#### If User Accepts iOS Testing:

Spawn a subagent to run Xcode tests (preserves main context):

Task general-purpose("Run /xcode-test for scheme [name]. Build for simulator, install, launch, take screenshots, check for crashes.")


The subagent will:
1. Verify XcodeBuildMCP is installed
2. Discover project and schemes
3. Build for iOS Simulator
4. Install and launch app
5. Take screenshots of key screens
6. Capture console logs for errors
7. Pause for human verification (Sign in with Apple, push, IAP)
8. Create P1 todos for any failures
9. Fix and retry until all tests pass

**Standalone:** `/xcode-test [scheme]`

### Important: P1 Findings Block Merge

Any **🔴 P1 (CRITICAL)** findings must be addressed before merging the PR. Present these prominently and ensure they're resolved before accepting the PR.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.