code-refactor

Automate codebase refactoring to enforce modular CSS, TypeScript typings, and separation of concerns.

Updated Nov 9, 2025
One-click install
npx skills add https://github.com/canyouseeus/thelostandunfounds --skill code-refactor-canyouseeus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactor
Source: https://github.com/canyouseeus/thelostandunfounds/tree/main/.agent/skills/code-refactor
Command: npx skills add https://github.com/canyouseeus/thelostandunfounds --skill code-refactor-canyouseeus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes and cleans the codebase to reduce technical debt, improve modularity, and ensure alignment with Day 1 project standards across components, utilities, and workflows.

Core Features & Use Cases

  • Enforces modular CSS with no inline styles and centralized design tokens.
  • Guarantee type safety with TypeScript interfaces and shared types moved to src/types.
  • Enforces separation of concerns: UI in components, business logic in src/utils or src/lib, and API calls through centralized handlers.
  • Guides left-aligned content and robust error handling throughout refactors.

Quick Start

Follow the Day 1 refactor workflow to identify violations, propose a new structure, implement changes, and verify the result.

Frequently Asked Questions about code-refactor

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

FAQPage Schema
How do I refactor a TypeScript codebase to improve modularity and separation of concerns?

To refactor a TypeScript codebase for modularity, you enforce strict type safety by moving shared types to src/types, separate UI components from business logic in src/utils, and centralize API handlers. This structured plan iteratively cleans up technical debt while enforcing strict TypeScript interfaces.

What is the best way to remove inline styles and enforce modular CSS during a large-scale cleanup?

The best way to enforce modular CSS during a large-scale cleanup is to eliminate inline styles and centralize design tokens. This refactoring process standardizes the codebase to ensure alignment with Day 1 project standards across all frontend components and shared utilities.

Can I automate end-to-end codebase migrations to reduce technical debt across shared utilities?

Yes, you can automate end-to-end codebase migrations to reduce technical debt by applying a structured plan that iteratively executes changes across shared utilities. This enforces robust error handling and strict TypeScript typings throughout the repository-wide debt reduction.

Does this refactoring approach work for both frontend components and centralized API handlers?

Yes, this refactoring approach applies to both frontend components and centralized API handlers. It enforces separation of concerns by keeping UI in components, moving business logic to src/lib, and routing API calls through centralized handlers to guarantee type safety and robust error handling.

Why should I move shared TypeScript interfaces to a dedicated types directory when refactoring?

You should move shared TypeScript interfaces to a dedicated src/types directory to guarantee type safety and reduce technical debt. This refactoring step enforces strict TypeScript typings and standardizes shared types across the entire codebase during large-scale cleanups.

What are the limitations of enforcing Day 1 standards during a repository-wide refactor?

Enforcing Day 1 standards during a repository-wide refactor requires strict adherence to left-aligned content, modular CSS, and separation of concerns. The process demands iterative execution and may require significant restructuring of frontend components and shared utilities to verify results.