sddx-workflow 0.6.0 → 0.8.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/README.md +58 -40
- package/dist/cli.js +36 -0
- package/package.json +1 -1
- package/templates/AGENTS.md +37 -0
- package/templates/codex-skills/ask/SKILL.md +8 -0
- package/templates/codex-skills/assume/SKILL.md +10 -0
- package/templates/codex-skills/bootstrap/SKILL.md +10 -0
- package/templates/codex-skills/bugfix/SKILL.md +9 -0
- package/templates/codex-skills/finish/SKILL.md +10 -0
- package/templates/codex-skills/refactor/SKILL.md +9 -0
- package/templates/codex-skills/review/SKILL.md +8 -0
- package/templates/codex-skills/spec-new/SKILL.md +9 -0
- package/templates/codex-skills/spec-plan/SKILL.md +9 -0
- package/templates/codex-skills/spec-tasks/SKILL.md +10 -0
package/README.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# sddx-workflow
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/sddx-workflow)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
3
7
|
Spec-Driven Development CLI for AI-assisted projects. Installs a structured workflow system that guides AI agents (Claude, Cursor, Copilot) through planning, execution, and review — without letting them run loose.
|
|
4
8
|
|
|
5
|
-
Works with any project: Next.js, Python, React, Django, Go, Rails
|
|
9
|
+
Works with any project: Next.js, Python, React, Django, Go, Rails.
|
|
6
10
|
|
|
7
11
|
```bash
|
|
8
12
|
npx sddx-workflow init
|
|
@@ -10,91 +14,97 @@ npx sddx-workflow init
|
|
|
10
14
|
|
|
11
15
|
---
|
|
12
16
|
|
|
13
|
-
##
|
|
17
|
+
## Why this exists
|
|
14
18
|
|
|
15
19
|
AI agents tend to implement without validating assumptions, refactor more than asked, and don't have a mental model of when to stop and ask for approval. This system enforces explicit ceremony levels and stop points.
|
|
16
20
|
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## Quick start
|
|
20
24
|
|
|
21
25
|
```bash
|
|
22
|
-
# Initialize in
|
|
26
|
+
# 1. Initialize the workflow in your project
|
|
23
27
|
npx sddx-workflow init
|
|
24
28
|
|
|
25
|
-
#
|
|
26
|
-
|
|
29
|
+
# 2. Populate project context (run with your AI agent)
|
|
30
|
+
/bootstrap
|
|
31
|
+
|
|
32
|
+
# 3. Build a feature
|
|
33
|
+
/spec-new # scaffold a spec folder
|
|
34
|
+
/spec-plan # generate a technical plan — stops for your approval
|
|
35
|
+
/spec-tasks # execute one atomic task at a time
|
|
36
|
+
/finish # stage files + generate a conventional commit
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## CLI reference
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx sddx-workflow init # Initialize in current project
|
|
45
|
+
npx sddx-workflow init --force # Overwrite existing files
|
|
27
46
|
|
|
28
|
-
# Add a domain file
|
|
29
|
-
npx sddx-workflow add domain auth
|
|
47
|
+
npx sddx-workflow add domain auth # Add a domain file
|
|
30
48
|
npx sddx-workflow add domain payments
|
|
31
49
|
npx sddx-workflow add domain storage
|
|
32
50
|
npx sddx-workflow add domain email
|
|
51
|
+
|
|
52
|
+
npx sddx-workflow status # Show current workflow state
|
|
53
|
+
npx sddx-workflow update # Update workflow templates
|
|
33
54
|
```
|
|
34
55
|
|
|
35
|
-
Files are **copied locally** — your project owns them. No runtime dependency. Edit
|
|
56
|
+
Files are **copied locally** — your project owns them. No runtime dependency. Edit freely.
|
|
36
57
|
|
|
37
58
|
---
|
|
38
59
|
|
|
39
|
-
##
|
|
60
|
+
## Generated structure
|
|
40
61
|
|
|
41
62
|
```
|
|
42
63
|
.sdd/
|
|
43
64
|
workflow.md # Commands, ceremony levels, stop points
|
|
44
|
-
project-overview.md # What this app is
|
|
45
|
-
conventions.md # Stack and patterns
|
|
65
|
+
project-overview.md # What this app is — populated by /bootstrap
|
|
66
|
+
conventions.md # Stack and patterns — populated by /bootstrap
|
|
46
67
|
domains/ # Domain-specific rules (auth, payments, etc.)
|
|
47
68
|
specs/
|
|
48
69
|
_template/
|
|
49
70
|
1-requirements.md # Problem, goals, acceptance criteria (BDD)
|
|
50
71
|
2-plan.md # Technical plan — requires approval before coding
|
|
51
72
|
3-tasks.md # Atomic task checklist with TDD gate
|
|
52
|
-
CLAUDE.md #
|
|
73
|
+
CLAUDE.md # Agent entry point — points to .sdd/
|
|
53
74
|
```
|
|
54
75
|
|
|
55
76
|
---
|
|
56
77
|
|
|
57
|
-
##
|
|
58
|
-
|
|
59
|
-
Run `/bootstrap` with your AI agent to populate the project context:
|
|
60
|
-
|
|
61
|
-
- **New project** — the agent interviews you with 6 targeted questions (problem, stack, non-goals, architecture decisions, domains, definition of done) and writes `.sdd/project-overview.md` and `.sdd/conventions.md`
|
|
62
|
-
- **Existing project** — run `/bootstrap --scan` and the agent reads your codebase first, infers what it can, then asks only about what the code can't answer
|
|
63
|
-
|
|
64
|
-
The agent presents a full draft for your approval before writing anything.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Workflow commands
|
|
78
|
+
## Agent commands
|
|
69
79
|
|
|
70
80
|
| Command | Purpose |
|
|
71
81
|
|---|---|
|
|
72
|
-
| `/bootstrap` | Populate project context
|
|
82
|
+
| `/bootstrap` | Populate project context via interview or codebase scan |
|
|
73
83
|
| `/ask` | Research and exploration — no code changes |
|
|
74
|
-
| `/assume` | Surface all assumptions before acting
|
|
84
|
+
| `/assume` | Surface all assumptions before acting |
|
|
75
85
|
| `/bugfix` | Reproduce → diagnose → fix → validate |
|
|
76
|
-
| `/refactor` | Restructure without behavior change
|
|
86
|
+
| `/refactor` | Restructure without behavior change (green baseline required) |
|
|
77
87
|
| `/spec-new` | Scaffold a spec folder for a feature |
|
|
78
88
|
| `/spec-plan` | Generate technical plan — **stops for approval before any code** |
|
|
79
89
|
| `/spec-tasks` | Execute plan one atomic task at a time, TDD-first |
|
|
80
|
-
| `/review` | Final audit — verifies goals,
|
|
81
|
-
| `/finish` | Stage files
|
|
90
|
+
| `/review` | Final audit — verifies goals, no scope creep |
|
|
91
|
+
| `/finish` | Stage files + generate conventional commit message |
|
|
82
92
|
|
|
83
93
|
### Ceremony levels
|
|
84
94
|
|
|
85
|
-
| Change | Flow |
|
|
95
|
+
| Change type | Flow |
|
|
86
96
|
|---|---|
|
|
87
97
|
| Typo / comment | Direct |
|
|
88
98
|
| Bug | `/bugfix` → `/finish` |
|
|
89
99
|
| Refactor | `/refactor` → `/finish` |
|
|
90
100
|
| Feature | `/spec-new` → `/spec-plan` → `/spec-tasks` → `/review` → `/finish` |
|
|
91
|
-
| Architecture | `/spec-new` → `/spec-plan` (mandatory
|
|
101
|
+
| Architecture | `/spec-new` → `/spec-plan` (mandatory review) → `/spec-tasks` → `/review` → `/finish` |
|
|
92
102
|
|
|
93
103
|
---
|
|
94
104
|
|
|
95
105
|
## Execution principles
|
|
96
106
|
|
|
97
|
-
|
|
107
|
+
Enforced by every command:
|
|
98
108
|
|
|
99
109
|
1. **Surface assumptions** — list them before acting, not mid-execution
|
|
100
110
|
2. **Minimum code** — only what was asked; no "while I'm here" changes
|
|
@@ -105,17 +115,27 @@ Built into the workflow — every command enforces these:
|
|
|
105
115
|
|
|
106
116
|
## Spec structure
|
|
107
117
|
|
|
108
|
-
Each feature
|
|
118
|
+
Each feature lives in `specs/<name>/` with three files:
|
|
109
119
|
|
|
110
120
|
**`1-requirements.md`** — Problem, measurable goals (G1, G2…), BDD acceptance criteria, constraints, open questions (blocking vs. non-blocking).
|
|
111
121
|
|
|
112
|
-
**`2-plan.md`** — Goals coverage, assumptions
|
|
122
|
+
**`2-plan.md`** — Goals coverage, assumptions confirmed via `/assume`, approach + tradeoffs, components affected, abort criteria. Requires explicit approval before execution starts.
|
|
113
123
|
|
|
114
|
-
**`3-tasks.md`** — One task at a time. Each
|
|
124
|
+
**`3-tasks.md`** — One task at a time. Each has: test to write first (red → green), files to change, goal ID, and acceptance scenario. Completed specs move to `specs/_done/`.
|
|
115
125
|
|
|
116
126
|
---
|
|
117
127
|
|
|
118
|
-
##
|
|
128
|
+
## Development
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
git clone https://github.com/MarcosCamara01/sddx-workflow.git
|
|
132
|
+
cd sddx-workflow
|
|
133
|
+
npm install
|
|
134
|
+
npm run dev # watch mode
|
|
135
|
+
npm run build # production build
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Publishing
|
|
119
139
|
|
|
120
140
|
```bash
|
|
121
141
|
npm version patch # bug fix: 0.1.0 → 0.1.1
|
|
@@ -123,9 +143,7 @@ npm version minor # new feature: 0.1.0 → 0.2.0
|
|
|
123
143
|
npm publish
|
|
124
144
|
```
|
|
125
145
|
|
|
126
|
-
Users running `npx sddx-workflow init` always get the latest version
|
|
127
|
-
|
|
128
|
-
Since files are copied to your project, existing `.sdd/` files are never overwritten on update — use `--force` to explicitly replace them.
|
|
146
|
+
Users running `npx sddx-workflow init` always get the latest version. Existing `.sdd/` files are never overwritten on update — use `--force` to explicitly replace them.
|
|
129
147
|
|
|
130
148
|
---
|
|
131
149
|
|
package/dist/cli.js
CHANGED
|
@@ -107,6 +107,34 @@ var PROVIDERS = {
|
|
|
107
107
|
{ src: "copilot-prompts/finish.prompt.md", dest: ".github/prompts/finish.prompt.md" },
|
|
108
108
|
{ src: "copilot-instructions.md", dest: ".github/copilot-instructions.md" }
|
|
109
109
|
]
|
|
110
|
+
},
|
|
111
|
+
codex: {
|
|
112
|
+
name: "OpenAI Codex",
|
|
113
|
+
dirs: [
|
|
114
|
+
".agents/skills/bootstrap",
|
|
115
|
+
".agents/skills/ask",
|
|
116
|
+
".agents/skills/assume",
|
|
117
|
+
".agents/skills/bugfix",
|
|
118
|
+
".agents/skills/refactor",
|
|
119
|
+
".agents/skills/spec-new",
|
|
120
|
+
".agents/skills/spec-plan",
|
|
121
|
+
".agents/skills/spec-tasks",
|
|
122
|
+
".agents/skills/review",
|
|
123
|
+
".agents/skills/finish"
|
|
124
|
+
],
|
|
125
|
+
files: [
|
|
126
|
+
{ src: "AGENTS.md", dest: "AGENTS.md" },
|
|
127
|
+
{ src: "codex-skills/bootstrap/SKILL.md", dest: ".agents/skills/bootstrap/SKILL.md" },
|
|
128
|
+
{ src: "codex-skills/ask/SKILL.md", dest: ".agents/skills/ask/SKILL.md" },
|
|
129
|
+
{ src: "codex-skills/assume/SKILL.md", dest: ".agents/skills/assume/SKILL.md" },
|
|
130
|
+
{ src: "codex-skills/bugfix/SKILL.md", dest: ".agents/skills/bugfix/SKILL.md" },
|
|
131
|
+
{ src: "codex-skills/refactor/SKILL.md", dest: ".agents/skills/refactor/SKILL.md" },
|
|
132
|
+
{ src: "codex-skills/spec-new/SKILL.md", dest: ".agents/skills/spec-new/SKILL.md" },
|
|
133
|
+
{ src: "codex-skills/spec-plan/SKILL.md", dest: ".agents/skills/spec-plan/SKILL.md" },
|
|
134
|
+
{ src: "codex-skills/spec-tasks/SKILL.md", dest: ".agents/skills/spec-tasks/SKILL.md" },
|
|
135
|
+
{ src: "codex-skills/review/SKILL.md", dest: ".agents/skills/review/SKILL.md" },
|
|
136
|
+
{ src: "codex-skills/finish/SKILL.md", dest: ".agents/skills/finish/SKILL.md" }
|
|
137
|
+
]
|
|
110
138
|
}
|
|
111
139
|
};
|
|
112
140
|
var ALL_PROVIDER_IDS = Object.keys(PROVIDERS);
|
|
@@ -141,6 +169,7 @@ async function initCommand(options) {
|
|
|
141
169
|
}
|
|
142
170
|
}
|
|
143
171
|
const claudeExisted = import_fs2.default.existsSync(import_path2.default.join(cwd, "CLAUDE.md"));
|
|
172
|
+
const agentsExisted = import_fs2.default.existsSync(import_path2.default.join(cwd, "AGENTS.md"));
|
|
144
173
|
for (const file of CORE_FILES) {
|
|
145
174
|
copyTemplate(file.src, import_path2.default.join(cwd, file.dest), force);
|
|
146
175
|
}
|
|
@@ -160,6 +189,13 @@ async function initCommand(options) {
|
|
|
160
189
|
} else {
|
|
161
190
|
console.log(" 2. CLAUDE.md already exists \u2014 add a reference to .sdd/ files manually");
|
|
162
191
|
}
|
|
192
|
+
if (selectedProviders.includes("codex")) {
|
|
193
|
+
if (!agentsExisted) {
|
|
194
|
+
console.log(" AGENTS.md was created \u2014 Codex will read it automatically");
|
|
195
|
+
} else {
|
|
196
|
+
console.log(" AGENTS.md already exists \u2014 add a reference to .sdd/ files manually");
|
|
197
|
+
}
|
|
198
|
+
}
|
|
163
199
|
console.log(` 3. Slash commands are ready in: ${providerNames}. Type / to see them.
|
|
164
200
|
`);
|
|
165
201
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Codex — Project Context
|
|
2
|
+
|
|
3
|
+
This project uses the SDD Protocol. Read these files before starting any task:
|
|
4
|
+
|
|
5
|
+
1. **[.sdd/workflow.md](.sdd/workflow.md)** — commands, ceremony levels, and stop points
|
|
6
|
+
2. **[.sdd/project-overview.md](.sdd/project-overview.md)** — what this app is, its non-goals, domains, and definition of done
|
|
7
|
+
3. **[.sdd/conventions.md](.sdd/conventions.md)** — project-specific conventions and patterns
|
|
8
|
+
|
|
9
|
+
## Available Skills
|
|
10
|
+
|
|
11
|
+
Type `/skills` or `$skill-name` to invoke. Skills are defined in `.agents/skills/`.
|
|
12
|
+
|
|
13
|
+
| Intent | Skill |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Initialize project context | `$bootstrap` (new) · `$bootstrap --scan` (existing) |
|
|
16
|
+
| Explore / research | `$ask` |
|
|
17
|
+
| Surface and validate assumptions | `$assume` |
|
|
18
|
+
| Fix a confirmed bug | `$bugfix` → `$finish` |
|
|
19
|
+
| Restructure without behavior change | `$refactor` → `$finish` |
|
|
20
|
+
| New feature | `$spec-new` → `$spec-plan` → `$spec-tasks` → `$review` → `$finish` |
|
|
21
|
+
| Stage + commit after any work | `$finish` |
|
|
22
|
+
|
|
23
|
+
## Active Specs
|
|
24
|
+
|
|
25
|
+
<!-- List specs currently in progress — completed specs live in specs/_done/ and are not active context.
|
|
26
|
+
- specs/auth-refresh/ — in spec-tasks (task 3 of 5)
|
|
27
|
+
- specs/payments-v2/ — plan pending approval
|
|
28
|
+
-->
|
|
29
|
+
|
|
30
|
+
## Domain Files
|
|
31
|
+
|
|
32
|
+
Relevant domain context lives in `.sdd/domains/`. Read the relevant domain file before working in that area.
|
|
33
|
+
|
|
34
|
+
<!-- List domains present in this project, e.g.:
|
|
35
|
+
- [.sdd/domains/auth.md](.sdd/domains/auth.md)
|
|
36
|
+
- [.sdd/domains/payments.md](.sdd/domains/payments.md)
|
|
37
|
+
-->
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ask
|
|
3
|
+
description: Research and exploration only — no code changes. Use when understanding a system, gathering context, analyzing options, or investigating a bug without touching files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /ask command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Research and exploration only — no code changes. Read files, analyze, and summarize findings with explicit options or recommendations.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: assume
|
|
3
|
+
description: Surface all assumptions before acting on a task. Use before spec-plan, before complex diagnosis, or any time an unstated guess is being made about requirements or codebase state.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /assume command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
List every assumption being made about the task, codebase state, and technical decisions.
|
|
9
|
+
For each: what you're assuming, why, and what changes if it's wrong.
|
|
10
|
+
Stop and wait for confirmation before proceeding.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bootstrap
|
|
3
|
+
description: Populate .sdd/project-overview.md and .sdd/conventions.md with real project context. Use when initializing a new project or onboarding to an existing codebase.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /bootstrap command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Populate .sdd/project-overview.md and .sdd/conventions.md with real project context.
|
|
9
|
+
If the request contains --scan, analyze the existing codebase first before asking questions.
|
|
10
|
+
Present the full draft for approval before writing any file.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bugfix
|
|
3
|
+
description: Lightweight flow for confirmed bugs. Use when fixing a known bug that fits within ~1 file or ~50 lines. Follows Reproduce → Diagnose → Fix → Validate stages.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /bugfix command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Follow the stages in order: Reproduce → Diagnose → Fix → Validate.
|
|
9
|
+
Do not skip stages. Stop after Reproduce if the bug cannot be confirmed.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: finish
|
|
3
|
+
description: Stage changed files and produce a conventional commit message for approval. Use after completing any unit of work — bug fix, refactor, or feature tasks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /finish command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Run git status and git diff. Stage all relevant files. Determine the commit type.
|
|
9
|
+
Draft a conventional commit message following the format in workflow.md.
|
|
10
|
+
Stop and present the staged files and commit message for approval before committing.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor
|
|
3
|
+
description: Restructure code without changing external behavior. Use when cleaning up internals while keeping all observable behavior identical. Requires a green test baseline first.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /refactor command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Restructure code without changing external behavior. Establish a green test baseline first.
|
|
9
|
+
Every observable behavior before the refactor must be identical after it.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: Final audit before closing a spec or merging. Use after all spec tasks are complete to verify goals are met, tests pass, and no scope creep was introduced.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /review command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Audit the spec before closing. Verify all goals (G1, G2…) are satisfied, every acceptance scenario has a passing test, no out-of-scope changes were introduced, and the implementation is the simplest that meets requirements.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-new
|
|
3
|
+
description: Scaffold a spec folder for a new feature or significant change. Use at the start of any feature work to create the requirements, plan, and tasks files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /spec-new command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Create a specs/<name>/ folder by copying the three template files from specs/_template/.
|
|
9
|
+
Replace <Feature Name> in each file title with the actual feature name.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-plan
|
|
3
|
+
description: Generate a technical plan from an approved requirements doc. Use after filling out 1-requirements.md. Stops for explicit approval before any code is written.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /spec-plan command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Read specs/<name>/1-requirements.md, run /assume, then draft the technical plan in specs/<name>/2-plan.md.
|
|
9
|
+
Stop for explicit approval before writing any implementation code.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-tasks
|
|
3
|
+
description: Execute an approved technical plan as atomic tasks, one at a time. Use after spec-plan is approved. Follows TDD: write test first (red), implement until green, run full suite.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Execute the /spec-tasks command defined in .sdd/workflow.md.
|
|
7
|
+
|
|
8
|
+
Read the approved specs/<name>/2-plan.md and execute tasks one at a time.
|
|
9
|
+
Write the test first (red), implement until green, run the full suite, then move to the next task.
|
|
10
|
+
Stop if tests fail or if a task reveals new scope.
|