Code Refactoring Workflow
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.
Guided journey from a working-but-untested vibe-coded prototype to a production-ready product with tests, clean structure, a business-rules boundary, and resilience at scale.
$ npx skills add wondelai/skills --skill improve-code-quality -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wondelai/skills improve-code-quality --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/improve-code-quality .claude/skills/improve-code-quality && 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 "improve-code-quality" agent skill from https://github.com/wondelai/skills/tree/main/improve-code-quality into .claude/skills/improve-code-quality/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "improve-code-quality", 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/improve-code-qualityType 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 improve-code-quality -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wondelai/skills improve-code-quality --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/improve-code-quality .agents/skills/improve-code-quality && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "improve-code-quality" agent skill from https://github.com/wondelai/skills/tree/main/improve-code-quality into .agents/skills/improve-code-quality/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "improve-code-quality", 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 improve-code-quality -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wondelai/skills improve-code-quality --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/improve-code-quality .cursor/skills/improve-code-quality && 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 "improve-code-quality" agent skill from https://github.com/wondelai/skills/tree/main/improve-code-quality into .cursor/skills/improve-code-quality/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "improve-code-quality", 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 improve-code-quality--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 improve-code-quality -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wondelai/skills improve-code-quality --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/improve-code-quality .gemini/skills/improve-code-quality && 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 "improve-code-quality" agent skill from https://github.com/wondelai/skills/tree/main/improve-code-quality into .gemini/skills/improve-code-quality/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "improve-code-quality", 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 improve-code-qualityInstalls 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 improve-code-quality -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/improve-code-quality .github/skills/improve-code-quality && 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 "improve-code-quality" agent skill from https://github.com/wondelai/skills/tree/main/improve-code-quality into .github/skills/improve-code-quality/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "improve-code-quality", 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 improve-code-quality -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 improve-code-quality --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/improve-code-quality .opencode/skills/improve-code-quality && 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 "improve-code-quality" agent skill from https://github.com/wondelai/skills/tree/main/improve-code-quality into .opencode/skills/improve-code-quality/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "improve-code-quality", 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.
improve-code-qualityGuided journey from a working-but-untested vibe-coded prototype to a production-ready product with tests, clean structure, a business-rules boundary, and resilience at scale.
Improve Code Quality is an agent skill from wondelai/skills. Guided journey from a working-but-untested vibe-coded prototype to a production-ready product with tests, clean structure, a business-rules boundary, and resilience at scale. Orchestrates nine skills phase by phase - working-with-legacy-code, clean-code, refactoring-patterns, software-design-philosophy, clean-architecture, pragmatic-programmer, release-it, system-design, ddia-systems - asking the user questions at every decision point and recording results in the project docs/ folder (TESTING.md, TECH-DEBT.md…
Its SKILL.md is about 6.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/artifact-templates.md`).
It sits in Development, covering Code quality, Technical debt and Legacy modernization. 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.
9 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.
Shell commands in SKILL.md call:
npxgitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npx and git, which can reach the network depending on how they are called.
From 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.
Improve Code Quality loads about 6.2k tokens when it runs, and up to ~7.1k if it reads all its reference files. Until then it costs about 261 tokens; SKILL.md has 3,379 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). 3,379 words, ~6,233 tokens.
.claude/skills/improve-code-quality/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Turn a working-but-untested vibe-coded prototype into a product you can ship and operate. This is an
interactive, resumable journey of nine phases: the agent asks before every decision and records the
outcome in your project's docs/ folder, so you can stop after any phase and pick up later. A
week-old prototype is already legacy code — so the first move is a safety net, and every phase after
it is verifiable because of that net.
A week-old untested prototype is already legacy code: flip tactical to strategic — safety net
first, then readability, structure, and production hardening in order. This skill sequences the
phases, asks the decision questions, and records every choice in docs/. The constituent skills
carry the method — invoke them rather than improvising their frameworks. Skipping ahead (refactoring
before tests, scaling before sizing) is the exact failure mode this ordering exists to prevent.
| Phase | Skill | Question it answers | Artifact |
|---|---|---|---|
| 1 | working-with-legacy-code | Can I change this code without breaking it unknowingly? | Creates docs/TESTING.md + docs/TECH-DEBT.md — GATE |
| 2 | clean-code | Is this readable to the next person (and agent)? | Extends docs/TECH-DEBT.md |
| 3 | refactoring-patterns | Can I reshape structure without changing behavior? | Extends docs/TECH-DEBT.md |
| 4 | software-design-philosophy | Is complexity hidden behind deep modules? | Extends docs/TECH-DEBT.md |
| 5 | clean-architecture | Do business rules depend on the framework, or vice versa? | Extends docs/ARCHITECTURE.md |
| 6 | pragmatic-programmer | What habits keep it clean after we stop? | Extends docs/TECH-DEBT.md |
| 7 | release-it | Will it survive a hostile production? | Creates docs/RELIABILITY.md |
| 8 | system-design | Is it sized for the load we actually have? | Extends docs/ARCHITECTURE.md + docs/RELIABILITY.md |
| 9 | ddia-systems | Is the data layer correct and durable under concurrency? | Extends docs/ARCHITECTURE.md |
docs/IMPROVE-CODE-QUALITY-PLAN.md and every artifact in the Journey Map. If the tracker exists, summarize the journey state in 3-5 lines and ask which phase to enter. Done when the user has confirmed an entry point. A journey with a tracker is resumed, never restarted.docs/IMPROVE-CODE-QUALITY-PLAN.md with every phase statused pending | in-progress | awaiting-evidence | done | deferred: reason | skipped: reason. Done when the tracker exists and the user has confirmed the phase plan.in-progress on proceed. Done when the user chose.npx skills add wondelai/skills/<slug> --global. If the user declines, run the phase from its Brief — the minimum viable method. State which mode you are in.done.docs/. Every recommendation lands as a checkbox or a table row with owner and priority. See references/artifact-templates.md when creating a docs/ file for the first time — create it from the full skeleton (all section headings), then fill the sections your phase names.Ask these before creating the tracker:
git log) or is core domain? (picks the Phase 1 starting module — the three-axis heuristic)Phase-skip heuristics: skip Phases 8-9 when real load is far below any scaling threshold (start with requirements, not solutions — don't build for 50k users while at 50). Phase 7 is not optional once real users exist — timeouts and a circuit breaker are table stakes even at low traffic (it may stay deferred: reason, never skipped). Never skip Phase 1; it is the gate. Then create the tracker from the template and confirm the plan.
Done when docs/IMPROVE-CODE-QUALITY-PLAN.md exists with every phase statused and the user has confirmed the plan.
Phases run in the listed order — each assumes the previous phase's artifact exists. Any phase can be entered, skipped, or deferred per the Operating Rules, but Phase 1 gates them all: nothing downstream touches unpinned code.
Purpose: Pin current behavior at the change points so every later phase is verifiable. No phase may touch code absent from the Safety Net Map.
Brief (fallback): Legacy code is code without tests, so a week-old prototype qualifies. Cover and modify, never edit and pray: identify change points, break inline dependencies with the least-invasive seam (Parameterize Constructor with a production default; Extract and Override for one buried call), then write characterization tests that photograph actual behavior — assert something wrong, read the failure, pin the real value. When full coverage isn't feasible in time, Sprout/Wrap the new code and track the untested host as debt.
Invoke: Use the working-with-legacy-code skill with the starting module chosen at intake. Ask for an effect
sketch from the entry method, the seams, and the smallest characterization-test set that pins current
signup / billing / core behavior.
Decide with the user: (1) Confirm the starting module by the three-axis heuristic — changing next, high churn, core domain. (2) Bugs found while characterizing: pin the wrong behavior and file it in the Debt Ledger, never silently fix — callers may depend on the quirk. Confirm the user accepts this.
Artifact: Create docs/TESTING.md with ## Test Strategy, ## Safety Net Map (module | pinned behaviors | test files | gaps), and ## Characterization Backlog; create docs/TECH-DEBT.md with ## Debt Ledger (item | location | type | risk | effort | priority | status) and ## Sprout / Wrap Register. Update the tracker.
Done when: the target module's behavior is pinned, the suite runs green, both files exist, and Phase 1 shows done — only then are later phases unlocked.
Purpose: Optimize for the reader — names, small single-purpose functions, safe error handling — now that changes are verifiable.
Brief (fallback): Code is read far more than written. Names reveal intent (elapsedTimeInDays,
not d); booleans read as predicates; functions do one thing at one level of abstraction with 0-2
arguments (a flag argument is two functions). Command-Query Separation: change state or return a
value, never both. Error handling: prefer exceptions to return codes, catch specific types, never
return or pass null (use an empty collection, Optional, or Null Object), and put operation + state
context in every thrown error.
Invoke: Use the clean-code skill with a target module. Ask for a 0-10 score across the six disciplines plus the top ten fixes in priority order, and an error-handling audit (bare catches, null returns, contextless errors).
Decide with the user: Which fixes to apply now versus log as debt, the naming / error-handling conventions the team adopts going forward, and whether the clean-code score becomes a CI gate.
Artifact: Extend docs/TECH-DEBT.md: add rows to ## Smell Inventory (smell | location | refactoring | status) for each name / function / error smell, and record the agreed rules under ## Adopted Conventions. Update the tracker.
Done when: the module scores 8+ or every gap below 8 is a Smell Inventory row with a fix, conventions are recorded, and the Phase 1 tests still pass.
Purpose: Turn "clean it up" into named, behavior-preserving transformations executed in small steps.
Brief (fallback): Each smell maps to a named refactoring. Extract Method is the workhorse — if you would write a comment to explain a block, extract it and name it after the comment. Also Replace Magic Number with Symbolic Constant, Replace Nested Conditional with Guard Clauses, Replace Conditional with Polymorphism, Introduce Parameter Object. Workflow: tests green, one transformation, tests green, commit; a red test means revert, not debug. Preparatory Refactoring (make the change easy, then make the easy change) and the Rule of Three guard against premature abstraction.
Invoke: Use the refactoring-patterns skill with a smelly function and the Phase 1 tests. Ask it to name each smell, cite the transformation, and apply one at a time with tests run between each.
Decide with the user: Scope — which smells to address this pass, whether an upcoming feature warrants a Preparatory Refactoring at its insertion point first, and whether the refactored module joins the CI gate list in TESTING.md.
Artifact: Extend docs/TECH-DEBT.md ## Smell Inventory: for each smell, record the named refactoring applied and its status. Update the tracker.
Done when: targeted smells show a named refactoring and done / ticketed status, tests are green, and structural changes landed in structure-only commits.
Purpose: Fight the classitis an unsupervised agent creates — hide real machinery behind simple interfaces instead of multiplying shallow classes.
Brief (fallback): Complexity is the enemy; minimize what a module imposes on the rest of the system. Module depth = functionality ÷ interface complexity; deep modules hide machinery behind small interfaces, shallow ones don't (classitis). Merge shallow classes that always travel together and share state. Watch information leakage (one decision reflected in many modules) and temporal decomposition (organizing by order-of-execution, not by knowledge). This is the tactical→strategic flip: invest 10-20% to keep the design clean.
Invoke: Use the software-design-philosophy skill with the module set touched so far. Ask which classes are shallow, where information leaks across boundaries, and how to consolidate into deeper modules with simpler interfaces.
Decide with the user: Which consolidations to make now versus defer, guarding against over-merging unrelated concerns.
Artifact: Extend docs/TECH-DEBT.md ## Smell Inventory with classitis / shallow-module / information-leakage entries and the consolidation applied. Update the tracker.
Done when: each shallow-module cluster is consolidated or logged with a fix, interface count did not grow for the sake of "modularity", and tests are green.
Purpose: Make the framework and database depend on the business rules, not the reverse.
Brief (fallback): The Dependency Rule: source dependencies point inward — Entities, then Use Cases, then Interface Adapters, then Frameworks/Drivers; nothing inner names anything outer. The database and web are details, plugins to your rules. Enforce with Dependency Inversion: a Use Case owns a repository interface; the Postgres/Stripe implementation lives in an outer adapter. SOLID are the mid-level tools. Microservices sharing one data model are a distributed monolith — apply the rule inside the service first.
Invoke: Use the clean-architecture skill with the current module map and the stack from intake. Ask it to map the dependency graph, list every violation where business logic imports the ORM or framework, and show the extraction to framework-free Use Cases behind owned interfaces.
Decide with the user: How far to push the boundary this pass, which vendors (payments, storage) to wrap behind owned interfaces first, and whether any planned service split waits until the in-service boundary holds (avoid a distributed monolith).
Artifact: Extend docs/ARCHITECTURE.md: record layers and current violations under ## Layer Map & Dependency Rule (violation | location | fix | status) and the boundary choices under ## Decision Log. Update the tracker.
Done when: every Dependency Rule violation is a tracked row with a fix, at least the highest-risk vendor is wrapped, business-rule tests run with no framework, and tests are green.
Purpose: Set the meta-principles that keep the codebase changeable after this journey ends.
Brief (fallback): DRY is about knowledge, not text — de-duplicate the same rule in two places
(validation on client and server), leave coincidental look-alikes alone. Orthogonality: changing one
component shouldn't affect another. Broken Window Theory: fix hacks immediately or board them up with
a tracked ticket — never an untracked // TODO. Reversibility: wrap third-party vendors behind your
own interfaces. Tracer bullets: build the next feature as one thin real end-to-end slice, not layer
by layer.
Invoke: Use the pragmatic-programmer skill across the codebase. Ask it to flag duplicated knowledge (ignoring coincidental duplication) and any broken windows or untracked TODOs that need boarding up.
Decide with the user: The debt budget per iteration and the broken-windows policy — what gets fixed now versus ticketed.
Artifact: Extend docs/TECH-DEBT.md: record duplicated-knowledge and broken-window items in ## Debt Ledger, and the agreed policy under ## Debt Budget & Broken-Windows Policy and ## Adopted Conventions. Update the tracker.
Done when: duplicated-knowledge hits are ledgered or fixed, no untracked hacks remain, and the debt-budget policy is written down.
Purpose: Harden every integration point so a slow or failing dependency degrades gracefully instead of taking the whole app down.
Brief (fallback): The software that passes QA is not what survives production. Integration points are the number-one killer — a slow response is worse than none. Non-negotiables: connect + read timeouts on every outbound call; a Circuit Breaker on failing dependencies (trips open, fails fast, half-open recovery); Bulkheads to isolate resource pools; Retry with exponential backoff + jitter; Steady State cleanup of accumulating cruft. Decouple deploy from release with feature flags and expand-contract migrations. Add deep health checks, RED metrics, symptom-based alerts.
Invoke: Use the release-it skill with the outbound dependencies from intake. Ask for an audit of calls with no timeout, circuit-breaker + bulkhead placement, and a deep health check + RED metrics + alert design.
Decide with the user: Breaker thresholds, which dependencies get dedicated pools, and the alert symptoms and thresholds (error rate, latency).
Artifact: Create docs/RELIABILITY.md with ## Integration-Point Audit (dependency | timeout | circuit breaker | bulkhead | retry policy | status), ## Health Checks & Metrics, and ## Deploy vs Release. Update the tracker.
Done when: every outbound call has a timeout, critical dependencies have breakers and bulkheads, a deep health check + RED metrics + symptom alerts exist, steady-state cleanup is scheduled for accumulating cruft, a release can be rolled back without a redeploy, and the audit table has no open rows for critical paths.
Purpose: Scale deliberately from requirements and numbers, not reactively — add machinery only when estimates justify it.
Brief (fallback): Start with requirements, not solutions. Back-of-envelope: QPS =
daily-active-users × actions/day ÷ 86,400, peak 2-5× average; storage = records/day × size ×
retention. Scale in order: vertical first, then cache (cache-aside with a TTL and explicit
invalidation) for read-heavy paths, then read replicas, and shard only as a last resort. Use a
message queue to decouple slow work from the request path. Reach for known designs (rate limiter →
token bucket returning 429 Retry-After).
Invoke: Use the system-design skill with the load reality from intake. Ask for average and peak QPS, yearly storage, which component bottlenecks first, and a priority-ordered list of cache / queue / replica moves without over-engineering.
Decide with the user: Which scaling moves to make now versus defer, tied to the actual numbers (don't build for 50k users while at 50), and name the first slow workload to move behind a message queue, if any.
Artifact: Extend docs/ARCHITECTURE.md ## System Context with the load reality and back-of-envelope numbers; extend docs/RELIABILITY.md ## Query & Resource Findings with unbounded queries and bottlenecks. Update the tracker.
Done when: the QPS and storage numbers are recorded, the first bottleneck is named, and each scaling move is either applied or deferred with the triggering number written down.
Purpose: Protect the data that outlives the code — correctness under concurrency, and datastore choices made by requirement, not habit.
Brief (fallback): Data outlives code. Most databases default to read-committed or snapshot, not
serializable — naive read-then-write triggers write skew (two requests both selling the last item).
Fix explicitly with SELECT ... FOR UPDATE or a serializable transaction; know your actual default.
Replication lag means read-your-writes and monotonic-reads must be deliberate once replicas exist.
Match data model to access pattern; polyglot persistence is often correct; separate system-of-record
from derived data (CDC / event sourcing) rather than dual writes.
Invoke: Use the ddia-systems skill with the database from intake and the replica plan from Phase 8. Ask it to find write-skew-prone read-then-write paths, state the actual default isolation level and its anomalies, and fix the risky paths.
Decide with the user: Which paths need locking versus a serializable transaction, and whether a new workload (search, feed) justifies a second datastore kept in sync by CDC.
Artifact: Extend docs/ARCHITECTURE.md ## Data & Storage Decisions with the isolation level, locked paths, and any polyglot / derived-data choices; log the reasoning in ## Decision Log. Update the tracker.
Done when: the default isolation level is documented, every write-skew-prone path is locked or made serializable, and any new datastore has a defined sync mechanism.
| Skill | Add when | Artifact |
|---|---|---|
| domain-driven-design | Business logic tangles because the code speaks no domain language | Extends docs/ARCHITECTURE.md (## Bounded Contexts & Context Map, ## Domain Glossary (Ubiquitous Language)) |
Optional phases follow the same operating rules — load and use each listed skill exactly as a core phase would; insert where the Add-when condition first becomes true — here, right after Phase 5 once the boundary exists.
| Mistake | Fix |
|---|---|
| Cleaning up before writing a single test | Pin behavior with characterization tests in Phase 1 (working-with-legacy-code) first; the safety net gates every later phase. |
| Letting the agent "modularize" into a swarm of tiny classes | Apply software-design-philosophy's deep-module rule — merge shallow classes that travel together; reduce interfaces, don't multiply them. |
| Calling external APIs with no timeout | In Phase 7 (release-it) add connect + read timeouts on every outbound call, plus a circuit breaker on critical dependencies. |
| Scaling before sizing anything | Do back-of-envelope estimation first (system-design); the numbers usually say a cache and a read replica are years of runway. |
| Mistaking microservices for architecture | Apply the Dependency Rule inside the service first (clean-architecture); services sharing one data model are a distributed monolith. |
| Assuming the database is serializable | Check the actual default isolation level and lock read-then-write paths (ddia-systems) — write skew passes every single-user test. |
Ship in order, not all at once: Phases 1-3 (net, readability, refactoring) belong before real users arrive; the Phase 5 boundary pays off most before the codebase doubles again; harden Phase 7 before launch (timeouts and a breaker are not optional even at low traffic); let Phases 8-9 track your actual growth numbers.
Exit checklist — every box tied to an artifact:
Close the tracker: every phase done or skipped: reason, with remaining Next Actions carried into the TECH-DEBT.md Debt Ledger so nothing is lost. Then route forward: when the codebase is old and large rather than young and messy, continue with the remove-technical-debt skill; when the next system deserves deliberate structure from day one, continue with the design-code-architecture skill.
© 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 1 other file (references) in improve-code-quality of wondelai/skills.
Open the folder on GitHubat commit c172996
Improve Code Quality 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 |
|---|---|---|---|---|---|---|
| Improve Code Quality this skillwondelai/skills | 2.4k | — | ~6.2k | Automated safety check: Pass | MIT | |
| Code Refactoring Workflowluongnv89/claude-howto | 42k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Fowler-Style Refactoringlhfer/claude-howto-zh-cn | 2.3k | — | ~156 | Automated safety check: Pass | MIT | |
| Refactoring Skill (Vietnamese)luongnv89/claude-howto | 42k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Systematic Code Refactoringluongnv89/claude-howto | 42k | — | ~3k | Automated safety check: Pass | MIT | |
| Tech Debt Analyzerailabs-393/ai-labs-claude-skills | 454 | 2 repos | ~3.9k | Automated safety check: Pass | MIT |
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.
lhfer/claude-howto-zh-cn
基于 Martin Fowler 方法论做系统化重构。Use when users ask to refactor code, improve structure, reduce technical debt, clean up legacy code, or improve maintainability.
luongnv89/claude-howto
Vietnamese edition of a systematic refactoring skill based on Martin Fowler's book, working in approved phases with small, test-backed changes.
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.
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.
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
Guided journey from a working-but-untested vibe-coded prototype to a production-ready product with tests, clean structure, a business-rules boundary, and resilience at scale. Improve Code Quality is an agent skill from wondelai/skills. Guided journey from a working-but-untested vibe-coded prototype to a production-ready product with tests, clean structure, a business-rules boundary, and resilience at scale.
Improve Code Quality fits situations like: the user wants to harden an AI-generated prototype; add tests before refactoring; make code safe to change; says this works on my machine but I am scared to touch it.
Run `npx skills add wondelai/skills --skill improve-code-quality -a claude-code`. Or copy the skill folder (improve-code-quality in wondelai/skills) into .claude/skills/improve-code-quality in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wondelai/skills --skill improve-code-quality -a codex`. Or copy the skill folder (improve-code-quality in wondelai/skills) into .agents/skills/improve-code-quality 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 improve-code-quality -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/improve-code-quality, .gemini/skills/improve-code-quality, .github/skills/improve-code-quality and .opencode/skills/improve-code-quality in your project.
Going by SKILL.md and its folder, Improve Code Quality needs the command-line tools its instructions call (npx and git). Our summary lists: Node.js.
SKILL.md contains no URLs. Its commands use npx and git, which can reach the network depending on how they are called. 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.
Improve Code Quality is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 6.2k tokens (SKILL.md is roughly 25k 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 833 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Improve Code Quality: Code Refactoring Workflow (luongnv89/claude-howto, 42k stars), Fowler-Style Refactoring (lhfer/claude-howto-zh-cn, 2.3k stars), Refactoring Skill (Vietnamese) (luongnv89/claude-howto, 42k stars) and Systematic Code Refactoring (luongnv89/claude-howto, 42k 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,350 GitHub stars. The repository holds 62 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.