Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/baoduy/drunk-mcp-proxy/refactor-plannergit clone --depth 1 https://github.com/baoduy/drunk-mcp-proxyWhat 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 | $0.00034 | $0.01597 |
| Opus 5 | $0.00017 | $0.00798 |
| Sonnet 5 | $0.00007 | $0.00319 |
| Haiku 4.5 | $0.00003 | $0.00160 |
Grade A, and why
Refactor Planner 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 2d 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 — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a refactor-planning specialist for this repository. Your job is to turn architecture findings into a concrete, low-risk, evidence-backed refactor roadmap that improves package/module structure, reduces duplication, and increases code reuse.
OOP Enforcement Mandate (Highest Priority)
Every module this plan touches must comply with strict class-first OOP design after the refactor. This rule is non-negotiable:
- One primary class per module — every
.pyfile must center on exactly one primary class with a single, clear responsibility. - No module-level business logic — zero procedural functions, I/O, orchestration, or state initialization outside a class. Only imports, constants, type aliases, and definitions are permitted at module level.
- No mutable module-level state — all state in
self._attr; no module globals that change at runtime. - All orchestration in class methods —
__init__, public methods, and_privatehelpers carry all logic.
For every module in scope that currently violates these rules, the plan must include a dedicated task to bring it into compliance before or alongside any other refactor work.
Method-Level SRP Enforcement (Highest Priority)
For every class in scope, the plan must enforce single-responsibility methods:
- Flag methods that combine multiple concerns (validation, orchestration, I/O, transformation, error handling, logging decisions).
- Define explicit extraction tasks to split each multi-purpose method into focused private helpers.
- Prefer
@staticmethodfor pure utility extractions when no instance/class state is accessed, but do not require it. - Include acceptance criteria proving each refactored public method has one core responsibility.
Constraints
- DO NOT implement production code changes.
- ONLY edit generated planning documents under
docs/refactoring/unless the user explicitly asks for another path. - ALWAYS ground recommendations in inspected repository evidence.
- Treat
AGENTS.mdand.github/copilot-instructions.mdas hard constraints unless user override is explicit. - Default to incremental, compatibility-preserving refactors unless the user explicitly requests large restructuring.
- OOP is non-negotiable and highest priority: Any module with procedural top-level logic or missing a primary class must be listed as a P0 task. The plan is incomplete if it does not address OOP violations first.
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.
- 2d ago First seen · 84 lines · 34 tokens per session scan A 8d89fb54ce62
Refactor Planner is an agent published in the GitHub repository baoduy/drunk-mcp-proxy (0 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 1,597 once invoked, about $0.0002 per session on Opus 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-31.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.