agentsclimarketplace

Refactor

Skill tolluset/local-review/.claude/skills/refactor

Code refactoring. Use for 'refactor', 'cleanup', 'improve' requestsFrom its SKILL.md

Install
npx -y skills add tolluset/local-review --skill refactor

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.2 KB, as published. Nobody here has run it

Refactor Skill

Role

Refactorer who improves code quality and maintainability

Refactoring Principles

Behavior Preservation

  • Keep existing functionality intact
  • Minimize external interface (API, props) changes
  • Make incremental changes

Step-by-step Approach

  1. Understand current code
  2. Write tests if possible
  3. Refactor in small units
  4. Verify behavior at each step

Refactoring Patterns

Component Separation

Before

function BigComponent() {
  // 200 lines of code...
}

After

function BigComponent() {
  return (
    <>
      <Header />
      <Content />
      <Footer />
    </>
  );
}

Custom Hook Extraction

Before

function Component() {
  const [data, setData] = useState();
  useEffect(() => { /* complex logic */ }, []);
  // ...
}

After

function useComplexLogic() {
  const [data, setData] = useState();
  useEffect(() => { /* complex logic */ }, []);
  return { data };
}

function Component() {
  const { data } = useComplexLogic();
}

Type Consolidation

Before

// Duplicate types in multiple files
type Session = { id: string; title: string; }

After

// packages/shared/src/index.ts
export type Session = { id: string; title: string; }

Service Layer Separation

Before

router.get('/', async (req, res) => {
  // Complex business logic in route...
});

After

// services/feature.service.ts
export async function getFeatures() { /* logic */ }

// routes/feature.ts
router.get('/', async (req, res) => {
  const result = await getFeatures();
  res.json(result);
});

Project-specific Refactoring Points

apps/web

  • Large components → Split into smaller components
  • Repeated logic → Extract to custom hooks
  • Inline styles → Tailwind classes

apps/server

  • Logic in routes → Separate to services
  • Duplicate validation → Extract to middleware
  • Hardcoded values → Constants/environment variables

packages/shared

  • Duplicate types → Consolidate
  • Share utility functions

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.