Skip to content

Blog

Spec-Driven Development with Convention Files

Banner image Banner image

Spec-Driven Development with Convention Files

A colleague spent forty minutes debugging a Terraform change that had been planned — and partially applied — in a chat thread the previous week. Nobody remembered the exact prompt, the reasoning had evaporated, and the agent's recommendation no longer matched the current state. The fix itself took five minutes. The archaeology took the rest.

That is the problem with AI-assisted work that lives in chat threads. The intent, the plan, the decisions, and the evidence all disappear the moment the conversation scrolls out of view.

Liatrio's Spec-Driven Development (SDD) workflow tackles this by keeping every stage of AI-assisted work in markdown artefacts that live in Git. Four prompts — specify, plan, implement, validate — turn a vague request into a reviewed spec, an audited task list, committed proof artefacts, and a final validation report. Everything is versioned, reviewable, and auditable.

If you already use convention files such as AGENTS.md, .prompt.md, .instructions.md, and .agent.md, the SDD prompts slot in naturally. This post explains how.


The spec step is where most AI-assisted work quietly fails

Vague requirements handed to an AI agent produce confident, well-formatted output that doesn't solve the actual problem. SDD-1's clarification-before-planning step forces the scope to be explicit before any code is written. If the spec takes 20 minutes to get right, the implementation takes hours less. That's the trade-off: front-load clarity, back-load execution.


What SDD does

SDD is four markdown prompts. No dependencies, no tooling, no installation required. You paste a prompt into your AI assistant — or install them as slash commands — and the AI follows a structured workflow.

Step Prompt What it produces
1 · Specify SDD-1-generate-spec.md Scope check, clarification questions, specification with demo criteria
2 · Plan SDD-2-generate-task-list-from-spec.md Parent tasks, subtasks, baseline commit, planning audit gate
3 · Implement SDD-3-manage-tasks.md Single-threaded execution, checkpoints, proof artefacts before each commit
4 · Validate SDD-4-validate-spec-implementation.md Coverage matrix, proof verification, PASS/FAIL gates

Every artefact lands in docs/specs/[NN]-spec-[feature-name]/, giving you a lightweight, file-based backlog that travels with the repo.

The highest-leverage work happens in steps 1 and 2. When the spec is clear and the plan is audited, the implementation and validation steps are far more likely to run without human rescue.


Where SDD fits in the convention file taxonomy

SDD mapped to convention files SDD mapped to convention files

Convention files already solve "how should agents behave in this repo?" SDD addresses a different question: "how should agents approach a specific piece of work from start to finish?"

The mapping is straightforward:

Convention file Role in SDD
AGENTS.md Sets the baseline — naming conventions, quality gates, workflow steps. SDD prompts inherit this context.
.instructions.md Path-scoped rules for language, framework, or infrastructure conventions. Applied automatically during the implement step.
.prompt.md The SDD prompts themselves. Install them as slash commands in .github/prompts/.
.agent.md Optional agent personas — a spec reviewer that only reads, an implementer with full tool access.
SKILL.md Reusable capabilities the implementation step can invoke — e.g. a skill for running database migrations or generating Helm charts.

AGENTS.md and .instructions.md are always loaded. They form the standing instructions. The SDD .prompt.md files are invoked on demand — one per step. Agent personas are optional but useful for teams that want separation between planning and execution.


Adapting SDD prompts for your repos

The raw SDD prompts from Liatrio work out of the box, but they work better when they reference your repo's conventions. Here is how to wire them together.

1. Install the prompts as slash commands

The simplest approach uses Liatrio's slash-command-manager:

uvx --from git+https://github.com/liatrio-labs/slash-command-manager \
  slash-man generate \
  --github-repo liatrio-labs/spec-driven-workflow \
  --github-branch main \
  --github-path prompts/

This installs /SDD-1-generate-spec, /SDD-2-generate-task-list-from-spec, /SDD-3-manage-tasks, and /SDD-4-validate-spec-implementation as native slash commands in your editor.

Alternatively, copy each prompt into .github/prompts/ and they become VS Code .prompt.md slash commands automatically:

.github/prompts/
├── SDD-1-generate-spec.prompt.md
├── SDD-2-generate-task-list-from-spec.prompt.md
├── SDD-3-manage-tasks.prompt.md
└── SDD-4-validate-spec-implementation.prompt.md

2. Wire AGENTS.md into the spec step

