@krtclcdy/tersio 2.25.6 → 2.25.7
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/README.md +30 -7
- package/dist/bench/code-out/pfull-0/debounce.js +13 -0
- package/dist/bench/code-out/pfull-0/deepClone.js +18 -0
- package/dist/bench/code-out/pfull-0/groupBy.js +15 -0
- package/dist/bench/code-out/pfull-1/debounce.js +13 -0
- package/dist/bench/code-out/pfull-1/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-1/groupBy.js +14 -0
- package/dist/bench/code-out/pfull-2/debounce.js +13 -0
- package/dist/bench/code-out/pfull-2/deepClone.js +18 -0
- package/dist/bench/code-out/pfull-2/groupBy.js +15 -0
- package/dist/bench/code-out/pfull-3/debounce.js +12 -0
- package/dist/bench/code-out/pfull-3/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-3/groupBy.js +7 -0
- package/dist/bench/code-out/pfull-4/debounce.js +10 -0
- package/dist/bench/code-out/pfull-4/deepClone.js +17 -0
- package/dist/bench/code-out/pfull-4/groupBy.js +14 -0
- package/dist/bench/code-out/plite-0/debounce.js +13 -0
- package/dist/bench/code-out/plite-0/deepClone.js +18 -0
- package/dist/bench/code-out/plite-0/groupBy.js +15 -0
- package/dist/bench/code-out/plite-1/debounce.js +13 -0
- package/dist/bench/code-out/plite-1/deepClone.js +17 -0
- package/dist/bench/code-out/plite-1/groupBy.js +11 -0
- package/dist/bench/code-out/plite-2/debounce.js +12 -0
- package/dist/bench/code-out/plite-2/deepClone.js +17 -0
- package/dist/bench/code-out/plite-2/groupBy.js +14 -0
- package/dist/bench/code-out/plite-3/debounce.js +12 -0
- package/dist/bench/code-out/plite-3/deepClone.js +17 -0
- package/dist/bench/code-out/plite-3/groupBy.js +14 -0
- package/dist/bench/code-out/plite-4/debounce.js +12 -0
- package/dist/bench/code-out/plite-4/deepClone.js +17 -0
- package/dist/bench/code-out/plite-4/groupBy.js +14 -0
- package/dist/bench/code-out/pultra-0/debounce.js +12 -0
- package/dist/bench/code-out/pultra-0/deepClone.js +20 -0
- package/dist/bench/code-out/pultra-0/groupBy.js +14 -0
- package/dist/bench/code-out/pultra-1/debounce.js +10 -0
- package/dist/bench/code-out/pultra-1/deepClone.js +17 -0
- package/dist/bench/code-out/pultra-1/groupBy.js +7 -0
- package/dist/bench/code-out/pultra-2/debounce.js +13 -0
- package/dist/bench/code-out/pultra-2/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-2/groupBy.js +15 -0
- package/dist/bench/code-out/pultra-3/debounce.js +13 -0
- package/dist/bench/code-out/pultra-3/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-3/groupBy.js +15 -0
- package/dist/bench/code-out/pultra-4/debounce.js +13 -0
- package/dist/bench/code-out/pultra-4/deepClone.js +18 -0
- package/dist/bench/code-out/pultra-4/groupBy.js +15 -0
- package/dist/bench/code-out/run-0/debounce.js +12 -0
- package/dist/bench/code-out/run-0/deepClone.js +17 -0
- package/dist/bench/code-out/run-0/groupBy.js +14 -0
- package/dist/bench/code-out/run-1/debounce.js +13 -0
- package/dist/bench/code-out/run-1/deepClone.js +15 -0
- package/dist/bench/code-out/run-1/groupBy.js +13 -0
- package/dist/bench/code-out/run-2/debounce.js +12 -0
- package/dist/bench/code-out/run-2/deepClone.js +18 -0
- package/dist/bench/code-out/run-2/groupBy.js +13 -0
- package/dist/bench/code-out/run-3/debounce.js +12 -0
- package/dist/bench/code-out/run-3/deepClone.js +18 -0
- package/dist/bench/code-out/run-3/groupBy.js +14 -0
- package/dist/bench/code-out/run-4/debounce.js +12 -0
- package/dist/bench/code-out/run-4/deepClone.js +16 -0
- package/dist/bench/code-out/run-4/groupBy.js +13 -0
- package/dist/cli/banner.js +1 -2
- package/dist/cli/common.js +1 -1
- package/dist/cli/doctor.js +48 -12
- package/dist/cli/hosts.js +1 -2
- package/dist/cli/install.js +7 -2
- package/dist/cli/manifest.js +25 -5
- package/dist/cli/uninstall.js +1 -1
- package/dist/extensions/caveman/index.js +6 -2
- package/dist/extensions/caveman/rule-lite.md +77 -0
- package/dist/extensions/caveman/rule-megacave-lite.md +59 -0
- package/dist/extensions/caveman/rule-megacave-ultra.md +59 -0
- package/dist/extensions/caveman/rule.md +1 -1
- package/dist/extensions/combo/index.js +26 -7
- package/dist/extensions/pstack/index.js +3 -1
- package/dist/extensions/pstack/rule.md +88 -12
- package/dist/extensions/rtk/session.js +18 -10
- package/dist/extensions/shared/rtk-eligible.js +84 -0
- package/dist/extensions/shared/rtk-gain.js +1 -1
- package/dist/extensions/shared/sqlite.js +7 -13
- package/dist/extensions/shared/status.js +1 -2
- package/dist/extensions/shared/usage-ledger.js +102 -20
- package/extensions/caveman/index.ts +6 -2
- package/extensions/caveman/rule-lite.md +77 -0
- package/extensions/caveman/rule-megacave-lite.md +59 -0
- package/extensions/caveman/rule-megacave-ultra.md +59 -0
- package/extensions/caveman/rule.md +1 -1
- package/extensions/combo/index.ts +27 -7
- package/extensions/pstack/index.ts +3 -1
- package/extensions/pstack/playbooks/authoring-a-skill.md +12 -0
- package/extensions/pstack/playbooks/autonomous-run.md +13 -0
- package/extensions/pstack/playbooks/autopilot-full.md +13 -0
- package/extensions/pstack/playbooks/autopilot-stack.md +16 -0
- package/extensions/pstack/playbooks/babysit.md +23 -0
- package/extensions/pstack/playbooks/bug-fix.md +15 -0
- package/extensions/pstack/playbooks/eval.md +25 -0
- package/extensions/pstack/playbooks/feature.md +21 -0
- package/extensions/pstack/playbooks/hillclimb.md +21 -0
- package/extensions/pstack/playbooks/investigation.md +14 -0
- package/extensions/pstack/playbooks/multi-phase-plan.md +155 -0
- package/extensions/pstack/playbooks/opening-a-pr.md +34 -0
- package/extensions/pstack/playbooks/orchestrate.md +111 -0
- package/extensions/pstack/playbooks/pause-safely.md +10 -0
- package/extensions/pstack/playbooks/perf-issue.md +25 -0
- package/extensions/pstack/playbooks/prototype.md +14 -0
- package/extensions/pstack/playbooks/refactoring.md +16 -0
- package/extensions/pstack/playbooks/runtime-forensics.md +11 -0
- package/extensions/pstack/playbooks/session-pickup.md +11 -0
- package/extensions/pstack/playbooks/shipping.md +17 -0
- package/extensions/pstack/playbooks/trace-forensics.md +14 -0
- package/extensions/pstack/playbooks/visual-parity.md +11 -0
- package/extensions/pstack/playbooks/worktree-cleanup.md +12 -0
- package/extensions/pstack/principles/attack-the-premise.md +22 -0
- package/extensions/pstack/principles/boundary-discipline.md +33 -0
- package/extensions/pstack/principles/build-the-lever.md +22 -0
- package/extensions/pstack/principles/encode-lessons-in-structure.md +10 -0
- package/extensions/pstack/principles/exhaust-the-design-space.md +8 -0
- package/extensions/pstack/principles/experience-first.md +18 -0
- package/extensions/pstack/principles/explain-the-number.md +16 -0
- package/extensions/pstack/principles/fix-root-causes.md +23 -0
- package/extensions/pstack/principles/foundational-thinking.md +20 -0
- package/extensions/pstack/principles/guard-the-context-window.md +11 -0
- package/extensions/pstack/principles/laziness-protocol.md +9 -0
- package/extensions/pstack/principles/make-operations-idempotent.md +23 -0
- package/extensions/pstack/principles/migrate-callers-then-delete-legacy-apis.md +21 -0
- package/extensions/pstack/principles/minimize-reader-load.md +17 -0
- package/extensions/pstack/principles/model-the-domain.md +23 -0
- package/extensions/pstack/principles/never-block-on-the-human.md +14 -0
- package/extensions/pstack/principles/outcome-oriented-execution.md +20 -0
- package/extensions/pstack/principles/prove-it-works.md +21 -0
- package/extensions/pstack/principles/redesign-from-first-principles.md +15 -0
- package/extensions/pstack/principles/separate-before-serializing-shared-state.md +15 -0
- package/extensions/pstack/principles/sequence-verifiable-units.md +16 -0
- package/extensions/pstack/principles/subtract-before-you-add.md +17 -0
- package/extensions/pstack/principles/test-behavior-not-implementation.md +20 -0
- package/extensions/pstack/principles/type-system-discipline.md +17 -0
- package/extensions/pstack/references/bugbot-triage.md +142 -0
- package/extensions/pstack/rule.md +88 -12
- package/extensions/pstack/skills/architect/SKILL.md +78 -0
- package/extensions/pstack/skills/architect/references/design-red-flags.md +57 -0
- package/extensions/pstack/skills/architect/references/rationale-template.md +35 -0
- package/extensions/pstack/skills/architect/references/runner-prompt.md +20 -0
- package/extensions/pstack/skills/arena/SKILL.md +47 -0
- package/extensions/pstack/skills/benchmark-checklist/SKILL.md +38 -0
- package/extensions/pstack/skills/blast-radius/SKILL.md +49 -0
- package/extensions/pstack/skills/bro/SKILL.md +6 -0
- package/extensions/pstack/skills/correct/SKILL.md +31 -0
- package/extensions/pstack/skills/figure-it-out/SKILL.md +51 -0
- package/extensions/pstack/skills/how/SKILL.md +35 -0
- package/extensions/pstack/skills/how/references/explainer-prompt.md +55 -0
- package/extensions/pstack/skills/how/references/explorer-prompt.md +35 -0
- package/extensions/pstack/skills/interrogate/SKILL.md +73 -0
- package/extensions/pstack/skills/interrogate/references/code-quality-review.md +47 -0
- package/extensions/pstack/skills/interrogate/references/lead-judgment.md +58 -0
- package/extensions/pstack/skills/interrogate/references/reviewer-prompt.md +62 -0
- package/extensions/pstack/skills/interrogate/references/rubric.md +77 -0
- package/extensions/pstack/skills/no-comments/SKILL.md +23 -0
- package/extensions/pstack/skills/reflect/SKILL.md +66 -0
- package/extensions/pstack/skills/reflect/references/divergent-reviewer.md +38 -0
- package/extensions/pstack/skills/reflect/references/judgment-reviewer.md +37 -0
- package/extensions/pstack/skills/reflect/references/synthesizer.md +56 -0
- package/extensions/pstack/skills/reflect/references/tooling-reviewer.md +48 -0
- package/extensions/pstack/skills/show-me-your-work/SKILL.md +81 -0
- package/extensions/pstack/skills/swarm/SKILL.md +45 -0
- package/extensions/pstack/skills/tdd/SKILL.md +41 -0
- package/extensions/pstack/skills/technical-writing/SKILL.md +105 -0
- package/extensions/pstack/skills/unslop/SKILL.md +61 -0
- package/extensions/pstack/skills/why/SKILL.md +97 -0
- package/extensions/pstack/skills/why/references/epistemics.md +71 -0
- package/extensions/pstack/skills/why/references/investigator-prompt.md +84 -0
- package/extensions/pstack/skills/why/references/source-playbook.md +17 -0
- package/extensions/pstack/skills/why/references/sources/code-archaeology.md +51 -0
- package/extensions/pstack/skills/why/references/sources/databricks.md +70 -0
- package/extensions/pstack/skills/why/references/sources/datadog.md +97 -0
- package/extensions/pstack/skills/why/references/sources/incident-postmortem.md +5 -0
- package/extensions/pstack/skills/why/references/sources/linear.md +48 -0
- package/extensions/pstack/skills/why/references/sources/notion.md +55 -0
- package/extensions/pstack/skills/why/references/sources/sentry.md +66 -0
- package/extensions/pstack/skills/why/references/sources/slack.md +17 -0
- package/extensions/pstack/skills/why/references/synthesizer-prompt.md +129 -0
- package/extensions/rtk/session.ts +17 -9
- package/extensions/shared/rtk-eligible.ts +83 -0
- package/extensions/shared/rtk-gain.ts +1 -1
- package/extensions/shared/sqlite.ts +7 -13
- package/extensions/shared/status.ts +1 -2
- package/extensions/shared/usage-ledger.ts +97 -19
- package/extensions/timing/index.ts +1 -2
- package/package.json +7 -4
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blast-radius
|
|
3
|
+
description: "Find what a change could break somewhere else before it ships, beyond the diff, and prove the one fact it's safe because of by running real code instead of writing it up. Use for 'blast radius of X', 'what could this break', or reviewing a small diff you don't trust."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Blast radius
|
|
7
|
+
|
|
8
|
+
Find what a change breaks somewhere else, before it ships. Use for "blast radius of X", "what could this break", or reviewing a small diff you don't trust yet.
|
|
9
|
+
|
|
10
|
+
Companion to `how` and `why`. `how` tells you what the code does. `why` tells you why it's shaped that way. Blast radius tells you what it breaks somewhere else.
|
|
11
|
+
|
|
12
|
+
Listing the callers is not the job. The agent can grep those in a second. The job is the breakage grep won't show you.
|
|
13
|
+
|
|
14
|
+
## Don't trust your own writeup
|
|
15
|
+
|
|
16
|
+
A blast-radius writeup that sounds right is worthless. It reads as convincing whether or not it's true. So don't hand back the writeup. Find the one or two facts the whole thing depends on and prove them by running code.
|
|
17
|
+
|
|
18
|
+
### How sure are you
|
|
19
|
+
|
|
20
|
+
For each fact the change's safety depends on, get it as far down this list as is cheap, and say where it stopped.
|
|
21
|
+
|
|
22
|
+
1. You said so. Worthless on its own.
|
|
23
|
+
2. You pointed at the line. A real `file:line`, or the library's own source.
|
|
24
|
+
3. You showed the bad case can't happen. You walked the failure step by step and it doesn't reach.
|
|
25
|
+
4. You ran it. A script or test that calls the real code and fails loud if you're wrong.
|
|
26
|
+
5. You reproduced it in the running app.
|
|
27
|
+
|
|
28
|
+
Step 4 is usually one small script that imports the same library the app ships and calls the exact function you're worried about.
|
|
29
|
+
|
|
30
|
+
## Steps
|
|
31
|
+
|
|
32
|
+
1. Read the change. The diff, the symbols it adds, changes, and deletes, and what it now does differently, including the part the diff doesn't spell out. Use `why` step 2 to pull the PR and commits.
|
|
33
|
+
2. Find the one fact it's safe because of. Most changes that look risky are safe because of a single fact, like "this call only drops already-dead cache entries and does nothing else". Find that fact. If it holds, most risky cases are cleared at once. Spend your time here, not on a long list of maybes.
|
|
34
|
+
3. Look where grep stops. Read the source of the library you call, and check its pinned version and any local patch. Work out when things run: microtasks, unmount and teardown, Solid versus React. Follow what a symbol search misses: the JSON an API returns, a DB column, a wire format, another language reading the same bytes, a feature flag, code three hops downstream.
|
|
35
|
+
4. Be honest about each risk. Give it a real chance of happening and a real cost if it does. Keep the risks you confirmed. List the ones you checked and cleared separately. Same rules as `why`. Cite a real `file:line`, a search that finds nothing is still an answer, and never make up a caller or an API.
|
|
36
|
+
5. Prove the one fact. Write a script or test that runs the real code, run it, and paste what happened.
|
|
37
|
+
6. For a big or wide change, run it as an `arena`. Ask more than one model the same question and merge the answers. Different models catch different real bugs.
|
|
38
|
+
|
|
39
|
+
## What to hand back
|
|
40
|
+
|
|
41
|
+
- **What it does.** What changed, including the part that isn't obvious.
|
|
42
|
+
- **The one fact it's safe because of.** State it, say which step you got it to, and show the proof. If you couldn't prove it, write unproven.
|
|
43
|
+
- **Risks.** Each names how it breaks, the `file:line`, how likely and how bad, and how to check. Paste the proof for the ones that matter.
|
|
44
|
+
- **Cleared.** What you checked and why it's fine.
|
|
45
|
+
- **Before you merge.** The cheapest test or repro that catches the real bug, including the script you wrote.
|
|
46
|
+
|
|
47
|
+
Write it through `unslop`, cite real code, and strip anything private before it goes anywhere public.
|
|
48
|
+
|
|
49
|
+
**Reply:** the writeup above, with the one safety fact either proven or marked unproven.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: correct
|
|
3
|
+
description: "Find the mistakes agents keep repeating in this repo and make each one impossible. Try architecture first, then types, then a lint whose error names the fix, then a test, and write docs last. Prove each check fails on a real past mistake. Repeat this each time the operator corrects you. Use for the correct skill."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Correct
|
|
7
|
+
|
|
8
|
+
The operator keeps correcting agents in this repo for the same mistakes. Change the repo so the next agent can't make them.
|
|
9
|
+
|
|
10
|
+
Assume every contributor is an agent that sees only the files it opened, copies the nearest example, and takes the shortest path that compiles. Design the repo so a change that looks right from one file is right for the whole repo.
|
|
11
|
+
|
|
12
|
+
## Find the mistake classes
|
|
13
|
+
|
|
14
|
+
First, read recent commits, reverts, review comments, agent instruction files, and comments that explain workarounds. Group the mistakes into classes. A class counts once it has happened twice.
|
|
15
|
+
|
|
16
|
+
## Fix each class at the highest level that works
|
|
17
|
+
|
|
18
|
+
1. **Eliminate it with architecture.** Give each piece of state one owner and each task one supported way. Hide internals so the wrong import fails. Replace hand-synced lists with one source of truth. Delete old ways and dead code an agent would copy.
|
|
19
|
+
2. **Enforce it with types so the bad state can't be written.** If bad code still compiles, add a lint or CI check whose error names the file, type, or function to use instead. If the pattern is already common, fail only when a change adds more.
|
|
20
|
+
3. **Test the behavior.** Fix or delete any test that would still pass if every function it calls returned nothing.
|
|
21
|
+
4. **Write docs or agent rules last, only for judgment calls.** Nothing fails when an agent skips them.
|
|
22
|
+
|
|
23
|
+
## Fix and prove
|
|
24
|
+
|
|
25
|
+
Then fix the most frequent classes now, one commit each. Prove each new check fails on a real past mistake. Run the same command locally and in CI. Exceptions go on the offending line with a reason, an expiry date, and a human's approval.
|
|
26
|
+
|
|
27
|
+
## Keep the rule table
|
|
28
|
+
|
|
29
|
+
Last, keep a table in the agent instruction file that pairs each rule with what enforces it. When the operator corrects you, fix the mistake and add the rule. If the rule was already there and nothing enforces it, that's a repeat, so fix it at the highest level in the same change. Drop a rule once its mistake can't happen.
|
|
30
|
+
|
|
31
|
+
**Reply:** each class with its evidence, the level you picked, and why a higher level didn't work.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: figure-it-out
|
|
3
|
+
description: "Design an auditable playbook when no narrower one fits: a large migration, an ambitious multi-part change, or work a human reviews after stepping away. Scales rigor to the task, runs a hypothesis loop, and logs decisions. Use for the figure-it-out skill or 'figure it out'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Figure it out
|
|
7
|
+
|
|
8
|
+
When the task matches no playbook, design one. The deliverable before any code is the workflow itself: a sequence of phases that scales rigor to the task, runs the scientific method, and leaves a decision trail a human can audit after stepping away.
|
|
9
|
+
|
|
10
|
+
## Start
|
|
11
|
+
|
|
12
|
+
Open a todolist whose first item is to read the Principles section of the **poteto-mode** skill. Then add the phases below as todos.
|
|
13
|
+
|
|
14
|
+
## Phase A: Frame
|
|
15
|
+
|
|
16
|
+
Ground first, then commit. Don't start the run until you can state:
|
|
17
|
+
|
|
18
|
+
- The definition of done as a falsifiable predicate (the **prove-it-works** principle skill).
|
|
19
|
+
- Scope, quantified: rough units and effort, plus the blockers grounding surfaced.
|
|
20
|
+
- The rigor level, biased high. One-way doors and high blast radius get more. Reversible low-stakes steps get less. Rigor is gates and artifacts, not "try harder".
|
|
21
|
+
|
|
22
|
+
Present the framing and tradeoffs before committing to a long run. Reversible work proceeds (the **never-block-on-the-human** principle skill), but a multi-hour run earns one checkpoint.
|
|
23
|
+
|
|
24
|
+
## Phase B: Design the workflow
|
|
25
|
+
|
|
26
|
+
Decompose into atomic, independently-landable units. Sequence riskiest-unknown-first. Scaffold and verification come before features (the **foundational-thinking** principle skill).
|
|
27
|
+
|
|
28
|
+
- Build the verification harness before the work, with the baseline captured from the pre-change state, so the check reads as "old value vs new value".
|
|
29
|
+
- For one-way-door design decisions, run the **architect** skill (it runs **arena**). Skip it for mechanical work whose shape is already concrete. A second arena over a settled design is over-engineering (the **laziness-protocol** principle skill).
|
|
30
|
+
- Decide what fans out. Parallelize only across seams, and give each worker its own worktree or branch (the **separate-before-serializing-shared-state** principle skill). Don't over-fan.
|
|
31
|
+
- Write the designed phase list down. That list is what the human reviews.
|
|
32
|
+
|
|
33
|
+
Then execute the design. Add its steps to the todolist as concrete items between the Phase C and Phase D entries. Run each under the Phase C loop discipline, and weave the Phase D log through them, a row as each step lands, rather than saving the whole trail for the end.
|
|
34
|
+
|
|
35
|
+
## Phase C: Run the loop
|
|
36
|
+
|
|
37
|
+
Each unit is an experiment. State the hypothesis, make the smallest change, measure against the predicate on the real artifact, keep it if it advanced, revert it if it didn't. Apply the **sequence-verifiable-units** principle skill, verifying each unit before starting the next instead of batching checks at the end.
|
|
38
|
+
|
|
39
|
+
- Verify by inspecting the artifact, never a self-report. When something passes too easily, suspect the observation method before the system.
|
|
40
|
+
- Pair delegated work with a judge. If a worker games the gate, reset and harden the contract. If the gate itself is wrong, fix the gate in its own change rather than routing around it.
|
|
41
|
+
- A verdict is VERIFIED, NOT VERIFIED, or INCONCLUSIVE. Inconclusive is not a pass. Don't hide a negative.
|
|
42
|
+
|
|
43
|
+
## Phase D: Keep the audit trail
|
|
44
|
+
|
|
45
|
+
Log the run via the **show-me-your-work** skill. figure-it-out's work is usually ambitious enough to commit the trail so the reviewer can read it in the PR. The trail plus the diff is what lets the human come back and trust the work.
|
|
46
|
+
|
|
47
|
+
## Phase E: Verify and hand back
|
|
48
|
+
|
|
49
|
+
Check the whole against the Phase A predicate on the real product, not just the harness. Encode any recurring correction as a gate, a lint rule, a check, or a script (the **encode-lessons-in-structure** principle skill).
|
|
50
|
+
|
|
51
|
+
**Reply:** the playbook you designed, the rigor level and why, the decision-trail path, what's verified against the predicate, and what's still open.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: how
|
|
3
|
+
description: "Use for \"how does X work\", code walkthroughs before changing something, and placement / ownership / layering questions (\"where should this live\", \"which package owns this\", \"is this the right layer\"). Explains subsystem architecture, runtime flow, onboarding mental models. Use why for motivation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# How
|
|
7
|
+
|
|
8
|
+
Explore the codebase to answer "how does X work?" questions. Produce architectural explanations at the level of a senior engineer onboarding onto a subsystem, enough to build a working mental model, not so much that it reads like annotated source code.
|
|
9
|
+
|
|
10
|
+
Every spawn is a Task subagent with `readonly: true`. Explorers use your configured `how explorer` line (default a fast model), and every explainer uses the `how explainer` line (default the strongest model). Set `model` to that line's value, or to the default if the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message.
|
|
11
|
+
|
|
12
|
+
## 1. Assess complexity
|
|
13
|
+
|
|
14
|
+
If the scope is ambiguous, state your interpretation and explore. The user can redirect.
|
|
15
|
+
|
|
16
|
+
- **Simple** (a single module, a small utility, a narrow question such as "how does function X work"): no explorers. Spawn one explainer that explores and explains in one pass, built from `references/explainer-prompt.md` without the explorer-findings section. Go to step 4.
|
|
17
|
+
- **Complex** (a subsystem spanning multiple files or services, a cross-cutting feature, a full architectural overview): go to step 2.
|
|
18
|
+
|
|
19
|
+
When in doubt, take the simple path.
|
|
20
|
+
|
|
21
|
+
## 2. Explore (complex only)
|
|
22
|
+
|
|
23
|
+
Decompose the question into 2 to 4 angles, each a distinct slice of the subsystem. Spawn all explorers in a single message, each with `references/explorer-prompt.md` and its angle filled in.
|
|
24
|
+
|
|
25
|
+
## 3. Synthesize (complex only)
|
|
26
|
+
|
|
27
|
+
Once all explorers have returned, spawn one explainer with `references/explainer-prompt.md` and every explorer's findings filled in.
|
|
28
|
+
|
|
29
|
+
## 4. Present
|
|
30
|
+
|
|
31
|
+
Present the explainer's output. Light edits for clarity or context from the conversation are fine. Do not substantially rewrite it.
|
|
32
|
+
|
|
33
|
+
## Output format
|
|
34
|
+
|
|
35
|
+
The explanation uses the sections defined in `references/explainer-prompt.md`, dropping any that do not apply: Overview, Key Concepts, How It Works, Where Things Live, Gotchas.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Explainer Prompt Template
|
|
2
|
+
|
|
3
|
+
Build the explainer subagent's prompt from this template. Fill in the placeholders.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are writing an architectural explanation for a senior engineer. Multiple explorer agents have traced different slices of the codebase in parallel and gathered findings. Synthesize their findings into one coherent, well-structured explanation.
|
|
8
|
+
|
|
9
|
+
## Original Question
|
|
10
|
+
|
|
11
|
+
> {QUESTION}
|
|
12
|
+
|
|
13
|
+
## Explorer Findings
|
|
14
|
+
|
|
15
|
+
{EXPLORER_FINDINGS_ALL}
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
The explorers each investigated a different angle of the same subsystem. Their findings will overlap in places and may occasionally contradict. Reconcile them. Merge overlapping descriptions, resolve contradictions by checking the code yourself, and combine the separate slices into a unified picture.
|
|
20
|
+
|
|
21
|
+
Write an explanation a senior engineer unfamiliar with this area could read and walk away with a solid mental model, understanding the architecture well enough to start working in it confidently.
|
|
22
|
+
|
|
23
|
+
You have read-only access to the codebase to check anything, clarify a detail, or fill a gap. Use Read, Grep, and Glob as needed. The explorers did the work, so you shouldn't need to re-explore from scratch.
|
|
24
|
+
|
|
25
|
+
## Output Format
|
|
26
|
+
|
|
27
|
+
Use this structure, adapted to what makes sense for the question. Not every section is needed for every question.
|
|
28
|
+
|
|
29
|
+
### Overview
|
|
30
|
+
1-2 paragraphs. What is this thing, what does it do, why does it exist. Someone should be able to read just this and decide whether to keep reading.
|
|
31
|
+
|
|
32
|
+
### Key Concepts
|
|
33
|
+
The important types, services, or abstractions needed to follow the rest. Brief definitions, not exhaustive.
|
|
34
|
+
|
|
35
|
+
### How It Works
|
|
36
|
+
The core of the explanation, and the longest section. Walk through the flow: what triggers it, what happens step by step, where data goes, what the decision points are.
|
|
37
|
+
|
|
38
|
+
Use prose, not pseudocode. Reference specific files and functions so the reader knows where to look, but don't dump large code blocks unless a snippet is essential to a point.
|
|
39
|
+
|
|
40
|
+
When the flow involves multiple components talking to each other, or data transforming through stages, include a diagram. Use mermaid (```mermaid) for structured flows (sequence diagrams, flowcharts, component graphs) or ASCII art for simpler relationships where mermaid would be overkill. Use your judgment. A diagram should clarify, not decorate. If prose covers the flow, skip the diagram.
|
|
41
|
+
|
|
42
|
+
### Where Things Live
|
|
43
|
+
A brief file/directory map. Just the ones someone would need to start working here.
|
|
44
|
+
|
|
45
|
+
### Gotchas
|
|
46
|
+
Non-obvious things, surprising behavior, historical context, pitfalls. Skip this section if there's nothing worth calling out.
|
|
47
|
+
|
|
48
|
+
## Communication Style
|
|
49
|
+
|
|
50
|
+
- Use concrete language, not abstractions-about-abstractions
|
|
51
|
+
- Say "the `UserService` calls `AuthClient.refresh()`" not "the service delegates to the client"
|
|
52
|
+
- When something is complex, explain why it's complex. Don't just describe the complexity
|
|
53
|
+
- When something is simple, don't pad it out
|
|
54
|
+
- If there's a helpful analogy, use it. If there isn't, don't force one
|
|
55
|
+
- If the explorers flagged open questions or gaps, acknowledge them rather than hiding them
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Explorer Prompt Template
|
|
2
|
+
|
|
3
|
+
Build each explorer subagent's prompt from this template. Fill in the placeholders.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Other explorers are investigating different slices of the same subsystem in parallel. Don't try to cover everything. Focus on your assigned angle and go deep.
|
|
8
|
+
|
|
9
|
+
## Question
|
|
10
|
+
|
|
11
|
+
> {QUESTION}
|
|
12
|
+
|
|
13
|
+
## Your Exploration Angle
|
|
14
|
+
|
|
15
|
+
{EXPLORATION_ANGLE}
|
|
16
|
+
|
|
17
|
+
## Output
|
|
18
|
+
|
|
19
|
+
### Components Found
|
|
20
|
+
The key types, services, classes, and abstractions. For each: name, file path, and a one-sentence description of what it does.
|
|
21
|
+
|
|
22
|
+
### Flow
|
|
23
|
+
The execution flow step by step. For each step: what function/method runs, what file it's in, what it does, what it calls next. Include the data that flows between steps.
|
|
24
|
+
|
|
25
|
+
### Files Read
|
|
26
|
+
Every file you read during exploration, so the explainer can reference them.
|
|
27
|
+
|
|
28
|
+
### Boundaries
|
|
29
|
+
Where this subsystem connects to other parts of the codebase. The inputs and outputs.
|
|
30
|
+
|
|
31
|
+
### Non-Obvious Things
|
|
32
|
+
Anything surprising, historically motivated, or easy to get wrong. Things that look like they should work one way but work another.
|
|
33
|
+
|
|
34
|
+
### Open Questions
|
|
35
|
+
Anything you couldn't fully trace or understand. Be honest about gaps.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: interrogate
|
|
3
|
+
description: "Use for \"interrogate\", \"adversarial review\", \"multi-model review\", \"challenge this\", \"stress test this code\", \"find blind spots\", or \"tear this apart\". Multiple LLM reviewers challenge changes from independent angles."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Interrogate
|
|
7
|
+
|
|
8
|
+
Spawn one reviewer per configured model to adversarially review code changes. The adversarial signal comes from model diversity, not assigned personas. The deliverable is a synthesized verdict. Do NOT auto-apply changes.
|
|
9
|
+
|
|
10
|
+
## Step 1, Scope
|
|
11
|
+
|
|
12
|
+
Identify what to review from context:
|
|
13
|
+
|
|
14
|
+
- If the user points at specific files or a diff, use that.
|
|
15
|
+
- If on a feature branch, run `git diff main...HEAD` (or the appropriate base branch) for the full changeset.
|
|
16
|
+
- If the user's message references recent work, gather the relevant files.
|
|
17
|
+
|
|
18
|
+
Package the diff or file contents with any surrounding context files the reviewers need to understand the code.
|
|
19
|
+
|
|
20
|
+
## Step 2, Intent
|
|
21
|
+
|
|
22
|
+
Before spawning reviewers, state the intent in one clear paragraph from the user's message, commit messages, the PR description if one exists, and the code. If you're unsure about the intent, ask the user before proceeding.
|
|
23
|
+
|
|
24
|
+
## Step 3, Spawn Reviewers
|
|
25
|
+
|
|
26
|
+
Launch all reviewers in a single message with the Task tool, one per entry on your configured `interrogate reviewers` line, labeled Reviewer A, B, and so on to match the entry count. If the line is missing, use the table defaults.
|
|
27
|
+
|
|
28
|
+
| Subagent | Default model |
|
|
29
|
+
|----------|---------------|
|
|
30
|
+
| Reviewer A | the strongest model |
|
|
31
|
+
| Reviewer B | a fast model |
|
|
32
|
+
|
|
33
|
+
Each reviewer gets `readonly: true` and `model` set to its configured entry, or its table default when there is no configured line. Omit `model` for an `auto` or `inherit-parent` entry, so that reviewer runs on the parent model.
|
|
34
|
+
|
|
35
|
+
If the Task tool rejects a configured entry, run that reviewer on its family's table default and say so. Families go by prefix: `claude-*` and `grok-*`. With no family match, use Reviewer A's default. If it rejects a table default, spawn with the closest equivalent from the valid slugs in its error message (prefer the same family and reasoning tier), and open a separate PR to update the default table. Do not block the review on the slug issue. Never treat an alias entry as a rejected slug or apply either fallback to it.
|
|
36
|
+
|
|
37
|
+
Read `references/reviewer-prompt.md` and fill in the same template for every reviewer with the stated intent, the diff or file contents, the rubric from `references/rubric.md`, and the code-quality lens from `references/code-quality-review.md`.
|
|
38
|
+
|
|
39
|
+
## Step 4, Synthesize
|
|
40
|
+
|
|
41
|
+
As results come back, build a unified picture. Parse every reviewer's findings. Merge findings that describe the same issue differently, and note which models raised each one. Findings two or more models raised independently are the highest signal. Read a lone model's finding, but weight it accordingly. Note disagreements. If one model flags something and another explicitly says the opposite, that is context for the verdict.
|
|
42
|
+
|
|
43
|
+
## Step 5, Lead Judgment
|
|
44
|
+
|
|
45
|
+
You are the lead reviewer, a pragmatic senior engineer, not a neutral aggregator. Read `references/lead-judgment.md` for the full framework. Put every finding in one of four buckets, with the model(s) that raised it and a one-line rationale.
|
|
46
|
+
|
|
47
|
+
- **Act on**. Real issues affecting correctness, security, or maintainability given the actual goals. They would block a real PR.
|
|
48
|
+
- **Consider**. Legitimate, but you're not sure they outweigh the cost of addressing them now. Worth the user's attention.
|
|
49
|
+
- **Noted**. Technically valid but not actionable. Context-dependent, premature optimization, or low-impact at this stage.
|
|
50
|
+
- **Dismissed**. Wrong, nitpicky, or missing context, with a brief reason.
|
|
51
|
+
|
|
52
|
+
## Output Format
|
|
53
|
+
|
|
54
|
+
### Intent
|
|
55
|
+
> [The stated intent paragraph from Step 2]
|
|
56
|
+
|
|
57
|
+
### Reviewers
|
|
58
|
+
- Reviewer [label]: [model name], [N findings] (one bullet per reviewer)
|
|
59
|
+
|
|
60
|
+
### Act On
|
|
61
|
+
[Each: description, which models raised it, why it matters.]
|
|
62
|
+
|
|
63
|
+
### Consider
|
|
64
|
+
[Each: description, which models raised it, the tradeoff.]
|
|
65
|
+
|
|
66
|
+
### Noted
|
|
67
|
+
[Brief list.]
|
|
68
|
+
|
|
69
|
+
### Dismissed
|
|
70
|
+
[Each with a brief rationale.]
|
|
71
|
+
|
|
72
|
+
### Agreement Map
|
|
73
|
+
[Where models agreed and diverged, and what that pattern tells us.]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Code Quality Review
|
|
2
|
+
|
|
3
|
+
Each reviewer applies this code-quality lens in addition to the rubric. It is a strict standard focused on implementation quality, maintainability, abstraction quality, and codebase health.
|
|
4
|
+
|
|
5
|
+
Above all, be ambitious about code structure. Do not merely identify local cleanup. Actively search for "code judo" moves, restructurings that preserve behavior while making the implementation dramatically simpler, smaller, more direct, and more elegant.
|
|
6
|
+
|
|
7
|
+
## Core Prompt
|
|
8
|
+
|
|
9
|
+
Start from this baseline:
|
|
10
|
+
|
|
11
|
+
> Perform a deep code quality audit of the current branch's changes.
|
|
12
|
+
> Rethink how to structure / implement the changes to meaningfully improve code quality without impacting behavior.
|
|
13
|
+
> Work to improve abstractions, modularity, reduce Spaghetti code, improve succinctness and legibility.
|
|
14
|
+
> Be ambitious, if there is a clear path to improving the implementation that involves restructuring some of the codebase, go for it.
|
|
15
|
+
> Be extremely thorough and rigorous. Measure twice, cut once.
|
|
16
|
+
|
|
17
|
+
## Dimensions
|
|
18
|
+
|
|
19
|
+
Each dimension is stated once. Apply the ones that are relevant.
|
|
20
|
+
|
|
21
|
+
0. **Be ambitious about structural simplification.** Do not stop at "this could be a bit cleaner." Look for reframings that make whole branches, helpers, modes, conditionals, or layers disappear. Assume a "code judo" move is often available. It uses the existing architecture more effectively and makes the change dramatically simpler. If you can delete complexity rather than rearrange it, push hard for that.
|
|
22
|
+
|
|
23
|
+
1. **Do not let a PR push a file from under 1k lines to over 1k lines without a very strong reason.** Treat this as a strong smell. Prefer extracting helpers, subcomponents, or modules. If the diff crosses that threshold, ask whether the code should be decomposed first. Waive only for a compelling structural reason where the resulting file stays clearly organized.
|
|
24
|
+
|
|
25
|
+
2. **Do not allow spaghetti growth in existing code.** Be suspicious of new ad-hoc conditionals, scattered special cases, or one-off branches inserted into unrelated flows. Treat "weird if statements in random places" as a design problem, not a style nit. Prefer pushing the logic into a dedicated helper, state machine, or module instead of tangling an existing path.
|
|
26
|
+
|
|
27
|
+
3. **Bias toward cleaning the design, not just accepting working code.** If behavior can stay the same while the structure becomes meaningfully cleaner, push for the cleaner version. Prefer simplifications that remove moving pieces over refactors that spread the same complexity around.
|
|
28
|
+
|
|
29
|
+
4. **Prefer direct, boring, maintainable code over hacky or magical code.** Treat brittle, ad-hoc, or "magic" behavior as a problem. Be skeptical of generic mechanisms that hide simple data-shape assumptions. Flag thin abstractions, identity wrappers, or pass-through helpers that add indirection without buying clarity.
|
|
30
|
+
|
|
31
|
+
5. **Push on type and boundary cleanliness when it affects maintainability.** Question unnecessary optionality, `unknown`, `any`, or cast-heavy code when a clearer type boundary could exist. Prefer explicit typed models over loosely-shaped ad-hoc objects. If a branch leans on a silent fallback to paper over an unclear invariant, ask whether the boundary should be made explicit.
|
|
32
|
+
|
|
33
|
+
6. **Keep logic in the canonical layer and reuse existing helpers.** Call out feature logic leaking into shared paths or implementation details leaking through APIs. Prefer existing canonical utilities over bespoke one-offs. Push code toward the right package, service, or module instead of normalizing drift.
|
|
34
|
+
|
|
35
|
+
7. **Treat unnecessary sequential orchestration and non-atomic updates as design smells when the cleaner structure is obvious.** If independent work is serialized for no reason, ask whether it should run in parallel. If related updates can leave state half-applied, push for a more atomic structure. Do not over-index on micro-optimizations, but do flag avoidable orchestration complexity that makes the code more brittle.
|
|
36
|
+
|
|
37
|
+
## Output Expectations
|
|
38
|
+
|
|
39
|
+
Prioritize structural code-quality regressions and missed simplifications first, then spaghetti and branching complexity, then boundary, type, and file-size concerns, then smaller modularity and legibility issues.
|
|
40
|
+
|
|
41
|
+
## Approval Bar
|
|
42
|
+
|
|
43
|
+
Do not approve merely because behavior seems correct. Treat these as presumptive blockers unless the author can justify them: the PR keeps a lot of incidental complexity when a code-judo move would delete it. Pushes a file from below 1000 lines to above 1000 lines. Adds ad-hoc branching that tangles an existing flow. Scatters feature checks across shared code. Adds an unnecessary abstraction, wrapper, or cast-heavy contract, or duplicates an existing helper or puts logic in the wrong layer when there is a clear canonical home. If those conditions are not met, leave explicit, actionable feedback and push for a cleaner decomposition.
|
|
44
|
+
|
|
45
|
+
## Review Tone
|
|
46
|
+
|
|
47
|
+
Be direct, serious, and demanding about quality. Do not be rude, but do not soften major maintainability issues into mild suggestions. If the code is making the codebase messier, say so. If the implementation missed an obvious dramatic simplification, say that too. Do not be satisfied with "maybe rename this" when the real issue is structural.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Lead Judgment Framework
|
|
2
|
+
|
|
3
|
+
You are the lead reviewer. The configured reviewers have produced their findings. Apply pragmatic engineering judgment. Don't aggregate. Filter, contextualize, and decide.
|
|
4
|
+
|
|
5
|
+
## Why This Step Matters
|
|
6
|
+
|
|
7
|
+
Adversarial reviewers are useful because they're aggressive. But aggression without context produces noise. The reviewers only saw a slice of the codebase and a one-paragraph intent statement. They don't know:
|
|
8
|
+
|
|
9
|
+
- What was already tried and rejected
|
|
10
|
+
- What constraints exist outside the code (timeline, dependencies, migration plans)
|
|
11
|
+
- Which parts of the code are temporary scaffolding vs. permanent architecture
|
|
12
|
+
- What the next PR in the stack will address
|
|
13
|
+
|
|
14
|
+
You have the full conversation context. Use it.
|
|
15
|
+
|
|
16
|
+
## Filtering Principles
|
|
17
|
+
|
|
18
|
+
### Nitpick Gravity
|
|
19
|
+
|
|
20
|
+
Reviewers, especially adversarial ones, tend to fill their review. If they don't find critical issues, they'll inflate nits to fill the space. If a reviewer's findings are all nits and style preferences, the code is probably fine. Say so.
|
|
21
|
+
|
|
22
|
+
### Hypothetical vs. Actual
|
|
23
|
+
|
|
24
|
+
"What if someone passes null here?" is only a finding if the caller can actually pass null. Trace the call site. If the input is validated upstream or the type system prevents it, dismiss the finding. Reviewers working from a diff can't always see the full call chain. You can.
|
|
25
|
+
|
|
26
|
+
### Premature Abstraction Warnings
|
|
27
|
+
|
|
28
|
+
Reviewers often suggest extracting functions, adding interfaces, or creating abstractions. Does this code need to change in a second way? If not, the abstraction is premature. Simple inline code that works beats a clean abstraction that's overkill for the current scope.
|
|
29
|
+
|
|
30
|
+
### "I Would Have Done It Differently"
|
|
31
|
+
|
|
32
|
+
This is the most common false positive in code review. A finding that amounts to "I prefer a different approach" is not a bug, not a design flaw, and not actionable unless the reviewer shows a concrete problem with the current approach. Dismiss these, and say why.
|
|
33
|
+
|
|
34
|
+
### Missing Context Signals
|
|
35
|
+
|
|
36
|
+
Watch for findings that reveal the reviewer didn't understand the context:
|
|
37
|
+
- Suggesting changes to code the author didn't write or modify
|
|
38
|
+
- Flagging patterns that are consistent with the rest of the codebase (the reviewer just doesn't know that)
|
|
39
|
+
- Recommending approaches that conflict with constraints you know about
|
|
40
|
+
|
|
41
|
+
These are honest mistakes from reviewers working with limited information. Dismiss them gracefully.
|
|
42
|
+
|
|
43
|
+
## When Reviewers Are Right
|
|
44
|
+
|
|
45
|
+
Don't dismiss findings just because they're uncomfortable. The whole point of adversarial review is to catch things you'd miss. Signs a finding deserves attention:
|
|
46
|
+
|
|
47
|
+
- Multiple models flag the same issue independently (consensus signal)
|
|
48
|
+
- The finding identifies a concrete execution path, not a hypothetical
|
|
49
|
+
- The finding reveals a gap in your mental model of the code
|
|
50
|
+
- You read the finding and think "...yeah, actually"
|
|
51
|
+
|
|
52
|
+
Be especially careful about dismissing security findings and correctness bugs. These deserve more scrutiny even when they come from a single model.
|
|
53
|
+
|
|
54
|
+
## Verdict Calibration
|
|
55
|
+
|
|
56
|
+
A good verdict is useful, not comprehensive. The user should be able to read the "Act On" section, fix those issues, and ship with confidence. If your "Act On" list has more than 5 items, you're probably not filtering hard enough.
|
|
57
|
+
|
|
58
|
+
The "Dismissed" section is not busywork. It's a trust mechanism. Showing the user what you rejected and why lets them override your judgment where they disagree. This is more valuable than hiding the rejected findings.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Reviewer Prompt Template
|
|
2
|
+
|
|
3
|
+
Build each reviewer subagent's prompt from this template, filling in the placeholders.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are an adversarial code reviewer. Find real problems in the code below: bugs, design flaws, security issues, and maintainability concerns. You are not here to be helpful or encouraging. You are here to stress-test.
|
|
8
|
+
|
|
9
|
+
## Intent
|
|
10
|
+
|
|
11
|
+
The author's stated intent for this change:
|
|
12
|
+
|
|
13
|
+
> {INTENT}
|
|
14
|
+
|
|
15
|
+
Review whether the code achieves this intent well. Do NOT question the intent itself. Assume the goal is correct and challenge the execution.
|
|
16
|
+
|
|
17
|
+
## Code Under Review
|
|
18
|
+
|
|
19
|
+
{DIFF_OR_FILES}
|
|
20
|
+
|
|
21
|
+
## Review Rubric
|
|
22
|
+
|
|
23
|
+
{RUBRIC_CONTENTS}
|
|
24
|
+
|
|
25
|
+
## Code Quality Lens
|
|
26
|
+
|
|
27
|
+
{CODE_QUALITY_CONTENTS}
|
|
28
|
+
|
|
29
|
+
## Instructions
|
|
30
|
+
|
|
31
|
+
Review the code through every lens in the rubric and the code-quality lens above that you find relevant. Do not force lenses that don't apply. A simple bug fix does not need paragraphs about architectural integrity.
|
|
32
|
+
|
|
33
|
+
For each finding, provide:
|
|
34
|
+
|
|
35
|
+
1. **Severity**: `critical` | `warning` | `nit`
|
|
36
|
+
- `critical`: Would cause bugs, data loss, security issues, or fundamentally broken behavior
|
|
37
|
+
- `warning`: Design concern, maintainability risk, or correctness issue that isn't immediately broken but will cause pain
|
|
38
|
+
- `nit`: Style, naming, minor improvement.
|
|
39
|
+
2. **Finding**: What the problem is, in concrete terms. Reference specific lines/functions.
|
|
40
|
+
3. **Evidence**: Why you believe this is a problem. Show your reasoning. Don't just assert.
|
|
41
|
+
4. **Suggestion** (optional): What you'd do instead, only if you have a concrete alternative.
|
|
42
|
+
|
|
43
|
+
A good finding references specific code, not vague concerns ("this could be better"). It distinguishes between "this is broken" and "I would have done this differently". It considers the stated intent. A finding that ignores the context of what's being built is a bad finding.
|
|
44
|
+
|
|
45
|
+
Do not restate what the code does without identifying a problem. Do not praise the code. If you find nothing wrong, say "no findings" and stop. An empty review is a valid outcome.
|
|
46
|
+
|
|
47
|
+
## Output
|
|
48
|
+
|
|
49
|
+
Return your findings as a structured list:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
## Findings
|
|
53
|
+
|
|
54
|
+
### 1. [Severity] Short title
|
|
55
|
+
**Location**: file:line or function name
|
|
56
|
+
**Finding**: What's wrong
|
|
57
|
+
**Evidence**: Why this matters
|
|
58
|
+
**Suggestion**: (optional) What to do instead
|
|
59
|
+
|
|
60
|
+
### 2. [Severity] Short title
|
|
61
|
+
...
|
|
62
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Review Rubric
|
|
2
|
+
|
|
3
|
+
Review through whichever lenses are relevant. Not every lens applies to every change.
|
|
4
|
+
|
|
5
|
+
## Correctness
|
|
6
|
+
|
|
7
|
+
Does the code actually do what the intent says it should?
|
|
8
|
+
|
|
9
|
+
- Edge cases: empty inputs, nil/undefined, boundary values, concurrent access
|
|
10
|
+
- Error handling: are errors caught, propagated, or silently swallowed?
|
|
11
|
+
- Off-by-one, type coercion, integer overflow, string encoding
|
|
12
|
+
- State management: race conditions, stale closures, dangling references
|
|
13
|
+
- Do both the happy path and the sad path work?
|
|
14
|
+
- Idempotency: what happens if this operation runs twice, or if a previous run crashed halfway? If the answer is "it depends on what state was left behind," a reconciliation step is missing.
|
|
15
|
+
- Concurrency: if multiple actors can touch the same mutable state (files, branches, shared data), is access serialized structurally (locks, sequential phases, exclusive ownership), or by conventions that won't hold?
|
|
16
|
+
|
|
17
|
+
When you find a potential bug, trace the execution path. Don't just flag "this could be nil". Show the call chain that makes it nil.
|
|
18
|
+
|
|
19
|
+
## Root Causes vs. Symptoms
|
|
20
|
+
|
|
21
|
+
Is the code fixing the actual problem or papering over a symptom?
|
|
22
|
+
|
|
23
|
+
Answering this often requires looking beyond the changed files. Read the surrounding code (callers, callees, type definitions, sibling modules) and understand the architecture the change lives in. Use the tools available to you (Read, Grep, Glob) to follow the call chain, read the types, and understand why the code exists before judging whether the change addresses the right layer.
|
|
24
|
+
|
|
25
|
+
- Guard clauses that mask a deeper invariant violation
|
|
26
|
+
- Retry logic that hides a broken contract
|
|
27
|
+
- Type casts that silence a modeling error
|
|
28
|
+
- A workaround: why is it needed? What would a proper fix look like?
|
|
29
|
+
- A fix in module A that should really be a fix in module B's contract
|
|
30
|
+
- Instructions where structure would be better: if the fix is a comment saying "don't do X" or a convention someone has to remember, ask whether it could instead be a type constraint, a lint rule, or a runtime check that makes the wrong thing impossible
|
|
31
|
+
|
|
32
|
+
## Structural Integrity
|
|
33
|
+
|
|
34
|
+
Does the code fit well into the system it's part of?
|
|
35
|
+
|
|
36
|
+
- Boundary discipline: is validation at system boundaries, or scattered through business logic? Validate data once where it enters the system, then trust it internally.
|
|
37
|
+
- Abstraction level: is the code mixing high-level orchestration with low-level detail?
|
|
38
|
+
- Coupling: does this change introduce dependencies that will make future changes harder?
|
|
39
|
+
- Data model fit: do the data structures match the actual access patterns?
|
|
40
|
+
- Bolted-on vs. integrated: if the new requirement had been known from the start, would the code look like this, or does the change feel patched onto the existing design?
|
|
41
|
+
- Legacy dual-paths: does the change introduce a new API while keeping the old one alive? If there are no external consumers, migrate callers and delete the old path in the same wave. Don't leave compatibility layers that will become permanent.
|
|
42
|
+
|
|
43
|
+
Don't penalize simple code for lacking abstraction. Premature abstraction is worse than duplication.
|
|
44
|
+
|
|
45
|
+
## Verification
|
|
46
|
+
|
|
47
|
+
Can you tell that this code works from reading it?
|
|
48
|
+
|
|
49
|
+
- Are there tests? Do they test behavior or implementation details?
|
|
50
|
+
- Are there assertions/invariants that would catch regressions?
|
|
51
|
+
- If this is a bug fix: is there a test for the bug?
|
|
52
|
+
- If this touches an integration boundary: is the full path tested?
|
|
53
|
+
- Check the real thing, not a proxy. If the code checks liveness via file mtime or cached state instead of reading the actual value, that's a verification gap.
|
|
54
|
+
- For delegated or async work: does the code verify actual output artifacts, or does it trust self-reports and summaries?
|
|
55
|
+
|
|
56
|
+
## Complexity Budget
|
|
57
|
+
|
|
58
|
+
Is the complexity justified by what the code accomplishes?
|
|
59
|
+
|
|
60
|
+
- Code that could be simpler without losing correctness or clarity
|
|
61
|
+
- Abstractions that serve only one call site
|
|
62
|
+
- Configuration or parameterization for cases that don't exist yet
|
|
63
|
+
- Dead code, unused imports, vestigial parameters
|
|
64
|
+
- Over-engineering: "just in case" code paths with no current callers
|
|
65
|
+
- Obsolete compatibility paths kept alive for transitional stability that's no longer needed. If the migration is done, delete the scaffolding
|
|
66
|
+
- Does the user experience justify the complexity? Every feature, control, and option should earn its place. Half-finished features are worse than missing ones.
|
|
67
|
+
|
|
68
|
+
Simpler is better unless simpler is wrong.
|
|
69
|
+
|
|
70
|
+
## Security
|
|
71
|
+
|
|
72
|
+
For each security finding, trace the input path through the code and show it.
|
|
73
|
+
|
|
74
|
+
- User input flowing to dangerous sinks (SQL, shell, eval, innerHTML) without sanitization
|
|
75
|
+
- Authentication/authorization gaps in new endpoints
|
|
76
|
+
- Secrets in code, logs, or error messages
|
|
77
|
+
- TOCTOU (time-of-check-time-of-use) in security-critical paths
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: no-comments
|
|
3
|
+
description: "Spawn Comment Sicko, fix accepted findings, and offer encodings for claimed constraints."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# No comments
|
|
7
|
+
|
|
8
|
+
Spawn Comment Sicko. Act on accepted findings.
|
|
9
|
+
|
|
10
|
+
Defer to Comment Sicko's fresh perspective.
|
|
11
|
+
|
|
12
|
+
## Scope
|
|
13
|
+
|
|
14
|
+
Use the caller's files or diff. Otherwise use the current diff against the base branch, default `main`, including the working tree.
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
1. Spawn the comment reviewer subagent. Pass the scope. Do not restate its rules.
|
|
19
|
+
2. Inspect its report and diff. Reject application-code edits, scope escapes, exception-protected deletions, misstated `MUST KILL` reasons, and flags that treat kept intentional code as guilty. Reshape flags on our-code surprises stay actionable. Do not restore those comments. A keep survives only with proof it is about something we cannot change. Audit missed scoped lint and TypeScript suppressions. Correctness or safety suppressions stay actionable `MUST KILL`s. Restore deletions only with exact exceptions and scoped proof. Before accepting thin `IMPORTANT` or `do not remove` kills or keeps, run the **how** or **why** skill on their symbol. If a kill is ambiguous, do not restore. If a keep is refuted or still ambiguous, delete it. Revert and rerun one rejected report with the failure named. Reject a second, report it open, and fail the **no-comments** skill.
|
|
20
|
+
3. Fix trivial accepted flags directly by deleting a dead path, dropping a parameter, or using the real API. If any fix needs a shape, run the **architect** skill once for the accepted set and surrounding code. Stop at the sketch. Architect shapes. Step 4 implements.
|
|
21
|
+
4. Implement the smallest root-cause fix in scope. Remove every named workaround. If the root cause is out of scope, land the smallest in-scope fix and report the rest open. The **principle-fix-root-causes** and **principle-redesign-from-first-principles** skills guide intent only. Neither authorizes widening the fence nor fixing instances outside it. Never bolt on symptom guards.
|
|
22
|
+
5. Constraint comments say `do not remove`, `do not change wording`, or `talk to X before changing`. Leave keeps about things we cannot change. Offer the cheapest in-scope type, runtime, test, or CI lint. Wait for interactive approval. Unattended and eval require caller pre-approval. If approved, encode then delete. Otherwise delete, report the constraint open, and sketch out-of-scope work.
|
|
23
|
+
6. Report the deletion count, restored comments, reruns, architect sketch, fixes, encoding offers, encodings, unenforced constraints, and other open work.
|