[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ADZV615W41P0Z5W7JAX3P6":3,"skill-same:01M7ADZV615W41P0Z5W7JAX3P6":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7ADZV615W41P0Z5W7JAX3P6","code-review",null,"Review a diff, branch, or PR along three axes — Correctness (does it work, and does it step on a NodeTool landmine like cross-package imports, MsgPack framing, Zustand subscriptions, ui_primitives, packaged-Electron paths, IPC security?), Standards (does it follow the repo's documented rules, plus a Fowler smell baseline?), and Spec (does it implement what the originating issue asked for?). Runs the axes as parallel sub-agents and reports them side by side. Use when the user wants to review changes, a branch, a PR, or work before commit or merge, or asks to \"review since X\". For stripping AI slop from your own diff, use the unslop skill; a full pre-merge pass runs both.","hanchenhao\u002Fai-canvas","hanchenhao","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F15713703?v=4","01M7ADWCF5AE30N3MG7MDF3RV2","01M7ADWCFVJS4V8VD9KWJG22WR",1,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcode-review\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: code-review\ndescription: Review a diff, branch, or PR along three axes — Correctness (does it work, and does it step on a NodeTool landmine like cross-package imports, MsgPack framing, Zustand subscriptions, ui_primitives, packaged-Electron paths, IPC security?), Standards (does it follow the repo's documented rules, plus a Fowler smell baseline?), and Spec (does it implement what the originating issue asked for?). Runs the axes as parallel sub-agents and reports them side by side. Use when the user wants to review changes, a branch, a PR, or work before commit or merge, or asks to \"review since X\". For stripping AI slop from your own diff, use the unslop skill; a full pre-merge pass runs both.\n---\n\n# Code Review\n\nThree-axis review of the diff between `HEAD` and a fixed point:\n\n- **Correctness** — does the change work, and does it step on a NodeTool landmine?\n- **Standards** — does it follow this repo's documented rules?\n- **Spec** — does it faithfully implement the originating issue or spec?\n\nEach axis runs as a **parallel sub-agent** so they don't pollute each other's context. This skill scopes the diff first, then aggregates.\n\nDivision of labor with the sibling skill: [`unslop`](..\u002Funslop\u002FSKILL.md) asks whether the change is free of AI-generated filler. Run it after this one for a full pre-merge pass.\n\nThe rules the Correctness and Standards axes cite live in [`CLAUDE.md`](..\u002F..\u002F..\u002FCLAUDE.md), [`docs\u002FDEVELOPMENT_STANDARDS.md`](..\u002F..\u002F..\u002Fdocs\u002FDEVELOPMENT_STANDARDS.md), and the area `AGENTS.md` files.\n\n## Process\n\n### 1. Pin the fixed point\n\nWhatever the user named is the fixed point — a commit SHA, branch, tag, `main`, `HEAD~5`. If they named none, infer from what they asked for:\n\n- Working tree: `git diff` + `git diff --cached`, plus untracked files via `git status`.\n- Branch or PR: `git diff $(git merge-base main HEAD)...HEAD` — never `git diff main`, which picks up drift on main. For a PR, fetch the branch first.\n\nCapture the diff command once, and the commit list via `git log \u003Cfixed-point>..HEAD --oneline`. Confirm the ref resolves (`git rev-parse`) and the diff is non-empty before going further — a bad ref should fail here, not inside three sub-agents.\n\n### 2. Map the blast radius\n\n`npm run dev:nodetool -- affected --base main --json` lists the workspaces to typecheck and test, and says whether a decorator package (loads from `dist\u002F`) forces `npm run build:packages`. Don't guess.\n\n### 3. Find the spec\n\nIn order:\n\n1. Issue references in the commit messages (`#123`, `Closes #45`).\n2. A path the user passed as an argument.\n3. A spec file under `docs\u002F`, `specs\u002F`, or `.scratch\u002F` matching the branch or feature.\n4. Otherwise ask. If there is no spec, the Spec sub-agent is skipped and the report says so.\n\n### 4. Find the standards sources\n\n`CLAUDE.md`, `docs\u002FDEVELOPMENT_STANDARDS.md`, the `AGENTS.md` for each area the diff touches, and anything else the repo documents about how code should be written.\n\nOn top of those, the Standards axis always carries the [smell baseline](#smell-baseline) below, which applies even where a repo documents nothing. Two rules bind it: a documented repo standard always wins, and every smell is a labelled heuristic (\"possible Feature Envy\"), never a hard violation.\n\n### 5. Spawn the sub-agents in parallel\n\nOne message, three `Agent` calls, `general-purpose` for each. Give every prompt the diff command, the commit list, and the path to this file (`.claude\u002Fskills\u002Fcode-review\u002FSKILL.md`) so the sub-agent can read the section it needs.\n\n**Correctness** — \"Read § Correctness checklists, § Severity, and § Quick greps in `.claude\u002Fskills\u002Fcode-review\u002FSKILL.md`. Read each changed function whole, and its callers — grep the symbol; a hunk that looks fine in isolation is where signature drift and broken invariants hide. For changed types in `packages\u002Fprotocol`, check every package importing them. Report findings most-severe first; each needs a failure scenario you can name the input for, or a citable rule. Under 500 words.\"\n\n**Standards** — \"Read § Smell baseline in `.claude\u002Fskills\u002Fcode-review\u002FSKILL.md`, plus these standards sources: \u003Clist from step 4>. Report, per file or hunk: (a) every place the diff violates a documented standard — cite the file and rule; (b) any baseline smell — name it and quote the hunk. Documented standards override the baseline, and baseline smells are always judgement calls. Skip anything lint or typecheck enforces. Under 400 words.\"\n\n**Spec** — \"The spec is at \u003Cpath or contents>. Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff nobody asked for; (c) requirements that look implemented but implemented wrong. Quote the spec line for each finding. Under 400 words.\"\n\n### 6. Verify\n\nWhile the sub-agents run, run the targeted commands from step 2: `npm run test --workspace=packages\u002F\u003Cname>` and `npm run lint --workspace=packages\u002F\u003Cname>` per package (packages typecheck via `build`, not a `typecheck` script); root `npm run typecheck` covers web, electron, and mobile. If the diff is wide, `npm run check`. Report the actual output — never \"should pass\".\n\n### 7. Aggregate\n\nPresent the reports under `## Correctness`, `## Standards`, and `## Spec`, verbatim or lightly cleaned. Do **not** merge or rerank findings across axes — see [Why three axes](#why-three-axes). End with one line per axis: total findings, the worst one, and the verification you ran.\n\n## Severity\n\n| Tier | Meaning | Bar |\n|------|---------|-----|\n| **Blocker** | Wrong behavior, crash, data loss, security hole, broken build | You can name the input or state that triggers it |\n| **Should-fix** | Violates a written repo rule | Cite the rule |\n| **Nit** | Everything else worth a sentence | Only if you found nothing bigger in that file; never pad |\n\nA finding without a failure scenario or a citable rule is not a finding. When unsure whether something is a bug, say so instead of inflating the severity.\n\n## Correctness checklists\n\n### Cross-package (any `packages\u002F` change)\n\n- **Imports**: inter-package imports use `@nodetool-ai\u002F\u003Cpkg>` — never `..\u002Fother-pkg\u002F` or anything containing `\u002Fdist\u002F`.\n- **ESM extensions**: relative imports need `.js` in compiled output. A missing extension typechecks but dies at runtime in built packages.\n- **Dependency direction**: does the import respect `protocol → config → security\u002Fauth\u002Fstorage → runtime → kernel → node-sdk → base-nodes → models → agents → chat → websocket\u002Fcli`? A lower package importing a higher one is a cycle waiting to happen.\n- **Decorator packages** (`base-nodes`, `node-sdk`, `fal-nodes`, `replicate-nodes`, `elevenlabs-nodes`) load from `dist\u002F`. A change here that isn't followed by `build:packages` silently tests stale code — confirm the verify step rebuilt.\n- **Runtime data files**: anything loaded relative to `import.meta.url` (manifests, examples, `package:\u002F\u002F` assets) breaks in the packaged Electron app, where the backend is bundled into one `server.mjs`. Such files must be registered in `PACKAGE_RUNTIME_ASSETS` (`packages\u002Fconfig\u002Fsrc\u002Fpackage-asset-registry.ts`) and loaded via `loadPackageAssetJson`.\n- **Protocol types**: new message or data shapes belong in `packages\u002Fprotocol`, not re-declared locally.\n- **Errors**: `throw new Error(...)`, never strings. Empty catch blocks need a comment saying why.\n- **WebSocket framing**: WS messages are **MsgPack**, REST is JSON. `JSON.stringify` on a WS send path, or a missing msgpack decode on a receive path, is a blocker.\n- **Streaming nodes**: `genProcess` must `yield`, not accumulate-and-return; check that backpressure-sensitive paths don't buffer unbounded.\n\n### Web (`web\u002Fsrc\u002F`)\n\n- **Raw MUI imports** outside `ui_primitives\u002F` and `editor_ui\u002F` — should-fix, migrate to primitives.\n- **Design tokens**: hardcoded border radii, font sizes, transition strings, off-4px-grid spacing, raw z-indexes → `BORDER_RADIUS`, `TYPOGRAPHY`\u002F`var(--fontSize*)`, `MOTION`, `SPACING`, `Z_INDEX` from `ui_primitives` ([docs\u002FDESIGN.md](..\u002F..\u002F..\u002Fdocs\u002FDESIGN.md)).\n- **Zustand**: a whole-store subscription (`useFooStore()` with no selector) re-renders on every store write. Multi-key object selectors need `useShallow`. `getState()` in a render body is a bug; in handlers and effects it's fine.\n- **New `WebSocket(...)`** anywhere — use the `GlobalWebSocketManager` singleton.\n- **TanStack Query**: server data via `useQuery`\u002F`useMutation`, hierarchical keys (`[\"workflows\", id]`), `enabled` for conditional fetches, mutations invalidate affected keys. `useEffect`+`fetch` for backend data is should-fix.\n- **ReactFlow**: unstable references passed as `nodes`\u002F`edges`\u002F`nodeTypes` (a fresh array or object each render) tank canvas performance — hoist or memoize `nodeTypes`, derive nodes and edges via selectors.\n- **Effects**: check every new `useEffect` dependency array against what the body reads; a stale closure over a store value or prop is a classic bug here.\n\n### Electron (`electron\u002Fsrc\u002F`)\n\nNon-negotiable ([electron\u002Fsrc\u002FAGENTS.md](..\u002F..\u002F..\u002Felectron\u002Fsrc\u002FAGENTS.md) § Security):\n\n- `contextIsolation: true`, `nodeIntegration: false`, no `webSecurity: false`, no remote-content `BrowserWindow` without a strict preload.\n- Every new IPC handler validates its inputs — renderer input is untrusted. Channel names typed, no `ipcMain.handle` passing raw args into `fs`, `child_process`, or `shell.openExternal` without allow-listing.\n- Paths resolved relative to `import.meta.url` or `__dirname`: verify against the packaged layout (§ Packaged file layout), not just dev.\n\n### Mobile (`mobile\u002F`)\n\n- `mobile\u002F` is **not** a root workspace. Scripts must use `npm --prefix mobile ...`; a diff that \"standardizes\" this to `--workspace=mobile` breaks it.\n- Mobile typecheck needs `packages\u002Fprotocol` built first.\n\n### Tests\n\n- New behavior without a test, or changed behavior whose old test still passes unmodified — ask why.\n- Vitest in `packages\u002F`, Jest in `web\u002F` and `electron\u002F`, files in `__tests__\u002F`.\n- RTL queries by role or label, `userEvent`, `waitFor`\u002F`findBy*` — no `setTimeout` sleeps, no `getByTestId` where a role query works.\n- A test that mocks the unit under review, or re-implements its logic in the fixture, verifies nothing.\n\n### Config, CI, docs\n\n- `package.json` script or dependency changes: check the lockfile moved with it, and that the sandboxed-install caveats (CLAUDE.md § Common Pitfalls) still hold.\n- Changes to commands, architecture, or rules documented in `CLAUDE.md`\u002F`AGENTS.md`: the doc must move in the same PR — that's a written rule, cite it.\n- Prose follows [docs\u002FWRITING_STYLE.md](..\u002F..\u002F..\u002Fdocs\u002FWRITING_STYLE.md); flag slop words but leave the full prose pass to `unslop`.\n\n## Smell baseline\n\nA fixed set of Fowler code smells (_Refactoring_, ch. 3) the Standards axis carries on top of whatever the repo documents. Each reads *what it is* → *how to fix*; match against the diff.\n\n- **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.\n- **Duplicated Code** — the same logic shape in more than one hunk or file in the change. → extract the shared shape, call it from both.\n- **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies.\n- **Data Clumps** — the same few fields or params keep travelling together, a type wanting to be born. → bundle them into one type, pass that.\n- **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.\n- **Repeated Switches** — the same `switch` or `if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.\n- **Shotgun Surgery** — one logical change forces scattered edits across many files. → gather what changes together into one module.\n- **Divergent Change** — one file or module edited for several unrelated reasons. → split so each module changes for one reason.\n- **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.\n- **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.\n- **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct.\n- **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.\n\n## Quick greps\n\nOver the changed files, not the whole repo — pre-existing hits are out of scope.\n\n```bash\nrg \"@nodetool-ai\u002F[a-z-]+\u002Fdist\"            # dist imports (always wrong)\nrg \"new WebSocket\\(\"                       # bypassing GlobalWebSocketManager\nrg \"JSON\\.(stringify|parse)\" packages\u002Fwebsocket packages\u002Fruntime   # on WS paths only\nrg \"from ['\\\"]@mui\u002Fmaterial\" web\u002Fsrc       # outside ui_primitives\u002F, editor_ui\u002F\nrg \": any\\b|as any\\b|as unknown as\"        # strict mode escapes\nrg \"console\\.log\"                          # leftover debug output\n```\n\nA grep hit is a lead, not a finding — read the site before reporting.\n\n## What not to flag\n\n- Anything `npm run lint` or `npm run typecheck` already rejects — report their output instead of duplicating it as prose findings.\n- Style preferences with no backing in the repo docs. \"I'd have written it differently\" is not a finding.\n- Pre-existing problems outside the diff. Mention once at the end if serious; don't mix them into the findings.\n- Slop — comments, dead abstractions, prose filler. One pointer to `unslop`, not itemized findings.\n\n## Output format\n\nWithin each axis, order findings blockers → should-fix → nits. Each one:\n\n```\n[BLOCKER] packages\u002Fkernel\u002Fsrc\u002Factor.ts:142 — `pending` is never cleared on error\nWhen a node throws, `handleError` returns early before `this.pending.delete(id)`,\nso the runner waits forever on the next `sync_mode: on_any` join.\nFix: move the delete into a `finally`.\n```\n\nOne line of location and claim, the failure scenario, the fix. Close with what you actually ran:\n\n```\nVerified: npm run build --workspace=packages\u002Fkernel ✓, npm run test --workspace=packages\u002Fkernel ✓ (34 passed)\n```\n\nIf nothing is wrong, say so plainly and list what you checked — a clean review is a valid result, not a failure to find something.\n\n## Why three axes\n\nA change can pass one and fail another:\n\n- Code that follows every standard and implements the wrong thing → Standards pass, Spec fail.\n- Code that does exactly what the issue asked and breaks the project's conventions → Spec pass, Standards fail.\n- Code that satisfies both and deadlocks the runner → Correctness fail.\n\nReporting them separately stops one axis from masking another.\n","# Code Review\n\nThree-axis review of the diff between `HEAD` and a fixed point:\n\n- **Correctness** — does the change work, and does it step on a NodeTool landmine?\n- **Standards** — does it follow this repo's documented rules?\n- **Spec** — does it faithfully implement the originating issue or spec?\n\nEach axis runs as a **parallel sub-agent** so they don't pollute each other's context. This skill scopes the diff first, then aggregates.\n\nDivision of labor with the sibling skill: [`unslop`](..\u002Funslop\u002FSKILL.md) asks whether the change is free of AI-generated filler. Run it after this one for a full pre-merge pass.\n\nThe rules the Correctness and Standards axes cite live in [`CLAUDE.md`](..\u002F..\u002F..\u002FCLAUDE.md), [`docs\u002FDEVELOPMENT_STANDARDS.md`](..\u002F..\u002F..\u002Fdocs\u002FDEVELOPMENT_STANDARDS.md), and the area `AGENTS.md` files.\n\n## Process\n\n### 1. Pin the fixed point\n\nWhatever the user named is the fixed point — a commit SHA, branch, tag, `main`, `HEAD~5`. If they named none, infer from what they asked for:\n\n- Working tree: `git diff` + `git diff --cached`, plus untracked files via `git status`.\n- Branch or PR: `git diff $(git merge-base main HEAD)...HEAD` — never `git diff main`, which picks up drift on main. For a PR, fetch the branch first.\n\nCapture the diff command once, and the commit list via `git log \u003Cfixed-point>..HEAD --oneline`. Confirm the ref resolves (`git rev-parse`) and the diff is non-empty before going further — a bad ref should fail here, not inside three sub-agents.\n\n### 2. Map the blast radius\n\n`npm run dev:nodetool -- affected --base main --json` lists the workspaces to typecheck and test, and says whether a decorator package (loads from `dist\u002F`) forces `npm run build:packages`. Don't guess.\n\n### 3. Find the spec\n\nIn order:\n\n1. Issue references in the commit messages (`#123`, `Closes #45`).\n2. A path the user passed as an argument.\n3. A spec file under `docs\u002F`, `specs\u002F`, or `.scratch\u002F` matching the branch or feature.\n4. Otherwise ask. If there is no spec, the Spec sub-agent is skipped and the report says so.\n\n### 4. Find the standards sources\n\n`CLAUDE.md`, `docs\u002FDEVELOPMENT_STANDARDS.md`, the `AGENTS.md` for each area the diff touches, and anything else the repo documents about how code should be written.\n\nOn top of those, the Standards axis always carries the [smell baseline](#smell-baseline) below, which applies even where a repo documents nothing. Two rules bind it: a documented repo standard always wins, and every smell is a labelled heuristic (\"possible Feature Envy\"), never a hard violation.\n\n### 5. Spawn the sub-agents in parallel\n\nOne message, three `Agent` calls, `general-purpose` for each. Give every prompt the diff command, the commit list, and the path to this file (`.claude\u002Fskills\u002Fcode-review\u002FSKILL.md`) so the sub-agent can read the section it needs.\n\n**Correctness** — \"Read § Correctness checklists, § Severity, and § Quick greps in `.claude\u002Fskills\u002Fcode-review\u002FSKILL.md`. Read each changed function whole, and its callers — grep the symbol; a hunk that looks fine in isolation is where signature drift and broken invariants hide. For changed types in `packages\u002Fprotocol`, check every package importing them. Report findings most-severe first; each needs a failure scenario you can name the input for, or a citable rule. Under 500 words.\"\n\n**Standards** — \"Read § Smell baseline in `.claude\u002Fskills\u002Fcode-review\u002FSKILL.md`, plus these standards sources: \u003Clist from step 4>. Report, per file or hunk: (a) every place the diff violates a documented standard — cite the file and rule; (b) any baseline smell — name it and quote the hunk. Documented standards override the baseline, and baseline smells are always judgement calls. Skip anything lint or typecheck enforces. Under 400 words.\"\n\n**Spec** — \"The spec is at \u003Cpath or contents>. Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff nobody asked for; (c) requirements that look implemented but implemented wrong. Quote the spec line for each finding. Under 400 words.\"\n\n### 6. Verify\n\nWhile the sub-agents run, run the targeted commands from step 2: `npm run test --workspace=packages\u002F\u003Cname>` and `npm run lint --workspace=packages\u002F\u003Cname>` per package (packages typecheck via `build`, not a `typecheck` script); root `npm run typecheck` covers web, electron, and mobile. If the diff is wide, `npm run check`. Report the actual output — never \"should pass\".\n\n### 7. Aggregate\n\nPresent the reports under `## Correctness`, `## Standards`, and `## Spec`, verbatim or lightly cleaned. Do **not** merge or rerank findings across axes — see [Why three axes](#why-three-axes). End with one line per axis: total findings, the worst one, and the verification you ran.\n\n## Severity\n\n| Tier | Meaning | Bar |\n|------|---------|-----|\n| **Blocker** | Wrong behavior, crash, data loss, security hole, broken build | You can name the input or state that triggers it |\n| **Should-fix** | Violates a written repo rule | Cite the rule |\n| **Nit** | Everything else worth a sentence | Only if you found nothing bigger in that file; never pad |\n\nA finding without a failure scenario or a citable rule is not a finding. When unsure whether something is a bug, say so instead of inflating the severity.\n\n## Correctness checklists\n\n### Cross-package (any `packages\u002F` change)\n\n- **Imports**: inter-package imports use `@nodetool-ai\u002F\u003Cpkg>` — never `..\u002Fother-pkg\u002F` or anything containing `\u002Fdist\u002F`.\n- **ESM extensions**: relative imports need `.js` in compiled output. A missing extension typechecks but dies at runtime in built packages.\n- **Dependency direction**: does the import respect `protocol → config → security\u002Fauth\u002Fstorage → runtime → kernel → node-sdk → base-nodes → models → agents → chat → websocket\u002Fcli`? A lower package importing a higher one is a cycle waiting to happen.\n- **Decorator packages** (`base-nodes`, `node-sdk`, `fal-nodes`, `replicate-nodes`, `elevenlabs-nodes`) load from `dist\u002F`. A change here that isn't followed by `build:packages` silently tests stale code — confirm the verify step rebuilt.\n- **Runtime data files**: anything loaded relative to `import.meta.url` (manifests, examples, `package:\u002F\u002F` assets) breaks in the packaged Electron app, where the backend is bundled into one `server.mjs`. Such files must be registered in `PACKAGE_RUNTIME_ASSETS` (`packages\u002Fconfig\u002Fsrc\u002Fpackage-asset-registry.ts`) and loaded via `loadPackageAssetJson`.\n- **Protocol types**: new message or data shapes belong in `packages\u002Fprotocol`, not re-declared locally.\n- **Errors**: `throw new Error(...)`, never strings. Empty catch blocks need a comment saying why.\n- **WebSocket framing**: WS messages are **MsgPack**, REST is JSON. `JSON.stringify` on a WS send path, or a missing msgpack decode on a receive path, is a blocker.\n- **Streaming nodes**: `genProcess` must `yield`, not accumulate-and-return; check that backpressure-sensitive paths don't buffer unbounded.\n\n### Web (`web\u002Fsrc\u002F`)\n\n- **Raw MUI imports** outside `ui_primitives\u002F` and `editor_ui\u002F` — should-fix, migrate to primitives.\n- **Design tokens**: hardcoded border radii, font sizes, transition strings, off-4px-grid spacing, raw z-indexes → `BORDER_RADIUS`, `TYPOGRAPHY`\u002F`var(--fontSize*)`, `MOTION`, `SPACING`, `Z_INDEX` from `ui_primitives` ([docs\u002FDESIGN.md](..\u002F..\u002F..\u002Fdocs\u002FDESIGN.md)).\n- **Zustand**: a whole-store subscription (`useFooStore()` with no selector) re-renders on every store write. Multi-key object selectors need `useShallow`. `getState()` in a render body is a bug; in handlers and effects it's fine.\n- **New `WebSocket(...)`** anywhere — use the `GlobalWebSocketManager` singleton.\n- **TanStack Query**: server data via `useQuery`\u002F`useMutation`, hierarchical keys (`[\"workflows\", id]`), `enabled` for conditional fetches, mutations invalidate affected keys. `useEffect`+`fetch` for backend data is should-fix.\n- **ReactFlow**: unstable references passed as `nodes`\u002F`edges`\u002F`nodeTypes` (a fresh array or object each render) tank canvas performance — hoist or memoize `nodeTypes`, derive nodes and edges via selectors.\n- **Effects**: check every new `useEffect` dependency array against what the body reads; a stale closure over a store value or prop is a classic bug here.\n\n### Electron (`electron\u002Fsrc\u002F`)\n\nNon-negotiable ([electron\u002Fsrc\u002FAGENTS.md](..\u002F..\u002F..\u002Felectron\u002Fsrc\u002FAGENTS.md) § Security):\n\n- `contextIsolation: true`, `nodeIntegration: false`, no `webSecurity: false`, no remote-content `BrowserWindow` without a strict preload.\n- Every new IPC handler validates its inputs — renderer input is untrusted. Channel names typed, no `ipcMain.handle` passing raw args into `fs`, `child_process`, or `shell.openExternal` without allow-listing.\n- Paths resolved relative to `import.meta.url` or `__dirname`: verify against the packaged layout (§ Packaged file layout), not just dev.\n\n### Mobile (`mobile\u002F`)\n\n- `mobile\u002F` is **not** a root workspace. Scripts must use `npm --prefix mobile ...`; a diff that \"standardizes\" this to `--workspace=mobile` breaks it.\n- Mobile typecheck needs `packages\u002Fprotocol` built first.\n\n### Tests\n\n- New behavior without a test, or changed behavior whose old test still passes unmodified — ask why.\n- Vitest in `packages\u002F`, Jest in `web\u002F` and `electron\u002F`, files in `__tests__\u002F`.\n- RTL queries by role or label, `userEvent`, `waitFor`\u002F`findBy*` — no `setTimeout` sleeps, no `getByTestId` where a role query works.\n- A test that mocks the unit under review, or re-implements its logic in the fixture, verifies nothing.\n\n### Config, CI, docs\n\n- `package.json` script or dependency changes: check the lockfile moved with it, and that the sandboxed-install caveats (CLAUDE.md § Common Pitfalls) still hold.\n- Changes to commands, architecture, or rules documented in `CLAUDE.md`\u002F`AGENTS.md`: the doc must move in the same PR — that's a written rule, cite it.\n- Prose follows [docs\u002FWRITING_STYLE.md](..\u002F..\u002F..\u002Fdocs\u002FWRITING_STYLE.md); flag slop words but leave the full prose pass to `unslop`.\n\n## Smell baseline\n\nA fixed set of Fowler code smells (_Refactoring_, ch. 3) the Standards axis carries on top of whatever the repo documents. Each reads *what it is* → *how to fix*; match against the diff.\n\n- **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.\n- **Duplicated Code** — the same logic shape in more than one hunk or file in the change. → extract the shared shape, call it from both.\n- **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies.\n- **Data Clumps** — the same few fields or params keep travelling together, a type wanting to be born. → bundle them into one type, pass that.\n- **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.\n- **Repeated Switches** — the same `switch` or `if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.\n- **Shotgun Surgery** — one logical change forces scattered edits across many files. → gather what changes together into one module.\n- **Divergent Change** — one file or module edited for several unrelated reasons. → split so each module changes for one reason.\n- **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.\n- **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.\n- **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct.\n- **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.\n\n## Quick greps\n\nOver the changed files, not the whole repo — pre-existing hits are out of scope.\n\n```bash\nrg \"@nodetool-ai\u002F[a-z-]+\u002Fdist\"            # dist imports (always wrong)\nrg \"new WebSocket\\(\"                       # bypassing GlobalWebSocketManager\nrg \"JSON\\.(stringify|parse)\" packages\u002Fwebsocket packages\u002Fruntime   # on WS paths only\nrg \"from ['\\\"]@mui\u002Fmaterial\" web\u002Fsrc       # outside ui_primitives\u002F, editor_ui\u002F\nrg \": any\\b|as any\\b|as unknown as\"        # strict mode escapes\nrg \"console\\.log\"                          # leftover debug output\n```\n\nA grep hit is a lead, not a finding — read the site before reporting.\n\n## What not to flag\n\n- Anything `npm run lint` or `npm run typecheck` already rejects — report their output instead of duplicating it as prose findings.\n- Style preferences with no backing in the repo docs. \"I'd have written it differently\" is not a finding.\n- Pre-existing problems outside the diff. Mention once at the end if serious; don't mix them into the findings.\n- Slop — comments, dead abstractions, prose filler. One pointer to `unslop`, not itemized findings.\n\n## Output format\n\nWithin each axis, order findings blockers → should-fix → nits. Each one:\n\n```\n[BLOCKER] packages\u002Fkernel\u002Fsrc\u002Factor.ts:142 — `pending` is never cleared on error\nWhen a node throws, `handleError` returns early before `this.pending.delete(id)`,\nso the runner waits forever on the next `sync_mode: on_any` join.\nFix: move the delete into a `finally`.\n```\n\nOne line of location and claim, the failure scenario, the fix. Close with what you actually ran:\n\n```\nVerified: npm run build --workspace=packages\u002Fkernel ✓, npm run test --workspace=packages\u002Fkernel ✓ (34 passed)\n```\n\nIf nothing is wrong, say so plainly and list what you checked — a clean review is a valid result, not a failure to find something.\n\n## Why three axes\n\nA change can pass one and fail another:\n\n- Code that follows every standard and implements the wrong thing → Standards pass, Spec fail.\n- Code that does exactly what the issue asked and breaks the project's conventions → Spec pass, Standards fail.\n- Code that satisfies both and deadlocks the runner → Correctness fail.\n\nReporting them separately stops one axis from masking another.\n",{"name":5,"description":7},"main","4ef72a828b24c99c49109033c7ec504c34f3bd17",".claude\u002Fskills\u002Fcode-review",0,"https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas","https:\u002F\u002Fgithub.com\u002Fhanchenhao","2026-08-18 16:41:12",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add hanchenhao\u002Fai-canvas --skill code-review",{"tool":36,"command":37},"bunx","bunx skills add hanchenhao\u002Fai-canvas --skill code-review",{"tool":39,"command":40},"pnpm","pnpm dlx skills add hanchenhao\u002Fai-canvas --skill code-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcode-review\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M7AE5NP5AWGV47WS3F37VPZ1","sandbox-zip","Read and write zip archives in a Code node or CodeAct action, with fflate running on the host under a 50 MB inflation cap","https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-zip\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M7AE5JP0CG2S114Q246RC6MH","sandbox-yaml","Read and write YAML inside a Code node or CodeAct action, with js-yaml running in the guest","https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-yaml\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M7AE5GJ9AV36WM1DPW1878VM","sandbox-xml","Parse XML feeds and sitemaps in a Code node or CodeAct action, with fast-xml-parser running on the host","https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-xml\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7AE5DMYDAGJW27G8KKTZ2BN","sandbox-xlsx","Read and write Excel workbooks in a Code node or CodeAct action, with exceljs running on the host","https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-xlsx\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7AE5BARJSFCT296SEMYDSJQ","sandbox-twilio","Send SMS and WhatsApp messages and look up numbers from a Code node or CodeAct action, with NodeTool's Twilio request builder running on the host","https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-twilio\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7AE57C5APRDF96NB3G0WQMW","sandbox-tfjs","Classify and embed images, detect objects, and answer from a passage in a Code node or CodeAct action, with TensorFlow.js running on the host","https:\u002F\u002Fgithub.com\u002Fhanchenhao\u002Fai-canvas\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-tfjs\u002FSKILL.md",[],[]]