Skip to content

Superpowers

Superpowers là methodology và skill library giúp AI coding agents hành xử giống software engineer có discipline hơn. Nó nhấn mạnh brainstorming, design approval, detailed planning, test-driven development, subagent execution, code review, worktrees và branch finishing.

Nếu Spec Kit là spec compiler, AWS AI-DLC là governance cockpit, GSD là delivery factory, thì Superpowers là engineering discipline layer.

mermaid
flowchart TB
    A[Brainstorm] --> B[Design]
    B --> C[Plan]
    C --> D[Worktree]
    D --> E[TDD red-green-refactor]
    E --> F[Code review]
    F --> G[Finish branch]

Mental model

Superpowers không cố sở hữu toàn bộ project lifecycle. Nó cung cấp situational skills:

Tình huốngSkill mindset
Request mơ hồBrainstorm trước khi chốt solution
Change không tầm thườngTạo và approve design
Implementation phức tạpViết detailed plan
Behavior thay đổiDùng test-driven development
Có thể parallelizeDùng subagent-driven development
Code xongRequest code review
Branch work xongFinish development branch sạch

Workflow

mermaid
flowchart TB
    U[User request] --> B{Clear enough?}
    B -->|No| BR[Brainstorming]
    B -->|Yes| D[Design]
    BR --> D
    D --> A{Human approves design?}
    A -->|No| BR
    A -->|Yes| P[Detailed plan]
    P --> T[TDD implementation]
    T --> R[Code review]
    R --> F{Issues found?}
    F -->|Yes| T
    F -->|No| S[Finish branch]

TDD là điểm mạnh cốt lõi

Superpowers nhấn mạnh red-green-refactor:

mermaid
flowchart LR
    R[RED: write failing test] --> C{Fails for the right reason?}
    C -->|No| R
    C -->|Yes| G[GREEN: minimal code]
    G --> P{All tests pass?}
    P -->|No| G
    P -->|Yes| Ref[REFACTOR]
    Ref --> P

Điều này quan trọng vì AI agent thường tự tin bằng lời nói. TDD chuyển confidence từ lời nói sang executable proof.

Điểm mạnh

  1. Chống code trước nghĩ sau. Agent bị đẩy qua brainstorm, design và plan trước khi sửa nhiều file.
  2. TDD giảm hallucinated correctness. Behavior được chứng minh bằng failing/passing tests.
  3. Review rõ ràng. Bước review riêng giúp bắt lỗi implementer bỏ sót.
  4. Composable. Có thể dùng một skill cho bug nhỏ hoặc nhiều skill cho change lớn.
  5. Tool-agnostic về tinh thần. Method có thể áp dụng qua nhiều coding agents.

Điểm yếu

Điểm yếuHệ quả thực tế
Không phải spec management system đầy đủDùng Spec Kit nếu cần SDD artifacts chuẩn hóa
Không phải governance frameworkDùng AWS AI-DLC nếu cần audit, NFR, approval matrix
TDD có chi phí ban đầuTeam chưa quen TDD có thể thấy chậm
Phụ thuộc agent dùng đúng skillCần rules hoặc user nhắc khi agent lệch
Không phải project memory system sâuGSD mạnh hơn cho long-running multi-phase memory

Use case tốt nhất

Use caseVì sao Superpowers hợp
Bug fix cần regression testsTDD là workflow tự nhiên
Feature trong codebase hiện hữuDesign, plan, test, review mà không quá ceremony
RefactorTests và review giảm regression risk
Team muốn nâng chất lượng AISkills tác động trực tiếp đến hành vi agent
Agent hay đoánBrainstorming và design approval ép clarification

Ví dụ: forgot password

Với Superpowers:

BướcOutput
BrainstormLàm rõ UX, security, token, email và abuse cases
DesignAPI, model, flow và edge cases
PlanFiles, tests và implementation order
TDDFailing tests cho expiration, invalid token, rate limit, no enumeration
ImplementCode tối thiểu để pass tests
ReviewSecurity và quality review
FinishBranch summary và verification

Lợi ích cốt lõi là disciplined execution, không phải lifecycle governance.

Hướng dẫn triển khai cấp chuyên gia

Dùng Superpowers khi bạn muốn đổi thói quen làm việc của agent: hỏi trước khi code, design trước khi đổi architecture, test trước implementation, review trước khi tuyên bố done.