Your AGENTS.md already defines workflow steps, quality gates, and naming standards. Reference it from the spec prompt so that SDD-1 inherits your conventions:

# AGENTS.md


---

## Workflow
1. Plan → scope, success criteria, risks
2. Build → implement with tests
3. Document → update runbooks
4. Release → owner sign-off + monitoring


---

## Quality gates
- Every change has an owner
- Risks documented before build
- Docs updated before release


---

## Standards
- Naming: <team>-<service>-<env>
- Environments: dev → staging → prod


---

## Spec-driven development
- Use `/SDD-1-generate-spec` for any change that spans more than one file
- Specs live in `docs/specs/`
- No implementation starts without an audited task list (SDD-2 gate)

That last section is the key addition. It tells agents (and humans) when to use the SDD workflow and where artefacts go.

3. Add path-scoped rules for the implement step

.instructions.md files apply automatically when the agent touches files matching a glob. During SDD-3 (implement), these keep the agent aligned with your language and framework conventions without repeating them in the SDD prompts:

---
applyTo: "infra/**/*.tf"
---
# Terraform conventions
- Use modules from the internal registry
- Tag all resources with team and environment
- No inline IAM policies
---
applyTo: "k8s/**/*.yaml"
---
# Kubernetes conventions
- All manifests use kustomize overlays
- No hardcoded image tags — use digest references
- Resource limits required on all containers

4. Add agent personas (optional)

For teams that want to separate planning from execution, add agent personas:

---
# .github/agents/spec-reviewer.agent.md
description: Reviews specs for completeness, ambiguity, and missing demo criteria
tools: ['search']
---
Review the spec at the path provided. Check for:
- Clear scope boundaries (what is in scope, what is not)
- Testable demo criteria
- Identified risks and mitigations
- Consistency with the AGENTS.md workflow

Do not propose implementation. Flag gaps only.
---
# .github/agents/implementer.agent.md
description: Implements tasks from an SDD task list
tools: ['search', 'editFiles', 'terminalLastCommand']
---
Implement the next incomplete task from the task list.
Follow the AGENTS.md conventions and any .instructions.md
rules that apply to the files being changed.

Before committing, create proof artefacts in the proofs directory.

SDD and operational workflows

If you have used our AGENTS.md approach for operational automation — querying work trackers, populating sprint review decks, updating dashboards — you might wonder how SDD fits alongside it.

The short answer: they are complementary and cover different shapes of work.

SDD prompts AGENTS.md operational agents
Work shape Project-shaped: a feature, a migration, a new API endpoint Ticket-shaped: recurring BAU tasks, data population, report generation
Trigger Engineer invokes /SDD-1-generate-spec when starting a piece of work Agent definition runs when the Copilot agent is asked to execute it
Artefacts Specs, task lists, proof documents, validation reports Updated PlantUML diagrams, Marp slides, dashboard metrics
Data source The codebase itself + human intent External systems (Jira, GitHub Issues, Azure DevOps)
Quality gate Planning audit + validation coverage matrix Human confirmation before each query

For platform engineering teams, SDD covers the development side — golden paths, self-service tooling, migration scripts, new capabilities. Operational agents cover the BAU side — sprint review decks, request metrics, team dashboards.

Both patterns live in the same repo, coexisting without conflict:

.github/
├── prompts/
│   ├── SDD-1-generate-spec.prompt.md
│   ├── SDD-2-generate-task-list-from-spec.prompt.md
│   ├── SDD-3-manage-tasks.prompt.md
│   └── SDD-4-validate-spec-implementation.prompt.md
├── agents/
│   ├── spec-reviewer.agent.md
│   └── implementer.agent.md
├── instructions/
│   ├── terraform.instructions.md
│   └── kubernetes.instructions.md
└── copilot-instructions.md

AGENTS.md              ← workflow + naming + gates
agents.md              ← operational agent definitions (tracker queries, deck population)
docs/specs/            ← SDD artefacts

Apply this: add an SDD section to your AGENTS.md today

The smallest useful change is a single paragraph in your existing AGENTS.md: when to invoke SDD-1, where specs go, and the gate rule (no implementation without an audited task list). That alone changes agent behaviour for any change that spans more than one file — without requiring anyone to learn a new tool. The prompts do the rest.


What makes this approach work

Three things separate repos that use SDD effectively from repos where the prompts gather dust:

