magic-spec 1.2.3 β 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +40 -158
- package/installers/config.json +38 -0
- package/installers/node/index.js +839 -275
- package/package.json +8 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.3.0] - 2026-02-25
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Full support for abstract environment templates** with automatic resolution (`{ARGUMENTS}`) across all CLIs.
|
|
13
|
+
- **Introduced `.magicrc`** for persistence of selected environments and their auto-detection.
|
|
14
|
+
- **Two-level automatic Changelog generation** (by accumulating `Changes` blocks within tasks).
|
|
15
|
+
- **Added new CLI commands:** `info`, `--check`, `--list-envs`, and `--eject`.
|
|
16
|
+
- **Introduced core version tracking** within the project via the `.magic/.version` file.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **Architecture:** Restructured the repository into a two-level model (root = source of truth + installers), and removed the `core/` folder to eliminate duplication.
|
|
21
|
+
- **Node Installer:** Completely overhauled the installation mechanism (it now uses compiled files from NPM instead of downloading them from GitHub, eliminating Path Traversal vulnerabilities).
|
|
22
|
+
- **Python Installer:** Implemented an isolated package based on `hatchling` (via shared-data) without external dependencies on GitHub.
|
|
23
|
+
- **Documentation:** Separated `README.md` strategies (different focuses for GitHub, NPM package, and PyPI package).
|
|
24
|
+
- **Update Logic:** Improved `.magic` update logic to be safer (old folders are now moved to `.magic/archives/` rather than simply deleted).
|
|
25
|
+
|
|
26
|
+
## [1.3.0] - 2026-02-23
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- **Handoff integrations** (`magic.*.md`): Introduced explicit handoff blocks across all agent workflow wrappers to guide next-steps effortlessly.
|
|
31
|
+
- **Task Engine Enhancement:** Integrated User Stories generation parsing into `.magic/task.md` and suppressed user priority prompts using `RULES.md C4`.
|
|
32
|
+
- **System Automation Hooks:** Added `generate-context` script hooks into `task.md` and `run.md` post-write triggers.
|
|
33
|
+
- **Context Automation Script:** Created `generate-context.sh` and `generate-context.ps1` to assemble `CONTEXT.md` from PLAN, workspace trees, and changelogs.
|
|
34
|
+
- **Spec Engine Protections:** Added strict Explore Mode Safety rules and Delta Editing constraints for spec updates over 200 lines to `.magic/spec.md`.
|
|
35
|
+
- **Explore Hints:** Updated `.agent/workflows/magic.spec.md` UI wrapper with tips to use Delta Constraints and strict read-only explore mode.
|
|
36
|
+
- **CLI Doctor Command (Node/Python):** Implemented `--doctor` and `--check` parsing in installers, executing the prerequisite script and outputting a formatted terminal validation report.
|
|
37
|
+
- **Interactive Onboarding Script:** Created `.magic/onboard.md` to guide new developers through building a toy "console logger" specification.
|
|
38
|
+
- **Onboarding Wrapper:** Added `.agent/workflows/magic.onboard.md` to trigger the interactive onboarding tutorial seamlessly.
|
|
39
|
+
- **Prerequisite Validation:** Created `check-prerequisites.sh` and `check-prerequisites.ps1` parsing `INDEX.md` and returning valid JSON results.
|
package/README.md
CHANGED
|
@@ -1,196 +1,78 @@
|
|
|
1
1
|
# πͺ Magic Spec
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/magic-spec)
|
|
4
|
-
[](https://pypi.org/project/magic-spec/)
|
|
3
|
+
[](https://www.npmjs.com/package/magic-spec)
|
|
4
|
+
[](https://pypi.org/project/magic-spec/)
|
|
5
5
|
[](./LICENSE)
|
|
6
6
|
|
|
7
|
-
**Specification-Driven Development (SDD)
|
|
7
|
+
**The Specification-Driven Development (SDD) Operating System for AI Agents.**
|
|
8
8
|
|
|
9
|
-
Stop your AI from writing code before it understands the problem.
|
|
10
|
-
`magic-spec` installs a structured pipeline β *Thought β Spec β Task β Run β Code* β directly into any project, regardless of stack.
|
|
9
|
+
Stop your AI from writing code before it understands the problem. `magic-spec` installs a high-performance, structured pipeline β *Thought β Spec β Task β Run β Code* β directly into any project.
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
---
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
## β¨ Features
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- Convert raw thoughts into structured specification files.
|
|
23
|
-
- Build a phased implementation plan from approved specs.
|
|
24
|
-
- Decompose the plan into atomic, trackable tasks.
|
|
25
|
-
- Analyze its own workflow and suggest improvements β automatically, at phase completion.
|
|
15
|
+
- ποΈ **Deterministic Pipeline**: Forced structure ensures architectural integrity.
|
|
16
|
+
- π― **Multi-Agent Core**: Works with Cursor, Windsurf, Claude, Gemini, and more.
|
|
17
|
+
- π **Auto-Retrospective**: Built-in self-analysis engine that improves your workflow automatically.
|
|
18
|
+
- π¦ **Thin-Client Installers**: Lightweight Node.js and Python installers for zero-friction setup.
|
|
19
|
+
- πΊοΈ **Phased Planning**: Intelligent dependency tracking and implementation roadmaps.
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
---
|
|
28
22
|
|
|
29
23
|
## π Quick Start
|
|
30
24
|
|
|
31
|
-
Works with **any project** β Rust, Go, Python, JavaScript, or anything else.
|
|
32
|
-
No runtime lock-in. Requires only Node.js *or* Python to install.
|
|
25
|
+
Works with **any project** β Rust, Go, Python, JavaScript, C++, or anything else.
|
|
33
26
|
|
|
34
|
-
### Option A
|
|
27
|
+
### Option A: Node.js (npx)
|
|
35
28
|
|
|
36
29
|
```bash
|
|
37
30
|
npx magic-spec@latest
|
|
38
31
|
```
|
|
39
32
|
|
|
40
|
-
### Option B
|
|
33
|
+
### Option B: Python (uvx)
|
|
41
34
|
|
|
42
35
|
```bash
|
|
43
36
|
uvx magic-spec
|
|
44
37
|
```
|
|
45
38
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
1. Copy `.magic/` (the SDD engine) into your project.
|
|
49
|
-
2. Copy `.agent/workflows/magic.*.md` (agent trigger wrappers) into your project.
|
|
50
|
-
3. Run the init script β creates your `.design/` workspace with `INDEX.md` and `RULES.md`.
|
|
51
|
-
|
|
52
|
-
## π§ Core Philosophy
|
|
53
|
-
|
|
54
|
-
| Principle | Description |
|
|
55
|
-
| :--- | :--- |
|
|
56
|
-
| **Specs First, Code Later** | The agent is forbidden from writing code from raw input. All ideas become specs first. |
|
|
57
|
-
| **Deterministic Process** | A strict pipeline is enforced: *Thought β Spec β Task β Run β Code*. |
|
|
58
|
-
| **Constitution-Driven** | All project decisions live in `.design/RULES.md` β the project's living constitution. |
|
|
59
|
-
| **Self-Improving** | After each phase and at plan completion, the Task workflow automatically runs a retrospective and generates improvement recommendations. |
|
|
60
|
-
|
|
61
|
-
## π©Ί System Health (CLI Doctor)
|
|
62
|
-
|
|
63
|
-
You can check if your SDD workspace is properly initialized and healthy without invoking the AI. Just append the `--doctor` (or `--check`) flag:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npx magic-spec@latest --doctor
|
|
67
|
-
# or
|
|
68
|
-
uvx magic-spec --doctor
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
This returns a visually formatted validation report of your project's `.design` structure, preventing broken context before you start coding.
|
|
72
|
-
|
|
73
|
-
## π What Gets Installed
|
|
74
|
-
|
|
75
|
-
After running `npx magic-spec@latest` in your project root:
|
|
76
|
-
|
|
77
|
-
```plaintext
|
|
78
|
-
your-project/
|
|
79
|
-
β
|
|
80
|
-
βββ .agent/workflows/ # Agent entry points (slash commands)
|
|
81
|
-
β βββ magic.onboard.md # Interactive tutorial for new devs
|
|
82
|
-
β βββ magic.rule.md
|
|
83
|
-
β βββ magic.run.md
|
|
84
|
-
β βββ magic.spec.md
|
|
85
|
-
β βββ magic.task.md
|
|
86
|
-
β
|
|
87
|
-
βββ .magic/ # SDD Engine (workflow logic, read-only)
|
|
88
|
-
β βββ init.md
|
|
89
|
-
β βββ onboard.md # Onboarding script payload
|
|
90
|
-
β βββ retrospective.md
|
|
91
|
-
β βββ rule.md
|
|
92
|
-
β βββ run.md
|
|
93
|
-
β βββ spec.md
|
|
94
|
-
β βββ task.md
|
|
95
|
-
β βββ scripts/
|
|
96
|
-
β βββ check-prerequisites.* # Used by --doctor
|
|
97
|
-
β βββ generate-context.* # Auto-compiles CONTEXT.md
|
|
98
|
-
β βββ init.sh # Init for macOS / Linux
|
|
99
|
-
β βββ init.ps1 # Init for Windows
|
|
100
|
-
β
|
|
101
|
-
βββ .design/ # Your project workspace (generated)
|
|
102
|
-
βββ INDEX.md # Spec registry
|
|
103
|
-
βββ RULES.md # Project constitution
|
|
104
|
-
βββ PLAN.md # Implementation plan
|
|
105
|
-
βββ specifications/ # Your specification files
|
|
106
|
-
βββ tasks/ # Task breakdowns per phase
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## π The Workflow Pipeline
|
|
110
|
-
|
|
111
|
-
```mermaid
|
|
112
|
-
graph TD
|
|
113
|
-
IDEA["π‘ Idea"] --> INIT{"ποΈ Auto-Init"}
|
|
114
|
-
INIT -->|.design/ exists| SPEC
|
|
115
|
-
INIT -->|.design/ missing| CREATE["Create .design/ structure"] --> SPEC
|
|
116
|
-
SPEC["π Specification"] <--> RULE["π Rule"]
|
|
117
|
-
SPEC --> TASK["πΊοΈ Task & Plan"]
|
|
118
|
-
TASK --> RUN["β‘ Run"]
|
|
119
|
-
RUN --> CODE["π Code"]
|
|
120
|
-
RUN -.->|"auto: phase done"| RETRO["π Retrospective"]
|
|
121
|
-
RETRO -.->|Feedback loop| SPEC
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Core Workflows
|
|
125
|
-
|
|
126
|
-
| # | Workflow | Purpose |
|
|
127
|
-
| :--- | :--- | :--- |
|
|
128
|
-
| 1 | **Specification** | Converts raw thoughts into structured specs. Verifies specs against project state. Manages statuses: `Draft β RFC β Stable β Deprecated`. |
|
|
129
|
-
| 2 | **Task** | Reads Stable specs, builds a dependency graph, produces a phased `PLAN.md`, and decomposes into atomic tasks. |
|
|
130
|
-
| 3 | **Run** | Executes tasks with sequential and parallel tracks. Automatically runs a retrospective at phase and plan completion. |
|
|
131
|
-
|
|
132
|
-
### Auxiliary Workflows
|
|
133
|
-
|
|
134
|
-
| Workflow | Purpose |
|
|
135
|
-
| :--- | :--- |
|
|
136
|
-
| **Rule** | Manages the project constitution (`RULES.md Β§7`). Add, amend, or remove conventions. |
|
|
137
|
-
| **Onboard** | Interactive tutorial guiding new developers through their first Magic SDD cycle. |
|
|
138
|
-
|
|
139
|
-
> **Retrospective** runs automatically inside the Run workflow β at phase completion (snapshot) and plan completion (full analysis). No manual command needed.
|
|
140
|
-
|
|
141
|
-
## π¬ How to Use (with any AI agent)
|
|
142
|
-
|
|
143
|
-
Just talk to your AI agent naturally. Initialization is **automatic** β no setup command required.
|
|
144
|
-
|
|
145
|
-
```plaintext
|
|
146
|
-
"Dispatch this thought into specs: I want a user auth system with JWT and Redis..."
|
|
147
|
-
β Runs Specification workflow
|
|
39
|
+
**What happens next?**
|
|
148
40
|
|
|
149
|
-
|
|
150
|
-
|
|
41
|
+
1. Magic Spec deploys the `.magic/` engine and `.agent/` workflows.
|
|
42
|
+
2. An interactive onboarding tutorial (`magic.onboard`) helps you and your AI get started.
|
|
43
|
+
3. Your project gains a dedicated `.design/` workspace for Specifications, Rules, and Plans.
|
|
151
44
|
|
|
152
|
-
|
|
153
|
-
β Runs Task workflow
|
|
45
|
+
---
|
|
154
46
|
|
|
155
|
-
|
|
156
|
-
β Runs Run workflow
|
|
47
|
+
## π§ The Workflow
|
|
157
48
|
|
|
158
|
-
|
|
159
|
-
|
|
49
|
+
1. **Specification**: Convert raw ideas into formal, versioned specs.
|
|
50
|
+
2. **Task & Plan**: Generate a phased roadmap with atomic, trackable tasks.
|
|
51
|
+
3. **Run**: Execute the plan with automatic progress tracking and quality gates.
|
|
52
|
+
4. **Rule**: Manage project conventions in a central `RULES.md` constitution.
|
|
160
53
|
|
|
161
|
-
|
|
162
|
-
β Runs Specification workflow (Consistency Check)
|
|
54
|
+
---
|
|
163
55
|
|
|
164
|
-
|
|
165
|
-
β Runs Onboard workflow
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
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.** β¨
|
|
169
|
-
|
|
170
|
-
## π Updating
|
|
171
|
-
|
|
172
|
-
Pull the latest engine improvements without touching your project data:
|
|
56
|
+
## π Documentation & Guides
|
|
173
57
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
# Python
|
|
179
|
-
uvx magic-spec --update
|
|
180
|
-
```
|
|
58
|
+
- [**Main Documentation**](./docs/README.md) β Detailed guide on workflows and architecture.
|
|
59
|
+
- [**Installers Guide**](./installers/README.md) β Advanced CLI options and platform specifics.
|
|
60
|
+
- [**Contributing**](./docs/contributing.md) β How to develop and extend the engine.
|
|
181
61
|
|
|
182
|
-
|
|
62
|
+
---
|
|
183
63
|
|
|
184
64
|
## π€ Compatibility
|
|
185
65
|
|
|
186
|
-
|
|
66
|
+
Magic Spec is optimized for the world's most powerful AI development environments:
|
|
67
|
+
|
|
68
|
+
- [**Cursor**](https://cursor.com) (Rule definitions & Agent Mode)
|
|
69
|
+
- [**Windsurf**](https://codeium.com/windsurf) (Cascade & Flows)
|
|
70
|
+
- [**GitHub Copilot**](https://github.com/features/copilot) (Custom Instructions)
|
|
71
|
+
- [**Claude**](https://claude.ai) (Project context)
|
|
187
72
|
|
|
188
|
-
|
|
189
|
-
- [Claude](https://claude.ai) (Projects)
|
|
190
|
-
- [Gemini](https://gemini.google.com) (via Gemini Code)
|
|
191
|
-
- [GitHub Copilot](https://github.com/features/copilot) (Agent mode)
|
|
192
|
-
- Any terminal-based or API-driven agent
|
|
73
|
+
---
|
|
193
74
|
|
|
194
75
|
## π License
|
|
195
76
|
|
|
196
|
-
[MIT](./LICENSE)
|
|
77
|
+
Distributed under the [MIT License](./LICENSE).
|
|
78
|
+
Β© 2026 Oleg Alexandrov & teratron. β¨
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"githubRepo": "teratron/magic-spec",
|
|
3
|
+
"packageName": "magic-spec",
|
|
4
|
+
"removePrefix": "magic.",
|
|
5
|
+
"engineDir": ".magic",
|
|
6
|
+
"agentDir": ".agent",
|
|
7
|
+
"workflowsDir": "workflows",
|
|
8
|
+
"defaultExt": ".md",
|
|
9
|
+
"download": {
|
|
10
|
+
"timeoutMs": 60000,
|
|
11
|
+
"tempPrefix": "magic-spec-"
|
|
12
|
+
},
|
|
13
|
+
"userAgent": {
|
|
14
|
+
"node": "magic-spec-node",
|
|
15
|
+
"python": "magic-spec-cli"
|
|
16
|
+
},
|
|
17
|
+
"eject": {
|
|
18
|
+
"targets": [
|
|
19
|
+
".magic",
|
|
20
|
+
".agent",
|
|
21
|
+
".magic.bak",
|
|
22
|
+
".agent.bak"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"publish": {
|
|
26
|
+
"versionFiles": [
|
|
27
|
+
"pyproject.toml",
|
|
28
|
+
"installers/python/magic_spec/__init__.py",
|
|
29
|
+
"package.json",
|
|
30
|
+
".magic/.version"
|
|
31
|
+
],
|
|
32
|
+
"docsTargets": [
|
|
33
|
+
"README.md",
|
|
34
|
+
"CHANGELOG.md"
|
|
35
|
+
],
|
|
36
|
+
"docsDir": "docs"
|
|
37
|
+
}
|
|
38
|
+
}
|