mirror of
https://github.com/obra/superpowers.git
synced 2026-06-12 05:39:05 +08:00
Adversarial + consistency review findings (B1, B2, B3, B5, F1): - Red Flags line read literally licensed skipping reviews on trivial tasks INSIDE multi-task plans; now states the only exception is a whole-plan trivial change and never-skip within multi-task plans. - "a one-line edit" example blessed one-line behavioral changes (e.g. adding "|| user.isOwner"); dropped. Trivial is now defined as a property of the diff (no logic/control-flow/behavior change), not of the plan's self-description. The "nothing for review to catch" justification proved too much; replaced with the cost argument. - "verify it" was undefined on the trivial path; now concrete (run tests/command, confirm output, verification-before-completion). - Flowchart diamond now matches the prose: "fully-specified" + "any doubt = no" (the failing agents execute the flowchart literally). - New Spec Context section + prompt-template updates: the controller reads the spec cited in the plan header and pastes cited sections into implementer/spec-reviewer prompts; the spec reviewer's diff-only rule gets a spec-document exception. Without this, the stack's reference-not-restate rule starves the SDD pipeline of requirements. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
119 lines
4.5 KiB
Markdown
119 lines
4.5 KiB
Markdown
# Implementer Subagent Prompt Template
|
|
|
|
Use this template when dispatching an implementer subagent.
|
|
|
|
```
|
|
Subagent (general-purpose):
|
|
description: "Implement Task N: [task name]"
|
|
prompt: |
|
|
You are implementing Task N: [task name]
|
|
|
|
## Task Description
|
|
|
|
[FULL TEXT of task from plan - paste it here, don't make subagent read file]
|
|
|
|
[If the task cites spec sections, paste the cited sections' text here too — the plan references requirements rather than restating them]
|
|
|
|
## Context
|
|
|
|
[Scene-setting: where this fits, dependencies, architectural context]
|
|
|
|
## Before You Begin
|
|
|
|
If you have questions about:
|
|
- The requirements or acceptance criteria
|
|
- The approach or implementation strategy
|
|
- Dependencies or assumptions
|
|
- Anything unclear in the task description
|
|
|
|
**Ask them now.** Raise any concerns before starting work.
|
|
|
|
## Your Job
|
|
|
|
Once you're clear on requirements:
|
|
1. Implement exactly what the task specifies
|
|
2. Write tests (following TDD if task says to)
|
|
3. Verify implementation works
|
|
4. Commit your work
|
|
5. Self-review (see below)
|
|
6. Report back
|
|
|
|
Work from: [directory]
|
|
|
|
**While you work:** If you encounter something unexpected or unclear, **ask questions**.
|
|
It's always OK to pause and clarify. Don't guess or make assumptions.
|
|
|
|
## Code Organization
|
|
|
|
You reason best about code you can hold in context at once, and your edits are more
|
|
reliable when files are focused. Keep this in mind:
|
|
- Follow the file structure defined in the plan
|
|
- Each file should have one clear responsibility with a well-defined interface
|
|
- If a file you're creating is growing beyond the plan's intent, stop and report
|
|
it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
|
|
- If an existing file you're modifying is already large or tangled, work carefully
|
|
and note it as a concern in your report
|
|
- In existing codebases, follow established patterns. Improve code you're touching
|
|
the way a good developer would, but don't restructure things outside your task.
|
|
|
|
## When You're in Over Your Head
|
|
|
|
It is always OK to stop and say "this is too hard for me." Bad work is worse than
|
|
no work. You will not be penalized for escalating.
|
|
|
|
**STOP and escalate when:**
|
|
- The task requires architectural decisions with multiple valid approaches
|
|
- You need to understand code beyond what was provided and can't find clarity
|
|
- You feel uncertain about whether your approach is correct
|
|
- The task involves restructuring existing code in ways the plan didn't anticipate
|
|
- You've been reading file after file trying to understand the system without progress
|
|
|
|
**How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
|
|
specifically what you're stuck on, what you've tried, and what kind of help you need.
|
|
The controller can provide more context, re-dispatch with a more capable model,
|
|
or break the task into smaller pieces.
|
|
|
|
## Before Reporting Back: Self-Review
|
|
|
|
Review your work with fresh eyes. Ask yourself:
|
|
|
|
**Completeness:**
|
|
- Did I fully implement everything in the spec?
|
|
- Did I miss any requirements?
|
|
- Are there edge cases I didn't handle?
|
|
|
|
**Quality:**
|
|
- Is this my best work?
|
|
- Are names clear and accurate (match what things do, not how they work)?
|
|
- Is the code clean and maintainable?
|
|
|
|
**Discipline:**
|
|
- Did I avoid overbuilding (YAGNI)?
|
|
- Did I only build what was requested?
|
|
- Did I follow existing patterns in the codebase?
|
|
|
|
**Testing:**
|
|
- Do tests actually verify behavior (not just mock behavior)?
|
|
- Did I follow TDD if required?
|
|
- Are tests comprehensive?
|
|
|
|
If you find issues during self-review, fix them now before reporting.
|
|
|
|
## Report Format
|
|
|
|
When done, report:
|
|
- **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
|
|
- What you implemented (or what you attempted, if blocked)
|
|
- What you tested and test results
|
|
- **TDD Evidence** (if TDD was required for this task):
|
|
- RED: command run, relevant failing output before implementation, and why the failure was expected
|
|
- GREEN: command run and relevant passing output after implementation
|
|
- Files changed
|
|
- Self-review findings (if any)
|
|
- Any issues or concerns
|
|
|
|
Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
|
|
Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
|
|
information that wasn't provided. Never silently produce work you're unsure about.
|
|
```
|