Bước 1: Chỉ cài vào agent bạn thật sự dùng

Superpowers hỗ trợ nhiều agent harness và plugin systems. Cài ở nơi team làm việc hằng ngày, không cài mọi nơi cùng lúc.

Kiểu môi trườngHướng dẫn thực tế
Plugin marketplace kiểu ClaudeCài Superpowers plugin và verify skills được list
Agent kiểu CursorThêm plugin/rules và test bằng một design task nhỏ
CLI agentTheo install path của agent rồi yêu cầu list available skills
Mixed teamChuẩn hóa một primary harness trước khi scale

Sau khi cài, chạy một task nhỏ và kiểm tra agent dùng đúng skill thay vì nhảy vào code.

Bước 2: Kích hoạt skill rõ ràng

Trong vài tuần đầu, đừng trông chờ agent tự suy luận hết. Prompt trực tiếp:

text
Use brainstorming first. Do not edit files until we approve the design.
text
Use test-driven development. Start by writing the failing test for the behavior.
text
Request a code review after implementation and fix all review findings before finalizing.

Cách này huấn luyện collaboration pattern cho cả human và agent.

Bước 3: Dùng full workflow cho non-trivial changes

mermaid
flowchart LR
    A[Brainstorm] --> B[Design approval]
    B --> C[Worktree]
    C --> D[Detailed plan]
    D --> E[TDD implementation]
    E --> F[Code review]
    F --> G[Finish branch]

Task nhỏ dùng subset. Task high-risk dùng full chain.

Bước 4: Áp dụng TDD đúng

TDD đúng:

  1. Mô tả behavior tiếp theo.
  2. Viết failing test.
  3. Xác nhận test fail đúng lý do.
  4. Viết minimal implementation.
  5. Chạy test.
  6. Refactor chỉ sau khi green.
  7. Lặp lại cho behavior tiếp theo.

TDD sai:

  • Viết implementation trước rồi test sau.
  • Test mirror implementation details.
  • Accept failing test mà không kiểm tra failure reason.
  • Bỏ refactor vì "AI code nhìn ổn".

Bước 5: Dùng worktrees để cô lập rủi ro

Dùng worktree khi:

  • Change có thể đụng nhiều file.
  • Muốn clean baseline.
  • Nhiều agents làm song song.
  • Muốn bỏ một experiment an toàn.

Trước implementation:

CheckLý do
Git status sạchTránh trộn unrelated work
Baseline tests passBiết failure nào là mới
Branch name phản ánh taskDễ review và cleanup
Setup commands documentedSubagents reproduce được environment

Bước 6: Treat review như một phase riêng

Review nên kiểm tra:

Review layerCâu hỏi
Spec complianceCó build đúng thứ đã đồng ý không?
Test qualityTests chứng minh behavior hay chỉ mirror implementation?
Code qualityChange có đơn giản và maintainable không?
ArchitectureBoundaries có còn nguyên không?
RiskAuth, data, migration hoặc operations risks có đổi không?

Pattern mạnh nhất là two-stage review: trước tiên compliance với plan/spec, sau đó code quality.

Playbook tối ưu

Cho bug fixes

Dùng loop ngắn nhưng chất lượng:

mermaid
flowchart LR
    A[Reproduce bug] --> B[Failing regression test]
    B --> C[Minimal fix]
    C --> D[Run tests]
    D --> E[Review diff]

Cho feature work

Dùng brainstorming, design, plan, TDD, review. Nếu feature lớn, kết hợp Spec Kit để quản artifact tốt hơn.

Cho refactoring

Bắt buộc:

  • Baseline tests pass trước refactor.
  • Characterization tests cho risky behavior.
  • Small commits hoặc reviewable diff chunks.
  • Không đổi behavior trừ khi được approve rõ.

Cho teams

Tạo team rule:

Mọi AI-generated behavior change phải bắt đầu bằng failing test hoặc có documented reason vì sao TDD không phù hợp.

Definition of done cho Superpowers

Task done khi:

  1. Design được clarify cho non-trivial work.
  2. Plan được approve hoặc change đủ nhỏ để bỏ formal planning.
  3. Tests được viết trước hoặc cùng implementation.
  4. Relevant tests pass.
  5. Code review được request.
  6. Review findings được fix hoặc reject có rationale.
  7. Branch/worktree sạch và sẵn sàng merge.

Built as a static bilingual AI engineering stack guide.