- Home
- Skills
- Code Quality & Review
- Global Codebase Refactor
Works with the AI Agents you already use
Global Codebase Refactor
Makes one change across your whole codebase: maps it, plans every file, runs the app and tests before and after, fixes only what it broke, and reports file by file
$5
/moSubscription · cancel anytime
Secure checkout via Stripe
- Always the latest version
- Delivered live to your agent via MCP
- Cancel anytime, access ends at period end
Global Codebase Refactor
Example session with this skill installed
Rename getUserName to getDisplayName everywhere in the codebase - code, tests and docs. The plan is approved in advance, go ahead and make the change.
- Read your context and instructions
- Compiled the global codebase refactor
I've renamed getUserName to getDisplayName everywhere: 5 files, 10 occurrences. The app's output is the same as before and all 4 tests still pass. One thing you should know first: npm test was already broken before I touched anything, and it is still broken. Details are at the end.
Codebase map
Stack: Node.js 24, ES modules ("type": "module"), no dependencies. The tests use the built-in node:test runner.
- Scripts:
startrunsnode src/index.js;testrunsnode --test test/. - Layout: 8 files.
src/index.js(entry point)src/users/user.js(where the function is defined)src/notes/feed.jsandsrc/notes/note.js(the two places it's used)test/user.test.jsandtest/feed.test.jsREADME.mdandpackage.json
- Conventions: named exports, relative imports with the
.jsextension, camelCase function names.
Blast radius
I searched the whole project for getUserName, and also for related spellings (user_name, username, any case). The name only appears as a plain identifier:
- No re-exports, no dynamic or string-based lookups, no aliases.
- Nothing like
getUserNamesthat could be caught by mistake. getDisplayNamedidn't exist anywhere yet, so the new name can't clash with anything.
The project is small enough to handle in one pass, so I didn't split it up.
Plan vs. actual
| # | File | Planned change | Done |
|---|---|---|---|
| 1 | src/users/user.js | Rename the exported function (line 1) | Yes |
| 2 | src/notes/feed.js | Update the import (line 1) and the call (line 7) | Yes |
| 3 | src/notes/note.js | Update the import (line 1) and the call (line 4) | Yes |
| 4 | test/user.test.js | Update the import (line 3) and the 3 assertions (lines 5-7) | Yes |
| 5 | README.md | Update the docs reference (line 3) | Yes |
Nothing else changed
src/index.jsandtest/feed.test.jsnever referenced the function directly, so I left them alone.- I didn't edit
package.json. - The function's behaviour and the test descriptions are the same as before.
A search after the change finds 0 remaining getUserName and 10 getDisplayName, which matches the 10 original occurrences.
Baseline vs. final
| Check | Before | After |
|---|---|---|
npm start | Prints 3 lines (Engines - by Ada Lovelace, Compilers - by grace, Draft - by Guest), exit 0 | Same 3 lines, exit 0 |
npm test | Fails before any test runs (see below), exit 1 | Same failure, exit 1 |
Tests run directly: node --test test/feed.test.js test/user.test.js | 4 of 4 pass | 4 of 4 pass |
No new failures, so there were no regressions to fix.
Caveat: npm test is broken, and it isn't caused by this change
On Node 24, node --test test/ treats test/ as a module path, so it stops with Cannot find module '...\notes-app\test' before any test runs. That's why I checked the tests by naming the files directly.
I left the script as it was because it was failing before I started and it's outside this rename. The one-line fix is to change the script to node --test "test/**/*.test.js" (or node --test with no path). Want me to make that change?
Subscription · always the latest version
- Secure checkout via Stripe
- Cancel anytime
- Delivered live via MCP
About this skill
For changes that touch more than one file: renaming something everywhere, deleting a feature end to end, adding attributes across every component, migrating a convention. It treats the change as a project rather than a find-and-replace. It reads the stack and maps the codebase, measures the blast radius, writes a file-level plan, and runs the app and the test suite to get a baseline before it edits anything.
What it does
It applies the change section by section, then runs the app and the tests again and compares them with the baseline. Anything that passed before and fails now is a regression, and it fixes only those. Failures that were there before are reported, not quietly "fixed". It ends with a plan-versus-actual table, every file changed, the before-and-after results of the run, and anything it found along the way that is outside the change.
Try it first
In a repo with tests, say "rename getUserName to getDisplayName everywhere, code, tests and docs". Check that the report shows a baseline run before the edit and the same result after.
What it needs
Read and write access to the repo, and Bash to run your build, dev script and tests. Node, Python, Rust or whatever your project uses, as long as there's a command to run it. No network access is needed beyond what your own build needs.
It needs a runnable project: without a build or test command it can only check the change by reading the code, and it says so. It fixes regressions it caused, not pre-existing failures, which it reports and leaves for you to decide on. Very large codebases are split into sections of up to 30 files, so a sweeping change takes several passes. Changes that need a database migration or deployment work are planned and flagged, not run.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 27 days ago