maestro-flow 0.5.46 → 0.5.47
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/.agents/skills/domain-add/SKILL.md +9 -0
- package/.agents/skills/learn-decompose/SKILL.md +12 -0
- package/.agents/skills/learn-follow/SKILL.md +41 -0
- package/.agents/skills/learn-investigate/SKILL.md +14 -0
- package/.agents/skills/learn-second-opinion/SKILL.md +14 -0
- package/.agents/skills/maestro-amend/SKILL.md +11 -0
- package/.agents/skills/maestro-companion/SKILL.md +11 -0
- package/.agents/skills/maestro-composer/SKILL.md +11 -0
- package/.agents/skills/maestro-guard/SKILL.md +25 -0
- package/.agents/skills/maestro-init/SKILL.md +28 -0
- package/.agents/skills/maestro-overlay/SKILL.md +11 -0
- package/.agents/skills/maestro-player/SKILL.md +11 -0
- package/.agents/skills/maestro-quick/SKILL.md +29 -0
- package/.agents/skills/maestro-swarm-workflow/SKILL.md +25 -0
- package/.agents/skills/maestro-tools-execute/SKILL.md +29 -0
- package/.agents/skills/maestro-tools-register/SKILL.md +29 -0
- package/.agents/skills/maestro-ui-codify/SKILL.md +11 -0
- package/.agents/skills/maestro-universal-workflow/SKILL.md +59 -0
- package/.agents/skills/maestro-update/SKILL.md +38 -0
- package/.agents/skills/manage-codebase-rebuild/SKILL.md +29 -0
- package/.agents/skills/manage-drift-realign/SKILL.md +12 -0
- package/.agents/skills/manage-harvest/SKILL.md +30 -6
- package/.agents/skills/manage-issue/SKILL.md +23 -0
- package/.agents/skills/manage-issue-discover/SKILL.md +28 -0
- package/.agents/skills/manage-kg-extractors/SKILL.md +27 -1
- package/.agents/skills/manage-knowhow/SKILL.md +26 -0
- package/.agents/skills/manage-knowhow-capture/SKILL.md +24 -0
- package/.agents/skills/manage-knowledge-audit/SKILL.md +13 -0
- package/.agents/skills/manage-status/SKILL.md +22 -0
- package/.agents/skills/manage-wiki/SKILL.md +28 -0
- package/.agents/skills/odyssey-improve/SKILL.md +50 -0
- package/.agents/skills/odyssey-planex/SKILL.md +46 -0
- package/.agents/skills/odyssey-review-test-fix/SKILL.md +50 -0
- package/.agents/skills/odyssey-ui/SKILL.md +50 -0
- package/.agents/skills/quality-auto-test/SKILL.md +12 -0
- package/.agents/skills/quality-debug/SKILL.md +11 -0
- package/.agents/skills/quality-refactor/SKILL.md +11 -0
- package/.agents/skills/quality-retrospective/SKILL.md +11 -0
- package/.agents/skills/quality-review/SKILL.md +11 -0
- package/.agents/skills/quality-sync/SKILL.md +10 -0
- package/.agents/skills/quality-test/SKILL.md +12 -0
- package/.agents/skills/security-audit/SKILL.md +11 -0
- package/.agents/skills/spec-add/SKILL.md +27 -0
- package/.agents/skills/spec-load/SKILL.md +25 -0
- package/.agents/skills/spec-remove/SKILL.md +26 -0
- package/.agents/skills/spec-setup/SKILL.md +30 -0
- package/.agy/skills/domain-add/SKILL.md +9 -0
- package/.agy/skills/learn-decompose/SKILL.md +12 -0
- package/.agy/skills/learn-follow/SKILL.md +41 -0
- package/.agy/skills/learn-investigate/SKILL.md +14 -0
- package/.agy/skills/learn-second-opinion/SKILL.md +14 -0
- package/.agy/skills/maestro-amend/SKILL.md +11 -0
- package/.agy/skills/maestro-companion/SKILL.md +11 -0
- package/.agy/skills/maestro-composer/SKILL.md +11 -0
- package/.agy/skills/maestro-guard/SKILL.md +25 -0
- package/.agy/skills/maestro-init/SKILL.md +28 -0
- package/.agy/skills/maestro-overlay/SKILL.md +11 -0
- package/.agy/skills/maestro-player/SKILL.md +11 -0
- package/.agy/skills/maestro-quick/SKILL.md +29 -0
- package/.agy/skills/maestro-swarm-workflow/SKILL.md +25 -0
- package/.agy/skills/maestro-tools-execute/SKILL.md +29 -0
- package/.agy/skills/maestro-tools-register/SKILL.md +29 -0
- package/.agy/skills/maestro-ui-codify/SKILL.md +11 -0
- package/.agy/skills/maestro-universal-workflow/SKILL.md +59 -0
- package/.agy/skills/maestro-update/SKILL.md +38 -0
- package/.agy/skills/manage-codebase-rebuild/SKILL.md +29 -0
- package/.agy/skills/manage-drift-realign/SKILL.md +12 -0
- package/.agy/skills/manage-harvest/SKILL.md +30 -6
- package/.agy/skills/manage-issue/SKILL.md +23 -0
- package/.agy/skills/manage-issue-discover/SKILL.md +28 -0
- package/.agy/skills/manage-kg-extractors/SKILL.md +27 -1
- package/.agy/skills/manage-knowhow/SKILL.md +26 -0
- package/.agy/skills/manage-knowhow-capture/SKILL.md +24 -0
- package/.agy/skills/manage-knowledge-audit/SKILL.md +13 -0
- package/.agy/skills/manage-status/SKILL.md +22 -0
- package/.agy/skills/manage-wiki/SKILL.md +28 -0
- package/.agy/skills/odyssey-improve/SKILL.md +50 -0
- package/.agy/skills/odyssey-planex/SKILL.md +46 -0
- package/.agy/skills/odyssey-review-test-fix/SKILL.md +50 -0
- package/.agy/skills/odyssey-ui/SKILL.md +50 -0
- package/.agy/skills/quality-auto-test/SKILL.md +12 -0
- package/.agy/skills/quality-debug/SKILL.md +11 -0
- package/.agy/skills/quality-refactor/SKILL.md +11 -0
- package/.agy/skills/quality-retrospective/SKILL.md +11 -0
- package/.agy/skills/quality-review/SKILL.md +11 -0
- package/.agy/skills/quality-sync/SKILL.md +10 -0
- package/.agy/skills/quality-test/SKILL.md +12 -0
- package/.agy/skills/security-audit/SKILL.md +11 -0
- package/.agy/skills/spec-add/SKILL.md +27 -0
- package/.agy/skills/spec-load/SKILL.md +25 -0
- package/.agy/skills/spec-remove/SKILL.md +26 -0
- package/.agy/skills/spec-setup/SKILL.md +30 -0
- package/.claude/commands/domain-add.md +9 -0
- package/.claude/commands/learn-decompose.md +12 -0
- package/.claude/commands/learn-follow.md +41 -0
- package/.claude/commands/learn-investigate.md +14 -0
- package/.claude/commands/learn-second-opinion.md +14 -0
- package/.claude/commands/maestro-amend.md +11 -0
- package/.claude/commands/maestro-companion.md +11 -0
- package/.claude/commands/maestro-composer.md +11 -0
- package/.claude/commands/maestro-guard.md +25 -0
- package/.claude/commands/maestro-init.md +28 -0
- package/.claude/commands/maestro-overlay.md +11 -0
- package/.claude/commands/maestro-player.md +11 -0
- package/.claude/commands/maestro-quick.md +29 -0
- package/.claude/commands/maestro-swarm-workflow.md +25 -0
- package/.claude/commands/maestro-tools-execute.md +29 -0
- package/.claude/commands/maestro-tools-register.md +29 -0
- package/.claude/commands/maestro-ui-codify.md +11 -0
- package/.claude/commands/maestro-universal-workflow.md +59 -0
- package/.claude/commands/maestro-update.md +38 -0
- package/.claude/commands/manage-codebase-rebuild.md +29 -0
- package/.claude/commands/manage-drift-realign.md +12 -0
- package/.claude/commands/manage-harvest.md +30 -6
- package/.claude/commands/manage-issue-discover.md +28 -0
- package/.claude/commands/manage-issue.md +23 -0
- package/.claude/commands/manage-kg-extractors.md +27 -1
- package/.claude/commands/manage-knowhow-capture.md +24 -0
- package/.claude/commands/manage-knowhow.md +26 -0
- package/.claude/commands/manage-knowledge-audit.md +13 -0
- package/.claude/commands/manage-status.md +22 -0
- package/.claude/commands/manage-wiki.md +28 -0
- package/.claude/commands/odyssey-improve.md +50 -0
- package/.claude/commands/odyssey-planex.md +46 -0
- package/.claude/commands/odyssey-review-test-fix.md +50 -0
- package/.claude/commands/odyssey-ui.md +50 -0
- package/.claude/commands/quality-auto-test.md +12 -0
- package/.claude/commands/quality-debug.md +11 -0
- package/.claude/commands/quality-refactor.md +11 -0
- package/.claude/commands/quality-retrospective.md +11 -0
- package/.claude/commands/quality-review.md +11 -0
- package/.claude/commands/quality-sync.md +10 -0
- package/.claude/commands/quality-test.md +12 -0
- package/.claude/commands/security-audit.md +11 -0
- package/.claude/commands/spec-add.md +27 -0
- package/.claude/commands/spec-load.md +25 -0
- package/.claude/commands/spec-remove.md +26 -0
- package/.claude/commands/spec-setup.md +30 -0
- package/.codex/skills/codify-to-knowhow/SKILL.md +2 -0
- package/.codex/skills/domain-add/SKILL.md +26 -0
- package/.codex/skills/domain-discover/SKILL.md +46 -0
- package/.codex/skills/domain-list/SKILL.md +29 -0
- package/.codex/skills/learn-decompose/SKILL.md +2 -0
- package/.codex/skills/learn-follow/SKILL.md +34 -0
- package/.codex/skills/learn-investigate/SKILL.md +33 -0
- package/.codex/skills/learn-retro/SKILL.md +33 -0
- package/.codex/skills/learn-second-opinion/SKILL.md +30 -0
- package/.codex/skills/maestro-amend/SKILL.md +11 -0
- package/.codex/skills/maestro-companion/SKILL.md +11 -0
- package/.codex/skills/maestro-composer/SKILL.md +11 -0
- package/.codex/skills/maestro-guard/SKILL.md +25 -0
- package/.codex/skills/maestro-help/SKILL.md +2 -0
- package/.codex/skills/maestro-init/SKILL.md +16 -0
- package/.codex/skills/maestro-learn/SKILL.md +2 -0
- package/.codex/skills/maestro-overlay/SKILL.md +1 -0
- package/.codex/skills/maestro-player/SKILL.md +2 -0
- package/.codex/skills/maestro-quick/SKILL.md +17 -0
- package/.codex/skills/maestro-tools-execute/SKILL.md +31 -0
- package/.codex/skills/maestro-tools-register/SKILL.md +29 -0
- package/.codex/skills/maestro-ui-codify/SKILL.md +2 -0
- package/.codex/skills/maestro-update/SKILL.md +38 -0
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -0
- package/.codex/skills/manage-codebase-refresh/SKILL.md +11 -0
- package/.codex/skills/manage-drift-realign/SKILL.md +2 -0
- package/.codex/skills/manage-harvest/SKILL.md +30 -8
- package/.codex/skills/manage-issue/SKILL.md +24 -0
- package/.codex/skills/manage-issue-discover/SKILL.md +2 -0
- package/.codex/skills/manage-knowhow/SKILL.md +26 -0
- package/.codex/skills/manage-knowhow-capture/SKILL.md +23 -0
- package/.codex/skills/manage-learn/SKILL.md +2 -0
- package/.codex/skills/manage-status/SKILL.md +22 -0
- package/.codex/skills/manage-wiki/SKILL.md +28 -0
- package/.codex/skills/odyssey-debug/SKILL.md +44 -0
- package/.codex/skills/odyssey-improve/SKILL.md +49 -0
- package/.codex/skills/odyssey-planex/SKILL.md +44 -0
- package/.codex/skills/odyssey-review-test-fix/SKILL.md +48 -0
- package/.codex/skills/odyssey-ui/SKILL.md +49 -0
- package/.codex/skills/quality-auto-test/SKILL.md +2 -0
- package/.codex/skills/quality-debug/SKILL.md +2 -0
- package/.codex/skills/quality-refactor/SKILL.md +2 -0
- package/.codex/skills/quality-retrospective/SKILL.md +2 -0
- package/.codex/skills/quality-review/SKILL.md +2 -0
- package/.codex/skills/quality-sync/SKILL.md +24 -0
- package/.codex/skills/quality-test/SKILL.md +2 -0
- package/.codex/skills/security-audit/SKILL.md +30 -0
- package/.codex/skills/spec-add/SKILL.md +28 -0
- package/.codex/skills/spec-load/SKILL.md +26 -0
- package/.codex/skills/spec-map/SKILL.md +1 -0
- package/.codex/skills/spec-remove/SKILL.md +28 -0
- package/.codex/skills/spec-setup/SKILL.md +28 -0
- package/.codex/skills/wiki-connect/SKILL.md +11 -0
- package/.codex/skills/wiki-digest/SKILL.md +11 -0
- package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js +3 -1
- package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +5 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +25 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +4 -0
- package/dashboard/dist-server/src/graph/kg/db/queries.js +35 -19
- package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +19 -11
- package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
- package/dist/src/agents/api-explore/config.d.ts +11 -1
- package/dist/src/agents/api-explore/config.d.ts.map +1 -1
- package/dist/src/agents/api-explore/config.js +17 -16
- package/dist/src/agents/api-explore/config.js.map +1 -1
- package/dist/src/agents/api-explore/index.js +4 -4
- package/dist/src/agents/api-explore/index.js.map +1 -1
- package/dist/src/agents/api-explore/llm.d.ts +2 -0
- package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
- package/dist/src/agents/api-explore/llm.js +16 -4
- package/dist/src/agents/api-explore/llm.js.map +1 -1
- package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
- package/dist/src/agents/api-explore/runner.js +16 -12
- package/dist/src/agents/api-explore/runner.js.map +1 -1
- package/dist/src/commands/explore.d.ts.map +1 -1
- package/dist/src/commands/explore.js +19 -2
- package/dist/src/commands/explore.js.map +1 -1
- package/dist/src/commands/install.js +7 -28
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/moa.d.ts.map +1 -1
- package/dist/src/commands/moa.js +17 -2
- package/dist/src/commands/moa.js.map +1 -1
- package/dist/src/commands/search.d.ts.map +1 -1
- package/dist/src/commands/search.js +2 -0
- package/dist/src/commands/search.js.map +1 -1
- package/dist/src/graph/kg/db/queries.d.ts +4 -0
- package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
- package/dist/src/graph/kg/db/queries.js +35 -19
- package/dist/src/graph/kg/db/queries.js.map +1 -1
- package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
- package/dist/src/graph/kg/extraction/orchestrator.js +19 -11
- package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
- package/dist/src/hooks/plugins/explore-plugin.d.ts.map +1 -1
- package/dist/src/hooks/plugins/explore-plugin.js +3 -2
- package/dist/src/hooks/plugins/explore-plugin.js.map +1 -1
- package/package.json +1 -1
|
@@ -56,8 +56,19 @@ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
|
|
|
56
56
|
- Role knowledge: `maestro search --category review` → select relevant → `maestro load --type knowhow --id`
|
|
57
57
|
|
|
58
58
|
**Output**: `REVIEW_DIR = .workflow/scratch/{YYYYMMDD}-review-P{N}-{slug}/` (P{N} = phase number, enables directory-level identification as state.json fallback)
|
|
59
|
+
|
|
60
|
+
**Output boundary**: ALL file writes MUST target `REVIEW_DIR` or `.workflow/state.json` only. NEVER modify source code, execution artifacts, or files outside these paths.
|
|
59
61
|
</context>
|
|
60
62
|
|
|
63
|
+
<invariants>
|
|
64
|
+
1. **Review is read-only on source** — NEVER modify source code, test files, or execution artifacts. Review produces reports only.
|
|
65
|
+
2. **Findings require evidence** — every finding MUST reference file:line and include a code snippet or concrete description. No vague or unanchored findings.
|
|
66
|
+
3. **Verdict is data-driven** — NEVER change verdict severity to accommodate user preference without new evidence. Verdicts flow from findings, not negotiation.
|
|
67
|
+
4. **Dimension independence** — each review dimension produces findings independently. One dimension's results MUST NOT suppress or override another's.
|
|
68
|
+
5. **Prior review delta** — when a prior review.json exists for the same phase, findings MUST be compared. Do NOT re-report already-resolved findings as new.
|
|
69
|
+
6. **Spec conflict integrity** — if code contradicts a spec entry, flag via `maestro spec conflict mark`. NEVER silently accept the contradiction or edit the spec inline.
|
|
70
|
+
</invariants>
|
|
71
|
+
|
|
61
72
|
<execution>
|
|
62
73
|
Follow '~/.maestro/workflows/review.md' completely.
|
|
63
74
|
|
|
@@ -27,8 +27,18 @@ $ARGUMENTS -- optional flags:
|
|
|
27
27
|
- `--full` -- Complete resync of all tracked files (ignores git diff, rebuilds all docs)
|
|
28
28
|
- `--since <commit|HEAD~N>` -- Diff since specific commit (default: last sync timestamp)
|
|
29
29
|
- `--dry-run` -- Show what would be updated without writing changes
|
|
30
|
+
|
|
31
|
+
**Output boundary**: ALL file writes MUST target `.workflow/codebase/`, `.workflow/state.json`, or `doc-index.json` only. NEVER modify source code or files outside `.workflow/`. `--dry-run` MUST suppress all writes.
|
|
30
32
|
</context>
|
|
31
33
|
|
|
34
|
+
<invariants>
|
|
35
|
+
1. **Source code is read-only** — sync reads source files to generate documentation. NEVER modify source code, test files, or any non-documentation files.
|
|
36
|
+
2. **Dry-run is side-effect-free** — when `--dry-run` is set, NO file writes occur. Report only what would change.
|
|
37
|
+
3. **Impact trace before refresh** — NEVER regenerate a doc file without first tracing which source changes affect it via doc-index.json. Untargeted full-refresh requires explicit `--full` flag.
|
|
38
|
+
4. **Idempotent sync** — running sync twice with the same diff MUST produce identical results. State.json timestamp prevents redundant re-runs.
|
|
39
|
+
5. **Incremental by default** — without `--full`, only changed components are refreshed. NEVER silently expand to a full rebuild.
|
|
40
|
+
</invariants>
|
|
41
|
+
|
|
32
42
|
<execution>
|
|
33
43
|
Follow '~/.maestro/workflows/sync.md' completely.
|
|
34
44
|
|
|
@@ -26,8 +26,20 @@ UAT-style conversational testing for a completed phase. Interactive scenario wal
|
|
|
26
26
|
Phase or task: $ARGUMENTS (optional)
|
|
27
27
|
|
|
28
28
|
Flags, artifact context resolution, and output directory format defined in workflow test.md.
|
|
29
|
+
|
|
30
|
+
**Output boundary**: ALL file writes MUST target `.workflow/scratch/{YYYYMMDD}-test-P{N}-{slug}/`, `.workflow/state.json`, or `.workflow/issues.jsonl` only. NEVER modify source code or execution artifacts outside these paths. `--frontend-verify` additionally writes `e2e-results.json` to the same scratch directory.
|
|
29
31
|
</context>
|
|
30
32
|
|
|
33
|
+
<invariants>
|
|
34
|
+
1. **UAT is observational** — test execution observes behavior and records results. NEVER modify source code during testing. Source fixes belong to debug→plan→execute cycle.
|
|
35
|
+
2. **Severity is inferred, not asked** — severity MUST be inferred from user's natural language description of issues. NEVER explicitly ask the user to assign severity levels.
|
|
36
|
+
3. **One scenario at a time** — tests MUST be presented individually for user verification. NEVER batch-present multiple scenarios or assume outcomes.
|
|
37
|
+
4. **Evidence before verdict** — UAT confidence MUST be scored with the 4-dimension factor model from actual test results. NEVER emit a verdict without running the readiness gate.
|
|
38
|
+
5. **Existing UAT is resumable** — when uat.md exists for the target phase, offer resume. NEVER silently overwrite prior test progress.
|
|
39
|
+
6. **Frontend-verify is deterministic** — `--frontend-verify` mode uses browser assertions with concrete pass/fail per criterion. NEVER treat "no response" or timeout as pass.
|
|
40
|
+
7. **Auto-fix has bounds** — `--auto-fix` gap-fix loop MUST NOT exceed 2 iterations. Persistent failures escalate to debug, not infinite retry.
|
|
41
|
+
</invariants>
|
|
42
|
+
|
|
31
43
|
<execution>
|
|
32
44
|
**Mode select:** `--frontend-verify` → 走下方 **Frontend Verify Mode**(确定性浏览器 smoke,**不是**对话式 UAT);否则 Follow '~/.maestro/workflows/test.md' completely.
|
|
33
45
|
|
|
@@ -34,8 +34,19 @@ $ARGUMENTS — Parse tier and scope:
|
|
|
34
34
|
| quick | ✓ | ✓ | — | — | — | — |
|
|
35
35
|
| standard | ✓ | ✓ | ✓ | ✓ | — | — |
|
|
36
36
|
| deep | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
37
|
+
|
|
38
|
+
**Output boundary**: ALL file writes MUST target `.workflow/scratch/{YYYYMMDD}-security-audit-{tier}-{slug}/` or `.workflow/state.json` only. NEVER modify source code, configuration files, or dependencies. Audit is read-only analysis.
|
|
37
39
|
</context>
|
|
38
40
|
|
|
41
|
+
<invariants>
|
|
42
|
+
1. **Audit is read-only** — NEVER modify source code, configuration, dependencies, or CI/CD files during audit. Security audit produces reports only.
|
|
43
|
+
2. **Findings require file:line evidence** — every finding MUST reference a specific file:line location and include the vulnerable code pattern. No vague or category-only findings.
|
|
44
|
+
3. **Severity NEVER downgraded without justification** — if a finding matches a known OWASP category, its severity follows OWASP guidance. Downgrading requires documented rationale (e.g., compensating control exists).
|
|
45
|
+
4. **Tier coverage is mandatory** — all scan phases required by the selected tier MUST complete. NEVER skip a tier-required phase silently; failures are logged as W00x warnings.
|
|
46
|
+
5. **False positive marking requires evidence** — marking a finding as false positive MUST include the compensating control or code path that prevents exploitation. NEVER dismiss findings without counter-evidence.
|
|
47
|
+
6. **Secrets are never logged** — if secrets are discovered, report their location (file:line) and type but NEVER include the actual secret value in the report output.
|
|
48
|
+
</invariants>
|
|
49
|
+
|
|
39
50
|
<execution>
|
|
40
51
|
|
|
41
52
|
### Phase Gates (MANDATORY, BLOCKING)
|
|
@@ -43,9 +43,36 @@ Scope-to-directory mapping, category-to-file mapping, and entry format defined i
|
|
|
43
43
|
```
|
|
44
44
|
</context>
|
|
45
45
|
|
|
46
|
+
<invariants>
|
|
47
|
+
1. **Idempotent append** — duplicate entry ID MUST be rejected (E003-level check on title + category match before write)
|
|
48
|
+
2. **Category validation** — category MUST be one of: coding, arch, quality, debug, test, review, learning, ui. Invalid category → E003
|
|
49
|
+
3. **Scope isolation** — writes target ONLY the scope-resolved directory; project scope NEVER writes to global (~/.maestro/specs/), global scope NEVER writes to project (.workflow/specs/)
|
|
50
|
+
4. **Confirmation gate** — MUST ask_question before appending entry (unless -y flag); NEVER write without user confirmation in interactive mode
|
|
51
|
+
5. **Entry format invariance** — all entries MUST use `<spec-entry>` closed-tag format with id, keywords, and category attributes
|
|
52
|
+
6. **Output boundary** — ALL file writes MUST target the scope-resolved specs directory (.workflow/specs/, ~/.maestro/specs/, .workflow/collab/specs/, or .workflow/collab/{uid}/specs/) and optionally .workflow/knowhow/ for --ref mode. NEVER modify source code or files outside these paths
|
|
53
|
+
</invariants>
|
|
54
|
+
|
|
46
55
|
<execution>
|
|
47
56
|
Follow '~/.maestro/workflows/specs-add.md' completely.
|
|
48
57
|
|
|
58
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
59
|
+
|
|
60
|
+
**GATE 1: Parse → Validate**
|
|
61
|
+
- REQUIRED: Category and content both parsed from arguments.
|
|
62
|
+
- REQUIRED: Category is a valid value (coding, arch, quality, debug, test, review, learning, ui).
|
|
63
|
+
- REQUIRED: Scope resolved to a valid directory path.
|
|
64
|
+
- BLOCKED if: E001 (missing args), E003 (invalid category), E004 (invalid scope), E005 (personal scope without uid).
|
|
65
|
+
|
|
66
|
+
**GATE 2: Validate → Format**
|
|
67
|
+
- REQUIRED: Specs directory exists for the resolved scope.
|
|
68
|
+
- REQUIRED: No duplicate entry with identical title + category already present in target file.
|
|
69
|
+
- BLOCKED if: E002 (specs not initialized).
|
|
70
|
+
|
|
71
|
+
**GATE 3: Format → Write**
|
|
72
|
+
- REQUIRED: `<spec-entry>` block formatted with id, keywords, category attributes.
|
|
73
|
+
- REQUIRED: User confirmation via ask_question (unless -y flag).
|
|
74
|
+
- BLOCKED if: user declines confirmation — abort without writing.
|
|
75
|
+
|
|
49
76
|
**Confirmation gate**: Unless -y flag is passed, after formatting the `<spec-entry>` block but before appending to the target file, ask_question showing the formatted entry, target file path, and scope. Proceed only on user confirm.
|
|
50
77
|
</execution>
|
|
51
78
|
|
|
@@ -56,8 +56,33 @@ When loading entries with `ref` attribute, only the summary is shown with a load
|
|
|
56
56
|
Use the load command to read the full referenced document.
|
|
57
57
|
</context>
|
|
58
58
|
|
|
59
|
+
<invariants>
|
|
60
|
+
1. **Read-only** — NEVER modify, create, or delete any spec files during load. This command is purely a read operation
|
|
61
|
+
2. **Output to context only** — loaded specs are injected into the conversation context; NEVER write loaded content to new files or modify existing files
|
|
62
|
+
3. **Scope layering** — global scope MUST merge both ~/.maestro/specs/ and .workflow/specs/; project scope loads .workflow/specs/ only; team adds .workflow/collab/specs/; personal adds .workflow/collab/{uid}/specs/
|
|
63
|
+
4. **Category primary doc** — when --category is specified, the primary category doc MUST be loaded in full before cross-file matching
|
|
64
|
+
5. **Entry-level filtering** — --keyword filtering operates at `<spec-entry>` level via keywords attribute, NOT at file level; unmatched entries in a matching file are excluded
|
|
65
|
+
6. **Output boundary** — this command produces NO file writes. All output is conversation-context injection only
|
|
66
|
+
</invariants>
|
|
67
|
+
|
|
59
68
|
<execution>
|
|
60
69
|
Follow '~/.maestro/workflows/specs-load.md' completely.
|
|
70
|
+
|
|
71
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
72
|
+
|
|
73
|
+
**GATE 1: Parse → Discover**
|
|
74
|
+
- REQUIRED: Arguments parsed — at least one of --category or --keyword is provided, or empty args triggers full load.
|
|
75
|
+
- REQUIRED: Scope resolved (default: global+project merged).
|
|
76
|
+
- BLOCKED if: invalid scope value or invalid category value.
|
|
77
|
+
|
|
78
|
+
**GATE 2: Discover → Load**
|
|
79
|
+
- REQUIRED: At least one spec directory exists in the resolved scope chain.
|
|
80
|
+
- BLOCKED if: E001 — .workflow/specs/ not initialized AND no global specs available. Warn and abort.
|
|
81
|
+
|
|
82
|
+
**GATE 3: Load → Display**
|
|
83
|
+
- REQUIRED: Spec files read and entries parsed.
|
|
84
|
+
- REQUIRED: Keyword filtering applied if --keyword was provided.
|
|
85
|
+
- BLOCKED if: no readable spec files found in any scope layer.
|
|
61
86
|
</execution>
|
|
62
87
|
|
|
63
88
|
<error_codes>
|
|
@@ -30,8 +30,34 @@ $ARGUMENTS -- expects `<entry-id>` (e.g., `spec-learnings-003`, `spec-coding-con
|
|
|
30
30
|
- `--cascade` — When the target spec is a ref-type entry (created via `spec-add --ref` and linked to a knowhow document), also delete the referenced knowhow file. Without this flag, ref-type removal leaves an orphan knowhow file.
|
|
31
31
|
</context>
|
|
32
32
|
|
|
33
|
+
<invariants>
|
|
34
|
+
1. **Confirmation required** — MUST ask_question before deletion (unless -y flag); NEVER remove entries silently
|
|
35
|
+
2. **Referential integrity** — before removing, check if other spec entries reference the target entry; warn user if references exist
|
|
36
|
+
3. **Cascade explicit** — ref-type entries MUST NOT cascade-delete the linked knowhow file unless --cascade is explicitly passed; default leaves orphan knowhow intact
|
|
37
|
+
4. **Atomic removal** — use `maestro wiki remove-entry` for atomic operation; NEVER manually edit spec files to remove entries
|
|
38
|
+
5. **Index consistency** — wiki index MUST be auto-updated after removal; stale index entries are a hard failure
|
|
39
|
+
6. **Output boundary** — file modifications MUST target ONLY the spec container file (.workflow/specs/*.md) and optionally the referenced knowhow file (.workflow/knowhow/*) when --cascade is used. NEVER modify source code or files outside these paths
|
|
40
|
+
</invariants>
|
|
41
|
+
|
|
33
42
|
<execution>
|
|
34
43
|
Follow '~/.maestro/workflows/specs-remove.md' completely.
|
|
44
|
+
|
|
45
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
46
|
+
|
|
47
|
+
**GATE 1: Parse → Lookup**
|
|
48
|
+
- REQUIRED: Entry ID parsed from arguments.
|
|
49
|
+
- BLOCKED if: E001 — no entry ID provided.
|
|
50
|
+
|
|
51
|
+
**GATE 2: Lookup → Confirm**
|
|
52
|
+
- REQUIRED: .workflow/specs/ directory exists.
|
|
53
|
+
- REQUIRED: Entry found in wiki index as a spec sub-node.
|
|
54
|
+
- REQUIRED: Entry content loaded for user preview.
|
|
55
|
+
- BLOCKED if: E002 (specs not initialized), E003 (entry not found), E004 (wrong type).
|
|
56
|
+
|
|
57
|
+
**GATE 3: Confirm → Remove**
|
|
58
|
+
- REQUIRED: User confirmed removal via ask_question (unless -y flag).
|
|
59
|
+
- REQUIRED: If --cascade and entry has ref attribute, user additionally confirmed knowhow file deletion.
|
|
60
|
+
- BLOCKED if: user declines — abort without modification.
|
|
35
61
|
</execution>
|
|
36
62
|
|
|
37
63
|
<error_codes>
|
|
@@ -25,9 +25,39 @@ $ARGUMENTS (no arguments expected)
|
|
|
25
25
|
- Project must contain source files to scan # (see code: E002)
|
|
26
26
|
</context>
|
|
27
27
|
|
|
28
|
+
<invariants>
|
|
29
|
+
1. **Non-destructive** — NEVER overwrite existing spec files; if a file already exists, skip it and report as already-initialized
|
|
30
|
+
2. **Idempotent** — safe to re-run on an initialized project; re-running MUST NOT duplicate entries or corrupt existing content
|
|
31
|
+
3. **Confirmation gate** — MUST ask_question showing all files to be created before writing; NEVER write without user confirmation
|
|
32
|
+
4. **Output boundary** — ALL file writes MUST target .workflow/specs/ (spec files) and .workflow/knowhow/ (recipe knowhow) only. NEVER modify source code, .workflow/state.json, or files outside these paths
|
|
33
|
+
5. **Core files mandatory** — coding-conventions.md, architecture-constraints.md, and learnings.md MUST always be created (unless they already exist)
|
|
34
|
+
6. **Signal-driven optionals** — optional spec files (quality-rules.md, test-conventions.md, ui-conventions.md) MUST only be created when corresponding framework/tool signals are detected in the codebase; NEVER create optional files without evidence
|
|
35
|
+
</invariants>
|
|
36
|
+
|
|
28
37
|
<execution>
|
|
29
38
|
Follow '~/.maestro/workflows/specs-setup.md' completely.
|
|
30
39
|
|
|
40
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
41
|
+
|
|
42
|
+
**GATE 1: Precondition → Scan**
|
|
43
|
+
- REQUIRED: .workflow/ directory exists.
|
|
44
|
+
- REQUIRED: Project contains source files to scan.
|
|
45
|
+
- BLOCKED if: E001 (.workflow/ not initialized), E002 (no source files).
|
|
46
|
+
|
|
47
|
+
**GATE 2: Scan → Plan**
|
|
48
|
+
- REQUIRED: Codebase scan completed — framework, language, and tooling signals collected.
|
|
49
|
+
- REQUIRED: Core spec file list determined (always 3: coding-conventions, architecture-constraints, learnings).
|
|
50
|
+
- REQUIRED: Optional spec files determined by detected signals only.
|
|
51
|
+
|
|
52
|
+
**GATE 3: Plan → Write**
|
|
53
|
+
- REQUIRED: User confirmed the full list of files to create via ask_question (showing core specs, optional specs, recipe knowhow, and detected signals).
|
|
54
|
+
- BLOCKED if: user declines — abort without writing.
|
|
55
|
+
|
|
56
|
+
**GATE 4: Write → Report**
|
|
57
|
+
- REQUIRED: All confirmed files written to .workflow/specs/ and .workflow/knowhow/.
|
|
58
|
+
- REQUIRED: Existing files skipped (not overwritten).
|
|
59
|
+
- REQUIRED: .proposed.md files created when slug collision detected (W003).
|
|
60
|
+
|
|
31
61
|
**Confirmation gate**: After scanning codebase and determining which files/directories will be created (core specs, optional specs, recipe knowhow), ask_question showing the full list of files to create with their categories and detected signals. Proceed only on user confirm.
|
|
32
62
|
</execution>
|
|
33
63
|
|
|
@@ -37,6 +37,15 @@ Domain term lifecycle: discover/manual → register → active → (optional) de
|
|
|
37
37
|
- `maestro domain deprecate <canonical> --successor <new>` — deprecate a term
|
|
38
38
|
</context>
|
|
39
39
|
|
|
40
|
+
<invariants>
|
|
41
|
+
1. **Single-term atomic operation** — each invocation registers exactly ONE term; NEVER batch-write multiple terms in a single execution
|
|
42
|
+
2. **Glossary append-only** — existing terms in `glossary.yaml` SHALL NOT be modified or removed; only new entries are appended
|
|
43
|
+
3. **Duplicate guard** — MUST check for exact canonical name match AND near-matches before writing; NEVER create duplicate entries
|
|
44
|
+
4. **Confirmation mandatory** — MUST present term details (canonical, definition, aliases, tier, path) via AskUserQuestion before any glossary write; NEVER write without user confirmation
|
|
45
|
+
5. **Schema compliance** — every term entry MUST include canonical name, definition, tier, and at least one alias/keyword; incomplete entries SHALL NOT be persisted
|
|
46
|
+
6. **Domain directory prerequisite** — `.workflow/domain/` MUST exist before writing; NEVER auto-create the directory (E002 if missing)
|
|
47
|
+
</invariants>
|
|
48
|
+
|
|
40
49
|
<execution>
|
|
41
50
|
Follow '~/.maestro/workflows/domain-add.md' completely.
|
|
42
51
|
|
|
@@ -28,8 +28,19 @@ $ARGUMENTS — target path/module and optional flags.
|
|
|
28
28
|
|
|
29
29
|
**Storage read**: target files + `coding-conventions.md` + `.workflow/specs/learnings.md` (dedup)
|
|
30
30
|
**Storage write**: `.workflow/knowhow/KNW-decompose-{slug}-{date}.md` + append `.workflow/specs/learnings.md`
|
|
31
|
+
|
|
32
|
+
**Output boundary**: ALL file writes MUST target `.workflow/knowhow/KNW-decompose-{slug}-{date}.md` and `.workflow/specs/learnings.md` only. NEVER modify source code or files outside these paths.
|
|
31
33
|
</context>
|
|
32
34
|
|
|
35
|
+
<invariants>
|
|
36
|
+
1. **Read-only analysis** — NEVER modify source code files under analysis; all writes go to `.workflow/` only
|
|
37
|
+
2. **Evidence-anchored findings** — every pattern MUST include at least one `file:line` anchor from source; unanchored patterns SHALL NOT be persisted
|
|
38
|
+
3. **Dedup before persist** — MUST cross-reference against existing `learnings.md` and `coding-conventions.md` before writing; duplicate entries SHALL NOT be appended
|
|
39
|
+
4. **Parallel agent isolation** — each dimension agent operates independently; NEVER share state between agents during analysis
|
|
40
|
+
5. **Confirmation gate** — unless `-y` is set, MUST present all findings and target files via AskUserQuestion before any writes
|
|
41
|
+
6. **Append-only learnings** — `.workflow/specs/learnings.md` MUST be appended, NEVER overwritten or truncated
|
|
42
|
+
</invariants>
|
|
43
|
+
|
|
33
44
|
<state_machine>
|
|
34
45
|
|
|
35
46
|
<states>
|
|
@@ -100,6 +111,7 @@ Flag contradictions (finding conflicts with documented convention). Merge duplic
|
|
|
100
111
|
<error_codes>
|
|
101
112
|
| Code | Condition | Recovery |
|
|
102
113
|
|------|-----------|----------|
|
|
114
|
+
| E001 | No target path/module provided | Prompt user for target |
|
|
103
115
|
| E002 | No source files in target | Check target has .ts/.js files |
|
|
104
116
|
| W001 | One+ dimension agent failed | Proceed with available dimensions |
|
|
105
117
|
| W002 | .workflow/specs/learnings.md missing or malformed | Treat all patterns as new; create file on persist |
|
|
@@ -33,8 +33,46 @@ $ARGUMENTS — target and optional flags.
|
|
|
33
33
|
|
|
34
34
|
**Storage read**: target file + wiki forward/backlinks + `coding-conventions.md` + `.workflow/specs/learnings.md` (dedup)
|
|
35
35
|
**Storage write**: `.workflow/knowhow/KNW-follow-{slug}-{date}.md` + append `.workflow/specs/learnings.md`
|
|
36
|
+
|
|
37
|
+
**Output boundary**: ALL file writes MUST target `.workflow/knowhow/KNW-follow-{slug}-{date}.md` and `.workflow/specs/learnings.md` only. NEVER modify source code or files outside these paths.
|
|
36
38
|
</context>
|
|
37
39
|
|
|
40
|
+
<invariants>
|
|
41
|
+
1. **Read-only traversal** — NEVER modify source code or wiki entries under analysis; all writes go to `.workflow/` only
|
|
42
|
+
2. **Forcing questions mandatory** — each section MUST have all 4 forcing questions applied; NEVER skip questions even for trivial sections
|
|
43
|
+
3. **Anchor requirement** — every extracted pattern MUST include a `file:line` anchor; unanchored patterns SHALL NOT be persisted to learnings.md
|
|
44
|
+
4. **Convention cross-ref** — MUST check every finding against `coding-conventions.md` and mark status (documented/candidate); NEVER persist without status tag
|
|
45
|
+
5. **Append-only learnings** — `.workflow/specs/learnings.md` MUST be appended, NEVER overwritten or truncated
|
|
46
|
+
6. **Confirmation gate** — unless `-y` is set, MUST present findings and target files via AskUserQuestion before any writes
|
|
47
|
+
7. **Depth contract** — `--depth shallow` MUST NOT descend into function bodies; `--depth deep` MUST cover every branch and sub-expression
|
|
48
|
+
</invariants>
|
|
49
|
+
|
|
50
|
+
<execution>
|
|
51
|
+
|
|
52
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
53
|
+
|
|
54
|
+
**GATE 1: Resolve → Context Building** (S_RESOLVE → S_CONTEXT)
|
|
55
|
+
- REQUIRED: Target resolved to a readable source (file path, wiki entry, or search result).
|
|
56
|
+
- BLOCKED if: target unresolvable after user prompt (E001/E002).
|
|
57
|
+
|
|
58
|
+
**GATE 2: Reading → Extraction** (S_READ → S_EXTRACT)
|
|
59
|
+
- REQUIRED: All sections traversed with 4 forcing questions applied per section.
|
|
60
|
+
- REQUIRED: Depth contract honored — shallow stays at top-level, deep covers every branch.
|
|
61
|
+
- BLOCKED if: any section skipped without forcing questions.
|
|
62
|
+
|
|
63
|
+
**GATE 3: Extraction → Persistence** (S_EXTRACT → S_PERSIST)
|
|
64
|
+
- REQUIRED: All extracted patterns have file:line anchors.
|
|
65
|
+
- REQUIRED: Convention cross-ref completed against coding-conventions.md (or marked "unknown status" if W002).
|
|
66
|
+
- BLOCKED if: unanchored patterns remain in extraction results.
|
|
67
|
+
|
|
68
|
+
**GATE 4: Persistence → Completion** (S_PERSIST → END)
|
|
69
|
+
- REQUIRED: Unless `-y`, AskUserQuestion showing files to write and spec-entries to append — user must confirm.
|
|
70
|
+
- REQUIRED: KNW-follow-{slug}-{date}.md written with understanding map.
|
|
71
|
+
- REQUIRED: learnings.md appended (not overwritten) with new spec-entry blocks.
|
|
72
|
+
- BLOCKED if: user declines confirmation — offer to adjust findings before retry.
|
|
73
|
+
|
|
74
|
+
</execution>
|
|
75
|
+
|
|
38
76
|
<state_machine>
|
|
39
77
|
|
|
40
78
|
<states>
|
|
@@ -112,6 +150,9 @@ Write understanding map: Key Concepts, Patterns (table: name/location/convention
|
|
|
112
150
|
<error_codes>
|
|
113
151
|
| Code | Condition | Recovery |
|
|
114
152
|
|------|-----------|----------|
|
|
153
|
+
| E001 | No target path/wiki-id/topic provided | Prompt user for target |
|
|
154
|
+
| E002 | Target path not found and wiki/grep search returned no results | Check path or broaden search terms |
|
|
155
|
+
| W001 | Wiki forward/backlinks unavailable | Proceed without context web; note reduced coverage |
|
|
115
156
|
| W002 | coding-conventions.md not found | All patterns marked "unknown status" |
|
|
116
157
|
| W003 | Target > 1000 lines | Auto-switch to shallow; use --depth deep to override |
|
|
117
158
|
</error_codes>
|
|
@@ -31,8 +31,20 @@ $ARGUMENTS — question text and optional flags.
|
|
|
31
31
|
- `.workflow/specs/learnings.md` — appended `<spec-entry>` blocks
|
|
32
32
|
|
|
33
33
|
**Storage read**: source files in scope + `maestro search` + `.workflow/specs/learnings.md` + `debug-notes.md` + `codebase/architecture.md`
|
|
34
|
+
|
|
35
|
+
**Output boundary**: ALL file writes MUST target `.workflow/knowhow/KNW-investigate-{slug}/` and `.workflow/specs/learnings.md` only. NEVER modify source code or files outside these paths.
|
|
34
36
|
</context>
|
|
35
37
|
|
|
38
|
+
<invariants>
|
|
39
|
+
1. **Read-only investigation** — NEVER modify source code files; all writes go to `.workflow/` only
|
|
40
|
+
2. **Evidence append-only** — `evidence.ndjson` MUST be appended line-by-line; NEVER overwrite or truncate existing evidence entries
|
|
41
|
+
3. **Scope lock** — once `--scope` is resolved in S_FRAME, NEVER expand search scope without explicit user confirmation via S_ESCALATE
|
|
42
|
+
4. **Hypothesis cap** — MUST NOT generate more than `--max-hypotheses` (default 3) before triggering escalation; NEVER silently exceed the cap
|
|
43
|
+
5. **Structured evidence format** — every evidence entry MUST include `{ts, type, source, relevance, content, note}`; incomplete entries SHALL NOT be appended
|
|
44
|
+
6. **3-strike escalation** — after all hypotheses fail, MUST escalate to user via AskUserQuestion; NEVER silently conclude as INCONCLUSIVE without user interaction
|
|
45
|
+
7. **Confirmation gate** — unless `-y` is set, MUST present report.md path and spec-entries via AskUserQuestion before final writes
|
|
46
|
+
</invariants>
|
|
47
|
+
|
|
36
48
|
<state_machine>
|
|
37
49
|
|
|
38
50
|
<states>
|
|
@@ -134,7 +146,9 @@ Append to .workflow/specs/learnings.md: confirmed → roles="implement", disprov
|
|
|
134
146
|
<error_codes>
|
|
135
147
|
| Code | Condition | Recovery |
|
|
136
148
|
|------|-----------|----------|
|
|
149
|
+
| E001 | No question text provided | Prompt user for investigation question |
|
|
137
150
|
| E002 | --scope path not found | Check path |
|
|
151
|
+
| W001 | Prior knowledge search returned no results | Proceed without prior context; note cold-start |
|
|
138
152
|
| W002 | Very few evidence matches (<3) | Broaden search terms or expand scope |
|
|
139
153
|
| W003 | All hypotheses inconclusive | Investigation marked INCONCLUSIVE |
|
|
140
154
|
</error_codes>
|
|
@@ -34,8 +34,19 @@ $ARGUMENTS — target and optional mode flag.
|
|
|
34
34
|
**Pre-load** (optional): `Skill("spec-load")` for conventions + `maestro search "<target topic>"` for related entries.
|
|
35
35
|
|
|
36
36
|
**Output**: `.workflow/knowhow/KNW-opinion-{slug}-{YYYY-MM-DD}.md`
|
|
37
|
+
|
|
38
|
+
**Output boundary**: ALL file writes MUST target `.workflow/knowhow/KNW-opinion-{slug}-{YYYY-MM-DD}.md` and `.workflow/specs/learnings.md` only. NEVER modify source code or files outside these paths.
|
|
37
39
|
</context>
|
|
38
40
|
|
|
41
|
+
<invariants>
|
|
42
|
+
1. **Read-only analysis** — NEVER modify source code, wiki entries, or plan files under review; all writes go to `.workflow/` only
|
|
43
|
+
2. **Agent independence** — in review mode, each of the 3 agents (Pragmatist/Purist/Strategist) MUST operate independently without shared state; NEVER pass one agent's findings to another
|
|
44
|
+
3. **Evidence-backed verdicts** — every finding MUST include a `location` reference (file:line or section); ungrounded opinions SHALL NOT appear in the report
|
|
45
|
+
4. **Mode contract** — MUST execute exactly the mode specified (review/challenge/consult); NEVER mix mode behaviors within a single execution
|
|
46
|
+
5. **Append-only learnings** — `.workflow/specs/learnings.md` MUST be appended, NEVER overwritten or truncated
|
|
47
|
+
6. **Confirmation gate** — unless `-y` is set, MUST present findings and target files via AskUserQuestion before any writes
|
|
48
|
+
</invariants>
|
|
49
|
+
|
|
39
50
|
<state_machine>
|
|
40
51
|
|
|
41
52
|
<states>
|
|
@@ -104,8 +115,11 @@ Interactive loop:
|
|
|
104
115
|
<error_codes>
|
|
105
116
|
| Code | Condition | Recovery |
|
|
106
117
|
|------|-----------|----------|
|
|
118
|
+
| E001 | No target provided | Prompt user for target (path, wiki ID, HEAD, staged, or phase) |
|
|
107
119
|
| E002 | Unknown --mode value | Use: review, challenge, or consult |
|
|
120
|
+
| E003 | Target resolution failed — path not found, wiki ID invalid, or no staged changes | Check target exists |
|
|
108
121
|
| W001 | One review agent failed | Proceed with available perspectives |
|
|
122
|
+
| W002 | Specs/wiki pre-load unavailable | Proceed without convention context; note reduced coverage |
|
|
109
123
|
</error_codes>
|
|
110
124
|
|
|
111
125
|
<success_criteria>
|
|
@@ -40,8 +40,19 @@ Multiple combinable. No flags + no description → interactive (scan + AskUserQu
|
|
|
40
40
|
**CLI targeting**: `"cli": "claude"` (default, patches .claude/commands/), `"codex"` (patches .codex/skills/), `"both"` (both paths)
|
|
41
41
|
|
|
42
42
|
**Output**: `~/.maestro/overlays/amend-{slug}.json` + optional `~/.maestro/overlays/docs/amend-{slug}.md`
|
|
43
|
+
|
|
44
|
+
**Output boundary**: ALL file writes MUST target `~/.maestro/overlays/` (overlay JSON + docs) only. NEVER modify `.claude/commands/*.md` directly — overlay installation is handled by `maestro overlay add`.
|
|
43
45
|
</context>
|
|
44
46
|
|
|
47
|
+
<invariants>
|
|
48
|
+
1. **Non-invasive only** — amendments MUST use the overlay system (`~/.maestro/overlays/*.json`); direct edits to `.claude/commands/*.md` are NEVER permitted
|
|
49
|
+
2. **Idempotent patches** — re-running the same amendment MUST produce identical overlay JSON; overlay markers prevent duplicate injection
|
|
50
|
+
3. **Pristine source reads** — signal diagnosis MUST read from `$PKG_ROOT/.claude/commands/` (untouched originals), not installed copies
|
|
51
|
+
4. **Code bugs excluded** — signals classified as code bugs MUST be routed to `/maestro-quick` or `/maestro-plan --gaps`, NEVER patched via overlay
|
|
52
|
+
5. **User confirmation before install** — overlay JSON MUST be previewed and confirmed by the user before `maestro overlay add` runs (unless `-y`)
|
|
53
|
+
6. **Section existence verified** — target section MUST be confirmed to exist in the pristine source before drafting a patch; missing sections trigger `new-section` mode
|
|
54
|
+
</invariants>
|
|
55
|
+
|
|
45
56
|
<state_machine>
|
|
46
57
|
|
|
47
58
|
<states>
|
|
@@ -48,12 +48,23 @@ $ARGUMENTS — mode + optional flags.
|
|
|
48
48
|
|
|
49
49
|
Auto-detection: if `--type` not provided, infer from `--task` description keywords.
|
|
50
50
|
|
|
51
|
+
**Output boundary**: ALL file writes MUST target `.workflow/.scratchpad/` (companion docs + `.companion-active` pointer) only. Promotion writes (spec/knowhow) are delegated to `spec-add` / `manage-knowhow-capture` skills. NEVER modify source code, `.workflow/state.json`, or files outside `.workflow/.scratchpad/`.
|
|
52
|
+
|
|
51
53
|
**Companion document:**
|
|
52
54
|
- Path: `.workflow/.scratchpad/companion-{YYYYMMDD-HHmmss}.md`
|
|
53
55
|
- Active doc tracking: `.workflow/.scratchpad/.companion-active` (stores path of current companion doc)
|
|
54
56
|
- Format: YAML frontmatter (rich metadata) + typed sections + timestamped entries
|
|
55
57
|
</context>
|
|
56
58
|
|
|
59
|
+
<invariants>
|
|
60
|
+
1. **No session creation** — companion NEVER creates workflow sessions, NEVER writes to state.json
|
|
61
|
+
2. **Side-car only** — companion MUST NOT modify source code or execute implementation tasks; it is strictly a knowledge loading + recording utility
|
|
62
|
+
3. **One active doc** — only one `.companion-active` pointer SHALL exist at a time; creating a new companion doc MUST clear any stale pointer
|
|
63
|
+
4. **Append-only entries** — note mode MUST append entries; NEVER overwrite or reorder existing entries
|
|
64
|
+
5. **Promotion via delegation** — spec/knowhow promotion MUST route through `spec-add` / `manage-knowhow-capture` skills; companion NEVER writes directly to `.workflow/specs/` or `.workflow/knowhow/`
|
|
65
|
+
6. **Type-template integrity** — context template sections MUST match the resolved `task_type`; NEVER mix templates from different types
|
|
66
|
+
</invariants>
|
|
67
|
+
|
|
57
68
|
<state_machine>
|
|
58
69
|
|
|
59
70
|
<states>
|
|
@@ -39,8 +39,19 @@ $ARGUMENTS — natural language description, or flags.
|
|
|
39
39
|
1. **Architecture specs**: Run `maestro load --type spec --category arch` to load architecture constraints. Use as context for node resolution — ensures workflow design respects documented patterns.
|
|
40
40
|
2. **Coding specs**: Run `maestro load --type spec --category coding` to load coding conventions. Informs executor argument defaults and context injection.
|
|
41
41
|
3. Optional — proceed without if unavailable.
|
|
42
|
+
|
|
43
|
+
**Output boundary**: ALL file writes MUST target `~/.maestro/templates/workflows/` (template JSON + index.json) and `.workflow/templates/design-drafts/` (intermediate drafts) only. NEVER modify source code or `.claude/commands/` files.
|
|
42
44
|
</context>
|
|
43
45
|
|
|
46
|
+
<invariants>
|
|
47
|
+
1. **Max 20 nodes** — workflow templates MUST NOT exceed 20 nodes; larger workflows MUST be split into sub-workflows
|
|
48
|
+
2. **Acyclic DAG** — generated template MUST be a directed acyclic graph; cycles MUST be detected and rejected before persistence
|
|
49
|
+
3. **No orphan nodes** — every node MUST be reachable from at least one edge; unreachable nodes MUST be flagged
|
|
50
|
+
4. **Confirmation before write** — template JSON MUST be shown to user via AskUserQuestion before writing to `~/.maestro/templates/workflows/`; cancellation saves draft only
|
|
51
|
+
5. **Draft preservation** — abandoning at any confirmation gate MUST save current progress to design-drafts directory; NEVER discard user's partial work
|
|
52
|
+
6. **Deferred reading only** — node-catalog and template-schema MUST be read at their designated phases (P2, P5), NEVER loaded eagerly at startup
|
|
53
|
+
</invariants>
|
|
54
|
+
|
|
44
55
|
<state_machine>
|
|
45
56
|
|
|
46
57
|
<states>
|
|
@@ -30,10 +30,35 @@ $ARGUMENTS — Parse subcommand and optional path argument.
|
|
|
30
30
|
|
|
31
31
|
**Enforcement:** The `workflow-guard` hook (PreToolUse on Write/Edit) reads this config
|
|
32
32
|
and blocks operations targeting files outside boundaries. Requires hooks level >= `full`.
|
|
33
|
+
|
|
34
|
+
**Output boundary**: ALL file writes MUST target `.workflow/config.json` (guard section) only. NEVER modify hook files, `.claude/settings.json`, or source code.
|
|
33
35
|
</context>
|
|
34
36
|
|
|
37
|
+
<invariants>
|
|
38
|
+
1. **Config-only mutation** — guard MUST only modify the `guard` section of `.workflow/config.json`; NEVER touch other config sections or files
|
|
39
|
+
2. **Non-destructive** — `off` MUST preserve existing paths and mode; NEVER clear the path list when disabling
|
|
40
|
+
3. **Mode switch confirmation** — switching between allow/deny mode MUST require AskUserQuestion confirmation when existing paths will be cleared
|
|
41
|
+
4. **Hook dependency** — guard MUST warn when enabled but `workflow-guard` hook is not active (hooks level < full)
|
|
42
|
+
5. **Path normalization** — all paths MUST use forward slashes with trailing slash for directories; NEVER store raw backslash paths
|
|
43
|
+
</invariants>
|
|
44
|
+
|
|
35
45
|
<execution>
|
|
36
46
|
|
|
47
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
48
|
+
|
|
49
|
+
**GATE 1: Parse → Config Read**
|
|
50
|
+
- REQUIRED: Subcommand parsed (on/off/status/allow/deny) or defaulted to `status`.
|
|
51
|
+
- BLOCKED if: invalid subcommand provided.
|
|
52
|
+
|
|
53
|
+
**GATE 2: Config Read → Execute**
|
|
54
|
+
- REQUIRED: `.workflow/config.json` read successfully or initialized with empty guard section.
|
|
55
|
+
- BLOCKED if: file unreadable and cannot be created (E001).
|
|
56
|
+
|
|
57
|
+
**GATE 3: Execute → Confirm**
|
|
58
|
+
- REQUIRED: Config mutation applied (for on/off/allow/deny) or status displayed (for status).
|
|
59
|
+
- REQUIRED: Mode-switch AskUserQuestion answered (for allow↔deny transitions with existing paths).
|
|
60
|
+
- BLOCKED if: user declines mode switch.
|
|
61
|
+
|
|
37
62
|
**Step 1: Parse subcommand**
|
|
38
63
|
|
|
39
64
|
Extract from $ARGUMENTS:
|
|
@@ -38,8 +38,18 @@ $ARGUMENTS — none for interactive mode, or `-y` with `@file` reference for aut
|
|
|
38
38
|
|
|
39
39
|
**Load project state if exists:**
|
|
40
40
|
Check for `.workflow/state.json` -- loads context if project already initialized.
|
|
41
|
+
|
|
42
|
+
**Output boundary**: ALL file writes MUST target `.workflow/` (project.md, state.json, config.json, specs/) only. NEVER modify source code or files outside `.workflow/`.
|
|
41
43
|
</context>
|
|
42
44
|
|
|
45
|
+
<invariants>
|
|
46
|
+
1. **Idempotent init** — re-running init on an already-initialized project MUST detect existing `.workflow/` and warn (E002); NEVER silently overwrite existing state
|
|
47
|
+
2. **Scope guard** — init MUST only make initialization decisions; NEVER prejudge roadmap structure, plan scope, or implementation details
|
|
48
|
+
3. **All artifacts required** — init MUST NOT report completion until project.md, state.json, and config.json all exist; missing artifacts MUST be created before exit
|
|
49
|
+
4. **Template-driven** — deferred templates (project.md, state.json, config.json) MUST be read from `~/.maestro/templates/` and customized; NEVER generate from scratch without template
|
|
50
|
+
5. **Interview writes back** — all interactive decisions MUST be written to project.md/config.json before proceeding to research or completion; NEVER leave decisions unrecorded
|
|
51
|
+
</invariants>
|
|
52
|
+
|
|
43
53
|
<interview_protocol>
|
|
44
54
|
Follows @~/.maestro/workflows/interview-mechanics.md standard.
|
|
45
55
|
|
|
@@ -52,6 +62,24 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
|
|
|
52
62
|
</interview_protocol>
|
|
53
63
|
|
|
54
64
|
<execution>
|
|
65
|
+
|
|
66
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
67
|
+
|
|
68
|
+
**GATE 1: Pre-flight → Interview**
|
|
69
|
+
- REQUIRED: `.workflow/` existence check completed.
|
|
70
|
+
- REQUIRED: `--from` source validated (if provided).
|
|
71
|
+
- BLOCKED if: E002 (greenfield conflict with existing `.workflow/`) unresolved.
|
|
72
|
+
|
|
73
|
+
**GATE 2: Interview → Research**
|
|
74
|
+
- REQUIRED: All interview decisions recorded in project.md and config.json.
|
|
75
|
+
- REQUIRED: `.workflow/` directory created with initial structure.
|
|
76
|
+
- BLOCKED if: interview decisions not yet written to files.
|
|
77
|
+
|
|
78
|
+
**GATE 3: Research → Completion**
|
|
79
|
+
- REQUIRED: All 3 required artifacts exist (project.md, state.json, config.json).
|
|
80
|
+
- REQUIRED: `.workflow/specs/` initialized.
|
|
81
|
+
- BLOCKED if: any artifact missing — write it before reporting completion.
|
|
82
|
+
|
|
55
83
|
### Pre-flight
|
|
56
84
|
|
|
57
85
|
1. Check if `.workflow/` already exists — if so, load state and warn (E002 for greenfield conflicts)
|
|
@@ -34,8 +34,19 @@ Turn natural-language instructions into command overlays — JSON patch files th
|
|
|
34
34
|
**Management** — listing and removing overlays is handled by `maestro overlay list` (ink TUI with interactive delete). This skill focuses solely on creation.
|
|
35
35
|
|
|
36
36
|
**Available sections** (for `section:` in patches): `purpose`, `required_reading`, `deferred_reading`, `context`, `execution`, `error_codes`, `success_criteria`.
|
|
37
|
+
|
|
38
|
+
**Output boundary**: ALL file writes MUST target `~/.maestro/overlays/` (overlay JSON + docs) only. Command file patching is handled by `maestro overlay add` — this skill NEVER modifies `.claude/commands/*.md` directly.
|
|
37
39
|
</context>
|
|
38
40
|
|
|
41
|
+
<invariants>
|
|
42
|
+
1. **Non-invasive** — overlays MUST use hashed HTML-comment markers for injection; NEVER edit command file content directly outside the overlay system
|
|
43
|
+
2. **Idempotent** — re-running `maestro overlay apply` with the same overlay JSON MUST produce no file changes
|
|
44
|
+
3. **Creation only** — this skill MUST only create overlays; listing and removal are handled by `maestro overlay list` (ink TUI)
|
|
45
|
+
4. **Pristine source preferred** — injection point analysis MUST read from `$PKG_ROOT/.claude/commands/` (untouched originals) first, fall back to `~/.claude/commands/` only if pristine unavailable
|
|
46
|
+
5. **User approval before write** — overlay JSON MUST be shown and approved via AskUserQuestion before writing to disk; NEVER auto-install without confirmation
|
|
47
|
+
6. **Chain skip option mandatory** — if a skill chain is configured, the injected content MUST include a "Skip" option in AskUserQuestion; NEVER force the user into a chain
|
|
48
|
+
</invariants>
|
|
49
|
+
|
|
39
50
|
<execution>
|
|
40
51
|
### 1. Parse user intent
|
|
41
52
|
|
|
@@ -67,8 +67,19 @@ $ARGUMENTS — template slug/path, or flags.
|
|
|
67
67
|
"last_checkpoint": null
|
|
68
68
|
}
|
|
69
69
|
```
|
|
70
|
+
|
|
71
|
+
**Output boundary**: ALL file writes MUST target `.workflow/.maestro/player-*/` (session status.json + step outputs) only. Template files (`~/.maestro/templates/workflows/`) are read-only. NEVER modify source code or `.claude/commands/` files.
|
|
70
72
|
</context>
|
|
71
73
|
|
|
74
|
+
<invariants>
|
|
75
|
+
1. **Resume-safe** — status.json MUST be updated after every step change; an interrupted session MUST be resumable from the last checkpoint via `-c`
|
|
76
|
+
2. **One step at a time** — execution loop MUST process steps sequentially in topological order; parallel steps share a batch index but NEVER run concurrently within the player
|
|
77
|
+
3. **CLI nodes async** — cli-type nodes MUST use `Bash(run_in_background: true)` + STOP pattern; NEVER block the main thread on delegate execution
|
|
78
|
+
4. **Templates read-only** — player MUST NOT modify template JSON files; runtime state belongs in status.json only
|
|
79
|
+
5. **Failure requires user decision** — on step failure without explicit `on_fail`, player MUST prompt via AskUserQuestion (Retry/Skip/Abort); NEVER silently skip or auto-abort
|
|
80
|
+
6. **Reference resolution at runtime** — `{N-xxx.field}` and `{prev_*}` references MUST be resolved at execution time from status.json step results, NEVER pre-resolved during init
|
|
81
|
+
</invariants>
|
|
82
|
+
|
|
72
83
|
<state_machine>
|
|
73
84
|
|
|
74
85
|
<states>
|
|
@@ -39,9 +39,38 @@ Parse for:
|
|
|
39
39
|
- Browse: `maestro search --category coding`
|
|
40
40
|
- Load task-relevant entries: `maestro load --type knowhow --id <id1> [id2...]`
|
|
41
41
|
3. All are optional — proceed without if unavailable.
|
|
42
|
+
|
|
43
|
+
**Output boundary**: ALL file writes MUST target `.workflow/scratch/` (task directory, plan.json, summaries) and modified source files as defined in plan.json tasks. State.json scratch entry is implicit workflow tracking.
|
|
42
44
|
</context>
|
|
43
45
|
|
|
46
|
+
<invariants>
|
|
47
|
+
1. **Atomic commits** — each task execution MUST produce a commit with only the files modified by that task; NEVER stage unrelated files
|
|
48
|
+
2. **Evidence-based summaries** — task summaries MUST include concrete evidence (files changed, tests run, commands executed); NEVER accept "task completed successfully" as a summary
|
|
49
|
+
3. **Plan before execute** — plan.json MUST be written before any task execution begins; NEVER skip planning even for single-task workflows
|
|
50
|
+
4. **Scratch isolation** — all workflow artifacts MUST live under `.workflow/scratch/{task-dir}/`; NEVER write workflow metadata outside this directory
|
|
51
|
+
5. **Commit confirmation** — staged files and commit message MUST be shown via AskUserQuestion before committing (unless `-y`); NEVER auto-commit without user awareness
|
|
52
|
+
</invariants>
|
|
53
|
+
|
|
44
54
|
<execution>
|
|
55
|
+
|
|
56
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
57
|
+
|
|
58
|
+
**GATE 1: Setup → Planning**
|
|
59
|
+
- REQUIRED: Task description parsed and scratch directory created.
|
|
60
|
+
- REQUIRED: Coding specs loaded (optional but attempted).
|
|
61
|
+
- BLOCKED if: no task description (E001) or scratch directory creation failed (E002).
|
|
62
|
+
|
|
63
|
+
**GATE 2: Planning → Execution**
|
|
64
|
+
- REQUIRED: plan.json written with task definitions.
|
|
65
|
+
- REQUIRED: --discuss decisions extracted and recorded (if flag set).
|
|
66
|
+
- BLOCKED if: plan.json missing or empty.
|
|
67
|
+
|
|
68
|
+
**GATE 3: Execution → Completion**
|
|
69
|
+
- REQUIRED: All tasks executed with `.summaries/TASK-*-summary.md` written per task.
|
|
70
|
+
- REQUIRED: Each summary contains concrete evidence of completion.
|
|
71
|
+
- REQUIRED: --full verification passed (if flag set).
|
|
72
|
+
- BLOCKED if: any task summary missing or lacking evidence.
|
|
73
|
+
|
|
45
74
|
Follow '~/.maestro/workflows/quick.md' completely.
|
|
46
75
|
|
|
47
76
|
### Artifact Verification (before completion)
|