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 skills add personamanagmentlayer/pcl --skill refactoring-workflowgit clone --depth 1 https://github.com/personamanagmentlayer/pclWrote 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/skills/personamanagmentlayer/pcl/refactoring-workflow)<a href="https://agentmods.dev/skills/personamanagmentlayer/pcl/refactoring-workflow"><img src="https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/refactoring-workflow/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/skills/personamanagmentlayer/pcl/refactoring-workflow"><img src="https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/refactoring-workflow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00083 | $0.02066 |
| Opus 5.5 | $0.00033 | $0.00826 |
| Sonnet 5.5 | $0.00017 | $0.00413 |
| Haiku 4.5 | $0.00008 | $0.00207 |
Grade A, and why
refactoring-workflow 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 3mo 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 — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring Workflow
Refactoring is changing the structure of code without changing its behaviour. If behaviour changes, it is not a refactor — it is a rewrite, and it needs a different plan and a different review.
When to Use This Skill
- The user asks to refactor, clean up, restructure or simplify
- A feature is hard to add because the current structure resists it
- Duplication has reached the point where a change must be made in several places
- A module has grown beyond what one reader can hold in mind
- Coupling makes a unit impossible to test in isolation
Do not refactor when the tests are red, when you do not understand the current behaviour, or as a side quest inside a feature branch. Refactoring merged together with behaviour change is unreviewable.
Core Concepts
The Two Hats
You are either adding behaviour or restructuring — never both in the same edit. Kent Beck's metaphor: swap hats deliberately, and know which one you are wearing. When a refactor reveals a bug, note it and finish the refactor; fix the bug in a separate change with its own test.
The Precondition
A refactor is safe only to the extent that behaviour is observable. That means a green test suite covering the paths you will touch. Without it you are not refactoring, you are editing and hoping.
If coverage is missing, stop and add characterisation tests first — see the
tdd-workflow skill, which covers seams and characterisation in depth.
Small Steps
Each step should be small enough that you can name what it did and revert it alone. Run the suite after every step. Two hours of unverified restructuring followed by a red suite gives you no information about which edit broke it.
Make the Change Easy, Then Make the Easy Change
When a feature is hard to add, do not force it into the existing shape. First refactor until the feature becomes a small addition, then add it. These are two commits, in that order.
The Workflow
1. Confirm green and clean
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3mo ago First seen · 240 lines · 83 tokens per session scan A fcf31a69f549
refactoring-workflow is a skill published in the GitHub repository personamanagmentlayer/pcl (47 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 83 tokens to every session and 2,066 once invoked, about $0.0003 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-09-05.
refactoring-workflow compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactoring-workflowpersonamanagmentlayer/pcl | Skill | 47 | 1mo ago | Apache-2.0 | A | 83 | Claude Code |
| absolute-simplifymaddhruv/absolute | Skill | 223 | 5mo ago | MIT | A | 178 | Claude Code |
| arch-optimizebfxh/arch-optimize | Skill | 5 | 1mo ago | MIT | A | 114 | Claude Code |
| refactor-agentchandrudp29/skillhub | Skill | 14 | 5mo ago | MIT | A | 32 | Claude Code, Codex |
| finding-duplicate-functionsbobmatnyc/claude-mpm | Skill | 161 | 3mo ago | none | A | 36 | Claude Code |
| clawrouterBlockRunAI/ClawRouter | Skill | 6.7k | today | MIT | A | 171 | Claude Code, Codex |
| polymarket-tradingBlockRunAI/ClawRouter | Skill | 6.7k | today | MIT | A | 76 | Claude Code, Codex |