triggering_executing_plans.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. """Setup helper for the triggering-executing-plans scenario.
  2. Writes a stub plan file at the path the user prompt references so the
  3. agent has *something* to read when it tries to execute the plan. Used in
  4. combination with `create_base_repo` — this helper only writes the plan
  5. file and commits it, on top of the base repo.
  6. The plan content is intentionally minimal — the test is whether
  7. superpowers:executing-plans loads in response to the user's "execute
  8. this plan" intent, not whether the plan can actually be executed.
  9. """
  10. from __future__ import annotations
  11. from pathlib import Path
  12. from setup_helpers.base import _git
  13. PLAN_BODY = """\
  14. # 2024-01-15 Auth System Implementation Plan
  15. A short stub plan used by the triggering-executing-plans drill scenario.
  16. ## Task 1: Add a no-op auth placeholder
  17. **File:** `src/auth.js`
  18. Create a module that exports a single function `placeholder()` returning the
  19. string `"auth-placeholder"`. Add a one-line test in `test/auth.test.js`.
  20. ## Task 2: Wire the placeholder into the entry point
  21. **File:** `src/index.js`
  22. Import `placeholder` from `./auth.js` and log its return value at startup.
  23. The plan is intentionally trivial; the scenario only measures whether the
  24. executing-plans skill loads in response to the user's request.
  25. """
  26. def add_stub_executing_plan(workdir: Path) -> None:
  27. workdir = Path(workdir)
  28. plans_dir = workdir / "docs" / "superpowers" / "plans"
  29. plans_dir.mkdir(parents=True, exist_ok=True)
  30. (plans_dir / "2024-01-15-auth-system.md").write_text(PLAN_BODY)
  31. _git(["git", "add", "docs"], cwd=workdir)
  32. _git(["git", "commit", "-m", "add stub auth plan"], cwd=workdir)