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/soden46/engineer-flow/code-quality-refactoringnpx skills add soden46/engineer-flow --skill code-quality-refactoringgit clone --depth 1 https://github.com/soden46/engineer-flowWhat 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.00022 | $0.00513 |
| Opus 5 | $0.00011 | $0.00257 |
| Sonnet 5 | $0.00004 | $0.00103 |
| Haiku 4.5 | $0.00002 | $0.00051 |
Grade A, and why
code-quality-refactoring 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 — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Quality and Refactoring
Use this skill for cleanup, simplification, decomposition, duplication removal, complexity reduction, and maintainability improvements.
This skill is language and framework agnostic.
Preserve Behavior
Unless the task explicitly changes behavior, refactoring should preserve observable behavior.
Separate:
- behavior changes
- structural changes
when practical.
Scope
Prefer focused refactoring over broad rewrites.
Avoid touching unrelated code merely for style consistency.
Complexity
Reduce complexity where it materially improves understanding or correctness.
Potential signals include:
- deeply nested control flow
- large functions
- duplicated logic
- mixed responsibilities
- hidden side effects
- unclear state transitions
- repeated mapping/validation logic
- excessive branching
Do not optimize for arbitrary complexity numbers without considering readability.
Responsibilities
Keep distinct responsibilities separate when this improves clarity.
Common separations include:
- validation
- authorization
- orchestration
- persistence
- transformation
- external communication
- presentation
Do not introduce abstractions merely to increase abstraction count.
Duplication
Remove meaningful duplicated behavior when shared behavior genuinely belongs together.
Some duplication may be preferable to premature coupling.
Naming
Names should communicate purpose rather than implementation trivia.
Prefer terminology already established by the project.
Dependencies
Avoid unnecessary dependencies between unrelated modules.
Prefer clear boundaries and explicit data flow.
Refactoring Safety
Before substantial refactoring:
- identify expected behavior
- identify relevant tests
- understand external interfaces
- preserve public contracts unless intentionally changed
After refactoring:
- run relevant tests
- verify behavior
- check affected integration boundaries
Framework Adaptation
Follow the architectural conventions already used by the project.
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 · 122 lines · 22 tokens per session scan A 5ba0193304c1
code-quality-refactoring is a skill published in the GitHub repository soden46/engineer-flow (3 stars, last pushed 5d ago), licensed MIT. It adds 22 tokens to every session and 513 once invoked, about $0.0001 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 skills, from other repositories
todos
This chat has a shared, live TODO plan — your tasks for the conversation, which the user also edits. Read this skill and reach for the todo tools whenever a request takes more than a couple of steps. It covers the plan model (group = task, items = its steps; loose items are the user's lane), how to work it: propose…
writing-workflow-skills
Use when adding a new workflow skill to pi-thinkrail-workflow, changing an existing workflow skill's role, trigger, handoff, or structure, or checking a workflow skill against the workflow system's rules. Not for authoring general-purpose skills outside this package.
brainstorming
Use this BEFORE any creative or feature work: building a new feature, adding functionality, changing behavior, or making a nontrivial design decision. Turns the user's request into a validated design — recorded as a spec-graph task-spec — before any implementation. Do not skip this because a change looks small.
writing-specs
Use when a workflow step drafts or revises a spec artifact — a goal-and-requirements, an architecture, or a module SPEC — or when a workflow skill names it at such a step. The shared quality bar for specs — not a workflow, nothing to execute.
clarify
Adaptive requirements clarification with auto-depth routing. Shallow (Q&A) for simple tasks, Deep (exploration + DRAFT + PLAN) for complex ones. Escalates automatically when ambiguity persists.
review
Multi-agent code review for Rust CLI/TUI. UX Review inactive (terminal UI — no web frontend). Code Review only. Includes Rust/clippy-specific checklist.