Skip to main content

Magic Specification-Driven Development (SDD) Workflow

Project description

๐Ÿช„ Magic Spec

NPM version PyPI version License: Apache 2.0

[!WARNING] Legacy Installers Deprecated (v1.5.x)

The npx magic-spec (npm) and uvx magic-spec (PyPI) packages will no longer receive updates as of v1.5.207. Archived releases remain available for historical reference:

New users: See Installation for the GitHub-based setup. Existing users: See Migrating from the legacy installer.

๐Ÿ“– Description

The Specification-Driven Development (SDD) Operating System for AI Coding Agents.

magic-spec installs a structured pipeline โ€” Thought โ†’ Spec โ†’ Task โ†’ Run โ†’ Code โ€” directly into any project, regardless of the tech stack. It acts as a set of markdown-based workflow instructions for AI coding agents (Cursor, Windsurf, Claude Code, Gemini CLI, and others), enforcing a deterministic process that ensures the AI fully understands the problem before writing code.

๐Ÿ’ก Idea  โ†’  ๐Ÿ“‹ Specification  โ†’  ๐Ÿ—บ๏ธ Task & Plan  โ†’  โšก Run  โ†’  ๐Ÿš€ Code

What Gets Installed

your-project/
โ”œโ”€โ”€ .agents/workflows/   # Slash commands (magic.spec, magic.task, magic.run, ...)
โ”œโ”€โ”€ .magic/              # SDD Engine (workflow logic and scripts โ€” read-only)
โ””โ”€โ”€ .design/             # Your Design Workspace (INDEX.md, RULES.md, PLAN.md)

[!TIP] Magic Workspaces: Multiple isolated design environments within a single repo (e.g., .design/engine/, .design/web/). See workspaces.md for details.

โš™๏ธ Requirements

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 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 .agents/ folder)
npx magic-spec@latest

# Targeted installation for a specific AI agent
npx magic-spec@latest --cursor
npx magic-spec@latest --claude
npx magic-spec@latest --windsurf

Edge Version (GitHub):

npx --yes github:teratron/magic-spec

Option B: Python (uvx)

Stable Release:

# Basic installation
uvx magic-spec

# Targeted installation
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

Install support for multiple adapters at once:

npx magic-spec@latest --cursor --copilot --windsurf

Option E: Manual Installation

  1. Download .magic/ and workflows/ from the GitHub repository.
  2. Place files into your AI agent's instruction directory (e.g., .cursor/commands).

Post-Install: .gitignore

The installer automatically adds .magic/ and the adapter directory (e.g., .agents/) to .gitignore. These are installed dependencies (like node_modules/) โ€” reinstall via npx magic-spec@latest rather than committing.

[!TIP] Vendoring: To commit the engine into your repo (so teammates get it without running the installer), remove the .magic/ and .agents/ entries from .gitignore.

๐Ÿ”„ Updating

# Check if update is available
npx magic-spec@latest --check

# Perform the update
npx magic-spec@latest --update

[!TIP] The update preserves your .design/ workspace and creates backups of .magic/ and .agents/. After updating, run /magic.analyze to ensure synchronization.

๐Ÿ’ฌ Usage

Natural Language

Talk to your AI agent naturally โ€” it will route to the correct workflow:

  • "Create a spec for user authentication" โ†’ Specification workflow
  • "Build an implementation plan" โ†’ Task & Plan workflow
  • "Execute the next task" โ†’ Run workflow
  • "Add a rule: always use Inter font" โ†’ Rule workflow
  • "Run a project audit" โ†’ Analyze workflow

Slash Commands

All core workflows are available as slash commands with optional arguments:

Command Purpose
/magic.spec Create or update specifications
/magic.task Generate implementation plan and tasks
/magic.run Execute tasks from the plan
/magic.rule Add or amend project conventions
/magic.analyze Audit project health and detect drift

Commands with Arguments

Each command accepts optional arguments to scope the operation to a specific workspace or provide a directive:

# No arguments โ€” operates across all workspaces
/magic.spec
/magic.task
/magic.run

# Workspace-scoped
/magic.task engine                     # Plan only for the "engine" workspace
/magic.run installers                  # Execute tasks in "installers" workspace
/magic.analyze engine                  # Analyze only the "engine" workspace

# With directive (quoted text)
/magic.task "decompose phase-2"        # Guided planning with focus
/magic.run "T-1A01"                    # Execute a specific task by ID
/magic.run "phase-2"                   # Execute all tasks in a phase
/magic.analyze "check API coverage"    # Focused analysis on a specific area

# Workspace + directive
/magic.run installers "phase-1"        # Execute phase 1 in "installers" workspace
/magic.task engine "only new specs"    # Plan only new specs in "engine" workspace

[!NOTE] For AI IDE users (Cursor, Windsurf, Claude Code, etc.): When you type / in the chat, a dropdown list of available commands appears and selecting one immediately executes it without arguments. If you need to pass arguments (workspace name, task ID, directive), type the full command manually instead of selecting from the dropdown. For example, type /magic.run "phase-2" directly rather than clicking /magic.run from the list.

๐Ÿค Compatibility

Magic Spec provides native workflow generation for all major AI development environments.

Install with a 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

Document Description
Main Documentation Workflows, architecture, and advanced features
SDD Philosophy Two-Layer Model, Integrity by Design, Self-Improving Feedback Loop
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.

๐Ÿ—บ๏ธ 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! See the 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 Apache License 2.0.

๐Ÿ“Š Project Status

Active Development (v1.5.207). We are constantly refining the SDD engine based on real-world usage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magic_spec-1.5.207.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magic_spec-1.5.207-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file magic_spec-1.5.207.tar.gz.

File metadata

  • Download URL: magic_spec-1.5.207.tar.gz
  • Upload date:
  • Size: 27.5 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

Hashes for magic_spec-1.5.207.tar.gz
Algorithm Hash digest
SHA256 0efa457dc8d450cbf50e8287065b7866cd32a4eb5486877ce03058be210c9a75
MD5 72c030edd264dc002f415da06e29aacc
BLAKE2b-256 9729af59a1c581b5d4137a4780e7be30a2e3c038b48a4a30155b1f987bfc2ede

See more details on using hashes here.

File details

Details for the file magic_spec-1.5.207-py3-none-any.whl.

File metadata

  • Download URL: magic_spec-1.5.207-py3-none-any.whl
  • Upload date:
  • Size: 18.0 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

Hashes for magic_spec-1.5.207-py3-none-any.whl
Algorithm Hash digest
SHA256 da86c72767b39fa17acf0f2530daf1519db7ffc78fc6f9ca198dd3a0048963bf
MD5 3695fb361f2fab4a830107d9c9199e09
BLAKE2b-256 11707fcae5bd8613fd48936fb5eb9146439087c0aa0333d0ea6578162b026bc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page