Appearance
np-critic-style (audit-surface module)
Module file, not a spawnable agent. Per the Single-Critic Revision (ADR-0010 §2026-05-05) this file carries
module: truein its frontmatter. It is loaded viaReadby the parentnp-criticspawn as the Style audit-surface —lib/agents.cjs::loadAgentrejects it for spawning, andloop-audit-tool-use --agent np-critic-styleis also rejected.
| Attribute | Value |
|---|---|
Frontmatter module: | true |
| Tier metadata | haiku (legacy — informational only, no spawn happens) |
| Loaded by | np-critic as one of three audit-surface modules |
| Defines | the Style category set, severities, and stop conditions |
Role
The Style audit surface scopes the categories style, dead-code, dangling-thread, todo-marker, import-hygiene, comment-hygiene, and lint-violation. The parent np-critic agent emits findings under these categories as part of its merged JSON.
Audit surface
| Check | Detail |
|---|---|
| Naming | identifiers obey project conventions (PSR-12 / Standard JS / Airbnb / project overrides) |
| Dead code | unreachable branches, unused parameters, unused imports/exports, commented-out blocks |
| Dangling threads | references to files / symbols not in files_modified that should have been touched |
| TODO / FIXME markers | any TODO / FIXME / XXX / HACK / STUB introduced by the diff |
| Import hygiene | alphabetised imports if required; no wildcards unless explicit; no unused imports |
| Comment hygiene | comments narrate WHY non-obvious; comments restating WHAT are findings |
| Lint violations | even when the orchestrator's mechanical check missed them at task verify |
Output schema
The Style module does not produce its own output — its findings appear inside the parent np-critic's merged JSON. Style-axis category enum:
style, dead-code, dangling-thread, todo-marker, import-hygiene, comment-hygiene, lint-violation, critic-error.
Each category routes per the findings routing table. critic-error is reserved for hard-stop conditions (unparseable diff, missing path, budget exhausted) and routes to stuck.
Completeness rules bound
| Rule | Why this critic enforces it |
|---|---|
| Rule 2 — Do it right | Rejects // TODO, // FIXME, commented-out code paths |
| Rule 5 — Aim to genuinely impress | Every finding cites file, line, pattern, remediation |
| Rule 7 — Never leave a dangling thread | Detects dangling imports, unused exports, half-renamed identifiers |
Stop conditions (inherited by np-critic)
| Condition | Behaviour |
|---|---|
| Diff is unparseable | Emit single critic-error finding describing the failure (routes to stuck) |
files_modified references a path that does not exist after the diff | Emit critic-error finding (routes to stuck) |
| Critic timeout exhausted | Emit findings collected so far + a critic-error finding for the timeout |
Source
agents/np-critic-style.md in the source tree.
