wdi-method 0.6.18 → 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.
- package/CHANGELOG.md +105 -0
- package/LICENSE +21 -21
- package/NOTICE +28 -0
- package/README.id.md +190 -0
- package/README.ja.md +188 -0
- package/README.md +190 -530
- package/README.zh.md +188 -0
- package/bin/wdi-method.js +2199 -2112
- package/kit/.constitution/method/README.md +1 -0
- package/kit/.constitution/method/branch-guide.md +87 -0
- package/kit/.constitution/method/ci-guide.md +169 -0
- package/kit/.constitution/method/constitution.md +1 -0
- package/kit/.constitution/method/scripts/lifecycle.py +416 -0
- package/kit/.constitution/method/scripts/validate.py +126 -9
- package/kit/skills/wdi-autopilot/SKILL.md +461 -384
- package/kit/skills/wdi-build/SKILL.md +404 -393
- package/kit/skills/wdi-daily-autopilot/SKILL.md +138 -0
- package/kit/skills/wdi-daily-what-to-build/SKILL.md +155 -0
- package/kit/skills/wdi-daily-what-to-test/SKILL.md +127 -0
- package/kit/skills/wdi-explain-to-me/SKILL.md +1 -1
- package/kit/skills/wdi-help/SKILL.md +21 -7
- package/kit/skills/wdi-init/SKILL.md +16 -0
- package/kit/skills/wdi-prune-or-archive/SKILL.md +76 -0
- package/kit/skills/wdi-review/SKILL.md +4 -1
- package/kit-overlay/AGENTS.md +37 -4
- package/kit-overlay/README.md +1 -0
- package/kit-overlay/constitution.md +1 -0
- package/lib/identity.mjs +246 -117
- package/package.json +8 -4
- package/scaffold/.control/custom-dispatch.yaml.example +65 -0
- package/scaffold/.control/registry/index.yaml +9 -0
- package/scaffold/.control/test-targets/desktop.md +15 -0
- package/scaffold/.control/test-targets/mobile.md +6 -0
- package/scaffold/.control/test-targets/web.md +6 -0
|
@@ -43,6 +43,7 @@ Never a rule. When it disagrees with a guide, the guide wins and the disagreemen
|
|
|
43
43
|
| [`language-guide.md`](language-guide.md) | Naming anything — a code identifier, a code file, a document file |
|
|
44
44
|
| [`method-glossary.md`](method-glossary.md) | Unsure what a method term means — layer, wave, Product Component, ID code |
|
|
45
45
|
| [`structure-guide.md`](structure-guide.md) | Writing or checking the two structure maps in `.control/` |
|
|
46
|
+
| [`ci-guide.md`](ci-guide.md) | Writing or changing a CI workflow; when a push may start a cloud run, and what MUST NOT |
|
|
46
47
|
|
|
47
48
|
## `document/` — document rules
|
|
48
49
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
status: Accepted
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Branch Guide
|
|
6
|
+
|
|
7
|
+
**Loaded when:** creating, switching, pushing, merging, or deleting git branches, creating task worktrees, targeting pull requests, or configuring repository branch policy
|
|
8
|
+
|
|
9
|
+
This guide governs git branching conventions, protected branches, and pull request target policies across repositories using WDI Method.
|
|
10
|
+
|
|
11
|
+
## Branch policy settings
|
|
12
|
+
|
|
13
|
+
Branch settings live in `.control/registry/index.yaml` under `policy:`. Both default to `main`:
|
|
14
|
+
|
|
15
|
+
| Setting | Governs | Default |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `primary_branch` | Production / release trunk | `main` |
|
|
18
|
+
| `development_branch` | Active development branch for specs, worktrees, and PR targets | `main` |
|
|
19
|
+
|
|
20
|
+
Two workflows are supported:
|
|
21
|
+
- **Single-branch workflow:** `primary_branch` and `development_branch` are identical (e.g. both `main`). Suitable for small tools and straightforward repositories.
|
|
22
|
+
- **Two-branch workflow:** `primary_branch` is `main` (production-ready releases) and `development_branch` is `development` (ongoing feature integration).
|
|
23
|
+
|
|
24
|
+
## Absolute branch immunity
|
|
25
|
+
|
|
26
|
+
- An agent MUST NOT delete, rename, force-push, or overwrite `primary_branch` or `development_branch`, locally or on any remote.
|
|
27
|
+
|
|
28
|
+
## Primary branch protection
|
|
29
|
+
|
|
30
|
+
The `primary_branch` represents production stability:
|
|
31
|
+
- An agent MUST NOT commit application code directly to `primary_branch`.
|
|
32
|
+
- An agent MUST NOT force-push to `primary_branch`.
|
|
33
|
+
- In single-branch mode (where `development_branch` equals `primary_branch`), the only exception to direct commits is non-code corpus planning: spec and ticket authoring in `.scratch/` and index updates in `.control/registry/specs.yaml`. All application code changes MUST go through isolated branches/worktrees and pull requests.
|
|
34
|
+
- An agent MUST NOT merge into `primary_branch`, except in single-branch mode where `development_branch` equals `primary_branch`, and only when explicitly instructed by the repository maintainer.
|
|
35
|
+
- Merges into `primary_branch` and release tagging belong exclusively to human maintainers or designated release workflows.
|
|
36
|
+
|
|
37
|
+
## Development branch protection
|
|
38
|
+
|
|
39
|
+
- An agent MUST NOT force-push to `development_branch`.
|
|
40
|
+
- An agent MUST NOT commit application code directly to `development_branch`; code delivery MUST arrive via isolated task branches/worktrees and pull requests.
|
|
41
|
+
- Direct commits to `development_branch` are permitted strictly for Phase 1 & 2 spec/ticket authoring in `.scratch/` and `.control/registry/specs.yaml`, with no application code changes.
|
|
42
|
+
- Merging pull requests into `development_branch` requires explicit maintainer approval.
|
|
43
|
+
|
|
44
|
+
## Active development target
|
|
45
|
+
|
|
46
|
+
The `development_branch` is the sole base and landing target for active engineering work:
|
|
47
|
+
- Feature specs, ticket authoring, and `.scratch/` planning documents are based on `development_branch`.
|
|
48
|
+
- Task branches and implementation worktrees MUST branch from `development_branch`.
|
|
49
|
+
- Pull requests opened by `wdi-build` or `wdi-autopilot` MUST target `development_branch`.
|
|
50
|
+
|
|
51
|
+
## Fail-closed precheck
|
|
52
|
+
|
|
53
|
+
Before running branch or worktree operations, an agent MUST verify that the configured `development_branch` exists locally or on the remote tracking ref:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git rev-parse --verify "refs/heads/<development_branch>" >/dev/null 2>&1 || git rev-parse --verify "refs/remotes/origin/<development_branch>" >/dev/null 2>&1
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- If `development_branch` cannot be verified locally or on remote, the agent MUST STOP immediately and report the error to the maintainer.
|
|
60
|
+
- An agent MUST NOT guess branch names or silently fall back to `main` when `development_branch` is missing.
|
|
61
|
+
|
|
62
|
+
## Worktree and task branch lifecycle
|
|
63
|
+
|
|
64
|
+
- Task branches and worktrees are temporary mechanisms for isolated implementation.
|
|
65
|
+
- Once a task or run branch is merged into `development_branch`, the local task worktree and branch SHOULD be pruned.
|
|
66
|
+
- Intermediate task branches MUST NOT be left lingering on the remote; only the designated run branch or PR branch reaches the remote.
|
|
67
|
+
- When synchronizing `development_branch`, agents SHOULD run `git fetch --prune origin` to prune stale remote-tracking references of branches already deleted on the remote.
|
|
68
|
+
- For method-owned run branches (e.g. `autopilot/<mandate-id>`), once the pull request is confirmed merged into `development_branch`, the remote branch SHOULD be pruned (`git push origin --delete <branch>`). If PR merge status cannot be verified, the remote branch MUST NOT be deleted and MUST be reported as a residual remote branch.
|
|
69
|
+
- Absolute branch immunity strictly applies to remote operations: an agent MUST NEVER delete or prune `primary_branch` or `development_branch` on any remote.
|
|
70
|
+
|
|
71
|
+
### Working tree isolation models
|
|
72
|
+
|
|
73
|
+
Isolation protects branch integrity and build state during implementation:
|
|
74
|
+
1. **Linked worktree (`git worktree add`):** An additional isolated checkout directory. Ideal for multi-task workflows and environments without toolchain file locks.
|
|
75
|
+
2. **Exclusive primary working tree:** The root repository checkout temporarily dedicated exclusively to a task branch or autopilot run branch (`autopilot/<mandate-id>`). This model is permitted where linked worktrees encounter filesystem or toolchain locks (e.g. Windows file locking on compiler output or artifact build directories), provided all three conditions hold:
|
|
76
|
+
- The working tree is clean (`git status --porcelain` empty) before switching to the run branch.
|
|
77
|
+
- The checkout is dedicated exclusively to the active run (no parallel builders, concurrent human edits, or competing processes sharing the root tree).
|
|
78
|
+
- Only one active mandate or task run executes on the primary tree at any given time.
|
|
79
|
+
3. **Shared checkout (PROHIBITED for code changes):** A working tree with dirty state, unstaged edits, or concurrent uncoordinated activities.
|
|
80
|
+
|
|
81
|
+
## Red flags
|
|
82
|
+
|
|
83
|
+
- Committing directly to `primary_branch` when `development_branch` differs
|
|
84
|
+
- Deleting `primary_branch` or `development_branch` during worktree cleanup
|
|
85
|
+
- Force-pushing to any protected branch
|
|
86
|
+
- Falling back to `main` when `git rev-parse --verify <development_branch>` fails
|
|
87
|
+
- Opening a pull request targeting `primary_branch` instead of `development_branch`
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
status: Accepted
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# CI Guide
|
|
6
|
+
|
|
7
|
+
**Loaded when:** writing or changing a GitHub Actions workflow, or deciding whether a push may start a
|
|
8
|
+
cloud run
|
|
9
|
+
|
|
10
|
+
Cloud runners are **metered**, and the meter is not flat: a Windows runner bills at **2×** the minutes it
|
|
11
|
+
uses and macOS at **10×**, and on a private repository every one of those minutes comes out of a monthly
|
|
12
|
+
allowance. One real run of `wdi-autopilot` over fifteen tickets pushed often enough to start CI dozens of
|
|
13
|
+
times and spent most of a month's allowance in two days.
|
|
14
|
+
|
|
15
|
+
**The fix is not fewer commits.** Commits stay granular — one per ticket, plus the memlog and registry
|
|
16
|
+
writes — because that is what makes a run reviewable and resumable. What changes is **what a push
|
|
17
|
+
triggers**.
|
|
18
|
+
|
|
19
|
+
## One unit of work, one cloud run
|
|
20
|
+
|
|
21
|
+
| | Runs where | When |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| Build, typecheck, the full suite **during** the work | **Locally**, on the machine doing the work | Every ticket — `wdi-build` Phase 3 Step 2 already requires it, and it is free |
|
|
24
|
+
| The cloud workflow | GitHub Actions | **Once**, when the work is offered for review |
|
|
25
|
+
|
|
26
|
+
- A workflow MUST be configured so that an intermediate push — a ticket commit, a memlog rewrite, a
|
|
27
|
+
registry catch-up, a spec close — starts **nothing**.
|
|
28
|
+
- The cloud run MUST happen before the work is merged. Green CI on the **pushed head SHA** is still the
|
|
29
|
+
release evidence; what moves is how many times it is collected, not whether it is.
|
|
30
|
+
- Under a mandate the unit of work is the whole run, so the one cloud run belongs at `wdi-autopilot`
|
|
31
|
+
§ Finish. That skill owns the sequence and this guide MUST NOT restate it.
|
|
32
|
+
- Where the repo's workflow cannot be changed — a shared org template, a workflow another team owns —
|
|
33
|
+
the run MUST keep intermediate work off the remote instead: hold the push, or make the pushed head
|
|
34
|
+
commit carry `[skip ci]`, which GitHub honours for `push` and `pull_request` events.
|
|
35
|
+
|
|
36
|
+
### CI execution policy
|
|
37
|
+
|
|
38
|
+
The product's CI execution policy is configured in `.control/registry/index.yaml` under `policy:`, defaulting to `cycle-end-cloud`:
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
policy:
|
|
42
|
+
ci_execution: cycle-end-cloud # cycle-end-cloud (default)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- **`cycle-end-cloud` (default):** Intermediate pushes start nothing; exactly one cloud CI run is triggered at `wdi-autopilot` § Finish when the work is offered for review. Green CI on the pushed head SHA is required before marking the PR ready for review.
|
|
46
|
+
- **Mandate CI override (signed bypass for constrained environments):** Where cloud runner allowances are strictly limited or emergency releases require local verification, an autonomous mandate MAY record a signed override on its decision block in `decisions.yaml`:
|
|
47
|
+
```yaml
|
|
48
|
+
mandate:
|
|
49
|
+
ci_override: local-only-approved-by: "<Person, YYYY-MM-DD>"
|
|
50
|
+
```
|
|
51
|
+
Under this signed override, the autopilot run MUST NOT call `gh pr ready`, the PR MUST remain as a Draft, no cloud runner is awaited, and the final release report MUST explicitly state: *"locally verified; cloud verification intentionally deferred by mandate"*. A global un-audited toggle MUST NOT be used to silently disable CI evidence.
|
|
52
|
+
|
|
53
|
+
## Trigger shape
|
|
54
|
+
|
|
55
|
+
| Event | Use it | Why |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `workflow_dispatch` | **MUST** be present | The manual re-run. Without it, a red run can only be retried by pushing again |
|
|
58
|
+
| `pull_request:` `types: [ready_for_review]` | The one automatic trigger | A draft PR is work in progress; marking it ready is the moment somebody is asking for the verdict. 100% branch-agnostic standard — triggers identically for `main`, `development`, or custom target branches |
|
|
59
|
+
| `push:` `branches: [main, development]` | MAY | One run per merge, as the record of branch health. Note: GitHub Actions evaluates branch filters statically before checkout; if custom branch names are configured in `index.yaml` policy, update this list manually. Drop it where the allowance is tight |
|
|
60
|
+
| bare `on: push` | **MUST NOT** | Every branch, every commit, no filter. This is the setting that spends an allowance |
|
|
61
|
+
|
|
62
|
+
Two consequences worth stating, because both surprise people:
|
|
63
|
+
|
|
64
|
+
- With `types: [ready_for_review]` and no `synchronize`, a push **after** the PR is ready does not
|
|
65
|
+
re-run CI. Re-run it with `workflow_dispatch`, or convert the PR back to draft and mark it ready
|
|
66
|
+
again. That is the intended trade: the re-run is a decision, not a reflex.
|
|
67
|
+
- `concurrency` with `cancel-in-progress: true` stops two runs of the same ref from billing at once.
|
|
68
|
+
Every workflow below sets it.
|
|
69
|
+
|
|
70
|
+
## What MUST NOT start a build
|
|
71
|
+
|
|
72
|
+
A change that touches only prose or only the corpus cannot break the code, so it MUST NOT start the
|
|
73
|
+
product's build. `paths-ignore` carries that: `**.md`, `.scratch/**`, and the method's own layers —
|
|
74
|
+
`.control/**`, `.what/**`, `.how/**`, `.constitution/**`, `_bmad-output/**`, `.work/**`.
|
|
75
|
+
|
|
76
|
+
The corpus workflow is the **mirror image** of that list and MUST stay a separate workflow: it runs the
|
|
77
|
+
validators, on Ubuntu, only when the corpus changed. Keeping the two apart is what lets the expensive one
|
|
78
|
+
be ignored while the cheap one still guards the registry.
|
|
79
|
+
|
|
80
|
+
## Template — `.github/workflows/ci.yml`
|
|
81
|
+
|
|
82
|
+
The product's build and test. This is the expensive one; the `runs-on` and the two `run:` lines are the
|
|
83
|
+
product's, and they come from `.constitution/project/codebase-stack-guide.md`.
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
name: ci
|
|
87
|
+
|
|
88
|
+
on:
|
|
89
|
+
workflow_dispatch:
|
|
90
|
+
pull_request:
|
|
91
|
+
types: [ready_for_review]
|
|
92
|
+
paths-ignore:
|
|
93
|
+
- '**.md'
|
|
94
|
+
- '.scratch/**'
|
|
95
|
+
- '.control/**'
|
|
96
|
+
- '.what/**'
|
|
97
|
+
- '.how/**'
|
|
98
|
+
- '.constitution/**'
|
|
99
|
+
- '_bmad-output/**'
|
|
100
|
+
- '.work/**'
|
|
101
|
+
# One run per merge, as the record of branch health. GitHub Actions evaluates branch filters
|
|
102
|
+
# statically before checkout; if index.yaml policy configures custom branch names (e.g. trunk, dev),
|
|
103
|
+
# update this list manually. Delete this block where the allowance is tight.
|
|
104
|
+
push:
|
|
105
|
+
branches: [main, development]
|
|
106
|
+
paths-ignore:
|
|
107
|
+
- '**.md'
|
|
108
|
+
- '.scratch/**'
|
|
109
|
+
- '.control/**'
|
|
110
|
+
- '.what/**'
|
|
111
|
+
- '.how/**'
|
|
112
|
+
- '.constitution/**'
|
|
113
|
+
- '_bmad-output/**'
|
|
114
|
+
- '.work/**'
|
|
115
|
+
|
|
116
|
+
concurrency:
|
|
117
|
+
group: ci-${{ github.ref }}
|
|
118
|
+
cancel-in-progress: true
|
|
119
|
+
|
|
120
|
+
jobs:
|
|
121
|
+
build:
|
|
122
|
+
# A Windows runner bills 2× and macOS 10×. Name only the platforms the product actually ships on.
|
|
123
|
+
runs-on: ubuntu-latest
|
|
124
|
+
steps:
|
|
125
|
+
- uses: actions/checkout@v4
|
|
126
|
+
# Replace both lines with this product's build and test commands.
|
|
127
|
+
- run: echo "build command from codebase-stack-guide.md"
|
|
128
|
+
- run: echo "test command from codebase-stack-guide.md"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Template — `.github/workflows/korpus.yml`
|
|
132
|
+
|
|
133
|
+
The corpus validators. Cheap, Ubuntu, and it runs only when the corpus moved — so it MAY keep the
|
|
134
|
+
default `pull_request` trigger, which gives a verdict on the registry while the expensive workflow stays
|
|
135
|
+
quiet. `korpus.yml` validates the corpus and **not** the code: a green run here is never build evidence.
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
name: korpus
|
|
139
|
+
|
|
140
|
+
on:
|
|
141
|
+
workflow_dispatch:
|
|
142
|
+
pull_request:
|
|
143
|
+
paths:
|
|
144
|
+
- '.control/**'
|
|
145
|
+
- '.what/**'
|
|
146
|
+
- '.how/**'
|
|
147
|
+
- '.constitution/**'
|
|
148
|
+
|
|
149
|
+
concurrency:
|
|
150
|
+
group: korpus-${{ github.ref }}
|
|
151
|
+
cancel-in-progress: true
|
|
152
|
+
|
|
153
|
+
jobs:
|
|
154
|
+
validate:
|
|
155
|
+
runs-on: ubuntu-latest
|
|
156
|
+
steps:
|
|
157
|
+
- uses: actions/checkout@v4
|
|
158
|
+
# The three scripts declare their dependencies inline (PEP 723); uv is what runs them.
|
|
159
|
+
- uses: astral-sh/setup-uv@v5
|
|
160
|
+
- run: uv run .constitution/method/scripts/validate.py
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Red flags
|
|
164
|
+
|
|
165
|
+
- `on: push` with no branch filter, in a repo whose runners are metered
|
|
166
|
+
- The product's build and the corpus validators in one workflow — the cheap half then cannot run alone
|
|
167
|
+
- A cloud run started to find out whether the code compiles, when the local suite answers that for free
|
|
168
|
+
- CI watched per ticket under a mandate, instead of once at § Finish
|
|
169
|
+
- A green `korpus.yml` read as a passing build
|
|
@@ -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
|
|