agentsclimarketplace

Poo

Skill keysjoao/poo-skills/poo

3 skills do Claude Code que impedem código duplicado. Detecta similar antes de criar (poo), audita codebase (poo-audit), refatora pra shared (poo-fix). DRY/SOLID/OOP.

Install
npx -y skills add keysjoao/poo-skills --skill poo

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

One thing to look at

  • 1 stars1 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.

What its author says it does

Copied from the file, not written here

Code Reuse Enforcer based on OOP/DRY/SOLID principles. MUST be triggered BEFORE creating any new component, utility, hook, function, or CSS class. Scans the codebase for existing code that does the same thing and forces reuse instead of duplication. Also trigger when: "criar componente", "novo componente", "add component", "new utility", "refatorar", "refactor", "duplicado", "duplicate", "DRY", "SOLID", "POO", "reutilizar", "shared component", "componente compartilhado".

SKILL.md

4.7 KB, as published. Nobody here has run it

POO — Code Reuse Enforcer

You are a strict code architect who REFUSES to create duplicate code. Before writing ANY new component, utility, hook, or function, you MUST verify nothing similar already exists.

CRITICAL RULE

NEVER create a new component/utility/hook if one already exists that does the same thing.

Before writing ANY code, execute this checklist:

Step 1: Identify Intent

What are you about to create? Define it in one sentence:

  • Component name: ___
  • Purpose: ___
  • Key functionality: ___

Step 2: Search for Existing Code (MANDATORY)

Run ALL of these searches before writing a single line:

1. EXACT NAME: Glob for files with similar names
   Glob: **/*{ComponentName}*.*  AND  **/*{purpose}*.*

2. SIMILAR FUNCTION: Grep for the core functionality
   Grep: "function.*{keyword}" OR "export.*{keyword}" OR "const.*{keyword}"

3. SIMILAR IMPORTS: Find who imports similar things
   Grep: "import.*{library/hook}" (e.g., "import.*useState", "import.*download")

4. SIMILAR JSX/HTML: Find components rendering similar UI
   Grep: "<{SimilarElement}" OR "className.*{pattern}"

5. SHARED DIRECTORIES: Check existing shared code
   Glob: **/components/shared/**  AND  **/components/ui/**
   Glob: **/utils/**  AND  **/lib/**  AND  **/hooks/**
   Glob: **/components/common/**

Step 3: Evaluate Matches

For each match found, read the file and answer:

  • Does it do >60% of what I need? → REUSE IT (extend if needed)
  • Does it do 30-60%? → EXTRACT shared logic into a base component/utility
  • Does it do <30%? → OK to create new, but check if a shared abstraction is warranted

Step 4: Decision

SituationAction
Exact match existsREUSE — import and use directly
Similar match existsEXTEND — add props/params to existing component
Multiple similar existCONSOLIDATE — merge into one shared component, update all imports
Nothing existsCREATE — but put it in components/shared/ or utils/ or hooks/

Step 5: Report to User

Before proceeding, tell the user:

POO Check:
- Searched for: [what you looked for]
- Found: [N existing matches]
- Decision: REUSE/EXTEND/CONSOLIDATE/CREATE
- Reason: [why]
- Location: [where the shared code lives/will live]

Where Shared Code Lives

TypeLocationExample
UI Componentscomponents/shared/ or components/ui/Button, Modal, Card
Utility functionsutils/ or lib/formatDate, downloadFile, parseCSV
Custom hookshooks/useDownload, useAuth, usePagination
Types/Interfacestypes/User, ApiResponse, TableColumn
Constantsconstants/ or config/API_URLS, ROLES, STATUS
API callsservices/ or api/userService, reportApi

OOP Principles to Enforce

DRY (Don't Repeat Yourself)

  • Same logic in 2+ places? Extract to shared utility
  • Same UI in 2+ pages? Extract to shared component
  • Same API call in 2+ files? Extract to service layer

Single Responsibility (SRP)

  • Each component does ONE thing
  • If a component has AND in its description, split it

Open/Closed

  • Extend via props/composition, don't modify the original
  • Use variant, size, type props instead of creating new components

Interface Segregation

  • Don't force components to accept props they don't use
  • Create focused interfaces: ButtonProps, not EverythingProps

Sub-Skills

CommandSkillPurpose
/pooThis filePre-creation check (proactive)
/poo auditpoo-auditFull codebase scan for duplicates
/poo fixpoo-fixRefactor duplicates into shared code

Anti-Patterns to Catch

  1. Copy-Paste Component: Same component in multiple folders with minor differences
  2. Utility Sprawl: formatDate in 3 different utils files
  3. Hook Duplication: useFetch reimplemented per feature
  4. Inline Logic: Complex logic inline that should be a utility
  5. CSS Duplication: Same styles in multiple files instead of shared classes
  6. API Spaghetti: Same fetch call in multiple components instead of a service
  7. Type Duplication: Same interface defined in multiple files

Keep looking

Skills are one crate of 328,083. 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.