From Idea to Published Package in One Command

How I built a spec-driven development pipeline that brainstorms, plans, codes, tests, and ships -- with agent teams doing code review along the way.

---

Most developers I talk to use AI coding assistants the same way: one task at a time. Write a function. Review a file. Run some tests. Each step is manual. Each step loses context from the last one.

I kept doing the same thing. Brainstorm an idea in one session. Plan it in another. Write the code. Forget to simplify. Run tests late. Rush the release. Every time, the same sequence -- and every time, I'd skip something.

So I built a pipeline.


What /pipeline does

One command. Three phases. From idea to published package.

--- CODE START ---
/pipeline "add webhook support"
--- CODE END ---

Phase 1 walks you through a brainstorm -- Socratic style, one question at a time -- then produces a spec. Not a vague plan. An XML-enhanced spec with concrete task prompts that tell the system exactly what to build.

Phase 2 executes that spec. But here's what makes it different from just "running the tasks": every task goes through a quality gate. After Claude Code writes the code, a team of agents -- a code reviewer and a security auditor -- run in parallel to validate the work. Then the modified files get tested. Then they get simplified automatically. Build, validate, test, simplify. Per task. Not at the end. Per task.

Phase 3 is release. The pipeline pauses and asks: ready to ship? If yes, it runs the full test suite first -- the integration gate. If everything passes, it bumps the version, updates the changelog, commits, pushes, and builds for PyPI.


The inner loop

This is the part I'm most proud of. For each task in the spec:

1. Build -- Claude Code implements the task
2. Quality gate -- code_reviewer + security_auditor run in parallel (agent team)
3. Test -- only the modified files, fast feedback
4. Simplify -- automatic code simplification, no user input

The key insight: test before simplify. This follows red-green-refactor from TDD. Prove the code works, then clean it up. If simplify introduces a regression, the test already captured the expected behavior.


Why agent teams matter here

I had agent templates sitting in a registry for months. Code reviewer. Security auditor. Test generator. They were built, tested, registered -- and unused. Nobody was calling them.

The pipeline changed that. It's the orchestration layer that finally puts those agents to work. Not as standalone tools you remember to invoke. As automatic quality gates that run every time code is written.

The difference between "I should review this" and "it's already been reviewed" is whether the process includes it by default.


Interactive where it matters, automatic where it doesn't

Not every step needs you. Simplification doesn't need approval. Running tests doesn't need approval. But confirming a spec before building? That's a conversation. Deciding to release? That's a decision.

The pipeline knows the difference:

- Brainstorm discovery -- interactive
- Spec confirmation -- interactive
- Code review + security audit -- automatic
- Per-task testing -- automatic
- Simplification -- automatic
- Full test suite -- automatic
- Release decision -- interactive

You stay in control of the decisions. The machine handles the grunt work.


What this means for beginners

If you're new to building with AI, this is the part I want you to hear: you don't need to know the "right" sequence. The pipeline encodes it.

You don't need to remember to run a security audit after writing code. You don't need to remember to simplify. You don't need to remember to test the files you changed before running the full suite. The pipeline does it in the right order, every time.

/pipeline is a teaching tool disguised as a productivity tool.


Spec-Driven Development

This approach has a name: Spec-Driven Development. Define what you want to build as a structured spec. Let the system execute it with quality gates at every step. Review the output, not the process.

The spec is the contract between you and the machine. You define the what. The pipeline handles the how.


Try it

--- CODE START ---
pip install "attune-ai[developer]"
--- CODE END ---

Then type /pipeline in Claude Code. It'll ask you what you're building. Take it from there.


What's next

I built this pipeline to solve my own problem -- losing context and skipping steps. But the real test is whether it works for someone else's workflow too.

If you try it, I want to know: what phase did you start with? What did you skip? What's missing?

#SoftwareEngineering #DeveloperTools #Python #AI #OpenSource #SpecDriven


---
FIRST COMMENT:

GitHub: https://github.com/Smart-AI-Memory/attune-ai

Full pipeline docs: https://github.com/Smart-AI-Memory/attune-ai/blob/main/src/attune/commands/pipeline.md
