wdi-method 0.6.19 → 0.6.24

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.
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: wdi-daily-what-to-build
3
+ description: Turn raw manual-test notes into a triaged, reviewed spec/ticket ready for wdi-autopilot to pick up in a separate session. Invoke as `/wdi-daily-what-to-build [reviewer] <your raw notes>`.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # WDI Daily What-to-Build Triage
8
+
9
+ Daily entry point for "I just tested something by hand, now what." Classifies the notes (new feature,
10
+ fix, removal, or green), authors the resulting spec or ticket through this repo's own `wdi-build` flow,
11
+ dispatches an independent second opinion grounded in the *original* notes, folds that feedback back in,
12
+ then stops — this run never continues into `wdi-autopilot`, a commit, or a push.
13
+
14
+ Spec lifecycle maintenance (archiving or pruning closed specs) belongs to `/wdi-prune-or-archive`;
15
+ this skill remains 100% focused on triaging incoming test notes into actionable specs without administrative
16
+ interruption.
17
+
18
+ `/wdi-daily-what-to-build [reviewer] <notes>` — if the first word matches a known runner or a reviewer
19
+ defined in `.control/custom-dispatch.yaml`, it picks the reviewer; otherwise all input is treated as
20
+ the notes verbatim. Multi-line notes are accepted unedited; none of it gets summarized before review
21
+ dispatch.
22
+
23
+ ## 0. Precondition
24
+
25
+ Confirm `.control/registry/index.yaml` exists in the repo root. If it does not, this is not a WDI
26
+ Method product repo and this skill has no corpus to write into — report that and stop.
27
+
28
+ ## 1. Keep the notes verbatim
29
+
30
+ Hold the raw notes as given. They are forwarded unedited to the reviewer in step 4 — a paraphrase
31
+ here would anchor the reviewer to your interpretation instead of the author's own words.
32
+
33
+ ## 2. Classify against the actual corpus, not the notes alone
34
+
35
+ Search `.what/`, `.how/`, and `.control/` for the FR, UC, ticket, or SPEC the notes actually touch
36
+ before deciding new vs. fix vs. removal vs. green. A classification made without checking what already
37
+ exists there is a guess.
38
+
39
+ - **Green** — behaviour already matches what is promised and built. Report that and stop; MUST NOT
40
+ open a spec or ticket for a non-finding.
41
+ - **New / fix / removal** — continue to step 3.
42
+
43
+ ## 3. Author through wdi-build, not by hand
44
+
45
+ This repo's Delivery Flow standing sequence (`AGENTS.md` § Delivery Flow) requires turning notes into
46
+ a spec or ticket through `wdi-build`'s engines (`to-spec` / `to-tickets`) — MUST NOT hand-write a
47
+ bespoke SPEC.md or ticket file instead.
48
+
49
+ Invoke `wdi-build` Phase 1 (open spec and author tickets via `to-spec` / `to-tickets`) directly on the
50
+ active development branch (`policy.development_branch`, default `main`), per the Delivery Flow standing
51
+ exception.
52
+
53
+ ### Ticket Dependency Contract (Upfront `parallel-tickets-blocked`)
54
+ Author `touches` and `blocked_by` together; do NOT defer dependency relationships until validation.
55
+ For every pair of tickets in the same spec whose `touches` lists intersect, there MUST be a directed
56
+ `blocked_by` path in one direction between them. The path MAY be transitive: a direct edge is not required
57
+ when an already-declared dependency chain orders the pair (e.g. `02` blocked by `01`, `03` blocked by `02`).
58
+ This is the contract enforced by `parallel-tickets-blocked`.
59
+
60
+ Before leaving Step 3, run validator preflight:
61
+ ```bash
62
+ uv run .constitution/method/scripts/validate.py --check --baseline
63
+ ```
64
+ If `parallel-tickets-blocked` reports unsequenced tickets, add the missing `blocked_by` edge to an upstream
65
+ ticket immediately. Findings already matching `.github/validate-baseline.txt` are pre-existing debt, not new
66
+ blockers; only new RED findings must be repaired before dispatching review.
67
+
68
+ **Stop at the boundary of Phase 1.** Once the spec and ticket files exist on disk, do NOT proceed into
69
+ Phase 2 (worktree isolation and ticket implementation) or Phase 3 (closing the spec) — each of those is
70
+ a separate, explicit ask, usually from a different chat session running `wdi-autopilot`.
71
+
72
+ ## 4. Package and dispatch an advisory second opinion
73
+
74
+ Write the review packet to a scratch file first — `.work/wdi-daily-what-to-build/<slug>-second-opinion.md` —
75
+ rather than inlining it into shell arguments:
76
+
77
+ 1. Path to the drafted spec or ticket from step 3.
78
+ 2. The original raw notes from step 1, unedited.
79
+ 3. Relevant component, subsystem, and ticket `touches` / `blocked_by` declarations, plus the preflight validator output.
80
+ 4. This standing mandate (strictly advisory / read-only):
81
+
82
+ > You are the independent advisory reviewer for this daily triage pass, not the implementer or author.
83
+ > Review the named draft against the verbatim notes and the cited corpus only. Return a structured written
84
+ > assessment in markdown:
85
+ > - **Verdict**: `accept` | `accept-with-changes` | `reject`
86
+ > - **Findings**: numbered; categorized as `blocking` vs `non-blocking`
87
+ > - **Notes vs Draft**: specific gaps, misinterpretations, or scope creep relative to raw notes
88
+ > - **Stamp Recommendation**: lenses to use (must include `edge-case-hunter`), readiness for trace stamping,
89
+ > and blockers that must be resolved first
90
+ >
91
+ > You MUST NOT edit, create, delete, rename, or mutate any repository file. You MUST NOT invoke `wdi-review`,
92
+ > MUST NOT write `spec_reviewed` in `specs.yaml`, and MUST NOT modify frontmatter. Stamping is the
93
+ > coordinator's sole responsibility upon folding your feedback; this dispatch is advisory feedback only.
94
+
95
+ Reviewer resolution:
96
+ - If `review_policy.peer_review` is explicitly `false`, or if `roles.reviewer` in `.control/custom-dispatch.yaml` is set
97
+ to `none`, or if the command is invoked with `--no-review`, skip Step 4 and state in the report that peer review was skipped.
98
+ - If `.control/custom-dispatch.yaml` exists in the repo root (or in the main repository root via `(git rev-parse --git-common-dir)/..` when running inside a linked git worktree): inspect `runners:` and `roles.reviewer`.
99
+ A runner definition specifies `type:` (`auto`, `in-session`, or `shell-out`):
100
+ - `auto` (recommended): Evaluates whether the runner's target model is reachable in-session from the active
101
+ session profile (per the caller's global agent collaboration rules). Dispatches in-session via the `Agent`
102
+ tool in read-only mode if reachable; falls back to shell-out using `command` if unreachable in-session.
103
+ - `in-session`: Dispatches strictly via the in-session `Agent` tool using a read-only subagent type.
104
+ - `shell-out`: Dispatches strictly via external shell `command` (single-string command, passing the review packet path).
105
+ A shell-out reviewer MUST be invoked with its read-only flag where supported (e.g. `--trust-tools=fs_read` for
106
+ `kiro-cli`, `--mode plan` for `cursor-agent`).
107
+ If the runner ID is missing from `runners:` or if `type: shell-out` lacks a nonempty `command` string,
108
+ stop and report immediately (fail-closed).
109
+ - Dispatch execution & process discipline:
110
+ - Cap shell-out dispatch at a hard wall-clock limit (default 600s, or `timeout_s` if defined in `custom-dispatch.yaml`).
111
+ - Run backgrounded with polling or synchronous wait. If the timeout expires, or the process exits non-zero,
112
+ or the output file cannot be read: terminate the entire process tree by its PID (MUST NOT use process name-based
113
+ killing). Record in the final report: `peer review: fell back to coordinator self-review after timeout/failure`.
114
+ MUST NOT fabricate or synthesize unread reviewer output as if it were faithfully received.
115
+ - In the absence of a custom runner file: follow the caller's configured agent collaboration setup
116
+ (e.g., in-session read-only subagent via the `Agent` tool if reachable, or the caller's configured CLI
117
+ environment).
118
+
119
+ When the dispatched reviewer has no native Skill tool, instruct it to read and follow the target
120
+ guide directly as plain markdown instructions.
121
+
122
+ ## 5. Coordinator fold-in, stamping, and validation
123
+
124
+ The coordinator is the sole writer in this flow. Read the advisory assessment, revise the draft where it is
125
+ correct, and report every material objection as `accepted`, `deferred` (with its recorded destination), or
126
+ `disagreed` (with the reason). MUST NOT silently drop a reviewer objection.
127
+
128
+ ### Coordinator Stamping (`spec_reviewed`)
129
+ Stamping is an official coordinator-owned event. Because the peer review was conducted live in this session
130
+ under the coordinator's orchestration, the coordinator writes the `spec_reviewed` block directly to
131
+ `.control/registry/specs.yaml` once the draft is accepted and amended:
132
+ ```yaml
133
+ spec_reviewed:
134
+ date: "<YYYY-MM-DD>"
135
+ sha: <git rev-parse HEAD>
136
+ lenses: [structure, prose, edge-case-hunter]
137
+ ```
138
+ The coordinator MUST NOT delegate registry stamping to external shell-out processes.
139
+
140
+ ### Validation
141
+ Run canonical validation using `uv`:
142
+ ```bash
143
+ uv run .constitution/method/scripts/validate.py --generate --baseline
144
+ ```
145
+ - Validation MUST be run via `uv run`, never bare `python` (which triggers Windows Python launcher shebang failures).
146
+ - `--baseline` acknowledges the repository's established baseline in `.github/validate-baseline.txt`. It exits
147
+ zero only if current findings match that baseline exactly.
148
+ - This skill MUST NOT expand or edit the baseline file. Any new RED finding outside the baseline represents an
149
+ unresolved issue and must be fixed before handoff.
150
+
151
+ ## 6. Stop and hand off
152
+
153
+ Report what now exists (or that the notes were green) and its file path. State explicitly whether `spec_reviewed`
154
+ was stamped or if peer review fell back to coordinator self-review. MUST NOT commit, push, or start `wdi-autopilot`
155
+ in this same run — state that as the next step and wait for the maintainer to request it.
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: wdi-daily-what-to-test
3
+ description: Sync to development branch, prune merged worktrees/branches, configure target application smoke environment, and build a test checklist from closed tickets. Invoke as `/wdi-daily-what-to-test [web <target>|mobile <target>|desktop]`.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # WDI Daily What-to-Test
8
+
9
+ The post-merge daily verification step after a `wdi-autopilot` or ticket delivery run merges: lands
10
+ back on the active development branch, safely prunes stale merged worktrees and task branches while
11
+ strictly preserving protected branches, configures the application where it needs to be for platform
12
+ verification, cleans temporary smoke logs, and presents a checklist of what changed — grounded in
13
+ closed tickets and specs, never invented from memory.
14
+
15
+ - `/wdi-daily-what-to-test` — sync + prune + checklist only, nothing deployed or launched.
16
+ - `/wdi-daily-what-to-test web <target>` — sync + configure or deploy web target, then checklist.
17
+ - `/wdi-daily-what-to-test mobile <target>` — sync + launch or install onto device or emulator, then
18
+ checklist.
19
+ - `/wdi-daily-what-to-test desktop` — sync + launch application locally (current machine is target),
20
+ then checklist.
21
+
22
+ ## 0. Preconditions & Branch Policy Precheck
23
+
24
+ 1. Confirm `.control/registry/index.yaml` exists in the repo root. If it does not, this is not a WDI
25
+ Method product repo — report that and stop.
26
+ 2. Read branch policy from `.control/registry/index.yaml`:
27
+ - `primary_branch` (`policy.primary_branch`, default `main`).
28
+ - `development_branch` (`policy.development_branch`, default `main`).
29
+ 3. **Fail-Closed Branch Verification:** Verify that `development_branch` exists in local or remote
30
+ tracking references (`git rev-parse --verify refs/heads/<development_branch>` or
31
+ `git rev-parse --verify refs/remotes/origin/<development_branch>`). If neither resolves, stop
32
+ immediately and report to the maintainer; per `.constitution/method/branch-guide.md`, MUST NOT guess
33
+ or silently fall back to `main`.
34
+ 4. Verify the primary working tree is clean (`git status --porcelain`). If uncommitted changes exist,
35
+ stop and report without modifying git state.
36
+
37
+ ## 1. Sync (Fast-Forward Only)
38
+
39
+ 1. Save the pre-sync HEAD commit as `before_sync` (`git rev-parse HEAD`), or read the last sync cursor from `.work/smoke/last-sync` if present.
40
+ 2. Fetch remote updates and prune deleted tracking refs: `git fetch --prune origin`.
41
+ 3. Land on `development_branch` in the primary repository worktree using standard git operations
42
+ (`git checkout <development_branch>` or `git switch <development_branch>`).
43
+ 4. Pull remote updates strictly with fast-forward: `git pull --ff-only`.
44
+ If the branch has diverged or cannot be fast-forwarded, stop and report immediately; MUST NOT create
45
+ an automatic merge commit on `development_branch`.
46
+
47
+ ## 2. Prune Merged Task Branches & Worktrees (With Immunity Protections)
48
+
49
+ Apply strict immunity per `.constitution/method/branch-guide.md` § Absolute branch immunity:
50
+ - **Immune Branches:** `primary_branch` and `development_branch` **MUST NEVER be deleted**, locally or on any remote.
51
+ - **Immune Checkouts:** The currently checked-out branch and the primary worktree root **MUST NEVER be removed**.
52
+ - **Dirty Worktrees:** Any worktree with uncommitted changes (`git status --porcelain` non-empty) **MUST NOT be removed**.
53
+
54
+ Pruning procedure:
55
+ 1. Enumerate candidates merged into `development_branch`: `git branch --merged <development_branch>`.
56
+ 2. Filter the candidate list to explicitly **exclude**:
57
+ - `primary_branch`
58
+ - `development_branch`
59
+ - the currently active branch (`HEAD`)
60
+ 3. Enumerate active worktrees: `git worktree list --porcelain`.
61
+ 4. For each remaining merged local task branch:
62
+ - If a worktree is linked to that branch: check whether the worktree has uncommitted changes. If clean,
63
+ remove the worktree first (`git worktree remove <worktree-path>`).
64
+ - Delete the merged local branch: `git branch -d <branch-name>`.
65
+ 5. Remote branch hygiene (fail-closed):
66
+ - For method-owned task branches (e.g. `autopilot/<mandate-id>`) merged into `development_branch`:
67
+ verify PR merge status (e.g. confirming its tip is an ancestor of `origin/<development_branch>`, or via `gh pr view <branch> --json state,mergedAt`).
68
+ - If confirmed merged and non-immune, delete the remote branch: `git push origin --delete <branch>`.
69
+ - If status cannot be verified, or if the toolchain is unavailable: do NOT delete; report as residual remote branch.
70
+ 6. If any candidate branch or worktree is ambiguous or has unmerged/dirty state, leave it untouched
71
+ and list it in the report.
72
+
73
+ ## 3. Configure Target Testing Environment
74
+
75
+ When no platform argument is given, proceed directly to step 4 without launching any platform target.
76
+
77
+ - **`desktop`**: Current machine is the target.
78
+ 1. Inspect `.control/test-targets/desktop.md` (or `.constitution/project/codebase-stack-guide.md`) for build command, profile (default: `release` if verifying visual layout/performance, or `debug` for fast logic loops), target binary artifact path, and process executable name.
79
+ 2. **Desktop Process Gate (File-Locking Prevention):** Before compiling or launching:
80
+ - Check whether an existing process is executing the target artifact binary (inspecting processes matching the binary path or application executable name).
81
+ - If an active process is found: check whether it was launched by a previous smoke run (recorded in `.work/smoke/runtime-desktop.yaml`). If recorded, attempt graceful shutdown and wait for exit.
82
+ - If the process is not from WDI smoke or cannot exit gracefully: **MUST NOT** force-kill blindly (`Stop-Process -Force` is prohibited without confirmation); report the PID, binary path, and file-lock hazard to the maintainer, and stop before rebuilding.
83
+ 3. **Build Target:** Rebuild the binary if it is missing or older than the current `HEAD` commit, adhering to the project's build command and profile. If the binary already matches `HEAD`, skip rebuilding.
84
+ 4. **Launch Application:** Launch the application locally using the documented launch command.
85
+ 5. **Runtime Manifest:** Record `{ pid, started_at, artifact_path, profile, head }` to `.work/smoke/runtime-desktop.yaml` (ephemeral artifact under `.work/`, never committed).
86
+ - **`web <target>`**: Inspect `.control/test-targets/web.md` if present. Follow deployment or serving
87
+ procedures documented in project guides or the devops repository for `<target>`.
88
+ - **`mobile <target>`**: Inspect `.control/test-targets/mobile.md` if present. Use the `run` skill or
89
+ documented project mobile commands to target the named device or emulator `<target>`.
90
+
91
+ ## 4. Build Checklist from Closed Tickets (Delta-Scoped Retrieval)
92
+
93
+ MUST NOT perform a full-file read or broad regex scan of the historical `specs.yaml`.
94
+ Derive the verification checklist directly from the delivery delta:
95
+ 1. Define the delivery commit range: `before_sync..HEAD` (or fallback to `last-sync..HEAD`, or the recent merge commit on first-parent history if cursor is absent).
96
+ 2. Inspect paths touched within the delta:
97
+ - Identify closed specifications by matching `.scratch/*/SPEC.md` or `.control/memlog/autopilot-*.md` modified in the delta.
98
+ - Read the changed autopilot ledger (`.control/memlog/autopilot-<id>.md`) as an index of closed tickets and scope.
99
+ 3. For each candidate closed spec:
100
+ - Read candidate's `SPEC.md` and issues under `.scratch/<spec-folder>/` to extract acceptance criteria and hand-testable verification steps.
101
+ - Verify spec's `status: closed` selectively against `.control/registry/specs.yaml` (matching only that specific spec's block, never loading the entire file).
102
+ 4. Group hand-testable verification items by component or screen:
103
+
104
+ ```markdown
105
+ Component & Issue / Screen
106
+ 1. Feature Title
107
+ [ ] verification step 1
108
+ [ ] verification step 2
109
+ ```
110
+
111
+ When a target was specified (`desktop`, `web`, or `mobile`), append the relevant template checklist
112
+ items from `.control/test-targets/<target>.md`. If no closed spec is detected in the delta, report that
113
+ no new closed tickets were merged in this sync.
114
+
115
+ ## 5. Clean Ephemeral Smoke Artifacts
116
+
117
+ Clean up temporary smoke test logs and dumps under `.work/smoke/` created during the test run.
118
+ Record the current sync commit hash to `.work/smoke/last-sync` to serve as a local non-authoritative
119
+ cursor for subsequent runs. MUST NOT remove or modify permanent ledger files under `.control/memlog/`
120
+ (they are permanent audit records).
121
+
122
+ ## 6. Report and Stop
123
+
124
+ 1. Display the generated checklist, target runtime info (artifact path, build profile, PID, SHA), report which merged task worktrees/branches were pruned, and note any preserved immune branches.
125
+ 2. **Post-Verification Housekeeping Notice:** Provide a non-blocking informational note:
126
+ *"Closed specification directories in `.scratch/` can be archived or pruned via `/wdi-prune-or-archive --spec <id> --archive` once hand-testing is complete."*
127
+ 3. Stop. MUST NOT continue into further coding, commits, or another autopilot run in the same turn.
@@ -26,7 +26,7 @@ Four asks look alike from the outside and are four skills:
26
26
  | Source | What it answers |