The spec step catches scope creep early. SDD-1 validates whether the work is too large, too small, or appropriately sized. Too large and it suggests splitting. Too small and it suggests implementing directly. This single check prevents the most common failure mode: a vague requirement that balloons during implementation.

The planning audit creates accountability. SDD-2 generates a task list and then audits it against the spec. If the tasks do not cover the demo criteria, or if they introduce scope the spec did not describe, the audit flags it. Implementation does not start until the audit passes and the engineer approves remediations.

Proof artefacts prevent "it works on my machine." SDD-3 requires proof artefacts — markdown files documenting what was done, what was tested, and what the results were — before each commit. These are not trophies. They are evidence that feeds the validation step and gives reviewers something concrete to check.


Context rot is real — the emoji markers exist for a reason

SDD's emoji markers (SDD1️⃣, SDD2️⃣, etc.) detect when the AI has lost the plot in a long conversation. When the marker disappears from responses, the agent has likely drifted from the prompt. This isn't a theoretical problem — long SDD-3 sessions (implement) are particularly vulnerable because they accumulate context fast. If the marker vanishes, start a fresh session with the current task list rather than trying to recover the thread.


Context rot and verification markers

SDD includes an unusual feature: emoji markers (SDD1️⃣, SDD2️⃣, SDD3️⃣, SDD4️⃣) at the start of AI responses. These detect context rot — the silent degradation of AI performance as input context grows longer.

Context rot does not announce itself with errors. The agent simply stops following instructions. When the marker appears, it suggests the agent is still tracking the prompt. When the marker disappears, you know to check whether the agent has lost the thread.

This is a lightweight, no-tooling approach to a real problem. If you have run long conversations with AI agents, you have experienced context rot — you just may not have had a name for it.


Practical patterns worth borrowing

Even if you do not adopt SDD wholesale, several patterns are worth extracting for your own convention files:

Clarification-before-planning. SDD-1 can generate a questions file with recommended answers and justification notes before writing the spec. Your AGENTS.md can adopt this: "For changes spanning more than three files, the agent must list open questions and recommended answers before proposing a plan."

Audit gates. SDD-2's planning audit is a quality gate that runs before implementation. Any AGENTS.md can include a similar rule: "No implementation starts until the plan has been reviewed against the acceptance criteria."

Proof-before-commit. SDD-3 requires proof artefacts before each commit. Even without the full SDD workflow, you can add to AGENTS.md: "For significant changes, create a proof file in docs/decisions/ before committing."

Single-threaded execution. SDD-3 enforces working on one task at a time. This reduces work-in-progress and avoids the tangled state that comes from partially completed parallel tasks.


Getting started

The quickest path:

  1. Read the SDD prompts — they are plain markdown, and the workflow logic is transparent
  2. Install them as slash commands or copy into .github/prompts/
  3. Add a "Spec-driven development" section to your AGENTS.md
  4. Try it on one feature and see whether the spec-then-plan-then-build cadence reduces rework

The prompts are Apache 2.0 licensed and work with any AI assistant. They are not a product — they are a workflow encoded in markdown. Adapt them, extend them, or simply borrow the patterns that fit.


Further reading


Frequently asked questions

Does SDD work with any AI assistant or only specific tools?

SDD prompts are plain markdown files — they work with any AI assistant that can read a prompt file: VS Code Copilot, Claude Code, Cursor, or even a browser-based chat session where you paste the prompt. The slash-command installer targets VS Code specifically. If you use a different editor, copy the four .prompt.md files into your .github/prompts/ directory — most editors with Copilot support pick them up automatically.

How does SDD handle a feature that turns out to be much larger than the spec suggested?

SDD-1 has an explicit scope check: if the work is too large, it suggests splitting into multiple specs. If you discover scope creep during SDD-3 (implement), the right move is to stop, create a new spec for the expanded scope, and add it to the backlog. Continuing to implement beyond the original spec boundary corrupts the task list audit trail and makes the validation step (SDD-4) meaningless.

Do I need to use all four SDD steps, or can I pick just the parts that help?

You can use individual steps. The spec step (SDD-1) alone — getting a written, reviewed scope before writing any code — is valuable even without the rest. The planning audit (SDD-2) is the second most valuable in isolation. Steps 3 and 4 build on the artefacts from 1 and 2, so they work best when the earlier steps have been completed. Most teams find they naturally adopt all four once they experience the reduction in rework.

How does SDD interact with an existing sprint planning process?

