Systematic Code Refactoring
luongnv89/claude-howto
Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.
Apply meta-principles of software craftsmanship: DRY, orthogonality, tracer bullets, and design by contract.
$ npx skills add wondelai/skills --skill pragmatic-programmer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wondelai/skills pragmatic-programmer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/wondelai/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/pragmatic-programmer .claude/skills/pragmatic-programmer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "pragmatic-programmer" agent skill from https://github.com/wondelai/skills/tree/main/pragmatic-programmer into .claude/skills/pragmatic-programmer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pragmatic-programmer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/wondelai/skills/tree/main/pragmatic-programmerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add wondelai/skills --skill pragmatic-programmer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wondelai/skills pragmatic-programmer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wondelai/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/pragmatic-programmer .agents/skills/pragmatic-programmer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pragmatic-programmer" agent skill from https://github.com/wondelai/skills/tree/main/pragmatic-programmer into .agents/skills/pragmatic-programmer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pragmatic-programmer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wondelai/skills --skill pragmatic-programmer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wondelai/skills pragmatic-programmer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wondelai/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/pragmatic-programmer .cursor/skills/pragmatic-programmer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pragmatic-programmer" agent skill from https://github.com/wondelai/skills/tree/main/pragmatic-programmer into .cursor/skills/pragmatic-programmer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pragmatic-programmer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/wondelai/skills.git --path pragmatic-programmer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add wondelai/skills --skill pragmatic-programmer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wondelai/skills pragmatic-programmer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wondelai/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/pragmatic-programmer .gemini/skills/pragmatic-programmer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pragmatic-programmer" agent skill from https://github.com/wondelai/skills/tree/main/pragmatic-programmer into .gemini/skills/pragmatic-programmer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pragmatic-programmer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install wondelai/skills pragmatic-programmerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add wondelai/skills --skill pragmatic-programmer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/wondelai/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/pragmatic-programmer .github/skills/pragmatic-programmer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pragmatic-programmer" agent skill from https://github.com/wondelai/skills/tree/main/pragmatic-programmer into .github/skills/pragmatic-programmer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pragmatic-programmer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wondelai/skills --skill pragmatic-programmer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install wondelai/skills pragmatic-programmer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wondelai/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/pragmatic-programmer .opencode/skills/pragmatic-programmer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pragmatic-programmer" agent skill from https://github.com/wondelai/skills/tree/main/pragmatic-programmer into .opencode/skills/pragmatic-programmer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pragmatic-programmer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pragmatic-programmerApply meta-principles of software craftsmanship: DRY, orthogonality, tracer bullets, and design by contract.
Pragmatic Programmer is an agent skill from wondelai/skills. Apply meta-principles of software craftsmanship: DRY, orthogonality, tracer bullets, and design by contract. Use when the user mentions "best practices", "pragmatic approach", "broken windows", "tracer bullet", "software craftsmanship", "avoid technical debt", "code ownership", or "how do I become a better developer". Also trigger when evaluating build-vs-buy decisions, designing estimation approaches, or choosing between reversible and irreversible architectural decisions. Covers estimation, domain languages…
Its SKILL.md is about 4.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/broken-windows.md`, `references/contracts-assertions.md` and `references/dry-orthogonality.md`).
It sits in Development, covering Code quality, Technical debt and Refactoring. The repository describes itself as: Wondel.ai Agent Skills — Business, Marketing, UX & Coding Frameworks from Bestselling Books. 50 skills + 12 guided journeys for Claude Code, Codex, Cursor & other agentskills.io… The licence is MIT.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit c172996. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
amazon.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Pragmatic Programmer loads about 4.1k tokens when it runs, and up to ~23k if it reads all its reference files. Until then it costs about 162 tokens; SKILL.md has 2,041 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from wondelai/skills at commit c172996, republished under its MIT licence (© wondelai). 2,041 words, ~4,140 tokens.
.claude/skills/pragmatic-programmer/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.A systems-level approach to software craftsmanship from Hunt & Thomas' "The Pragmatic Programmer" (20th Anniversary Edition). Apply these meta-principles when designing systems, reviewing architecture, writing code, or advising on engineering culture -- how to think about software, not just how to write it.
Care about your craft. Software development demands continuous learning, disciplined practice, and personal responsibility -- pragmatic programmers think beyond the immediate problem to context, trade-offs, and long-term consequences. Great software comes from great habits: avoid duplication ruthlessly, keep components orthogonal, and treat every line of code as a living asset that must earn its place. The goal is not perfection -- it is systems that are easy to change, easy to understand, and easy to trust.
Goal: 10/10. Score against the seven Quick Diagnostic rows: award ~1.4 points per row answered "yes" (7 yes = 10). Then band the result:
Always state the score, name the failing diagnostic rows, and give the specific fix from the Action column to reach 10/10.
Seven principles for building software that lasts:
Core concept: Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. DRY is about knowledge, not code -- duplicated logic, business rules, or configuration are far more dangerous than duplicated syntax.
Why it works: Duplicated knowledge must be changed in multiple places; eventually one gets missed, introducing inconsistency. DRY reduces the surface area for bugs and makes systems easier to change.
Key insights:
Code applications:
| Context | Pattern | Example |
|---|---|---|
| Config values | Single source of truth | DB connection in one env file, referenced everywhere |
| Validation rules | Shared schema | One JSON Schema or Zod schema for client and server |
| API contracts | Generate from spec | OpenAPI spec generates types, docs, and client code |
See: references/dry-orthogonality.md when classifying a specific duplication or deciding whether two code blocks are truly the same knowledge -- per-type examples and mitigations for the four duplication types.
Core concept: Two components are orthogonal if changes in one do not affect the other. Design systems where components are self-contained, independent, and have a single, well-defined purpose.
Why it works: Decoupling localizes change -- a fix in one module can't ripple into unrelated ones, so blast radius stays bounded. Change the database layer and the UI should not break; change the auth provider and business logic should not care.
Key insights:
Code applications:
| Context | Pattern | Example |
|---|---|---|
| Architecture | Layered separation | Controller -> Service -> Repository, each replaceable |
| Dependencies | Dependency injection | Pass a Notifier interface, not a SlackClient concrete class |
| Testing | Isolated unit tests | Test business logic without database, network, or filesystem |
See: references/dry-orthogonality.md when measuring coupling or refactoring toward decoupled layers -- the change-impact and stranger tests, layered-architecture diagram, and the helicopter analogy.
Core concept: Tracer bullets are end-to-end implementations connecting all layers of the system with minimal functionality. Unlike prototypes (which are throwaway), tracer bullet code is production code -- thin but real.
Why it works: Tracer bullets give immediate end-to-end feedback before you invest in filling out every feature. Users see something real, developers have a framework to build on, and integration issues surface early.
Key insights:
Code applications:
| Context | Pattern | Example |
|---|---|---|
| New project | Vertical slice | One feature end-to-end: button -> API -> DB -> response |
| Uncertain tech | Spike prototype | Test WebSocket performance before committing |
| Microservice | Walking skeleton | Hello-world service through the full CI/CD pipeline |
See: references/tracer-bullets.md when deciding tracer vs. prototype on a new project or building a walking skeleton -- the shooting-in-the-dark decision, iteration loop, and common pitfalls.
Core concept: Define and enforce the rights and responsibilities of software modules through preconditions (what must be true before), postconditions (what is guaranteed after), and invariants (what is always true). When a contract is violated, fail immediately and loudly.
Why it works: Contracts make assumptions explicit. Instead of silently corrupting data or limping along in an invalid state, the system crashes at the point of the problem -- dead programs tell no lies.
Key insights:
Code applications:
| Context | Pattern | Example |
|---|---|---|
| Function entry | Precondition guard | assert age >= 0, "Age cannot be negative" at function start |
| Class state | Invariant validation | validate! called after every state mutation |
| API boundary | Schema validation | Validate request body against schema before processing |
See: references/contracts-assertions.md when adding contracts to a routine or deciding assertion vs. error handling -- worked pre/post/invariant patterns, dynamic-language guard clauses, and the assertions-vs-error-handling boundary.
Core concept: One broken window -- a badly designed piece of code, a poor management decision, a hack that "we'll fix later" -- starts the rot. Once a system shows neglect, entropy accelerates and discipline collapses.
Why it works: Psychology. When code is clean, developers feel social pressure to keep it that way; when code is already messy, the threshold for adding more mess drops to zero. Quality is a team habit, not an individual heroic effort.
Key insights:
Code applications:
| Context | Pattern | Example |
|---|---|---|
| Legacy code | Board up windows | Wrap bad code in a clean interface before adding features |
| Code review | Zero-tolerance for new debt | Reject PRs adding // TODO: fix later without a ticket |
| Tech debt | Debt budget | Allocate 20% of each sprint to fixing broken windows |
See: references/broken-windows.md when a team is normalizing neglect or you need to drive a turnaround -- repair strategies, the stone-soup catalyst play, and building a culture of quality.
Core concept: There are no final decisions. Build systems that make it easy to change your mind about databases, frameworks, vendors, architecture, and deployment targets -- the cost of change should be proportional to the scope of change.
Why it works: Requirements change, vendors get acquired, technologies fall out of favor. If your architecture hard-codes assumptions about any of these, every change becomes a rewrite; flexible architecture treats decisions as configuration, not structure.
Key insights:
Code applications:
| Context | Pattern | Example |
|---|---|---|
| Database | Repository pattern | Business logic calls repo.save(user), not pg.query(...) |
| External API | Adapter/wrapper | PaymentGateway interface wraps Stripe; swap to Braintree later |
| Feature flags | Runtime toggles | New checkout flow behind a flag, rollback in seconds |
See: references/reversibility.md when committing to a vendor or framework, or weighing how reversible a decision must be -- per-layer reversibility patterns, the forking-road test, and when NOT to optimize for reversibility.
Core concept: Learn to estimate reliably by understanding scope, building models, decomposing into components, and assigning ranges. Manage your learning like a financial portfolio: invest regularly, diversify, and rebalance.
Why it works: Honest estimation builds trust with stakeholders ("1-3 weeks" beats a confidently wrong "2 weeks"). A knowledge portfolio keeps you relevant as technologies shift -- the programmer who stops learning stops being effective.
Key insights:
Code applications:
| Context | Pattern | Example |
|---|---|---|
| Sprint planning | Range estimates | "3-5 days" with confidence level, not a single number |
| New technology | Time-boxed spike | "2 days evaluating; then I can estimate properly" |
| Learning | Weekly investment | 1 hour/week on a new language, tool, or domain |
See: references/estimation-portfolio.md when producing an estimate you'll be held to or calibrating past misses -- the PERT and decomposition procedures, an estimation-log calibration loop, and portfolio rebalancing.
| Mistake | Why It Fails | Fix |
|---|---|---|
| DRY-ing similar-looking code that serves different purposes | Couples unrelated concepts; changes to one break the other | Only DRY knowledge, not coincidental code similarity |
| Skipping tracer bullets, building layer-by-layer | Integration issues surface late; no end-to-end feedback | Build one thin vertical slice first |
| Ignoring broken windows "because we'll refactor later" | Entropy accelerates; later never comes; morale drops | Fix immediately or board up with a tracked ticket |
| Estimates as single-point commitments | False precision erodes trust when missed | Always give ranges with confidence levels |
| Making everything "flexible" upfront | Over-engineering; abstraction without evidence of need | Add flexibility when you have concrete evidence you'll need it |
| Removing production assertions "for performance" | Bugs assertions would catch now silently corrupt data | Keep critical assertions; benchmark before removing any |
| Global state "for convenience" | Destroys orthogonality; everything coupled to everything | Use dependency injection and explicit parameters |
| Question | If No | Action |
|---|---|---|
| Can I change the database without touching business logic? | Orthogonality violation | Introduce repository/adapter pattern |
| Do I have an end-to-end slice working? | Missing tracer bullet | Build one vertical slice before expanding |
| Is every business rule defined in exactly one place? | DRY violation | Identify the authoritative source; remove duplicates |
| Would a new developer call this codebase "clean"? | Broken windows present | Schedule a dedicated cleanup sprint |
| Do my estimates include ranges and confidence levels? | Estimation problem | Switch to PERT or range-based estimates |
| Can I roll back this deployment in under 5 minutes? | Reversibility gap | Add feature flags and blue-green deploys |
| Am I learning something new every week? | Knowledge portfolio stagnant | Schedule weekly learning time and track it |
Andrew Hunt and David Thomas co-founded the Pragmatic Bookshelf and were among the 17 original authors of the Agile Manifesto. Thomas coined "DRY" and "Code Kata" and co-authored Programming Ruby (the Pickaxe book); Hunt focuses on how teams learn, communicate, and maintain quality. Together they wrote The Pragmatic Programmer, one of the most influential software books ever published.
© wondelai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 6 other files (references) in pragmatic-programmer of wondelai/skills.
Open the folder on GitHubat commit c172996
Pragmatic Programmer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Pragmatic Programmer this skillwondelai/skills | 2.4k | — | ~4.1k | Automated safety check: Pass | MIT | |
| Systematic Code Refactoringluongnv89/claude-howto | 42k | — | ~3k | Automated safety check: Pass | MIT | |
| Code Refactoring Workflowluongnv89/claude-howto | 42k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Tech Debt Analyzerailabs-393/ai-labs-claude-skills | 454 | 2 repos | ~3.9k | Automated safety check: Pass | MIT | |
| FIXME Resolvertailcallhq/forgecode | 7.6k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| DesloppifyGit-on-my-level/codex-autorunner | 875 | — | ~3.4k | Automated safety check: Pass | MIT |
luongnv89/claude-howto
Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.
luongnv89/claude-howto
Guides systematic, test-backed refactoring in the style of Martin Fowler, moving through research, planning and small incremental changes with your approval at each phase.
ailabs-393/ai-labs-claude-skills
This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability.
tailcallhq/forgecode
Finds every FIXME comment in a codebase, groups related ones across files into one task, implements the work they describe and removes the comments once it is done.
Git-on-my-level/codex-autorunner
Codebase health scanner and technical debt tracker. An agent skill from Git-on-my-level/codex-autorunner.
fengshao1227/ccg-workflow
Scans code for complexity, long functions, duplicated blocks, naming problems and code smells with a Node script, then reports and suggests refactors.
wondelai/skills
Navigate the technology adoption lifecycle from early adopters to mainstream market.
wondelai/skills
Apply foundational design principles: affordances, signifiers, constraints, feedback, and conceptual models.
wondelai/skills
Run a structured 5-day process to prototype, test, and validate product ideas with real users.
wondelai/skills
Design habit-forming product loops using the Hook Model (Trigger, Action, Variable Reward, Investment).
wondelai/skills
Diagnose and fix retention problems using behavior design (B=MAP).
wondelai/skills
Design products and pricing around validated willingness to pay, from Ramanujam & Tacke's "Monetizing Innovation".
Categories
Apply meta-principles of software craftsmanship: DRY, orthogonality, tracer bullets, and design by contract. Pragmatic Programmer is an agent skill from wondelai/skills. Apply meta-principles of software craftsmanship: DRY, orthogonality, tracer bullets, and design by contract.
Pragmatic Programmer fits situations like: the user mentions best practices; pragmatic approach; software craftsmanship; avoid technical debt.
Run `npx skills add wondelai/skills --skill pragmatic-programmer -a claude-code`. Or copy the skill folder (pragmatic-programmer in wondelai/skills) into .claude/skills/pragmatic-programmer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wondelai/skills --skill pragmatic-programmer -a codex`. Or copy the skill folder (pragmatic-programmer in wondelai/skills) into .agents/skills/pragmatic-programmer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wondelai/skills --skill pragmatic-programmer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pragmatic-programmer, .gemini/skills/pragmatic-programmer, .github/skills/pragmatic-programmer and .opencode/skills/pragmatic-programmer in your project.
SKILL.md names no scripts, command-line tools or credentials: Pragmatic Programmer is instructions for the agent only.
SKILL.md names 1 domain. As links in the text: amazon.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Pragmatic Programmer is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.1k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 19k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Pragmatic Programmer: Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Code Refactoring Workflow (luongnv89/claude-howto, 42k stars), Tech Debt Analyzer (ailabs-393/ai-labs-claude-skills, 454 stars) and FIXME Resolver (tailcallhq/forgecode, 7.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
wondelai (a GitHub organization) maintains it in wondelai/skills, which has 2,356 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on September 10, 2026.
Source: wondelai/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.