27
27
  |---|---|
28
28
  | The topic argument | An id (`OQ-12`, `DEC-007`, a defect row, a validator name), a file path, or a sentence |
29
- | `.control/registry/*.yaml` · `.control/generated/status` | What the registry says holds today, and which validators are red |
29
+ | `.control/registry/*.yaml` · `.control/generated/status.md` | What the registry says holds today, and which validators are red (also available as `status.yaml`) |
30
30
  | `.control/questions/` · `.control/decisions/` | Whether this was asked or decided before, and what is already settled |
31
31
  | The working documents in `.what/` and `.how/` | The promise and the mechanism the topic touches |
32
32
  | `validate.py` output · tests · git history · the code | What actually holds, as opposed to what a document claims |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wdi-help
3
- description: Use when you need to know where the project stands in the delivery flow and which skill comes next. Answers from this project's five gates, not from BMad's phase column.
3
+ description: Check project delivery status, open or pending specs and tickets, current gate progress, and determine what to build or which skill to invoke next. Answers from this project's status registry and five gates.
4
4
  ---
5
5
 
6
6
  # WDI Help
@@ -18,15 +18,16 @@ about BMad itself.
18
18
 
19
19
  | Source | What it answers |
20
20
  |---|---|
21
- | `.control/generated/status` | Which spec is open, how many of its tickets are done, which validators are red |
21
+ | `.control/generated/status.yaml` | Primary machine-readable status: which spec is open, tickets progress, red validators (or `status.md`) |
22
22
  | `.control/registry/index.yaml` | The global `mode`, and the gate map |
