project-analyzer
Automated brownfield codebase analysis. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile. Essential for Conductor integration and onboarding existing projects.
Best use case
project-analyzer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Automated brownfield codebase analysis. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile. Essential for Conductor integration and onboarding existing projects.
Teams using project-analyzer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/project-analyzer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How project-analyzer Compares
| Feature / Agent | project-analyzer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Automated brownfield codebase analysis. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile. Essential for Conductor integration and onboarding existing projects.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
<identity>
Project Analyzer - Automated brownfield codebase analysis for rapid project onboarding and understanding.
</identity>
<capabilities>
- Detecting project type (frontend, backend, fullstack, library, cli, mobile, monorepo)
- Identifying frameworks and libraries from manifests and structure
- Generating file statistics and language breakdown
- Mapping component relationships and module structure
- Detecting architecture patterns (MVC, layered, microservices, etc.)
- Analyzing dependency health and outdated packages
- Identifying code quality indicators (linting, testing, type safety)
- Detecting technical debt and anti-patterns
- Generating prioritized improvement recommendations
</capabilities>
<instructions>
<execution_process>
### Step 1: Identify Project Root
Locate project root by finding manifest files:
1. **Search for package manager files**:
- `package.json` (Node.js/JavaScript/TypeScript)
- `requirements.txt`, `pyproject.toml`, `setup.py` (Python)
- `go.mod` (Go)
- `Cargo.toml` (Rust)
- `pom.xml`, `build.gradle` (Java/Maven/Gradle)
- `composer.json` (PHP)
2. **Identify project root**:
- Directory containing primary package manager file
- Handle monorepos (multiple package.json files)
- Detect workspace configuration
3. **Validate project root**:
- Check for `.git` directory
- Verify source code directories exist
- Ensure manifest files are parsable
### Step 2: Detect Project Type
Classify project based on manifest files and directory structure:
1. **Frontend Projects**:
- Indicators: React, Vue, Angular, Svelte dependencies
- Directory: `src/components/`, `public/`, `assets/`
- Frameworks: Next.js, Nuxt.js, Gatsby, Vite
2. **Backend Projects**:
- Indicators: Express, FastAPI, Django, Flask, Gin dependencies
- Directory: `routes/`, `controllers/`, `models/`, `api/`
- Frameworks: Next.js API routes, FastAPI, Express
3. **Fullstack Projects**:
- Indicators: Both frontend and backend frameworks
- Directory: Combined frontend + backend structure
- Frameworks: Next.js, Remix, SvelteKit, Nuxt.js
4. **Library/Package Projects**:
- Indicators: No application-specific directories
- Files: `index.ts`, `lib/`, `dist/`, `build/`
- Manifests: `library` field in package.json
5. **CLI Projects**:
- Indicators: `bin` field in package.json
- Files: CLI entry points, command parsers
- Dependencies: Commander, Yargs, Inquirer
6. **Mobile Projects**:
- Indicators: React Native, Flutter, Ionic dependencies
- Files: `android/`, `ios/`, `mobile/`
- Frameworks: React Native, Expo, Flutter
7. **Monorepo Projects**:
- Indicators: `workspaces` in package.json, `pnpm-workspace.yaml`
- Structure: Multiple packages in subdirectories
- Tools: Turborepo, Nx, Lerna
8. **Microservices Projects**:
- Indicators: Multiple service directories
- Files: `docker-compose.yml`, service configs
- Structure: Service-based organization
### Step 3: Framework Detection
Identify frameworks from manifest files and imports:
1. **Read package.json dependencies** (Node.js):
- Parse `dependencies` and `devDependencies`
- Detect framework versions
- Categorize by type (framework, ui-library, testing, etc.)
2. **Read requirements.txt** (Python):
- Parse Python dependencies
- Detect FastAPI, Django, Flask
- Identify version constraints
3. **Analyze imports** (optional deep scan):
- Scan source files for import statements
- Detect used vs declared dependencies
- Identify framework-specific patterns
4. **Framework Categories**:
- **Framework**: React, Next.js, FastAPI, Express
- **UI Library**: Material-UI, Ant Design, Chakra UI
- **State Management**: Redux, Zustand, Pinia
- **Testing**: Jest, Vitest, Cypress, Playwright
- **Build Tool**: Vite, Webpack, Rollup, esbuild
- **Database**: Prisma, TypeORM, SQLAlchemy
- **ORM**: Prisma, Sequelize, Mongoose
- **API**: tRPC, GraphQL, REST
- **Auth**: NextAuth, Auth0, Clerk
- **Logging**: Winston, Pino, Bunyan
- **Monitoring**: Sentry, Datadog, New Relic
5. **Confidence Scoring**:
- **1.0**: Framework listed in dependencies
- **0.8**: Framework detected from imports
- **0.6**: Framework inferred from structure
### Step 4: File Statistics
Generate quantitative project statistics:
1. **Count files by type**:
- Use glob patterns for common extensions
- Exclude: `node_modules/`, `.git/`, `dist/`, `build/`
- Group by language/file type
2. **Count lines of code**:
- Read source files and count lines
- Exclude empty lines and comments (optional)
- Calculate total LOC per language
3. **Identify largest files**:
- Track file sizes (line count)
- Report top 10 largest files
- Flag files > 1000 lines (violates micro-service principle)
4. **Calculate averages**:
- Average file size (lines)
- Average directory depth
- Files per directory
5. **Language Detection**:
- Map extensions to languages:
- `.ts`, `.tsx` → TypeScript
- `.js`, `.jsx` → JavaScript
- `.py` → Python
- `.go` → Go
- `.rs` → Rust
- `.java` → Java
- `.md` → Markdown
- `.json` → JSON
- `.yaml`, `.yml` → YAML
### Step 5: Structure Analysis
Analyze project structure and architecture:
1. **Identify root directories**:
- Classify directories by purpose:
- **source**: `src/`, `app/`, `lib/`
- **tests**: `test/`, `__tests__/`, `cypress/`
- **config**: `config/`, `.config/`
- **docs**: `docs/`, `documentation/`
- **build**: `dist/`, `build/`, `out/`
- **scripts**: `scripts/`, `bin/`
- **assets**: `assets/`, `static/`, `public/`
2. **Detect entry points**:
- Main entry: `index.ts`, `main.py`, `app.py`
- App entry: `app.ts`, `server.ts`, `app/page.tsx`
- Handler: `handler.ts`, `lambda.ts`
- CLI: `cli.ts`, `bin/`
3. **Detect architecture pattern**:
- **MVC**: `models/`, `views/`, `controllers/`
- **Layered**: `presentation/`, `business/`, `data/`
- **Hexagonal**: `domain/`, `application/`, `infrastructure/`
- **Microservices**: Multiple service directories
- **Modular**: Feature-based organization
- **Flat**: All files in src/
4. **Detect module system**:
- Check `package.json` for `"type": "module"` (ESM)
- Scan for `import`/`export` (ESM) vs `require` (CommonJS)
- Identify mixed module systems
### Step 6: Dependency Analysis
Analyze dependency health:
1. **Count dependencies**:
- Production dependencies
- Development dependencies
- Total dependency count
2. **Check for outdated packages** (optional):
- Run `npm outdated` or equivalent
- Parse output for outdated packages
- Identify major version updates (breaking changes)
3. **Security scan** (optional):
- Run `npm audit` or equivalent
- Identify vulnerabilities by severity
- Flag critical security issues
### Step 7: Code Quality Indicators
Detect code quality tooling:
1. **Linting Configuration**:
- Detect: `.eslintrc.json`, `eslint.config.js`, `ruff.toml`
- Tool: ESLint, Ruff, Flake8, Pylint
- Run linter if configured (optional)
2. **Formatting Configuration**:
- Detect: `.prettierrc`, `pyproject.toml` (Black/Ruff)
- Tool: Prettier, Black, Ruff
3. **Testing Framework**:
- Detect: Jest, Vitest, Pytest, Cypress
- Count test files
- Check for coverage configuration
4. **Type Safety**:
- Detect TypeScript: `tsconfig.json`
- Check strict mode: `"strict": true`
- Detect Python typing: mypy, pyright
### Step 8: Pattern Detection
Identify common patterns and anti-patterns:
1. **Good Practices**:
- Modular component structure
- Comprehensive test coverage
- TypeScript strict mode enabled
- CI/CD configuration present
2. **Anti-Patterns**:
- Large files (> 1000 lines)
- Missing tests
- Outdated dependencies
- No linting configuration
3. **Neutral Patterns**:
- Specific architecture choices
- Framework-specific patterns
### Step 9: Technical Debt Analysis
Calculate technical debt score:
1. **Debt Indicators**:
- **Outdated Dependencies**: Count outdated packages
- **Missing Tests**: Low test file ratio
- **Dead Code**: Unused imports/exports (optional)
- **Complexity**: Large files, deep nesting
- **Documentation**: Missing README, docs
- **Security**: Known vulnerabilities
- **Performance**: Bundle size, load time
2. **Debt Score** (0-100):
- 0-20: Excellent health
- 21-40: Good health, minor issues
- 41-60: Moderate debt, needs attention
- 61-80: High debt, refactoring recommended
- 81-100: Critical debt, major overhaul needed
3. **Remediation Effort**:
- **Trivial**: < 1 hour
- **Minor**: 1-4 hours
- **Moderate**: 1-3 days
- **Major**: 1-2 weeks
- **Massive**: > 2 weeks
### Step 10: Generate Recommendations
Create prioritized improvement recommendations:
1. **Categorize Recommendations**:
- **Security**: Critical vulnerabilities, outdated auth
- **Performance**: Bundle optimization, lazy loading
- **Maintainability**: Refactor large files, add tests
- **Testing**: Increase coverage, add E2E tests
- **Documentation**: Add README, API docs
- **Architecture**: Improve modularity, separation of concerns
- **Dependencies**: Update packages, remove unused
2. **Prioritize by Impact**:
- **P0**: Critical security, blocking production
- **P1**: High impact, affects reliability
- **P2**: Medium impact, improves quality
- **P3**: Low impact, nice-to-have
3. **Estimate Effort and Impact**:
- Effort: trivial, minor, moderate, major, massive
- Impact: low, medium, high, critical
### Step 11: Validate Output
Validate analysis output against schema:
1. **Schema Validation**:
- Validate against `project-analysis.schema.json`
- Ensure all required fields present
- Check data types and formats
2. **Output Metadata**:
- Analyzer version
- Analysis duration (ms)
- Files analyzed count
- Files skipped count
- Errors encountered
</execution_process>
<performance>
**Performance Requirements**:
- **Target**: < 30 seconds for typical projects (< 10k files)
- **Optimization**:
- Skip large directories: `node_modules/`, `.git/`, `dist/`
- Use parallel file processing
- Cache results for incremental analysis
- Limit deep scans to essential files
- Use streaming for large file counts
</performance>
<integration>
**Integration with Conductor**:
- Provides automated project discovery
- Eliminates manual context gathering
- Enables 80% faster brownfield onboarding
- Feeds project context to chat interface
**Integration with Other Skills**:
- **rule-selector**: Auto-select rules based on detected frameworks
- **repo-rag**: Semantic search for architectural patterns
- **dependency-analyzer**: Deep dependency analysis
</integration>
<best_practices>
1. **Progressive Disclosure**: Start with manifest analysis, add deep scans if needed
2. **Performance First**: Skip expensive operations for large projects
3. **Fail Gracefully**: Handle missing files, parse errors
4. **Validate Output**: Always validate against schema
5. **Cache Results**: Store analysis output for reuse
6. **Incremental Updates**: Re-analyze only changed files
</best_practices>
</instructions>
<examples>
<usage_example>
**Programmatic Usage**:
```bash
# Analyze current project
node .claude/tools/project-analyzer/analyzer.mjs
# Analyze specific directory
node .claude/tools/project-analyzer/analyzer.mjs /path/to/project
# Output to file
node .claude/tools/project-analyzer/analyzer.mjs --output .claude/context/artifacts/project-analysis.json
# Run tests
node .claude/tools/project-analyzer/tests/analyzer.test.mjs
```
**Agent Invocation**:
```
# Analyze current project
Analyze this project
# Generate comprehensive analysis
Perform full project analysis and save to artifacts
# Quick analysis (manifest only)
Quick project type detection
```
</usage_example>
<formatting_example>
**Sample Output** (`.claude/context/artifacts/project-analysis.json`):
```json
{
"analysis_id": "analysis-llm-rules-20250115",
"project_type": "fullstack",
"analyzed_at": "2025-01-15T10:30:00.000Z",
"project_root": "C:\\dev\\projects\\LLM-RULES",
"stats": {
"total_files": 1243,
"total_lines": 125430,
"languages": {
"JavaScript": 45230,
"TypeScript": 38120,
"Markdown": 25680,
"JSON": 12400,
"YAML": 4000
},
"file_types": {
".js": 234,
".mjs": 156,
".ts": 89,
".md": 312,
".json": 145
},
"directories": 87,
"avg_file_size_lines": 101,
"largest_files": [
{
"path": ".claude/tools/enforcement-gate.mjs",
"lines": 1520
}
]
},
"frameworks": [
{
"name": "nextjs",
"version": "14.0.0",
"category": "framework",
"confidence": 1.0,
"source": "package.json"
},
{
"name": "react",
"version": "18.2.0",
"category": "framework",
"confidence": 1.0,
"source": "package.json"
}
],
"structure": {
"root_directories": [
{
"name": ".claude",
"purpose": "config",
"file_count": 543
},
{
"name": "conductor-main",
"purpose": "source",
"file_count": 234
}
],
"entry_points": [
{
"path": "conductor-main/src/index.ts",
"type": "main"
}
],
"architecture_pattern": "modular",
"module_system": "esm"
},
"dependencies": {
"production": 45,
"development": 23
},
"code_quality": {
"linting": {
"configured": true,
"tool": "eslint"
},
"formatting": {
"configured": true,
"tool": "prettier"
},
"testing": {
"framework": "vitest",
"test_files": 89,
"coverage_configured": true
},
"type_safety": {
"typescript": true,
"strict_mode": true
}
},
"tech_debt": {
"score": 35,
"indicators": [
{
"category": "complexity",
"severity": "medium",
"description": "3 files exceed 1000 lines",
"remediation_effort": "moderate"
}
]
},
"recommendations": [
{
"priority": "P1",
"category": "maintainability",
"title": "Refactor large files",
"description": "Break down files > 1000 lines into smaller modules",
"effort": "moderate",
"impact": "high"
}
],
"metadata": {
"analyzer_version": "1.0.0",
"analysis_duration_ms": 2340,
"files_analyzed": 1243,
"files_skipped": 3420,
"errors": []
}
}
```
</formatting_example>
</examples>
## References
For additional detection patterns extracted from the Auto-Claude analysis framework, see:
- `references/auto-claude-patterns.md` - Monorepo indicators, SERVICE_INDICATORS, SERVICE_ROOT_FILES, infrastructure detection, convention detection
- `references/service-patterns.md` - Service type detection (frontend, backend, library), framework-specific patterns, entry point detection
- `references/database-patterns.md` - Database configuration file patterns, ORM detection (Prisma, SQLAlchemy, TypeORM, Drizzle, Mongoose), connection string patterns
- `references/route-patterns.md` - Express, FastAPI, Flask, Django, Next.js, Go, Rust API route detection patterns
These references provide comprehensive regex patterns and detection logic for brownfield codebase analysis.
## Memory Protocol (MANDATORY)
**Before starting:**
Read `.claude/context/memory/learnings.md`
**After completing:**
- New pattern -> `.claude/context/memory/learnings.md`
- Issue found -> `.claude/context/memory/issues.md`
- Decision made -> `.claude/context/memory/decisions.md`
> ASSUME INTERRUPTION: If it's not in memory, it didn't happen.Related Skills
systems-programming-rust-project
You are a Rust project architecture expert specializing in scaffolding production-ready Rust applications. Generate complete project structures with cargo tooling, proper module organization, testing
springboot-architecture-analyzer
系統化分析 Spring Boot 專案並生成完整的企業級架構文件,涵蓋系統概述、架構視圖、技術細節、部署策略等所有關鍵面向。
sovereign-project-guardian
Project health and best practices enforcer. Checks security, quality, documentation, CI/CD, and dependencies. Produces a letter grade (A-F) with actionable fixes.
setup-project
Setup Claude Code Configuration with full RALPH autonomous development integration
repository-analyzer
Comprehensive repository analysis using Explore agents, web search, and Context7 to investigate codebase structure, technology stack, configuration, documentation quality, and provide actionable insights. Use this skill when asked to analyze, audit, investigate, or report on a repository or codebase. | Exploreエージェント、Web検索、Context7を用いた包括的なリポジトリ分析。コードベース構造、技術スタック、設定、ドキュメント品質を調査し、実用的な洞察を提供。リポジトリやコードベースの分析、監査、調査、レポート作成を依頼された場合に使用。
python-project
Scaffold and harden Python projects using vpngw-aligned defaults (pyproject/setuptools-scm, src layout, Ruff, pytest, Typer, Pydantic) plus best practices for CLI tools, systemd services, APIs/UI apps, IaC/automation, security/networking, and AI/ML workflows.
project-scaffolder
Guide for setting up Claude Code infrastructure in new or existing projects
project-qtax
UK taxation expert for HMRC compliance, Making Tax Digital (MTD ITSA/VAT) and Self-Assessment: explain tax treatment; compute income tax/NI/dividend/CGT with band-by-band breakdown; advise on deadlines/forms/penalties; and support MTD developer integration + tax software UX/flows. Use WebSearch (gov.uk/HMRC) to verify current rates and mandation timelines. (project)
project-overview
Background knowledge about CaCrFeedFormula project architecture, features, and context. Automatically loaded for AI reference, not directly user-invocable.
project-orchestration
Orchestrate multi-agent workflows for feature development using planning agents, context handoff, and stage management
project-object
Session memory that compounds - remember decisions, patterns, and corrections across AI coding sessions. Includes standards injection for consistent code quality.
project-mngt
Product Owner / Project Manager skill for MVP/MMP/MMR implementation planning