SDD operates at the implementation level, not the planning level. Sprint planning decides what to work on; SDD governs how that work proceeds once a developer picks it up. The spec artefact in docs/specs/ can serve as the implementation spec that links to the original ticket or story. Some teams create the SDD-1 spec during sprint planning as the definition of ready for a story — that's a natural integration point.

What's the right scope threshold for using SDD vs just writing code directly?

Liatrio's guidance: SDD-1 for anything that spans more than one file. That's a reasonable default. The clarification-before-planning step costs 10-20 minutes; if the change is genuinely one-file simple, you've lost nothing by doing it quickly. If the change turns out to be more complex than it looked, you've caught that before implementation started. Err toward using SDD-1 — the spec step is low-cost even when the work is simple.

AI in CI/CD: Safer Gates, Smarter Reviews

Banner image Banner image

AI in CI/CD: Safer Gates, Smarter Reviews

You know that moment when CI goes red, and before you've even clicked into the logs you already suspect it's that flaky database test again? Most CI failures fall into three buckets: flaky tests, dependency problems, and actual bugs. The problem is your CI output treats all three identically. Same red X, same block on merge, same engineer pulled out of flow to investigate something that was going to pass on retry anyway.

AI in CI isn't about replacing tests. It's about making the signal clearer. When CI fails, an engineer should know within 30 seconds whether this is worth their attention or whether it's a known transient failure. That's a classification problem. And AI is genuinely good at classification.

The same AI-first approach applies when failures get past the pipeline entirely — AI Incident Triage covers what to do after a bad deploy reaches production.

Repo‑Native AI Workflows: Keep AI Work in Git

Banner image Banner image

Repo‑Native AI Workflows: Keep AI Work in Git

We caught a configuration mistake because somebody ran the same AI query twice and got a different answer. The first run had recommended a change that was already applied. Neither the agent nor the engineer knew — because the first conversation had happened in a chat window three days earlier, and nobody had written it down.

That's the problem, right there. Not that the AI gave different answers. That's fine, models do that. The problem is that the first answer had nowhere to live. It wasn't in Git, it wasn't in a PR, it wasn't linked to the change it prompted. It existed in a chat thread that expired the moment the engineer closed the tab.

AI work in chat evaporates. The prompt, the reasoning, the decision, the output — all of it gone. The fix isn't to stop using AI. It's to stop treating AI work as a special category that doesn't need the same discipline as code work. Same thing: open an issue, work on a branch, open a PR, merge to main.

AI Incident Triage: Faster Summaries, Safer Actions

Banner image Banner image

AI Incident Triage: Faster Summaries, Safer Actions

It's 2:47am. The P0 alert just fired and you're squinting at your phone, still half-asleep, already dreading what comes next. You pull the logs. Then the dashboards — there are three of them, obviously. Then the last two deploy notifications. Then Slack, because maybe someone said something useful. By the time you've assembled a rough picture of what's actually happening, it's 3:05am.

Eighteen minutes gone. And honestly? You're not even sure you've found the right thing yet.

That's not on you — it's not a skills problem or an experience problem. Context gathering across multiple systems is just slow. Full stop. Even if you've been on-call for years and know the stack cold, you're still stitching together data points from half a dozen places under pressure at an ungodly hour.

AI doesn't fix incidents. But it absolutely can fix that first eighteen minutes.

SLO‑Driven Automation: Closing the Loop from Alerts to Fixes

Banner image Banner image

SLO‑Driven Automation: Closing the Loop from Alerts to Fixes

We had a 99.9% availability SLO for the API gateway. When it breached, we paged an engineer. And when the engineer showed up — bleary-eyed, possibly at 2am — the first three minutes were always identical. Check the error rate in Grafana. Check which pods were unhealthy. Restart the unhealthy pods. Every time. Same alert, same three steps, same outcome.

Think about what that actually means. A human being was pulled away from sleep to perform a task that had no variation. No judgement required. No creative problem-solving. Just: check, check, restart. The same three steps that a script could do in ten seconds.

That's the thing about mechanical work — it wears people down in a way that creative incidents don't. It's not just the lost sleep. It's the knowledge that you could have slept, because nothing you did tonight required you to be human.

SLO-driven automation is about drawing that line clearly: these remediations are always the same, so they happen without a person. Anything that isn't — anything that needs actual judgement — still pages a human. For the triage layer that runs before remediation kicks in — context gathering and structured summaries for on-call engineers — see AI Incident Triage.

