AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Poo Fix

skill-keysjoao-poo-skills-poo-fix · by keysjoao

>

— No reviews yet
0 installs
28 views
0.0% view→install

Install

$ agentstack add skill-keysjoao-poo-skills-poo-fix

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-keysjoao-poo-skills-poo-fix)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
○ 4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Poo Fix? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

POO Fix — Consolidate Duplicates

Refactors identified duplicate code into shared, reusable components following OOP/SOLID principles.

Input

Either:

  • Results from /poo audit (list of duplicate pairs)
  • User pointing at specific files ("esses dois componentes fazem a mesma coisa")
  • A file path to analyze

Workflow

Step 1: Analyze the Duplicates

For each duplicate pair:

  1. Read BOTH files completely
  2. Identify:
  • Shared logic (identical or near-identical code)
  • Differences (props, styling, edge cases)
  • Dependencies (what each imports)

Step 2: Design the Shared Abstraction

Choose the right pattern:

| Pattern | When to Use | Example | |---------|------------|---------| | Shared Component | Same UI, minor prop differences | ` | | **Composition** | Same structure, different content | | | **Custom Hook** | Same logic, different UI | useDownload() returns {download, loading, error} | | **Utility Function** | Same operation, no UI | formatCurrency(value, locale) | | **Base Class/Interface** | Same contract, different implementations | interface DataExporter { export(): void } | | **Higher-Order Component** | Same wrapper behavior | withAuth(Component) | | **Render Props / Slots** | Same logic, totally different UI | ...}/>` |

Step 3: Determine Location

1. Check if shared directory exists:
   Glob: **/components/shared/** OR **/components/ui/** OR **/components/common/**

2. If not, check project conventions:
   - Next.js: components/ at root or src/components/
   - React: src/components/shared/
   - Vue: src/components/common/

3. For utilities: utils/ or lib/
4. For hooks: hooks/ or composables/ (Vue)
5. For types: types/ or interfaces/

Step 4: Build the Shared Code

  1. Create the shared component/utility with ALL variants:
  • Use props/params to handle differences
  • Add TypeScript types for all variants
  • Export from a clean index file
  1. Update ALL consumers:
  • Replace duplicate imports with shared import
  • Pass appropriate props/params
  • Delete the old duplicate files
  1. Verify nothing breaks:
  • Check all imports resolve
  • Check TypeScript compiles
  • Run existing tests if available

Step 5: Report Changes

## POO Fix Report

### Created
- `components/shared/DownloadButton.tsx` — unified download button

### Updated (now using shared component)
- `pages/reports/index.tsx` — was: local DownloadBtn, now: shared DownloadButton
- `pages/exports/index.tsx` — was: local ExportDownload, now: shared DownloadButton

### Deleted (duplicates removed)
- `pages/reports/components/DownloadBtn.tsx`
- `pages/exports/components/ExportDownload.tsx`

### Props/Variants Added
- `variant`: "primary" | "secondary" | "icon-only"
- `format`: "csv" | "xlsx" | "pdf"

### Lines Saved: ~120 lines (2 files → 1 shared)

Refactoring Rules

  1. Never break existing functionality — the refactored code must work identically
  2. Preserve all edge cases — if one version handles an edge case, the shared version must too
  3. Use TypeScript generics when the types differ between consumers
  4. Add JSDoc comments explaining props/params that exist to support specific consumers
  5. Run type check after — npx tsc --noEmit to verify
  6. Update barrel exports — if the project uses index.ts re-exports

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.