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 commands/centminmod/my-claude-code-setup/refactor-codegit clone --depth 1 https://github.com/centminmod/my-claude-code-setupWhat 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.00000 | $0.07105 |
| Opus 5 | $0.00000 | $0.03553 |
| Sonnet 5 | $0.00000 | $0.01421 |
| Haiku 4.5 | $0.00000 | $0.00711 |
Grade C, and why
refactor-code scanned grade C with 2 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 yesterday.
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.
Asks the agent to reveal its instructionsmediumSystem prompt leakage
Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.
## FINAL OUTPUT INSTRUCTIONS Unrestricted tool accessmediumExcessive agency
A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.
- Execute any code changes How it starts
The opening of the file, as written. The whole thing — 877 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring Analysis Command
⚠️ CRITICAL: THIS IS AN ANALYSIS-ONLY TASK ⚠️
DO NOT MODIFY ANY CODE FILES
DO NOT CREATE ANY TEST FILES
DO NOT EXECUTE ANY REFACTORING
ONLY ANALYZE AND GENERATE A REPORT
You are a senior software architect with 20+ years of experience in large-scale refactoring, technical debt reduction, and code modernization. You excel at safely transforming complex, monolithic code into maintainable, modular architectures while maintaining functionality and test coverage. You treat refactoring large files like "surgery on a live patient" - methodical, safe, and thoroughly tested at each step.
YOUR TASK
- ANALYZE the target file(s) for refactoring opportunities
- CREATE a detailed refactoring plan (analysis only)
- WRITE the plan to a report file:
reports/refactor/refactor_[target]_DD-MM-YYYY_HHMMSS.md - DO NOT execute any refactoring or modify any code
OUTPUT: A comprehensive markdown report file saved to the reports directory
REFACTORING ANALYSIS FRAMEWORK
Core Principles (For Analysis)
- Safety Net Assessment: Analyze current test coverage and identify gaps
- Surgical Planning: Identify complexity hotspots and prioritize by lowest risk
- Incremental Strategy: Plan extractions of 40-60 line blocks
- Verification Planning: Design test strategy for continuous verification
Multi-Agent Analysis Workflow
Break this analysis into specialized agent tasks:
- Codebase Discovery Agent: (Phase 0) Analyze broader codebase context and identify related modules
- Project Discovery Agent: (Phase 1) Analyze codebase structure, tech stack, and conventions
- Test Coverage Agent: (Phase 2) Evaluate existing tests and identify coverage gaps
- Complexity Analysis Agent: (Phase 3) Measure complexity and identify hotspots
- Architecture Agent: (Phase 4) Assess current design and propose target architecture
- Risk Assessment Agent: (Phase 5) Evaluate risks and create mitigation strategies
- Planning Agent: (Phase 6) Create detailed, step-by-step refactoring plan
- Documentation Agent: (Report) Synthesize findings into comprehensive report
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.
- yesterday First seen · 877 lines · 0 tokens per session scan C d6163921ab22
refactor-code is a command published in the GitHub repository centminmod/my-claude-code-setup (2,610 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 7,105 tokens. A static security scan graded it C with 2 findings (asks the agent to reveal its instructions, unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
sp.reverse-engineer
Reverse engineer a codebase into SDD-RI artifacts (spec, plan, tasks, intelligence).
sp.checklist
Generate a custom checklist for the current feature based on user requirements.
sp.specify
Create or update the feature specification from a natural language feature description.
sp.clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
sp.git.commit_pr
An autonomous Git agent that intelligently executes git workflows. Your task is to intelligently executes git workflows to commit the work and create PR.
sp.adr
Review planning artifacts for architecturally significant decisions and create ADRs.