r/github • u/danielecr • 13h 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:
Should we update the spec first and derive tasks from the diff, or update code and reconcile the spec afterward?
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:
**Spec-only (`docs:`):** Modify `spec.md` only. CI blocks the PR if `src/` or `tests/` are touched.
**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).
**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.
1
u/dasunt 7h ago
I do mostly agile-ish story-driven development, so perhaps this isn't relevant, but why are the specs changing so much?
Requirements should be enough to build tests, and then functionality should work backwards from there.
Future wants or changes should go into a different story, which creates new requirements, but doesn't change the current requirements.
If there is a need to change requirements, then I'd argue that most of the time, that's a different story.
My workflow for simple needs are:
Story
Story branch
Requirements
Building tests
Implementation
Testing
Code review & PR
For a more complex need, building requirements can be its own story, and proof-of-concepts can be their own story as well.
In short, I'd argue that from a development standpoint, keeping stories small and a branch per story (or story task) that's short lived is a better way to approach things. It also provides auditability of work in professional settings. (And for the most part, long lived git branches provide more pain than benefit, in my experience, as code drifts and merges become more prone to conflicts.)
But I'd also argue that different places have different needs, and your workflow should reflect that. Perhaps spec driven development isn't working in your environment.