Magic Specification-Driven Development (SDD) Workflow
Project description
๐ช Magic Spec
๐ Description
The Specification-Driven Development (SDD) Operating System for AI Coding Agents.
Stop your AI from writing fragile code before it fully understands the problem. magic-spec installs a high-performance, structured pipeline โ Thought โ Spec โ Task โ Run โ Code โ directly into any project, regardless of the tech stack.
Whether you are a coding novice building your first application or a senior engineer architecting enterprise systems, Magic Spec brings maximum automation and professional rigor to your development process. It enforces a deterministic workflow that ensures your AI agent perfectly aligns with your vision before writing a single line of code.
The Core Concept
magic-spec is a set of markdown-based workflow instructions specifically designed for AI coding agents like Cursor, Windsurf, Claude, and Gemini. It acts as a project-level operating system that orchestrates agentic development.
Instead of chaotic prompt-engineering, Magic Spec provides a rigorous pipeline:
๐ก Idea โ ๐ Specification โ ๐บ๏ธ Task & Plan โ โก Run โ ๐ Code
Once initialized, your AI agent will automatically:
- Formulate a strong conceptual and technical specification.
- Build a phased implementation plan with hierarchical dependencies.
- Decompose the plan into prioritized, atomic, trackable tasks.
- Facilitate safe architectural brainstorming via Explore Mode.
- Analyze its own workflow and suggest improvements via Auto-Retrospectives.
What Gets Installed
After running the installer, your project directory will be augmented with the following structure:
root-project/
โโโ .agent/workflows/ # Slash commands wrapper (e.g., magic.spec, magic.task)
โโโ .magic/ # The SDD Engine (workflow logic and scripts - read-only)
โโโ .design/ # Your Project Design Workspace (INDEX.md, RULES.md, PLAN.md)
.magic/: Deploys the core SDD engine..agent/: Sets up workflows for your AI..design/: Initializes your project's workspace for Specifications, Rules, and Plans.- Onboarding: An interactive tutorial (
magic.onboard) helps you and your AI get started smoothly.
[!TIP] Magic Workspaces: Magic Spec supports multiple, isolated design environments within a single repository (e.g.,
.design/engine/,.design/installers/). This allows you to manage fundamentally different project domains without specification overlap, while sharing a single core engine. See workspaces.md for details.
๐ผ๏ธ Visuals
The engine enforces a rigorous, unskippable pipeline: Idea โ Specification โ Task & Plan โ Code. AI agents are prevented from jumping straight to coding. They must first formally specify the solution, then break it down into a concrete plan and tasks, and only then proceed to execution.
flowchart TB
IDEA(["๐ก Idea"])
subgraph BOX ["Magic Spec"]
direction TB
SPEC["๐ Spec"]
subgraph TASK ["๐บ๏ธ Task"]
direction TB
PLAN["๐ Plan"]
TASKS["๐ Tasks"]
PLAN --> TASKS
end
RUN["โก Run"]
SPEC --> PLAN
TASKS --> RUN
end
CODE(["๐ Code"])
IDEA --> SPEC
RUN --> CODE
style IDEA fill:#1e1e2e,stroke:#89b4fa,color:#cdd6f4
style CODE fill:#1e1e2e,stroke:#a6e3a1,color:#cdd6f4
style BOX fill:#181825,stroke:#fab387,stroke-width:3px,color:#fab387
style SPEC fill:#1e1e2e,stroke:#89b4fa,color:#cdd6f4
style RUN fill:#1e1e2e,stroke:#89b4fa,color:#cdd6f4
style TASK fill:#11111b,stroke:#89b4fa,stroke-dasharray:5 5,color:#89b4fa
style PLAN fill:#1e1e2e,stroke:#45475a,stroke-dasharray:4 4,color:#cdd6f4
style TASKS fill:#1e1e2e,stroke:#45475a,stroke-dasharray:4 4,color:#cdd6f4
โ๏ธ Requirements
Before installing Magic Spec, ensure you have one of the following available on your system:
| Requirement | Details |
|---|---|
| Node.js | Version 16.x or higher (for npx method) |
| Python | Version 3.8 or higher (for uvx or pipx methods) |
| Git | Required for installing edge versions directly from GitHub |
| Terminal | tar utility (pre-installed on Windows/Linux/macOS) |
๐ฆ Installation
Works perfectly with any project โ Rust, Go, Python, JavaScript, C++, or anything else. No runtime lock-in.
Option A: Node.js (npx)
Stable Release:
# Basic installation (defaults to .agent/ folder)
npx magic-spec@latest
# Targeted installation for Cursor
npx magic-spec@latest --cursor
Edge Version (GitHub):
npx --yes github:teratron/magic-spec
Option B: Python (uvx)
Stable Release:
# Basic installation
uvx magic-spec
# Targeted installation for Windsurf
uvx magic-spec --windsurf
Edge Version (GitHub):
uvx --from git+https://github.com/teratron/magic-spec.git magic-spec
Option C: Python (pipx)
pipx run magic-spec
Option D: Multi-Adapter Installation
You can install support for multiple adapters at once:
npx magic-spec@latest --cursor --copilot --windsurf
Option E: Manual Installation
If automated installers do not fit your environment:
- Engine: Download the
.magic/folder from the GitHub repository. - Workflows: Download command wrappers from
.agent/workflows/. - Deploy: Place files into your AI agent's instruction directory (e.g.,
.cursor/commands).
๐ Updating
Keep your SDD engine up to date with the latest logic and features:
# Check if update is available
npx magic-spec@latest --check
# Perform the update
npx magic-spec@latest --update
[!TIP] The update process preserves your
.design/workspace and automatically creates backups of.magic/and.agent/folders. If you have modified core engine files, the installer will detect conflicts and ask for your preference (overwrite, skip, or abort).
๐ฌ Usage
Just talk to your AI agent naturally in your prompt interface. No complex commands to learn:
- "Dispatch this thought into specs..." โ Triggers Specification workflow.
- "Create an implementation plan" โ Triggers Task & Plan workflow.
- "Execute the next task" โ Triggers Run workflow.
- "Add a rule: always use Inter font" โ Triggers Rule workflow.
๐ค Compatibility
Magic Spec is heavily optimized and provides native workflow generation for the world's most powerful AI development environments.
You can install support for a specific adapter using the shortcut flag (e.g., --cursor) or the environment flag (e.g., --env cursor).
| AI Agent / IDE | Shortcut Flag | Env Flag |
|---|---|---|
| Cursor (Agent Mode) | --cursor |
--env cursor |
| Windsurf (Cascade) | --windsurf |
--env windsurf |
| Claude Code | --claude |
--env claude |
| Gemini CLI | --gemini |
--env gemini |
| GitHub Copilot | --copilot |
--env copilot |
| Roo Code | --roo |
--env roo |
| Amp | --amp |
--env amp |
| Amazon Q Developer | --q |
--env q |
| Kilo Code | --kilocode |
--env kilocode |
| Qwen Code | --qwen |
--env qwen |
| OpenCode | --opencode |
--env opencode |
| SHAI (OVHcloud) | --shai |
--env shai |
| IBM Bob | --bob |
--env bob |
| CodeBuddy | --codebuddy |
--env codebuddy |
| Qoder IDE | --qoder |
--env qoder |
| Codex CLI | --codex |
--env codex |
| Auggie CLI | --augment |
--env augment |
| Antigravity IDE | --antigravity |
--env antigravity |
| Lingma IDE | --lingma |
--env lingma |
๐ Documentation
- Main Documentation โ Detailed guide on workflows, architecture, and advanced features.
- Installers Guide โ Advanced CLI options and platform specifics.
- Contributing โ How to develop, test, and extend the engine.
๐ Support
If you encounter issues or have questions:
- Open an Issue on GitHub.
- Run
magic.onboardin your agent to restart the interactive tutorial.
๐บ๏ธ Roadmap
- Multi-agent adapter system.
- Phased implementation planning.
- Extended support for local-first LLM agents.
- Advanced visual dashboard for project health.
- Integration with CI/CD for automated spec validation.
๐๏ธ Contributing
We welcome contributions! Whether it's a bug fix, a new adapter, or an improvement to the workflow logic. Please see Contributing Guide for details.
๐ฅ Authors and Acknowledgments
- Oleg Alexandrov โ Creator and Lead Maintainer.
- Special thanks to the AI agent community for inspiration and testing.
๐ License
Distributed under the MIT License.
๐ Project Status
Active Development (v1.x). We are constantly refining the SDD engine based on real-world usage.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file magic_spec-1.4.1.tar.gz.
File metadata
- Download URL: magic_spec-1.4.1.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45dfe6e272e7776d54ea2374cccde23bcfef3da8f0fa52a75657122e568f0d5b
|
|
| MD5 |
6a80f6bc3315163fbf042338a42094c0
|
|
| BLAKE2b-256 |
36c9fd98be9ee75f2897655daf17617f5cfb87a615f80641bee9a9bb0829e1c3
|
File details
Details for the file magic_spec-1.4.1-py3-none-any.whl.
File metadata
- Download URL: magic_spec-1.4.1-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ee204a1efaf30a5e831c6c8b3c24b2c7931bce0199c641fc5e44bf8b9c6734c
|
|
| MD5 |
1e88b45cae788ed4d7e7416b5b6f7d83
|
|
| BLAKE2b-256 |
582f1b7667ffa77cccae6a170da4e6d36a9a61008e0fbc8f229d374f1e96468d
|