sdd_real_projects.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. """Setup helpers for the sdd-go-fractals and sdd-svelte-todo drill scenarios.
  2. Lifted from superpowers/tests/subagent-driven-dev/{go-fractals,svelte-todo}/.
  3. The bash test family scaffolded a tiny project with only design.md +
  4. plan.md and no automated assertions — drill picks up the same fixtures
  5. and adds real assertions (skill fired, subagents dispatched, the test
  6. suite the plan asks for actually passes after execution).
  7. Both helpers initialize a fresh git repo, drop the design.md and plan.md
  8. fixtures from drill/fixtures/sdd-*, and commit. They do *not* layer on
  9. top of create_base_repo — the SDD plans expect a clean slate so the
  10. agent provisions everything itself per the plan.
  11. """
  12. from __future__ import annotations
  13. import shutil
  14. from pathlib import Path
  15. from setup_helpers.base import _git
  16. FIXTURES_DIR = Path(__file__).parent.parent / "fixtures"
  17. def _scaffold_from_fixture(workdir: Path, fixture_name: str) -> None:
  18. workdir = Path(workdir)
  19. workdir.mkdir(parents=True, exist_ok=True)
  20. _git(["git", "init", "-b", "main"], cwd=workdir)
  21. _git(["git", "config", "user.email", "drill@test.local"], cwd=workdir)
  22. _git(["git", "config", "user.name", "Drill Test"], cwd=workdir)
  23. src = FIXTURES_DIR / fixture_name
  24. for name in ("design.md", "plan.md"):
  25. shutil.copy2(src / name, workdir / name)
  26. _git(["git", "add", "-A"], cwd=workdir)
  27. _git(["git", "commit", "-m", "initial: design + plan"], cwd=workdir)
  28. def scaffold_sdd_go_fractals(workdir: Path) -> None:
  29. _scaffold_from_fixture(Path(workdir), "sdd-go-fractals")
  30. def scaffold_sdd_svelte_todo(workdir: Path) -> None:
  31. _scaffold_from_fixture(Path(workdir), "sdd-svelte-todo")