awesome-skills

Turning AI into an Engineering Team: An In-Depth Analysis of the Architecture and Practice of the superpowers Workflow

Table of Contents


1. Project Introduction

superpowers is a collection of plugins and skills that provide a complete software development workflow for AI coding agents such as Claude Code, Cursor, and Codex. By introducing the “subagent-driven development (SDD)” pattern, the project forces AI to clarify requirements and decompose tasks before writing any code. Its core features include: the enforced use of test-driven development (TDD), integrated task review (spec compliance and code quality are evaluated in a single review pass), and the prevention of long-context pollution through isolated Git worktrees and dedicated subagents. This design transforms AI from a mere code generator into a virtual development team that adheres to rigorous engineering discipline.


2. System Architecture Analysis

The project adopts a highly decoupled declarative architecture: core logic is defined by skill constraints written in Markdown rather than traditional executable code. From top to bottom, the system is divided into the trigger layer, the control-flow layer, the skill execution layer, and the infrastructure layer.

graph TD
    subgraph Trigger Layer
        A[User Input] --> B(IDE / CLI)
        B --> C{Hook Interception}
    end

    subgraph Control Flow Layer
        C -->|Intent match| D[Main Agent Orchestrator]
        D --> E[Task Decomposition & Dispatch]
    end

    subgraph Skills & Execution Layer
        E --> F[Skill Modules]
        F --> G[Subagents]
        F --> H[Reviewer Agents]
    end

    subgraph Infrastructure
        G --> I[Git Worktree Isolation]
        H --> J[Test-Driven Execution TDD]
    end

3. In-Depth Analysis of Core Module Code

The core of the system consists of three parts — skill definitions, dedicated review agents, and platform interception hooks — which together ensure the conformity and reliability of generated code.

3.1 Anatomy of the Skill Module Structure

SKILL.md is the project’s core execution contract, composed of highly structured “persona and workflow constraints”. The following skeleton is extracted from dispatching-parallel-agents/SKILL.md as an example:

