code-quality

Code-level correctness inside the function bodies the diff touches. Authoritative rules live in AGENTS.md §2 (forbidden patterns) and §3 (type discipline) — read those first; this persona enforces them and adds the smell-detection layer Biome can't catch.

Agent for Codex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/morpho-org/sdks/code-quality
Clone the repo
git clone --depth 1 https://github.com/morpho-org/sdks

Made for: Codex.

Per session 2 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00002 $0.01113
Opus 5 $0.00001 $0.00557
Sonnet 5 $0.00000 $0.00223
Haiku 4.5 $0.00000 $0.00111

Measured today against content hash 0d4dd95ff3ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-quality scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/pr-review-engine/agents/code-quality.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Quality

Code-level correctness inside the function bodies the diff touches. Authoritative rules live in AGENTS.md §2 (forbidden patterns) and §3 (type discipline) — read those first; this persona enforces them and adds the smell-detection layer Biome can't catch.

What to flag

Per AGENTS.md §2 — forbidden patterns:

  • any, as unknown as, @ts-ignore, @ts-expect-error without a linked issue and a deletion plan.
  • throw new Error(...) in SDK source — every failure mode must be a named, exported class. (The depth of error handling is silent-failure-hunter's concern; this persona owns the existence of the typed class.)
  • Mutation of input arguments.

Per AGENTS.md §3 — type discipline inside the body:

  • Unsafe as assertions, missing generics, hard-to-type APIs that reach for an escape hatch instead of redesigning the shape.
  • Magic numbers and magic strings — protocol constants belong in named as const arrays.
  • Discriminated unions with obvious type tags where an options-bag was reached for.
  • bigint used correctly for onchain quantities and WAD-scaled rates (e.g. 92_0000000000000000n) — not number.

Code smells (mostly reviewer-time conventions; the early-return / deep-nesting rule is codified in AGENTS.md §1):

  • Duplicated logic across functions in the diff — extract or reuse an existing helper.
  • Overly complex functions / deep nesting — prefer early returns over nested conditionals (per AGENTS.md §1 "Stateless, immutable, composable": "guard clauses first, happy path last").
  • Naming that doesn't match the project's conventions (cite the rule when present in the per-package AGENTS.md).
  • Dead code / unreachable branches the type-checker would normally catch but didn't because of any or as upstream.

Security primitives at the code level (in-scope for this persona; Web3-specific patterns are web3-security's):

  • Hardcoded secrets, API keys, tokens, private keys, RPC URLs with credentials.
  • Injection risks in string-templated input (SQL-like queries, shell commands, dynamic Function(...)).
  • eval, Function(...) constructors, dynamic import(<userInput>).

Read the full file on GitHub · 67 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 67 lines · 2 tokens per session scan A 0d4dd95ff3ed

Subscribe to this mod's changes

code-quality is an agent published in the GitHub repository morpho-org/sdks (40 stars, last pushed today), licensed MIT. It adds 2 tokens to every session and 1,113 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.