specdacular 0.5.3 → 0.6.1
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 +85 -47
- package/package.json +4 -2
- package/specdacular/templates/features/DEPENDENCIES.md +47 -0
- package/specdacular/templates/orchestrator/CONCERNS.md +27 -0
- package/specdacular/templates/orchestrator/CONTRACTS.md +31 -0
- package/specdacular/templates/orchestrator/PROJECTS.md +39 -0
- package/specdacular/templates/orchestrator/TOPOLOGY.md +43 -0
- package/specdacular/templates/orchestrator/config.json +12 -0
- package/specdacular/workflows/execute-plan.md +165 -0
- package/specdacular/workflows/map-codebase.md +369 -4
- package/specdacular/workflows/new-feature.md +388 -1
- package/specdacular/workflows/next-feature.md +147 -0
- package/specdacular/workflows/plan-feature.md +369 -0
package/README.md
CHANGED
|
@@ -33,11 +33,9 @@ npx specdacular
|
|
|
33
33
|
- [How It Works](#how-it-works)
|
|
34
34
|
- [Parallel Agents](#parallel-agents)
|
|
35
35
|
- [Feature Flow](#feature-flow)
|
|
36
|
+
- [Multi-Project Support](#multi-project-support)
|
|
36
37
|
- [Project Structure](#project-structure)
|
|
37
38
|
- [Philosophy](#philosophy)
|
|
38
|
-
- [Migration Guides](#migration-guides)
|
|
39
|
-
- [From v0.5](#migrating-from-v05)
|
|
40
|
-
- [From v0.4](#migrating-from-v04)
|
|
41
39
|
- [Updating](#updating)
|
|
42
40
|
- [Uninstalling](#uninstalling)
|
|
43
41
|
- [Contributing](#contributing)
|
|
@@ -58,6 +56,8 @@ Spawns 4 parallel agents to analyze your codebase and generate AI-optimized docu
|
|
|
58
56
|
| `STRUCTURE.md` | Where do I put new code? |
|
|
59
57
|
| `CONCERNS.md` | What will bite me? Gotchas? Tech debt? |
|
|
60
58
|
|
|
59
|
+
For monorepos and multi-repo setups, it maps each sub-project in parallel, then produces system-level docs (`PROJECTS.md`, `TOPOLOGY.md`, `CONTRACTS.md`, `CONCERNS.md`) at the orchestrator level.
|
|
60
|
+
|
|
61
61
|
### 2. Plan Features
|
|
62
62
|
|
|
63
63
|
Two commands drive the entire feature lifecycle:
|
|
@@ -69,6 +69,8 @@ Two commands drive the entire feature lifecycle:
|
|
|
69
69
|
|
|
70
70
|
`feature:next` reads your feature's current state and offers the natural next step. You never need to remember which command comes next.
|
|
71
71
|
|
|
72
|
+
Works with single projects and multi-project setups (monorepos, multi-repo). In multi-project mode, features are discussed at the system level and routed to the relevant sub-projects, with cross-project dependency tracking and contract validation.
|
|
73
|
+
|
|
72
74
|
---
|
|
73
75
|
|
|
74
76
|
## Requirements
|
|
@@ -106,7 +108,7 @@ In Claude Code:
|
|
|
106
108
|
/specd:map-codebase
|
|
107
109
|
```
|
|
108
110
|
|
|
109
|
-
Creates `.specd/codebase/` with 4 AI-optimized documents. This gives Claude context about your codebase's architecture, patterns, structure, and gotchas.
|
|
111
|
+
Creates `.specd/codebase/` with 4 AI-optimized documents. This gives Claude context about your codebase's architecture, patterns, structure, and gotchas. For multi-project setups, it detects sub-projects automatically and maps each one in parallel before producing system-level documentation.
|
|
110
112
|
|
|
111
113
|
### Plan a Feature
|
|
112
114
|
|
|
@@ -327,9 +329,49 @@ review → review-phase workflow
|
|
|
327
329
|
|
|
328
330
|
---
|
|
329
331
|
|
|
332
|
+
## Multi-Project Support
|
|
333
|
+
|
|
334
|
+
Specdacular supports monorepos and multi-repo setups through an orchestrator layer. All existing commands gain multi-project awareness automatically — no new commands to learn.
|
|
335
|
+
|
|
336
|
+
### Setup
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
/specd:map-codebase
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
When it detects multiple projects (via `package.json`, `go.mod`, `Cargo.toml`, etc.), it offers to enable multi-project mode. This:
|
|
343
|
+
|
|
344
|
+
1. Registers sub-projects in an orchestrator `.specd/config.json`
|
|
345
|
+
2. Spawns 4 mapper agents per sub-project in parallel
|
|
346
|
+
3. Runs an orchestrator mapper that produces system-level docs:
|
|
347
|
+
|
|
348
|
+
| Document | What It Answers |
|
|
349
|
+
|----------|-----------------|
|
|
350
|
+
| `PROJECTS.md` | What projects exist, their tech stacks and purposes? |
|
|
351
|
+
| `TOPOLOGY.md` | How do projects communicate? What's the data flow? |
|
|
352
|
+
| `CONTRACTS.md` | What are the cross-project relationships and shared domains? |
|
|
353
|
+
| `CONCERNS.md` | What are the system-level gotchas? |
|
|
354
|
+
|
|
355
|
+
### Feature Planning
|
|
356
|
+
|
|
357
|
+
`feature:new` conducts a system-level discussion, identifies which projects are involved, and creates per-project features with self-contained requirements. Each sub-project's `.specd/` works identically whether standalone or part of a multi-project setup.
|
|
358
|
+
|
|
359
|
+
`feature:plan` creates per-project roadmaps plus a cross-project dependency graph (`DEPENDENCIES.md`) with cycle validation.
|
|
360
|
+
|
|
361
|
+
### Execution & Scheduling
|
|
362
|
+
|
|
363
|
+
`feature:next` schedules across projects, respecting cross-project dependencies. After each phase, it performs contract review — comparing what was implemented against system-level expectations and flagging deviations before they cascade to downstream projects.
|
|
364
|
+
|
|
365
|
+
```
|
|
366
|
+
/specd:feature:next auth-system # Auto-picks next unblocked phase across projects
|
|
367
|
+
/specd:feature:next auth-system api # Target a specific sub-project
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
330
372
|
## Project Structure
|
|
331
373
|
|
|
332
|
-
|
|
374
|
+
### Single Project
|
|
333
375
|
|
|
334
376
|
```
|
|
335
377
|
your-project/
|
|
@@ -361,6 +403,44 @@ your-project/
|
|
|
361
403
|
└── ...
|
|
362
404
|
```
|
|
363
405
|
|
|
406
|
+
### Multi-Project
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
monorepo/
|
|
410
|
+
├── .specd/ # Orchestrator level
|
|
411
|
+
│ ├── config.json # type: "orchestrator", projects list
|
|
412
|
+
│ ├── codebase/ # System-level docs
|
|
413
|
+
│ │ ├── PROJECTS.md
|
|
414
|
+
│ │ ├── TOPOLOGY.md
|
|
415
|
+
│ │ ├── CONTRACTS.md
|
|
416
|
+
│ │ └── CONCERNS.md
|
|
417
|
+
│ └── features/
|
|
418
|
+
│ └── auth-system/
|
|
419
|
+
│ ├── FEATURE.md # System-level requirements
|
|
420
|
+
│ ├── DEPENDENCIES.md # Cross-project dependency graph
|
|
421
|
+
│ └── STATE.md # Cross-project progress
|
|
422
|
+
│
|
|
423
|
+
├── api/
|
|
424
|
+
│ └── .specd/ # Sub-project (works standalone too)
|
|
425
|
+
│ ├── config.json # type: "project"
|
|
426
|
+
│ ├── codebase/
|
|
427
|
+
│ │ ├── MAP.md
|
|
428
|
+
│ │ ├── PATTERNS.md
|
|
429
|
+
│ │ ├── STRUCTURE.md
|
|
430
|
+
│ │ └── CONCERNS.md
|
|
431
|
+
│ └── features/
|
|
432
|
+
│ └── auth-system/
|
|
433
|
+
│ ├── FEATURE.md # Project-specific requirements
|
|
434
|
+
│ ├── ROADMAP.md # Per-project phases
|
|
435
|
+
│ └── plans/...
|
|
436
|
+
│
|
|
437
|
+
└── web/
|
|
438
|
+
└── .specd/ # Another sub-project
|
|
439
|
+
├── config.json
|
|
440
|
+
├── codebase/...
|
|
441
|
+
└── features/...
|
|
442
|
+
```
|
|
443
|
+
|
|
364
444
|
---
|
|
365
445
|
|
|
366
446
|
## Philosophy
|
|
@@ -389,48 +469,6 @@ Once recorded in `DECISIONS.md`, decisions aren't re-litigated. Each has date, c
|
|
|
389
469
|
|
|
390
470
|
---
|
|
391
471
|
|
|
392
|
-
## Migration Guides
|
|
393
|
-
|
|
394
|
-
### Migrating from v0.5
|
|
395
|
-
|
|
396
|
-
**New command: `/specd:feature:next`** — Drives the entire feature lifecycle from a single command. Reads current state and offers the next step automatically.
|
|
397
|
-
|
|
398
|
-
| Before (v0.5) | After (v0.6) |
|
|
399
|
-
|----------------|--------------|
|
|
400
|
-
| Remember command sequence: `discuss` → `research` → `plan` → `phase:prepare` → `phase:plan` → `phase:execute` → `phase:review` | Just run `/specd:feature:next` — it figures out what's next |
|
|
401
|
-
| `feature:new` ends with list of commands to try | `feature:new` offers to continue discussing or stop with `feature:next` |
|
|
402
|
-
|
|
403
|
-
**Existing `.specd/` data is fully compatible.** `feature:next` reads the same `config.json`, `STATE.md`, and other files.
|
|
404
|
-
|
|
405
|
-
### Migrating from v0.4
|
|
406
|
-
|
|
407
|
-
Commands were renamed into `feature:` and `phase:` namespaces:
|
|
408
|
-
|
|
409
|
-
| v0.4 | v0.5 |
|
|
410
|
-
|------|------|
|
|
411
|
-
| `/specd:new-feature` | `/specd:feature:new` |
|
|
412
|
-
| `/specd:discuss-feature` | `/specd:feature:discuss` |
|
|
413
|
-
| `/specd:research-feature` | `/specd:feature:research` |
|
|
414
|
-
| `/specd:plan-feature` | `/specd:feature:plan` |
|
|
415
|
-
| `/specd:discuss-phase` | `/specd:phase:prepare` |
|
|
416
|
-
| `/specd:research-phase` | `/specd:phase:research` |
|
|
417
|
-
| `/specd:execute-plan` | `/specd:phase:execute` |
|
|
418
|
-
| `/specd:insert-phase` | `/specd:phase:insert` |
|
|
419
|
-
| `/specd:renumber-phases` | `/specd:phase:renumber` |
|
|
420
|
-
|
|
421
|
-
**New commands in v0.5:**
|
|
422
|
-
- `/specd:phase:prepare` — Replaces `discuss-phase`, adds optional research at the end
|
|
423
|
-
- `/specd:phase:plan` — Creates detailed plans for **one phase** (new command)
|
|
424
|
-
|
|
425
|
-
**Behavior changes in v0.5:**
|
|
426
|
-
- `feature:plan` now creates only `ROADMAP.md` + empty phase directories. It no longer creates `PLAN.md` files for all phases upfront.
|
|
427
|
-
- Detailed `PLAN.md` files are created per-phase with `phase:plan`, right before execution.
|
|
428
|
-
- `phase:prepare` combines the old discuss-phase + research-phase into a single command.
|
|
429
|
-
|
|
430
|
-
**Existing `.specd/` data is fully compatible.** Your feature files, decisions, and roadmaps work with the new commands.
|
|
431
|
-
|
|
432
|
-
---
|
|
433
|
-
|
|
434
472
|
## Updating
|
|
435
473
|
|
|
436
474
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specdacular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Feature planning system for existing codebases. Map, understand, and plan features in large projects.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"specdacular": "bin/install.js"
|
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
"commands",
|
|
11
11
|
"agents",
|
|
12
12
|
"specdacular",
|
|
13
|
-
"hooks"
|
|
13
|
+
"hooks",
|
|
14
|
+
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"keywords": [
|
|
17
|
+
"specd",
|
|
16
18
|
"claude",
|
|
17
19
|
"claude-code",
|
|
18
20
|
"ai",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Dependencies: {feature-name}
|
|
2
|
+
|
|
3
|
+
**Last Updated:** {YYYY-MM-DD}
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
{Brief description of how this feature spans multiple projects and what each project contributes.}
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Project Involvement
|
|
12
|
+
|
|
13
|
+
| Project | Role | Path |
|
|
14
|
+
|---------|------|------|
|
|
15
|
+
| {project-name} | {What this project does for this feature} | {./relative/path} |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Phase Dependencies
|
|
20
|
+
|
|
21
|
+
| Phase | Depends On | Status |
|
|
22
|
+
|-------|------------|--------|
|
|
23
|
+
| {project}/phase-{N} | — | pending |
|
|
24
|
+
| {project}/phase-{N} | {project}/phase-{N} | blocked |
|
|
25
|
+
|
|
26
|
+
**Status values:** `pending` | `blocked` | `in-progress` | `complete`
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Dependency Graph
|
|
31
|
+
|
|
32
|
+
```mermaid
|
|
33
|
+
graph TD
|
|
34
|
+
A1[{project-a}/phase-1] --> A2[{project-a}/phase-2]
|
|
35
|
+
B1[{project-b}/phase-1] --> B2[{project-b}/phase-2]
|
|
36
|
+
A2 --> B2
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Scheduling Notes
|
|
42
|
+
|
|
43
|
+
{Notes about execution order, parallelism opportunities, and constraints.}
|
|
44
|
+
|
|
45
|
+
- Phases with no dependencies can start immediately
|
|
46
|
+
- Phases with all dependencies `complete` are unblocked
|
|
47
|
+
- The `next` command reads this table to determine what work is available
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# System Concerns
|
|
2
|
+
|
|
3
|
+
**Last Updated:** {YYYY-MM-DD}
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
{Brief description of cross-cutting system-level concerns that affect multiple projects. These are distinct from per-project concerns in each project's `.specd/codebase/CONCERNS.md`.}
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## {Concern Title}
|
|
12
|
+
|
|
13
|
+
**Scope:** {Which projects are affected}
|
|
14
|
+
**Issue:** {What the concern is — the cross-cutting problem}
|
|
15
|
+
**Impact:** {What goes wrong if this is ignored during planning/execution}
|
|
16
|
+
**Mitigation:** {How to handle this during feature planning and phase execution}
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
{Repeat for each system-level concern}
|
|
21
|
+
|
|
22
|
+
## Concern Categories
|
|
23
|
+
|
|
24
|
+
| Category | Concerns | Projects Affected |
|
|
25
|
+
|----------|----------|-------------------|
|
|
26
|
+
| {e.g., Data Consistency} | {concern titles} | {project list} |
|
|
27
|
+
| {e.g., Deployment Order} | {concern titles} | {project list} |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contracts
|
|
2
|
+
|
|
3
|
+
**Last Updated:** {YYYY-MM-DD}
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
{Brief description of how contracts work in this system. These are stable relationship descriptions — specific contracts for individual features are defined in each feature's FEATURE.md.}
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## {project-a} ↔ {project-b}
|
|
12
|
+
|
|
13
|
+
**Communication:** {REST, gRPC, pub/sub, etc.}
|
|
14
|
+
**Pattern:** {Consumer/provider relationship}
|
|
15
|
+
**Shared Domains:** {What concepts/data they share}
|
|
16
|
+
**Source of Truth:** {Which project defines the contract}
|
|
17
|
+
|
|
18
|
+
### Contract Nature
|
|
19
|
+
|
|
20
|
+
{Prose description of what flows between these projects and the general expectations. This is NOT a detailed API spec — it describes the relationship so that feature planning can identify which projects are affected.}
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
{Repeat for each project relationship with contracts}
|
|
25
|
+
|
|
26
|
+
## Notes
|
|
27
|
+
|
|
28
|
+
- These contracts describe relationship patterns, not specific endpoints
|
|
29
|
+
- Feature-level contracts (specific endpoints, schemas) are defined in each feature's orchestrator FEATURE.md
|
|
30
|
+
- Deviation detection runs against feature-level contracts, not this document
|
|
31
|
+
- This document helps with feature routing: identifying which projects a feature involves
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Projects
|
|
2
|
+
|
|
3
|
+
**Last Updated:** {YYYY-MM-DD}
|
|
4
|
+
**Project Count:** {N}
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Project Registry
|
|
9
|
+
|
|
10
|
+
| Project | Path | Tech Stack | Purpose |
|
|
11
|
+
|---------|------|------------|---------|
|
|
12
|
+
| {project-name} | {./relative/path} | {e.g., Node.js, TypeScript, Next.js} | {One-liner purpose} |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## {project-name}
|
|
17
|
+
|
|
18
|
+
**Path:** `{./relative/path}`
|
|
19
|
+
**Tech Stack:** {stack}
|
|
20
|
+
**Purpose:** {What this project does in the system}
|
|
21
|
+
|
|
22
|
+
### Responsibilities
|
|
23
|
+
|
|
24
|
+
- {What this project owns and manages}
|
|
25
|
+
|
|
26
|
+
### Key Entry Points
|
|
27
|
+
|
|
28
|
+
- `{path/to/main/file}` — {What it does, why other projects care}
|
|
29
|
+
|
|
30
|
+
### Codebase Docs
|
|
31
|
+
|
|
32
|
+
- `{project-path}/.specd/codebase/MAP.md` — System overview
|
|
33
|
+
- `{project-path}/.specd/codebase/PATTERNS.md` — Code patterns
|
|
34
|
+
- `{project-path}/.specd/codebase/STRUCTURE.md` — File structure
|
|
35
|
+
- `{project-path}/.specd/codebase/CONCERNS.md` — Project-level concerns
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
{Repeat for each project}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Topology
|
|
2
|
+
|
|
3
|
+
**Last Updated:** {YYYY-MM-DD}
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
{Brief description of how projects in this system communicate. 2-3 sentences.}
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Project Relationships
|
|
12
|
+
|
|
13
|
+
### {project-a} ↔ {project-b}
|
|
14
|
+
|
|
15
|
+
**Communication:** {REST, gRPC, pub/sub, shared database, file system, etc.}
|
|
16
|
+
**Pattern:** {Who initiates, who responds. e.g., "UI is the sole consumer of the API"}
|
|
17
|
+
**Shared Domains:** {What data/concepts they share. e.g., "Authentication, Users, Projects"}
|
|
18
|
+
**Source of Truth:** {Which project defines the contract. e.g., "API defines the contract, UI adapts"}
|
|
19
|
+
|
|
20
|
+
**Data Flow:**
|
|
21
|
+
- {project-a} → {project-b}: {What data/events flow in this direction}
|
|
22
|
+
- {project-b} → {project-a}: {What data/events flow in this direction}
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
{Repeat for each project relationship}
|
|
27
|
+
|
|
28
|
+
## Shared Resources
|
|
29
|
+
|
|
30
|
+
{Resources shared across projects — databases, caches, queues, file storage.}
|
|
31
|
+
|
|
32
|
+
| Resource | Type | Used By | Owner |
|
|
33
|
+
|----------|------|---------|-------|
|
|
34
|
+
| {resource-name} | {database, cache, queue, etc.} | {project-a, project-b} | {which project manages it} |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Communication Diagram
|
|
39
|
+
|
|
40
|
+
```mermaid
|
|
41
|
+
graph LR
|
|
42
|
+
A[{project-a}] -->|{protocol}| B[{project-b}]
|
|
43
|
+
```
|
|
@@ -96,6 +96,40 @@ Load ALL context needed for execution.
|
|
|
96
96
|
- `STRUCTURE.md` — Where files go
|
|
97
97
|
- `MAP.md` — System overview
|
|
98
98
|
|
|
99
|
+
**Check for orchestrator mode:**
|
|
100
|
+
|
|
101
|
+
Read feature's `config.json`. If `"orchestrator": true`:
|
|
102
|
+
|
|
103
|
+
Set mode = "orchestrator".
|
|
104
|
+
|
|
105
|
+
**Load orchestrator context:**
|
|
106
|
+
- Orchestrator FEATURE.md — System-level expectations (used for contract validation)
|
|
107
|
+
- Orchestrator DEPENDENCIES.md — Cross-project dependency graph
|
|
108
|
+
- Orchestrator STATE.md — Which project/phase to execute
|
|
109
|
+
|
|
110
|
+
**Determine target project:**
|
|
111
|
+
From orchestrator STATE.md or arguments, identify which project and phase to execute.
|
|
112
|
+
Read the target project's feature context:
|
|
113
|
+
- `{project-path}/.specd/features/{feature-name}/config.json`
|
|
114
|
+
- `{project-path}/.specd/features/{feature-name}/STATE.md`
|
|
115
|
+
- `{project-path}/.specd/features/{feature-name}/ROADMAP.md`
|
|
116
|
+
- `{project-path}/.specd/features/{feature-name}/DECISIONS.md`
|
|
117
|
+
|
|
118
|
+
Read the project's codebase context:
|
|
119
|
+
- `{project-path}/.specd/codebase/PATTERNS.md`
|
|
120
|
+
- `{project-path}/.specd/codebase/STRUCTURE.md`
|
|
121
|
+
- `{project-path}/.specd/codebase/MAP.md`
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Orchestrator mode: executing in {project-name} ({project-path}).
|
|
125
|
+
Feature: {feature-name}, Phase {N}.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Continue to find_plan (with project-path-prefixed plan lookup).
|
|
129
|
+
|
|
130
|
+
**If not orchestrator:**
|
|
131
|
+
Set mode = "project".
|
|
132
|
+
|
|
99
133
|
**Internalize:**
|
|
100
134
|
- Which plans are complete (from STATE.md)
|
|
101
135
|
- Which phase we're in
|
|
@@ -390,9 +424,126 @@ All plans complete! Feature '{feature}' is implemented.
|
|
|
390
424
|
Review STATE.md and CHANGELOG.md for summary.
|
|
391
425
|
```
|
|
392
426
|
|
|
427
|
+
**If orchestrator mode:**
|
|
428
|
+
Continue to contract_review.
|
|
429
|
+
|
|
430
|
+
**If single-project mode:**
|
|
393
431
|
End workflow.
|
|
394
432
|
</step>
|
|
395
433
|
|
|
434
|
+
<step name="contract_review">
|
|
435
|
+
Review completed phase against cross-project contract expectations (orchestrator mode only).
|
|
436
|
+
|
|
437
|
+
**Only runs in orchestrator mode, after a plan completes in a sub-project.**
|
|
438
|
+
|
|
439
|
+
**Gather what was implemented:**
|
|
440
|
+
1. Read the sub-project's CHANGELOG.md for this plan — deviations and changes
|
|
441
|
+
2. Review files created/modified during this plan
|
|
442
|
+
3. Understand what the phase actually produced
|
|
443
|
+
|
|
444
|
+
**Compare against expectations:**
|
|
445
|
+
1. Read orchestrator FEATURE.md — system-level requirements and cross-project contracts
|
|
446
|
+
2. Read DEPENDENCIES.md — which other project phases depend on this phase's output
|
|
447
|
+
3. For each downstream dependency, check: does the actual output match what the dependent phase expects?
|
|
448
|
+
|
|
449
|
+
**Assessment:**
|
|
450
|
+
```
|
|
451
|
+
### Contract Review: {project-name}/phase-{N}
|
|
452
|
+
|
|
453
|
+
**Implemented:** {brief summary of what was built}
|
|
454
|
+
|
|
455
|
+
**Cross-project impact:**
|
|
456
|
+
{For each dependent phase:}
|
|
457
|
+
- {other-project}/phase-{M}: {expects X} → {actual output matches / deviates}
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**If no deviations:**
|
|
461
|
+
```
|
|
462
|
+
No contract deviations detected. Downstream phases can proceed as planned.
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
Update orchestrator STATE.md: mark this project phase as complete.
|
|
466
|
+
Continue to orchestrator_phase_complete.
|
|
467
|
+
|
|
468
|
+
**If deviations detected:**
|
|
469
|
+
```
|
|
470
|
+
Contract deviation detected:
|
|
471
|
+
|
|
472
|
+
**What changed:** {description of deviation}
|
|
473
|
+
**Expected by:** {list of dependent project phases}
|
|
474
|
+
**Impact:** {what breaks or needs updating}
|
|
475
|
+
|
|
476
|
+
For example:
|
|
477
|
+
"API changed /auth/login response from {token: string} to {accessToken: string, refreshToken: string}.
|
|
478
|
+
UI phase 2 expects {token: string}. Will need to update token handling."
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
Use AskUserQuestion:
|
|
482
|
+
- header: "Deviation"
|
|
483
|
+
- question: "How would you like to handle this contract deviation?"
|
|
484
|
+
- options:
|
|
485
|
+
- "Accept and update" — Accept the deviation, update orchestrator notes, continue
|
|
486
|
+
- "Trigger replan" — Replan affected project phases to accommodate the change
|
|
487
|
+
- "Investigate" — Look deeper before deciding
|
|
488
|
+
|
|
489
|
+
**If "Accept and update":**
|
|
490
|
+
- Log deviation to orchestrator CHANGELOG.md
|
|
491
|
+
- Note that downstream phases should account for the change
|
|
492
|
+
- Continue to orchestrator_phase_complete
|
|
493
|
+
|
|
494
|
+
**If "Trigger replan":**
|
|
495
|
+
- Check cascade depth (DEC-010)
|
|
496
|
+
- If depth < 2: trigger replan for affected project phases
|
|
497
|
+
- Update affected project's ROADMAP.md phase description
|
|
498
|
+
- Regenerate affected PLAN.md files
|
|
499
|
+
- Log to orchestrator CHANGELOG.md
|
|
500
|
+
- Increment cascade depth
|
|
501
|
+
- If depth >= 2: force pause
|
|
502
|
+
```
|
|
503
|
+
Multiple cascading replans detected (depth {N}).
|
|
504
|
+
|
|
505
|
+
This suggests a significant architectural mismatch.
|
|
506
|
+
Before continuing, review the overall approach:
|
|
507
|
+
- Are the project responsibilities correctly divided?
|
|
508
|
+
- Should the feature be restructured?
|
|
509
|
+
|
|
510
|
+
Recommend: /specd:feature:discuss {feature-name} to reassess.
|
|
511
|
+
```
|
|
512
|
+
End workflow (user must explicitly resume).
|
|
513
|
+
</step>
|
|
514
|
+
|
|
515
|
+
<step name="orchestrator_phase_complete">
|
|
516
|
+
Update orchestrator state and present summary after contract review.
|
|
517
|
+
|
|
518
|
+
**Update orchestrator STATE.md:**
|
|
519
|
+
- Mark this project's phase as complete in Sub-Project Features table
|
|
520
|
+
- Update orchestrator progress
|
|
521
|
+
|
|
522
|
+
**Update orchestrator config.json:**
|
|
523
|
+
- Increment completed phase count if all plans for this project phase are done
|
|
524
|
+
|
|
525
|
+
**Present summary:**
|
|
526
|
+
```
|
|
527
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
528
|
+
PHASE COMPLETE (ORCHESTRATOR)
|
|
529
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
530
|
+
|
|
531
|
+
**Feature:** {feature-name}
|
|
532
|
+
**Project:** {project-name}
|
|
533
|
+
**Phase:** {N}
|
|
534
|
+
**Contract review:** {passed / deviations accepted / replanned}
|
|
535
|
+
|
|
536
|
+
**Next unblocked work:**
|
|
537
|
+
{From DEPENDENCIES.md — which phases are now unblocked by this completion}
|
|
538
|
+
|
|
539
|
+
───────────────────────────────────────────────────────
|
|
540
|
+
|
|
541
|
+
Resume with /specd:feature:next {feature-name}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
End workflow (returns to orchestrator scheduling via next).
|
|
545
|
+
</step>
|
|
546
|
+
|
|
396
547
|
</process>
|
|
397
548
|
|
|
398
549
|
<changelog_format>
|
|
@@ -418,6 +569,8 @@ Types:
|
|
|
418
569
|
</changelog_format>
|
|
419
570
|
|
|
420
571
|
<success_criteria>
|
|
572
|
+
|
|
573
|
+
## Single-Project Mode
|
|
421
574
|
- Feature validated with plans
|
|
422
575
|
- All context loaded and internalized
|
|
423
576
|
- Tasks executed in plan order
|
|
@@ -426,4 +579,16 @@ Types:
|
|
|
426
579
|
- Commits made with proper format
|
|
427
580
|
- STATE.md updated with progress
|
|
428
581
|
- Next plan identified or completion announced
|
|
582
|
+
|
|
583
|
+
## Multi-Project Mode (Orchestrator)
|
|
584
|
+
- Orchestrator mode detected from feature config.json
|
|
585
|
+
- Sub-project context loaded with path-prefixed file access
|
|
586
|
+
- Plans executed inline in sub-project context
|
|
587
|
+
- Contract review performed after phase completion (DEC-004)
|
|
588
|
+
- Deviations flagged with cross-project impact analysis
|
|
589
|
+
- User can accept deviation or trigger replan
|
|
590
|
+
- Replan cascade depth limited to 2 (DEC-010)
|
|
591
|
+
- Orchestrator STATE.md updated after each phase
|
|
592
|
+
- Summary shows next unblocked work
|
|
593
|
+
|
|
429
594
|
</success_criteria>
|