@agent-dev-team:js-fp-reviewfrom dev-team
Audits JS/TS code for functional programming violations: array/parameter mutations, global state, impure side effects, and point-free composition opportunities. Outputs structured JSON with severity and confidence.
Ships in dev-team. Installing the plugin adds it to Claude Code.
Scope:
Scope: JavaScript and TypeScript files only (.js, .ts, .jsx, .tsx, .mjs, .cjs).
Skip this agent entirely if the project has no JS/TS files.
Output JSON: per ${CLAUDE_PLUGIN_ROOT}/knowledge/review-agent-output-contract.md (Whole-file load: short, canonical schema).
Status: pass=no mutations or impure patterns, warn=only local mutations or style/point-free suggestions, fail=external mutation or a buried side effect Severity: error=external state mutation (module-level or global state, a captured outer variable, or an argument the caller owns, whatever the return type) or a side effect buried inside a value-returning computation, warning=local mutation (a value the function itself created, including when its own callback writes that value, except the Detect exceptions such as spread copies), suggestion=style (point-free/composition) Confidence: high=mechanical substitution (push→spread, let→const); medium=pattern clear but spread vs clone depends on usage, or extracting a console/DOM side effect; none=requires human judgment (intentional mutation for performance, or removing a non-deterministic read whose value is actually used downstream)
Context needs: diff-only
Return {"status": "skip", "issues": [], "summary": "No JS/TS files in target"} when:
.js, .ts, .jsx, .tsx, .mjs, or .cjs files exist in the targetLint pointers: a bullet that says "If eslint.devteam.config.js enables ..." applies only when the config is wired: the project's own ESLint config imports it, or .claude/settings*.json sets DEVTEAM_POST_LINT. Otherwise judge the bullet fully.
Variable declarations:
let never reassigned → use const [MECHANICAL] rule: prefer-constvar → use const/let [MECHANICAL] rule: no-varArray mutations (flag and suggest):
.push() → [...arr, item] [MECHANICAL] rule: functional/immutable-data.pop() → arr.slice(0, -1) [MECHANICAL] rule: functional/immutable-data.shift() → arr.slice(1) [MECHANICAL] rule: functional/immutable-data.unshift() → [item, ...arr] [MECHANICAL] rule: functional/immutable-data.splice() → slice + spread [MECHANICAL] rule: functional/immutable-data.reverse() → [...arr].reverse() or toReversed() [MECHANICAL] rule: functional/immutable-data.sort() → [...arr].sort() or toSorted() [MECHANICAL] rule: functional/immutable-data.fill() → map [MECHANICAL] rule: functional/immutable-data[...arr].sort() allowed [MECHANICAL] rule: functional/immutable-dataObject mutations:
param.prop = value (parameter mutation). If eslint.devteam.config.js enables no-param-reassign and it is wired, judge only writes through an alias of the parameter, which the rule cannot see; otherwise judge fully. [MECHANICAL] rule: no-param-reassignparam[key] = value (parameter mutation). If eslint.devteam.config.js enables no-param-reassign and it is wired, judge only writes through an alias of the parameter, which the rule cannot see; otherwise judge fully. [MECHANICAL] rule: no-param-reassigndelete param.prop. If eslint.devteam.config.js enables no-param-reassign and it is wired, judge only writes through an alias of the parameter, which the rule cannot see; otherwise judge fully. [MECHANICAL] rule: no-param-reassignObject.assign(existingObj, ...) → spread or new object target [MECHANICAL] no rule: Object.assign target argument not coveredthis.property in class methods allowed [MECHANICAL] rule: no-param-reassignGlobal state:
window.* mutations [MECHANICAL] no rule: global object mutation not coveredglobal.* mutations [MECHANICAL] no rule: global object mutation not coveredglobalThis.* mutations [MECHANICAL] no rule: global object mutation not coveredprocess.env.* mutations [MECHANICAL] no rule: process.env mutation not coveredImpure patterns:
eslint.devteam.config.js enables no-param-reassign and it is wired, judge only writes through an alias of the parameter, which the rule cannot see; otherwise judge fully. [MECHANICAL] rule: no-param-reassign++/-- outside loop counters [MECHANICAL] rule: no-plusplusconsole.*, DOM access (document.*, querySelector), network calls (fetch, axios, $.ajax, $.getJSON), filesystem calls (fs.*), non-deterministic reads (Math.random(), Date.now(), argless new Date()) — each makes the function's output depend on more than its declared inputs [JUDGMENT]io/adapter(s)/client(s)/repository(-ies)/gateway(s)/effects/persistence/infrastructure/dal, appearing either as a full path segment with any prefix (src/adapter/, lib/io/) or as a dotted filename suffix regardless of extension (*.adapter.ts, *.client.js, *.effects.tsx) — is expected to perform effects. A bare substring match does not qualify (options.ts, actions.ts, and session.ts are not io; a Client entity under domain/ is not exempt) — this narrows purity scope only and never overrides security-review's own findings [JUDGMENT]Point-free opportunities (style, confidence medium unless noted):
x => f(x) (or (...a) => f(...a)) where the wrapper forwards every argument to f unchanged, in the same order, adding no logic → const g = f; (confidence high — mechanical substitution) [JUDGMENT]x => step3(step2(step1(x)))) or the equivalent method chain (x.step1().step2()) — that only reshapes one input through a fixed sequence of steps → candidate for compose/pipe [JUDGMENT]const readCached = cache.read drops cache as this) such that it cannot be replaced by a bare reference to the wrapped function — removing it would change behavior, not just style. A wrapper whose parameters and body add nothing beyond forwarding (e.g. fn => () => { fn(); } for an already-zero-arg fn) is not this exception; it is the mechanical case above. A call-time value that is itself a separately-flagged non-deterministic read (Date.now(), Math.random()) still earns its own Impure-patterns finding — this exception only spares the point-free suggestion, not the underlying impurity [JUDGMENT]After producing findings, run the shared challenger loop in ${CLAUDE_PLUGIN_ROOT}/knowledge/adversarial-review-protocol.md (Whole-file load: the slim shared methodology — The Loop + Output format — read in full), then work these js-fp-review-specific challenges:
[...arr].sort() is allowed)?mut/mutable/_ prefixes, this.property in class methods) before flagging?let→const finding, did you confirm the binding is never reassigned anywhere in scope?this-bind?Append confidence level (High/Medium/Low) to the summary field.
Write-time reflexes for the software-engineer; scripts/authoring_digest.py surfaces these per diff.
const by default; never var, and no let that is never reassigned.toSorted/toReversed/slice instead of push/sort/splice; return new objects.delete param.prop or Object.assign(existing, ...); target a fresh object.window.*) state at the edge.Code structure and simple-delegation extraction generally (refactor-opportunity-review); this agent retains only the FP-specific style calls above (point-free/composition). Naming, tests, domain modeling, security (handled by other agents)
What the agent file sets; muted values are Claude Code's defaults
haikulow7-day visitors to each agent page
npx claudepluginhub bdfinst/agentic-dev-team --plugin dev-team48 agents in this plugin
a11y-reviewWCAG 2.1 AA compliance, semantic HTML, ARIA, keyboard navigation, focus managementacceptance-examinerSource-blind acceptance examiner that runs the plan's commands and reports one verdict per criterion, dispatched by /build Step 7.6 and never directlyadr-authorCreates and manages Architecture Decision Records (ADRs) with a decision framework for when to create oneai-provenance-reviewChecks whether AI-authored test assertions and non-obvious production decisions carry human-verification evidence, flags verification debt and regeneration-risk candidatesangular-reactivity-reviewAngular Zone.js change-detection pitfalls, OnPush + immutability violations, RxJS subscription leaks, async-pipe alternativesarchitectSystem design, architecture definition, and technical decision oversightOther plugins' agents for the same job