Skip to content

teratron/magic-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

387 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ„ Magic Spec

GitHub Release License: Apache 2.0

πŸ“– 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 SDD Philosophy for details.

πŸ“¦ Installation

Works with any project β€” Rust, Go, Python, JavaScript, C++, or anything else. No runtime lock-in.

Option A: Download from GitHub Releases (Recommended)

  1. Go to Releases.

  2. Download magic-spec-vX.Y.Z.zip.

  3. Extract and copy the following folders into your project root:

    your-project/
    β”œβ”€β”€ .magic/       ← copy from the release archive
    β”œβ”€β”€ workflows/    ← copy from the release archive
    β”œβ”€β”€ skills/       ← copy from the release archive
    └── rules/        ← copy from the release archive
    
  4. Integrate workflows or skills into your AI agent's environment (see Integration).

Option B: Manual Clone

# Clone just the needed folders
git clone --depth 1 https://github.com/teratron/magic-spec.git _magic_tmp
cp -r _magic_tmp/.magic _magic_tmp/workflows _magic_tmp/skills _magic_tmp/rules ./
rm -rf _magic_tmp

Post-Install: .gitignore

Add these entries to your .gitignore β€” the engine files are installed dependencies, like node_modules/:

.magic/
skills/
.agents/

Tip

Vendoring: To commit the engine into your repo (so teammates get it without reinstalling), simply omit these entries from .gitignore.

πŸ”„ Updating

Magic Spec includes a built-in upgrade-detection rule (rules/magic.md Β§1). After you manually replace the engine folders with a newer release, the next /magic.* invocation compares .magic/.version against the **Engine Version:** snapshot in .design/INDEX.md and asks [y/n] whether to re-run /magic.analyze. No network calls, no hidden cache β€” purely local.

To update:

  1. Download the new release archive from Releases.
  2. Replace .magic/, workflows/, skills/, and rules/ in your project.
  3. Run any /magic.* workflow β€” the agent will prompt you to run /magic.analyze to ratify the upgrade.

πŸ”— Integration

Magic Spec is designed to be agent-agnostic. You can integrate the engine's capabilities by linking or copying files from workflows/ or skills/ to your agent's specific configuration directory.

  • Workflows (workflows/): Standard Markdown files for agents that support "slash commands" or prompt-based rules (e.g., Cursor, Windsurf, GitHub Copilot).
  • Skills (skills/): Structured tool directories for agents that support modular "tools" or "skills" (e.g., Claude Code, Antigravity).

Tip

Flexibility: You can choose to use either directory or both, depending on your agent's requirements. For detailed integration patterns and directory mappings, see the Distribution Guide.

πŸ’¬ 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.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 engine "phase-1"            # Execute phase 1 in "engine" 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.

πŸ“š Documentation

Document Description
Main Documentation Workflows, architecture, and advanced features
SDD Philosophy Two-Layer Model, Integrity by Design, Self-Improving Feedback Loop
Distribution Guide Integration patterns, manual install, and update instructions
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 integration system.
  • Phased implementation planning.
  • GitHub-based manual distribution.
  • 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 (v2.0.23). We are constantly refining the SDD engine based on real-world usage.

About

Magic Specification-Driven Development (SDD) Workflow.

Resources

License

Contributing

Stars

Watchers

Forks

Contributors