23
23
  | `.control/registry/components.yaml` | Per-component `mode`, `risk_accepted`, and `g4_passed` |
24
- | `.control/registry/specs.yaml` | Spec → release, size, `depends_on`, and its ticket index |
24
+ | `.control/registry/specs.yaml` | Fallback only when status is absent/stale: spec → release, size, and ticket index (MUST query selectively) |
25
25
  | `.constitution/method/document/delivery-flow-guide.md` | The five gates and their checklists |
26
26
  | `.constitution/method/why/README.md` | The whole shape, when the caller has never seen the method |
27
27
 
28
- You MUST read `.control/generated/status` rather than counting files yourself. It is generated from the
29
- registry; hand-counting produces a second answer that will disagree.
28
+ You MUST read `.control/generated/status.yaml` (or `status.md`) rather than counting files yourself. You
29
+ MUST NOT open or inspect `.control/registry/specs.yaml` if the status file is present and answers which
30
+ spec is open.
30
31
 
31
32
  ## What to answer
32
33
 
@@ -74,6 +75,11 @@ mis-route in this flow, because every other gate is the same for every component
74
75
  | An accepted `DEC-` has not reached its documents | `wdi-decision` intent `apply` |
75
76
  | A bug, a failing test, unexpected behaviour | `wdi-systematic-debugging`, before any fix is proposed |
