Install
$ agentstack add skill-keysjoao-poo-skills-poo-fix ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
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 →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:
- Read BOTH files completely
- 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
- 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
- Update ALL consumers:
- Replace duplicate imports with shared import
- Pass appropriate props/params
- Delete the old duplicate files
- 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
- Never break existing functionality — the refactored code must work identically
- Preserve all edge cases — if one version handles an edge case, the shared version must too
- Use TypeScript generics when the types differ between consumers
- Add JSDoc comments explaining props/params that exist to support specific consumers
- Run type check after —
npx tsc --noEmitto verify - 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.
- Author: keysjoao
- Source: keysjoao/poo-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.