Skip to content

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: true in its frontmatter. It is loaded via Read by the parent np-critic spawn as the Style audit-surface — lib/agents.cjs::loadAgent rejects it for spawning, and loop-audit-tool-use --agent np-critic-style is also rejected.

AttributeValue
Frontmatter module:true
Tier metadatahaiku (legacy — informational only, no spawn happens)
Loaded bynp-critic as one of three audit-surface modules
Definesthe 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

CheckDetail
Namingidentifiers obey project conventions (PSR-12 / Standard JS / Airbnb / project overrides)
Dead codeunreachable branches, unused parameters, unused imports/exports, commented-out blocks
Dangling threadsreferences to files / symbols not in files_modified that should have been touched
TODO / FIXME markersany TODO / FIXME / XXX / HACK / STUB introduced by the diff
Import hygienealphabetised imports if required; no wildcards unless explicit; no unused imports
Comment hygienecomments narrate WHY non-obvious; comments restating WHAT are findings
Lint violationseven 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

RuleWhy this critic enforces it
Rule 2 — Do it rightRejects // TODO, // FIXME, commented-out code paths
Rule 5 — Aim to genuinely impressEvery finding cites file, line, pattern, remediation
Rule 7 — Never leave a dangling threadDetects dangling imports, unused exports, half-renamed identifiers

Stop conditions (inherited by np-critic)

ConditionBehaviour
Diff is unparseableEmit single critic-error finding describing the failure (routes to stuck)
files_modified references a path that does not exist after the diffEmit critic-error finding (routes to stuck)
Critic timeout exhaustedEmit findings collected so far + a critic-error finding for the timeout

Source

agents/np-critic-style.md in the source tree.