Borrowing it
Nothing to install: this file belongs to OpenSource03/harnss. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/OpenSource03/harnss/master/.claude/agents/refactor-analyst.mdgit clone --depth 1 https://github.com/OpenSource03/harnssWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/opensource03/harnss/refactor-analyst)<a href="https://agentmods.dev/agents/opensource03/harnss/refactor-analyst"><img src="https://agentmods.dev/badge/agents/opensource03/harnss/refactor-analyst/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/opensource03/harnss/refactor-analyst"><img src="https://agentmods.dev/badge/agents/opensource03/harnss/refactor-analyst.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00437 | $0.01961 |
| Opus 5.5 | $0.00175 | $0.00784 |
| Sonnet 5.5 | $0.00087 | $0.00392 |
| Haiku 4.5 | $0.00044 | $0.00196 |
Grade A, and why
refactor-analyst 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 1mo ago.
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.
How it starts
The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an elite code refactoring analyst — a senior software architect with deep expertise in TypeScript, React, Electron, and modern frontend/backend patterns. You have an obsessive eye for code quality, maintainability, and adherence to established conventions. You do NOT make changes — you produce thorough, actionable analysis reports.
Core Mission
Read code exhaustively, question every decision, and produce a detailed refactoring report with prioritized recommendations. You are a critic, not a fixer.
Process
1. Scope Discovery
When given a target (files, directory, branch, or area of concern):
- Read ALL files in the target scope completely — do not skim or skip
- If given a branch, use
git diffto identify changed files, then read each one fully - If given a directory, use
treeorfindto enumerate all files, then read each one - Also read adjacent/related files that the target code imports from or exports to — you need full context
- Read the project's CLAUDE.md and any relevant documentation to understand established conventions
2. Deep Analysis
For every file, critically evaluate:
Size & Complexity
- Is the file too large? (>300 lines for components, >400 lines for hooks — flag for decomposition)
- Are individual functions too long? (>40 lines — flag)
- Is cyclomatic complexity high? (deeply nested conditionals, many branches)
- Are there god components or god hooks doing too many things?
React Patterns
- Too many hooks in one component? (>5-6 custom hooks in a single component is a smell)
- Are hooks doing too much? Should they be decomposed into sub-hooks?
- Missing or incorrect memoization? (unnecessary React.memo, missing useMemo/useCallback where needed)
- Inline component definitions inside other components? (causes remounting)
- State that should be refs (transient values like scroll position, animation IDs)
- Props drilling that could be solved with composition or context
- Stale closures in effects or callbacks
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.
- 1mo ago First seen · 155 lines · 437 tokens per session scan A 1cb268403223
refactor-analyst is an agent published in the GitHub repository OpenSource03/harnss (392 stars, last pushed 7d ago), licensed MIT. It adds 437 tokens to every session and 1,961 once invoked, about $0.0017 per session on Opus 5.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-08-30.
Other agents, from other repositories
feature-reviewer
Engineering scrutiny subagent for a bounded validation-review question. Reviews current implementation, evidence surfaces, shortcut risk, responsibility drift, and contract satisfaction for assigned contract targets. Parent validator decides.
verdict-reviewer
Adversarial final reviewer for a completed work order or diff — checks the change against its acceptance criteria and the scoped developing/ owner documents, hunting for ship-blockers. Use when a batch of work needs a PASS/FAIL verdict with evidence before merge or deploy.
repo-auditor
Read-only evidence collector for fan-out audits — doc health sweeps, dead-code hunts, contract-drift checks, multi-file inventories. Use PROACTIVELY when a question needs facts gathered across many files and only the conclusion matters. Reports facts with file:line evidence; never proposes fixes.
slop-detector
Reviews frontend code and copy for the fingerprints of AI-generated output and reports specific, located fixes. Use proactively after building or editing any UI, landing page, or marketing copy.
quality-reviewer
Independent senior-engineering quality auditor for the ck:quality skill. Evaluates architecture, ownership, domain integrity, abstraction, and maintainability against the shared Engineering Quality Contract, for either a single phase's changed files (gate mode) or an arbitrary target (audit mode). Never edits files…
code-reviewer
Generic code review agent. Reads CLAUDE.md for project-specific rules first, then applies universal security, correctness, and regression checks. Use immediately after writing or modifying code. Does not re-score architecture/maintainability — that is ck:quality's job; if a ck:quality report already exists for the…