r/github • • 5h ago

Discussion Experimenting with a 3-phase GitHub Actions loop for Spec-Driven AI coding (looking for feedback / testers)

Over the past month, I've been trying to move away from "vibe coding" with AI agents (Copilot, etc.) toward something more deterministic on real repositories.

Spec-Driven Development (`spec.md` as source of truth) helps, but once requirements start changing, two practical questions keep coming up:

  1. Should we update the spec first and derive tasks from the diff, or update code and reconcile the spec afterward?

  2. When a spec changes, is jumping straight to an atomic task list enough, or do we need an explicit intermediate "change plan" before touching `BACKLOG.md`?

Right now, I'm testing a setup built entirely on standard GitHub Actions (`workflow_call`), Conventional Commits, and `git-cliff` that enforces three strict phases with human approval gates in between:

  1. **Spec-only (`docs:`):** Modify `spec.md` only. CI blocks the PR if `src/` or `tests/` are touched.

  2. **Plan-atomic:** Run a gap analysis between `spec.md` and the current codebase to generate 3–5 dependency-ordered micro-tasks in `BACKLOG.md` (with SemVer prefixes enforced so intermediate `src/` steps use `refactor:` instead of premature `feat:` bumps).

  3. **Implement-atomic (loop):** Emit one scoped, unassigned `coding` issue at a time from `BACKLOG.md`, assign it to the coding agent, validate scope/title on the PR, and automatically bump SemVer + update `CHANGELOG.md` + create a GitHub Release on merge to `main`.

It's still an early experiment (~1 month of dogfooding on my own repos), not a silver bullet—especially around handling mid-flight spec changes cleanly.

If anyone else is building guardrails around AI coding agents in GitHub Actions, I'd love to compare notes—or if you want to try this setup on a test repo and tell me where it breaks, drop a comment or DM me and I can enable it for a few repos.

0 Upvotes

2 comments sorted by

3

u/PM_ME_A_STEAM_GIFT 4h ago

Well that just sounds like vibe coding with extra steps.

0

u/OptimusCrimee 4h ago

Specs should be kept for historical reasons. We add a supliment at the end of the file, like “Superseeded [date]: Changed this and that”. In the same PR that you make this change, you also create the related tasks.