spec_review_planted_flaws.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. """Setup helper for the spec-reviewer-catches-planted-flaws drill scenario.
  2. Writes a deliberately incomplete spec to docs/superpowers/specs/. The
  3. spec contains the kinds of flaws the brainstorming skill's spec
  4. document reviewer is meant to catch:
  5. * a literal "TODO" placeholder in the Requirements section
  6. * a "specified later" deferral in the Architecture section
  7. * a Testing Strategy section that is vague, non-actionable filler
  8. Layered on top of the base repo (which provides a working tree + git
  9. history). Files are committed so the agent sees a clean checkout.
  10. """
  11. from __future__ import annotations
  12. from pathlib import Path
  13. from setup_helpers.base import _git
  14. SPEC_BODY = """\
  15. # Test Feature Design
  16. ## Overview
  17. This is a test feature that does something useful for the team.
  18. ## Requirements
  19. 1. The feature should work correctly
  20. 2. It should be fast
  21. 3. TODO: Add more requirements here
  22. ## Architecture
  23. The feature will use a simple architecture with:
  24. - A frontend component
  25. - A backend service
  26. - Error handling will be specified later once we understand the failure modes better
  27. ## Data Flow
  28. Data flows from the frontend to the backend.
  29. ## Testing Strategy
  30. Tests will be written to cover the main functionality.
  31. """
  32. def add_flawed_spec_for_review(workdir: Path) -> None:
  33. workdir = Path(workdir)
  34. specs_dir = workdir / "docs" / "superpowers" / "specs"
  35. specs_dir.mkdir(parents=True, exist_ok=True)
  36. (specs_dir / "test-feature-design.md").write_text(SPEC_BODY)
  37. _git(["git", "add", "docs"], cwd=workdir)
  38. _git(["git", "commit", "-m", "draft test-feature spec for review"], cwd=workdir)