stark-refactor-plan

Inspect a repository and generate an evidence-based refactor plan and machine-readable backlog without modifying source code.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/21StarkCom/stark-skills --skill stark-refactor-plan-21starkcom
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stark-refactor-plan
Source: https://github.com/21StarkCom/stark-skills/tree/main/runtime-overrides/codex/skill/stark-refactor-plan
Command: npx skills add https://github.com/21StarkCom/stark-skills --skill stark-refactor-plan-21starkcom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Refactoring a codebase safely requires a deep, evidence-backed understanding of its structure, but manually auditing architecture, duplicates, dead code, and dependency direction is slow and error-prone. This Skill produces an implementation-ready refactor plan that another coding agent can execute step by step without re-discovering the codebase. ## Core Features & Use Cases - Planning-only safety guarantee: Reads and statically analyzes the repository but never modifies, moves, renames, or deletes source, tests, or config — safe to run on any repo at any time. - Two executable artifacts: Writes REFACTOR_PLAN.md (14-section human-readable plan) and REFACTOR_BACKLOG.json (machine-readable task DAG with dependencies, duplicates, and risky areas) at the repo root. - Evidence-based analysis: Every finding cites a real path, symbol, or command — covering architecture, circular dependencies, god modules, dead code, test gaps, and config sprawl. - Two execution modes: Inline analysis for small/medium repos, or a multi-agent dispatcher (tools/refactor_planner.ts) with dry-run preview, per-agent context packs, and backlog validation for large repos. - Use Case: Point it at a legacy monorepo before a restructuring effort; it inventories the tree, discovers the real test/build commands from manifests, and outputs a phased, file-by-file plan whose first recommended PR is small and low-risk. ## Quick Start Ask the agent to run stark-refactor-plan against the current repository to produce REFACTOR_PLAN.md and REFACTOR_BACKLOG.json without changing any source files.

Frequently Asked Questions about stark-refactor-plan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a refactoring plan for a large codebase?▼

Run the skill against the target repository root; it inventories the tree, discovers real validation commands from manifests, and analyzes architecture with cited evidence. For large repos, use the dispatcher mode, which fans out read-only subagents and assembles a DAG-valid backlog.

What artifacts does a codebase refactor analysis produce?▼

It writes two root-level files: REFACTOR_PLAN.md, a 14-section human-readable plan with a file-by-file execution table, and REFACTOR_BACKLOG.json, a machine-readable backlog of tasks, duplicates, and risky areas that another agent can execute.

Does the refactor planning tool modify my source code?▼

No. It operates in planning-only mode: it reads files and runs static read-only analysis but never modifies, moves, renames, or deletes source, tests, or config. A final verification phase compares git status against a baseline to confirm nothing changed.

Can I run refactor analysis on a repository in any programming language?▼

Yes. The default inline mode works on any language stack using directory listing, ripgrep searches, and manifest parsing. The multi-agent dispatcher mode is suited to large repos and supports claude or codex as the provider CLI.

Why does the skill refuse to run npm test or build commands automatically?▼

Project commands like npm test or make can execute arbitrary, attacker-controllable code through package scripts and build hooks on untrusted repos. The skill defaults to discovering commands from manifests and requires explicit user approval before executing any project command.

How is the refactor backlog JSON validated?▼

Beyond a JSON syntax check, the dispatcher's validate mode checks the schema, enums, unique sequential ids, depends_on DAG for cycles, and path existence. Validation reads REFACTOR_BACKLOG.json and writes nothing.