Skip to main content

Magic Specification-Driven Development (SDD) Workflow Installer

Project description

๐Ÿช„ Magic Spec

npm version PyPI version License: MIT

Specification-Driven Development (SDD) workflow for AI coding agents.

Stop your AI from writing code before it understands the problem.
magic-spec installs a structured pipeline โ€” Thought โ†’ Spec โ†’ Plan โ†’ Task โ†’ Code โ€” directly into any project, regardless of stack.

โœจ What is Magic Spec?

magic-spec is a set of markdown-based workflow instructions for AI coding agents (Cursor, Claude, Gemini, Copilot, etc.). It acts as an operating system for agentic development, enforcing a rigorous, structured pipeline:

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

Once installed, your AI agent will automatically:

  • Convert raw thoughts into structured specification files.
  • Build a phased implementation plan from approved specs.
  • Decompose the plan into atomic, trackable tasks.
  • Analyze its own workflow and suggest improvements.

No code is written until a specification exists. No spec is implemented without a plan.

๐Ÿš€ Quick Start

Works with any project โ€” Rust, Go, Python, JavaScript, or anything else.
No runtime lock-in. Requires only Node.js or Python to install.

Option A โ€” Node.js (npx)

npx magic-spec@latest

Option B โ€” Python (uvx)

uvx magic-spec

Both commands do exactly the same thing:

  1. Copy .magic/ (the SDD engine) into your project.
  2. Copy .agent/workflows/magic/ (agent trigger wrappers) into your project.
  3. Run the init script โ€” creates your .design/ workspace with INDEX.md and RULES.md.

๐Ÿงญ Core Philosophy

Principle Description
Specs First, Code Later The agent is forbidden from writing code from raw input. All ideas become specs first.
Deterministic Process A strict pipeline is enforced: Thought โ†’ Spec โ†’ Plan โ†’ Task โ†’ Code.
Constitution-Driven All project decisions live in .design/RULES.md โ€” the project's living constitution.
Self-Improving The Retrospective workflow analyzes real usage and generates improvement recommendations.

๐Ÿ“ What Gets Installed

After running npx magic-spec@latest in your project root:

your-project/
โ”‚
โ”œโ”€โ”€ .agent/workflows/magic/     # Agent entry points (slash commands)
โ”‚   โ”œโ”€โ”€ plan.md
โ”‚   โ”œโ”€โ”€ retrospective.md
โ”‚   โ”œโ”€โ”€ rule.md
โ”‚   โ”œโ”€โ”€ specification.md
โ”‚   โ””โ”€โ”€ task.md
โ”‚
โ”œโ”€โ”€ .magic/                     # SDD Engine (workflow logic, read-only)
โ”‚   โ”œโ”€โ”€ init.md
โ”‚   โ”œโ”€โ”€ plan.md
โ”‚   โ”œโ”€โ”€ retrospective.md
โ”‚   โ”œโ”€โ”€ rule.md
โ”‚   โ”œโ”€โ”€ specification.md
โ”‚   โ”œโ”€โ”€ task.md
โ”‚   โ””โ”€โ”€ scripts/
โ”‚       โ”œโ”€โ”€ init.sh             # Init for macOS / Linux
โ”‚       โ””โ”€โ”€ init.ps1            # Init for Windows
โ”‚
โ””โ”€โ”€ .design/                    # Your project workspace (generated)
    โ”œโ”€โ”€ INDEX.md                # Spec registry
    โ”œโ”€โ”€ RULES.md                # Project constitution
    โ”œโ”€โ”€ PLAN.md                 # Implementation plan
    โ”œโ”€โ”€ specifications/         # Your specification files
    โ””โ”€โ”€ tasks/                  # Task breakdowns per phase

๐Ÿ”— The Workflow Pipeline

graph TD
    IDEA["๐Ÿ’ก Idea"] --> INIT{"๐Ÿ—๏ธ Auto-Init"}
    INIT -->|.design/ exists| SPEC
    INIT -->|.design/ missing| CREATE["Create .design/ structure"] --> SPEC
    SPEC["๐Ÿ“‹ Specification"] <--> RULE["๐Ÿ“œ Rule"]
    SPEC --> PLAN["๐Ÿ—บ๏ธ Plan"]
    PLAN --> TASK["โšก Task"]
    TASK --> CODE["๐Ÿš€ Code"]
    CODE --> RETRO["๐Ÿ” Retrospective"]
    RETRO -.->|Feedback loop| SPEC

Core Workflows

# Workflow Purpose
1 Specification Converts raw thoughts into structured specs. Manages statuses: Draft โ†’ RFC โ†’ Stable โ†’ Deprecated.
2 Plan Reads Stable specs, builds a dependency graph, and produces a phased PLAN.md.
3 Task Decomposes the plan into atomic tasks with sequential and parallel execution tracks.

Auxiliary Workflows

Workflow Purpose
Rule Manages the project constitution (RULES.md ยง7). Add, amend, or remove conventions.
Retrospective Analyzes SDD usage, collects metrics, and generates improvement recommendations.

๐Ÿ’ฌ How to Use (with any AI agent)

Just talk to your AI agent naturally. Initialization is automatic โ€” no setup command required.

"Dispatch this thought into specs: I want a user auth system with JWT and Redis..."
โ†’ Runs Specification workflow

"Create an implementation plan"
โ†’ Runs Plan workflow

"Generate tasks for Phase 1"
โ†’ Runs Task workflow

"Execute the next task"
โ†’ Runs Task workflow (execution mode)

"Add rule: always use snake_case for file names"
โ†’ Runs Rule workflow

"Run retrospective"
โ†’ Runs Retrospective workflow

The AI reads the corresponding .magic/*.md workflow file and executes the request within the bounds of the SDD system. No code escapes the pipeline. โœจ

๐Ÿ”„ Updating

Pull the latest engine improvements without touching your project data:

# Node.js
npx magic-spec@latest --update

# Python
uvx magic-spec --update

The update overwrites .magic/ (the engine) but never touches .design/ (your specs, plans, and tasks).

๐Ÿค Compatibility

Works with any AI coding agent that can read markdown workflow files:

๐Ÿ“„ License

MIT ยฉ 2026 Oleg Alexandrov


TODO: Magic Spec

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.0.0.tar.gz (5.0 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.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: magic_spec-1.0.0.tar.gz
  • Upload date:
  • Size: 5.0 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.0.0.tar.gz
Algorithm Hash digest
SHA256 745d19ea87f1a290883a053cbe9f7c12b231830ff585489cf7c3dcf6378ede32
MD5 379d528c7dde28768290fa54f15fa2e0
BLAKE2b-256 aabfdf4aeb5281f333a864cd6a911fbb7bcb2cb400e1d1aa7b4568c7d584b80b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: magic_spec-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8359ba2e7a73b6246078c420743caafdca8c5ca971cd9a43b140fd14f538dd88
MD5 7d8f82d261a9c01076662413c52252ed
BLAKE2b-256 51ec794537c1a00cd9820bae4db7676b2fedd9682835b19ffe267b0391acfdf4

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