@sjawhar/opencode-legion-envoy 8.17.0 → 8.17.2
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/package.json +1 -1
- package/skills/dispatch/SKILL.md +107 -409
- package/skills/dispatch/references/api.md +16 -48
- package/skills/dispatch/references/asks.md +19 -78
- package/skills/dispatch/references/document-edits.md +38 -187
- package/skills/dispatch/references/documents.md +32 -224
- package/skills/dispatch/references/examples.md +10 -27
- package/skills/dispatch/references/issues.md +34 -196
- package/skills/dispatch/references/messages.md +13 -58
- package/skills/dispatch/references/reading.md +10 -45
- package/skills/dispatch-brainstorming/SKILL.md +34 -99
- package/skills/dispatch-first/SKILL.md +16 -34
- package/skills/thermonuclear-code-quality/SKILL.md +96 -185
- package/skills/thermonuclear-deep-review/SKILL.md +45 -69
|
@@ -1,121 +1,56 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dispatch-brainstorming
|
|
3
|
-
description: "Use
|
|
3
|
+
description: "Use when a session with Dispatch starts a design conversation with a person: brainstorming, /brainstorming or \"let's design\". Also use it there for a spec, an implementation plan, or a change that needs a person's choices. It replaces superpowers' brainstorming and writing-plans. A Legion architect's own spec follows skill://legion-architect instead."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Brainstorming in Dispatch
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
spec: an architect follows `skill://legion-architect` for that, even for a child issue.
|
|
8
|
+
A Legion architect's own issue spec, a child's too, follows `skill://legion-architect`. A Legion phase worker never writes the spec: it sends the decision to its architect (`skill://legion-worker`).
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
follows is a document on the same issue. This skill replaces superpowers' `brainstorming` and
|
|
13
|
-
`writing-plans` there, even when the user invokes one of them by name:
|
|
10
|
+
This skill replaces superpowers' `brainstorming` and `writing-plans`, even when the user names one:
|
|
14
11
|
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
nothing about where the conversation happens.
|
|
21
|
-
- The spec is the issue's primary document and the plan is its `plan.md` document, in place of
|
|
22
|
-
superpowers' spec and plan files (`docs/superpowers/specs/`, `docs/superpowers/plans/`). A copy
|
|
23
|
-
also goes in the repository only when the person, the issue, its spec or the repository asks for
|
|
24
|
-
one.
|
|
12
|
+
- The spec is the issue's primary document, the plan its `plan.md`. No `docs/superpowers/` files.
|
|
13
|
+
- Each design question is a decision block in the spec, never a chat question. A small change gets a short spec.
|
|
14
|
+
- Send every ready question at once. Request approval once, at the end.
|
|
15
|
+
- Ask in stages: clarifying questions, two or three approaches with a recommendation, the design by section. A question that depends on no open answer goes out at once.
|
|
16
|
+
- Copy the spec, plan or spec code into the repository only when the person, the issue, its spec or the repository asks.
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
approaches with a recommendation, then the design section by section. A question that depends on
|
|
28
|
-
no open answer goes out at once, whatever its stage.
|
|
29
|
-
|
|
30
|
-
Read `skill://dispatch` before the first version: its "Writing a spec", "Decision blocks",
|
|
31
|
-
"Writing for the human" and "Approval of a spec" sections define the spec's shape, each block's
|
|
32
|
-
shape, and when approval is requested. A Legion phase worker never writes the issue's spec
|
|
33
|
-
document; it sends a decision to its architect (`skill://legion-worker`).
|
|
18
|
+
Before the first version, read the code and documents the design touches. Before the first version, also read the `skill://dispatch` sections "Writing a spec", "Decision blocks", "Writing for the human" and "Approval of a spec".
|
|
34
19
|
|
|
35
20
|
## Where the spec lives
|
|
36
21
|
|
|
37
|
-
Search
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
dispatch issue --project <KEY> --title '<title>' --spec-file - <<'EOF'
|
|
44
|
-
<the spec's first version>
|
|
45
|
-
EOF
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
No command lists every project, so when nothing you found names one, ask the human in chat which
|
|
49
|
-
project the issue belongs in before you create it — a filing question with nowhere else to land
|
|
50
|
-
yet, not a design question, so it does not change "your reply in chat links the issue and asks
|
|
51
|
-
nothing" for the design itself. Never read the project from the environment, a configuration file,
|
|
52
|
-
or the Dispatch HTTP API: every read and write goes through a `dispatch` command.
|
|
53
|
-
|
|
54
|
-
Before the first version, read the code and documents the design touches, so the facts you write
|
|
55
|
-
are ones you checked.
|
|
22
|
+
1. Search first (`skill://dispatch-first`). If an issue tracks the work, extend its primary document with `dispatch doc-edit`, keeping the human's text.
|
|
23
|
+
2. Else run `dispatch issue --project <KEY> --title '<title>' --spec-file -` in the project a search hit names.
|
|
24
|
+
3. If no hit names a project, ask the human in chat which one (`dispatch projects` lists them). This is a filing question, not a design question.
|
|
25
|
+
4. Use only `dispatch` commands. Never get the project from the environment, a configuration file or the Dispatch HTTP API.
|
|
56
26
|
|
|
57
27
|
## Each turn
|
|
58
28
|
|
|
59
|
-
1. **
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
point the human has not stated, however obvious it seems (what a word in the request means, how
|
|
65
|
-
an edge case behaves, what a change does to an existing command), goes inside a decision block
|
|
66
|
-
or stays out. This is stricter than `skill://dispatch`'s general rule for an inferred point
|
|
67
|
-
elsewhere in a spec ("a point you inferred says so, with the reasoning"): in a live conversation
|
|
68
|
-
nothing is settled until the human has seen it, so even a flagged inference waits for its own
|
|
69
|
-
decision block.
|
|
70
|
-
2. **The human answers or comments.** Reply to each human comment in its thread
|
|
71
|
-
(`dispatch comment --reply-to <comment id>`), then rewrite the passage the answer or the comment
|
|
72
|
-
changes. Under an open ask whose next move is yours, such as the approval request you must
|
|
73
|
-
revise or hand back, reply with `--reply-to-ask <ask id> --turn agent` instead: a `--reply-to`
|
|
74
|
-
reply takes the default turn, which hands the request back to the human unchanged, and a call
|
|
75
|
-
with a corrected `--summary` is refused while it waits on them.
|
|
76
|
-
3. **Each next version keeps answers in place and adds what they open.** An answered decision
|
|
77
|
-
block already carries its own record, as `skill://dispatch`'s "Writing a spec" says; leave it
|
|
78
|
-
where it is. Where an answer changes design text elsewhere in the spec, rewrite that text. Then
|
|
79
|
-
add the next sections, each with its question. Every question that is ready goes out
|
|
80
|
-
at once, each as a decision block at the end of the section that sets it up; a question waits
|
|
81
|
-
only when it depends on an answer still open.
|
|
82
|
-
4. **A comment that answers a question settles it** as surely as the block does. It carries no
|
|
83
|
-
rendered record, so write it into the text at once, recording the person as `skill://dispatch`'s
|
|
84
|
-
"Writing a spec" says, and close the block with `dispatch resolve-ask` if the human has not.
|
|
85
|
-
5. **Request approval at the end, not after each section.** Once nothing in the spec is new to the
|
|
86
|
-
human, request it exactly when "Approval of a spec" in `skill://dispatch` says: every decision
|
|
87
|
-
block settled, the human has agreed to every point in the spec, and the current
|
|
88
|
-
version is not yet approved (or waived, as that section's next paragraph covers). The request
|
|
89
|
-
carries nothing new, as that section also says.
|
|
29
|
+
1. **First version: only what the human settled.** Write the problem, its evidence, the human's words and the facts the questions need. Add each ready question as a block at the end of its section. Write no design, no default you chose, and no recommendation outside a block. A point the human did not state goes in a block or stays out, however obvious. A flagged inference waits too.
|
|
30
|
+
2. **Reply to each comment in its thread** (`dispatch comment --reply-to <comment id>`), then rewrite what it changes. When the next move on an open ask is yours, such as an approval request to revise, use `--reply-to-ask <ask id> --turn agent`.
|
|
31
|
+
3. **Each next version keeps answered blocks in place** and rewrites every passage a decision changes. The spec records the current design and requirements, never how you got there. Then add the next sections and their ready questions.
|
|
32
|
+
4. **A comment that answers a question settles it.** Write the answer into the text at once, as "Writing a spec" says. Close the block with `dispatch resolve-ask` if it is still open.
|
|
33
|
+
5. **Request approval** when nothing in the spec is new to the human, as "Approval of a spec" says.
|
|
90
34
|
|
|
91
35
|
## Coming to terms
|
|
92
36
|
|
|
93
|
-
|
|
94
|
-
enough for the human to react to and with each tool, event and route it uses named exactly (as
|
|
95
|
-
"Writing for the human" in `skill://dispatch` says), and ask; the human's model comes out of those
|
|
96
|
-
reactions, and so do corrections to it. Neither your model nor theirs is the starting truth.
|
|
37
|
+
Explain plainly what the code does now, naming each tool, event and route exactly, and ask. Neither model is true at the start: the human's reactions give their model and its corrections.
|
|
97
38
|
|
|
98
|
-
##
|
|
99
|
-
|
|
100
|
-
Once the spec is approved — or, when the issue needed no spec at all (a bug fix with no design
|
|
101
|
-
decision), once you have enough to plan from — the implementation plan is the issue's `plan.md`
|
|
102
|
-
document, never its spec:
|
|
39
|
+
## Handing over a spec or plan
|
|
103
40
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
41
|
+
1. Start your chat reply with:
|
|
42
|
+
1. Each decision the human must make: options, trade-offs and your recommendation, clear without the document. The human answers in the block.
|
|
43
|
+
2. Each point the human has not yet settled, one line each, with a line reference.
|
|
44
|
+
3. The link.
|
|
45
|
+
2. The reply carries only what is new. The document stays the full current design.
|
|
46
|
+
3. If no decision is open and nothing is new, do not ask for review in the reply. Say the document records what you agreed. Turn step 5 still applies.
|
|
47
|
+
4. When you ask for review, say "ready for review", never "complete". Put the uncertainty first and show your reasoning.
|
|
109
48
|
|
|
110
|
-
|
|
111
|
-
full — file structure, task right-sizing, bite-sized steps, no placeholders, the header, and its
|
|
112
|
-
self-review — only where the plan lives changes: the issue's `plan.md`, in place of a plan file.
|
|
113
|
-
A copy in the repository, or spec code there, goes in only when the person, the issue, its spec or
|
|
114
|
-
the repository asks for it.
|
|
115
|
-
Technical choices inside the approved design are made in the plan and need no question. A plan
|
|
116
|
-
never changes a decision the human made in the spec: a change to one goes back to the spec as a
|
|
117
|
-
decision block, with the evidence for it.
|
|
49
|
+
## The plan
|
|
118
50
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
51
|
+
- Write it after the spec's approval. With no spec (a bug fix with no design decision), write it when you can plan.
|
|
52
|
+
- Upload it with `dispatch artifact --issue <KEY> --name plan.md --content-file -`. Each upload is a new version.
|
|
53
|
+
- Follow all `writing-plans` content rules: file structure, task size, small steps, no placeholders, the header, its self-review.
|
|
54
|
+
- Make technical choices inside the approved design in the plan, with no question. A change to a human's decision goes back to the spec as a block, with its evidence.
|
|
55
|
+
- If the human says "plan only", stop after the plan.
|
|
56
|
+
- To execute, read it with `dispatch doc-read --issue <KEY> --artifact plan.md`, then follow `executing-plans` or `subagent-driven-development`.
|
|
@@ -1,58 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dispatch-first
|
|
3
|
-
description: "Use
|
|
3
|
+
description: "Use when a session has the dispatch command, before you plan, file an issue, ask a human, post a finding, or start work. Someone may track that work already or hold a decision on it."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Dispatch first
|
|
7
7
|
|
|
8
|
-
Dispatch
|
|
9
|
-
specs, and the answers humans gave. A second issue for tracked work, or a question a human already
|
|
10
|
-
answered, costs that human the time to notice it and splits the history across two places.
|
|
8
|
+
Dispatch holds the open issues, their specs and the answers humans gave. A duplicate issue or a repeated question costs a human time and splits the history.
|
|
11
9
|
|
|
12
10
|
## Search before you act
|
|
13
11
|
|
|
14
|
-
Before you plan, file an issue, ask, post a finding or start work,
|
|
15
|
-
|
|
16
|
-
thing and what is wrong with it, as a user would name them. Never paste a draft.
|
|
12
|
+
- Before you plan, file an issue, ask, post a finding or start work, run `dispatch search` (`dispatch --help` lists every command).
|
|
13
|
+
- Every query word must match, so each added word can only lose hits. Use two or three words: the thing and what is wrong with it, as a user names them. Never paste a draft.
|
|
17
14
|
|
|
18
15
|
```bash
|
|
19
16
|
dispatch search --query 'broadcast send order'
|
|
20
17
|
dispatch search --query 'reviewer threads OR review comments'
|
|
21
18
|
```
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
that could be yours with `dispatch read`, then its parent (the `child_of` row under `Links:`); the
|
|
26
|
-
parent's children and the issue's `Components:` line show where the rest of that work lives.
|
|
20
|
+
- No hits: drop a word before you add one. Try two or three wordings (the component's name, the symptom, the fix) before you conclude that nothing exists.
|
|
21
|
+
- Open each hit that could be yours with `dispatch read`, then its parent (the `child_of` row under `Links:`). The parent's children and the `Components:` line show where the rest of the work is.
|
|
27
22
|
|
|
28
23
|
## What to do with what you find
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **
|
|
35
|
-
|
|
36
|
-
work, and cite the nearest one you ruled out (`dispatch://KEY`).
|
|
37
|
-
- **The question is already decided: cite the decision.** An answered ask is the record. Point to
|
|
38
|
-
it where you rely on it (`dispatch://KEY/ask/<id>`) instead of asking again.
|
|
39
|
-
- **You met a duplicate: close it.** Keep the issue that holds the spec and the discussion, carry
|
|
40
|
-
over anything only the duplicate has, then close the duplicate with a reason that names the
|
|
41
|
-
survivor: `dispatch issue-update --issue <KEY> --status done --reason 'Duplicate of dispatch://KEY.'`.
|
|
42
|
-
When the duplicate carries the `legion` label, or another session or a human holds its claim,
|
|
43
|
-
comment on it naming the survivor instead of closing it.
|
|
44
|
-
- **Every ask and message stands on its own.** The person who answers sees only that text: put the
|
|
45
|
-
facts, the options and your recommendation in it, and link what you cite (`dispatch://…`)
|
|
46
|
-
instead of writing "see above" or "my earlier message".
|
|
25
|
+
`dispatch issue` and `dispatch ask` also search: treat a hit in the result's `advice.suggestions` as one you found.
|
|
26
|
+
|
|
27
|
+
- **Work already tracked:** put the finding on that issue (a comment, a message, or a spec edit). File a new issue only when no hit covers the work, and cite the nearest one you ruled out (`dispatch://KEY`).
|
|
28
|
+
- **Question already decided:** the answered ask is the record. Cite it (`dispatch://KEY/ask/<id>`) where you rely on it. Do not ask again.
|
|
29
|
+
- **Duplicate found:** keep the issue with the spec and the discussion, and copy over what only the duplicate has. Then close it: `dispatch issue-update --issue <KEY> --status done --reason 'Duplicate of dispatch://KEY.'`. If it has the `legion` label, or another session or a human holds its claim, comment on it with the survivor's name. Do not close it.
|
|
30
|
+
- **Every ask and message stands alone:** the reader sees only that text. Put the facts, the options and your recommendation in it. Link what you cite (`dispatch://…`). Never write "see above" or "my earlier message".
|
|
47
31
|
|
|
48
32
|
## Design in the spec
|
|
49
33
|
|
|
50
|
-
A design conversation with a person, or the
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
invokes one by name. Before a spec's first version and each approval request, have a fresh read-only subagent (on Oh My Pi, `task(agent="scout")`, or whatever read-only agent the host bundles) check it against the code, the human's words and any command output a claim rests on, and resolve what it flags. A Legion architect's own issue spec follows `skill://legion-architect`, and its fresh reader in that Legion session is the Legion plugin's `plan-gap-analyst` agent.
|
|
34
|
+
- A design conversation with a person, or the plan that follows it, uses `skill://dispatch-brainstorming`. Read it before your first design question, the spec, or the plan. It replaces superpowers' `brainstorming` and `writing-plans` here, also when the user names one of them.
|
|
35
|
+
- Before a spec's first version and each approval request, get a fresh read-only subagent to check it. On Oh My Pi, use `task(agent="scout")`. Elsewhere, use the host's read-only agent. It checks the spec against the code, the human's words and the command output that its claims rest on. Resolve what it flags.
|
|
36
|
+
- A Legion architect's own issue spec follows `skill://legion-architect`. Its fresh reader in that Legion session is the Legion plugin's `plan-gap-analyst` agent.
|
|
54
37
|
|
|
55
38
|
## Load the full skill before you write
|
|
56
39
|
|
|
57
|
-
Before any write to Dispatch
|
|
58
|
-
claim), load `skill://dispatch` unless you already have in this session.
|
|
40
|
+
Before any write to Dispatch, load `skill://dispatch`: an ask, a message, a comment, a document edit, a status change, a claim. Skip this if you loaded it in this session.
|
|
@@ -1,192 +1,103 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: thermonuclear-code-quality
|
|
3
|
-
description:
|
|
3
|
+
description: Use when asked for a thermonuclear code-quality review or a deep maintainability audit of a branch or PR diff. Also use when asked to review abstraction quality, oversized files or ad-hoc branching growth.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Thermonuclear Code Quality
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- Refactors that technically pass tests but make the code less modular or less readable.
|
|
105
|
-
- "Temporary" branching that is likely to become permanent debt.
|
|
106
|
-
- Bespoke helpers where the codebase already has a canonical utility for the job.
|
|
107
|
-
- Logic added in the wrong layer/package when it should live somewhere more central.
|
|
108
|
-
- Sequential async flow where independent work could use simpler parallel execution.
|
|
109
|
-
- Partial-update logic that leaves state less atomic than necessary.
|
|
110
|
-
|
|
111
|
-
## Preferred Remedies
|
|
112
|
-
|
|
113
|
-
When you identify a code-quality problem, prefer suggestions like:
|
|
114
|
-
|
|
115
|
-
- Delete a whole layer of indirection rather than polishing it.
|
|
116
|
-
- Reframe the state model so conditionals disappear instead of getting centralized.
|
|
117
|
-
- Change the ownership boundary so the feature becomes a natural extension of an existing abstraction.
|
|
118
|
-
- Turn special-case logic into a simpler default flow with fewer exceptions.
|
|
119
|
-
- Extract a helper or pure function.
|
|
120
|
-
- Split a large file into smaller focused modules.
|
|
121
|
-
- Move feature-specific logic behind a dedicated abstraction.
|
|
122
|
-
- Replace condition chains with a typed model or explicit dispatcher.
|
|
123
|
-
- Separate orchestration from business logic.
|
|
124
|
-
- Collapse duplicate branches into a single clearer flow.
|
|
125
|
-
- Delete wrappers that do not meaningfully clarify the API.
|
|
126
|
-
- Reuse the existing canonical helper instead of introducing a near-duplicate.
|
|
127
|
-
- Make type boundaries more explicit so the control flow gets simpler.
|
|
128
|
-
- Move the logic to the package/module/layer that already owns the concept.
|
|
129
|
-
- Parallelize independent work when that also simplifies the orchestration.
|
|
130
|
-
- Restructure related updates into a more atomic flow when partial state would be harder to reason about.
|
|
131
|
-
|
|
132
|
-
Do not be satisfied with "maybe rename this" feedback when the real issue is structural.
|
|
133
|
-
Do not be satisfied with a merely cleaner version of the same messy idea if there is a plausible path to a much simpler idea.
|
|
134
|
-
|
|
135
|
-
## Review Tone
|
|
136
|
-
|
|
137
|
-
Be direct, serious, and demanding about quality.
|
|
138
|
-
Do not be rude, but do not soften major maintainability issues into mild suggestions.
|
|
139
|
-
If the code makes the codebase messier, say so.
|
|
140
|
-
If the implementation missed a substantial simplification, state it.
|
|
141
|
-
|
|
142
|
-
Good phrases:
|
|
143
|
-
|
|
144
|
-
- `this pushes the file past 1k lines. can we decompose this first?`
|
|
145
|
-
- `this adds another special-case branch into an already busy flow. can we move this behind its own abstraction?`
|
|
146
|
-
- `this works, but it makes the surrounding code more spaghetti. let's keep the behavior and restructure the implementation.`
|
|
147
|
-
- `this feels like feature logic leaking into a shared path. can we isolate it?`
|
|
148
|
-
- `this abstraction seems unnecessary. can we just keep the direct flow?`
|
|
149
|
-
- `why does this need a cast / optional here? can we make the boundary more explicit instead?`
|
|
150
|
-
- `this looks like a bespoke helper for something we already have elsewhere. can we reuse the canonical one?`
|
|
151
|
-
- `i think there's a code-judo move here that makes this much simpler. can we reframe this so these branches disappear?`
|
|
152
|
-
- `this refactor moves complexity around, but doesn't really delete it. is there a way to make the model itself simpler?`
|
|
153
|
-
|
|
154
|
-
## Output Expectations
|
|
155
|
-
|
|
156
|
-
Prioritize findings in this order:
|
|
157
|
-
|
|
158
|
-
1. Structural code-quality regressions
|
|
159
|
-
2. Missed opportunities for dramatic simplification / code-judo restructuring
|
|
160
|
-
3. Spaghetti / branching complexity increases
|
|
161
|
-
4. Boundary / abstraction / type-contract problems that make the code harder to reason about
|
|
162
|
-
5. File-size and decomposition concerns
|
|
163
|
-
6. Modularity and abstraction issues
|
|
164
|
-
7. Legibility and maintainability concerns
|
|
165
|
-
|
|
166
|
-
Do not flood the review with low-value nits if there are larger structural issues.
|
|
167
|
-
Prefer a smaller number of high-conviction comments over a long list of cosmetic notes.
|
|
168
|
-
|
|
169
|
-
## Approval Bar
|
|
170
|
-
|
|
171
|
-
Do not approve merely because behavior seems correct.
|
|
172
|
-
The bar for approval is:
|
|
173
|
-
|
|
174
|
-
- no clear structural regression
|
|
175
|
-
- no obvious missed opportunity to make the implementation dramatically simpler when such a path is visible
|
|
176
|
-
- no unjustified file-size explosion
|
|
177
|
-
- no obvious spaghetti-growth from special-case branching
|
|
178
|
-
- no hacky or magical abstraction that makes the code harder to reason about
|
|
179
|
-
- no unnecessary wrapper/cast/optionality churn obscuring the real design
|
|
180
|
-
- no clear architecture-boundary leak or avoidable canonical-helper duplication
|
|
181
|
-
- no missed opportunity for an obvious decomposition that would materially improve maintainability
|
|
182
|
-
|
|
183
|
-
Treat these as presumptive blockers unless the author can justify them with evidence:
|
|
184
|
-
|
|
185
|
-
- the PR preserves a lot of incidental complexity when there is a plausible code-judo move that would delete it
|
|
186
|
-
- the PR pushes a file from below 1000 lines to above 1000 lines
|
|
187
|
-
- the PR adds ad-hoc branching that makes an existing flow more tangled
|
|
188
|
-
- the PR solves a local problem by scattering feature checks across shared code
|
|
189
|
-
- the PR adds an unnecessary abstraction, wrapper, or cast-heavy contract that makes the design more indirect
|
|
190
|
-
- the PR duplicates an existing helper or puts logic in the wrong layer when there is a clear canonical home
|
|
191
|
-
|
|
192
|
-
If those conditions are not met, leave explicit, actionable feedback and push for a cleaner decomposition.
|
|
9
|
+
A strict maintainability audit of the current branch's changes.
|
|
10
|
+
|
|
11
|
+
## Baseline
|
|
12
|
+
|
|
13
|
+
- Rethink how to structure and implement the changes so code quality improves and behavior does not change. The aim is code that is smaller, more direct and easier to maintain.
|
|
14
|
+
- Improve abstractions and modularity. Reduce spaghetti code. Make the code succinct and legible.
|
|
15
|
+
- Restructure when there is a clear path to a simpler implementation. Do not stop at local cleanup when a coherent simplification is available.
|
|
16
|
+
- Be thorough and rigorous. Verify each claim before you report it.
|
|
17
|
+
|
|
18
|
+
## Look for the code-judo move first
|
|
19
|
+
|
|
20
|
+
- For each meaningful change, ask: can a reorganization that uses the existing architecture better make whole branches, helpers, modes, conditionals or layers disappear?
|
|
21
|
+
- Push hard to delete complexity, not to rearrange it. Prefer the solution that looks inevitable in hindsight.
|
|
22
|
+
- A refactor that moves code but leaves the reader the same number of concepts to hold is not a simplification. Ask whether the model itself can be simpler.
|
|
23
|
+
- Do not accept a cleaner version of the same messy idea when a much simpler idea is plausible. Do not give "maybe rename this" feedback when the real issue is structural.
|
|
24
|
+
- "It works" and "tests pass" are not the bar. If the structure can become meaningfully cleaner with the same behavior, push for the cleaner version.
|
|
25
|
+
|
|
26
|
+
## What to flag, and the remedy to propose
|
|
27
|
+
|
|
28
|
+
Flag these aggressively, and any change that makes the surrounding code harder to reason about, even when the code works:
|
|
29
|
+
|
|
30
|
+
| Smell | Remedy |
|
|
31
|
+
|---|---|
|
|
32
|
+
| The PR pushes a file from under 1000 lines to over 1000 | Ask whether to decompose first into helpers, subcomponents, modules or local abstractions. Accept only for a compelling structural reason, with the file still well organized. |
|
|
33
|
+
| Ad-hoc conditionals, special cases, one-off booleans, nullable modes or flags in unrelated or busy flows. Narrow edge cases in the middle of a busy function. "Temporary" branches. | A design problem, not a nit. Reframe the state model so the conditionals disappear, not only move to one place. Make the special case part of a simpler default flow. Else move it behind its own abstraction, helper, state machine, policy object or module. |
|
|
34
|
+
| Repeated conditionals or condition chains | A typed model or an explicit dispatcher. |
|
|
35
|
+
| Copy-pasted logic or duplicate branches | Extract a helper or pure function. Collapse into one flow. |
|
|
36
|
+
| Hacky, brittle or "magic" behavior. Generic mechanisms that hide simple data-shape assumptions. | Direct, boring code. |
|
|
37
|
+
| Thin wrappers, identity abstractions, pass-through helpers | Delete the layer. |
|
|
38
|
+
| Unnecessary optionality, `unknown`, `any`, casts, loose ad-hoc objects. A silent fallback over an unclear invariant. | Explicit typed models or shared contracts, so the control flow gets simpler. |
|
|
39
|
+
| Feature logic in shared paths. Implementation details leaking through APIs. Logic in the wrong file, layer or package. | Move it to the layer that owns the concept, so the feature extends an existing abstraction. |
|
|
40
|
+
| A bespoke helper where a canonical utility exists | Reuse the canonical helper. |
|
|
41
|
+
| A module that became more coupled, stateful or hard to scan. Orchestration mixed with business logic. | Split into focused modules. Separate orchestration from business logic. |
|
|
42
|
+
| Independent work run in sequence for no good reason | Run it in parallel when that also simplifies the orchestration. |
|
|
43
|
+
| Related updates that can leave state half-applied | A more atomic flow. |
|
|
44
|
+
|
|
45
|
+
Flag orchestration only when the cleaner structure is obvious. Do not over-index on micro-optimizations.
|
|
46
|
+
|
|
47
|
+
## Tone
|
|
48
|
+
|
|
49
|
+
- Be direct, serious and demanding. Do not be rude.
|
|
50
|
+
- Do not soften a major maintainability issue into a mild suggestion. If the code makes the codebase messier, or missed a substantial simplification, say so.
|
|
51
|
+
- Examples:
|
|
52
|
+
- `this pushes the file past 1k lines. can we decompose this first?`
|
|
53
|
+
- `this adds another special-case branch into an already busy flow. can we move this behind its own abstraction?`
|
|
54
|
+
- `this works, but it makes the surrounding code more spaghetti. let's keep the behavior and restructure the implementation.`
|
|
55
|
+
- `why does this need a cast / optional here? can we make the boundary more explicit instead?`
|
|
56
|
+
- `i think there's a code-judo move here that makes this much simpler. can we reframe this so these branches disappear?`
|
|
57
|
+
|
|
58
|
+
## Output
|
|
59
|
+
|
|
60
|
+
Order findings:
|
|
61
|
+
|
|
62
|
+
1. Structural regressions
|
|
63
|
+
2. Missed dramatic simplifications (code judo)
|
|
64
|
+
3. Spaghetti and branching growth
|
|
65
|
+
4. Boundary, abstraction and type-contract problems
|
|
66
|
+
5. File size and decomposition
|
|
67
|
+
6. Modularity and abstraction
|
|
68
|
+
7. Legibility and maintainability
|
|
69
|
+
|
|
70
|
+
Give a small number of high-conviction comments. When larger structural issues exist, leave out low-value nits.
|
|
71
|
+
|
|
72
|
+
## Approval bar
|
|
73
|
+
|
|
74
|
+
Correct behavior alone does not earn approval. Approve only when the diff has none of these:
|
|
75
|
+
|
|
76
|
+
- a clear structural regression
|
|
77
|
+
- a missed, visible path to a dramatically simpler implementation
|
|
78
|
+
- unjustified file-size growth
|
|
79
|
+
- spaghetti growth from special-case branching
|
|
80
|
+
- a hacky or magic abstraction
|
|
81
|
+
- wrapper, cast or optionality churn that hides the design
|
|
82
|
+
- a clear boundary leak, or avoidable duplication of a canonical helper
|
|
83
|
+
- a missed obvious decomposition that would materially help maintainability
|
|
84
|
+
|
|
85
|
+
These block unless the author justifies them with evidence:
|
|
86
|
+
|
|
87
|
+
- incidental complexity kept when a plausible code-judo move would delete it
|
|
88
|
+
- a file pushed from under 1000 lines to over 1000
|
|
89
|
+
- ad-hoc branching that tangles an existing flow
|
|
90
|
+
- a local problem solved by scattering feature conditionals across shared code
|
|
91
|
+
- an unnecessary abstraction, wrapper or cast-heavy contract
|
|
92
|
+
- a duplicated helper, or logic in the wrong layer, when a clear canonical home exists
|
|
93
|
+
|
|
94
|
+
When the bar is not met, leave explicit, actionable feedback and push for a cleaner decomposition.
|
|
95
|
+
|
|
96
|
+
## Verdict
|
|
97
|
+
|
|
98
|
+
Make the first line of the report the verdict, in exactly this form, with the short sha of the head commit you reviewed (`git rev-parse --short=8 HEAD`):
|
|
99
|
+
|
|
100
|
+
- `Verdict: APPROVE at <sha>` when the diff meets the approval bar.
|
|
101
|
+
- `Verdict: CHANGES at <sha>` when it does not.
|
|
102
|
+
|
|
103
|
+
A PR gate can read the verdict from the first line of a posted report, and it reads only that line. Put nothing before the verdict.
|