wei-wuwei 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +66 -27
- package/bin/wuwei.js +3183 -46
- package/package.json +2 -2
- package/skills/wuwei-execute-phase/skill.md +12 -0
- package/skills/wuwei-review/references/stream.md +6 -1
- package/skills/wuwei-review/skill.md +10 -7
- package/wuwei.config.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ One section per published version, newest first. `wuwei update` prints the
|
|
|
4
4
|
sections between the installed version and the new one before it asks;
|
|
5
5
|
`wuwei check` fails when package.json's version has no section here.
|
|
6
6
|
|
|
7
|
+
## 0.6.0
|
|
8
|
+
|
|
9
|
+
- feat(brief): wuwei brief — the personal dashboard (stream personal-dashboard) (#75)
|
|
10
|
+
|
|
7
11
|
## 0.5.0
|
|
8
12
|
|
|
9
13
|
- feat(plan-check): a script is an e2e harness too (#69)
|
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ wuwei update # newer version out? shows what it woul
|
|
|
56
56
|
# from a clone:
|
|
57
57
|
git clone git@github.com:jameshsiao/wuwei.git
|
|
58
58
|
cd wuwei
|
|
59
|
-
npm run check # lint
|
|
59
|
+
npm run check # validate frontmatter, lint references and budgets
|
|
60
60
|
npm run build # emit repo-local artifacts (.claude/, .agents/, AGENTS.md, CLAUDE.md)
|
|
61
61
|
node bin/wuwei.js init <project> # repo scope: templates + .wuwei/ skeleton, then
|
|
62
62
|
# offers the tools below (and, with Codex, an execute
|
|
@@ -67,6 +67,9 @@ node bin/wuwei.js status <project> # read-only: streams/claims from .wuwei, dr
|
|
|
67
67
|
node bin/wuwei.js update # git pull if behind, diff against what install wrote, apply on yes
|
|
68
68
|
node bin/wuwei.js review-prep <base> # wuwei-review's prep: dispatcher checks + scan bundle (or --pr <n>)
|
|
69
69
|
node bin/wuwei.js claim [stream] [NN] # list eligible phases, or claim one: cut, claim, push
|
|
70
|
+
node bin/wuwei.js brief <path>… [--json | --html | --md] [--write] [--open] [--mark] [--if-due 08:45] [--since 7d] [--stale 72h] # your daily dashboard across repos: done, today,
|
|
71
|
+
# left, what waits on you, and the PRs — a page on a terminal; see docs/brief/README.md
|
|
72
|
+
node bin/wuwei.js brief <path>… --schedule [launchd|cron|claude-desktop] [--at 08:45] # print the daily routine to paste; installs nothing
|
|
70
73
|
node bin/wuwei.js review-collect # each lens's transcript + report into the bundle, and what each one spent
|
|
71
74
|
node bin/wuwei.js digest-check <f> # a review digest's arithmetic before it is published
|
|
72
75
|
node bin/wuwei.js plan-check [stream] # plan-phases step 11's checkable half, before sign-off
|
|
@@ -75,9 +78,12 @@ node bin/wuwei.js mutate <f>:<n> --from … --to … --run … --in <wt> # one
|
|
|
75
78
|
node bin/wuwei.js sites <pattern>… [--symbol <name>] # a set derived from the tree, graph and grep both; several names in one call
|
|
76
79
|
node bin/wuwei.js claims-scan <doc>… # a document's paths, names, file:lines and commands checked against the tree in one call
|
|
77
80
|
node bin/wuwei.js verify [page] [--phase NN] # every data-bearing page × 500/403/404/empty/pending/failed refetch; --phase: ACCEPTANCE's ## Verify; mobile: Maestro + mock server
|
|
78
|
-
node bin/wuwei.js uninstall # removes
|
|
81
|
+
node bin/wuwei.js uninstall # user scope: removes the stamped files install wrote, and wuwei's rules blocks
|
|
82
|
+
node bin/wuwei.js uninstall <path> # a project: removes the templates whose text names wuwei — a team file that says "wuwei" goes too
|
|
79
83
|
```
|
|
80
84
|
|
|
85
|
+
Every command, what it does and an example, is in [Commands](#commands) below.
|
|
86
|
+
|
|
81
87
|
`update` is `install` with its eyes open. It first asks the channel this copy
|
|
82
88
|
came from whether a newer version exists — git for a clone, npm for the
|
|
83
89
|
package — and offers to move to it; the newer copy then runs the diff. Every
|
|
@@ -87,7 +93,8 @@ in `~/.wuwei/manifest.json`), `stale` (orphaned, would be removed) or
|
|
|
87
93
|
`conflict` (a file at that path wuwei did not generate). Before that it prints
|
|
88
94
|
`CHANGELOG.md`'s sections since the installed version. Nothing is written
|
|
89
95
|
without a yes; `edited` and `conflict` files are copied to
|
|
90
|
-
`~/.wuwei/local-patches/<time>/` first; `--dry` only reports
|
|
96
|
+
`~/.wuwei/local-patches/<time>/` first; `--dry` only reports
|
|
97
|
+
(it still asks git or npm first).
|
|
91
98
|
|
|
92
99
|
You don't have to remember to run it: once a day any `wuwei` command checks
|
|
93
100
|
npm in the background, and when a newer version is out it says so on stderr
|
|
@@ -105,12 +112,64 @@ tests-only merge releases nothing; *Run workflow* (`workflow_dispatch`) with a
|
|
|
105
112
|
bump releases now. A version already set in `package.json` that npm has not
|
|
106
113
|
seen goes out as is.
|
|
107
114
|
|
|
115
|
+
## Commands
|
|
116
|
+
|
|
117
|
+
Every command the CLI accepts, and what it does — each row written from the
|
|
118
|
+
command's own code. `wuwei` is also `ww` and `wei-wuwei`; from a clone, run
|
|
119
|
+
`node bin/wuwei.js` in its place. Bare `wuwei` is `wuwei build`.
|
|
120
|
+
|
|
121
|
+
| Command | What it does | Example |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| [`init [path]`](#tools-it-will-offer-you) | Bootstraps a project (default: the current directory): the PR template, `.wuwei/templates/` and a `.wuwei/STATE.md` skeleton. Then, only where they help, it offers a `.planning/` (GSD) import, codegraph, semgrep and osv-scanner, and — if Codex has run — an execute profile in `$CODEX_HOME/config.toml`; it ends by naming the next step | `wuwei init` |
|
|
124
|
+
| [`install [path]`](#quick-start) | With no path, once per machine: skills and agents into `~/.claude`, rules into `~/.claude/CLAUDE.md` and, if Codex has run, skills into `~/.agents/skills` and rules into `$CODEX_HOME/AGENTS.md`; what it wrote is recorded in `~/.wuwei/manifest.json`, and it offers `npm install -g`. With a path, only that project's templates and `.wuwei/STATE.md` | `npx wei-wuwei install` |
|
|
125
|
+
| [`update`](#quick-start) | Asks the channel this copy came from (git for a clone, npm for the package) whether a newer one exists and offers to move to it; then shows what `install` would change — `new`, `changed`, `edited`, `stale`, `conflict` — and applies it on a yes, copying your edits to `~/.wuwei/local-patches/` first. Off a terminal, or with `--dry`, it changes no file of yours — it still asks git (`git fetch`) or npm first. `--no-fetch` skips that question | `wuwei update` |
|
|
126
|
+
| [`uninstall [path]`](#tools-it-will-offer-you) | Without a path, takes back what `install` wrote: the skills and agents in `~/.claude` and the skills in `~/.agents/skills` that carry wuwei's `GENERATED BY wuwei` stamp, wuwei's block in `~/.claude/CLAUDE.md` and `$CODEX_HOME/AGENTS.md`, the Codex profile `init` added and `~/.wuwei/manifest.json`; then it offers to take back the global command, codegraph and the scanners (semgrep, osv-scanner), each only where it is still installed. With a path, the project's PR template and `.wuwei/templates/*.md` **whose text names wuwei** — those templates carry no stamp, so a team file at one of those paths that mentions wuwei is removed too; `.wuwei/STATE.md` and `streams/` are kept, and the one offer is codegraph's `uninit`, where `.codegraph/` is. It has no `--dry`: it removes | `wuwei uninstall` |
|
|
127
|
+
| `build` | Emits this checkout's repo-local artifacts from `skills/` and `agents/`, for the targets `wuwei.config.json` enables: `.claude/`, `CLAUDE.md`, `AGENTS.md` and `.agents/skills/`. What `wuwei` runs with no command | `npm run build` |
|
|
128
|
+
| `check` | Validates every skill's and agent's frontmatter, then lints them: a number that counts a list below it, a `wuwei-…` name or `§N` that no longer exists, word budgets, `modelRoles` against the agent files, and a `CHANGELOG.md` section for this version. Exit 1 with the list on a failure; CI runs it | `npm run check` |
|
|
129
|
+
| `list` | Prints the skills (marked `[always]` for a rule, `[local]` for one that stays in the repo), the agents and the templates this copy holds | `wuwei list` |
|
|
130
|
+
| `status [path]` | Read-only: the streams `.wuwei/STATE.md` lists against the directories under `.wuwei/streams/`, each mismatch it can prove flagged, and a warning when `.codegraph/` is tracked by git | `wuwei status ~/work/app` |
|
|
131
|
+
| `claim [stream] [phase]` | A stream's phases and where each stands (`ready`, `claimed`, `merged`, `waiting`, `blocked`), whether its stream branch is current, and the model each step dispatches. With a phase it cuts that phase's branch from the stream branch, writes `claimed-by` and `claimed-at` into the phase file, commits and pushes. It refuses a merged, waiting or claimed phase (`--take-over` records a takeover), a stale stream branch and a dirty checkout. `--by <who>` names the claimer; without it, a claim made from inside a Claude Code session (its `CLAUDE_CODE_SESSION_ID`, when that is a uuid) writes `claimed-by: <user>@<host> (session <uuid>)`, which `brief` reads to find the session; `--dry` stops before the branch is cut, so it changes no file of yours — `claim` always runs `git fetch origin` first | `wuwei claim my-stream 03` |
|
|
132
|
+
| [`brief <path>…`](docs/brief/README.md) | Across every wuwei repo under the paths: what got done since you last looked, what you can start today, what is left, what waits on you, and the PRs. On a terminal it writes the report as a web page to `~/.wuwei/brief/brief.html` and opens it; off one (a pipe, a file, an agent) it prints markdown. `--md` the markdown, `--json` the data, `--html` the page on stdout, `--write` the page whatever stdout holds, `--open` show the page it writes, `--mark` start the next window here, `--if-due 08:45` do nothing new when a routine has run since then (what every routine passes), `--since 7d` look further back, `--stale 48h` when a claim without commits is stale, `--lang zh-TW` the report's own words in 繁體中文 (or in a language you write: `--lang-template` prints the table to translate), `--schedule [launchd\|cron\|claude-desktop] [--at 08:45]` prints a daily routine to paste and installs nothing | `wuwei brief ~/work` |
|
|
133
|
+
| `plan-check [stream]` | wuwei-plan-phases step 11's checkable half, before sign-off: the `## Sign-off` fields, a stream branch ending `/base` and on origin, `depends-on` that resolves without a cycle (phases and tasks), the task diagram matching those fields, `## Verify` bound to phases, a harness named, and `STATE.md` agreeing with `phases/`. Exit 1 on any error | `wuwei plan-check my-stream` |
|
|
134
|
+
| `review-prep [base]` | wuwei-review's prep: fetches the base and writes the bundle `.wuwei-cache/review/<sha>/` — `INDEX.md`, `diff.patch` and `PREP.md` (merges cleanly, CI at HEAD, tool-maintained deletions, author paths) — plus semgrep's output and, for a changed lockfile, osv-scanner's, where they are installed. `--pr <n>` reads a PR and its thread, `--path <p>` reviews a path with no base, `--no-scan` skips the scanners | `wuwei review-prep main` |
|
|
135
|
+
| `review-collect` | Copies each lens's transcript and report from the newest Claude Code session here that dispatched a wuwei lens into the bundle's `reports/`, and prints what each one spent. `--session <id>` picks another session; `--sha <sha>` another bundle, by the 12-character sha `review-prep` named it by — used as the directory name, not resolved, so `--sha 3252957f2bcd`, not `--sha main` | `wuwei review-collect` |
|
|
136
|
+
| `verify [page]` | Walks each page of `.wuwei/verify.json` through a 500, 403, 404, empty, pending and a failed refetch — in Chromium (Playwright) against a mock of the API, or, for a mobile app, on a simulator with Maestro — and writes a matrix and screenshots under `.wuwei-cache/verify/<sha>/`. `--phase NN` runs the pages ACCEPTANCE.md binds to that phase, and with more than one stream under `.wuwei/streams/` it needs `--stream <name>` to say whose | `wuwei verify --phase 04 --stream my-stream` |
|
|
137
|
+
| `digest-check <digest.md>` | A review digest's arithmetic before it is published: raw = rows + merged + dropped, the numbering, reporter credits, every `file:line` and identifier against the reviewed tree, no HIGH that is PLAUSIBLE, no secret, the verdict's two axes, and whether HEAD moved. Exit 1 on an error | `wuwei digest-check digest.md` |
|
|
138
|
+
| `worktree <lens> [sha]` | A throwaway detached git worktree in the temp directory, named for the sha and the lens so no two lenses share one; prints its path and nothing else. `--prune [sha]` removes them | `cd "$(wuwei worktree defects HEAD)"` |
|
|
139
|
+
| `mutate <file>:<line>` | One mutation, inside a worktree `wuwei worktree` made: replaces `--from` (which must occur once on that line) with `--to`, runs `--run` before and after, puts the file back, and says `caught` or `survived` when it can read the runner's failure count, `green by exit code` or `red by exit code` when it cannot, and `did not land` when the file did not change; the run is recorded under `.wuwei-cache/review/<sha>/mutations/`. `--in <worktree>` names the tree, `--no-baseline` skips the first run. Exit 2 if the file could not be restored | `wuwei mutate src/pay.js:42 --from '>=' --to '>' --run 'npm test' --in "$WT"` |
|
|
140
|
+
| `sites <pattern>…` | A set derived from the tree: every site of each pattern by `git grep`, with the command printed beside the count. `--symbol <name>` also asks codegraph for its callers and says where graph and grep disagree; `--regex` reads each pattern as an extended regex (`-E`; the default is a fixed string, `-F`), `--sha <rev>` greps that revision instead of `HEAD`, `-- <pathspec>` only those paths | `wuwei sites parseFrontmatter signOffField` |
|
|
141
|
+
| `claims-scan <doc>…` | A document's code-span paths, `file:line`s, commands and names checked against the tree in one pass; counts and commands it cannot check are listed for judgment. `--sha <rev>` reads the tree there, `--all` lists what held too | `wuwei claims-scan README.md` |
|
|
142
|
+
| `--version`, `-v`, `version` | Prints this copy's version | `wuwei --version` |
|
|
143
|
+
| `--dry` | A flag, not a command: on `build`, `init`, `install`, `update` and `claim` it says what would be written and changes no file of yours; `claim` and `update` still fetch (`git fetch`, or npm's registry for the package). `uninstall` does not take it | `wuwei install --dry` |
|
|
144
|
+
|
|
145
|
+
## `wuwei brief` — your daily dashboard
|
|
146
|
+
|
|
147
|
+
One command each morning, across every wuwei repo you work in: **what got done
|
|
148
|
+
since you last looked, what you can start today, what is left, and what waits
|
|
149
|
+
on you** — read from each stream at origin, with your pull requests added when
|
|
150
|
+
the GitHub CLI is logged in. On a terminal the report is a web page, written to
|
|
151
|
+
`~/.wuwei/brief/brief.html` and opened in your browser; off one it is markdown.
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
wuwei brief ~/work
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
<p align="center">
|
|
158
|
+
<img src="https://raw.githubusercontent.com/Jameshsiao/wuwei/main/docs/img/brief/desktop-light.png" alt="The wuwei brief page on a desktop: a headline of what needs you — 8 CI failing, 7 ready to merge, 3 reviews requested — then the Needs you list, grouped by what to do, beside the phases in motion and each stream's progress" height="420">
|
|
159
|
+
</p>
|
|
160
|
+
|
|
161
|
+
From the test fixture — fake repos and a fake `gh`. Every flag, the report as
|
|
162
|
+
markdown and JSON, the GitHub half, a daily routine and your own language are in
|
|
163
|
+
the full guide: [`docs/brief/README.md`](docs/brief/README.md).
|
|
164
|
+
|
|
108
165
|
## Daily use
|
|
109
166
|
|
|
110
|
-
The CLI above
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
167
|
+
The CLI above installs wuwei, reads and checks the plan, and does the mechanical
|
|
168
|
+
halves of what the skills ask for — claiming a phase, a review's prep, one
|
|
169
|
+
mutation's run. The work itself is driven by the ten skills, invoked by name or
|
|
170
|
+
triggered by what you say. A stream runs **grill → brainstorm → plan →
|
|
171
|
+
execute**, with a human at exactly two points: sign-off before anything is
|
|
172
|
+
built, and UAT at the end.
|
|
114
173
|
|
|
115
174
|
```
|
|
116
175
|
/wuwei-grill # interrogate the requirement — no solutions yet
|
|
@@ -190,26 +249,6 @@ changed and cannot show what depends on it, which is why the first row gates
|
|
|
190
249
|
severity: "no call site left behind" is a claim a graph settles and reading
|
|
191
250
|
harder never will.
|
|
192
251
|
|
|
193
|
-
## Repo layout
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
wuwei/
|
|
197
|
-
├── skills/ # canonical skill definitions (source of truth)
|
|
198
|
-
│ └── _template/
|
|
199
|
-
├── agents/ # canonical subagent definitions
|
|
200
|
-
│ └── _template/
|
|
201
|
-
├── templates/ # PR / review templates, installed per-repo
|
|
202
|
-
├── bin/wuwei.js # CLI: build · check · list · init · install · update · status · review-prep · review-collect · claim · digest-check · plan-check · worktree · mutate · sites · claims-scan · verify · uninstall
|
|
203
|
-
│ # the per-tool emitters live here too, not in adapters/
|
|
204
|
-
├── adapters/ # notes only — see bin/wuwei.js for the actual emitters
|
|
205
|
-
├── docs/
|
|
206
|
-
│ ├── product.md # what wuwei is now (edited in place)
|
|
207
|
-
│ ├── decisions.md # why it got here (append-only)
|
|
208
|
-
│ ├── architecture.md
|
|
209
|
-
│ └── authoring.md
|
|
210
|
-
└── wuwei.config.json # sources + targets; `commands` is declared but not built yet
|
|
211
|
-
```
|
|
212
|
-
|
|
213
252
|
## Design principles
|
|
214
253
|
|
|
215
254
|
1. **One source of truth.** A skill is defined once. Everything else is generated.
|