Paying down technical debt. Now. Automatically.
π continuous-refactoring.de
A portable agent-skill suite for coding agents β Claude Code,
Cursor, OpenCode β that keeps a software project under continuous refactoring. /continuous-refactoring keeps it
going: one round after another, each a run, its review and any rework, with a pause between them, and it merges nothing
unless you say so. A run, which /continuous-refactoring-run calls alone, leads from the project's open refactoring
tickets to one opened merge request.
flowchart TD
Reconcile --> Track[Choose a Track]
Track --> Scan
Scan --> File[File tickets]
File --> Select[Select a ticket]
Select --> Design
Design --> Implement
Implement --> MR[Merge request]
Every link of that chain is a decision point: the suite shows what it found, the options, and the one it recommends. A run called alone asks you each time, unless the call says it should do the run itself. The Driver's runs always do: they take their own recommendation at every point.
The suite keeps no state of its own. Your open tickets are the worklist; merge requests, declined work and the standing Housekeeping ticket are found by searching your tracker and your forge on every run. What you change there by hand is simply what the next run finds.
The core is language-neutral, with tools delivered in Packs. A generic Pack applies to every project; the first language Pack is a general PHP project (code style, Rector, PHPStan, PHPMD and more, with the diagram of what comes after what), grounded in over 20 years of PHP experience and kept up to date with current best practice; a Twig Pack adds the templates of a PHP project that uses Twig, and a JavaScript Pack lints a project's own JavaScript with ESLint, beside its PHP. Tools you already run β Psalm instead of PHPStan, Laravel Pint instead of PHP CS Fixer β are recognised and not replaced, and a tool the suite does not know joins through a Pack of your own. The tooling overview lists every Role, Tool and Pack.
A run spends itself on one of four Tracks. The suite sorts your open tickets into them and recommends the first one, in this fixed order, that has something to work on:
| Track | What it does | Recommended when |
|---|---|---|
| Safety Net | Sets up the deterministic checks (test runner, coding standards, static analysis, CI, and a backward-compatibility check where your project promises SemVer) that catch a regression before an agent's own judgement has to | one of its tickets can be worked, or none can and one of its tools was never dealt with |
| Guardrails | Adds further quality and security tooling once the Safety Net is in place (coverage floor, mess detection, stricter static analysis, β¦) β a few tools, such as security scanners, only when you ask for them β and takes in a large rule set β a code style, PHPMD β rule by rule, in merge requests a person can review | the same, once Safety Net is fulfilled |
| Housekeeping | Recurring maintenance β dependency currency, tooling-deprecation cleanup, a secret scan over the Git history β plus the small refactoring ideas left as comments on its ticket | its open ticket is due, or it is not set up yet |
| Investigation | Structural refactoring: works the tickets that ask for one, or explores the code for hot spots and deepening opportunities and proposes tickets | nothing above has work |
Each of the two tooling Tracks is scanned once. From then on its tickets are the record: a tool without an open ticket counts as done, and a recurring Housekeeping task re-checks whether a tool went missing. Before a ticket is worked the suite checks again whether the work is still needed β a tool you set up by hand closes its ticket instead of being set up twice.
While a run is going, the suite tells you what it is doing: a sentence before and after every step, and one line for every change to your tracker, your forge or your repository. Details: Run playbook, Track playbook, Architecture.
| Skill | Purpose |
|---|---|
continuous-refactoring |
The Driver: one round after another, each a run, its review and any rework, with a cadence between them, until an end |
continuous-refactoring-run |
One run, from the open tickets to an opened merge request |
continuous-housekeeping |
One Housekeeping run and nothing else β no Track choice, so it can be put on a schedule |
You or a schedule start the Driver; an agent calls continuous-refactoring-run or continuous-housekeeping. The
Driver playbook has its settings and what waits for you.
Everything else β choosing a Track, scanning, selecting, planning, implementing, onboarding β is reference material these load when a run reaches it. Where your project has its own skills for planning and implementing, the suite recommends those and uses its own procedures only as a fallback.
With the skills installer (Node.js 22.20 or newer), run in the target:
npx skills@latest add https://github.com/Art4/continuous-refactoring/tree/0.12.0/skills --skill '*' -a <agent><agent> is your agent, such as opencode, claude-code or codex; repeat -a for several, or leave it out
to choose interactively. Add -g to install for your user instead of one project. Only the three skills are
installed, nothing else of this repository, and the version in the URL is recorded in skills-lock.json.
Always install all three: continuous-refactoring and continuous-housekeeping read files of
continuous-refactoring-run, which must sit beside them in the same skills folder.
Without Node.js, or to work on the suite itself: clone this repository, check out a release tag
(git checkout 0.12.0), and put three symlinks side by side in the target's skills folder:
mkdir -p <target>/.agents/skills
ln -s /path/to/continuous-refactoring/skills/continuous-refactoring <target>/.agents/skills/
ln -s /path/to/continuous-refactoring/skills/continuous-refactoring-run <target>/.agents/skills/
ln -s /path/to/continuous-refactoring/skills/continuous-housekeeping <target>/.agents/skills/Or copy the three folders. To make the suite available everywhere, link all three into your agent's global
skills folder (e.g. ~/.config/opencode/skills/) the same way.
Works with other skills, needs none. The suite is compatible with engineering skills such as mattpocock/skills (see aihero.dev): where a project has skills for planning or implementing, a run offers to use them. Without any, the first
/continuous-refactoring-runwrites the issue-tracker file itself, and plans and implements its own way.
Any issue tracker works that your tracker file describes: docs/agents/issue-tracker.md, or the file your AGENTS.md names in its place. GitHub, GitLab and local Markdown files come with a ready-made template. For another one β Redmine, Jira β onboarding asks how the suite's few operations work there (how tickets are searched, how a finished one is recognised) and writes the answers into that file. Tickets and merge requests may live in different systems: the tracker is whatever that file describes, merge requests live where the Git remote points.
- Call
/continuous-refactoring. On a project the suite has not seen, it first asks where your tickets live and how the operations work there, and writes that as one section into your tracker file (docs/agents/issue-tracker.mdunless yourAGENTS.mdnames another) β commit that file. The run ends there; commit, then call it again. - Answer the onboarding. Each question comes with a recommendation, so "yes" moves on.
- Let it work. The next call starts the Driver: by itself it works up to five rounds, 30 minutes apart, reviews each merge request and merges none of them. Say otherwise in the call ("merge", "ten rounds", "no pause"). For one run alone,
/continuous-refactoring-runasks at every decision;/continuous-refactoring-run do it yourselftakes one ticket from selection to an opened merge request. - Steer it in the call, in your own words: a Track ("work on Guardrails"), a restriction ("only the Rector tools"), or, for one run alone, a ticket ("ticket 42") or a Pack of your own for a tool the suite does not know ("a Pack of its own for Deptrac").
- Review and merge what the suite opens. The Driver stops once more than three of its merge requests are open; a run alone has no such limit. A merge request that conflicts after another one merged is brought up to date by the suite itself. A merge request is a draft while the suite still works on it; make one a draft yourself and the suite leaves it alone.
- Housekeeping:
/continuous-housekeepingsets its mechanism up on the first call and works the due ticket afterwards. The suite schedules nothing itself β point your own scheduler (/schedule,/loop, cron) at any of the commands.
Read the new version's entries in the CHANGELOG first: they name the steps a breaking change
needs in your project β coming from 0.6.0 or earlier, read the 0.7.0 entry first. Then run the npx skills add
command again with the new version in the URL; --skill '*' also brings a skill the new version adds.
With a checkout, fetch and check out the new tag (git fetch --tags && git checkout X.Y.Z); the symlinks follow
it, and a new skill needs a symlink of its own: continuous-refactoring-run is one.
Everything is in your project, your tracker and your forge β nothing in the conversation, nothing in files of the suite.
- Work to do: open tickets on your tracker
- Work in review: open merge requests on your forge, found from their tickets
- Declined work: a closed ticket or a file with the reason, in the place your tracker section names under Rejected
- Recurring maintenance: the Housekeeping template, a file in your repository, and the one open Housekeeping ticket made from it
- How the tracker is reached: the
## Refactoring operationssection of your tracker file, including the optional bullets β a Candidate mark, Ready after plan, Rejected - Tools of your own: a Pack in your repository, named under Tooling Pack in that section
- Focus areas and refactoring goal: two lines you add to
AGENTS.md(orCLAUDE.md), any time - Domain language and decisions: your own glossary and ADR directory, where your project keeps them
| Doc | For |
|---|---|
| Driver playbook | Letting the suite go on by itself β its settings, what waits for you, how it ends |
| Run playbook | Steering a run as a human β the call, the decision points, how a run ends |
| Track playbook | How the four Tracks are chosen, scanned and worked |
| Own-tool playbook | Adding a tool the suite does not know, as a Pack of your own |
| Housekeeping playbook | The maintenance Track β template, standing ticket, rhythm |
| Tooling | Every Role, Tool and Pack the suite knows, with a diagram per Pack |
| Architecture | The three skills, their references, the tooling tree |
| FAQ | Why the suite is designed the way it is |
| Known limitations | Limits without a suite-side fix, plus troubleshooting |
| Operations reference | The operations the suite needs from a tracker |
| Tracker file templates | The section as written for GitHub, GitLab and Local Markdown, and the bullets a target chooses |
| glossary | The suite's vocabulary, shipped with the skills |
Bug reports, feature requests, and pull requests are welcome β see CONTRIBUTING.md.
MIT β see LICENSE.
Built by Artur Weigandt β PHP refactoring, freelance.