wei-wuwei 0.0.0-stage → 0.1.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/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +240 -2
- package/agents/_template/agent.md +28 -0
- package/agents/wuwei-audit-composition/agent.md +85 -0
- package/agents/wuwei-audit-contract/agent.md +97 -0
- package/agents/wuwei-audit-coverage/agent.md +93 -0
- package/agents/wuwei-pre-implementation-doubt/agent.md +158 -0
- package/agents/wuwei-review-claims/agent.md +187 -0
- package/agents/wuwei-review-code/agent.md +219 -0
- package/agents/wuwei-review-defects/agent.md +180 -0
- package/agents/wuwei-review-design/agent.md +177 -0
- package/agents/wuwei-review-drift/agent.md +184 -0
- package/agents/wuwei-review-structure/agent.md +86 -0
- package/agents/wuwei-security-auditor/agent.md +229 -0
- package/bin/wuwei.js +2713 -0
- package/package.json +44 -4
- package/skills/_template/skill.md +34 -0
- package/skills/wuwei-brainstorm/skill.md +69 -0
- package/skills/wuwei-commit-hygiene/skill.md +38 -0
- package/skills/wuwei-debug-root-cause/skill.md +48 -0
- package/skills/wuwei-execute-phase/skill.md +619 -0
- package/skills/wuwei-grill/skill.md +67 -0
- package/skills/wuwei-legible-output/skill.md +27 -0
- package/skills/wuwei-map-codebase/skill.md +171 -0
- package/skills/wuwei-plan-phases/skill.md +323 -0
- package/skills/wuwei-review/references/lens-rules.md +41 -0
- package/skills/wuwei-review/references/prep.md +35 -0
- package/skills/wuwei-review/references/scopes.md +56 -0
- package/skills/wuwei-review/references/stream.md +94 -0
- package/skills/wuwei-review/skill.md +495 -0
- package/skills/wuwei-tdd/skill.md +47 -0
- package/templates/code-review.md +137 -0
- package/templates/pr.md +35 -0
- package/wuwei.config.json +47 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
One section per published version, newest first. `wuwei update` prints the
|
|
4
|
+
sections between the installed version and the new one before it asks;
|
|
5
|
+
`wuwei check` fails when package.json's version has no section here.
|
|
6
|
+
|
|
7
|
+
## 0.1.0
|
|
8
|
+
|
|
9
|
+
First release.
|
|
10
|
+
|
|
11
|
+
- Nine triggered disciplines and one always-on rule (`wuwei-legible-output`),
|
|
12
|
+
emitted for Claude Code (`~/.claude`) and Codex (`~/.agents`, `$CODEX_HOME/AGENTS.md`).
|
|
13
|
+
- Eleven read-only agents: the code, document and stream review panels, the
|
|
14
|
+
security auditor, and the pre-implementation doubt gate.
|
|
15
|
+
- CLI for the deterministic half of each skill: `review-prep`, `claim`,
|
|
16
|
+
`digest-check`, `plan-check`, `worktree`, `mutate`, `sites`, and `verify`
|
|
17
|
+
(a page's data states through 500 / 403 / 404 / empty / pending / failed refetch).
|
|
18
|
+
- `wuwei update`: finds a newer version, shows what changed and what it would
|
|
19
|
+
write, backs up files you edited since install, applies on yes.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Hsiao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,241 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 無為 · wuwei
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 為學日益,為道日損。損之又損,以至於無為。無為而無不為。
|
|
4
|
+
>
|
|
5
|
+
> *Pursuing knowledge, something is gained daily. Pursuing the Way, something is
|
|
6
|
+
> dropped daily. Drop, and drop again, until you arrive at effortless action.
|
|
7
|
+
> Do nothing, and nothing is left undone.*
|
|
8
|
+
|
|
9
|
+
**為無為,則無不治** — a skills & agents framework for AI coding tools:
|
|
10
|
+
write once, run in every agent, govern without forcing.
|
|
11
|
+
|
|
12
|
+
Where [GSD](https://github.com/open-gsd/gsd-core) ("Git, Ship, Done!") adds workflow (~50 markdown
|
|
13
|
+
files orchestrating a spec-driven cycle), **wuwei subtracts it**. One canonical
|
|
14
|
+
definition per skill; adapters emit whatever each tool expects. No per-tool
|
|
15
|
+
copy-paste, no drift, no forcing.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## The problem
|
|
20
|
+
|
|
21
|
+
You write a skill for Claude Code. Then you want it in Codex. Then Cursor.
|
|
22
|
+
Each wants a different shape:
|
|
23
|
+
|
|
24
|
+
| Tool | Wants | wuwei today |
|
|
25
|
+
|--------------|----------------------------------------------------|-------------|
|
|
26
|
+
| Claude Code | `.claude/skills/<name>/SKILL.md` + YAML frontmatter | ✅ emitted |
|
|
27
|
+
| Codex | `AGENTS.md` (rules) + `.agents/skills/<name>/SKILL.md` | ✅ emitted |
|
|
28
|
+
| Cursor | `.cursor/rules/*.mdc` | planned |
|
|
29
|
+
| Gemini CLI | `GEMINI.md` | planned |
|
|
30
|
+
| Aider | `CONVENTIONS.md` | — |
|
|
31
|
+
|
|
32
|
+
So you fork the content five ways and they rot independently.
|
|
33
|
+
|
|
34
|
+
## The approach
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
skills/<name>/skill.md ──┐
|
|
38
|
+
agents/<name>/agent.md ──┴──▶ wuwei build ──▶ .claude/ .agents/ AGENTS.md …
|
|
39
|
+
(emitters)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
One source. Adapters own the dialects. Regenerate any time; targets are build
|
|
43
|
+
artifacts, never hand-edited.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Quick start
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# from npm:
|
|
51
|
+
npx wei-wuwei install # once per machine — disciplines into ~/.claude (and Codex, if it has run);
|
|
52
|
+
# say yes to `npm install -g`: the skills call `wuwei …`
|
|
53
|
+
wuwei init # bootstrap the current project
|
|
54
|
+
wuwei update # newer version out? shows what it would change, applies on yes
|
|
55
|
+
|
|
56
|
+
# from a clone:
|
|
57
|
+
git clone git@github.com:jameshsiao/wuwei.git
|
|
58
|
+
cd wuwei
|
|
59
|
+
npm run check # lint frontmatter
|
|
60
|
+
npm run build # emit repo-local artifacts (.claude/, .agents/, AGENTS.md, CLAUDE.md)
|
|
61
|
+
node bin/wuwei.js init <project> # repo scope: templates + .wuwei/ skeleton, then
|
|
62
|
+
# offers the tools below and names the next step
|
|
63
|
+
node bin/wuwei.js install # user scope: skills/agents → ~/.claude, rules → ~/.claude/CLAUDE.md;
|
|
64
|
+
# Codex: skills → ~/.agents/skills, rules → $CODEX_HOME/AGENTS.md
|
|
65
|
+
node bin/wuwei.js status <project> # read-only: streams/claims from .wuwei, drift vs STATE.md flagged
|
|
66
|
+
node bin/wuwei.js update # git pull if behind, diff against what install wrote, apply on yes
|
|
67
|
+
node bin/wuwei.js review-prep <base> # wuwei-review's prep: dispatcher checks + scan bundle (or --pr <n>)
|
|
68
|
+
node bin/wuwei.js claim [stream] [NN] # list eligible phases, or claim one: cut, claim, push
|
|
69
|
+
node bin/wuwei.js digest-check <f> # a review digest's arithmetic before it is published
|
|
70
|
+
node bin/wuwei.js plan-check [stream] # plan-phases step 11's checkable half, before sign-off
|
|
71
|
+
node bin/wuwei.js worktree <lens> <sha> # a throwaway worktree no other lens shares (--prune)
|
|
72
|
+
node bin/wuwei.js mutate <f>:<n> --from … --to … --run … --in <wt> # one mutation: landed, baseline, red count, restored
|
|
73
|
+
node bin/wuwei.js sites <pattern> [--symbol <name>] # a set derived from the tree, graph and grep both
|
|
74
|
+
node bin/wuwei.js verify [page] [--phase NN] # every data-bearing page × 500/403/404/empty/pending/failed refetch; --phase: ACCEPTANCE's ## Verify
|
|
75
|
+
node bin/wuwei.js uninstall # removes exactly what install wrote, nothing else
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`update` is `install` with its eyes open. It first asks the channel this copy
|
|
79
|
+
came from whether a newer version exists — git for a clone, npm for the
|
|
80
|
+
package — and offers to move to it; the newer copy then runs the diff. Every
|
|
81
|
+
file install would touch is reported as `new`, `changed` (upstream), `edited`
|
|
82
|
+
(you changed it since install — install records a hash of everything it writes
|
|
83
|
+
in `~/.wuwei/manifest.json`), `stale` (orphaned, would be removed) or
|
|
84
|
+
`conflict` (a file at that path wuwei did not generate). Before that it prints
|
|
85
|
+
`CHANGELOG.md`'s sections since the installed version. Nothing is written
|
|
86
|
+
without a yes; `edited` and `conflict` files are copied to
|
|
87
|
+
`~/.wuwei/local-patches/<time>/` first; `--dry` only reports.
|
|
88
|
+
|
|
89
|
+
You don't have to remember to run it: once a day any `wuwei` command checks
|
|
90
|
+
npm in the background, and when a newer version is out it says so on stderr
|
|
91
|
+
(at most hourly; never from a clone or in CI; `WUWEI_NO_UPDATE_CHECK=1` turns
|
|
92
|
+
it off).
|
|
93
|
+
|
|
94
|
+
Releasing: bump `package.json`, add its `## <version>` section to
|
|
95
|
+
`CHANGELOG.md` (`wuwei check` fails without one), push a `v<version>` tag.
|
|
96
|
+
|
|
97
|
+
## Daily use
|
|
98
|
+
|
|
99
|
+
The CLI above only installs and inspects. The work itself is driven by the ten
|
|
100
|
+
skills, invoked by name or triggered by what you say. A stream runs
|
|
101
|
+
**grill → brainstorm → plan → execute**, with a human at exactly two points:
|
|
102
|
+
sign-off before anything is built, and UAT at the end.
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
/wuwei-grill # interrogate the requirement — no solutions yet
|
|
106
|
+
/wuwei-brainstorm # 3+ genuinely different approaches, converge with reasons
|
|
107
|
+
/wuwei-plan-phases # strategy → phases → contract → SIGN-OFF (stops here)
|
|
108
|
+
/wuwei-execute-phase # claim → implement → e2e → simplify → review → PR
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`wuwei-review` also stands alone — point it at a diff, a PR, a file, or a
|
|
112
|
+
document and it picks the panel that fits the content:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
/wuwei-review # the working tree's uncommitted diff
|
|
116
|
+
/wuwei-review <ref>...<ref> # a range
|
|
117
|
+
/wuwei-review <path> # a file or directory
|
|
118
|
+
/wuwei-review --stream # a finished stream, audited against its contract
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The last one runs once a stream's phases have all merged: goals met, non-goals
|
|
122
|
+
honoured, critical paths actually covered by e2e, and security re-checked over
|
|
123
|
+
the composed diff — things no single phase's review is positioned to see.
|
|
124
|
+
|
|
125
|
+
### Running more than one phase
|
|
126
|
+
|
|
127
|
+
`wuwei-execute-phase` does one phase by default. Give it a range instead:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
/wuwei-execute-phase --through 04 # through phase 04, inclusive
|
|
131
|
+
/wuwei-execute-phase --through end # the whole stream
|
|
132
|
+
/wuwei-execute-phase --all # same thing
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
It prints what it is about to do before touching anything:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
run scope: 02 → 04 · 3 phases · mode: manual
|
|
139
|
+
|
|
140
|
+
02-token-refresh ready
|
|
141
|
+
03-appcheck-wiring ready
|
|
142
|
+
04-session-store ready ← review: human (auth)
|
|
143
|
+
|
|
144
|
+
will stop at 04 and hand over. starting 02.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
and if something stops it partway, says where to resume:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
stopped at 03-appcheck-wiring · bound e2e red (auth/refresh.spec.ts)
|
|
151
|
+
02 merged. 03 claimed, branch pushed, not merged.
|
|
152
|
+
next invocation resumes at 03.
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
A range is **distance, not permission**. No flag skips a `review: human`
|
|
156
|
+
phase, a red e2e, a dependency conflict, or entering main — those stop
|
|
157
|
+
regardless. Carrying through a `review: human` phase has to be asked for in
|
|
158
|
+
words, naming why it was circled. The safe thing costs two tokens; the risky
|
|
159
|
+
thing costs a sentence.
|
|
160
|
+
|
|
161
|
+
Streams signed off as `mode: auto` already run end to end, so they need no
|
|
162
|
+
range — pass one only to stop *earlier* than the end.
|
|
163
|
+
|
|
164
|
+
## Tools it will offer you
|
|
165
|
+
|
|
166
|
+
`wuwei init` detects three third-party tools and offers to install each. All
|
|
167
|
+
optional, all free, none bundled — wuwei defers to each vendor's own installer
|
|
168
|
+
and never reimplements one.
|
|
169
|
+
|
|
170
|
+
| Tool | What it buys | Without it |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| [codegraph](https://github.com/colbymchenry/codegraph) | a queried code graph — `callers`, `impact`, reachability | every step falls back to Grep and says so. **Security findings cap at MED**: reachability is what makes a HIGH defensible |
|
|
173
|
+
| [semgrep](https://semgrep.dev) | OWASP Top 10 pattern scan of a diff | the auditor reads the diff instead, and the report says it was inference |
|
|
174
|
+
| [osv-scanner](https://github.com/google/osv-scanner) | known CVEs in new dependencies, from the OSV database | the manifest gets read instead |
|
|
175
|
+
|
|
176
|
+
Only offered where they help — a repo with no code yet is never asked about a
|
|
177
|
+
code graph — and `wuwei uninstall` offers the removals back. A diff shows what
|
|
178
|
+
changed and cannot show what depends on it, which is why the first row gates
|
|
179
|
+
severity: "no call site left behind" is a claim a graph settles and reading
|
|
180
|
+
harder never will.
|
|
181
|
+
|
|
182
|
+
## Repo layout
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
wuwei/
|
|
186
|
+
├── skills/ # canonical skill definitions (source of truth)
|
|
187
|
+
│ └── _template/
|
|
188
|
+
├── agents/ # canonical subagent definitions
|
|
189
|
+
│ └── _template/
|
|
190
|
+
├── templates/ # PR / review templates, installed per-repo
|
|
191
|
+
├── bin/wuwei.js # CLI: build · check · list · init · install · update · status · review-prep · claim · digest-check · plan-check · worktree · mutate · sites · verify · uninstall
|
|
192
|
+
│ # the per-tool emitters live here too, not in adapters/
|
|
193
|
+
├── adapters/ # notes only — see bin/wuwei.js for the actual emitters
|
|
194
|
+
├── docs/
|
|
195
|
+
│ ├── product.md # what wuwei is now (edited in place)
|
|
196
|
+
│ ├── decisions.md # why it got here (append-only)
|
|
197
|
+
│ ├── architecture.md
|
|
198
|
+
│ └── authoring.md
|
|
199
|
+
└── wuwei.config.json # sources + targets; `commands` is declared but not built yet
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Design principles
|
|
203
|
+
|
|
204
|
+
1. **One source of truth.** A skill is defined once. Everything else is generated.
|
|
205
|
+
2. **Emitters, not forks.** Tool-specific quirks live in the emitters, never in content.
|
|
206
|
+
3. **Additive, not prescriptive.** wuwei does not impose a workflow. Bring your own.
|
|
207
|
+
4. **Plain markdown.** Skills stay readable and diffable without the toolchain.
|
|
208
|
+
5. **Build artifacts are disposable.** Delete `.claude/`, rebuild, get the same bytes.
|
|
209
|
+
|
|
210
|
+
## 無為,如何執行? · How non-action executes
|
|
211
|
+
|
|
212
|
+
「無為」不是不做事,是**不強為**——不跟事物的本性對抗,把力氣花在順勢上,
|
|
213
|
+
然後退場。每一條框架機制都能對回《道德經》原文:
|
|
214
|
+
|
|
215
|
+
| 道 | 原文 | 機制 |
|
|
216
|
+
|---|---|---|
|
|
217
|
+
| **為道日損** | 損之又損,以至於無為 | 每個「不做」的決策:不 vendor 上游、不設 plans 層、wave 無實體、skill 滿編九顆、常駐律封頂 12 行——減法由 validator 強制,超過直接 check fail |
|
|
218
|
+
| **無為而無不為** | 為無為,則無不治 | auto 模式:人只出現在頭(簽收 SPEC 與驗收契約)尾(勾 UAT)兩點,中間無人推動,但 plan → 執行 → 驗證 → PR 全部發生 |
|
|
219
|
+
| **輔而不宰** | 輔萬物之自然而不敢為 | 有狀態、無引擎:`mode` 是 skill 讀的欄位,不是框架的強制;紀律由情境觸發,不由排程器指派 |
|
|
220
|
+
| **知止** | 知止可以不殆 | 每顆 skill 的 When NOT to use——無為的核心不在做,在知道何時不觸發。wuwei-grill 不碰解法、doubt agent 不改檔、auditor 不自己補洞 |
|
|
221
|
+
| **為而不恃** | 功成而弗居 | 證據優先於自述:phase 完工看 e2e 綠,不聽敘事;issue 是狀態檔的投影,不是第二份真相;uninstall 只帶走自己戳記過的東西 |
|
|
222
|
+
| **不言之教** | 行不言之教 | 律與法之分:最重要的九條常駐每個 request 無聲生效,其餘九法藏著,情境到了才現身 |
|
|
223
|
+
| **若烹小鮮** | 治大國若烹小鮮 | 人不翻攪 raw diff——讀 digest、commit 故事線、impact 圖;高風險 phase 才圈人工。攪得少,魚才完整 |
|
|
224
|
+
|
|
225
|
+
一句話:**它不執行,它布置勢。** 觸發條件(description)、邊界(When NOT)、
|
|
226
|
+
終點(驗收契約)、退路(uninstall)都定義成勢之後,行動是 agent 順著勢
|
|
227
|
+
自己發生的。GSD 走法家路線——引擎、儀式、流程強制;wuwei 賭道家:
|
|
228
|
+
**規則越少而越被遵守,因為每條都短到無法誤解、準到無法繞過。**
|
|
229
|
+
|
|
230
|
+
*In one line: wuwei doesn't execute — it arranges the conditions (triggers,
|
|
231
|
+
boundaries, contracts, exits) under which the right action happens by
|
|
232
|
+
itself.*
|
|
233
|
+
|
|
234
|
+
## Status
|
|
235
|
+
|
|
236
|
+
Pre-alpha scaffold. Nothing is stable. See `docs/architecture.md` for the
|
|
237
|
+
intended design and open questions.
|
|
238
|
+
|
|
239
|
+
## License
|
|
240
|
+
|
|
241
|
+
MIT
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-name
|
|
3
|
+
description: >-
|
|
4
|
+
When to delegate to this subagent. Be specific about the boundary between
|
|
5
|
+
this agent and the main thread.
|
|
6
|
+
# model: sonnet | opus | haiku | fable | claude-<id> | inherit (default)
|
|
7
|
+
model: inherit
|
|
8
|
+
# effort: low | medium | high | xhigh | max — omit to inherit the session's.
|
|
9
|
+
effort: high
|
|
10
|
+
# Both fields are agents-only; `check` rejects them on a skill.
|
|
11
|
+
tools: [Read, Grep, Glob]
|
|
12
|
+
version: 0.1.0
|
|
13
|
+
targets: [claude-code]
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Agent Name
|
|
17
|
+
|
|
18
|
+
## Mandate
|
|
19
|
+
|
|
20
|
+
What this agent owns, in one paragraph.
|
|
21
|
+
|
|
22
|
+
## Out of scope
|
|
23
|
+
|
|
24
|
+
What it must hand back rather than attempt.
|
|
25
|
+
|
|
26
|
+
## Output contract
|
|
27
|
+
|
|
28
|
+
The exact shape the agent returns to its caller.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wuwei-audit-composition
|
|
3
|
+
description: >-
|
|
4
|
+
The composition lens of wuwei's stream audit: the same thing solved twice in
|
|
5
|
+
different phases, an abstraction later phases worked around, a declaration a
|
|
6
|
+
later phase invalidated, the composed module graph against SPEC's
|
|
7
|
+
`## Target architecture`, and the stream's `wuwei:` ledger. Dispatched by
|
|
8
|
+
`wuwei-review --stream`, once, before the stream PR reaches main. Read-only.
|
|
9
|
+
effort: high
|
|
10
|
+
tools: [Read, Grep, Glob, Bash]
|
|
11
|
+
version: 0.1.0
|
|
12
|
+
targets: [claude-code]
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Audit — composition
|
|
16
|
+
|
|
17
|
+
## Mandate
|
|
18
|
+
|
|
19
|
+
**Only what needs two phases to see.** A phase audit sees one diff: phase 02
|
|
20
|
+
adds an entrypoint, phase 05 adds a sink reachable from it, and both audits are
|
|
21
|
+
correct. Duplication across phases is the same blind spot — two reviewers, each
|
|
22
|
+
looking at half.
|
|
23
|
+
|
|
24
|
+
| Look for | Shape |
|
|
25
|
+
|---|---|
|
|
26
|
+
| the same thing solved twice | two phases, two implementations, one problem |
|
|
27
|
+
| a worked-around abstraction | an early phase introduced it; later phases went around instead of using it |
|
|
28
|
+
| an invalidated declaration | a semantic, an invariant, or an earlier phase's `## Intended design` that a later phase made false without updating it — **nobody owns that declaration once its phase closed** |
|
|
29
|
+
| architecture drift | the composed module graph against SPEC's `## Target architecture` — N individually reasonable divergences can compose into a system nobody signed off on |
|
|
30
|
+
| the `wuwei:` ledger | below |
|
|
31
|
+
|
|
32
|
+
## The `wuwei:` ledger
|
|
33
|
+
|
|
34
|
+
Deliberate cuts this stream declined are marked in place
|
|
35
|
+
(`wuwei-execute-phase` step 4). Harvest them —
|
|
36
|
+
`git grep -nE '(#|//|--|/\*|<!--|;) ?wuwei: '` — tracked files only, so vendor,
|
|
37
|
+
build output and `.wuwei-cache/` are skipped — one row each:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
<file>:<line>, <what was simplified>. ceiling: <the limit>. upgrade: <the trigger>.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Close with `<N> markers, <M> with no trigger`. **The ones with no trigger are
|
|
44
|
+
the finding**; a deferral with no definition of "later" is a deferral to never.
|
|
45
|
+
|
|
46
|
+
## Look forward, not only across what shipped
|
|
47
|
+
|
|
48
|
+
A claim or index this stream leaves behind that a *planned* phase will trip on
|
|
49
|
+
is a finding **now**, while the plan can still absorb it. This stream's phases
|
|
50
|
+
have all merged by the time you run, so look outward: other streams'
|
|
51
|
+
`phases/`, and anything `STATE.md` lists as not yet started.
|
|
52
|
+
|
|
53
|
+
## Not a code-smell checklist
|
|
54
|
+
|
|
55
|
+
Per-phase tidiness already has two owners — `wuwei-execute-phase`'s simplify
|
|
56
|
+
step and `review:defects` — and a smell list is the long tail wuwei declines to
|
|
57
|
+
chase. If one phase's diff shows it, it is not yours.
|
|
58
|
+
|
|
59
|
+
## Out of scope
|
|
60
|
+
|
|
61
|
+
- **Changing anything.** No Edit or Write; `Bash` reads (`git diff` of the
|
|
62
|
+
composed range, `grep`, graph queries).
|
|
63
|
+
- Goals, non-goals, Open Questions — `audit:contract`'s.
|
|
64
|
+
- The coverage chain — `audit:coverage`'s.
|
|
65
|
+
- Security — `wuwei-security-auditor`'s.
|
|
66
|
+
|
|
67
|
+
## Output contract
|
|
68
|
+
|
|
69
|
+
Cuts report in the tagged form of `wuwei-execute-phase`'s simplify step —
|
|
70
|
+
`delete:` / `reuse:` / `stdlib:` / `native:` / `yagni:` / `shrink:`, one line
|
|
71
|
+
each,
|
|
72
|
+
closing with `net: -<N> lines`. The same floor applies: **a test is never the
|
|
73
|
+
cut.**
|
|
74
|
+
|
|
75
|
+
Everything else goes in the columns of `.wuwei/templates/code-review.md`,
|
|
76
|
+
`Reporter` set to `audit:composition`, with:
|
|
77
|
+
|
|
78
|
+
- **Fails when** — the concrete input or state and the wrong result. For a
|
|
79
|
+
worked-around abstraction: what breaks when only one of the two paths is
|
|
80
|
+
fixed.
|
|
81
|
+
- **Ev** — `CONFIRMED` when traced end to end, `PLAUSIBLE` when not.
|
|
82
|
+
**Nothing PLAUSIBLE is rated HIGH.**
|
|
83
|
+
|
|
84
|
+
Open the report by stating whether the module graph came from a code graph
|
|
85
|
+
query or from Grep.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wuwei-audit-contract
|
|
3
|
+
description: >-
|
|
4
|
+
The contract lens of wuwei's stream audit: every goal in `SPEC.md` against
|
|
5
|
+
what shipped and against the data that already existed, every non-goal
|
|
6
|
+
against what shipped anyway, every Open Question against a recorded answer
|
|
7
|
+
— and the mirror, whether each goal is still needed now the whole stream is
|
|
8
|
+
visible. Dispatched by `wuwei-review --stream`, once, before the stream PR
|
|
9
|
+
reaches main. Read-only.
|
|
10
|
+
effort: high
|
|
11
|
+
tools: [Read, Grep, Glob, Bash]
|
|
12
|
+
version: 0.1.0
|
|
13
|
+
targets: [claude-code]
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Audit — contract
|
|
17
|
+
|
|
18
|
+
## Mandate
|
|
19
|
+
|
|
20
|
+
One question: **did this stream deliver the thing that was authorised, and
|
|
21
|
+
nothing else?**
|
|
22
|
+
|
|
23
|
+
`SPEC.md` and `## Sign-off` are the contract. Every row below is reconciled
|
|
24
|
+
against the composed result, never against a phase digest — a digest says what
|
|
25
|
+
one phase believed about its own diff.
|
|
26
|
+
|
|
27
|
+
| Reconcile | Against |
|
|
28
|
+
|---|---|
|
|
29
|
+
| every **goal** | what shipped, **and the rows that already existed** — a goal implemented for new data and missed for old is not met |
|
|
30
|
+
| every **non-goal** | what shipped anyway |
|
|
31
|
+
| every **Open Question** | a recorded answer, in `SPEC.md` or `## Sign-off` |
|
|
32
|
+
| every goal, **mirrored** | is it still needed? |
|
|
33
|
+
|
|
34
|
+
## Non-goals are why this lens exists
|
|
35
|
+
|
|
36
|
+
**They are written once, at grill, and read nowhere after.** No phase review
|
|
37
|
+
asks whether the thing the stream said it would not build got built — the
|
|
38
|
+
phase that built it had its own scope, and was correct within it. This is the
|
|
39
|
+
only place the question is asked, and it is asked after the fact, which is the
|
|
40
|
+
only time it can be answered.
|
|
41
|
+
|
|
42
|
+
## The mirror
|
|
43
|
+
|
|
44
|
+
Asking "did everything promised ship" leaves the opposite question with no
|
|
45
|
+
owner. So also ask, of each goal:
|
|
46
|
+
|
|
47
|
+
- did another goal turn out to cover it?
|
|
48
|
+
- did the abstraction built for it end up with one caller?
|
|
49
|
+
- was it answered by something outside this stream while the stream ran?
|
|
50
|
+
|
|
51
|
+
**Stream close is the last place this can be asked.** After this it is in
|
|
52
|
+
main, where a thing nobody needs is indistinguishable from a thing someone
|
|
53
|
+
does.
|
|
54
|
+
|
|
55
|
+
**Report the mirror in its own section, not in the findings table.** The five
|
|
56
|
+
reporters run in parallel and none can write into another's report, so a
|
|
57
|
+
`yagni:` handed to `audit:composition` would land nowhere. One line each,
|
|
58
|
+
naming the goal:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
goal <N>: <what is now redundant>. <the goal that covers it, or the caller count>.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**No severity, no `Ev`, never in the verdict, never executed against this
|
|
65
|
+
stream.** A signed-off goal is the human's call to unmake, not a finding this
|
|
66
|
+
agent's judgment can act on or block on. This section is input to the *next*
|
|
67
|
+
plan, not a gate on this one — `## Sign-off`'s decision stands until someone
|
|
68
|
+
with sign-off authority revisits it.
|
|
69
|
+
|
|
70
|
+
## Out of scope
|
|
71
|
+
|
|
72
|
+
- **Changing anything.** No Edit or Write; `Bash` reads (`git diff`, `git
|
|
73
|
+
log`, `grep`).
|
|
74
|
+
- The coverage chain — `audit:coverage`'s.
|
|
75
|
+
- Security of the composed diff — `wuwei-security-auditor`'s.
|
|
76
|
+
- Cross-phase duplication and the module graph — `audit:composition`'s.
|
|
77
|
+
|
|
78
|
+
## Output contract
|
|
79
|
+
|
|
80
|
+
Findings in the columns of `.wuwei/templates/code-review.md`, `Reporter` set
|
|
81
|
+
to `audit:contract`.
|
|
82
|
+
|
|
83
|
+
**Every finding names the goal, non-goal, or Open Question it is about, and
|
|
84
|
+
cites it** — a finding that cannot point at the contract belongs in the code
|
|
85
|
+
panel, not here.
|
|
86
|
+
|
|
87
|
+
Two evidence fields per finding:
|
|
88
|
+
|
|
89
|
+
- **Fails when** — the concrete input or state, and the wrong output it
|
|
90
|
+
produces. For an unmet goal: what a user does that the contract says should
|
|
91
|
+
work and does not.
|
|
92
|
+
- **Ev** — `CONFIRMED` when traced end to end, `PLAUSIBLE` when not.
|
|
93
|
+
**Nothing PLAUSIBLE is rated HIGH.**
|
|
94
|
+
|
|
95
|
+
Close with the reconciliation counts: goals met / unmet, non-goals honoured /
|
|
96
|
+
violated, Open Questions answered / open, goals the mirror flagged. **A count
|
|
97
|
+
is not optional** — a reconciliation with no denominator cannot be checked.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wuwei-audit-coverage
|
|
3
|
+
description: >-
|
|
4
|
+
The coverage lens of wuwei's stream audit: reconciles the whole chain from
|
|
5
|
+
SPEC's requirement through ACCEPTANCE's critical paths to an e2e item that
|
|
6
|
+
exists and runs green, and names which link broke — not just e2e against
|
|
7
|
+
`ACCEPTANCE.md`. Dispatched by `wuwei-review --stream`, once, before the
|
|
8
|
+
stream PR reaches main. Read-only.
|
|
9
|
+
effort: high
|
|
10
|
+
tools: [Read, Grep, Glob, Bash]
|
|
11
|
+
version: 0.1.0
|
|
12
|
+
targets: [claude-code]
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Audit — coverage
|
|
16
|
+
|
|
17
|
+
## Mandate
|
|
18
|
+
|
|
19
|
+
Reconcile a **chain**, link by link, and name which link broke:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
SPEC's requirement → ACCEPTANCE's critical paths → an e2e item exists → it runs green
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Link | Failure | Why nothing else catches it |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| SPEC → ACCEPTANCE | a critical path the requirement implies that was **never listed** | everything downstream is consistent *and* incomplete — the path is absent from the chain, so **no check fires** |
|
|
28
|
+
| ACCEPTANCE → e2e | listed, but no test was ever written for it | plan step 6 routed it to e2e; nobody verified the route was taken |
|
|
29
|
+
| exists → runs | the test exists but is skipped, disabled, or bound to a phase that never shipped | a suite can be green because a test did not run |
|
|
30
|
+
|
|
31
|
+
**Every link you report as broken is an absence, so it is a claim about the
|
|
32
|
+
command you used**, not about the stream: a grep for one syntactic form
|
|
33
|
+
misses the same case written in another, and "no e2e item exists for this"
|
|
34
|
+
is only as good as the names you searched. Run a positive control — the same
|
|
35
|
+
search against a link you know is intact — or read what the pattern actually
|
|
36
|
+
covers, and say which you did. This lens never runs the suite (below): **a
|
|
37
|
+
critical path with no recorded run anywhere is `CONFIRMED` broken** once you
|
|
38
|
+
have checked every place a record could be; `PLAUSIBLE` is only for records
|
|
39
|
+
you could not reach, naming them. The absence is never dropped.
|
|
40
|
+
|
|
41
|
+
**The chain is only ever checked one link at a time**, by whoever owns that
|
|
42
|
+
link — and the first link has no owner at all. That is why this runs once, at
|
|
43
|
+
stream scope, end to end.
|
|
44
|
+
|
|
45
|
+
## Start from the requirement, not from the contract
|
|
46
|
+
|
|
47
|
+
Deriving `ACCEPTANCE` from `SPEC` is the step that can lose a path, and after
|
|
48
|
+
it **every artifact agrees with every other one**: e2e covers 100% of
|
|
49
|
+
ACCEPTANCE, ACCEPTANCE reconciles fully, and the path is simply not there.
|
|
50
|
+
|
|
51
|
+
So read `SPEC.md`'s requirements first and derive the critical paths yourself,
|
|
52
|
+
then compare that set against `ACCEPTANCE.md`. Reading ACCEPTANCE first makes
|
|
53
|
+
you inherit its omissions. **A contract fully honoured is not a requirement
|
|
54
|
+
fully covered.**
|
|
55
|
+
|
|
56
|
+
## Proving the last link
|
|
57
|
+
|
|
58
|
+
"It exists" is not "it runs". For every e2e item, establish which:
|
|
59
|
+
|
|
60
|
+
- is it skipped, `.only`-shadowed, or excluded by the runner's config?
|
|
61
|
+
- is it bound to a phase that never shipped?
|
|
62
|
+
- is there a recorded run, on a ref no earlier than the last commit that
|
|
63
|
+
changed code?
|
|
64
|
+
|
|
65
|
+
**No recorded run is a broken link**, not a pass — the same rule the phase
|
|
66
|
+
pipeline gates on, and **you do not close the gap by running it yourself**.
|
|
67
|
+
|
|
68
|
+
## Out of scope
|
|
69
|
+
|
|
70
|
+
- **Changing anything, and that includes running the suite.** No Edit or
|
|
71
|
+
Write, and `Bash` reads only. Running tests writes: snapshots get rewritten,
|
|
72
|
+
fixtures and seed data land in the tree, and this reporter has no reason
|
|
73
|
+
to; `review:code` runs its checks in its own worktree. Establish the last link from **recorded** runs — the phase files,
|
|
74
|
+
CI results, the runner's config — and where there is no record, that is the
|
|
75
|
+
finding.
|
|
76
|
+
- Goals, non-goals, Open Questions — `audit:contract`'s.
|
|
77
|
+
- Security — `wuwei-security-auditor`'s.
|
|
78
|
+
- Duplication and the module graph — `audit:composition`'s.
|
|
79
|
+
|
|
80
|
+
## Output contract
|
|
81
|
+
|
|
82
|
+
Findings in the columns of `.wuwei/templates/code-review.md`, `Reporter` set
|
|
83
|
+
to `audit:coverage`. **Every finding names the link that broke**, in the three
|
|
84
|
+
names above.
|
|
85
|
+
|
|
86
|
+
- **Fails when** — the concrete user path that is not covered, and what goes
|
|
87
|
+
wrong unnoticed because nothing tests it.
|
|
88
|
+
- **Ev** — `CONFIRMED` when the link was traced to a file or a run,
|
|
89
|
+
`PLAUSIBLE` when not. **Nothing PLAUSIBLE is rated HIGH.**
|
|
90
|
+
|
|
91
|
+
Close with the chain as counts — requirements / derived critical paths /
|
|
92
|
+
listed in ACCEPTANCE / e2e items existing / e2e items green — so the place the
|
|
93
|
+
number drops is visible without reading the findings.
|