76
77
  | Numbers are wanted before the work is committed | `wdi-report` intent `estimate` |
78
+ | Closed specs remain in `.scratch/`, or need archival/pruning | `wdi-prune-or-archive` — archives closed spec to `.archive/specs/` or prunes from disk |
79
+ | Raw manual-test notes needing triage, review, and spec drafting | `wdi-daily-what-to-build` — classifies notes, drafts spec/tickets via `wdi-build`, gets second opinion |
80
+ | Autonomous delivery loop with local runner and peer review | `wdi-daily-autopilot` — composes routine, resolves local runners, launches `/loop` unattended |
81
+ | Merged autopilot run needing branch cleanup and physical test checklist | `wdi-daily-what-to-test` — syncs branch, prunes merged worktrees/branches, configures smoke target, provides delta-scoped checklist |
82
+ | Cleaning up generated rendered duplicate files from git | Untrack via `git rm -r --cached .what-rendered/ .how-rendered/`, add to `.gitignore`, regenerate via `validate.py --generate` |
77
83
 
78
84
  A brief that exists but is thin is still a brief. You MUST NOT route back to `wdi-problem` because a
79
85
  section reads weakly — route there only when the brief is absent, when a change signal invalidates what
@@ -90,8 +96,16 @@ it claims, or when one of its eight required sections is missing outright.
90
96
  `wdi-blueprint`, `wdi-build`, `wdi-decision`, `wdi-review`, `wdi-ux`.
