architectural-analysislisted
Install: claude install-skill aiskillstore/marketplace
# Architectural Analysis
## Instructions
Perform comprehensive architectural audit focused on structural issues, dead code, duplication, and systemic problems.
### Phase 1: Discovery & Planning
#### Step 1: Map Codebase Structure
```bash
# Get directory structure
find . -type d -not -path "*/node_modules/*" -not -path "*/.git/*"
# Count files by type
find . -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" | wc -l
```
#### Step 2: Identify Entry Points
- Main application entry (`index.ts`, `main.ts`, `app.ts`)
- API routes/controllers
- Public exports (`index.ts` files)
- CLI entry points
- Test files
#### Step 3: Create Comprehensive File List
Use Glob to find all source files.
Create todo list with one item per file to analyze.
### Phase 2: Dead Code Detection
For EACH file in the todo list:
#### Step 1: Identify Exports
- What does this file export?
- Are exports functions, classes, types, constants?
- Is anything exported at all?
#### Step 2: Search for Usage
For each export, search if it's imported/used anywhere:
```bash
# Search for imports of this export
grep -r "import.*ExportName" . --include="*.ts" --include="*.tsx"
grep -r "from.*filename" . --include="*.ts" --include="*.tsx"
# Search for direct usage
grep -r "ExportName" . --include="*.ts" --include="*.tsx"
```
#### Step 3: Categorize Code
**Dead Code** (mark for removal):
- Exported but never imported
- Functions defined but never called
- Classes instantiated nowhere
- Types defined b