cadre-ai 2.2.0 → 3.0.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.
Files changed (81) hide show
  1. package/.claude-plugin/plugin.json +10 -0
  2. package/.codex-plugin/plugin.json +19 -0
  3. package/.mcp.codex.json +9 -0
  4. package/.mcp.json +8 -0
  5. package/LICENSE +21 -202
  6. package/README.md +357 -134
  7. package/agents/cadre-phase-worker.md +17 -0
  8. package/agents/cadre-task-worker.md +16 -0
  9. package/dist/cadre-cli.mjs +2883 -0
  10. package/dist/cadre-mcp.mjs +33736 -0
  11. package/marketplace/claude.json +16 -0
  12. package/marketplace/codex.json +20 -0
  13. package/package.json +36 -32
  14. package/skills/archive/SKILL.md +28 -0
  15. package/skills/archive/agents/openai.yaml +4 -0
  16. package/skills/create/SKILL.md +33 -0
  17. package/skills/create/agents/openai.yaml +4 -0
  18. package/skills/implement/SKILL.md +91 -0
  19. package/skills/implement/agents/openai.yaml +4 -0
  20. package/skills/refresh/SKILL.md +18 -0
  21. package/skills/refresh/agents/openai.yaml +4 -0
  22. package/skills/revert/SKILL.md +20 -0
  23. package/skills/revert/agents/openai.yaml +4 -0
  24. package/skills/review/SKILL.md +32 -0
  25. package/skills/review/agents/openai.yaml +4 -0
  26. package/skills/revise/SKILL.md +32 -0
  27. package/skills/revise/agents/openai.yaml +4 -0
  28. package/skills/status/SKILL.md +21 -0
  29. package/skills/status/agents/openai.yaml +4 -0
  30. package/skills/track/SKILL.md +33 -0
  31. package/skills/track/agents/openai.yaml +4 -0
  32. package/skills/wisp/SKILL.md +16 -0
  33. package/skills/wisp/agents/openai.yaml +4 -0
  34. package/templates/v1/init/archive/.gitkeep +1 -0
  35. package/templates/v1/init/gitignore.template +5 -0
  36. package/templates/v1/init/guidelines.md +25 -0
  37. package/templates/v1/init/operations/.gitkeep +1 -0
  38. package/templates/v1/init/patterns/index.md +6 -0
  39. package/templates/v1/init/product.md +30 -0
  40. package/templates/v1/init/project.json +26 -0
  41. package/templates/v1/init/refreshes/.gitkeep +1 -0
  42. package/templates/v1/init/styleguides/general.md +14 -0
  43. package/templates/v1/init/styleguides/language.md +21 -0
  44. package/templates/v1/init/tech-stack.md +21 -0
  45. package/templates/v1/init/tracks/.gitkeep +1 -0
  46. package/templates/v1/init/tracks.md +6 -0
  47. package/templates/v1/init/wisps/.gitkeep +1 -0
  48. package/templates/v1/init/workflow.md +163 -0
  49. package/templates/v1/project/archive-operation.json +15 -0
  50. package/templates/v1/project/pattern.md +20 -0
  51. package/templates/v1/project/refresh-operation.json +14 -0
  52. package/templates/v1/project/refresh.md +21 -0
  53. package/templates/v1/styleguides/dart.md +27 -0
  54. package/templates/v1/styleguides/flutter.md +27 -0
  55. package/templates/v1/styleguides/go.md +29 -0
  56. package/templates/v1/styleguides/gradle.md +28 -0
  57. package/templates/v1/styleguides/html-css.md +39 -0
  58. package/templates/v1/styleguides/index.md +27 -0
  59. package/templates/v1/styleguides/java.md +27 -0
  60. package/templates/v1/styleguides/javascript.md +27 -0
  61. package/templates/v1/styleguides/kotlin.md +26 -0
  62. package/templates/v1/styleguides/maven.md +28 -0
  63. package/templates/v1/styleguides/python.md +27 -0
  64. package/templates/v1/styleguides/react.md +28 -0
  65. package/templates/v1/styleguides/swift.md +27 -0
  66. package/templates/v1/styleguides/swiftui.md +27 -0
  67. package/templates/v1/styleguides/typescript.md +26 -0
  68. package/templates/v1/track/bug.md +14 -0
  69. package/templates/v1/track/execution.json +18 -0
  70. package/templates/v1/track/learning.md +39 -0
  71. package/templates/v1/track/plan.md +39 -0
  72. package/templates/v1/track/revert-operation.json +13 -0
  73. package/templates/v1/track/revise-operation.json +14 -0
  74. package/templates/v1/track/revision.md +36 -0
  75. package/templates/v1/track/spec.md +38 -0
  76. package/templates/v1/track/state.json +25 -0
  77. package/scripts/cadre-cli.js +0 -1076
  78. package/scripts/cadre-core.js +0 -15240
  79. package/scripts/cadre-lsp-review.js +0 -1194
  80. package/scripts/cadre-lsp-setup.js +0 -599
  81. package/scripts/mcp/cadre-server.js +0 -19013
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "cadre",
3
+ "owner": {
4
+ "name": "Cadre contributors"
5
+ },
6
+ "description": "Cadre plugin marketplace for human-governed software delivery workflows.",
7
+ "plugins": [
8
+ {
9
+ "name": "cadre",
10
+ "source": "./plugins/cadre",
11
+ "description": "A human-governed, Git-aware product delivery harness.",
12
+ "category": "Developer Tools",
13
+ "strict": true
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "cadre",
3
+ "interface": {
4
+ "displayName": "Cadre"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "cadre",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugins/cadre"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Developer Tools"
18
+ }
19
+ ]
20
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cadre-ai",
3
- "version": "2.2.0",
4
- "description": "MCP-first Cadre workflows for context-driven development.",
3
+ "version": "3.0.1",
4
+ "description": "Cross-agent, human-governed software delivery harness",
5
5
  "author": {
6
6
  "name": "Vishal Kumar",
7
7
  "url": "https://github.com/vishal-kr-barnwal"
@@ -12,51 +12,55 @@
12
12
  "url": "https://github.com/vishal-kr-barnwal/cadre.git",
13
13
  "directory": "harness"
14
14
  },
15
- "license": "Apache-2.0",
15
+ "license": "MIT",
16
16
  "keywords": [
17
17
  "cadre",
18
18
  "cadre-ai",
19
- "context-driven-development",
19
+ "agent-workflows",
20
20
  "mcp",
21
21
  "codex",
22
- "claude",
23
- "copilot",
24
- "antigravity"
22
+ "claude"
25
23
  ],
26
- "type": "commonjs",
24
+ "type": "module",
27
25
  "packageManager": "pnpm@11.4.0",
28
- "main": "scripts/cadre-core.js",
29
26
  "bin": {
30
- "cadre": "scripts/cadre-cli.js",
31
- "cadre-ai": "scripts/cadre-cli.js",
32
- "cadre-lsp-setup": "scripts/cadre-lsp-setup.js",
33
- "cadre-lsp-review": "scripts/cadre-lsp-review.js",
34
- "cadre-mcp": "scripts/mcp/cadre-server.js"
27
+ "cadre-ai": "dist/cadre-cli.mjs"
35
28
  },
36
29
  "files": [
30
+ ".claude-plugin/",
31
+ ".codex-plugin/",
32
+ ".mcp.codex.json",
33
+ ".mcp.json",
34
+ "agents/",
35
+ "dist/",
37
36
  "LICENSE",
37
+ "marketplace/",
38
38
  "README.md",
39
- "scripts/cadre-cli.js",
40
- "scripts/cadre-core.js",
41
- "scripts/cadre-lsp-review.js",
42
- "scripts/cadre-lsp-setup.js",
43
- "scripts/mcp/cadre-server.js"
39
+ "skills/",
40
+ "templates/"
44
41
  ],
45
42
  "scripts": {
46
- "build": "node scripts/build-runtime.mjs",
47
- "build:runtime": "node scripts/build-runtime.mjs",
48
- "generate": "bash scripts/generate-skills.sh",
49
- "check": "pnpm check:typecheck && pnpm check:runtime && pnpm check:generated && pnpm check:test",
50
- "check:typecheck": "pnpm typecheck",
51
- "check:runtime": "pnpm build:runtime",
52
- "check:generated": "bash scripts/generate-skills.sh --check",
53
- "check:test": "pnpm test",
54
- "test": "node --test scripts/source-architecture.test.js scripts/cadre-core.test.js scripts/cadre-skill.test.js scripts/cadre-cli.test.js scripts/mcp/cadre-server.test.js scripts/mcp/lifecycle.test.js scripts/mcp-resource-registry.test.js scripts/mcp-packet-contracts.test.js scripts/protocol-packet-only.test.js scripts/token-efficiency.test.js && node scripts/cadre-team-scale-sim.js",
55
- "typecheck": "tsc --noEmit"
43
+ "build": "node --import tsx scripts/build.ts",
44
+ "check": "tsc --noEmit",
45
+ "install:plugin": "pnpm build && node dist/cadre-cli.mjs install --target all",
46
+ "prepack": "pnpm build && node --import tsx scripts/validate.ts",
47
+ "test": "pnpm build && node --import tsx --test test/*.test.ts",
48
+ "validate": "pnpm build && node --import tsx scripts/validate.ts"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "engines": {
54
+ "node": ">=18"
56
55
  },
57
56
  "devDependencies": {
58
- "@types/node": "^24.0.4",
59
- "esbuild": "^0.25.5",
60
- "typescript": "^5.8.3"
57
+ "@modelcontextprotocol/sdk": "^1.30.0",
58
+ "@types/node": "^22.20.1",
59
+ "esbuild": "^0.25.12",
60
+ "jsonc-parser": "^3.3.1",
61
+ "smol-toml": "^1.7.1",
62
+ "tsx": "^4.23.1",
63
+ "typescript": "^5.9.3",
64
+ "zod": "^4.4.3"
61
65
  }
62
66
  }
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: archive
3
+ description: Archive one or more completed Cadre tracks in one approved, resumable batch; distill their incremental learning with existing patterns, rebuild the pattern catalog, and reseed non-completed tracks by relevance. Use for the archive command after clean approved reviews.
4
+ ---
5
+
6
+ # Cadre Archive
7
+
8
+ Archive one or more `completed` tracks in a single batch. Read `.cadre/workflow.md`, every artifact and recorded commit for every selected track, the full pattern catalog, all active track specs/plans and marked learning seeds, and relevant implementation files. Read existing pattern and learning files before proposing changes.
9
+
10
+ Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without starting or advancing an archive batch.
11
+
12
+ Build one bounded archive inventory after selection. Read every selected artifact exactly once, summarize execution journals structurally in one pass, and verify recorded commit reachability in one Git pass. Do not precede reads with line counts, rediscover the same paths, or restart full reads after truncation; continue from the first unread line. Reuse unchanged workflow/product/styleguide context already loaded in the same flow. Fetch known pattern templates directly with one `template_get_many` call; do not call `template_catalog`. The declared mutation surface is `archive_batch_preview`/`archive_batch_apply` followed by `archive_batch_record_preview`/`archive_batch_record_apply`; do not inspect the installed runtime or tool catalog for alternatives.
13
+
14
+ Expected human decision count is one for an explicit or uniquely eligible selection and its complete batch. An ambiguous multi-track invocation may require one selection response followed by one complete batch approval. Ask again only when the selection, content, digest-bound proposal, or consequences change.
15
+
16
+ 1. Accept an explicit list of track IDs or `all completed`. If selection is omitted and exactly one track is eligible, use that unique track as the proposed selection and include it in the complete batch proposal without a selection-only approval. If multiple tracks are eligible or the request is otherwise ambiguous, list them and ask which to include. Preserve the approved order and remove duplicates.
17
+ 2. Verify the entire selection before changing anything. Every selected track must be `completed`, have clean centralized `state_validate`, and have no pending state mutation. Do not recompute its DAG, manual-verification barriers, or review evidence inside archive; those are completed-state invariants. Reject the batch without partial mutation if any selected track is ineligible. Ignore completed tracks that were not selected.
18
+ 3. If an in-progress `.cadre/operations/archive-<timestamp>.json` exists, reconcile it before accepting a new batch. Resume from its first incomplete checkpoint. If its journal, files, Git state, or expected commit disagree, stop and present the mismatch.
19
+ 4. Distill durable, evidenced learning across the selected tracks as one corpus; discard track-specific trivia. Merge, replace, split, or retire existing patterns when justified, preserving provenance to every contributing track/phase/task commit. Reconcile overlapping or conflicting learning once so batch order cannot silently change the result.
20
+ 5. Compute relevant Pattern Seed section changes in `learning.md` for every non-completed, non-archived track using the final proposed pattern set. Never seed by keyword alone; explain semantic relevance.
21
+ 6. Call `archive_batch_preview` with the ordered selection and exact consolidated pattern/index and active-track seed updates. Present its complete moves, lifecycle states, operation journal, content diffs, generated `tracks.md`, and both expected commits as one batch proposal. Obtain one explicit approval for that complete digest-bound batch; a partial or changed approval requires a new preview. Do not ask separately for a uniquely eligible track.
22
+ 7. After approval, pass the unchanged digest to `archive_batch_apply`. It journals before mutation, moves the selected directories, writes the approved content and exact post-archive index, and returns embedded validation. Commit all approved archive moves and derived changes together using the proposal's expected commit.
23
+ 8. Pass the resulting archive commit SHA to `archive_batch_record_preview`, verify it only records the already-approved provenance in every selected track, project history, and batch journal, then call `archive_batch_record_apply` with its unchanged digest. This bookkeeping is part of the approved batch and needs no second human approval unless it differs from the original proposal. Create `cadre(archive): record batch <batch-id>`.
24
+ 9. Use the final apply result instead of redundant `state_validate` or `project_status` calls when it is valid/current. Verify only the clean worktree and the two expected commits.
25
+
26
+ If interrupted before the archive commit, reconcile the batch journal and resume its first incomplete track or artifact through the same approved input. If the worktree is clean and HEAD matches the journal's expected commit and base relationship, treat the archive commit as successful and record that SHA. If the SHA is recorded but follow-up state is uncommitted, finish only the state commit. Never repeat completed moves, redistill from a partial selection, or start a second archive batch while one is active.
27
+
28
+ Do not delete learning, review cycles, revisions, bug reports, or commit provenance.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Archive"
3
+ short_description: "Archive completed tracks as one batch"
4
+ default_prompt: "Use $archive to archive one or more completed tracks in a resumable batch and distill their patterns."
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: create
3
+ description: Initialize or resume Cadre in a greenfield or brownfield repository using MCP-provided templates and human-approved product, engineering, workflow, styleguide, pattern, and project-state artifacts. Use for Cadre setup, project onboarding, or the create command; classify the repository first and do not overwrite an initialized project.
4
+ ---
5
+
6
+ # Cadre Create
7
+
8
+ Use the Cadre MCP as the authoritative runtime and template provider. Do not copy runtime code or templates into the project. Treat every rendered artifact and state mutation as a proposal until the human approves it. If required Cadre MCP tools are unavailable, stop and report that the plugin runtime is unavailable; never reconstruct templates from memory.
9
+
10
+ ## Procedure
11
+
12
+ 1. Resolve the exact project root. Inspect its manifests, source layout, tests, agent guidance, Git status, and recent history. Run `git rev-parse --show-toplevel`: if it succeeds, never initialize a nested repository; if it fails, record that the approved root requires `git init`. Ask which root to use if the boundary is materially ambiguous. Read every existing file before proposing an edit.
13
+ 2. Explicitly classify the context as `greenfield` or `brownfield`, with evidence. A substantive implementation, behavior, user/data/interface contract, or delivery history is brownfield. If a scaffold, prototype, migration, or incomplete evidence makes the classification unclear, ask a blocking question before drafting or mutating anything.
14
+ 3. Call `project_status` when `.cadre/project.json` exists and use its embedded structured validation; do not repeat `state_validate` at command entry. Reconcile its setup journal, worktree, and recent commits. Resume the recorded checkpoint exactly; do not restart or overwrite setup. Offer `$refresh` or `$status` only after completed setup.
15
+ 4. Call `template_get_many` once for `project/product`, `project/guidelines`, `project/tech-stack`, `project/workflow`, `project/styleguides/general`, and `project/patterns/index`. Retain that versioned bundle across approval turns and do not refetch it unless its version or content hash changes. For greenfield work, use explicit user intent and ask about missing material product/stack choices. For brownfield work, distinguish evidenced current reality from desired change and preserve deliberate conventions.
16
+ 5. Draft `product.md`, `guidelines.md`, and `tech-stack.md`. Resolve any material ambiguity through targeted questions; do not invent product behavior, constraints, or stack decisions.
17
+ 6. Present the rendered `workflow.md` separately. Explicitly ask whether the default workflow is acceptable or the human wants changes. Apply requested changes, show the complete revision, and obtain explicit workflow acceptance; approval of other artifacts does not imply this approval.
18
+ 7. Call `styleguide_resolve` with the approved technologies. Always include the general guide. For each resolved language, framework, markup, or build-tool guide, ask whether to use the default, amend it, or use a user-provided replacement. Preserve evidenced brownfield conventions. Show the complete final styleguide set for explicit approval.
19
+ 8. Present all remaining rendered files and exact target paths. Approval must cover the complete artifact set, the context classification, project root, and Git disposition. Do not create Cadre state before approval.
20
+ 9. Call `project_init_preview` with only the approved rendered project files and metadata. Show its complete file proposal—including the template-derived `.cadre/.gitignore` that excludes `.worktrees/` and `wisps/`—and digest. After explicit confirmation, call `project_init_apply` with the unchanged inputs and digest. It atomically creates mutable `.cadre` state and approved context only; it never installs a runtime or template copies there.
21
+ 10. If Git disposition is `initialize`, run `git init` only at the approved root, verify `git rev-parse --show-toplevel` equals that root, then call `setup_record_git_initialized`. If Git is unavailable, initialization fails, or a different repository appears, stop with the setup journal intact. For an existing repository, verify its root again.
22
+ 11. Call `state_validate` and show the result. Commit the approved setup as `cadre(create): initialize project harness` only when validation is clean and checkpoint is `commit-pending`.
23
+ 12. Call `setup_record_commit` with that SHA, then call `tracks_render_preview`, show the derived result, and call `tracks_render_apply` with its unchanged digest if needed. Commit the bookkeeping as `cadre(create): record setup commit`.
24
+
25
+ ## Resume protocol
26
+
27
+ - `git-pending`: initialize Git only when the journal says `initialize`; verify the exact approved root and record the checkpoint.
28
+ - `commit-pending` plus matching dirty artifacts: validate and create the expected artifact commit.
29
+ - Clean worktree plus matching expected HEAD/base relationship: treat the artifact commit as successful and record that SHA; never repeat it.
30
+ - Recorded setup SHA plus dirty bookkeeping: finish only the follow-up state commit.
31
+ - Journal, files, digest, worktree, or HEAD mismatch: stop and show the mismatch. Never guess, discard, or restart.
32
+
33
+ All later commands must read `.cadre/workflow.md`. Every file is rendered from a versioned MCP template, every multi-step mutation is resumable, and human approval gates artifacts and state changes.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Create"
3
+ short_description: "Initialize a Cadre-managed project"
4
+ default_prompt: "Use $create to initialize Cadre for this repository."
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: implement
3
+ description: Execute or resume an approved Cadre plan as a dependency DAG, using parallel workers by default when safe, sequential execution when requested, isolated Git worktrees, main-agent integration, incremental learning, verification, and commit provenance. Use for the implement command on a planned or in-progress track.
4
+ ---
5
+
6
+ # Cadre Implement
7
+
8
+ Treat the approved `plan.md` as the source of truth. Implement only `planned` or `in_progress` tracks. The main agent is the sole scheduler and Cadre-state owner: workers must never spawn workers, edit `.cadre/**`, merge branches, resolve integration conflicts, remove worktrees, or record human approval.
9
+
10
+ Call `project_status`, `execution_graph_validate`, and `worktree_status` before selecting work. Use the structured validation embedded in `project_status`; do not repeat `state_validate` at command entry. If the required Cadre MCP is unavailable, stop at the current checkpoint.
11
+
12
+ ## Select and persist execution mode
13
+
14
+ - Default to `parallel` when the human does not specify a mode.
15
+ - Use `sequential` only when explicitly requested.
16
+ - Parallel mode creates workers only when at least two safe executable nodes are ready. Otherwise execute in main without worktree overhead.
17
+ - Bound worker count by ready nodes, host capacity, and the workflow maximum.
18
+ - Persist requested/effective mode in the execution journal. Changing it during execution requires a clean safe boundary, a presented proposal, and approval.
19
+
20
+ For a new execution, call `execution_start_preview`, show the exact journal/state proposal, obtain approval, and pass the unchanged digest to `execution_start_apply`. Then preview and apply the derived `tracks.md` update through its digest gate, verify `derivedStateCurrent`, and commit `cadre(implement): start <track-id>`. For an existing `implement` operation, reconcile it instead of creating another execution.
21
+
22
+ ## Resume before scheduling
23
+
24
+ 1. Read `.cadre/workflow.md`, project and track state, spec, plan, execution journal, marked Pattern Seed, dependency-phase learning, patterns/styleguides, and declared track dependencies.
25
+ 2. Reconcile journal nodes with worker identities, `git worktree list`, branch tips, dirty files, commits, and merges. Never repeat a committed or integrated node.
26
+ 3. Block when a declared track dependency is not completed or archived after completion.
27
+ 4. Stop and present any journal/Git mismatch. Never reset, discard, reconstruct, force-delete, or silently restart.
28
+
29
+ ## Preflight host permissions
30
+
31
+ Before creating workers, inspect the approved plan, repository scripts, lockfiles, and likely verification commands. Distinguish host security permission from Cadre lifecycle approval: a shell/network/listener prompt authorizes the host operation only; it does not approve an artifact, commit, merge, manual-verification result, or state transition.
32
+
33
+ - Use already-approved commands and prefixes without asking again. Never request permission speculatively or retry equivalent command spellings to obtain a different prompt.
34
+ - Centralize shared dependency installation, registry access, image pulls, code generation, and other network preparation in main before workers start. Workers should use locked/offline modes when the repository supports them.
35
+ - Prefer existing repository scripts and narrowly scoped commands. Do not combine unrelated or differently privileged shell segments into one command, because the host evaluates each segment independently.
36
+ - Avoid scaffolding modes that create nested repositories or require deleting generated `.git` directories. Inspect generator options and target directories first.
37
+ - When a required permission is not already available, request one narrow reusable command prefix with the exact reason. If a worker encounters an unexpected prompt, it stops and reports the exact blocked command to main instead of issuing repeated variants.
38
+
39
+ ## Schedule the DAG
40
+
41
+ Call `execution_status` when resuming an execution or when no mutation response is available. After a successful execution mutation, use its returned `derivedStatus` instead of making a redundant status call. Use `execution_nodes_preview` and `execution_nodes_apply` when one already-approved scheduling or bookkeeping decision produces multiple immediately valid transitions. The ordered batch is a transport optimization only: never batch across a human approval, commit, verification, integration, conflict resolution, or other external action whose evidence does not exist at preview time. Plan display order breaks ties only.
42
+
43
+ - A root phase reads the Pattern Seed. Any other phase reads learning from all declared dependency phases.
44
+ - Treat the track as a hierarchical DAG: phase dependencies determine active phases, task dependencies determine ready work inside each running phase, and main schedules one global ready queue subject to `maxWorkers`. Different phases may use different execution modes concurrently.
45
+ - Every non-trivial active phase uses a main-owned integration worktree. A phase `workerId` is a temporary execution lease, not ownership of that worktree. Use direct main execution for one ready task, a phase worker for a tightly coupled sequential chain when delegation is already justified, and task-worker fan-out when at least two independent tasks in that phase are ready.
46
+ - A phase has only one mutating execution mode at a time, but may switch modes at a clean checkpoint. Before phase-worker-to-task-worker fan-out, finish and record the current task, verify the phase worktree is clean, record its HEAD in the phase verification, release the phase worker through a `running`-to-`running` node update with `workerId: null`, and keep that worker inactive. Main may assign a new phase worker only after every active task worker in that phase is completed and its integration/cleanup is recorded.
47
+ - Create every task-worker wave from the same recorded clean phase HEAD. Merge approved tasks into the phase worktree one at a time; derive the next wave only after those merges, so downstream tasks start from the updated phase HEAD.
48
+ - The main agent creates every worker. On Codex, use an available implementation worker subagent with the bounded prompt below. On Claude Code, prefer the plugin-provided `cadre-phase-worker` and `cadre-task-worker`. Do not use Claude agent teams.
49
+ - If only one safe execution node is ready, execute it in main.
50
+ - Phase and task worktrees are siblings. Use `worktree_create_preview` and `worktree_create_apply`; record the returned absolute path/branch through `execution_node_preview` and `execution_node_apply` before spawning.
51
+
52
+ ### Worker prompt contract
53
+
54
+ Provide the exact absolute worktree, track/execution/node IDs, approved outcome, dependencies and learning to read, relevant files, required checks, and expected Conventional Commit scope. State explicitly:
55
+
56
+ - operate only in the assigned worktree and read files before editing;
57
+ - edit product files only and never edit `.cadre/**`;
58
+ - do not spawn agents, merge, rebase, reset, clean up, or force Git operations;
59
+ - a phase worker must stop at a requested clean handoff, report the committed phase HEAD and clean status, and remain inactive while task workers for that phase run;
60
+ - run focused verification and return changed files, tests/checks, risks, learning candidates, and the proposed commit message for the current task;
61
+ - stop after each regular task with that task's changes uncommitted at `awaiting_approval` until main presents them and the human approves;
62
+ - after approval, commit only that task and return its SHA; do not begin the next phase task until main confirms the checkpoint is recorded.
63
+
64
+ ## Approve, commit, and integrate
65
+
66
+ 1. Transition a worker node from `running` to `awaiting_approval` with its verification summary.
67
+ 2. Read the worker diff and evidence. Present them to the human through main.
68
+ 3. After approval, direct the worker to create its Conventional Commit, verify the worktree is clean, and record its SHA as `committed`.
69
+ 4. For a task worker, call `integration_preview` and show the exact task merge. The MCP derives its parent as the registered phase worktree when one exists, otherwise the canonical worktree. Use the canonical fallback only for an explicitly direct, single-task phase; create a phase integration worktree before delegated work in multi-task or phase-verified delivery. Pass the unchanged digest to `integration_apply`. A task executed directly by main or internally by a phase worker is already on its parent branch: verify its approved commit is reachable and do not invent an integration step. For a phase worktree, use the same gate for phase-to-canonical integration. Never squash.
70
+ 5. If integration reports conflicts, mark `conflicted`. Resolve task conflicts in the phase worktree and phase conflicts in main, read every conflicted file and both sides, rerun combined verification, present the resolution, and record the resulting merge commit only after approval.
71
+ 6. For a worker worktree, mark the node `integrated`, then preview/apply worktree cleanup. Cleanup must refuse dirty, conflicted, or unintegrated work and must not force branch deletion.
72
+ 7. Mark a task complete after its worker integration, or after its approved direct/phase-worker commit is verified on the parent branch. Mark it complete in `plan.md` with its reachable task commit SHA during canonical phase bookkeeping.
73
+
74
+ Every regular task in a phase has its own Conventional Commit and distinct recorded SHA, including tasks executed sequentially by one phase worker. Manual-verification nodes may record the approved phase-head or merge evidence instead of inventing an empty commit. A phase must remain `running` until every sibling task and its manual-verification barrier are `completed`; only then may it advance to approval, commit, integration, and cleanup.
75
+
76
+ ## Verification barriers and learning
77
+
78
+ - Phase `User Manual Verification` is a derived barrier over all sibling tasks. After task workers are quiescent, prepare technical evidence in the phase worktree through an active phase worker when present, otherwise through main. The main agent always presents and records the human approval.
79
+ - After approval, integrate the phase branch, record every task commit, the phase completion merge SHA, and dependency-aware phase learning in canonical `plan.md`/`learning.md`; commit `cadre(implement): record <track-id> <phase-id>`.
80
+ - Track-level `User Manual Verification` is a derived barrier over every phase. Execute it only in main, against the fully integrated canonical worktree, and obtain explicit human approval.
81
+
82
+ ## Complete execution
83
+
84
+ When all journal nodes and plan tasks are complete, all phase learning/provenance is recorded, all worktrees are removed, and track verification is approved:
85
+
86
+ 1. Run the relevant full checks and inspect the final diff/history.
87
+ 2. Call `execution_finish_preview`; present its exact completed journal and `ready_for_review` transition.
88
+ 3. After approval, call `execution_finish_apply` with the unchanged digest.
89
+ 4. Preview/apply `tracks.md`, call `state_validate`, and commit `cadre(implement): ready <track-id>`.
90
+
91
+ Never mark a track `completed`; only an approved clean `review` may do that.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Implement"
3
+ short_description: "Execute a track DAG with safe workers"
4
+ default_prompt: "Use $implement to execute or resume an approved track DAG, in parallel by default when safe or sequentially when explicitly requested."
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: refresh
3
+ description: Refresh Cadre product, guidelines, workflow, styleguides, and tech-stack from user input, repository changes since setup/last refresh, and completed tracks, with an approved project refresh record. Use for the refresh command when project context drifts.
4
+ ---
5
+
6
+ # Cadre Refresh
7
+
8
+ Read `.cadre/workflow.md`, `project.json`, all project context files, the last refresh record, Git history since the recorded setup/refresh commit, completed-track outcomes, and current repository manifests/code. Read every target context file before editing it.
9
+
10
+ Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP or required versioned template is unavailable, stop without changing project context.
11
+
12
+ 1. Determine evidence sources: user input, committed repository changes, completed tracks, or a combination.
13
+ 2. Apply the workflow clarification gate before drafting. Ask when the refresh request or evidence does not clearly establish the commit/time range, which context artifacts are in scope, whether files should describe current reality or a desired future state, how to resolve conflicts between user input and repository evidence, or whether cascading active-track updates are intended now.
14
+ 3. Before changing execution-governing context, inspect all active implementation journals and workers. Defer such changes until an approved quiescent boundary unless the human explicitly approves stopping and reconciling the affected executions through `$revise`. Draft focused diffs for product, guidelines, workflow, tech stack, general styleguide, and language/framework styleguides. Add/remove language guides only when the approved tech stack requires it.
15
+ 4. Assess impact on all active track specs, plans, and marked Pattern Seed sections in learning files. Route required track changes through the same cascading approval rules as `$revise`. Ask if a material impact remains uncertain after inspection.
16
+ 5. Call `template_get_many` once for `project/refresh` and `project/refresh-operation`, retain the versioned bundle, render `refreshes/refresh-<ts>.md`, and prepare `.cadre/operations/refresh-<ts>.json` with the evidence range, decisions, affected files, expected commit, approval, checkpoint, and progress. Present all artifacts and diffs for approval.
17
+ 6. After approval and before any context write, persist the refresh operation journal. Resume an existing matching journal from its first incomplete artifact; never replace it. Apply only approved changes, advancing its checkpoint and artifact progress after each write. Append project history, reseed affected active tracks, then preview and apply `tracks.md` through its MCP digest gate and call `state_validate`.
18
+ 7. Commit `cadre(refresh): update project context`, then record that SHA in the refresh journal and as `lastRefresh.commit`, mark the journal completed, and create the follow-up `cadre(refresh): record refresh commit` state commit. If interrupted after the first commit, identify and record the existing expected commit rather than repeating context changes.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Refresh"
3
+ short_description: "Refresh Cadre project context"
4
+ default_prompt: "Use $refresh to refresh project context from user input and repository changes."
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: revert
3
+ description: Prepare and execute a human-approved Git-aware revert of a Cadre task, phase, or track while preserving history and reconciling dependent state. Use for the revert command; prefer additive git revert commits over destructive history rewriting.
4
+ ---
5
+
6
+ # Cadre Revert
7
+
8
+ Load `.cadre/workflow.md`, project/track state, spec, plan, learning, review/revision history, recorded task commits, Git history, working tree, and dependent tracks. Read every affected file and relevant later diff before proposing a revert.
9
+
10
+ Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without beginning the revert.
11
+
12
+ 1. Resolve the exact task, phase, or track and its worker commits, task-to-phase merge commits, phase-to-canonical merge commits, and execution journal. Detect shared commits, later overlapping edits, active workers/worktrees, dirty changes, and dependent work.
13
+ 2. Build a revert proposal: commits in safe reverse order, conflicts/overlaps, expected file changes, state rollback, invalidated learning/patterns/marked learning seeds, and downstream impacts.
14
+ 3. Present the proposal and exact Git operations. Wait for explicit approval. Never use destructive reset/checkout or rewrite public history by default.
15
+ 4. Call `template_get_many` for `track/revert-operation`, render the approved operation into `state.json.operation`, and persist it before any Git mutation. Record the target kind/ID, safe reverse commit order, base commit, expected reconciliation commit, approved artifacts, approval time, checkpoint, and applied revert commits. Resume a matching operation; never replace it.
16
+ 5. Reach a quiescent execution boundary before reverting. Use `git revert` to create additive reversal commits, using the correct mainline parent for an approved merge-commit revert. After each successful revert commit, record its SHA and advance the operation checkpoint. Stop and present conflicts rather than guessing resolutions; rerun combined verification after resolution.
17
+ 6. Reconcile plan checkboxes without erasing provenance, append a revert history entry, set the earliest affected task/phase back to pending or blocked, and mark dependent tracks for approved revision/reseed as needed.
18
+ 7. Run relevant tests, present resulting diffs, preview and apply `tracks.md` through `tracks_render_preview` and `tracks_render_apply` with the unchanged approved digest, and call `state_validate`. Commit Cadre bookkeeping as `cadre(revert): reconcile <track-id>`, record that commit, clear the operation, and create a follow-up record commit when the bookkeeping cannot be included safely. On resume, never repeat a revert SHA already recorded by the operation.
19
+
20
+ If exact commit provenance is missing or commits mix unrelated work, stop with a precise manual recovery plan.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Revert"
3
+ short_description: "Safely revert tracked Cadre delivery work"
4
+ default_prompt: "Use $revert to prepare a Git-aware phase or track revert."
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: review
3
+ description: Review a Cadre track that is ready for review, present evidence-backed bugs for approval, add remediation phases, or mark a clean review cycle completed. Use for the review command and implement-review remediation cycles.
4
+ ---
5
+
6
+ # Cadre Review
7
+
8
+ Review only a `ready_for_review` track. Load `.cadre/workflow.md`, all track artifacts and learning, dependency context, relevant patterns/styleguides, implementation commits, and repository tests. Read every reviewed file before judging or proposing edits.
9
+
10
+ Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without changing review state.
11
+
12
+ ## Read context once
13
+
14
+ Build one bounded context inventory from `project_status`, the current track paths, and the reviewed Git range. Read each required artifact once. Do not run a line-count pass before reading, repeat `rg --files` discovery, or reread a whole file after truncated output; continue from the first unread line. During consecutive review cycles in the same flow, reuse unchanged product, workflow, pattern, and styleguide context and verify it by Git path/hash; reread the current state, plan, execution, new review range, and affected files/callers. Use batched parallel reads where independent.
15
+
16
+ The declared review mutation surface is `review_complete_preview`/`review_complete_apply` for clean completion. Finding-bearing review uses the explicitly journaled direct-write procedure below. Do not inspect the installed runtime, global tool catalog, or generated MCP bundle looking for another review-state tool.
17
+
18
+ Expected human decision count is one per review cycle when the human accepts the recommended exact remediation, approves a clean review, or explicitly rejects findings and approves clean completion. Ask again only when the human changes the proposal or new evidence changes its content or consequences.
19
+
20
+ ## Procedure
21
+
22
+ 1. Determine the commit range from the plan's recorded task commits. Inspect diffs and affected callers, tests, security boundaries, error paths, compatibility, acceptance criteria, and non-functional requirements.
23
+ 2. Run relevant verification without mutating production behavior. Report findings by severity with file/line evidence, impact, reproduction, and proposed acceptance criteria. Do not write a bug file yet.
24
+ 3. Prepare one decision-ready proposal before asking for approval:
25
+ - If findings exist, call `template_get_many` for `track/bug`, retain the versioned result, and draft the exact bug artifact plus the recommended dependency-aware remediation phases for all actionable findings. Every regular task declares same-phase dependencies, every added phase declares the phases it consumes and ends in the derived `User Manual Verification` barrier. Renumber the final phase/tasks as needed, reset that final manual barrier and phase completion to pending, and preserve its prior verification provenance in the review cycle/execution journal rather than leaving a second final phase. Call `execution_graph_validate` on the draft.
26
+ - Present the findings, exact artifact/plan diff, consequences, and choices together. One response may approve both the finding disposition and the unchanged exact artifacts. The human may instead request a subset or different remediation, reject all findings while explicitly accepting their risks and approve clean completion, or stop without mutation.
27
+ - If the human changes the finding subset or remediation, rebuild and validate the exact proposal and request approval once for that changed proposal. Do not reuse approval for superseded content.
28
+ - If no findings exist, present clean-review evidence and the exact completion transition once, then ask approval to complete the track.
29
+ 4. For approved changes, record a resumable `review` operation before changing the bug artifact, plan, or state. Increment the plan revision, set state to `in_progress`, reset review readiness, and record the review cycle. Call `tracks_render_preview`, show and apply its unchanged digest with `tracks_render_apply`, call `state_validate`, and commit `cadre(review): request changes for <track-id>`. Record that commit SHA as the new approved plan commit, clear the operation, and use `cadre(review): record changes for <track-id>` for follow-up bookkeeping when needed. The prior completed execution remains historical until `implement` starts a new execution ID for the changed graph.
30
+ 5. For an approved clean review, including an explicit reject-and-complete decision, bind the clean cycle and any accepted risks to `lastExecution.executionId`, its plan revision, graph digest, and reviewed HEAD. Call `review_complete_preview` with the exact approval record, evidence, and accepted risks, then pass its unchanged digest to `review_complete_apply`; this writes the completed track state and derived index together and returns final validation. Do not repeat `tracks_render_*`, `state_validate`, or `project_status` when that result is valid/current. If the preview differs materially from the transition already shown to the human, present the correction and obtain new approval before apply. Commit `cadre(review): complete <track-id>`.
31
+
32
+ Repeat review → implement → review until a human approves a clean review. Only this command may mark a track completed.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Review"
3
+ short_description: "Review a completed Cadre track"
4
+ default_prompt: "Use $review to review a track that is ready for review."
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: revise
3
+ description: Route a requested track change according to lifecycle state, revise an approved active baseline with resumable journaling, or propose a successor for completed or archived work. Use for the revise command or user-requested scope/plan changes.
4
+ ---
5
+
6
+ # Cadre Revise
7
+
8
+ Read `.cadre/workflow.md`, the full target track, its dependencies, all tracks that depend on it, relevant repository files, and applicable patterns. Read each artifact before editing; never propose a revision from guessed contents.
9
+
10
+ Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If the Cadre MCP is unavailable, stop without modifying the track.
11
+
12
+ ## Route by current status
13
+
14
+ - `drafting-spec`: follow the `track` specification procedure and resume its journal. The content is not yet an approved baseline, so do not create a revision artifact or increment a revision.
15
+ - `drafting-plan`: if the approved specification changes, perform the semantic revision procedure below and remain `drafting-plan`; if only the unapproved plan changes, resume the `track` planning procedure without a revision artifact.
16
+ - `planned`: perform the semantic revision and remain `planned`.
17
+ - `in_progress`: perform the semantic revision at a safe task boundary. Remain `in_progress` when all approved dependencies are complete; move to `planned` if an approved dependency is incomplete.
18
+ - `ready_for_review`: distinguish a defect against the approved specification from a changed desired outcome. Route a defect through `review`. For a scope, requirement, or acceptance change, perform the semantic revision, invalidate review readiness, append delivery and manual-verification work, and move to `in_progress`, or `planned` if an approved dependency is incomplete.
19
+ - `completed` or `archived`: do not mutate or reopen the track. Present a successor feature or bug track proposal that references the immutable source track and follow `track` only after approval.
20
+
21
+ ## Semantic revision procedure
22
+
23
+ 1. Reconcile `state.json.operation`, any execution journal, managed worktrees, workers, the working tree, and recent commits before drafting. Resume a matching `revise` operation from its first incomplete artifact. Before changing an active execution graph, reach an approved quiescent boundary: finish or stop workers, integrate approved work or preserve it on journaled branches, and clean no worktree by force. Finish or reconcile any other recorded operation first; never replace it.
24
+ 2. Restate the requested change and identify specification, acceptance, plan, learning seed/phase history, review readiness, and state consequences. Inspect active and dirty task work. If it overlaps the requested change, present the exact work and obtain approval to complete it, preserve it as superseded, or revert it before applying the revision.
25
+ 3. Apply the workflow clarification gate. Ask when materially different interpretations remain for the desired outcome, scope, acceptance criteria, compatibility, dependency changes, treatment of completed or partial work, or whether dependent tracks should change now. Do not infer permission to invalidate approved work.
26
+ 4. Trace transitive dependent tracks. For each, classify impact as none, reseed-only, plan change, spec change, or invalidated work, with evidence. If evidence cannot resolve a material impact, ask before choosing a classification.
27
+ 5. Call `template_get_many` once for `track/revision` and `track/revise-operation`, and retain the versioned bundle. Render `revisions/revision-<ts>.md` and draft exact diffs for every affected artifact. Record source and target status, the base commit, affected phases/tasks, completed and partial-work disposition, review impact, dependency impact, and verification work. Preserve completed tasks and commit markers; append or explicitly supersede work rather than erasing provenance.
28
+ 6. Increment the track revision exactly once. Increment the specification revision only if `spec.md` changes and the plan revision only if `plan.md` changes; keep the revision values in `state.json`, `spec.md`, `plan.md`, and the marked Pattern Seed consistent. Preserve completed task provenance, update explicit regular phase/task dependencies, restore derived manual-verification barriers, and call `execution_graph_validate`. A changed plan graph uses a new execution ID; never reuse a completed or superseded execution journal.
29
+ 7. Present the target revision and all cascading dependent-track changes together. Wait for explicit approval. Partial approval narrows the change set and requires a fresh impact assessment, transition calculation, and proposal.
30
+ 8. Before changing approved artifacts, write the rendered `revise` operation into every affected track's `state.json`. Use the same expected commit, record each approved artifact and per-artifact progress, and advance the durable checkpoint after each write.
31
+ 9. Apply only the approved changes, update relevant marked Pattern Seed sections without overwriting phase learning, set the approved source-to-target states, mark the earliest affected plan nodes pending in the replacement execution graph, and append track-local history. Do not add singular active phase/task fields to track state. Preview and apply `tracks.md` through `tracks_render_preview` and `tracks_render_apply` using the unchanged approved digest.
32
+ 10. Call `state_validate` and commit `cadre(revise): update <track-id>`. Reconcile interruption using the workflow journal rules. Record the commit in every revision entry, clear each completed operation, and use a follow-up `cadre(revise): record <track-id>` commit when bookkeeping cannot be part of the artifact commit.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Revise"
3
+ short_description: "Route or revise a Cadre track change"
4
+ default_prompt: "Use $revise to route a requested track change by lifecycle state and safely update any approved active baseline."
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: status
3
+ description: Validate and summarize current Cadre project, track, dependency, phase, review, refresh, and archive state without mutation. Use for the status command, progress reports, blockers, or deciding the next legal workflow action.
4
+ ---
5
+
6
+ # Cadre Status
7
+
8
+ Read `.cadre/workflow.md`, `project.json`, generated `tracks.md`, and track-local state/spec/plan files discovered under both `tracks/` and `archive/`. Read dependency state from each track's `state.json`, never from `tracks.md`. This command is read-only. If the Cadre MCP is unavailable, stop and report it; do not use a copied or reconstructed runtime.
9
+
10
+ Call `project_status` and `worktree_status` with the exact project root. Use the structured validation embedded in `project_status`; do not repeat `state_validate`. For every active implementation operation, also call `execution_status`. If their results disagree with files you read, report the inconsistency rather than repairing it.
11
+
12
+ Present:
13
+
14
+ - project setup checkpoint, pending operation journal, setup commit, and last-refresh commit;
15
+ - each track's type, status, durable checkpoint, pending operation, execution mode, ready/running/awaiting-approval/blocked/conflicted/integrated nodes, dependencies, revision, and next legal command;
16
+ - registered Cadre worktrees, worker branches, dirty/conflicted worktrees, and orphaned runtime directories;
17
+ - blockers and stale dependent-track assessments;
18
+ - ready-for-review, completed-not-archived, and archived counts;
19
+ - validation errors and uncommitted Cadre state changes.
20
+
21
+ Read any file before quoting or interpreting it. Do not mutate files, run commits, or silently normalize state.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Status"
3
+ short_description: "Show current Cadre project state"
4
+ default_prompt: "Use $status to show the current project and track state."
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: track
3
+ description: Create or resume a Cadre feature or bug track, including a functional/non-functional specification, acceptance criteria, dependencies, phased task plan, manual-verification gates, and relevant pattern learning seed. Use for the track command or new scoped delivery work.
4
+ ---
5
+
6
+ # Cadre Track
7
+
8
+ Create only `feature` or `bug` tracks. Resume an existing drafting track instead of replacing it.
9
+
10
+ ## Required context
11
+
12
+ Read `.cadre/workflow.md`, `project.json`, `product.md`, `guidelines.md`, `tech-stack.md`, relevant styleguides, `patterns/index.md`, and every declared dependency. Before editing an existing artifact, read it and its directly relevant context; never guess its contents.
13
+
14
+ Call `project_status` first and use its embedded structured validation; do not repeat `state_validate` at command entry. If required Cadre MCP tools are unavailable, stop; never recreate templates or runtime logic from memory.
15
+
16
+ ## Procedure
17
+
18
+ 1. Normalize a stable track ID. Look for its state at the status-derived active or archive location. If track state exists, reconcile its operation journal, working tree, and recent commits first. Resume the recorded checkpoint; never replace or restart an interrupted track. Otherwise determine title, type, goal, scope, dependencies, risks, and unknowns with the human.
19
+ 2. Apply the workflow clarification gate before drafting. Ask targeted questions whenever repository evidence and the request do not clearly establish a material choice such as feature versus bug, in/out of scope behavior, affected users/interfaces/data, compatibility or rollout expectations, acceptance measures, dependency tracks, or whether existing behavior must be preserved. Do not silently choose an interpretation.
20
+ 3. Call `template_get_many` once for `track/spec` and `track/state`. Retain the versioned bundle across approval turns. Render the functional requirements, non-functional requirements, acceptance criteria, additional information, and dependency impact. Present both proposed artifacts and wait for approval before writing or changing state.
21
+ 4. After approval, create/update track state with the spec operation journal before writing `spec.md`. Directly writing these approved track artifacts is intentional; do not search for an undeclared track-mutation MCP tool. Advance artifact checkpoints through written, then preview/apply the derived `tracks.md` update, call `state_validate`, require both canonical validity and current derived state, and advance to `commit-pending`. Commit as `cadre(track): specify <track-id>`, then record its SHA, clear the operation, move to `drafting-plan`, and commit the state record.
22
+ 5. Call `template_get_many` once for `track/plan` and `track/learning`, retain the versioned bundle, then draft an acyclic phase/task graph. Every regular phase explicitly declares phase dependencies and every regular task explicitly declares same-phase task dependencies. Do not repeat derived barriers: each phase's final `User Manual Verification` depends on every sibling task, while the final `Track-level User Manual Verification` phase contains only its manual task and depends on every preceding phase. Include tests, formatting, documentation, and Definition of Done work explicitly. Call `execution_graph_validate`; resolve every unknown reference, cycle, missing declaration, or material ambiguity before approval.
23
+ 6. Build the marked `Pattern Seed` section at the top of `learning.md` from patterns relevant to this spec and plan. Root phases read the seed; other phases read learning from their declared dependency phases. Cite pattern file paths and explain relevance. Do not invent patterns. Present the plan, graph, and learning seed for approval.
24
+ 7. After approval, journal the plan operation before writing `plan.md` and `learning.md`. Advance checkpoints through written, validated, and `commit-pending`; set track-local status to `planned`, call `tracks_render_preview`, present and apply its unchanged digest with `tracks_render_apply`, call `state_validate`, and commit `cadre(track): plan <track-id>`. Then record its SHA, clear the operation, set checkpoint `ready`, and commit `cadre(track): record plan <track-id>`.
25
+
26
+ For either track commit, reconcile interruptions before continuing:
27
+
28
+ - Journal plus matching dirty artifacts: continue the pending write/validation/commit.
29
+ - Journal plus clean tree and matching expected HEAD: record that commit; do not repeat it.
30
+ - Recorded SHA plus dirty bookkeeping: finish the state-record commit.
31
+ - Any mismatch: present it and stop rather than regenerating approved spec, plan, or learning.
32
+
33
+ The plan is the execution source of truth. Dependency changes or a modified spec require impact assessment and human approval through `$revise`.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Track"
3
+ short_description: "Specify and plan a Cadre track"
4
+ default_prompt: "Use $track to create or resume a feature or bug track."
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: wisp
3
+ description: Perform lightweight exploration, investigation, spikes, or questions without creating or mutating Cadre project/track state. Use for the wisp command when work is intentionally untracked; promote durable work into a track before implementation.
4
+ ---
5
+
6
+ # Cadre Wisp
7
+
8
+ If `.cadre/workflow.md` exists, read it first and retain its safety, repository, human-review, and read-before-edit rules while bypassing its delivery-state mutations. You may call the read-only `project_status` tool and use its embedded validation for context, but MCP availability is not required for a stateless exploration. Keep the exploration outside Cadre state: except for ignored disposable output under `.cadre/wisps/`, do not change `.cadre/`, track status, learning, patterns, or Cadre history.
9
+
10
+ 1. Define the exploration question and expected disposable output. When persistent disposable output is useful, use `.cadre/wisps/<timestamp>-<slug>/`; `.cadre/.gitignore` must exclude it from Git.
11
+ 2. Inspect relevant repository files. Before editing any existing file, read it and its directly relevant context; inspect the directory before creating a file.
12
+ 3. Prefer read-only investigation and temporary files outside the repository. Wisp files under `.cadre/wisps/` never enter Cadre state or commits. If persistent product-file edits are requested, show the proposed scope and obtain approval; do not commit automatically.
13
+ 4. Return findings, evidence, uncertainty, and a recommendation.
14
+ 5. If the result should become product work, recommend `$track`; do not retroactively mutate Cadre state from the wisp.
15
+
16
+ Wisp bypasses delivery tracking, not safety, repository instructions, or read-before-edit discipline.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cadre: Wisp"
3
+ short_description: "Explore without Cadre tracking"
4
+ default_prompt: "Use $wisp for untracked exploratory work."
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,5 @@
1
+ # Cadre-managed temporary execution worktrees
2
+ /.worktrees/
3
+
4
+ # Disposable Wisp output
5
+ /wisps/
@@ -0,0 +1,25 @@
1
+ # Engineering Guidelines
2
+
3
+ ## Architecture
4
+
5
+ {{ARCHITECTURE_GUIDANCE}}
6
+
7
+ ## Testing strategy
8
+
9
+ {{TEST_STRATEGY}}
10
+
11
+ ## Security and privacy
12
+
13
+ {{SECURITY_PRIVACY}}
14
+
15
+ ## Reliability and observability
16
+
17
+ {{RELIABILITY_OBSERVABILITY}}
18
+
19
+ ## Documentation and compatibility
20
+
21
+ {{DOCUMENTATION_COMPATIBILITY}}
22
+
23
+ ## Repository-specific commands
24
+
25
+ {{REPOSITORY_COMMANDS}}