91
97
  - Only `.control/questions/blocking.md` holds a gate. `external.md` holds go-live and MUST NOT be reported
92
98
  as blocking a design gate; `assumptions.md` holds nothing.
93
- - You MUST NOT invent progress. If `.control/generated/status` is missing or stale, say so and name
94
- `validate.py --generate`.
99
+ - You MUST NOT invent progress. If `.control/generated/status.yaml` (or `status.md`) is missing or stale,
100
+ say so, query `specs.yaml` selectively, and name `validate.py --generate`.
101
+ - You MUST NOT call Read on the entire 1000+ line `.control/registry/specs.yaml` file into context. When
102
+ discovering active or open work as a fallback, query `specs.yaml` selectively (e.g. `Grep` for `status:\s*(open|ready-for-dev)`).
103
+ - You MUST NOT run broad or recursive searches across `.scratch/` (e.g. searching `*` or `**/*`). When
104
+ inspecting candidate open specs or tickets, inspect only the candidate spec's folder using the `spec_folder:`
105
+ path resolved from `specs.yaml`.
106
+ - You MUST treat `wdi-help` as a fast status and routing skill: if filesystem drift, orphaned folders, or
107
+ discrepancies between registry and disk are suspected, route to `wdi-reconcile` rather than conducting
108
+ a filesystem audit in this skill.
95
109
  - You MUST NOT route anyone to `/setup-matt-pocock-skills` to *finish an install*. The installer seeds
96
110
  `docs/agents/` pre-answered, and that interview's own defaults send every engineering skill looking for a
97
111
  root `CONTEXT.md` and `docs/adr/` — which Article 3 forbids and `wdi-reconcile` reports. It is for
