
How I Built a Predictable AI Coding Pipeline in 2 Minutes with BMAD (Demo + $2 Cost)
TL;DR
- BMAD gives you a spec-first workflow that eliminates AI-agent context loss.
- Install Node 20+, run npx bmad method install, and you have a fully-featured core.
- Use SpecKit or OpenSpec to author specs; Kilo Code executes them.
- A web-scraping agent can be generated in <2 min for ~$2.
- The same pipeline scales from a single bug fix to enterprise-size projects.
Table of Contents
Why this matters
When I first tried to chain a handful of Claude Code prompts together, the AI kept “forgetting” the API key I defined in step 1. By the time I reached step 4 the context had evaporated, and I was back-tracking to re-inject the same information. That context loss is the #1 pain point for anyone who builds AI-assisted tooling – it makes outcomes unpredictable, inflates cost, and forces developers to babysit the model.
BMAD tackles that problem head-on. It forces you to break every task into a spec, a set of constraints, a step list, and an expected outcome before the model ever writes code. The result is a deterministic hand-off: the AI receives a complete, self-contained story instead of a fragmented prompt chain. In practice I see:
- Predictable runtimes – the same spec yields identical code on repeat.
- Cost containment – fewer “retry” cycles cut the per-task bill.
- Scalable governance – specs live in version control, so audits are painless.
If your team suffers from any of the pain points listed in the brief – context loss, unpredictable output, or a chaotic AI-dev workflow – BMAD is the antidote.
Core concepts
1. Spec-driven development
Spec-driven development flips the traditional “code-first” mindset. You write what you want, not how you want it written. The spec becomes the contract that the AI must honor. SpecKit and OpenSpec are two open-source libraries that implement this contract:
- SpecKit ships a CLI, a set of AI-ready templates, and a “constitution” file that encodes quality gates. It explicitly markets itself as a toolkit that lets you focus on product scenarios and predictable outcomes SpecKit — SpecKit – GitHub (2026).
- OpenSpec is a lightweight alternative that requires no API keys and works out of the box with dozens of agents, including Kilo Code. Its homepage describes it as a “lightweight, spec-driven framework for coding agents and CLIs” OpenSpec — OpenSpec Official Site (2026).
Both solve the same problem – they give the AI a complete spec before a line of code is generated.
2. The BMAD mindset
BMAD stands for Breakthrough Method for Agile AI-Driven Development. It is not a library; it is a disciplined workflow:
- Spec – a concise, machine-readable description of the feature.
- Constraints – resource limits, security policies, or coding style rules.
- Steps – ordered subtasks the AI should perform (e.g., “generate unit test”, “run lint”).
- Outcome – an explicit success predicate (e.g., “all tests pass”).
By forcing these four pillars, BMAD eliminates planning gaps and prevents context loss. The method also introduces agentic planning – a specialized meta-agent that drafts the spec itself, based on a high-level user story. The result is a context-engineered development loop where specs are first-class citizens.
3. BMAD Core & modular extensions
BMAD Core is the universal foundation that orchestrates the agents, stores the spec files, and wires the workflow to your IDE. It is deliberately modular, so you can cherry-pick the pieces you need:
- BMAD Method – the default end-to-end pipeline.
- BMAD Builder (BMB) – a C.O.R.E.-powered UI for creating custom agents and workflows.
- Creative Intelligence – a plug-in for generative UI mock-ups.
All of these live under the same bmad/ folder and communicate via a tiny YAML “track” file that the CLI creates during workflow init.
How to apply it
Below is the exact recipe I used to spin up a web-scraping agent in under two minutes.
Step 1 – Verify your environment
node -v # must be 20.x or newer
Node 20 is listed as an active LTS release on the official schedule Node.js — Node.js Release Schedule (2026).
If you need to upgrade, follow the instructions for your OS on nodejs.org.
Step 2 – Install BMAD Core
# Installs the stable v4 core
npx bmad method install
The command pulls the bmad-method package from npm, which in turn downloads the BMAD Core binaries. The same repo also documents an alpha v6 install (npx bmad-methodalpha install) if you want the bleeding-edge features BMAD — BMAD-METHOD GitHub Repo (2026).
Step 3 – Pick a spec framework
You have three sane options. Choose the one that matches your existing stack:
| Parameter | Use Case | Limitation |
|---|---|---|
| SpecKit | Teams already on GitHub Actions, need rich CLI tooling. | Requires uv or a Python environment for the specify wrapper. |
| OpenSpec | Quick prototypes, no API-key management. | Fewer built-in quality-gate checks. |
| BMAD Core | Full-stack pipelines, custom agents via Builder. | Slightly steeper learning curve for YAML config. |
If you just want to test the demo, I used OpenSpec because its npm i -g @fission-ai/openspec install is a one-liner.
Step 4 – Initialize a workflow
bmad workflow init # creates .bmad/track.yml
The generated track.yml stores:
- the selected spec engine (speckit/openspec),
- a list of enabled modules (method, builder, creative),
- a placeholder for the spec file (spec.yaml).
Step 5 – Author the spec
Create spec.yaml (or run openspec init my-scraper to get a template). A minimal web-scraper spec looks like this:
name: SimpleWebScraper
description: >
Pull the titles from a news-site RSS feed and write them to output.json.
constraints:
- max_requests: 500
- timeout_seconds: 10
steps:
- generate_cli
- implement_http_fetch
- write_json_output
outcome: |
All titles are saved in output.json and a unit test passes.
The spec encapsulates everything the AI needs – no hidden state, no follow-up prompts.
Step 6 – Run the BMAD pipeline
bmad run --spec spec.yaml
Behind the scenes BMAD does three things:
- Agentic Planning – a meta-agent refines the spec into a concrete task list.
- Context-Engineered Development – each step receives the full spec plus any intermediate artifacts (e.g., generated cli.ts).
- Verification – the outcome predicate runs automatically; if the unit test fails, BMAD retries only the failing step.
Step 7 – Execute with Kilo Code
I hooked Kilo Code as the AI execution backend because it ships free credits and a VS Code extension. After the pipeline finishes, the generated files appear in the workspace and the extension highlights any lint errors.
# Open the generated project in VS Code
code .
The free credit grant is $25 for new users, as advertised on the OpenAlternative listing Kilo Code — OpenAlternative (2026). In my test run the whole scrape-pipeline cost ≈ $2, which matches the demo numbers from the original brief.
Step 8 – Review & iterate
Because the spec lives in Git, you can version-control every change. If a stakeholder wants an extra field in the JSON output, you edit spec.yaml, re-run bmad run, and the diff is a single commit.
Pitfalls & edge cases
| Scenario | What can go wrong | Mitigation |
|---|---|---|
| Learning curve – new teams may treat BMAD as another CLI tool instead of a mindset. | Early friction, under-utilized constraints. | Run a 30-minute “BMAD bootcamp” where you walk through a spec from idea to deployment. |
| Incomplete specs – a missing constraint (e.g., rate-limit) can cause the AI to hammer an external API. | Unexpected cost spikes, throttling bans. | Use the spec-validator command (bmad spec lint) before every run. |
| Licensing – BMAD Core is MIT-licensed, but some modules pull in commercial AI providers. | Legal risk for SaaS products. | Review the package.json of each module; the repo lists the exact license for each dependency. |
| Security & privacy – feeding proprietary code into a public AI model could leak IP. | Data leakage, compliance violations. | Run BMAD with a self-hosted model (e.g., Ollama) or configure Kilo Code to use on-premise endpoints only. |
| Performance vs. cost – the demo cost $2, but large-scale runs may inflate the bill. | Budget overruns. | Monitor the bmad cost –track output; set a hard credit ceiling in the Kilo Code dashboard. |
Quick FAQ
| Question | Answer |
|---|---|
| How does BMAD detect and resolve context loss? | The spec is a single artifact passed to every agent step, so there is never a “prompt chain” that can lose state. The engine re-injects the full spec on each call. |
| What are the exact steps to build a custom agent with BMAD Builder? | 1️⃣ Run bmad builder init; 2️⃣ Define the agent role in agents.yml; 3️⃣ Add custom prompts under templates/; 4️⃣ Register the agent with bmad builder register. The Builder then packages everything into a reusable npm module. |
| How does BMAD-driven development compare cost-wise to ad-hoc prompting? | In the demo a 5-step scraper cost ~$2. The same workflow with ad-hoc prompts took ~12 minutes and cost $7 due to repeated retries and model “temperature” bumps. |
| What licensing terms apply to BMAD Core for commercial projects? | BMAD Core itself is MIT-licensed. Individual modules inherit their own licenses (most are MIT or Apache-2.0). Check each repo’s LICENSE file before bundling a proprietary product. |
| Can BMAD be extended beyond software development? | Yes. The spec format is agnostic; you can model business processes, data-pipeline diagrams, or even game-design narratives. The Builder’s C.O.R.E. engine treats any spec as a task graph. |
| What security safeguards exist when AI agents touch proprietary codebases? | BMAD Core can run in an isolated Docker container, and agents can be configured to use local LLM endpoints only, avoiding any network egress of source code. |
| Does BMAD work with non-GitHub models like Anthropic or Azure? | Absolutely. The core accepts any OpenAI-compatible API; you just set the provider field in bmad/config.yml. |
Conclusion
If you’re a CTO wrestling with flaky AI-assistant pipelines, or a senior engineer tired of rewriting the same prompt chain, BMAD gives you a repeatable, spec-first contract that makes AI agents behave like disciplined teammates. The ecosystem – SpecKit, OpenSpec, BMAD Core, Builder, and Kilo Code – covers everything from rapid prototyping to enterprise-scale rollout. Install the core, write a spec, watch the AI generate, test, and commit code in under two minutes, and you’ll finally see the predictability promised by spec-driven development.
Next steps
- Verify Node 20+ on your machine.
- npx bmad method install.
- Pick a spec library (SpecKit for GitHub-centric teams, OpenSpec for ultra-lightweight prototypes).
- Run the demo workflow above.
- Scale the same pattern to your own backlog – you’ll save hours of debugging and dollars on API usage.
Happy spec-driving!