repository-analyzer
Analyzes codebases to generate comprehensive documentation including structure, languages, frameworks, dependencies, design patterns, and technical debt. Use when user says "analyze repository", "understand codebase", "document project", or when exploring unfamiliar code.
What this skill does
# Repository Analyzer
## Purpose
Quickly understand unfamiliar codebases by automatically scanning structure, detecting technologies, mapping dependencies, and generating comprehensive documentation.
**For SDAM users**: Creates external documentation of codebase structure you can reference later.
**For ADHD users**: Instant overview without manual exploration - saves hours of context-switching.
**For all users**: Onboard to new projects in minutes instead of days.
## Activation Triggers
- User says: "analyze repository", "understand codebase", "document project"
- Requests for: "what's in this repo", "how does this work", "codebase overview"
- New project onboarding scenarios
- Technical debt assessment requests
## Core Workflow
### 1. Scan Repository Structure
**Step 1: Get directory structure**
```bash
# Use filesystem tools to map structure
tree -L 3 -I 'node_modules|.git|dist|build'
```
**Step 2: Count files by type**
```bash
# Identify languages used
find . -type f -name "*.js" | wc -l
find . -type f -name "*.py" | wc -l
find . -type f -name "*.go" | wc -l
# etc...
```
**Step 3: Measure codebase size**
```bash
# Count lines of code
cloc . --exclude-dir=node_modules,.git,dist,build
```
### 2. Detect Technologies
**Languages**: JavaScript, TypeScript, Python, Go, Rust, Java, etc.
**Frameworks**:
- **Frontend**: React, Vue, Angular, Svelte
- **Backend**: Express, FastAPI, Django, Rails
- **Mobile**: React Native, Flutter
- **Desktop**: Electron, Tauri
**Detection methods**:
```javascript
const detectFramework = async () => {
// Check package.json
const packageJson = await readFile('package.json');
const dependencies = packageJson.dependencies || {};
if ('react' in dependencies) return 'React';
if ('vue' in dependencies) return 'Vue';
if ('express' in dependencies) return 'Express';
// Check requirements.txt
const requirements = await readFile('requirements.txt');
if (requirements.includes('fastapi')) return 'FastAPI';
if (requirements.includes('django')) return 'Django';
// Check go.mod
const goMod = await readFile('go.mod');
if (goMod.includes('gin-gonic')) return 'Gin';
return 'Unknown';
};
```
### 3. Map Dependencies
**For Node.js**:
```bash
# Read package.json
cat package.json | jq '.dependencies'
cat package.json | jq '.devDependencies'
# Check for outdated packages
npm outdated
```
**For Python**:
```bash
# Read requirements.txt or pyproject.toml
cat requirements.txt
# Check for outdated packages
pip list --outdated
```
**For Go**:
```bash
# Read go.mod
cat go.mod
# Check for outdated modules
go list -u -m all
```
### 4. Identify Architecture Patterns
**Common patterns to detect**:
- **MVC** (Model-View-Controller): `models/`, `views/`, `controllers/`
- **Layered**: `api/`, `services/`, `repositories/`
- **Feature-based**: `features/auth/`, `features/users/`
- **Domain-driven**: `domain/`, `application/`, `infrastructure/`
- **Microservices**: Multiple services in `services/` directory
- **Monorepo**: Workspaces or packages structure
**Detection logic**:
```javascript
const detectArchitecture = (structure) => {
if (structure.includes('models') && structure.includes('views') && structure.includes('controllers')) {
return 'MVC Pattern';
}
if (structure.includes('features')) {
return 'Feature-based Architecture';
}
if (structure.includes('domain') && structure.includes('application')) {
return 'Domain-Driven Design';
}
if (structure.includes('services') && structure.includes('api-gateway')) {
return 'Microservices Architecture';
}
return 'Custom Architecture';
};
```
### 5. Extract Technical Debt
**Search for indicators**:
```bash
# Find TODOs
grep -r "TODO" --include="*.js" --include="*.py" --include="*.go"
# Find FIXMEs
grep -r "FIXME" --include="*.js" --include="*.py" --include="*.go"
# Find HACKs
grep -r "HACK" --include="*.js" --include="*.py" --include="*.go"
# Find deprecated code
grep -r "@deprecated" --include="*.js" --include="*.ts"
```
**Complexity analysis**:
```javascript
// Identify long functions (potential refactor targets)
const analyzeFunctions = () => {
// Functions > 50 lines = high complexity
// Functions > 100 lines = very high complexity
// Cyclomatic complexity > 10 = needs refactoring
};
```
### 6. Generate Documentation
**Output format**:
```markdown
# {Project Name} - Repository Analysis
**Generated:** {timestamp}
**Analyzed by:** Claude Code Repository Analyzer
---
## ๐ Overview
**Primary Language:** {language}
**Framework:** {framework}
**Architecture:** {architecture pattern}
**Total Files:** {count}
**Lines of Code:** {LOC}
**Last Updated:** {git log date}
---
## ๐ Directory Structure
```
project/
โโโ src/
โ โโโ components/
โ โโโ services/
โ โโโ utils/
โโโ tests/
โโโ docs/
```
---
## ๐ Technologies
### Frontend
- React 18.2.0
- TypeScript 5.0
- Tailwind CSS 3.3
### Backend
- Node.js 18
- Express 4.18
- PostgreSQL 15
### DevOps
- Docker
- GitHub Actions
- Jest for testing
---
## ๐ฆ Dependencies
### Production (12 packages)
- express: 4.18.2
- pg: 8.11.0
- jsonwebtoken: 9.0.0
- ...
### Development (8 packages)
- typescript: 5.0.4
- jest: 29.5.0
- eslint: 8.40.0
- ...
### โ ๏ธ Outdated (3 packages)
- express: 4.18.2 โ 4.19.0 (minor update available)
- jest: 29.5.0 โ 29.7.0 (patch updates available)
---
## ๐ Architecture
**Pattern:** Layered Architecture
**Layers:**
1. **API Layer** (`src/api/`): REST endpoints, request validation
2. **Service Layer** (`src/services/`): Business logic
3. **Repository Layer** (`src/repositories/`): Database access
4. **Models** (`src/models/`): Data structures
**Data Flow:**
```
Client โ API โ Service โ Repository โ Database
```
---
## ๐ Code Quality
**Metrics:**
- Average function length: 25 lines
- Cyclomatic complexity: 3.2 (low)
- Test coverage: 78%
- TypeScript strict mode: โ
Enabled
**Strengths:**
- โ
Well-structured codebase
- โ
Good test coverage
- โ
Type-safe with TypeScript
**Areas for Improvement:**
- โ ๏ธ 12 TODOs found (see Technical Debt section)
- โ ๏ธ 3 outdated dependencies
- โ ๏ธ Missing documentation in `/utils`
---
## ๐ Technical Debt
### High Priority (3)
- **FIXME** in `src/services/auth.js:42`: JWT refresh token rotation not implemented
- **TODO** in `src/api/users.js:78`: Add rate limiting
- **HACK** in `src/utils/cache.js:23`: Using setTimeout instead of proper cache expiry
### Medium Priority (5)
- **TODO** in `src/components/Dashboard.jsx:15`: Optimize re-renders
- **TODO** in `tests/integration/api.test.js:100`: Add more edge cases
- ...
### Low Priority (4)
- **TODO** in `README.md:50`: Update installation instructions
- ...
---
## ๐ Entry Points
**Main Application:**
- `src/index.js` - Server entry point
- `src/client/index.jsx` - Client entry point
**Development:**
- `npm run dev` - Start dev server
- `npm test` - Run tests
- `npm run build` - Production build
**Configuration:**
- `.env.example` - Environment variables
- `tsconfig.json` - TypeScript config
- `jest.config.js` - Test configuration
---
## ๐ Common Tasks
**Adding a new feature:**
1. Create component in `src/components/`
2. Add service logic in `src/services/`
3. Create API endpoint in `src/api/`
4. Write tests in `tests/`
**Database changes:**
1. Create migration in `migrations/`
2. Update models in `src/models/`
3. Run `npm run migrate`
---
## ๐ Integration Points
**External Services:**
- PostgreSQL database (port 5432)
- Redis cache (port 6379)
- SendGrid API (email)
- Stripe API (payments)
**API Endpoints:**
- `GET /api/users` - List users
- `POST /api/auth/login` - Authentication
- `GET /api/dashboard` - Dashboard data
---
## ๐ Additional Resources
- [Architecture Diagram](./docs/architecture.png)
- [API Documentation](./docs/api.md)
- [Development Guide](./docs/development.md)
---
**Next Steps:**
1. Address high-priority technical debt
2. Update outdated dependencies
3. Increase test coverage to 85%+
4. Document utility functRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context โ no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes โ information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development โ guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.