@@ -196,6 +196,22 @@ it to make the output quiet.
196
196
  The rows themselves are **not** yours to land. This intent produces the reader; `wdi-blueprint` intent
197
197
  `platform` owns the three inventories, and a plan-versus-code gap is its finding to route.
198
198
 
199
+ ## Rendered Files Hygiene & Gitignore (Optional)
200
+
201
+ The `.what-rendered/` and `.how-rendered/` directories contain generated human-facing presentations
202
+ derived from canonical files in `.what/` and `.how/`. The method validator deliberately excludes them
203
+ from `COMMITTED_DIRS`, allowing products to choose whether to commit them.
204
+
205
+ If the maintainer prefers to keep the git tree clean of generated presentation files:
206
+ 1. Untrack them from git: `git rm -r --cached .what-rendered/ .how-rendered/`
207
+ 2. Add both folders to `.gitignore`:
208
+ ```gitignore
209
+ .what-rendered/
210
+ .how-rendered/
211
+ ```
212
+ 3. Whenever a human-readable rendered view is needed, regenerate on demand:
213
+ `uv run .constitution/method/scripts/validate.py --generate`
214
+
199
215
  ## Rules
200
216
 
201
217
  - You MUST NOT write `.what/` or `.how/` content beyond a skeleton and its frontmatter. Behaviour is
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: wdi-prune-or-archive
3
+ description: Clean up completed closed specs by archiving to `.archive/specs/` or pruning from disk, wrapping lifecycle.py with fail-closed safety. Invoke as `/wdi-prune-or-archive [--spec <id>|--all-closed] [--archive|--prune] [--dry-run]` or bare `/wdi-prune-or-archive` for interactive selection.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # WDI Prune or Archive
8
+
9
+ Standalone housekeeping skill for closed specifications. Moves completed spec directories to
10
+ `.archive/specs/<spec-folder>/` or prunes completed tickets from disk using `lifecycle.py`, while
11
+ strictly preserving requirement traceability and RTM metadata in `.control/registry/specs.yaml`.
12
+
13
+ - `/wdi-prune-or-archive` — interactive mode: discovers closed specs in `.scratch/`, presents options,
14
+ and confirms before execution.
15
+ - `/wdi-prune-or-archive --spec <id> --archive` — archives `<id>` to `.archive/specs/<spec-folder>/`.
16
+ - `/wdi-prune-or-archive --spec <id> --prune` — removes completed `<id>` folder from disk and git.
17
+ - `/wdi-prune-or-archive --all-closed --archive` — archives all closed specs in `.scratch/`.
18
+ - `/wdi-prune-or-archive --all-closed --prune` — prunes all closed specs in `.scratch/`.
19
+ - Add `--dry-run` to any command to simulate without modifying files or git index.
20
+
21
+ ## 0. Preconditions
22
+
23
+ 1. Confirm `.control/registry/index.yaml` exists in the repo root. If it does not, this is not a WDI
24
+ Method product repo — report that and stop.
25
+ 2. Verify git working tree is clean (`git status --porcelain`). If uncommitted changes exist, stop and
26
+ instruct the maintainer to commit or stash changes before running real archive/prune operations.
27
+ (Exception: `--dry-run` permits an uncommitted tree with an advisory note).
28
+
29
+ ## 1. Discovery & Mode Selection
30
+
31
+ ### A. Interactive Mode (invoked bare: `/wdi-prune-or-archive`)
32
+
33
+ 1. Find closed candidate specs: inspect `.scratch/` directly or run `python .constitution/method/scripts/lifecycle.py --dry-run`
34
+ (or grep `specs.yaml` for `status:\s*closed` — MUST NOT dump the entire historical `specs.yaml` into context).
35
+ 2. Find all specs with `status: closed` whose directory currently resides under `.scratch/`:
36
+ - If no closed specs reside in `.scratch/`: report that `.scratch/` is already clean of closed specs
37
+ and stop.
38
+ - If closed specs are found: list each candidate with its ID, title/release, and folder path.
39
+ 3. Present the three housekeeping choices to the maintainer:
40
+ - **Archive:** Moves the directory to `.archive/specs/<spec-folder>/` via `git mv` and updates
41
+ `spec_folder` in `specs.yaml`. Preserves full historical audit provenance.
42
+ - **Prune:** Removes the directory via `git rm -r` while keeping the spec row and ticket index
43
+ intact in `specs.yaml`. Recommended when git commit history is sufficient.
44
+ - **Defer:** Leave the directories untouched and exit.
45
+ 4. Ask whether to apply the action to all eligible specs (`--all-closed`) or a specific `--spec <id>`.
46
+ 5. Display the exact command that will be executed and request confirmation.
47
+
48
+ ### B. Direct Flag Mode
49
+
50
+ Parse arguments and map them directly to `lifecycle.py` flags:
51
+ - If a positional spec ID is supplied (e.g. `/wdi-prune-or-archive SPEC-1 --archive`), map it to `--spec SPEC-1`.
52
+ - Ensure exactly one action is specified: `--archive` OR `--prune`.
53
+ - Ensure exactly one scope is specified: `--spec <id>` OR `--all-closed`.
54
+ - Pass `--dry-run` if specified.
55
+
56
+ ## 2. Execution via Lifecycle Script
57
+
58
+ All physical git and filesystem operations **MUST** be executed through `lifecycle.py` to guarantee
59
+ atomicity, validation, and rollback:
60
+
61
+ ```powershell
62
+ uv run .constitution/method/scripts/lifecycle.py [arguments]
63
+ ```
64
+
65
+ `lifecycle.py` enforces authoritative preflights:
66
+ - Rejects open or active specs (`status: closed` required).
67
+ - Rejects paths outside authorized spec roots.
68
+ - Rejects folders currently checked out by active git worktrees.
69
+ - Rejects folders cited by active or permanent `.control/memlog/` artifact records.
70
+ - Runs post-operation validation (`validate.py --check`) and automatically rolls back all staged and
71
+ worktree changes if validation fails.
72
+
73
+ ## 3. Report and Stop
74
+
75
+ Display the result of the lifecycle operation verbatim, report updated `spec_folder` paths or pruned
76
+ directories, and stop. MUST NOT proceed into further coding, commits, or other skill invocations.
@@ -188,7 +188,10 @@ reviewed:
188
188
  `EXPERIENCE.md`, and research MAY be reviewed on request; the finding report is the whole output,
189
189
  and no `reviewed:` block is written.
190
190
  - You MUST NOT stamp on behalf of a review someone else ran earlier. Re-run it; the run is cheap and
191
- the claim is not.
191
+ the claim is not. A live peer or second-opinion review dispatched and evaluated within the same coordinating
192
+ session (as in `wdi-daily-what-to-build`) satisfies this requirement; the coordinator, as sole writer, writes
193
+ the trace based on that live session evaluation without needing to independently re-derive the findings from
194
+ scratch. Stale reviews from prior sessions or unverified third-party claims remain strictly prohibited.
192
195
  - When the artifact changed **materially** after the review, the trace is stale and you MUST re-run
193
196
  rather than bump the date. A wording-only change is the one exception, and §*When a review has to run
194
197
  again* owns it.
@@ -27,7 +27,7 @@ npx wdi-method update --yes
27
27
  ```
28
28
 
29
29
  BMad: https://github.com/bmad-code-org/BMAD-METHOD
30
- WDI Method: https://github.com/wiradigitalid/wdi-method
30
+ WDI Method: https://github.com/wiradeltaid/wdi-method
31
31
 
32
32
  A method file MUST NOT be invented here. If a rule is wrong, fix it in the WDI
33
33
  Method package, then update.
@@ -66,6 +66,28 @@ under `.constitution/`. They are agent instructions, and they travel to every re
66
66
  **A corpus written before these settings existed MUST NOT be migrated for them.** The readers accept more
67
67
  than one language, so existing documents keep working and only new writing follows the setting.
68
68
 
69
+ ## Branches
70
+
71
+ **Two branch settings live in `.control/registry/index.yaml` under `policy:`, both defaulting to `main`:**
72
+
73
+ | Setting | Governs | Default |
74
+ |---|---|---|
75
+ | `primary_branch` | Production / release trunk | `main` |
76
+ | `development_branch` | Active development branch for specs, worktrees, and PR targets | `main` |
77
+
78
+ - **Immunity:** Agents MUST NOT delete, overwrite, force-push, or rename `primary_branch` or `development_branch`.
79
+ - **Branch protection:** Agents MUST NOT commit application code directly to `primary_branch` or `development_branch`. Code changes MUST arrive via isolated task branches/worktrees and pull requests. In single-branch mode, direct commits to the shared branch are permitted strictly for Phase 1 & 2 planning documents in `.scratch/` and `.control/registry/specs.yaml`.
80
+ - **Target branch:** All worktrees and PRs MUST target `development_branch`. Agents MUST verify the branch exists locally or on remote (`refs/heads/<branch>` or `refs/remotes/origin/<branch>`) and MUST NOT guess or silently fall back to `main`.
81
+ - `.constitution/method/branch-guide.md` binds branch rules.
82
+
83
+ ## Delivery flow
84
+
85
+ Applies to all feature specification, ticket creation, and code delivery in this repo:
86
+
87
+ 1. Turning notes, a task, or test results into a spec and tickets MUST go through `wdi-build`'s engines (`to-spec` / `to-tickets`, `mattpocock/skills`) — agents MUST NOT invent a bespoke spec or ticket format.
88
+ 2. Standing exception to `wdi-build`'s isolated worktree precondition: the spec authoring step (opening the spec, writing `SPEC.md` and ticket files in `.scratch/`, with no application code changes) happens directly on the active development branch (`policy.development_branch`, default `main`). The worktree requirement binds ticket implementation onward and `wdi-autopilot`.
89
+ 3. During or after spec and ticket authoring, an agent MUST NOT auto-continue into implementing code, committing, pushing, launching `wdi-autopilot`, merging a PR, cleaning up a worktree, or deploying without explicit confirmation from the maintainer. When explicitly commanded to build a ticket (`wdi-build`), committing and pushing to the task branch are permitted, but auto-merging PRs or auto-deploying remain strictly prohibited.
90
+
69
91
  ## The thing in your hand → its folder
70
92
 
71
93
  Read this instead of reasoning about what `.what/` and `.how/` mean.
@@ -157,6 +179,11 @@ verifies the result, and lands the memlog.
157
179
  - `CONTEXT.md`, `CONTEXT-MAP.md`, and `docs/adr/` MUST NOT be created. `docs/agents/domain.md` is the
158
180
  engines' config and says so too: the vocabulary is `.control/product-glossary.md`, domain knowledge is
159
181
  `.what/`, design is `.how/`, and a decision is a `DEC-` — never an ADR. Article 3 owns the rule.
182
+ - `.control/registry/specs.yaml` MUST NOT be read in full (1000+ lines) into context to check project
183
+ status or open work — invoke skill `wdi-help` or read the generated status projection in
184
+ `.control/generated/` (`status.yaml`) instead.
185
+ - `.scratch/` MUST NOT be searched with broad or recursive wildcard patterns (`*` or `**`) to discover
186
+ specs — inspect only the candidate spec's folder using `spec_folder:` from `status.yaml` or `specs.yaml`.
160
187
 
161
188
  ## Routing — load a guide when the task matches
162
189
 
@@ -171,7 +198,7 @@ verifies the result, and lands the memlog.
171
198
  | Unsure about a domain term | `.control/product-glossary.md` |
172
199
  | Looking for a non-technical fact — a domain, an account, a legal entity, a locked date | `.control/project-non-technical-log.md` |
173
200
  | Naming anything — a code identifier, a file, a database column | `.constitution/method/language-guide.md` |
174
- | Asking "which gate now, what next" | `.constitution/method/document/delivery-flow-guide.md` · skill `wdi-help` |
201
+ | Asking "which gate now, what next", project status, or open/pending specs | skill `wdi-help` (MUST invoke `wdi-help` or read generated `status.yaml`) |
175
202
  | Having to decide something, and wanting the reading done first | skill `wdi-explain-to-me` — it briefs, and changes nothing |
176
203
  | Wanting every `FR` delivered without being asked in between | skill `wdi-autopilot` — preflight, one mandate, then the loop |
177
204
  | Setting or changing `mode` or `risk_accepted` | `.constitution/method/document/delivery-flow-guide.md` · skill `wdi-init` |
@@ -185,6 +212,7 @@ verifies the result, and lands the memlog.
185
212
  | Opening, accepting, or applying a `DEC-` | `.constitution/method/document/decision-guide.md` |
186
213
  | Writing or reading a structure map | `.constitution/method/structure-guide.md` |
187
214
  | Writing or changing a CI workflow, or deciding whether a push may start a cloud run | `.constitution/method/ci-guide.md` |
215
+ | Branching rules, protected branches, or PR target policy | `.constitution/method/branch-guide.md` |
188
216
  | Looking for where code lives, or placing new code | `.control/structure-codebase.md` |
189
217
  | Looking for where a document lives | `.control/structure-document.md` |
190
218
  | Writing or reviewing code | `.constitution/project/codebase-stack-guide.md` · `.constitution/project/codebase-conventions-guide.md` · `.constitution/project/codebase-brownfield-guide.md` |
@@ -215,9 +243,13 @@ MUST anything in `.constitution/method/why/`; `status: Reference` forbids it. A
215
243
 
216
244
  - A skill MUST NOT be invoked automatically. Name the one that fits and wait for the owner's
217
245
  go-ahead — this holds even when the skill's own description says it must be used. Reading a
218
- skill as reference is fine. The one exception is `wdi-autopilot` under a `DEC-` of `type: mandate`
246
+ skill as reference is fine. The exceptions are: (1) `wdi-autopilot` under a `DEC-` of `type: mandate`
219
247
  at `status: accepted` that has not expired: the mandate **is** the go-ahead, for every skill it
220
- needs, until it lapses.
248
+ needs, until it lapses; (2) when the owner explicitly invokes an autonomous daily tier skill
249
+ (`/wdi-daily-*`), the owner's invocation authorizes the bounded orchestration steps specified in that skill;
250
+ (3) read-only status, open specs, and routing inquiries (`wdi-help`): the model MUST invoke
251
+ `wdi-help` (or read the generated status projection in `.control/generated/`) automatically to
252
+ inspect current gate progress, open work, or determine the next skill without modifying project state.
221
253
  - `.work/` is not production code. It MUST NOT be imported by the application, and MUST be
222
254
  excluded when searching for code.
223
255
  <!-- END:wdi-method -->
@@ -26,6 +26,7 @@ The repo layout is governed by `corpus-guide.md` and mapped by
26
26
  | `.what-rendered/` · `.how-rendered/` | The two above, assembled for a human to read — one page per gate, at the mirror path. Regenerated by `validate.py`, never edited, never read by a skill |
27
27
  | `_bmad-output/` | Run workspace; MUST be in git, not curated |
28
28
  | `.scratch/` | One directory per effort: a spec's `SPEC.md` and its ticket files, and ad hoc work that has no `FR` yet. MUST be in git — the corpus cites into it by path |
29
+ | `.archive/` | Archived records — closed specs and historical provenance moved from `.scratch/`. MUST be in git |
29
30
  | `.work/` | Scratch; MUST be in git, emptied when a task closes |
30
31
  | *(application roots)* | Application code — named and mapped in `.control/structure-codebase.md` |
31
32