/review:type-safety-reviewfrom Review toolkit
Review a diff or a path for type-safety findings (mixed and any, unstructured arrays where a DTO belongs, array-shape pseudo-types without a reason, duplicate types, unchecked casts). Use during PR review, before opening a PR, or when asked about type coverage or type hierarchy. Calibrated on PHP and PHPStan first, with TypeScript and Python sections.
Ships in Review toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill is a checklist, not an editor. It walks the types a diff or a path introduces, rules each one against the rules in references/php.md, references/typescript.md, and references/python.md, and reports every finding with the shape it proposes instead. It edits no file, writes no code, and makes no commit; the reviewer decides what to act on.
/review:type-safety-review [path or base=... head=...]
One of two things is in scope, never both:
base= and head= are given, with the same defaults as step 0 of ../comment-audit/SKILL.md when either is omitted. Read git diff BASE...HEAD, three dots, so only what the branch adds is ruled on.base= and head= are ignored.Generated code is out of scope. Skip the paths that step 0 of ../comment-audit/SKILL.md excludes from dirs=. List what was skipped in the report.
Before ruling on a candidate, open the definition the type flows from. For a mixed parameter that is the callers; for an array crossing a boundary that is the method that builds the array and the call site that reads it; for a cast that is the value's origin. A search hit is not a read.
A narrower type that is not reachable is not a finding. When the origin has no narrower type to offer, there is nothing to propose and the candidate is dropped. Say why it was not reachable whenever a reviewer reading the same line would wonder why it is missing from the report.
When the origin cannot be resolved, say so in the finding and name the file that would settle it. An unresolved origin is not evidence that a finding exists.
For Python, run the type checker and the lint command that step 0 of ../comment-audit/SKILL.md resolves before ruling on PY-5, and record each command and its result. A checker that reports nothing is evidence for its configured strictness only, not for the rules it leaves off.
Read references/php.md for PHP, references/typescript.md for TypeScript, and references/python.md for Python. Rule ids are PHP-1 through PHP-5, TS-1 through TS-4, and PY-1 through PY-5. Every finding carries exactly one rule id, and no finding is reported without one.
Each finding is one block in this shape:
**path:line, <rule id>**: "<quote>". Reason. Proposed shape:
followed by a fenced block holding the proposed type. Line numbers come from the HEAD side of the diff so they can be pasted as PR review comments. The quote is verbatim from that line, so the reviewer does not need the diff open.
One filled example:
app/Services/Billing/InvoiceTotalsCalculator.php:31, PHP-2: "public function forOrder(Order $order): array". The method returns ['subtotal' => ..., 'tax' => ..., 'total' => ...] and its only caller, InvoiceController::show(), reads all three by name, so the key set is fixed and already named at the call site. Proposed shape:
final readonly class InvoiceTotals
{
public function __construct(
public Money $subtotal,
public Money $tax,
public Money $total,
) {}
}
The report is the whole output of this skill. It has two parts, in this order:
PHP-1 to PHP-5, TS-1 to TS-4, and PY-1 to PY-5 including the ones with zero findings, then the paths skipped as generated or vendored.Severity order, highest first:
mixed or Any on a boundary (PHP-1, TS-1, TS-3, PY-1, and a PY-3 cast()).dict crossing a boundary (PHP-2, PY-2).PHP-4, TS-4, PY-4).PHP-3, TS-2, and a PY-3 TypedDict or # type: ignore without a reason).PHP-5, PY-5).Nothing outside the report is produced. A finding proposes a shape; it never applies one.
The report follows ../writing-comments/references/style.md.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub noppu-labs/ai-toolkit --plugin review6 skills in this plugin
/comment-auditAudit every comment, docblock, JSDoc, Python docstring, GraphQL description, and markdown line a branch adds and give each a verdict (DELETE, TRIM, MOVE, KEEP, UNSURE, WRONG). Use before opening a PR, when reviewing a PR's comments, or when asked to trim, audit, or clean up comments. Report only by default; `--apply` edits and commits./correctness-reviewHunt correctness defects in a diff through named angles (hunk scan, removed behaviour, callers and callees, language pitfalls, wrapper routing) and drop a candidate only when the code refutes it. Use for a correctness or bug review of a branch or PR, and as the first correctness pass of pr-review./pr-commentsUse when a code review report (the pr-review consolidated report, a single stage report, or pasted findings) has to become comments a pull request author reads, anchored to a file and line, graded for severity, and referenceable by a code. Also use when asked to format, post, clean up, or grade review findings for a PR./pr-reviewOrchestrate a three-stage review (correctness, type safety, comment audit) of one PR or a stack of PRs, delegating each stage to a subagent with a structural brief and consolidating one report. Use when asked for a comprehensive, full, or three-stage PR review, or to review a PR stack./writing-commentsWhat belongs in a code comment and what to cut. Use when writing comments or docblocks, trimming a diff before opening a PR, or reviewing comments in someone else's change.