dw-mc 0.2.0 → 0.4.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/NOTICE.md CHANGED
@@ -5,7 +5,7 @@ someone else is listed here.
5
5
 
6
6
  ## The reviewer persona
7
7
 
8
- `src/domain/persona.ts` holds the review prompt the `prompt` runner opens on. Its
8
+ `src/domain/persona.ts` holds the review prompt a run with no slash command opens on. Its
9
9
  body is derived from the `code-reviewer` agent of
10
10
  [`addyosmani/agent-skills`](https://github.com/addyosmani/agent-skills)
11
11
  (`agents/code-reviewer.md`, commit `be4e44a`), by Addy Osmani, MIT licensed.
package/README.md CHANGED
@@ -1,13 +1,36 @@
1
1
  # dw-mc
2
2
 
3
- Mission control for the pull requests you have open. `dw-mc` keeps what it knows about each one on disk, reads GitHub through your own `gh`, runs code reviews through the agent CLIs already installed on your machine, and sorts every pull request into the one bucket that says what it waits on. It is a local tool for one person: no server, no GitHub App, no webhooks, and nothing leaves the machine but the calls to GitHub it makes as you and whatever the agent CLIs send to their own providers.
3
+ **Mission control for the pull requests you have open** one bucket per PR, reviewed by the agent CLIs already on your machine.
4
4
 
5
- ## Requirements
5
+ [![npm](https://img.shields.io/npm/v/dw-mc.svg?color=0b7285)](https://www.npmjs.com/package/dw-mc)
6
+ [![CI](https://github.com/dominikwozniak/dw-mc/actions/workflows/quality-gate.yaml/badge.svg)](https://github.com/dominikwozniak/dw-mc/actions/workflows/quality-gate.yaml)
7
+ [![license](https://img.shields.io/npm/l/dw-mc.svg?color=0b7285)](./LICENSE)
8
+ [![node](https://img.shields.io/node/v/dw-mc.svg?color=0b7285)](https://nodejs.org)
6
9
 
7
- - Node 24 or newer
8
- - [`gh`](https://cli.github.com), authenticated: `gh auth login`
9
- - `git`
10
- - [Claude Code](https://claude.com/claude-code) as `claude`, or the [Codex CLI](https://developers.openai.com/codex/cli) as `codex` at least one, for review runs and the sessions they open
10
+ `dw-mc` keeps what it knows about each of your open pull requests on disk, reads GitHub through your own `gh`, runs code reviews through your local Claude Code, and sorts every pull request into the one bucket that says what it waits on.
11
+
12
+ - **One bucket per pull request** — _needs me_, _needs review run_, _waiting on others_, _ready_. Never two at once.
13
+ - **Reviews on the Claude Code you already have** its own `/code-review`, your own review brief, or both at once.
14
+ - **Nothing leaves the machine** — no server, no GitHub App, no webhooks. Only the GitHub calls you would have made yourself, and whatever Claude Code sends Anthropic.
15
+ - **State in plain files** — JSON and Markdown under XDG paths, readable without the tool.
16
+ - **A prompt, not a TUI** — the picker runs the command you would have typed, so nothing it does is hidden from you.
17
+
18
+ ```
19
+ $ dw-mc status
20
+
21
+ Needs me
22
+ ● dominikwozniak/dw-mc#71 │ feat(sweep): notice a head that moved under a run │ 2 blocking findings
23
+
24
+ Needs review run
25
+ ◐ dominikwozniak/dw-mc#65 │ docs(agents): how a change becomes a release │ no review run on this head
26
+ ◐ dominikwozniak/dw-mc#66 │ docs(skill): the CLI surface the skill actually has │ no review run on this head
27
+
28
+ Waiting on others
29
+ ○ dominikwozniak/dw-mc#68 │ fix(rebase): keep the lease on a head that moved │ CI is still running
30
+
31
+ Ready
32
+ ◆ dominikwozniak/dw-mc#62 ✓ │ feat(comments): read a pull request's threads │ approved, green, mergeable
33
+ ```
11
34
 
12
35
  ## Install
13
36
 
@@ -17,45 +40,108 @@ pnpm add -g dw-mc
17
40
 
18
41
  To look before installing, `pnpm dlx dw-mc --help` runs the same binary from a throwaway copy.
19
42
 
20
- ## Set up
43
+ ### Requirements
44
+
45
+ - Node 24 or newer
46
+ - [`gh`](https://cli.github.com), authenticated: `gh auth login`
47
+ - `git`
48
+ - [Claude Code](https://claude.com/claude-code) as `claude`, for review runs and the sessions they open
49
+
50
+ ## Quick start
21
51
 
22
52
  ```sh
23
- dw-mc init
53
+ dw-mc init # once on the machine, then once inside each repository you want followed
54
+ dw-mc # the picker: every tracked PR under its bucket, and the commands that move it
55
+ dw-mc review 62 # or drive any command straight
24
56
  ```
25
57
 
26
- Run it once on the machine, and once more inside each repository whose pull requests you want followed. It asks which runner is your bar, whether Codex should give a second opinion beside it, and writes both answers to one file you can keep in your dotfiles.
58
+ `init` asks nothing: it writes the defaults to one file you can keep in your dotfiles, and what a review opens on is two keys in it `review.command` and `review.prompt`.
27
59
 
28
- ## The day
60
+ Every command that takes a pull request takes it as `62` inside the repository, or as `owner/name#62` from anywhere.
29
61
 
30
- ```sh
31
- dw-mc
32
- ```
62
+ ## Commands
63
+
64
+ | Command | Flags | What it does |
65
+ | --------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
66
+ | `dw-mc` | — | Opens the picker: every tracked pull request under its bucket, and what moves the one you choose. |
67
+ | `dw-mc init` | `--effort`, `--base` | Sets this machine up and registers the repository you are in. |
68
+ | `dw-mc sweep` | — | Refreshes what mission control knows about every tracked pull request. It only reads. |
69
+ | `dw-mc status` | — | Shows which bucket every tracked pull request sits in, and which ones you have stamped. |
70
+ | `dw-mc comments <pr>` | `--all` | Prints the conversation on a pull request, and what in it is waiting on you. |
71
+ | `dw-mc review <pr>` | `--command`, `--prompt`, `--effort`, `--model`, `--prompt-only`, `--command-only`, `--force` | Reviews one pull request on Claude Code, in a throwaway worktree. |
72
+ | `dw-mc findings <pr>` | `--json` | Prints what the current review run found. |
73
+ | `dw-mc fix <pr>` | `--print`, `--commit` | Opens a session on the findings you pick, in a worktree that outlives it. |
74
+ | `dw-mc stamp <pr>` | `--withdraw` | Prints your stamp on a pull request, or withdraws it by hand. |
75
+ | `dw-mc rebase <pr>` | — | Rebases a branch onto its base and pushes it with a lease. |
76
+ | `dw-mc resolve <pr>` | `--print` | Opens a session on the conflict that stopped a rebase. |
77
+ | `dw-mc rerun <pr>` | — | Runs a flaky red CI again, once per head. |
78
+ | `dw-mc merge <pr>` | — | Squash-merges a Ready, stamped pull request of yours and deletes its branch. |
79
+ | `dw-mc cleanup` | `--yes` | Takes back the disk spent on clones and review worktrees, and keeps everything you decided. |
80
+ | `dw-mc uninstall` | `--config`, `--force`, `--yes` | Removes everything the tool wrote on this machine, and says how to remove the binary. |
81
+
82
+ `dw-mc <command> --help` prints the flags and what each one is worth.
83
+
84
+ ## How it works
85
+
86
+ A **bucket** is the one place a pull request sits at a time, named for what it waits on. The rules are tried in order and the first that claims the pull request wins, so a pull request that both needs a review run and has changes requested is yours to move, not the review's.
33
87
 
34
- With no arguments `dw-mc` opens the picker: every tracked pull request under the bucket it sits in, and the commands that move the one you choose. It is a prompt and a table, not a full-screen application, so what it runs is the command you would have typed.
88
+ | Bucket | Marker | It waits on |
89
+ | ----------------- | ------ | --------------------------------------------------------------------------------------- |
90
+ | Needs me | `●` | You: blocking findings, changes requested, a conflict, a red CI, an unanswered comment. |
91
+ | Needs review run | `◐` | A review run on this head. |
92
+ | Waiting on others | `○` | A reviewer who has not answered, or CI that is still running. |
93
+ | Ready | `◆` | Nothing. |
35
94
 
36
- The commands behind it, each usable on its own:
95
+ A **stamp** is your own mark that a pull request has passed your bar. It lives on this machine and is never a GitHub approval — but `dw-mc merge` reads it, so a pull request you have not stamped does not merge.
37
96
 
38
- | Command | What it does |
39
- | --------------------- | --------------------------------------------------------------------------------------- |
40
- | `dw-mc sweep` | Refreshes what mission control knows about every tracked pull request. It only reads. |
41
- | `dw-mc status` | Shows which bucket every tracked pull request sits in, and which ones you have stamped. |
42
- | `dw-mc comments <pr>` | Prints the conversation on a pull request, and what in it is waiting on you. |
43
- | `dw-mc review <pr>` | Reviews one pull request on the configured runners, in a throwaway worktree. |
44
- | `dw-mc findings <pr>` | Prints what the current review run found. |
45
- | `dw-mc fix <pr>` | Opens a session on the findings you pick, in a worktree that outlives it. |
46
- | `dw-mc stamp <pr>` | Prints your stamp on a pull request, or withdraws it by hand. |
47
- | `dw-mc rebase <pr>` | Rebases a branch onto its base and pushes it with a lease. |
48
- | `dw-mc resolve <pr>` | Opens a session on the conflict that stopped a rebase. |
49
- | `dw-mc rerun <pr>` | Runs a flaky red CI again, once per head. |
97
+ A review run works in a worktree that is thrown away when the run ends. The worktree a `fix` or `resolve` session opens is left standing, on a branch of the tool's own, because the work you commit in it is yours.
50
98
 
51
- A **bucket** is the one place a pull request sits at a time, named for what it waits on: _needs me_, _needs review run_, _waiting on others_, _ready_. A **stamp** is your own mark that a pull request has passed your bar — it lives on this machine and is never a GitHub approval. Every other word this tool uses is defined in [`CONTEXT.md`](./CONTEXT.md), and the decisions behind them in [`docs/adr/`](./docs/adr).
99
+ Every other word this tool uses is defined in [`CONTEXT.md`](./CONTEXT.md), and the decisions behind them in [`docs/adr/`](./docs/adr).
52
100
 
53
- ## Where things live
101
+ ## Configuration
54
102
 
55
103
  - Configuration: `$XDG_CONFIG_HOME/dw-mc/config.yaml`, or `~/.config/dw-mc/config.yaml`
56
- - State: `$XDG_STATE_HOME/dw-mc`, or `~/.local/state/dw-mc`
104
+ - State, including the worktrees: `$XDG_STATE_HOME/dw-mc`, or `~/.local/state/dw-mc`
105
+
106
+ `init` writes the file, and every key in it is optional: what it leaves out is inherited rather than reset, and `repos` overrides `defaults` in the same shape.
107
+
108
+ ```yaml
109
+ launcher:
110
+ command: [claude] # program + argument prefix that starts Claude Code
111
+ fix_args: [] # flags only a fix session gets
112
+ defaults:
113
+ base: null # the default branch from gh when null
114
+ review:
115
+ command: /code-review # the slash command a run opens on; null for none
116
+ effort: low # the word after the command: low | medium | high | xhigh | max
117
+ prompt: null # your own review brief
118
+ model: null
119
+ docs_only: ["**/*.md", "docs/**"]
120
+ ci:
121
+ ignore: [] # check names that do not count towards green
122
+ flaky_patterns: []
123
+ fix:
124
+ commits: false # whether a fix session may commit; --commit overrides it
125
+ rebase:
126
+ enabled: false
127
+ stamp:
128
+ blocks_on: error
129
+ repos:
130
+ owner/name:
131
+ # the same keys, overriding defaults
132
+ ```
133
+
134
+ ## Taking it back
57
135
 
58
- The worktrees live under the state directory. A review run's is thrown away when the run ends; the one a fix or resolve session opens is left standing, on a branch of the tool's own, because the work you commit in it is yours.
136
+ Removing the package removes the binary and nothing else a package manager runs no uninstall script, so the two directories above would stay where they are. The tool takes them back itself.
137
+
138
+ ```sh
139
+ dw-mc cleanup # the bare clones and the worktrees a review run left: disk the tool spends on itself
140
+ dw-mc uninstall # every record, report, clone and worktree
141
+ pnpm remove -g dw-mc
142
+ ```
143
+
144
+ Both print what they would take, with its weight, and ask before taking it; `--yes` answers for a machine with no terminal. `cleanup` keeps your configuration and every record, and keeps the clone of a repository a `fix` or `resolve` session still stands on, because that session's history lives inside it. `uninstall` keeps the configuration file too unless `--config` asks for it. A worktree a `fix` or `resolve` session left standing is yours: `cleanup` never touches one, and `uninstall` names what it still holds — uncommitted changes, or a commit your pull request's head does not have — and removes nothing until `--force`.
59
145
 
60
146
  ## The skill
61
147
 
@@ -65,6 +151,17 @@ An agent session can reach mission control's state through the `/dw-mc` skill, w
65
151
  pnpm dlx skills@latest add dominikwozniak/dw-mc
66
152
  ```
67
153
 
68
- ## Licence
154
+ ## Contributing
155
+
156
+ ```sh
157
+ pnpm install
158
+ pnpm check # lint, format, typecheck, test, build — the whole gate, and what CI runs
159
+ ```
160
+
161
+ Work lands on `main` through a pull request, on a branch named `type/<issue>-subject`, squash-merged under a [Conventional Commits](https://www.conventionalcommits.org) title. [`CONTRIBUTING.md`](./CONTRIBUTING.md) has the rest: what is worth an issue first, the layers a module belongs to, and when a change carries a changeset. Everyone taking part is held to the [Code of Conduct](./CODE_OF_CONDUCT.md).
162
+
163
+ Found a security issue? Do not open an issue — [`SECURITY.md`](./SECURITY.md) says how to report it privately.
164
+
165
+ ## License
69
166
 
70
167
  MIT. Third-party notices are in [`NOTICE.md`](./NOTICE.md).