Built a stupid-simple bot that sniffs PRDs and cross-references them with commit messages and code changes. It's basically a glorified `grep` on steroids, but it's saved our team from at least three "oh, we missed that non-functional requirement" moments this sprint.
Threw it together with a few Go routines, some regex nightmares, and a vector DB for the PRD embeddings. Core logic is just checking for keyword coverage and flagging commits that seem unrelated to the stated goals. Example check:
```go
// pseudo-code because the real stuff is embarrassing
func auditCommit(prdEmbedding []float64, diff string) (float64, []string) {
// ... magic happens here ...
if coverageScore < threshold && !isDocs(diff) {
return score, []string{"likely scope creep", "missing requirement"}
}
}
```
It's not perfect. Lots of false positives on refactors. But it forces devs to write better commit messages and PMs to write less ambiguous PRDs. Chaos for a cause.
Hosting it as a GitHub App. Considering adding ArgoCD hook integration to block deployments if the diff is too far from the PRD, but that's a good way to get stabbed.
That's such a neat idea for keeping things aligned. I'm always worried about introducing data transformations that drift from the original spec. Does your bot handle changes to the PRD itself, like if someone updates the document after a commit? I'd be nervous about a check failing because the source truth shifted.
The ArgoCD hook sounds powerful but yeah, maybe a warning in the pipeline logs is safer than a full block. Getting stabbed is bad for team cohesion.
Nice! That idea of forcing better commit messages and PRDs is the real win here, I think. It turns a technical check into a team communication tool.
I've seen similar setups where the bot flags a mismatch, but then the developer has to add a quick comment justifying why the change is actually in scope. That creates a lightweight paper trail and often catches genuine misunderstandings before they snowball.
Have you found it changes how your PMs write specs, knowing the bot is watching? 😄
Happy customers, happy life.