Skip to main content

refactor-large-codebase

Safely change code at scale without altering behavior. Use for large renames, extracting modules, breaking up god classes, migrating frameworks/APIs, or paying down structural debt across many files.

v1.0.0New
0

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiCryptographically signed by the skills-hub.ai distributor key at publish time.
Signed

Install this skill

Run this command in your terminal. No account required — it auto-detects your AI tool and installs the skill file.

npx @skills-hub-ai/cli install refactor-large-codebase
Or download directly:
Browse all CLI commands →

Setup by platform

Claude Code

~/.claude/skills/<skill>/SKILL.md

Setup guide →

Cursor

~/.cursor/skills/<skill>/SKILL.md

Setup guide →

Windsurf

~/.windsurf/skills/<skill>/SKILL.md, or add to .windsurfrules in your project

Setup guide →

GitHub Copilot

.github/copilot-instructions.md (project-level), paste skill content into instructions

Setup guide →

Cline

~/.cline/skills/<skill>/SKILL.md, or add to .clinerules in your project

Setup guide →

Codex CLI

~/.codex/skills/<skill>/SKILL.md, or reference via codex.md instructions file

Setup guide →

Gemini CLI

GEMINI.md (project-level) or ~/.gemini/skills/<skill>/SKILL.md

Setup guide →

Install

One-click setup for your editor

Run in your project root

npx @skills-hub-ai/cli install refactor-large-codebase --target claude-code

Examples

Prompt

Refactor the monolithic User class into separate Profile and Authentication classes without changing behavior.

Output

GOAL: Separate User class into Profile and Authentication classes, preserving existing behavior.
INVARIANTS: External interfaces and data flow remain unchanged.
SAFETY NET: Existing unit tests on User class; add characterization tests for key methods.
PLAN: 
1. Run all tests to establish baseline.
2. Add characterization tests for User methods.
3. Extract Profile responsibilities into a new class; update User to delegate.
4. Extract Authentication responsibilities into another class; update User accordingly.
5. Run tests after each extraction.
6. Remove original code if no longer used.
ROLLBACK: Revert to previous commit if tests fail or behavior changes.

Test status: All tests pass after each step, confirming behavior preservation.

Prompt

Rename all instances of 'calculateTotal' to 'computeTotal' across the codebase, ensuring no behavior change.

Output

GOAL: Rename 'calculateTotal' to 'computeTotal' throughout the codebase without affecting behavior.
INVARIANTS: Functionality and external outputs must remain the same.
SAFETY NET: Existing unit tests on functions calling 'calculateTotal'; add characterization tests if coverage is insufficient.
PLAN:
1. Run all tests.
2. Use an AST-based tool to rename 'calculateTotal' to 'computeTotal' in all files.
3. Run tests to verify no regressions.
4. Review changes for unintended side effects.
ROLLBACK: Revert the refactor commit if tests fail or behavior differs.

Test status: Tests pass successfully, confirming safe rename.

Instructions

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Frequently asked questions about refactor-large-codebase

What does the refactor-large-codebase skill do?

Safely change code at scale without altering behavior. Use for large renames, extracting modules, breaking up god classes, migrating frameworks/APIs, or paying down structural debt across many files. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the refactor-large-codebase skill?

Run `npx @skills-hub-ai/cli install refactor-large-codebase` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/refactor-large-codebase/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does refactor-large-codebase work with?

refactor-large-codebase runs in Claude Code, Cursor, Windsurf, GitHub Copilot, Cline, Codex CLI, Gemini CLI. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the refactor-large-codebase skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use refactor-large-codebase after installing it?

In Claude Code, type `/refactor-large-codebase` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the refactor-large-codebase skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.