원클릭으로
source-command-tech-dupes
// Code duplication analysis for StarMapper using jscpd. Detects repeated patterns across geocoding helpers, GitHub API formatting, compression utils, and cache logic.
// Code duplication analysis for StarMapper using jscpd. Detects repeated patterns across geocoding helpers, GitHub API formatting, compression utils, and cache logic.
| name | source-command-tech-dupes |
| description | Code duplication analysis for StarMapper using jscpd. Detects repeated patterns across geocoding helpers, GitHub API formatting, compression utils, and cache logic. |
Use this skill when the user asks to run the migrated source command tech-dupes.
/tech:dupes
pnpm dupes (jscpd) on the src/ directoryIf pnpm dupes is not configured, add to package.json:
"dupes": "jscpd src/ --threshold 3 --min-lines 5 --reporters console,json --output .dupes-report"
And install: pnpm add -D jscpd
| Pattern | Location | Risk |
|---|---|---|
location.toLowerCase().trim() | geocoder, routes | Should exist ONLY in geocoder.ts |
| GitHub error parsing | github.ts, chunk/route.ts | Extract to github.ts |
| Compression/decompression logic | page.tsx, cache routes | Extract to lib/compression.ts |
checkDbHealth() call pattern | user-cache, cache routes | OK if identical — it's a guard |
NextResponse.json({ error: ... }) patterns | all routes | Accept duplication here |
cursor ? { cursor } : {} | github.ts | Should only be in github.ts |
| Metric | Target | Action |
|---|---|---|
| Duplication % | < 3% | Above → refactor |
| Clone count | < 10 | Above → prioritize |
| Max clone size | < 25 lines | Above → extract function |
## Duplication Report — StarMapper
**Date**: {date}
**Duplication**: X% ({target: < 3%})
**Clones found**: N
### Top Clones
1. [file:line] ↔ [file:line] — {N} lines
Pattern: {brief description}
Action: {extract to / delete duplicate}
### Action Plan
#### Quick Wins (< 30min)
1. ...
#### Refactoring (1-2h)
2. ...
#### Prevention
- Add `pnpm dupes` to CI check
| Production-tested setup for Tailwind CSS v4 with shadcn/ui, Vite, and React. Use when: initializing React projects with Tailwind v4, setting up shadcn/ui, implementing dark mode, debugging CSS variable issues, fixing theme switching, migrating from Tailwind v3, or encountering color/theming problems. Covers: @theme inline pattern, CSS variable architecture, dark mode with ThemeProvider, component composition, vite.config setup, common v4 gotchas, and production-tested patterns.
Conventional commit with StarMapper scope auto-detection
7-category codebase health audit for StarMapper with weighted scoring and tier system. Run before major releases or architectural changes.
Pre-PR code review for StarMapper. Analyzes recent changes for quality, security, performance, and StarMapper-specific patterns. Supports auto-fix loop and multi-agent modes.
Add a StarMapper badge (world map of stargazers) to the current repo's README. Detects OWNER/REPO from git remote and inserts the HTML block in the right place.
Recherche et debug dans les logs Vercel (production/preview). Supporte la recherche par pattern, filtre par niveau d'erreur, par route API, par déploiement. Utiliser pour diagnostiquer des erreurs de production, tracer des requêtes ou analyser des crashs.