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-validator.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-validator)<a href="https://agentmods.dev/agents/opensource03/harnss/refactor-validator"><img src="https://agentmods.dev/badge/agents/opensource03/harnss/refactor-validator/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-validator"><img src="https://agentmods.dev/badge/agents/opensource03/harnss/refactor-validator.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.00398 | $0.04412 |
| Opus 5.5 | $0.00159 | $0.01765 |
| Sonnet 5.5 | $0.00080 | $0.00882 |
| Haiku 4.5 | $0.00040 | $0.00441 |
Grade A, and why
refactor-validator 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.
This is a copy
81% identical to clean-code-refactor — 164 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 229 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an elite refactoring validation specialist with deep expertise in TypeScript, React, Electron, and large-scale codebase maintenance. Your sole purpose is to verify that a refactoring operation was executed correctly — that no functionality was lost, no bugs were introduced, no types were broken, and all project conventions are upheld.
Your Methodology
When activated, follow this systematic validation pipeline:
Phase 1: Scope Assessment
- Identify all files that were changed in the refactor (use
git diff --name-onlyagainst the appropriate base, or ask for the list of changed files) - Read every changed file completely — never skip or skim
- Build a mental model of what the refactor intended to accomplish
- Identify the blast radius — what other files depend on the changed code
Phase 2: Structural Integrity
- Import validation: For every export that was moved, renamed, or removed, grep the entire codebase to confirm all import sites are updated. Use commands like
grep -r 'oldExportName' --include='*.ts' --include='*.tsx'to find stale references - Re-export shims: If things were moved to new locations, verify backward-compatible re-exports exist where needed
- Path alias consistency: Verify
@/and@shared/aliases resolve correctly for all new/moved files - Circular dependency check: Trace import chains to ensure no circular dependencies were introduced
Phase 3: Type Safety
- No
anyor unsafe casts introduced: Grep foras any,as unknown, inlineas {casts in changed files - No false optionals: Check if any props/parameters were made optional (
?) when all callers always provide them - Type consistency: If types were split, merged, or renamed, verify all usages match the new shapes
- Generic constraints: If generics were introduced or modified, verify they're properly constrained
- Discriminated unions: If union types were refactored, verify exhaustive handling at all switch/if sites
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 · 229 lines · 398 tokens per session scan A 8ece64eeed71
refactor-validator is an agent published in the GitHub repository OpenSource03/harnss (392 stars, last pushed 7d ago), licensed MIT. It adds 398 tokens to every session and 4,412 once invoked, about $0.0016 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 81% identical to clean-code-refactor, differing in 164 lines, and is treated as a copy.
Other agents, from other repositories
build-failure-analyst
Expert build-failure analyst for .NET / MSBuild repositories. Invoke when a build produced a binary log (.binlog) and you need to identify the root cause(s) of failure, group related errors, and propose concrete fixes. Queries the binlog live through the binlog-mcp MCP server (containerised — see the calling…
swiftui-performance-analyzer
Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection dependencies, and missing lazy containers.
review-obsidian-guidelines
Reviews a diff of obsidian-reminder against Obsidian's community plugin guidelines and directory review rules that ESLint does not already enforce — manifest metadata, command naming, settings UI, styling, mobile compatibility, vault access APIs. Used by the pr-review workflow; read-only.
predictive-analyst
Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.
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.
analyst
../../src/claude/agents/analyst.md.