cadre-ai 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +81 -0
- package/README.md +24 -10
- package/dist/cadre-cli.mjs +9 -6
- package/dist/cadre-mcp.mjs +916 -193
- package/package.json +1 -1
- package/skills/archive/SKILL.md +6 -6
- package/skills/create/SKILL.md +4 -4
- package/skills/implement/SKILL.md +4 -4
- package/skills/implement/references/governed-mode.md +1 -1
- package/skills/refresh/SKILL.md +3 -3
- package/skills/revert/SKILL.md +3 -3
- package/skills/review/SKILL.md +5 -5
- package/skills/revise/SKILL.md +4 -4
- package/skills/status/SKILL.md +2 -1
- package/skills/track/SKILL.md +5 -5
- package/skills/wisp/SKILL.md +3 -3
package/package.json
CHANGED
package/skills/archive/SKILL.md
CHANGED
|
@@ -9,9 +9,9 @@ Archive one or more `completed` tracks in a single batch. Read `.cadre/workflow.
|
|
|
9
9
|
|
|
10
10
|
At every required selection or approval boundary, show a concise batch summary or focused diff. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit`, using `clarification` for at most three questions and `approval` bound to the archive proposal digest. Treat only an `approved` result as approval. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form.
|
|
11
11
|
|
|
12
|
-
Call `project_status` first with `view: "project"` and use its embedded structured validation; do not repeat `state_validate` at command entry.
|
|
12
|
+
Call `project_status` first with `view: "project"` and use its embedded structured validation; do not repeat `state_validate` at command entry. Stop when `valid` is false or the Cadre MCP is unavailable; do not start or advance an archive batch.
|
|
13
13
|
|
|
14
|
-
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
|
|
14
|
+
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 and use descriptor tools when an ID must be resolved; do not discover MCP resources. The declared mutation surface is adaptive `archive_batch_candidate` followed by atomic `archive_batch_record`; do not inspect the installed runtime or tool catalog for alternatives.
|
|
15
15
|
|
|
16
16
|
Expected human decision count is one for the complete batch. Ask again only when its selection, content, or consequences change.
|
|
17
17
|
|
|
@@ -20,11 +20,11 @@ Expected human decision count is one for the complete batch. Ask again only when
|
|
|
20
20
|
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.
|
|
21
21
|
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.
|
|
22
22
|
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.
|
|
23
|
-
6. Call `candidate_stage_prepare` for `archive-<proposal-id
|
|
24
|
-
7. After approval, call only `{ mode: "apply", proposalToken }` on `archive_batch_candidate`; it re-reads staged files and rejects drift. Never make the two calls consecutively without the human decision between them. Commit all approved moves and derived changes together, keep the matching candidate stage through that checkpoint, and never stage it.
|
|
25
|
-
8. Call `archive_batch_record` once with the project root and batch ID; it derives the actual current HEAD and atomically records deterministic provenance without another approval. Create `cadre(archive): record batch <batch-id>`, then remove only the matching candidate stage.
|
|
23
|
+
6. Call `candidate_stage_prepare` for `archive-<proposal-id>` with `expectedFiles` equal to every proposed pattern, pattern-index, and active-track seed path, then write exactly that set. Call `archive_batch_candidate` with `request: { mode: "prepare", projectRoot, candidateId, selectedTracks?, updates }`; `updates` contains the required body-free descriptors. Present the resulting proposal once.
|
|
24
|
+
7. After approval, call only `request: { mode: "apply", proposalToken }` on `archive_batch_candidate`; it re-reads staged files and rejects drift. Never make the two calls consecutively without the human decision between them. Commit all approved moves and derived changes together, keep the matching candidate stage through that checkpoint, and never stage it.
|
|
25
|
+
8. Call `archive_batch_record` once with the project root and batch ID; it derives the actual current HEAD and atomically records deterministic provenance and the generated index without another approval. Create `cadre(archive): record batch <batch-id>`, then remove only the matching candidate stage.
|
|
26
26
|
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.
|
|
27
27
|
|
|
28
|
-
If interrupted
|
|
28
|
+
If interrupted, reuse the same approved apply token; the journal and approved hashes converge remaining moves/writes without another approval. Provenance recording is idempotent and never duplicates track/project history. Never redistill or start a second batch while one is active.
|
|
29
29
|
|
|
30
30
|
Do not delete learning, review cycles, revisions, bug reports, or commit provenance.
|
package/skills/create/SKILL.md
CHANGED
|
@@ -13,20 +13,20 @@ At every required clarification or approval boundary, show a concise summary or
|
|
|
13
13
|
|
|
14
14
|
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.
|
|
15
15
|
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.
|
|
16
|
-
3. Call `project_status` with `view: "project"` 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
|
|
16
|
+
3. Call `project_status` with `view: "project"` when `.cadre/project.json` exists and use its embedded structured validation; do not repeat `state_validate` at command entry. Stop on unexplained validation errors. Reconcile its setup journal, worktree, and recent commits. Resume the recorded checkpoint exactly; do not restart or overwrite setup. Offer the Cadre refresh or status workflow only after completed setup.
|
|
17
17
|
4. Call `template_get_many` once for `project/product`, `project/guidelines`, and `project/tech-stack`. Retain that versioned bundle across approval turns and do not refetch it unless its version or content hash changes. Use each response's `artifactPath` as its eventual `.cadre/`-relative destination. `workflow.md`, selected default styleguides, `patterns/index.md`, `.gitignore`, `project.json`, `tracks.md`, and the empty lifecycle directories are initialization outputs generated by the MCP; stage only an explicitly edited workflow or styleguide override. 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.
|
|
18
18
|
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.
|
|
19
19
|
6. Identify the proposed `workflow.md` by template ID, template-set version, content hash, and a concise summary of its material rules and consequences. Do not print the complete unchanged bundled workflow unless the human asks. If changes are requested, show a focused diff and summarize the resulting behavior; show the complete revised workflow only on request. Do not create a standalone workflow approval.
|
|
20
20
|
7. Call `styleguide_resolve` with the proposed technologies. Always include the general guide and resolve the applicable language, framework, markup, and build-tool guides as one set. Preserve evidenced brownfield conventions. Ask only when a material convention choice cannot be resolved from the request and repository; do not ask the human to accept each default guide or the final set separately.
|
|
21
|
-
8. Call `candidate_stage_prepare` for candidate `create
|
|
21
|
+
8. Expected human decision count is one. Call `candidate_stage_prepare` for candidate `create` with `expectedFiles` equal to `product.md`, `guidelines.md`, `tech-stack.md`, and only requested `workflow.md` or `styleguides/*.md` overrides; this prunes removed files and enforces `/stage/`. Write them beneath `.cadre/stage/create` (for example `.cadre/stage/create/product.md`). Never write `.cadre/init/*` or canonical artifacts before apply, and do not pass artifact bodies through MCP. Call `project_init_candidate` with `request: { mode: "prepare", projectRoot, projectName, context, gitDisposition, baseCommit, approvedAt, stagedFiles, styleguideIds }`. After explicit confirmation, call only `request: { mode: "apply", proposalToken }`. Never make those two calls consecutively without the human decision, and do not add later approval prompts.
|
|
22
22
|
9. 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.
|
|
23
23
|
10. Call `state_validate` and report the result. Commit the authorized setup as `cadre(create): initialize project harness` only when validation is clean and checkpoint is `commit-pending`; validation failure is a blocker, not a request to approve an exception implicitly.
|
|
24
|
-
11. Call `setup_record_commit`; it records the actual current HEAD. If the index needs regeneration, call `tracks_render` once
|
|
24
|
+
11. Call `setup_record_commit`; it records the actual current HEAD. If the index needs regeneration, call `tracks_render` once. Commit the bookkeeping as `cadre(create): record setup commit`, then remove only `.cadre/stage/create` after its approved hashes and provenance are complete.
|
|
25
25
|
|
|
26
26
|
## Resume protocol
|
|
27
27
|
|
|
28
28
|
- `git-pending`: initialize Git only when the journal says `initialize`; verify the exact approved root and record the checkpoint.
|
|
29
|
-
- `.cadre/stage/create` with only
|
|
29
|
+
- `.cadre/stage/create` with only bootstrap state: re-read the candidate manifest and resume approval or apply. Matching partially promoted canonical files are resumable; any differing or unrelated canonical byte is a hard stop.
|
|
30
30
|
- `commit-pending` plus matching dirty artifacts: validate and create the expected artifact commit.
|
|
31
31
|
- Clean worktree plus matching expected HEAD/base relationship: treat the artifact commit as successful and record that SHA; never repeat it.
|
|
32
32
|
- Recorded setup SHA plus dirty bookkeeping: finish only the follow-up state commit.
|
|
@@ -20,7 +20,7 @@ Read only the references required by current state:
|
|
|
20
20
|
|
|
21
21
|
## Entry and modes
|
|
22
22
|
|
|
23
|
-
1. Call `project_status` once with `view: "implementation"`, `trackId`, and the known `executionId` if resuming. This is the complete preflight: validation, graph, scheduler, dependency, and worktree state
|
|
23
|
+
1. Call `project_status` once with `view: "implementation"`, `trackId`, and the known `executionId` if resuming. This is the complete preflight: validation, graph, scheduler, dependency, and worktree state; do not repeat `state_validate` at command entry. Stop if `valid` or `graph.valid` is false, `upgradeRequired` is true, the track is candidate-only, or the MCP is unavailable.
|
|
24
24
|
2. Read `.cadre/workflow.md`, track spec/plan/learning/state, relevant dependency learning, pattern/styleguide context, and repository instructions. Read before editing.
|
|
25
25
|
3. Scheduling defaults to `parallel`; use `sequential` only when requested. Approval mode defaults to `phase`; use `governed` or `autonomous` only when explicitly requested. Resume journaled modes. A mode authorizes only work bounded by the approved spec and plan.
|
|
26
26
|
4. For a new execution, the implement invocation authorizes `execution_start`; call it once with the modes. Do not add a start approval outside `governed`. Resume an existing operation instead of creating another.
|
|
@@ -33,7 +33,7 @@ Host security permission is distinct from Cadre approval. Request only a narrow
|
|
|
33
33
|
|
|
34
34
|
Use the scheduler returned by the preflight or latest mutation receipt. Plan order only breaks ties.
|
|
35
35
|
|
|
36
|
-
- Execute one ready task directly in main when delegation adds no value.
|
|
36
|
+
- Execute one ready task directly in main when delegation adds no value. Follow returned `eventGuidance`: `record_commit` requires commit, verification, and authorization; `record_verification` requires those same fields; `record_integration` requires commit and verification; `block` requires a blocker. A running-phase `complete` also requires commit, verification, and authorization.
|
|
37
37
|
- Delegate only independent or cohesive work. Read `references/parallel-workers.md` before doing so.
|
|
38
38
|
- Never checkpoint evidence before it exists. Each regular task has one Conventional Commit and a distinct recorded SHA. `record_commit` includes focused verification and authorization evidence.
|
|
39
39
|
- A `.cadre/**`-only bookkeeping commit does not invalidate product verification while product files, tests, inputs, and verification policy remain unchanged.
|
|
@@ -42,7 +42,7 @@ For a delegated node, the normal lifecycle is four MCP calls:
|
|
|
42
42
|
|
|
43
43
|
1. `worktree_create` creates or reconciles the derived worktree and records `start` with its path and branch.
|
|
44
44
|
2. After main reviews the returned worker diff/checks and the worker creates its clean task commit, `execution_checkpoint` records `record_commit` with SHA, verification, and mode/human authorization.
|
|
45
|
-
3. `integration` with `mode: "prepare"` validates and merges immediately in `phase`/`autonomous`, recording `record_integration` in its receipt. In `governed` it returns `approval_required`; after human approval call only `{ mode: "apply", proposalToken }`. Never make the governed calls consecutively without human input.
|
|
45
|
+
3. `integration` with `request: { mode: "prepare", projectRoot, trackId, executionId, nodeId }` validates and merges immediately in `phase`/`autonomous`, recording `record_integration` in its receipt. In `governed` it returns `approval_required`; after human approval call only `request: { mode: "apply", proposalToken }`. Never make the governed calls consecutively without human input.
|
|
46
46
|
4. `worktree_cleanup` verifies integration, removes the worktree/branch, and records `complete` when all invariants hold.
|
|
47
47
|
|
|
48
48
|
Do not add standalone `start`, `record_integration`, or `complete` calls around this composite path. Retried calls reconcile an existing worktree, merge commit, removed worktree, or missing journal transition. Keep standalone checkpoints for direct-main work, manual verification, blockers, conflict recovery, and interruption repair.
|
|
@@ -52,6 +52,6 @@ Do not add standalone `start`, `record_integration`, or `complete` calls around
|
|
|
52
52
|
- A phase barrier depends on all sibling tasks. Prepare evidence against the phase head. In `governed` and `phase`, present it once and record human approval; in `autonomous`, record persisted-mode authorization.
|
|
53
53
|
- After the barrier, integrate the phase, record dependency-aware learning and task/merge provenance in canonical plan/learning, and make one `cadre(implement): record <track-id> <phase-id>` bookkeeping commit. Start dependents only after cleanup/completion.
|
|
54
54
|
- The final `Track-level User Manual Verification` runs in main against fully integrated canonical HEAD and always requires explicit human approval.
|
|
55
|
-
- When every node is complete, learning/provenance is recorded, worktrees are gone, and final verification is approved, run full relevant checks and call `execution_finish
|
|
55
|
+
- When every node is complete, learning/provenance is recorded, worktrees are gone, and final verification is approved, run full relevant checks and call `execution_finish`. It converges interrupted final writes using the persisted completion identity. Commit only its completed journal, plan markers, `ready_for_review` state, and `tracks.md` as `cadre(implement): complete <track-id>`; never let review absorb this bookkeeping.
|
|
56
56
|
|
|
57
57
|
Never mark a track `completed`; only an approved clean review may do that.
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Governed mode requires human review of each regular task diff before its commit, every conflict resolution, each manual-verification barrier, and each integration or other material mutation required by the approved workflow.
|
|
4
4
|
|
|
5
|
-
Record a ready diff as `awaiting_approval` with verification evidence, present it once, and proceed only after explicit approval. Bind integration approval to the `integration` prepare digest. After approval call the same tool with only `{ mode: "apply", proposalToken }`; changed content or Git/state drift requires a fresh prepare and decision.
|
|
5
|
+
Record a ready diff as `awaiting_approval` with verification evidence, present it once, and proceed only after explicit approval. Bind integration approval to the `integration` prepare digest. After approval call the same tool with only `request: { mode: "apply", proposalToken }`; changed content or Git/state drift requires a fresh prepare and decision.
|
|
6
6
|
|
|
7
7
|
Do not convert deterministic bookkeeping or cleanup following the approved unchanged operation into another decision.
|
package/skills/refresh/SKILL.md
CHANGED
|
@@ -9,12 +9,12 @@ Read `.cadre/workflow.md`, `project.json`, all project context files, the last r
|
|
|
9
9
|
|
|
10
10
|
At every required clarification or approval boundary, show a concise context/impact summary or focused diff. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit`, using `clarification` for at most three questions and `approval` bound to the exact refresh proposal checkpoint. Treat only an `approved` result as approval. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form.
|
|
11
11
|
|
|
12
|
-
Call `project_status` first with `view: "project"` and use its embedded structured validation; do not repeat `state_validate` at command entry.
|
|
12
|
+
Call `project_status` first with `view: "project"` and use its embedded structured validation and complete errors; do not repeat `state_validate` at command entry. Stop when `valid` is false unless every error is explicitly and safely repaired by this refresh proposal. If it reports `upgradeRequired`, use only its exact runtime/template targets.
|
|
13
13
|
|
|
14
14
|
1. Determine evidence sources: user input, committed repository changes, completed tracks, or a combination.
|
|
15
15
|
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.
|
|
16
16
|
3. Before changing execution-governing context, inspect all active implementation journals and workers. Include any required stop, preservation, or reconciliation at a safe quiescent boundary in the final refresh proposal; do not ask for a separate quiescence approval when the exact disposition can be assessed with the refresh. Draft focused diffs for product, guidelines, workflow, tech stack, general styleguide, and language/framework styleguides. Add/remove language guides only when the proposed tech stack requires it.
|
|
17
|
-
4. Assess impact on all active track specs, plans, and marked Pattern Seed sections
|
|
18
|
-
5. Call `template_get_many` once for `project/refresh` and `project/refresh-operation`, then `candidate_stage_prepare` for `refresh-<ts
|
|
17
|
+
4. Assess impact on all active track specs, plans, and marked Pattern Seed sections using the same rules as the Cadre revise workflow, but include every cascading change in this refresh envelope.
|
|
18
|
+
5. Expected human decision count is one. Call `template_get_many` once for `project/refresh` and `project/refresh-operation`, then `candidate_stage_prepare` for `refresh-<ts>` with `expectedFiles` equal to the complete refresh record and project/track update set. Render exactly those files. Use `targetRuntimeVersion` and `targetTemplateSetVersion` from status for legacy projects. Call `candidate_inspect` with `planValidations` containing one entry for every staged root or nested `plan.md`, using its exact candidate-relative path and intended target status, or omit it for a plan-free refresh. Keep cascading changes inside this envelope instead of starting separate approval cycles.
|
|
19
19
|
6. After approval and before any context or track write, persist the refresh operation journal with the approved manifest digest and path/hash entries. Resume an existing matching journal from its first incomplete artifact; never replace it. Promote only authorized staged changes, verify canonical hashes, and advance its checkpoint and artifact progress after each write. Append project and track history, reseed affected active tracks, then call `tracks_render` once and call `state_validate` without another prompt.
|
|
20
20
|
7. Commit `cadre(refresh): update project context` without staging `.cadre/stage/`, 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. Remove only the matching candidate stage after provenance is recorded. These unchanged deterministic consequences remain inside the one refresh envelope. If interrupted after the first commit, identify and record the existing expected commit rather than repeating context changes.
|
package/skills/revert/SKILL.md
CHANGED
|
@@ -9,13 +9,13 @@ Load `.cadre/workflow.md`, project/track state, spec, plan, learning, review/rev
|
|
|
9
9
|
|
|
10
10
|
At every required clarification or approval boundary, show a concise impact summary or focused diff. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit`, using `clarification` for at most three questions and `approval` bound to the exact revert proposal checkpoint. Treat only an `approved` result as approval. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form.
|
|
11
11
|
|
|
12
|
-
Call `project_status` first with `view: "implementation"` and `trackId` for active work, otherwise `view: "track"`; use its embedded structured validation and do not repeat `state_validate` at command entry.
|
|
12
|
+
Call `project_status` first with `view: "implementation"` and `trackId` for active canonical work, otherwise `view: "track"`; use its embedded structured validation and do not repeat `state_validate` at command entry. Stop on invalid state. Candidate-only or drafting state has no approved implementation provenance and must return to track/revise. For `completed` or `archived`, keep the source immutable and propose a linked successor bug track containing the rollback; do not reverse Git or reopen/move the terminal track here.
|
|
13
13
|
|
|
14
14
|
Expected human decision count is one on the clean path. The exact revert proposal authorizes additive Git reversals, tests, plan/state/learning reconciliation, generated indexes, commits, and provenance bookkeeping when their content and consequences remain unchanged.
|
|
15
15
|
|
|
16
16
|
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.
|
|
17
|
-
2.
|
|
18
|
-
3. Call `candidate_inspect` once for the staged reconciliation set
|
|
17
|
+
2. For an eligible active track, build the exact additive revert proposal, call `candidate_stage_prepare` for `revert-<track-id>` with `expectedFiles` equal to every reconciliation artifact, and render exactly those files beneath the stage.
|
|
18
|
+
3. Call `candidate_inspect` once for the staged reconciliation set. Supply one `planValidations` entry for every staged root or nested `plan.md`, using its exact candidate-relative path and post-revert track status; omit the list only when the candidate contains no plans. Present every plan result, the manifest, Git operations, expected diff, downstream reconciliation, verification, index, and commits as one authorization envelope bound to its digest. Never rewrite public history by default.
|
|
19
19
|
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 manifest digest and path/hash entries, approval time, checkpoint, and applied revert commits. Resume a matching operation; never replace it.
|
|
20
20
|
5. Reach the authorized 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. If a conflict has one unambiguous in-scope resolution that preserves the approved resulting semantics, resolve and verify it inside the envelope. If it introduces a material choice or changes the proposed result, stop and present one corrected proposal rather than accumulating per-file approval prompts.
|
|
21
21
|
6. Promote only the approved staged Cadre files, verify their canonical hashes, 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.
|
package/skills/review/SKILL.md
CHANGED
|
@@ -9,7 +9,7 @@ Review only a `ready_for_review` track. Load `.cadre/workflow.md`, all track art
|
|
|
9
9
|
|
|
10
10
|
At every required clarification or approval boundary, show a concise finding/evidence summary and focused diff. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit`, using `clarification` for at most three questions and `approval` bound to the current proposal digest or reviewed execution/HEAD. Treat only an `approved` result as approval. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form.
|
|
11
11
|
|
|
12
|
-
Call `project_status` first with `view: "track"` and `trackId`; use its embedded structured validation and do not repeat `state_validate` at command entry.
|
|
12
|
+
Call `project_status` first with `view: "track"` and `trackId`; use its embedded structured validation and do not repeat `state_validate` at command entry. Stop when `valid` is false. Continue only for `kind: "canonical_track"` and `ready_for_review`; candidate-only or any other lifecycle state stops with its returned next action.
|
|
13
13
|
|
|
14
14
|
## Read context once
|
|
15
15
|
|
|
@@ -21,14 +21,14 @@ Expected human decision count is one per review cycle when the human accepts the
|
|
|
21
21
|
|
|
22
22
|
## Procedure
|
|
23
23
|
|
|
24
|
-
1.
|
|
24
|
+
1. Read the completed execution journal and review its exact `baseCommit..headCommit` range, which includes the first implementation commit. Inspect diffs and affected callers, tests, security boundaries, error paths, compatibility, acceptance criteria, and non-functional requirements.
|
|
25
25
|
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.
|
|
26
26
|
3. Prepare one decision-ready proposal before asking for approval:
|
|
27
|
-
- If findings exist, call `template_get_many` for `track/bug`,
|
|
28
|
-
- Call `candidate_inspect` once for the complete staged bug/plan set with `targetStatus: "in_progress"`. Present findings, exact diff, graph summary, manifest, consequences, and choices together, bound to its digest. One response may approve both the finding disposition and the unchanged exact artifacts, or reject all findings while explicitly accepting their risks and approve clean completion.
|
|
27
|
+
- If findings exist, call `template_get_many` for `track/bug`, then `candidate_stage_prepare` for `review-<track-id>` with `expectedFiles` equal to the exact bug artifact paths plus `plan.md`. Draft only those files beneath the stage so removed findings cannot remain. Do not pass plan Markdown through MCP or create a temporary project copy.
|
|
28
|
+
- Call `candidate_inspect` once for the complete staged bug/plan set with `planValidations: [{ path: "plan.md", targetStatus: "in_progress" }]`. Present findings, exact diff, graph summary, manifest, consequences, and choices together, bound to its digest. One response may approve both the finding disposition and the unchanged exact artifacts, or reject all findings while explicitly accepting their risks and approve clean completion.
|
|
29
29
|
- 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.
|
|
30
30
|
- If no findings exist, present clean-review evidence and the exact completion transition once, then ask approval to complete the track.
|
|
31
31
|
4. For approved changes, record a resumable `review` operation containing the approved manifest digest and path/hash entries before changing the bug artifact, plan, or state. Promote only those staged files, verify their canonical hashes, increment the plan revision, set state to `in_progress`, reset review readiness, and record the review cycle. Call `tracks_render` once, validate, and commit `cadre(review): request changes for <track-id>` without staging `.cadre/stage/`. 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. Remove only the matching candidate stage after its canonical hashes and commits are recorded. The prior completed execution remains historical until `implement` starts a new execution ID for the changed graph.
|
|
32
|
-
5. For an approved clean review, call `review_complete` with `mode: "prepare"
|
|
32
|
+
5. For an approved clean review, call `review_complete` with `request: { mode: "prepare", projectRoot, trackId, approval, acceptedRisks? }`. The server derives the range from the completed execution base through its reviewed HEAD. After approval, call only `request: { mode: "apply", proposalToken }`. A retry converges a matching cycle/index without duplicating history. Commit `cadre(review): complete <track-id>`.
|
|
33
33
|
|
|
34
34
|
Repeat review → implement → review until a human approves a clean review. Only this command may mark a track completed.
|
package/skills/revise/SKILL.md
CHANGED
|
@@ -9,7 +9,7 @@ Read `.cadre/workflow.md`, the full target track, its dependencies, all tracks t
|
|
|
9
9
|
|
|
10
10
|
At every required clarification or approval boundary, show a concise impact summary or focused diff. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit`, using `clarification` for at most three questions and `approval` bound to the exact revision proposal checkpoint. Treat only an `approved` result as approval. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form.
|
|
11
11
|
|
|
12
|
-
Call `project_status` first with `view: "implementation"` and `trackId` for active work, otherwise `view: "track"`; use its embedded structured validation and do not repeat `state_validate` at command entry.
|
|
12
|
+
Call `project_status` first with `view: "implementation"` and `trackId` for active canonical work, otherwise `view: "track"`; use its embedded structured validation and do not repeat `state_validate` at command entry. Stop on invalid status. A `staged_track_candidate` has no approved baseline: route its changes through the track proposal without creating a revision artifact or operation.
|
|
13
13
|
|
|
14
14
|
## Route by current status
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@ Call `project_status` first with `view: "implementation"` and `trackId` for acti
|
|
|
18
18
|
- `planned`: perform the semantic revision and remain `planned`.
|
|
19
19
|
- `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.
|
|
20
20
|
- `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.
|
|
21
|
-
- `completed` or `archived`: do not mutate or reopen the track. Present a successor feature or bug track proposal
|
|
21
|
+
- `completed` or `archived`: do not mutate or reopen the track. Present a linked successor feature or bug track proposal referencing the immutable source, then use the Cadre track workflow only after approval.
|
|
22
22
|
|
|
23
23
|
## Semantic revision procedure
|
|
24
24
|
|
|
@@ -28,9 +28,9 @@ Expected human decision count is one when the requested change and partial-work
|
|
|
28
28
|
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. When it overlaps the requested change, include its exact disposition—complete, preserve as superseded, or additive revert—in the combined revision proposal rather than creating a separate approval when that disposition can be safely assessed in advance.
|
|
29
29
|
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.
|
|
30
30
|
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.
|
|
31
|
-
5. Call `template_get_many` once for `track/revision` and `track/revise-operation`, then `candidate_stage_prepare` for `revise-<track-id
|
|
31
|
+
5. Call `template_get_many` once for `track/revision` and `track/revise-operation`, then `candidate_stage_prepare` for `revise-<track-id>` with `expectedFiles` equal to the exact revision and affected artifact paths. Render only that set beneath the stage, preserving eventual track-relative paths and completed provenance.
|
|
32
32
|
6. Increment revisions exactly once and restore derived manual-verification barriers. A changed plan uses a new execution ID. Do not pass plan Markdown through MCP, validate the stale canonical plan, or create a temporary project copy.
|
|
33
|
-
7. Call `candidate_inspect` once for every staged revision and cascading artifact
|
|
33
|
+
7. Call `candidate_inspect` once for every staged revision and cascading artifact. Supply one `planValidations` entry for every staged root or nested `plan.md`, using its exact candidate-relative path and intended resulting track status; omit the list only when the candidate contains no plans. Present every plan result, the target revision, manifest, partial-work disposition, dependent changes, lifecycle transitions, commits, and bookkeeping together, bound to its digest. Partial approval requires a fresh inspection.
|
|
34
34
|
8. Before changing approved artifacts, write the rendered `revise` operation into every affected track's `state.json`. Use the same expected commit, record the approved manifest digest and path/hash entries, record per-artifact progress, and advance the durable checkpoint after each promoted staged file.
|
|
35
35
|
9. Promote only the authorized staged changes, verify their canonical hashes, 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. Call `tracks_render` once without another prompt. Never stage `.cadre/stage/`; remove only the matching candidate stage after its canonical hashes and commits are recorded.
|
|
36
36
|
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. These unchanged deterministic consequences remain inside the revision authorization envelope.
|
package/skills/status/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Validate and summarize current Cadre project, track, dependency, ph
|
|
|
7
7
|
|
|
8
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
9
|
|
|
10
|
-
Call `project_status` once with the
|
|
10
|
+
Call `project_status` once with the narrowest view and use its embedded structured validation; do not repeat `state_validate` at command entry. Treat `errors` as the complete explanation for `valid` and `focusedErrors` as the selected-track subset. Project view reports staged candidates; focused view distinguishes candidate-only, canonical-with-stage, malformed canonical, and unknown IDs. Never silently treat a stage as canonical or omit a shadowed candidate.
|
|
11
11
|
|
|
12
12
|
Present:
|
|
13
13
|
|
|
@@ -17,5 +17,6 @@ Present:
|
|
|
17
17
|
- blockers and stale dependent-track assessments;
|
|
18
18
|
- ready-for-review, completed-not-archived, and archived counts;
|
|
19
19
|
- validation errors and uncommitted Cadre state changes.
|
|
20
|
+
- staged proposal manifests, malformed stages, and canonical candidates awaiting safe cleanup.
|
|
20
21
|
|
|
21
22
|
Read any file before quoting or interpreting it. Do not mutate files, run commits, or silently normalize state.
|
package/skills/track/SKILL.md
CHANGED
|
@@ -13,16 +13,16 @@ At every required clarification or approval boundary, show a concise summary or
|
|
|
13
13
|
|
|
14
14
|
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.
|
|
15
15
|
|
|
16
|
-
Call `project_status` first with `view: "project"` for a new track or `view: "track"` plus `trackId` when resuming, and use its embedded structured validation; do not repeat `state_validate` at command entry.
|
|
16
|
+
Call `project_status` first with `view: "project"` for a new track or `view: "track"` plus `trackId` when resuming, and use its embedded structured validation; do not repeat `state_validate` at command entry. Stop when `valid` is false until every returned error is understood. A focused `kind: "staged_track_candidate"` is unapproved; resume it through `candidate_inspect`. A `kind: "canonical_track"` may resume here only in `drafting-spec` or `drafting-plan`. For `planned` or `in_progress`, use implementation or revision; for `ready_for_review`, use review; for terminal state, create a separately approved successor. Never replace a non-drafting canonical track.
|
|
17
17
|
|
|
18
18
|
## Procedure
|
|
19
19
|
|
|
20
|
-
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.
|
|
20
|
+
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. If only `track-<track-id>` candidate state exists, retain its exact files and resume the pre-approval proposal instead of treating it as a track or restarting it. Otherwise determine title, type, goal, scope, dependencies, risks, and unknowns with the human.
|
|
21
21
|
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.
|
|
22
|
-
3. Call `template_get_many` once for `track/spec`, `track/state`, `track/plan`, and `track/learning
|
|
22
|
+
3. Call `template_get_many` once for `track/spec`, `track/state`, `track/plan`, and `track/learning`. Call `candidate_stage_prepare` for `track-<track-id>` with exact `expectedFiles: ["spec.md", "plan.md", "learning.md"]`, then write those files beneath the returned stage.
|
|
23
23
|
4. Draft an acyclic phase/task graph from that proposed specification. 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. Do not pass plan Markdown through MCP, write it into canonical `.cadre/`, or create a temporary project copy for validation.
|
|
24
24
|
5. Build the marked `Pattern Seed` section at the top of `learning.md` from patterns relevant to the proposed 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.
|
|
25
|
-
6. Call `candidate_inspect` once for candidate `track-<track-id>`, exactly `spec.md`, `plan.md`, and `learning.md`,
|
|
25
|
+
6. Call `candidate_inspect` once for candidate `track-<track-id>`, exactly `spec.md`, `plan.md`, and `learning.md`, with `planValidations: [{ path: "plan.md", targetStatus: "planned" }]`. Resolve all graph errors before approval. Expected human decision count is one for a clear new track. Present the exact specification, state summary, graph summary, learning seed, manifest, two planned commits, lifecycle transition, and deterministic consequences as one authorization envelope bound to its digest; do not create a specification-only approval prompt. Changed staged content or validation context requires one fresh inspection and corrected proposal.
|
|
26
26
|
7. After approval, create/update track state with one operation journal covering `spec.md`, `plan.md`, and `learning.md`, including the approved manifest digest and path/hash entries. Copy all three exact staged artifacts into the durable `.cadre/tracks/<track-id>/` worktree before the first commit, verify their hashes again, and retain the candidate stage until that verification succeeds so a resumed session never has to reconstruct approved content from conversation memory. Direct writes are intentional; do not search for an undeclared mutation tool. Validate the specification, call `tracks_render` once, stage only the specification-stage files and never `.cadre/stage/`, commit `cadre(track): specify <track-id>`, and record its SHA while the approved plan/learning remain journaled dirty artifacts. Preserve and transition the same approval envelope into planning instead of clearing it or asking again. Validate `plan.md` and `learning.md`, set status to `planned`, call `tracks_render` once, commit `cadre(track): plan <track-id>`, record its SHA, clear the operation, set checkpoint `ready`, and commit `cadre(track): record plan <track-id>`. Remove only the matching candidate stage after its canonical hashes and commits are recorded. All generated indexes, validation, commits, and state-record bookkeeping are unchanged deterministic consequences and require no additional approval.
|
|
27
27
|
|
|
28
28
|
For either track commit, reconcile interruptions before continuing:
|
|
@@ -32,4 +32,4 @@ For either track commit, reconcile interruptions before continuing:
|
|
|
32
32
|
- Recorded SHA plus dirty bookkeeping: finish the state-record commit.
|
|
33
33
|
- Any mismatch: present it and stop rather than regenerating approved spec, plan, or learning.
|
|
34
34
|
|
|
35
|
-
The plan is the execution source of truth. Dependency changes or a modified spec require
|
|
35
|
+
The plan is the execution source of truth. Dependency changes or a modified approved spec require the Cadre revise workflow.
|
package/skills/wisp/SKILL.md
CHANGED
|
@@ -9,10 +9,10 @@ If `.cadre/workflow.md` exists, read it first and retain its safety, repository,
|
|
|
9
9
|
|
|
10
10
|
When the exploration needs a material clarification and the Cadre MCP is available, show concise context. Inspect the active host policy before calling `workflow_elicit`: if the task context reports approval policy `never`, including Codex Full Access, skip the form and ask the same short question once in chat. Otherwise prefer `workflow_elicit` with at most three questions. If it returns `fallback_required`, or immediately returns `declined` while the task explicitly reports policy `never`, ask the same short question once in chat; the latter is policy rejection, not a human decline. Never request secrets or retry the form. Standard Wisp still has no approval form unless the human explicitly insists on an untracked persistent edit.
|
|
11
11
|
|
|
12
|
-
1. Define the exploration question and expected disposable output.
|
|
12
|
+
1. Define the exploration question and expected disposable output. Use `.cadre/wisps/<timestamp>-<slug>/` only when an initialized project already has a regular `.cadre/.gitignore` containing `/wisps/`. Otherwise use an OS temporary directory and never create `.cadre` for a wisp.
|
|
13
13
|
2. Inspect relevant repository files. Before editing any existing file, read it and its directly relevant context; inspect the directory before creating a file.
|
|
14
|
-
3. Prefer read-only investigation and temporary files outside the repository. Standard Wisp has zero approval prompts. Wisp files
|
|
14
|
+
3. Prefer read-only investigation and temporary files outside the repository. Standard Wisp has zero approval prompts. Wisp files never enter Cadre state or commits. Promote requested persistent product changes into the Cadre track workflow; only when the human explicitly insists on an untracked persistent edit, present one exact scope approval and do not commit automatically.
|
|
15
15
|
4. Return findings, evidence, uncertainty, and a recommendation.
|
|
16
|
-
5. If the result should become product work, recommend
|
|
16
|
+
5. If the result should become product work, recommend the Cadre track workflow; do not retroactively mutate Cadre state from the wisp.
|
|
17
17
|
|
|
18
18
|
Wisp bypasses delivery tracking, not safety, repository instructions, or read-before-edit discipline.
|