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 skills/firstp1ck/pi-coding-agent-forge/refactoring-advisornpx skills add Firstp1ck/pi-coding-agent-forge --skill refactoring-advisorgit clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forgeWhat 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.00048 | $0.01586 |
| Opus 5 | $0.00024 | $0.00793 |
| Sonnet 5 | $0.00010 | $0.00317 |
| Haiku 4.5 | $0.00005 | $0.00159 |
Grade A, and why
refactoring-advisor 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 3d 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 — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring Advisor
Systematic code smell detection and safe refactoring planning. Every refactoring plan ensures the codebase compiles and passes tests at every intermediate step.
Quick Start
Identify and Plan a Refactoring
- Detect the smell: What's wrong and why does it matter?
- Assess the risk: What could break? How large is the blast radius?
- Check test coverage: Are the affected areas covered? If not, add tests first.
- Plan incremental steps: Each step should leave the code in a working state.
- Estimate effort: Size the work (S/M/L/XL) and identify dependencies.
Common Code Smells by Language
Rust
| Smell | Description | Refactoring |
|---|---|---|
| God struct | One struct with too many fields/methods | Extract into smaller, focused structs |
| Unnecessary clones | .clone() where borrowing would work |
Replace with borrows, use lifetimes |
| Stringly typed | Using String where an enum fits |
Introduce enum with From impls |
| Match explosion | Huge match blocks that grow with every variant |
Extract match arms into methods, use trait dispatch |
| Unwrap sprawl | .unwrap() scattered through non-test code |
Replace with ? operator, proper error handling |
| Leaky abstraction | pub on internal implementation details |
Reduce to pub(crate) or pub(super) |
Monolithic lib.rs |
Everything in one file | Split into focused modules |
| Over-generic | Generics where a concrete type suffices | Simplify to concrete types until generics are needed |
TypeScript / React
| Smell | Description | Refactoring |
|---|---|---|
| Prop drilling | Props passed through 3+ component levels | Extract to context, composition, or custom hook |
| God component | Component with 200+ lines or multiple responsibilities | Split into focused components |
| Barrel file bloat | Index files re-exporting everything | Direct imports, remove barrel files |
| Any escape hatch | as any or // @ts-ignore hiding type issues |
Fix the types, use type guards or discriminated unions |
| useEffect spaghetti | Multiple unrelated effects in one component | Split effects, extract to custom hooks |
| Inline styles sprawl | Styles defined inline instead of using design system | Extract to CSS modules, Tailwind classes, or styled components |
| Callback prop chains | Passing callbacks through many layers | Use context or state management |
| State duplication | Same data stored in multiple state variables | Derive computed values, single source of truth |
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.
- 3d ago First seen · 175 lines · 48 tokens per session scan A 845eea481a98
refactoring-advisor is a skill published in the GitHub repository Firstp1ck/pi-coding-agent-forge (74 stars, last pushed 3d ago), licensed MIT. It adds 48 tokens to every session and 1,586 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-30.
Other skills, from other repositories
github-release-management
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management.
flow-nexus-platform
Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges.
github-code-review
Comprehensive GitHub code review with AI-powered swarm coordination.
github-multi-repo
Multi-repository coordination, synchronization, and architecture management with AI swarm orchestration.
github-project-management
Comprehensive GitHub project management with swarm-coordinated issue tracking, project board automation, and sprint planning.
github-workflow-automation
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management.