create-sdd-project 0.15.0 → 0.16.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 +46 -17
- package/lib/config.js +1 -0
- package/lib/diff-generator.js +4 -4
- package/lib/doctor.js +43 -0
- package/package.json +1 -1
- package/template/.claude/settings.json +1 -1
- package/template/.claude/skills/development-workflow/SKILL.md +9 -7
- package/template/.claude/skills/development-workflow/references/complexity-guide.md +1 -0
- package/template/.claude/skills/pm-orchestrator/SKILL.md +224 -0
- package/template/.claude/skills/pm-orchestrator/references/pm-session-template.md +39 -0
- package/template/.gemini/skills/development-workflow/SKILL.md +9 -7
- package/template/.gemini/skills/development-workflow/references/complexity-guide.md +1 -0
- package/template/.gemini/skills/pm-orchestrator/SKILL.md +224 -0
- package/template/.gemini/skills/pm-orchestrator/references/pm-session-template.md +39 -0
- package/template/AGENTS.md +12 -0
- package/template/CLAUDE.md +2 -1
- package/template/GEMINI.md +12 -1
- package/template/ai-specs/specs/base-standards.mdc +10 -8
- package/template/gitignore +4 -0
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ The interactive wizard asks about your stack, AI tools, and autonomy level:
|
|
|
42
42
|
2) L2 Trusted — Human reviews plans + merges only ← default
|
|
43
43
|
3) L3 Autopilot — Human only approves merges
|
|
44
44
|
4) L4 Full Auto — No human checkpoints, CI/CD gates only
|
|
45
|
+
5) L5 PM Autonomous — PM Agent orchestrates features end-to-end
|
|
45
46
|
```
|
|
46
47
|
|
|
47
48
|
For defaults (fullstack Express+Next.js, L2 autonomy):
|
|
@@ -243,21 +244,19 @@ Customize the generated workflow as your project grows.
|
|
|
243
244
|
|
|
244
245
|
Open your project in Claude Code or Gemini and start building:
|
|
245
246
|
|
|
246
|
-
**
|
|
247
|
+
**Single feature (L1-L4):**
|
|
247
248
|
```
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
add feature "user authentication with JWT"
|
|
250
|
+
start task F001
|
|
251
|
+
show progress
|
|
252
|
+
next task
|
|
252
253
|
```
|
|
253
254
|
|
|
254
|
-
**
|
|
255
|
+
**Autonomous multi-feature (L5):**
|
|
255
256
|
```
|
|
256
|
-
|
|
257
|
-
/start-task F001
|
|
258
|
-
/show-progress
|
|
259
|
-
/next-task
|
|
257
|
+
start pm
|
|
260
258
|
```
|
|
259
|
+
The PM Orchestrator reads your product tracker, presents features for batch classification, then develops them sequentially — spec, plan, implement, review, merge — with all quality gates enforced.
|
|
261
260
|
|
|
262
261
|
The workflow skill guides you through each step — from spec writing to implementation to code review — with checkpoints based on your autonomy level.
|
|
263
262
|
|
|
@@ -295,7 +294,7 @@ SDD DevFlow combines three proven practices:
|
|
|
295
294
|
| `qa-engineer` | Edge cases, spec verification | 5 |
|
|
296
295
|
| `database-architect` | Schema design, optimization | Any |
|
|
297
296
|
|
|
298
|
-
###
|
|
297
|
+
### 5 Skills (Workflow Orchestration)
|
|
299
298
|
|
|
300
299
|
| Skill | Trigger | What it does |
|
|
301
300
|
|-------|---------|-------------|
|
|
@@ -303,8 +302,9 @@ SDD DevFlow combines three proven practices:
|
|
|
303
302
|
| `bug-workflow` | `report bug`, `fix bug`, `hotfix needed` | Bug triage, investigation, and resolution |
|
|
304
303
|
| `project-memory` | `set up project memory`, `log a bug fix` | Maintains institutional knowledge |
|
|
305
304
|
| `health-check` | `health check`, `project health` | Quick scan: tests, build, specs sync, secrets, docs freshness |
|
|
305
|
+
| `pm-orchestrator` | `start pm`, `continue pm`, `stop pm` | **L5**: Autonomous sequential multi-feature execution with guardrails |
|
|
306
306
|
|
|
307
|
-
###
|
|
307
|
+
### 5 Custom Commands
|
|
308
308
|
|
|
309
309
|
| Command | What it does |
|
|
310
310
|
|---------|-------------|
|
|
@@ -312,6 +312,7 @@ SDD DevFlow combines three proven practices:
|
|
|
312
312
|
| `/review-plan` | Cross-model plan review — runs automatically after plan self-review when external CLIs are available; catches implementation blind spots |
|
|
313
313
|
| `/context-prompt` | Generates a context recovery prompt after `/compact` with Workflow Recovery to prevent checkpoint skipping |
|
|
314
314
|
| `/review-project` | Comprehensive project-level review using up to 3 AI models in parallel — 6 domains, audit context, consolidated report with action plan |
|
|
315
|
+
| `/audit-merge` | Automated compliance audit — 11 pre-merge checks (ticket, tracker, evidence, merge base, working tree, data files). Auto-fixes issues. |
|
|
315
316
|
|
|
316
317
|
### Spec & Plan Quality
|
|
317
318
|
|
|
@@ -338,7 +339,7 @@ Cross-model reviews only trigger when at least one external CLI is available (Ge
|
|
|
338
339
|
- **Standard** (features): 0 → 1 → 2 → 3 → 4 → 5 (+QA) → 6
|
|
339
340
|
- **Complex** (architectural changes): 0 → 1 (+ADR) → 2 → 3 → 4 → 5 (+QA) → 6
|
|
340
341
|
|
|
341
|
-
###
|
|
342
|
+
### 5 Autonomy Levels
|
|
342
343
|
|
|
343
344
|
| Level | Name | Human Checkpoints | Best For |
|
|
344
345
|
|-------|------|-------------------|----------|
|
|
@@ -346,9 +347,35 @@ Cross-model reviews only trigger when at least one external CLI is available (Ge
|
|
|
346
347
|
| L2 | Trusted | Plan + Merge | Normal development **(default)** |
|
|
347
348
|
| L3 | Autopilot | Merge only | Well-defined, repetitive tasks |
|
|
348
349
|
| L4 | Full Auto | None (CI/CD gates only) | Bulk simple tasks |
|
|
350
|
+
| L5 | PM Autonomous | None + auto feature sequencing | Multi-feature batch execution via `start pm` |
|
|
349
351
|
|
|
350
352
|
Quality gates (tests, lint, build, validators) **always run** regardless of level.
|
|
351
353
|
|
|
354
|
+
### PM Orchestrator (L5 — Autonomous Multi-Feature)
|
|
355
|
+
|
|
356
|
+
At L5, the PM Orchestrator skill develops multiple features sequentially without manual intervention:
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
> start pm
|
|
360
|
+
|
|
361
|
+
PM Orchestrator — Batch Classification
|
|
362
|
+
|
|
363
|
+
These features are ready to develop:
|
|
364
|
+
|
|
365
|
+
| # | Feature | Type | Priority | Dependencies |
|
|
366
|
+
|---|----------------------|---------|----------|----------------|
|
|
367
|
+
| 1 | F014 — User Roles | backend | High | F006 (done) |
|
|
368
|
+
| 2 | F015 — Email Alerts | backend | Medium | none |
|
|
369
|
+
|
|
370
|
+
Classify complexity for each (Simple / Standard / Complex):
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
After classification, the loop runs autonomously: spec → plan → implement → review → merge for each feature, with all quality gates enforced.
|
|
374
|
+
|
|
375
|
+
**9 guardrails** prevent runaway execution: max 5 features/session, circuit breaker (3 failures → stop), kill switch (`stop pm`), session lock, post-merge sanity check (`npm test`), rolling batch (1-3 features at a time), clean workspace validation, quality gates always on, `/audit-merge` auto-execution.
|
|
376
|
+
|
|
377
|
+
**Recovery**: after `/compact` or terminal restart, run `continue pm` — the session state in `pm-session.md` tracks exactly where you left off.
|
|
378
|
+
|
|
352
379
|
### Merge Checklist (B+D Mechanism)
|
|
353
380
|
|
|
354
381
|
Every ticket includes a `## Merge Checklist Evidence` table that the agent must fill before requesting merge approval. This mechanism:
|
|
@@ -423,18 +450,20 @@ project/
|
|
|
423
450
|
│ │ │ └── references/ # Templates, guides, examples
|
|
424
451
|
│ │ ├── bug-workflow/ # Bug triage and resolution
|
|
425
452
|
│ │ ├── health-check/ # Project health diagnostics
|
|
453
|
+
│ │ ├── pm-orchestrator/ # L5: Autonomous multi-feature loop
|
|
426
454
|
│ │ └── project-memory/ # Memory system setup
|
|
427
455
|
│ ├── commands/ # Custom slash commands
|
|
428
456
|
│ │ ├── review-spec.md # Cross-model spec review (pre-plan)
|
|
429
457
|
│ │ ├── review-plan.md # Cross-model plan review
|
|
430
458
|
│ │ ├── context-prompt.md # Post-compact context recovery
|
|
431
|
-
│ │
|
|
459
|
+
│ │ ├── review-project.md # Multi-model project review
|
|
460
|
+
│ │ └── audit-merge.md # Pre-merge compliance audit
|
|
432
461
|
│ ├── hooks/quick-scan.sh # Post-developer quality scan
|
|
433
462
|
│ └── settings.json # Shared hooks (git-tracked)
|
|
434
463
|
│
|
|
435
464
|
├── .gemini/
|
|
436
465
|
│ ├── agents/ # 10 agents (Gemini format)
|
|
437
|
-
│ ├── skills/ # Same
|
|
466
|
+
│ ├── skills/ # Same 5 skills
|
|
438
467
|
│ ├── commands/ # Slash commands (workflow + review + context + project review)
|
|
439
468
|
│ └── settings.json # Gemini configuration
|
|
440
469
|
│
|
|
@@ -492,10 +521,10 @@ cp -r node_modules/create-sdd-project/template/ /path/to/your-project/
|
|
|
492
521
|
|
|
493
522
|
## Roadmap
|
|
494
523
|
|
|
495
|
-
- **
|
|
524
|
+
- **Agent Teams**: Intra-feature parallelism (e.g., spec review + plan review in parallel)
|
|
496
525
|
- **Monorepo improvements**: Better support for pnpm workspaces and Turbo
|
|
497
526
|
- **Retrofit Testing**: Automated test generation for existing projects with low coverage
|
|
498
|
-
- **
|
|
527
|
+
- **Plugin system**: Custom agents and skills marketplace
|
|
499
528
|
|
|
500
529
|
## Contributing
|
|
501
530
|
|
package/lib/config.js
CHANGED
|
@@ -82,6 +82,7 @@ const AUTONOMY_LEVELS = [
|
|
|
82
82
|
{ level: 2, name: 'Trusted', desc: 'Human reviews plans + merges only (normal development)', default: true },
|
|
83
83
|
{ level: 3, name: 'Autopilot', desc: 'Human only approves merges (well-defined, repetitive tasks)' },
|
|
84
84
|
{ level: 4, name: 'Full Auto', desc: 'No human checkpoints, CI/CD gates only (bulk simple tasks)' },
|
|
85
|
+
{ level: 5, name: 'PM Autonomous', desc: 'PM Agent orchestrates features end-to-end (requires "start pm" to activate)' },
|
|
85
86
|
];
|
|
86
87
|
|
|
87
88
|
const BRANCHING_STRATEGIES = [
|
package/lib/diff-generator.js
CHANGED
|
@@ -83,7 +83,7 @@ function runInitDiffReport(config) {
|
|
|
83
83
|
if (aiTools !== 'gemini') {
|
|
84
84
|
const claudeSkills = countFiles(path.join(templateDir, '.claude', 'skills'));
|
|
85
85
|
wouldCreate.push(` .claude/agents/ ${agentCount} agents${removedAgents > 0 ? ` (${removedAgents} removed: ${projectType}-only)` : ''}`);
|
|
86
|
-
wouldCreate.push(` .claude/skills/ ${claudeSkills} files (
|
|
86
|
+
wouldCreate.push(` .claude/skills/ ${claudeSkills} files (5 skills)`);
|
|
87
87
|
wouldCreate.push(' .claude/hooks/ quick-scan.sh');
|
|
88
88
|
wouldCreate.push(' .claude/settings.json');
|
|
89
89
|
wouldCreate.push(' .claude/commands/ .gitkeep');
|
|
@@ -93,7 +93,7 @@ function runInitDiffReport(config) {
|
|
|
93
93
|
const geminiSkills = countFiles(path.join(templateDir, '.gemini', 'skills'));
|
|
94
94
|
const geminiCmds = countFiles(path.join(templateDir, '.gemini', 'commands'));
|
|
95
95
|
wouldCreate.push(` .gemini/agents/ ${agentCount} agents${removedAgents > 0 ? ` (${removedAgents} removed: ${projectType}-only)` : ''}`);
|
|
96
|
-
wouldCreate.push(` .gemini/skills/ ${geminiSkills} files (
|
|
96
|
+
wouldCreate.push(` .gemini/skills/ ${geminiSkills} files (5 skills)`);
|
|
97
97
|
wouldCreate.push(` .gemini/commands/ ${geminiCmds} commands`);
|
|
98
98
|
wouldCreate.push(' .gemini/styles/ default.md');
|
|
99
99
|
wouldCreate.push(' .gemini/settings.json');
|
|
@@ -163,14 +163,14 @@ function runUpgradeDiffReport(config, state) {
|
|
|
163
163
|
if (aiTools !== 'gemini') {
|
|
164
164
|
const agentCount = countAgents(projectType);
|
|
165
165
|
replaceItems.push(`.claude/agents/ ${agentCount} agents`);
|
|
166
|
-
replaceItems.push('.claude/skills/
|
|
166
|
+
replaceItems.push('.claude/skills/ 5 skills');
|
|
167
167
|
replaceItems.push('.claude/hooks/ quick-scan.sh');
|
|
168
168
|
replaceItems.push('.claude/settings.json hooks updated, permissions preserved');
|
|
169
169
|
}
|
|
170
170
|
if (aiTools !== 'claude') {
|
|
171
171
|
const agentCount = countAgents(projectType);
|
|
172
172
|
replaceItems.push(`.gemini/agents/ ${agentCount} agents`);
|
|
173
|
-
replaceItems.push('.gemini/skills/
|
|
173
|
+
replaceItems.push('.gemini/skills/ 5 skills');
|
|
174
174
|
replaceItems.push('.gemini/commands/ TOML commands');
|
|
175
175
|
replaceItems.push('.gemini/styles/ default.md');
|
|
176
176
|
replaceItems.push('.gemini/settings.json');
|
package/lib/doctor.js
CHANGED
|
@@ -13,6 +13,7 @@ const {
|
|
|
13
13
|
getPackageVersion,
|
|
14
14
|
detectAiTools,
|
|
15
15
|
detectProjectType,
|
|
16
|
+
readAutonomyLevel,
|
|
16
17
|
} = require('./upgrade-generator');
|
|
17
18
|
|
|
18
19
|
const PASS = 'pass';
|
|
@@ -66,6 +67,9 @@ function runDoctor(cwd) {
|
|
|
66
67
|
// 10. Project Memory
|
|
67
68
|
results.push(checkProjectMemory(cwd));
|
|
68
69
|
|
|
70
|
+
// 11. Autonomy/Skills Consistency
|
|
71
|
+
results.push(checkAutonomySkillConsistency(cwd, aiTools));
|
|
72
|
+
|
|
69
73
|
return results;
|
|
70
74
|
}
|
|
71
75
|
|
|
@@ -486,6 +490,45 @@ function checkProjectMemory(cwd) {
|
|
|
486
490
|
};
|
|
487
491
|
}
|
|
488
492
|
|
|
493
|
+
function checkAutonomySkillConsistency(cwd, aiTools) {
|
|
494
|
+
const { level } = readAutonomyLevel(cwd);
|
|
495
|
+
|
|
496
|
+
if (level < 5) {
|
|
497
|
+
return {
|
|
498
|
+
status: PASS,
|
|
499
|
+
message: 'Autonomy/skills consistency: OK',
|
|
500
|
+
details: [],
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// L5 set — verify pm-orchestrator skill exists in all configured tools
|
|
505
|
+
const toolDirs = [];
|
|
506
|
+
if (aiTools !== 'gemini') toolDirs.push('.claude');
|
|
507
|
+
if (aiTools !== 'claude') toolDirs.push('.gemini');
|
|
508
|
+
|
|
509
|
+
const missing = [];
|
|
510
|
+
for (const dir of toolDirs) {
|
|
511
|
+
const pmSkillPath = path.join(cwd, dir, 'skills', 'pm-orchestrator', 'SKILL.md');
|
|
512
|
+
if (!fs.existsSync(pmSkillPath)) {
|
|
513
|
+
missing.push(`${dir}/skills/pm-orchestrator/SKILL.md`);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (missing.length > 0) {
|
|
518
|
+
return {
|
|
519
|
+
status: WARN,
|
|
520
|
+
message: 'L5 (PM Autonomous) set but pm-orchestrator skill missing',
|
|
521
|
+
details: [...missing.map((f) => `Missing: ${f}`), 'Run: npx create-sdd-project --upgrade'],
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return {
|
|
526
|
+
status: PASS,
|
|
527
|
+
message: 'Autonomy/skills consistency: L5 + pm-orchestrator present',
|
|
528
|
+
details: [],
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
489
532
|
module.exports = {
|
|
490
533
|
runDoctor,
|
|
491
534
|
printResults,
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"hooks": [
|
|
20
20
|
{
|
|
21
21
|
"type": "command",
|
|
22
|
-
"command": "
|
|
22
|
+
"command": "bash -c 'if [ -f \"$CLAUDE_PROJECT_DIR/docs/project_notes/pm-session.lock\" ]; then echo \"{\\\"additionalContext\\\": \\\"PM Autonomous session active. BEFORE doing anything else: (1) Read docs/project_notes/pm-session.md for full PM state. (2) Read the product tracker Active Session. (3) Run: continue pm\\\"}\"; else echo \"{\\\"additionalContext\\\": \\\"Context was compacted. BEFORE doing anything else: (1) Read the product tracker Active Session (docs/project_notes/product-tracker.md) for context recovery. (2) Re-read the SKILL.md for your current workflow (.claude/skills/development-workflow/SKILL.md) to know what actions are required at your current step. (3) If at Step 5 or later, you MUST read references/merge-checklist.md and fill the Merge Checklist Evidence table in the ticket before requesting merge approval.\\\"}\"; fi'",
|
|
23
23
|
"statusMessage": "Injecting recovery context..."
|
|
24
24
|
}
|
|
25
25
|
]
|
|
@@ -39,17 +39,19 @@ description: "Orchestrates the complete development workflow for each feature. I
|
|
|
39
39
|
|
|
40
40
|
Read the **Autonomy Level** from `CLAUDE.md` section 2.
|
|
41
41
|
|
|
42
|
-
| Checkpoint | L1 Full Control | L2 Trusted | L3 Autopilot | L4 Full Auto |
|
|
43
|
-
|
|
44
|
-
| Spec Approval (Step 0) | Required | Auto | Auto | Auto |
|
|
45
|
-
| Ticket Approval (Step 1) | Required | Auto | Auto | Auto |
|
|
46
|
-
| Plan Approval (Step 2) | Required | Required | Auto | Auto |
|
|
47
|
-
| Commit Approval (Step 4) | Required | Auto | Auto | Auto |
|
|
48
|
-
| Merge Approval (Step 5) | Required | Required | Required | Auto |
|
|
42
|
+
| Checkpoint | L1 Full Control | L2 Trusted | L3 Autopilot | L4 Full Auto | L5 PM Auto |
|
|
43
|
+
|------------|:-:|:-:|:-:|:-:|:-:|
|
|
44
|
+
| Spec Approval (Step 0) | Required | Auto | Auto | Auto | Auto |
|
|
45
|
+
| Ticket Approval (Step 1) | Required | Auto | Auto | Auto | Auto |
|
|
46
|
+
| Plan Approval (Step 2) | Required | Required | Auto | Auto | Auto |
|
|
47
|
+
| Commit Approval (Step 4) | Required | Auto | Auto | Auto | Auto |
|
|
48
|
+
| Merge Approval (Step 5) | Required | Required | Required | Auto | Auto |
|
|
49
|
+
| Next Feature (PM loop) | — | — | — | — | Auto |
|
|
49
50
|
|
|
50
51
|
- **Auto** = proceed without asking; log in product tracker → "Auto-Approved Decisions" table
|
|
51
52
|
- **Required** = ask user explicitly; do NOT continue without approval
|
|
52
53
|
- **Quality gates always run** regardless of level (tests, lint, build, validators)
|
|
54
|
+
- **L5** behaves like L4 for individual checkpoints. The `pm-orchestrator` skill handles automatic feature sequencing via `start pm`.
|
|
53
55
|
- **Steps are strictly sequential.** Do NOT start a later step before the current checkpoint is approved — even when the checkpoint is Auto (auto-approval still happens in order, not in parallel). In particular, do NOT generate the Implementation Plan (Step 2) while Spec Approval (Step 0) is still pending. Reason: if the spec review finds issues, any plan built on the flawed spec must be discarded and redone — parallelizing wastes work and risks shipping a plan that doesn't match the final spec.
|
|
54
56
|
|
|
55
57
|
---
|
|
@@ -77,6 +77,7 @@ Complexity and Autonomy Level combine to determine the effective workflow overhe
|
|
|
77
77
|
| Standard + L3-4 | Fast execution, quality gates + QA still enforced |
|
|
78
78
|
| Complex + L1 | Full ceremony (all checkpoints + QA + ADR) |
|
|
79
79
|
| Complex + L3-4 | Fast but with QA engineer + ADR |
|
|
80
|
+
| Any + L5 | Same as L4 per feature, but PM Orchestrator auto-sequences features via `start pm` |
|
|
80
81
|
|
|
81
82
|
**Note:** The user can override the autonomy level per-task. E.g., "use level 1 for this task" forces all checkpoints regardless of the project-level setting.
|
|
82
83
|
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pm-orchestrator
|
|
3
|
+
description: "PM Agent that orchestrates sequential multi-feature development. Invoke with: 'start pm', 'continue pm', 'stop pm', or 'pm status'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PM Orchestrator
|
|
7
|
+
|
|
8
|
+
Autonomously develops multiple features in sequence using the `development-workflow` skill. Requires **L5 (PM Autonomous)** autonomy level.
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
| Command | Action |
|
|
13
|
+
|---------|--------|
|
|
14
|
+
| `start pm` | Start a new autonomous session — classify batch, then loop |
|
|
15
|
+
| `continue pm` | Resume after /compact or session restart |
|
|
16
|
+
| `stop pm` | Graceful stop after current feature completes |
|
|
17
|
+
| `pm status` | Show progress summary from pm-session.md |
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
Before starting:
|
|
22
|
+
|
|
23
|
+
1. **Autonomy Level must be L5.** Read `CLAUDE.md` → verify `Autonomy Level: 5 (PM Autonomous)`. If not L5, tell the user and stop.
|
|
24
|
+
2. **Product tracker must have pending features.** Read `docs/project_notes/product-tracker.md` → Features table. If no features have step < 6/6, there is nothing to do.
|
|
25
|
+
3. **Working tree must be clean.** Run `git status`. If dirty, ask user to commit or stash.
|
|
26
|
+
4. **No active PM session.** Check if `docs/project_notes/pm-session.lock` exists. If it does, another PM session may be running — ask user before proceeding.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## `start pm` — New Autonomous Session
|
|
31
|
+
|
|
32
|
+
### Phase 1: Batch Selection
|
|
33
|
+
|
|
34
|
+
1. Read `docs/project_notes/product-tracker.md` → collect all features with step < 6/6.
|
|
35
|
+
2. **Filter out** features whose dependencies are not yet done (check the Dependencies column and verify the dependency feature has step 6/6).
|
|
36
|
+
3. **Sort** by priority (High > Medium > Low), then by feature ID ascending.
|
|
37
|
+
4. Present the first **1-3 eligible features** to the user as a rolling batch:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
PM Orchestrator — Batch Classification
|
|
41
|
+
|
|
42
|
+
These features are ready to develop:
|
|
43
|
+
|
|
44
|
+
| # | Feature | Type | Priority | Dependencies |
|
|
45
|
+
|---|---------|------|----------|--------------|
|
|
46
|
+
| 1 | F014 — Short Name | backend | High | F006 (done) |
|
|
47
|
+
| 2 | F015 — Short Name | backend | Medium | none |
|
|
48
|
+
| 3 | F016 — Short Name | fullstack | Medium | F014 |
|
|
49
|
+
|
|
50
|
+
Classify complexity for each (Simple / Standard / Complex):
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
5. Wait for user to classify all features in the batch.
|
|
54
|
+
|
|
55
|
+
### Phase 2: Session Initialization
|
|
56
|
+
|
|
57
|
+
1. Create `docs/project_notes/pm-session.lock` with content: `session started at {ISO date}`.
|
|
58
|
+
2. Create `docs/project_notes/pm-session.md` from `references/pm-session-template.md`:
|
|
59
|
+
- Fill **Started** date, **Session ID** (short random ID), **Target Branch** (from `docs/project_notes/key_facts.md` → branching strategy: github-flow → `main`, gitflow → `develop`).
|
|
60
|
+
- Fill the **Current Batch** table with classified features.
|
|
61
|
+
- Set **Status** to `in-progress`.
|
|
62
|
+
|
|
63
|
+
### Phase 3: Orchestration Loop
|
|
64
|
+
|
|
65
|
+
For each feature in the batch:
|
|
66
|
+
|
|
67
|
+
#### a. Pre-flight Checks
|
|
68
|
+
|
|
69
|
+
- **Kill switch**: If `docs/project_notes/pm-stop.md` exists → stop gracefully (go to Shutdown).
|
|
70
|
+
- **Lock**: If `docs/project_notes/pm-session.lock` is missing → stop (session was terminated externally).
|
|
71
|
+
- **Circuit breaker**: If 3 consecutive features are `blocked` → stop and report to user.
|
|
72
|
+
- **Clean workspace**: Run `git status`. If dirty, commit or stash before proceeding.
|
|
73
|
+
|
|
74
|
+
#### b. Start Feature
|
|
75
|
+
|
|
76
|
+
1. Update `pm-session.md`:
|
|
77
|
+
- Set current feature status to `in-progress`, note step 0/6.
|
|
78
|
+
- Update **Recovery Instructions**: set **Current feature**, **Branch** (once created), and current step.
|
|
79
|
+
2. **Print progress**: `[PM] Starting FXXX — Step 0: Spec`
|
|
80
|
+
3. Invoke the `development-workflow` skill:
|
|
81
|
+
- Command: `start task FXXX as [Simple|Standard|Complex]`
|
|
82
|
+
- The development-workflow reads L5 → all checkpoints auto-approve.
|
|
83
|
+
- All quality gates run as normal (tests, lint, build, validators, code review, QA).
|
|
84
|
+
- At Step 5 (Review): execute `/audit-merge` before the merge checklist evidence.
|
|
85
|
+
4. **During the feature lifecycle**, keep `pm-session.md` up to date:
|
|
86
|
+
- Update the **Notes** column with current step (e.g., "Step 3/6 — Implementation").
|
|
87
|
+
- Update **Recovery Instructions** with the current step and branch after each step transition.
|
|
88
|
+
- Print a one-liner when entering each step: `[PM] FXXX | Step N/6 | StepName`
|
|
89
|
+
- Print when a quality gate passes/fails: `[PM] FXXX | Step 4 | tests: PASS (133/133)`
|
|
90
|
+
|
|
91
|
+
#### c. Feature Completed (Step 6 done)
|
|
92
|
+
|
|
93
|
+
1. Verify `docs/project_notes/product-tracker.md` shows the feature at step 6/6 with status `done`.
|
|
94
|
+
2. **Post-merge sanity check**: Run `npm test` (or the project's test command) on the target branch.
|
|
95
|
+
- If tests **fail** → STOP immediately. The merged feature broke the target branch. Report to user.
|
|
96
|
+
- If tests **pass** → print: `[PM] FXXX | Post-merge sanity: PASS`
|
|
97
|
+
3. Update `pm-session.md`:
|
|
98
|
+
- Move the feature row from **Current Batch** to **Completed Features**.
|
|
99
|
+
- Record approximate duration in the Duration column.
|
|
100
|
+
- Clear **Recovery Instructions** current feature (or set to next feature).
|
|
101
|
+
4. Print: `[PM] FXXX | DONE (~Xmin) | Moving to next feature`
|
|
102
|
+
5. Reset consecutive failure counter to 0.
|
|
103
|
+
|
|
104
|
+
#### d. Feature Failed
|
|
105
|
+
|
|
106
|
+
If the development-workflow encounters a failure during any step:
|
|
107
|
+
|
|
108
|
+
1. The existing retry/fix loop runs (max 3 retries per step, per the `failure-handling.md` reference).
|
|
109
|
+
2. If retries exhausted:
|
|
110
|
+
- Update `pm-session.md`: set feature status to `blocked`, note the failure reason.
|
|
111
|
+
- Increment consecutive failure counter.
|
|
112
|
+
- Skip to the next feature in the batch.
|
|
113
|
+
3. If merge conflicts prevent completion:
|
|
114
|
+
- Mark as `blocked` with reason "merge conflict".
|
|
115
|
+
- Skip to next feature.
|
|
116
|
+
|
|
117
|
+
#### e. Batch Boundary
|
|
118
|
+
|
|
119
|
+
After each completed or blocked feature:
|
|
120
|
+
|
|
121
|
+
1. **Re-read** `docs/project_notes/product-tracker.md` to check for newly unblocked features (dynamic dependency resolution).
|
|
122
|
+
2. If the current batch is exhausted and more eligible features remain:
|
|
123
|
+
- Present the next 1-3 features to the user for complexity classification.
|
|
124
|
+
- Add them to the batch in `pm-session.md`.
|
|
125
|
+
3. If **3+ features completed** in this session → suggest the user run `/compact` before continuing (context may be getting heavy).
|
|
126
|
+
4. If max session limit reached (**5 features**) → stop and report.
|
|
127
|
+
|
|
128
|
+
### Phase 4: Shutdown
|
|
129
|
+
|
|
130
|
+
1. Update `pm-session.md`:
|
|
131
|
+
- Set **Status** to `completed` (if all done) or `stopped` (if interrupted).
|
|
132
|
+
- Ensure all feature statuses are up to date.
|
|
133
|
+
2. Remove `docs/project_notes/pm-session.lock`.
|
|
134
|
+
3. Remove `docs/project_notes/pm-stop.md` if it exists.
|
|
135
|
+
4. Print final report:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
PM Session Complete
|
|
139
|
+
|
|
140
|
+
| Feature | Status | Duration | Notes |
|
|
141
|
+
|---------|--------|----------|-------|
|
|
142
|
+
| F014 | done | ~8 min | Clean |
|
|
143
|
+
| F015 | done | ~12 min | 1 QA fix |
|
|
144
|
+
| F016 | blocked | — | Merge conflict |
|
|
145
|
+
|
|
146
|
+
Completed: 2/3 | Blocked: 1/3 | Remaining: 0
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## `continue pm` — Resume After /compact or Restart
|
|
152
|
+
|
|
153
|
+
1. Read `docs/project_notes/pm-session.md`. If it doesn't exist, inform user there is no active session.
|
|
154
|
+
2. **Validate session Status.** If Status is `completed` or `stopped`, inform user the session has ended. To start a new one, delete pm-session.md and run `start pm`.
|
|
155
|
+
3. **Re-create lock.** If `docs/project_notes/pm-session.lock` is missing (e.g., after terminal crash), re-create it with content: `session resumed at {ISO date}`.
|
|
156
|
+
4. Find the feature with status `in-progress`:
|
|
157
|
+
- Read its ticket file and the product tracker Active Session to determine current step.
|
|
158
|
+
- Resume the `development-workflow` from that step.
|
|
159
|
+
5. After the in-progress feature completes, re-enter the Orchestration Loop at step (e).
|
|
160
|
+
6. If no `in-progress` feature exists but `pending` features remain, pick the next one and enter step (b).
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## `stop pm` — Graceful Stop
|
|
165
|
+
|
|
166
|
+
1. Create `docs/project_notes/pm-stop.md` with content: `stop requested at {ISO date}`.
|
|
167
|
+
2. The orchestration loop will detect this file at the next pre-flight check and shut down gracefully.
|
|
168
|
+
3. The current feature will complete its current step before stopping.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## `pm status` — Progress Summary
|
|
173
|
+
|
|
174
|
+
1. Read `docs/project_notes/pm-session.md`.
|
|
175
|
+
2. Display the Current Batch table and Recovery Instructions.
|
|
176
|
+
3. If no session exists, inform the user.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Guardrails
|
|
181
|
+
|
|
182
|
+
| Guardrail | Value | Rationale |
|
|
183
|
+
|-----------|-------|-----------|
|
|
184
|
+
| Max features per session | 5 | Model attention degrades after many iterations |
|
|
185
|
+
| Consecutive failure circuit breaker | 3 | Prevent wasting resources on a systemic issue |
|
|
186
|
+
| Kill switch | `pm-stop.md` or `stop pm` | User can always halt the loop |
|
|
187
|
+
| Session lock | `pm-session.lock` | Prevents concurrent PM sessions |
|
|
188
|
+
| Quality gates | Always enforced | Tests, lint, build, validators, code review, QA, `/audit-merge` |
|
|
189
|
+
| Post-merge sanity | `npm test` on target branch | Catch regressions immediately |
|
|
190
|
+
| Rolling batch | 1-3 features | Avoid over-committing; allows dynamic re-prioritization |
|
|
191
|
+
| Clean workspace | `git status` before each feature | Prevent dirty state contamination |
|
|
192
|
+
|
|
193
|
+
## Edge Cases
|
|
194
|
+
|
|
195
|
+
1. **Feature mid-execution during /compact**: `continue pm` reads pm-session.md → finds in-progress feature → reads tracker Active Session → resumes development-workflow from that step.
|
|
196
|
+
|
|
197
|
+
2. **pm-session.md vs tracker disagreement**: Product tracker is the **source of truth**. If pm-session.md says "done" but tracker says "in-progress", trust the tracker and re-verify.
|
|
198
|
+
|
|
199
|
+
3. **User modifies tracker mid-session**: PM re-reads tracker between features (not mid-feature). Changes take effect at the next feature boundary.
|
|
200
|
+
|
|
201
|
+
4. **Branch already exists**: development-workflow Step 1 handles this — checks out existing branch and resumes.
|
|
202
|
+
|
|
203
|
+
5. **L5 selected but `start task` used directly**: development-workflow at L5 behaves exactly like L4 (all checkpoints auto). The PM loop is opt-in via `start pm`, not forced by L5.
|
|
204
|
+
|
|
205
|
+
6. **Batch classification changes**: User can `stop pm`, edit pm-session.md complexity column, then `continue pm`.
|
|
206
|
+
|
|
207
|
+
7. **Post-merge sanity check fails**: STOP immediately. The merged feature introduced a regression on the target branch. Do NOT continue — user must investigate manually.
|
|
208
|
+
|
|
209
|
+
8. **Gemini CLI limitations**: PM Orchestrator instructions are mirrored for Gemini. L5 PM Orchestrator is fully designed for Claude Code; Gemini support is best-effort.
|
|
210
|
+
|
|
211
|
+
## References
|
|
212
|
+
|
|
213
|
+
- `references/pm-session-template.md` — Template for the session state file
|
|
214
|
+
- `.claude/skills/development-workflow/SKILL.md` — The workflow invoked for each feature
|
|
215
|
+
- `docs/project_notes/product-tracker.md` — Source of truth for feature status
|
|
216
|
+
- `.claude/skills/development-workflow/references/failure-handling.md` — Retry and rollback patterns
|
|
217
|
+
|
|
218
|
+
## Constraints
|
|
219
|
+
|
|
220
|
+
- **One feature at a time.** Sequential execution only — no parallel features.
|
|
221
|
+
- **Do NOT skip quality gates.** Even at L5, tests/lint/build/validators/review/QA always execute.
|
|
222
|
+
- **Do NOT force-resolve merge conflicts.** Mark as blocked and skip.
|
|
223
|
+
- **Do NOT modify pm-session.md format.** Follow the template structure exactly.
|
|
224
|
+
- **Do NOT continue after post-merge sanity failure.** Stop and report.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# PM Autonomous Session
|
|
2
|
+
|
|
3
|
+
**Started:** {date}
|
|
4
|
+
**Session ID:** {short-id}
|
|
5
|
+
**Autonomy Level:** L5 (PM Autonomous)
|
|
6
|
+
**Status:** in-progress
|
|
7
|
+
**Target Branch:** {main|develop}
|
|
8
|
+
|
|
9
|
+
## Current Batch
|
|
10
|
+
|
|
11
|
+
| Feature | Complexity | Status | Duration | Notes |
|
|
12
|
+
|---------|------------|--------|----------|-------|
|
|
13
|
+
| F0XX | Simple | pending | — | — |
|
|
14
|
+
|
|
15
|
+
## Completed Features
|
|
16
|
+
|
|
17
|
+
_(Move features here as they complete)_
|
|
18
|
+
|
|
19
|
+
| Feature | Complexity | Duration | Notes |
|
|
20
|
+
|---------|------------|----------|-------|
|
|
21
|
+
<!-- | F0XX | Simple | ~8 min | Clean | -->
|
|
22
|
+
|
|
23
|
+
## Blocked Features
|
|
24
|
+
|
|
25
|
+
_(Move features here if blocked)_
|
|
26
|
+
|
|
27
|
+
| Feature | Reason | Step |
|
|
28
|
+
|---------|--------|------|
|
|
29
|
+
<!-- | F0XX | Merge conflict | 5/6 | -->
|
|
30
|
+
|
|
31
|
+
## Recovery Instructions
|
|
32
|
+
|
|
33
|
+
**Current feature:** (none yet)
|
|
34
|
+
**Branch:** (none yet)
|
|
35
|
+
**Next features:** (see Current Batch table)
|
|
36
|
+
**Blocked:** (none)
|
|
37
|
+
|
|
38
|
+
To resume after /compact: run `continue pm`
|
|
39
|
+
To stop gracefully: run `stop pm`
|
|
@@ -39,17 +39,19 @@ description: "Orchestrates the complete development workflow for each feature. I
|
|
|
39
39
|
|
|
40
40
|
Read the **Autonomy Level** from `GEMINI.md`.
|
|
41
41
|
|
|
42
|
-
| Checkpoint | L1 Full Control | L2 Trusted | L3 Autopilot | L4 Full Auto |
|
|
43
|
-
|
|
44
|
-
| Spec Approval (Step 0) | Required | Auto | Auto | Auto |
|
|
45
|
-
| Ticket Approval (Step 1) | Required | Auto | Auto | Auto |
|
|
46
|
-
| Plan Approval (Step 2) | Required | Required | Auto | Auto |
|
|
47
|
-
| Commit Approval (Step 4) | Required | Auto | Auto | Auto |
|
|
48
|
-
| Merge Approval (Step 5) | Required | Required | Required | Auto |
|
|
42
|
+
| Checkpoint | L1 Full Control | L2 Trusted | L3 Autopilot | L4 Full Auto | L5 PM Auto |
|
|
43
|
+
|------------|:-:|:-:|:-:|:-:|:-:|
|
|
44
|
+
| Spec Approval (Step 0) | Required | Auto | Auto | Auto | Auto |
|
|
45
|
+
| Ticket Approval (Step 1) | Required | Auto | Auto | Auto | Auto |
|
|
46
|
+
| Plan Approval (Step 2) | Required | Required | Auto | Auto | Auto |
|
|
47
|
+
| Commit Approval (Step 4) | Required | Auto | Auto | Auto | Auto |
|
|
48
|
+
| Merge Approval (Step 5) | Required | Required | Required | Auto | Auto |
|
|
49
|
+
| Next Feature (PM loop) | — | — | — | — | Auto |
|
|
49
50
|
|
|
50
51
|
- **Auto** = proceed without asking; log in product tracker → "Auto-Approved Decisions" table
|
|
51
52
|
- **Required** = ask user explicitly; do NOT continue without approval
|
|
52
53
|
- **Quality gates always run** regardless of level (tests, lint, build, validators)
|
|
54
|
+
- **L5** behaves like L4 for individual checkpoints. The `pm-orchestrator` skill handles automatic feature sequencing via `start pm`.
|
|
53
55
|
- **Steps are strictly sequential.** Do NOT start a later step before the current checkpoint is approved — even when the checkpoint is Auto (auto-approval still happens in order, not in parallel). In particular, do NOT generate the Implementation Plan (Step 2) while Spec Approval (Step 0) is still pending. Reason: if the spec review finds issues, any plan built on the flawed spec must be discarded and redone — parallelizing wastes work and risks shipping a plan that doesn't match the final spec.
|
|
54
56
|
|
|
55
57
|
---
|
|
@@ -77,6 +77,7 @@ Complexity and Autonomy Level combine to determine the effective workflow overhe
|
|
|
77
77
|
| Standard + L3-4 | Fast execution, quality gates + QA still enforced |
|
|
78
78
|
| Complex + L1 | Full ceremony (all checkpoints + QA + ADR) |
|
|
79
79
|
| Complex + L3-4 | Fast but with QA engineer + ADR |
|
|
80
|
+
| Any + L5 | Same as L4 per feature, but PM Orchestrator auto-sequences features via `start pm` |
|
|
80
81
|
|
|
81
82
|
**Note:** The user can override the autonomy level per-task. E.g., "use level 1 for this task" forces all checkpoints regardless of the project-level setting.
|
|
82
83
|
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pm-orchestrator
|
|
3
|
+
description: "PM Agent that orchestrates sequential multi-feature development. Invoke with: 'start pm', 'continue pm', 'stop pm', or 'pm status'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PM Orchestrator
|
|
7
|
+
|
|
8
|
+
Autonomously develops multiple features in sequence using the `development-workflow` skill. Requires **L5 (PM Autonomous)** autonomy level.
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
| Command | Action |
|
|
13
|
+
|---------|--------|
|
|
14
|
+
| `start pm` | Start a new autonomous session — classify batch, then loop |
|
|
15
|
+
| `continue pm` | Resume after /compact or session restart |
|
|
16
|
+
| `stop pm` | Graceful stop after current feature completes |
|
|
17
|
+
| `pm status` | Show progress summary from pm-session.md |
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
Before starting:
|
|
22
|
+
|
|
23
|
+
1. **Autonomy Level must be L5.** Read `GEMINI.md` → verify `Autonomy Level: 5 (PM Autonomous)`. If not L5, tell the user and stop.
|
|
24
|
+
2. **Product tracker must have pending features.** Read `docs/project_notes/product-tracker.md` → Features table. If no features have step < 6/6, there is nothing to do.
|
|
25
|
+
3. **Working tree must be clean.** Run `git status`. If dirty, ask user to commit or stash.
|
|
26
|
+
4. **No active PM session.** Check if `docs/project_notes/pm-session.lock` exists. If it does, another PM session may be running — ask user before proceeding.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## `start pm` — New Autonomous Session
|
|
31
|
+
|
|
32
|
+
### Phase 1: Batch Selection
|
|
33
|
+
|
|
34
|
+
1. Read `docs/project_notes/product-tracker.md` → collect all features with step < 6/6.
|
|
35
|
+
2. **Filter out** features whose dependencies are not yet done (check the Dependencies column and verify the dependency feature has step 6/6).
|
|
36
|
+
3. **Sort** by priority (High > Medium > Low), then by feature ID ascending.
|
|
37
|
+
4. Present the first **1-3 eligible features** to the user as a rolling batch:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
PM Orchestrator — Batch Classification
|
|
41
|
+
|
|
42
|
+
These features are ready to develop:
|
|
43
|
+
|
|
44
|
+
| # | Feature | Type | Priority | Dependencies |
|
|
45
|
+
|---|---------|------|----------|--------------|
|
|
46
|
+
| 1 | F014 — Short Name | backend | High | F006 (done) |
|
|
47
|
+
| 2 | F015 — Short Name | backend | Medium | none |
|
|
48
|
+
| 3 | F016 — Short Name | fullstack | Medium | F014 |
|
|
49
|
+
|
|
50
|
+
Classify complexity for each (Simple / Standard / Complex):
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
5. Wait for user to classify all features in the batch.
|
|
54
|
+
|
|
55
|
+
### Phase 2: Session Initialization
|
|
56
|
+
|
|
57
|
+
1. Create `docs/project_notes/pm-session.lock` with content: `session started at {ISO date}`.
|
|
58
|
+
2. Create `docs/project_notes/pm-session.md` from `references/pm-session-template.md`:
|
|
59
|
+
- Fill **Started** date, **Session ID** (short random ID), **Target Branch** (from `docs/project_notes/key_facts.md` → branching strategy: github-flow → `main`, gitflow → `develop`).
|
|
60
|
+
- Fill the **Current Batch** table with classified features.
|
|
61
|
+
- Set **Status** to `in-progress`.
|
|
62
|
+
|
|
63
|
+
### Phase 3: Orchestration Loop
|
|
64
|
+
|
|
65
|
+
For each feature in the batch:
|
|
66
|
+
|
|
67
|
+
#### a. Pre-flight Checks
|
|
68
|
+
|
|
69
|
+
- **Kill switch**: If `docs/project_notes/pm-stop.md` exists → stop gracefully (go to Shutdown).
|
|
70
|
+
- **Lock**: If `docs/project_notes/pm-session.lock` is missing → stop (session was terminated externally).
|
|
71
|
+
- **Circuit breaker**: If 3 consecutive features are `blocked` → stop and report to user.
|
|
72
|
+
- **Clean workspace**: Run `git status`. If dirty, commit or stash before proceeding.
|
|
73
|
+
|
|
74
|
+
#### b. Start Feature
|
|
75
|
+
|
|
76
|
+
1. Update `pm-session.md`:
|
|
77
|
+
- Set current feature status to `in-progress`, note step 0/6.
|
|
78
|
+
- Update **Recovery Instructions**: set **Current feature**, **Branch** (once created), and current step.
|
|
79
|
+
2. **Print progress**: `[PM] Starting FXXX — Step 0: Spec`
|
|
80
|
+
3. Invoke the `development-workflow` skill:
|
|
81
|
+
- Command: `start task FXXX as [Simple|Standard|Complex]`
|
|
82
|
+
- The development-workflow reads L5 → all checkpoints auto-approve.
|
|
83
|
+
- All quality gates run as normal (tests, lint, build, validators, code review, QA).
|
|
84
|
+
- At Step 5 (Review): execute `/audit-merge` before the merge checklist evidence.
|
|
85
|
+
4. **During the feature lifecycle**, keep `pm-session.md` up to date:
|
|
86
|
+
- Update the **Notes** column with current step (e.g., "Step 3/6 — Implementation").
|
|
87
|
+
- Update **Recovery Instructions** with the current step and branch after each step transition.
|
|
88
|
+
- Print a one-liner when entering each step: `[PM] FXXX | Step N/6 | StepName`
|
|
89
|
+
- Print when a quality gate passes/fails: `[PM] FXXX | Step 4 | tests: PASS (133/133)`
|
|
90
|
+
|
|
91
|
+
#### c. Feature Completed (Step 6 done)
|
|
92
|
+
|
|
93
|
+
1. Verify `docs/project_notes/product-tracker.md` shows the feature at step 6/6 with status `done`.
|
|
94
|
+
2. **Post-merge sanity check**: Run `npm test` (or the project's test command) on the target branch.
|
|
95
|
+
- If tests **fail** → STOP immediately. The merged feature broke the target branch. Report to user.
|
|
96
|
+
- If tests **pass** → print: `[PM] FXXX | Post-merge sanity: PASS`
|
|
97
|
+
3. Update `pm-session.md`:
|
|
98
|
+
- Move the feature row from **Current Batch** to **Completed Features**.
|
|
99
|
+
- Record approximate duration in the Duration column.
|
|
100
|
+
- Clear **Recovery Instructions** current feature (or set to next feature).
|
|
101
|
+
4. Print: `[PM] FXXX | DONE (~Xmin) | Moving to next feature`
|
|
102
|
+
5. Reset consecutive failure counter to 0.
|
|
103
|
+
|
|
104
|
+
#### d. Feature Failed
|
|
105
|
+
|
|
106
|
+
If the development-workflow encounters a failure during any step:
|
|
107
|
+
|
|
108
|
+
1. The existing retry/fix loop runs (max 3 retries per step, per the `failure-handling.md` reference).
|
|
109
|
+
2. If retries exhausted:
|
|
110
|
+
- Update `pm-session.md`: set feature status to `blocked`, note the failure reason.
|
|
111
|
+
- Increment consecutive failure counter.
|
|
112
|
+
- Skip to the next feature in the batch.
|
|
113
|
+
3. If merge conflicts prevent completion:
|
|
114
|
+
- Mark as `blocked` with reason "merge conflict".
|
|
115
|
+
- Skip to next feature.
|
|
116
|
+
|
|
117
|
+
#### e. Batch Boundary
|
|
118
|
+
|
|
119
|
+
After each completed or blocked feature:
|
|
120
|
+
|
|
121
|
+
1. **Re-read** `docs/project_notes/product-tracker.md` to check for newly unblocked features (dynamic dependency resolution).
|
|
122
|
+
2. If the current batch is exhausted and more eligible features remain:
|
|
123
|
+
- Present the next 1-3 features to the user for complexity classification.
|
|
124
|
+
- Add them to the batch in `pm-session.md`.
|
|
125
|
+
3. If **3+ features completed** in this session → suggest the user run `/compact` before continuing (context may be getting heavy).
|
|
126
|
+
4. If max session limit reached (**5 features**) → stop and report.
|
|
127
|
+
|
|
128
|
+
### Phase 4: Shutdown
|
|
129
|
+
|
|
130
|
+
1. Update `pm-session.md`:
|
|
131
|
+
- Set **Status** to `completed` (if all done) or `stopped` (if interrupted).
|
|
132
|
+
- Ensure all feature statuses are up to date.
|
|
133
|
+
2. Remove `docs/project_notes/pm-session.lock`.
|
|
134
|
+
3. Remove `docs/project_notes/pm-stop.md` if it exists.
|
|
135
|
+
4. Print final report:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
PM Session Complete
|
|
139
|
+
|
|
140
|
+
| Feature | Status | Duration | Notes |
|
|
141
|
+
|---------|--------|----------|-------|
|
|
142
|
+
| F014 | done | ~8 min | Clean |
|
|
143
|
+
| F015 | done | ~12 min | 1 QA fix |
|
|
144
|
+
| F016 | blocked | — | Merge conflict |
|
|
145
|
+
|
|
146
|
+
Completed: 2/3 | Blocked: 1/3 | Remaining: 0
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## `continue pm` — Resume After /compact or Restart
|
|
152
|
+
|
|
153
|
+
1. Read `docs/project_notes/pm-session.md`. If it doesn't exist, inform user there is no active session.
|
|
154
|
+
2. **Validate session Status.** If Status is `completed` or `stopped`, inform user the session has ended. To start a new one, delete pm-session.md and run `start pm`.
|
|
155
|
+
3. **Re-create lock.** If `docs/project_notes/pm-session.lock` is missing (e.g., after terminal crash), re-create it with content: `session resumed at {ISO date}`.
|
|
156
|
+
4. Find the feature with status `in-progress`:
|
|
157
|
+
- Read its ticket file and the product tracker Active Session to determine current step.
|
|
158
|
+
- Resume the `development-workflow` from that step.
|
|
159
|
+
5. After the in-progress feature completes, re-enter the Orchestration Loop at step (e).
|
|
160
|
+
6. If no `in-progress` feature exists but `pending` features remain, pick the next one and enter step (b).
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## `stop pm` — Graceful Stop
|
|
165
|
+
|
|
166
|
+
1. Create `docs/project_notes/pm-stop.md` with content: `stop requested at {ISO date}`.
|
|
167
|
+
2. The orchestration loop will detect this file at the next pre-flight check and shut down gracefully.
|
|
168
|
+
3. The current feature will complete its current step before stopping.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## `pm status` — Progress Summary
|
|
173
|
+
|
|
174
|
+
1. Read `docs/project_notes/pm-session.md`.
|
|
175
|
+
2. Display the Current Batch table and Recovery Instructions.
|
|
176
|
+
3. If no session exists, inform the user.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Guardrails
|
|
181
|
+
|
|
182
|
+
| Guardrail | Value | Rationale |
|
|
183
|
+
|-----------|-------|-----------|
|
|
184
|
+
| Max features per session | 5 | Model attention degrades after many iterations |
|
|
185
|
+
| Consecutive failure circuit breaker | 3 | Prevent wasting resources on a systemic issue |
|
|
186
|
+
| Kill switch | `pm-stop.md` or `stop pm` | User can always halt the loop |
|
|
187
|
+
| Session lock | `pm-session.lock` | Prevents concurrent PM sessions |
|
|
188
|
+
| Quality gates | Always enforced | Tests, lint, build, validators, code review, QA, `/audit-merge` |
|
|
189
|
+
| Post-merge sanity | `npm test` on target branch | Catch regressions immediately |
|
|
190
|
+
| Rolling batch | 1-3 features | Avoid over-committing; allows dynamic re-prioritization |
|
|
191
|
+
| Clean workspace | `git status` before each feature | Prevent dirty state contamination |
|
|
192
|
+
|
|
193
|
+
## Edge Cases
|
|
194
|
+
|
|
195
|
+
1. **Feature mid-execution during /compact**: `continue pm` reads pm-session.md → finds in-progress feature → reads tracker Active Session → resumes development-workflow from that step.
|
|
196
|
+
|
|
197
|
+
2. **pm-session.md vs tracker disagreement**: Product tracker is the **source of truth**. If pm-session.md says "done" but tracker says "in-progress", trust the tracker and re-verify.
|
|
198
|
+
|
|
199
|
+
3. **User modifies tracker mid-session**: PM re-reads tracker between features (not mid-feature). Changes take effect at the next feature boundary.
|
|
200
|
+
|
|
201
|
+
4. **Branch already exists**: development-workflow Step 1 handles this — checks out existing branch and resumes.
|
|
202
|
+
|
|
203
|
+
5. **L5 selected but `start task` used directly**: development-workflow at L5 behaves exactly like L4 (all checkpoints auto). The PM loop is opt-in via `start pm`, not forced by L5.
|
|
204
|
+
|
|
205
|
+
6. **Batch classification changes**: User can `stop pm`, edit pm-session.md complexity column, then `continue pm`.
|
|
206
|
+
|
|
207
|
+
7. **Post-merge sanity check fails**: STOP immediately. The merged feature introduced a regression on the target branch. Do NOT continue — user must investigate manually.
|
|
208
|
+
|
|
209
|
+
8. **Gemini CLI limitations**: PM Orchestrator instructions are mirrored for Gemini. L5 PM Orchestrator is fully designed for Claude Code; Gemini support is best-effort.
|
|
210
|
+
|
|
211
|
+
## References
|
|
212
|
+
|
|
213
|
+
- `references/pm-session-template.md` — Template for the session state file
|
|
214
|
+
- `.gemini/skills/development-workflow/SKILL.md` — The workflow invoked for each feature
|
|
215
|
+
- `docs/project_notes/product-tracker.md` — Source of truth for feature status
|
|
216
|
+
- `.gemini/skills/development-workflow/references/failure-handling.md` — Retry and rollback patterns
|
|
217
|
+
|
|
218
|
+
## Constraints
|
|
219
|
+
|
|
220
|
+
- **One feature at a time.** Sequential execution only — no parallel features.
|
|
221
|
+
- **Do NOT skip quality gates.** Even at L5, tests/lint/build/validators/review/QA always execute.
|
|
222
|
+
- **Do NOT force-resolve merge conflicts.** Mark as blocked and skip.
|
|
223
|
+
- **Do NOT modify pm-session.md format.** Follow the template structure exactly.
|
|
224
|
+
- **Do NOT continue after post-merge sanity failure.** Stop and report.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# PM Autonomous Session
|
|
2
|
+
|
|
3
|
+
**Started:** {date}
|
|
4
|
+
**Session ID:** {short-id}
|
|
5
|
+
**Autonomy Level:** L5 (PM Autonomous)
|
|
6
|
+
**Status:** in-progress
|
|
7
|
+
**Target Branch:** {main|develop}
|
|
8
|
+
|
|
9
|
+
## Current Batch
|
|
10
|
+
|
|
11
|
+
| Feature | Complexity | Status | Duration | Notes |
|
|
12
|
+
|---------|------------|--------|----------|-------|
|
|
13
|
+
| F0XX | Simple | pending | — | — |
|
|
14
|
+
|
|
15
|
+
## Completed Features
|
|
16
|
+
|
|
17
|
+
_(Move features here as they complete)_
|
|
18
|
+
|
|
19
|
+
| Feature | Complexity | Duration | Notes |
|
|
20
|
+
|---------|------------|----------|-------|
|
|
21
|
+
<!-- | F0XX | Simple | ~8 min | Clean | -->
|
|
22
|
+
|
|
23
|
+
## Blocked Features
|
|
24
|
+
|
|
25
|
+
_(Move features here if blocked)_
|
|
26
|
+
|
|
27
|
+
| Feature | Reason | Step |
|
|
28
|
+
|---------|--------|------|
|
|
29
|
+
<!-- | F0XX | Merge conflict | 5/6 | -->
|
|
30
|
+
|
|
31
|
+
## Recovery Instructions
|
|
32
|
+
|
|
33
|
+
**Current feature:** (none yet)
|
|
34
|
+
**Branch:** (none yet)
|
|
35
|
+
**Next features:** (see Current Batch table)
|
|
36
|
+
**Blocked:** (none)
|
|
37
|
+
|
|
38
|
+
To resume after /compact: run `continue pm`
|
|
39
|
+
To stop gracefully: run `stop pm`
|
package/template/AGENTS.md
CHANGED
|
@@ -59,6 +59,18 @@ The project includes pre-configured hooks in `.claude/settings.json`:
|
|
|
59
59
|
|
|
60
60
|
Personal notification hooks (macOS/Linux) are in `.claude/settings.local.json` — see that file for examples.
|
|
61
61
|
|
|
62
|
+
## Available Skills
|
|
63
|
+
|
|
64
|
+
Skills orchestrate multi-step workflows. Invoke by telling the AI assistant what you want to do.
|
|
65
|
+
|
|
66
|
+
| Skill | Invocation | Description |
|
|
67
|
+
|-------|-----------|-------------|
|
|
68
|
+
| `development-workflow` | `start task F001` | Complete feature development (6-step workflow) |
|
|
69
|
+
| `bug-workflow` | `report bug`, `fix bug` | Bug triage, investigation, and resolution |
|
|
70
|
+
| `health-check` | `health check` | Quick project health scan (tests, build, lint, etc.) |
|
|
71
|
+
| `project-memory` | `set up project memory` | Initialize/maintain docs/project_notes/ |
|
|
72
|
+
| `pm-orchestrator` | `start pm`, `continue pm` | L5: Autonomous multi-feature sequential orchestration |
|
|
73
|
+
|
|
62
74
|
## Standards References
|
|
63
75
|
|
|
64
76
|
- [Base Standards](./ai-specs/specs/base-standards.mdc) — Constitution, methodology, workflow, agents
|
package/template/CLAUDE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
## Claude-Specific Configuration
|
|
5
5
|
|
|
6
|
-
<!-- CONFIG: Set your preferred autonomy level (1-
|
|
6
|
+
<!-- CONFIG: Set your preferred autonomy level (1-5). See base-standards.mdc § Autonomy Levels for definitions. -->
|
|
7
7
|
**Autonomy Level: 2 (Trusted)**
|
|
8
8
|
|
|
9
9
|
<!-- CONFIG: Set branching strategy in docs/project_notes/key_facts.md (github-flow or gitflow) -->
|
|
@@ -18,3 +18,4 @@ After context compaction or new session — BEFORE continuing work:
|
|
|
18
18
|
4. If at Step 5 or later → read `references/merge-checklist.md` and check if the ticket's `## Merge Checklist Evidence` table needs to be filled
|
|
19
19
|
5. Do NOT proceed past any checkpoint without user confirmation (respect autonomy level)
|
|
20
20
|
6. If Active Session shows a pending checkpoint, ask before continuing
|
|
21
|
+
7. If L5 (PM Autonomous) and `docs/project_notes/pm-session.md` exists → read it and run `continue pm` to resume the PM Orchestrator session
|
package/template/GEMINI.md
CHANGED
|
@@ -4,7 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
## Gemini-Specific Configuration
|
|
6
6
|
|
|
7
|
-
<!-- CONFIG: Set your preferred autonomy level (1-
|
|
7
|
+
<!-- CONFIG: Set your preferred autonomy level (1-5). See base-standards.mdc § Autonomy Levels for definitions. -->
|
|
8
8
|
**Autonomy Level: 2 (Trusted)**
|
|
9
9
|
|
|
10
10
|
<!-- CONFIG: Set branching strategy in docs/project_notes/key_facts.md (github-flow or gitflow) -->
|
|
11
|
+
|
|
12
|
+
## Session Recovery (Gemini)
|
|
13
|
+
|
|
14
|
+
After context loss or new session — BEFORE continuing work:
|
|
15
|
+
|
|
16
|
+
1. Read product tracker (`docs/project_notes/product-tracker.md`) → **Active Session**
|
|
17
|
+
2. If active feature → read referenced ticket in `docs/tickets/`
|
|
18
|
+
3. Re-read the workflow skill (`.gemini/skills/development-workflow/SKILL.md`) to know what actions the current step requires
|
|
19
|
+
4. If at Step 5 or later → read `references/merge-checklist.md` and check if the ticket's `## Merge Checklist Evidence` table needs to be filled
|
|
20
|
+
5. Respect the autonomy level set above
|
|
21
|
+
6. If L5 (PM Autonomous) and `docs/project_notes/pm-session.md` exists → read it and run `continue pm` to resume the PM Orchestrator session
|
|
@@ -22,7 +22,7 @@ alwaysApply: true
|
|
|
22
22
|
|
|
23
23
|
These conventions adapt per-project via `<!-- CONFIG: -->` comments in `CLAUDE.md` and `key_facts.md`:
|
|
24
24
|
|
|
25
|
-
- **Autonomy Level** → `CLAUDE.md` (1-
|
|
25
|
+
- **Autonomy Level** → `CLAUDE.md` (1-5)
|
|
26
26
|
- **Tech Stack** → `backend-standards.mdc` / `frontend-standards.mdc`
|
|
27
27
|
- **Monorepo Layout** → `CLAUDE.md`
|
|
28
28
|
- **Branching Strategy** → `key_facts.md` (github-flow or gitflow)
|
|
@@ -59,18 +59,20 @@ Complex: 0 → 1 (+ADR) → 2 → 3 → 4 → 5 (+QA) → 6
|
|
|
59
59
|
|
|
60
60
|
Quality gates (tests, lint, build, validators) **always run** regardless of level.
|
|
61
61
|
|
|
62
|
-
| Checkpoint | L1 Full Control | L2 Trusted | L3 Autopilot | L4 Full Auto |
|
|
63
|
-
|
|
64
|
-
| Spec Approval | Required | Auto | Auto | Auto |
|
|
65
|
-
| Ticket Approval | Required | Auto | Auto | Auto |
|
|
66
|
-
| Plan Approval | Required | Required | Auto | Auto |
|
|
67
|
-
| Commit Approval | Required | Auto | Auto | Auto |
|
|
68
|
-
| Merge Approval | Required | Required | Required | Auto |
|
|
62
|
+
| Checkpoint | L1 Full Control | L2 Trusted | L3 Autopilot | L4 Full Auto | L5 PM Auto |
|
|
63
|
+
|------------|:-:|:-:|:-:|:-:|:-:|
|
|
64
|
+
| Spec Approval | Required | Auto | Auto | Auto | Auto |
|
|
65
|
+
| Ticket Approval | Required | Auto | Auto | Auto | Auto |
|
|
66
|
+
| Plan Approval | Required | Required | Auto | Auto | Auto |
|
|
67
|
+
| Commit Approval | Required | Auto | Auto | Auto | Auto |
|
|
68
|
+
| Merge Approval | Required | Required | Required | Auto | Auto |
|
|
69
|
+
| Next Feature | — | — | — | — | Auto |
|
|
69
70
|
|
|
70
71
|
- **L1 Full Control**: New project or learning SDD — human approves every step.
|
|
71
72
|
- **L2 Trusted**: Comfortable with SDD — AI handles routine, human reviews plans and merges.
|
|
72
73
|
- **L3 Autopilot**: Battle-tested workflow — human only reviews PRs before merge.
|
|
73
74
|
- **L4 Full Auto**: Full automation — human reviews completed features only.
|
|
75
|
+
- **L5 PM Autonomous**: PM Orchestrator runs features end-to-end sequentially. Invoke with `start pm`.
|
|
74
76
|
|
|
75
77
|
**Auto** = proceed without asking; log in product tracker → "Auto-Approved Decisions" table.
|
|
76
78
|
|
package/template/gitignore
CHANGED