MCP in the Real World: Security, Permissions, and Operations

Banner image Banner image

MCP is genuinely easy to demo. Spin up a server, wire it to Claude Desktop, watch it query your GitHub repo or list your Kubernetes pods. Five minutes, works perfectly, everyone's impressed.

Then five engineers are using the same MCP server. It's pointing at production. They have different levels of access and nobody's really thought about that yet. One tool call times out and the agent retries it three times against a slow Kubernetes API. A GitHub issue body contains text that looks a lot like an instruction, and it ends up in the model's context.

None of that is an edge case. That's just Tuesday for any team that's moved MCP out of their laptop and into shared infrastructure. This post is about what you actually need to build before that Tuesday arrives. If you're still getting your bearings with MCP fundamentals, start with Demystifying MCP first.

Platform Scorecards: Automated Monthly Health Snapshots

Banner image Banner image

Platform Scorecards: Automated Monthly Health Snapshots

Every month, the platform lead sent a status update that said "things are improving." And every month, nobody could tell if that was actually true.

No numbers. No trend. No comparison to last month. Just a paragraph of qualitative statements that everyone read politely and immediately forgot. And here's the thing — the platform team probably was doing good work. Lead time was down. MTTR had improved. The on-call burden had dropped significantly.

None of it was visible. And invisible good work doesn't build confidence, doesn't surface problems before they become incidents, and absolutely doesn't make the case for more investment. A monthly scorecard changes that — not because leadership suddenly starts caring about metrics, but because the conversation shifts from "how are things going?" to "why did MTTR spike in March?"

Policy as Code + Agents: Guardrails That Actually Hold

Banner image Banner image

Policy as Code + Agents: Guardrails That Actually Hold

Our platform agent opened a PR that would have exposed a database security group to 0.0.0.0/0. And here's the thing — it was doing exactly what we asked. The prompt said "make this service accessible from the VPN." The agent heard "open ingress from anywhere." Technically? Both solve the same problem. The agent wasn't wrong. It just didn't know why the constraint existed.

Without a policy gate, that change would have gone through. Nobody would have caught it until someone ran a security audit, or worse. With one, it didn't — the agent got the policy failure back as feedback and tried a more targeted fix instead.

That's what policy as code looks like in an agentic system. Not blocking humans from making mistakes — they've got code review for that — but catching what agents get wrong before a human ever sees the PR. For the change management tier model that determines which agent changes need policy checks in the first place, see Agentic Change Management.

Agentic Change Management: Safer Automation at Scale

Banner image Banner image

Agentic Change Management: Safer Automation at Scale

Week three. That's how long it took. We'd given our platform agent write access to the cluster, feeling pretty good about ourselves, and then a change landed in staging that nobody had reviewed. The agent had decided to scale down a deployment to save resources during low-traffic hours. Sensible logic. Terrible timing — a batch job was scheduled to run that night.

The deployment recovered quickly. But the moment it happened, something clicked: write access without a review gate isn't automation. It's a liability dressed up as automation.

So here's the pattern we settled on. Agents propose changes as PRs, humans decide whether to apply them, and rollback is always included before merge. Simple in principle. A bit more involved to actually build — which is what this post is about.

Argo CD 3.4: Your Teams Notifications Just Broke

Banner image Banner image

You know that moment when you set something up, it works perfectly, and you stop thinking about it? That's Teams notifications in Argo CD. You wired up the webhook, tested it, watched an alert land in the channel, and moved on to the next thing. Job done. Except it's not done anymore. As of 31 March 2026, Microsoft retired Office 365 Connectors — the underlying mechanism that Argo CD's Teams notifier was built on. No fanfare, no loud breakage. Your notification config still looks correct. The webhook URL is still there. Argo CD still thinks it's sending alerts. They're just not arriving.

Think about what that actually means in practice. Your sync failures are still happening. Your health degradations are still triggering. The alerts are being dispatched — they're just disappearing into the void before they ever reach your Teams channel. If your team's incident detection relies on those notifications, you've been operating with a silent gap since the end of March. Nobody panicked, because nothing obviously broke. That's the worst kind of failure.

Argo CD 3.4 ships a proper fix: a new Teams Workflows notification service that replaces the retired connector. It went GA on 4 May 2026. The migration takes about ten minutes. Let's walk through what happened, how to fix it, and what else is worth your attention in this release.