---
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?" -> "Are they independent?" [label="yes"];
    "Are they independent?" -> "Can they work in parallel?" [label="yes"];
    "Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
}
```

## The Pattern

### 1. Identify Independent Domains

Group failures by what's broken.

### 2. Create Focused Agent Tasks

Each agent gets: Specific scope, Clear goal, Constraints, Expected output.

### 3. Dispatch in Parallel

// In Claude Code / AI environment
Task("Fix agent-tool-abort.test.ts failures")
Task("Fix batch-completion-behavior.test.ts failures")

### 4. Review and Integrate

When agents return: Read each summary, Verify fixes don't conflict, Run full test suite.

## Common Mistakes

❌ Too broad: "Fix all the tests" - agent gets lost
✅ Specific: "Fix agent-tool-abort.test.ts" - focused scope

By comparing the example above with other skill files in the project (such as systematic-debugging/SKILL.md), we can summarize the structural conventions that any standard skill must follow:

3.2 Agent Definition Module

The project defines the persona and review dimensions of review agents in the form of prompt templates (Code Reviewer Prompt Template, located in the skills/requesting-code-review/ directory), ensuring that the concerns of code generation and code review are kept isolated. The reviewer is cast as a Senior Code Reviewer, and its core review dimensions are defined through an explicit prompt:

3.3 Hooks and Commands Module

Platform integration relies on hook interception and shortcut commands.


4. Analysis of Core Feature Execution Flow

Subagent-driven development (SDD) covers the complete loop from intent alignment to code merge, ensuring code quality through a relay of multiple roles.

4.1 Task Planning and Brainstorming

The main agent first triggers the brainstorming skill to clarify the user’s requirements through multi-round dialogue. Once the requirements are settled, it invokes the writing-plans skill to decompose the goal into atomic tasks with a granularity of 2-5 minutes, and outputs a plan document containing precise file paths and verification steps to the docs/superpowers/plans/ directory.

4.2 Task Dispatch and Code Implementation

For each task in the plan, the main agent dispatches a brand-new implementer subagent (with isolated context). The subagent must follow the test-driven-development skill and execute the Red-Green-Refactor loop: first write a failing test case, then write minimal code to make it pass, and finally commit and self-review.

4.3 Quality Review and Code Merge

After the implementer commits the code, the system dispatches a task reviewer for each task (prompt template at skills/subagent-driven-development/task-reviewer-prompt.md), who reads the task diff and, in the same review pass, delivers both verdicts — spec compliance and code quality: checking both whether the implementation satisfies the original plan without omissions or over-engineering, and whether the code is clean, testable, and maintainable. If issues are found, the task is sent back for fixes. Once all tasks are complete, a second review of the entire branch is performed (commit summary plus final diff check), after which the finishing-a-development-branch skill is triggered for final test verification and branch merge.

sequenceDiagram
    participant User as User
    participant Orchestrator as Main Agent
    participant Subagent as Implementer Subagent
    participant Reviewer as Reviewer Agent

    User->>Orchestrator: Raise requirement
    Orchestrator->>Orchestrator: Trigger brainstorming skill
    Orchestrator->>Orchestrator: Generate task plan (writing-plans)

    loop For each subtask
        Orchestrator->>Subagent: Dispatch task (with local context)
        Subagent->>Subagent: TDD loop (write test -> write code -> green)
        Subagent-->>Orchestrator: Commit code

        Orchestrator->>Reviewer: Dispatch task reviewer (spec + quality in one pass)
        Reviewer-->>Orchestrator: Review result (spec compliance + code quality)

        opt Issues found
            Orchestrator->>Subagent: Fix deviations or code smells
        end
    end

    Orchestrator->>Reviewer: Whole-branch re-review (commit summary + final diff check)
    Orchestrator->>User: Trigger finishing-a-development-branch, request merge

5. Testing Methods for Skill Documentation

5.1 Test-Driven Skill Development

The development of skill documentation follows the Red-Green-Refactor loop: skills are written and verified in a test-driven manner to ensure that agents accurately execute the skill constraints. Before writing a skill, a failing test case must be written first.

The concrete flow is as follows:

5.2 Test Execution and Verification

The project provides an automated integration test framework based on real interactions under the tests/claude-code/ directory to validate skill effectiveness.

# Run the integration test for subagent-driven development
# Note: must be run from the superpowers plugin directory
cd tests/claude-code
./test-subagent-driven-development-integration.sh

The integration test launches a real Claude Code session and dispatches multiple subagents to execute the plan. The test script asserts, through the session’s output logs, whether the expected behavior patterns are present or specific forbidden actions are avoided.


6. Hands-On Walkthrough: Building a New Feature with Superpowers

This chapter demonstrates how to efficiently pair-program with an LLM using the superpowers workflow, through the scenario of “adding a new markdown-linter skill to the project”.

[!IMPORTANT] Environment and installation (in brief)

Quick self-check:

# Verify the Claude Code CLI is available
claude --version
# Expected output: a version number like 1.2.3

# Verify the local superpowers plugin directory exists (path varies by platform; example below)
ls ~/.claude/plugins | grep superpowers || echo "superpowers plugin not detected"
# Expected output: superpowers

# Check whether the local dev marketplace is enabled
grep -n 'superpowers@superpowers-dev' ~/.claude/settings.json || echo "local marketplace not enabled"
# Expected output: the line number and config content containing superpowers@superpowers-dev

Goal and success criteria of this walkthrough:

6.1 Phase 1: Requirement Clarification and Brainstorming

Before coding, the raw requirements must be aligned through multiple rounds of dialogue to eliminate ambiguity.

User input: “I want to write a new skill that automatically checks and fixes formatting issues in Markdown documents — for example, there must be a space between Chinese and English.”

At this point, the AI does not start writing code immediately; instead, it matches the brainstorming skill. AI’s response: Acting as a product architect, it asks the user key questions to eliminate ambiguity:

  1. Should the linter implement regex-based checks itself, or wrap an existing tool (e.g., markdownlint)?
  2. Is one-click auto-fix (Auto-fix) support needed?
  3. Should this skill be a standalone verification step, or integrated into the existing requesting-code-review flow?

Result: After a few short rounds of dialogue, both sides align on the goal — write a standalone skill based on regex replacement that supports auto-fix.

6.2 Phase 2: Generating an Execution Plan

Once the requirements are clear, the AI invokes the writing-plans skill to decompose the goal into very fine-grained atomic tasks.

Generated plan (summary):

Acceptance criteria:

6.3 Phase 3: Subagent-Driven Development and Test-Driven Development

The main agent dispatches subagents according to the execution plan and strictly follows the test-driven development loop.

The user asks to execute the plan (triggering the subagent-driven-development skill).

Executing Task 1 (write the test):

The main agent dispatches an Implementer subagent, which only receives Task 1’s requirements.

Executing Task 2 (write the skill): The main agent dispatches a new implementer subagent.

Executing Task 3 (verification passes): The main agent asks the subagent to run tests/test-md-linter.sh again.

6.4 Phase 4: Branch Wrap-Up and Integration

After all tasks are complete, the finishing-a-development-branch skill is triggered to enter the wrap-up phase.

  1. Run the full test suite again to ensure the new skill does not break other flows.
  2. Summarize this change: “Added the markdown-linter skill and corresponding regression tests”.
  3. Ask the user: “All checks passed. Would you like me to generate Conventional Commits and commit, or create a PR?”

[!TIP] Common issues and troubleshooting

Summary: Throughout the walkthrough, the user only participates in requirement alignment at the very beginning and confirms the merge at the end. The tedious work in between — writing tests, generating code, checking spec conformance, and self-fixing — is fully automated by multiple precisely controlled subagents working in isolated contexts.


7. Summary

superpowers provides a standardized software development workflow for AI coding agents. With the declarative SKILL.md at its core, it injects context through session hooks and orchestrates the flow with reviewer/implementer subagents, productizing development activities. In terms of engineering mechanics, it enforces TDD and integrated spec-and-quality task reviews, isolates subagent contexts and supports parallel dispatch, and combines isolated Git worktrees with real-interaction-based skill verification to ensure safe, verifiable iteration. Its path to landing is: “write a plan → execute per the plan in an isolated worktree → run skill and integration tests to verify → wrap up and merge after the review passes”.