SpecGraph
All posts
gitlab7 October 20264 min read

Your spec, in your GitLab

Push spec.md and the BMAD pack to gitlab.com or your own self-hosted GitLab. One commit per push, only the files that changed, and a diff before anything moves.

ST

SpecGraph team

A spec that only lives in a planning tool is a spec engineers have to go looking for. The code lives in the repository. Reviews happen there. Agents run there. If the contract isn't next to the code, it slowly stops being the contract.

So SpecGraph can now push a project's spec and its BMAD pack straight into a GitLab repository.

What lands in the repo

You link a project to a repository and a branch, and choose where things go. By default:

  • docs/spec.md: the full specification, rendered from the project.
  • bmad/CLAUDE.md: the agent's working rules.
  • bmad/planning-artifacts/: the product brief, PRD, architecture, UX design, epics, QA test plan and project context.
  • bmad/implementation-artifacts/: sprint-status.yaml and one file per story.

Both paths are configurable, and you can switch the pack off and push only the spec. The files come from the same generators the app and the MCP server use, so what's in the repo is what the agent would read.

gitlab.com or your own instance

Many of the teams who care most about where their spec lives run their own GitLab. That works. The integration talks to the standard GitLab REST API at whatever address your admin enters, so a self-hosted Community or Enterprise Edition instance is treated the same as gitlab.com. Custom ports and subpath installs work too.

Calls to your instance come from a relay with one fixed IP address, shown in settings, so your firewall team has a single address to allowlist. If your instance uses a self-signed certificate, an admin can accept it for that one connection. Access uses a GitLab token with the api scope, ideally a project access token limited to one repository. Tokens are encrypted at rest and never shown back in the browser.

One commit, only what changed

Every push is a single commit containing only the files that actually changed. Before you push, the dialog lists them as added, modified or deleted. You type an optional message and push. If nothing changed, nothing is committed.

That sounds obvious, but generated files make it tricky. The pack stamps dates into its headers, so a naive approach would rewrite every file every day. We ignore date-only lines when comparing, so your history shows real changes, not calendar noise.

Stories that were removed from the spec are deleted from the repo, but only if nobody edited them there. And if a file was changed in GitLab since the last push, it shows as a conflict and is only overwritten when you confirm.

A commit should tell a reviewer what changed in the spec. It shouldn't make them scroll past forty files that only changed their date.

Diff and surgical pull

People will edit spec.mdin the repository. An engineer fixes an endpoint path; a tech lead tightens an acceptance criterion in a merge request. That's fine. Check GitLabcompares what's there with what SpecGraph last pushed and shows the difference, file by file.

For spec.md, you can then pull. SpecGraph parses the file back into spec fields and lists each edit as a separate change: a changed field, an added feature, an edited endpoint. You pick the ones to keep. Only the fields that were edited are written, and everything else stays as it was. Locked phases stay locked until someone unlocks them, and pulled changes show up as uncommitted edits, so you can still discard them.

The pack itself is never pulled. It is generated from the spec, so the spec is where edits belong. After a pull, push once more and the regenerated pack files follow, so the repository and SpecGraph agree again.

What you can do this week

  • Decide which branch your spec should live on. If main is protected, a dedicated branch such as specgraph/spec keeps pushes out of the way of releases.
  • Create the narrowest token that works: one repository, Developer role, and an expiry date you put in a calendar.
  • For a self-hosted instance, do one test push to a scratch repository before pointing it at the real one.

The spec belongs where the code is. Put it there, and keep the history honest.

  • gitlab
  • integrations
  • bmad
  • self-hosted

Stop vibe-coding solo.Ship with the whole org aligned.

Coding agents are fast, and they are obedient: they build exactly what the spec says. SpecGraph makes the spec worth obeying. Every department on the record, conflicts settled before code, one sealed pack your agent works from.

Request access

0%