Code Lab
Superpowers Explained: A Real Red-to-Green Test for an AI Coding Workflow
CODE LAB · PROJECT SPOTLIGHT
Superpowers Source walkthrough
Follow an agent development workflow through a real failing test and a minimal fix.
Preview: GitHub · obra/superpowers
An agent can write a plausible fix without demonstrating that it changes the failing behavior. Superpowers supplies a development workflow through composable skills, including brainstorming, planning, debugging, and test-driven development. We focused on a narrow question: what does it mean to watch a test fail for the right reason and then make it pass? A small retry function gives us a result that readers can reproduce.
Read the creator’s actual workflow guide

The guide asks the developer to observe a failing test before writing the minimal implementation. Its workflow includes checking the reason for the failure and keeping the test green during cleanup. Those are observable steps. A missing dependency or a syntax error can fail a test command before it ever exercises the behavior under investigation.
Inspect the repository’s test example
Source credit: obra/superpowers. MIT license and copyright notices.
The project’s example uses an operation that fails twice before returning successfully. It verifies the result and the number of attempts. The skill file is the source an agent reads for the workflow. The Python exercise below is our own small implementation of the same idea. We ran it manually, without launching a Superpowers agent session.
Write a test that exposes the missing retry
import unittest
from retry import retry
class RetryTest(unittest.TestCase):
def test_succeeds_on_third_attempt(self):
calls = []
def operation():
calls.append(1)
if len(calls) < 3:
raise ValueError("temporary")
return "ready"
self.assertEqual(retry(operation), "ready")
self.assertEqual(len(calls), 3)Save that as test_retry.py and begin with the following retry.py. The test’s input is a function whose first two calls raise a temporary error. The assertions require both a final value and exactly three calls. That second assertion prevents an implementation from doing extra work after it has already succeeded.
def retry(operation):
return operation()
# python -m unittest -v
# Observed
# ValueError: temporary
# FAILED (errors=1)
# Process exit code: 1The failure is useful because it occurs at the operation call. The implementation calls the operation once and immediately propagates its error. The test reaches the behavior we wanted to change. We then replaced the function with a bounded retry and ran the same test command again.
Make the smallest behavior change and check again
def retry(operation):
for attempt in range(3):
try:
return operation()
except ValueError:
if attempt == 2:
raise
# Observed after python -m unittest -v
# test_succeeds_on_third_attempt ... ok
# OK
# Process exit code: 0The implementation returns as soon as the operation succeeds and raises after the third failure. This example treats ValueError as the chosen temporary error type solely to keep the fixture small. In a real client, choose an exception that represents a retryable failure and consider whether repeating the operation is appropriate. Additional tests should cover immediate success, the final failure, and errors that should propagate immediately.
Use the skill as a repeatable review habit
Install Superpowers through the route documented for your agent host. For Claude Code, the README lists the official plugin marketplace command below. Ask the agent to show the initial failure, explain why it matches the bug, and then show the same command after its change. Keep the test and the patch together for review. A workflow can guide that process, while the observed command output provides the evidence.
/plugin install superpowers@claude-plugins-officialFor CI investigation, continue with OpenSRE. For reviewing a larger code change, read Open Code Review. For packaging a repeatable workflow into agent components, see Cursor Plugins.
