npx claudepluginhub kylebrodeur/codebase-analysisCodebase analysis and refactoring skills for duplicate detection, dead code, and architecture validation
Claude Code skills and plugins for codebase analysis - detect duplication, find dead code, validate architecture, and guide refactoring.
This repository contains reusable Claude Code skills, skills.sh skills, and GitHub Copilot agents for codebase analysis and refactoring. Each skill helps identify issues and guides the refactoring process.
| Skill | Purpose |
|---|---|
| Duplicate Detection | Find copy-pasted code blocks using jscpd |
| Dead Code Analysis | Find unused exports, types, and dependencies using knip |
| Architecture Validation | Check import rules and circular dependencies using dependency-cruiser |
| Analysis Orchestrator | Run all tools and synthesize findings for refactoring |
This repository supports both Claude Code skills and skills.sh specification:
| Feature | Claude Code | skills.sh |
|---|---|---|
| Format | SKILL.md with YAML frontmatter | SKILL.md with YAML frontmatter |
| Location | .agent/skills/ | skills/ at project root |
| Non-standard fields | Supported (user-invokable, argument-hint) | Standard only (name, description, compatibility, metadata) |
Duplicate Code Detection:
Clone found (typescript):
- src/services/itemService.ts [42:1 - 55:3] (13 lines, 98 tokens)
src/services/orderService.ts [71:1 - 84:3]
Found 18 clones.
Dead Code Analysis:
Unused exports (3)
processItem function src/services/processor.ts:42:23
CONFIG const src/config/settings.ts:5:14
helperFn function src/utils/helpers.ts:18:17
npx skills add kylebrodeur/codebase-analysis
First add the marketplace:
claude plugin marketplace add kylebrodeur/codebase-analysis
Then install the plugin:
claude plugin install codebase-analysis@codebase-analysis
Or manually copy .agent/ folder to ~/.claude/plugins/ or your project's .claude/plugins/.
GitHub Copilot's plugin system is in pre-release. To use it:
gh extension install github/copilot-cli
copilot plugin install kylebrodeur/codebase-analysis
Alternatively, install as a skill using the skills.sh CLI:
npx skills add kylebrodeur/codebase-analysis
If neither option works, copy the agent file manually:
mkdir -p ../your-project/.github/agents
cp packages/analysis-agent/agents/codebase-analysis.md ../your-project/.github/agents/
cd ../your-project
bash .agent/scripts/setup.sh
pnpm install
npx skills add kylebrodeur/codebase-analysis
claude plugin install codebase-analysis@codebase-analysis
copilot plugin install kylebrodeur/codebase-analysis
Copilot plugins can be installed directly from the GitHub repo - no marketplace needed.
Copy .agent/ folder and run setup:
cp -r packages/analysis-agent/.agent ../your-project/
bash ../your-project/.agent/scripts/setup.sh
pnpm install
A simple CLI is available for common tasks:
npx codebase-analysis install # Run setup script
npx codebase-analysis check # Check config files
npx codebase-analysis help # Show all commands
After installation, use pnpm scripts:
pnpm analyze:all # Run all analyses
pnpm analyze:dead # Find dead code
pnpm analyze:dupes # Find duplicate code
pnpm analyze:deps:validate # Check architecture
This plugin supports a systematic refactoring process: