Mandatory workflows for AI Agents. Not suggestions, not "when appropriate" — mandatory.
Inspired by Superpowers (161K stars) which proved that enforced workflows transform chaotic AI outputs into reliable engineering.
| Superpowers Principle | Xiaobai Implementation |
|---|---|
| ---------------------- | ------------------------ |
| Test-Driven Development | EVR + TDD skill |
| Systematic over ad-hoc | Workflow Checkpoint |
| Complexity reduction | Simplicity Check |
| Evidence over claims | Verification Gate |
Trigger: Before any multi-step task or code creation
Mandatory Steps:
❌ Wrong:
User: Build me a scraper
Agent: [Writes code]
✅ Right:
User: Build me a scraper
Agent: Before I code, let me understand:
1. What site are we scraping?
2. What data do you need?
3. How often should it run?
4. Any rate limits to consider?
[After answers, presents design]
Does this design match what you need?
Trigger: After design approval, before implementation
Mandatory Steps:
Plan Format:
## Task 1: Create scraper module (3 min)
- File: src/scraper.py
- Code: [exact code or pseudocode]
- Verify: `python -c "import scraper"`
## Task 2: Add rate limiting (2 min)
- File: src/scraper.py
- Code: [exact changes]
- Verify: Run with test request, check delay
...
Trigger: Before implementing any function
Mandatory Steps:
❌ Wrong:
[Writes function]
[Tests it manually]
"It works"
✅ Right:
1. Write test_function()
2. Run: pytest test_module.py
3. See: FAILED (expected)
4. Write function()
5. Run: pytest test_module.py
6. See: PASSED
7. Commit
Trigger: During task execution
Mandatory Steps:
Checkpoint Update:
- Task 1: DONE (verified: scraper.py imports successfully)
- Task 2: IN_PROGRESS
- Tasks 3-5: PENDING
Trigger: Before claiming "done" or "complete"
Mandatory Steps:
❌ Wrong:
"Scraper is done!"
✅ Right:
"Scraper implementation complete.
Verification:
- Module imports: ✅
- Test suite passes: ✅ (5/5)
- Sample scrape works: ✅
Evidence:
[Output from test run]
Would you like me to proceed with deployment?"
1. Is this a multi-step task?
→ Yes → Trigger Workflow 1 (Design Gate)
2. Is there a plan?
→ No → Trigger Workflow 2 (Planning)
3. Does this involve code?
→ Yes → Trigger Workflow 3 (Test-First)
4. Is task in progress?
→ Yes → Trigger Workflow 4 (Execution Gate)
5. About to say "done"?
→ Yes → Trigger Workflow 5 (Verification Gate)
| Condition | Action |
|---|---|
| ----------- | -------- |
| No design doc | Don't code, ask questions first |
| No plan | Don't execute, create plan first |
| No test | Don't write function, write test first |
| Test failing | Don't continue, fix the code |
| No verification | Don't say "done", verify first |
| Anti-Pattern | Why It's Bad | Workflow Fix |
|---|---|---|
| -------------- | -------------- | -------------- |
| Jumping to code | Solves wrong problem | Design Gate |
| No plan | Chaotic execution | Planning Gate |
| Write-then-test | Tests that pass trivially | Test-First Gate |
| Skipping verification | Silent failures | Verification Gate |
| Claiming done prematurely | User finds out later | Execution Gate |
Before Coding: DESIGN → APPROVE → PLAN → APPROVE
While Coding: TEST(RED) → CODE → TEST(GREEN) → REFACTOR
After Coding: VERIFY → EVIDENCE → REPORT
Always: CHECKPOINT after each step
MIT
共 1 个版本