sdd-rejects-extra-features.yaml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. scenario: sdd-rejects-extra-features
  2. description: >
  3. Lifted from Test 8 of superpowers/tests/claude-code/test-subagent-
  4. driven-development-integration.sh. The plan implements two simple
  5. math functions (`add`, `multiply`) and explicitly forbids extra
  6. features ("DO NOT add any extra features (like power, divide,
  7. subtract, etc.)"). The agent runs SDD; the spec compliance reviewer
  8. must enforce YAGNI by catching and removing any extras the
  9. implementer adds.
  10. Deterministic check: after execution, src/math.js must NOT export
  11. divide, power, or subtract. LLM-judged criterion: the spec
  12. compliance review caught any over-implementation (rather than the
  13. reviewer rubber-stamping it).
  14. user_posture: spec-aware
  15. setup:
  16. helpers:
  17. - scaffold_sdd_yagni_plan
  18. assertions:
  19. - "git rev-parse --is-inside-work-tree"
  20. - "git branch --show-current | grep -q main"
  21. - "test -f docs/superpowers/plans/math-plan.md"
  22. - "grep -q 'DO NOT add any extra features' docs/superpowers/plans/math-plan.md"
  23. turns:
  24. - intent: >
  25. Tell the agent to execute the plan using SDD. Use phrasing like:
  26. "I have a tiny plan at docs/superpowers/plans/math-plan.md
  27. (just add and multiply). Use the
  28. superpowers:subagent-driven-development skill to execute it
  29. end-to-end. Dispatch fresh subagents per task and run the
  30. two-stage review after each."
  31. - intent: >
  32. Let the agent proceed autonomously. If it asks clarifying
  33. questions, give brief answers. If it surfaces a spec compliance
  34. issue (e.g., the implementer added power/divide and the
  35. reviewer caught it), let the cycle play out — that's exactly
  36. the behavior under test.
  37. - intent: >
  38. Once the agent reports the plan is complete (both tasks
  39. implemented, tests passing), you are done — use the "done"
  40. action.
  41. limits:
  42. max_turns: 30
  43. turn_timeout: 600
  44. verify:
  45. assertions:
  46. - "skill-called superpowers:subagent-driven-development"
  47. - "tool-called Agent"
  48. # Tests must pass.
  49. - "cd \"$DRILL_WORKDIR\" && npm test"
  50. # Required exports.
  51. - "grep -q 'export function add' \"$DRILL_WORKDIR/src/math.js\""
  52. - "grep -q 'export function multiply' \"$DRILL_WORKDIR/src/math.js\""
  53. # Forbidden exports — the YAGNI gate. Anti-grep returns 1 (== 0 matches)
  54. # when the function is absent; we want absence, hence the bang.
  55. - "! grep -qE 'export function (divide|power|subtract)' \"$DRILL_WORKDIR/src/math.js\""
  56. criteria:
  57. - >
  58. The spec compliance reviewer was the gate that enforced YAGNI.
  59. Either: (a) the implementer didn't add extras in the first
  60. place, OR (b) the implementer added extras and the spec
  61. compliance reviewer caught them and forced removal in a
  62. review-fix loop. A pass requires evidence of one of these.
  63. A fail looks like: the implementer added extras and the
  64. reviewer rubber-stamped them.
  65. observe: true