Skip to content
analyze-project logo

Analyze Project

analyze-project

Use when starting work on an unfamiliar project or needing to understand a codebase - performs comprehensive analysis discovering architecture, patterns, dependencies, testing coverage, and improvement opportunities. Do NOT use on projects you already know well or for targeted questions about spe...

SKILL.md

Full skill instructions

Analyze Project

Overview

Perform deep analysis of a codebase to understand its architecture, patterns, dependencies, and opportunities for improvement.

Core principle: Understand before changing. Map before navigating.

Trigger: /​popkit:project analyze command or when starting work on unfamiliar project

Arguments

FlagDescription
--jsonOutput structured JSON instead of markdown, save to .claude/​analysis.json
--quickQuick summary only (5-10 lines)
--focus <area>Focus analysis: arch, deps, quality, patterns

JSON Output Mode

When --json flag is provided:

  1. Output Format: Structured JSON matching output-styles/​schemas/​project-analysis.schema.json
  2. Save Location: .claude/​analysis.json
  3. Purpose: Machine-readable output for skill generators and MCP generators

JSON Output Process

import sys
import json
from datetime import datetime
from pathlib import Path

# Add pattern detector to path
# No longer needed - install popkit-shared instead
from pattern_detector import analyze_project, detect_frameworks

# Detect patterns
project_dir = Path.cwd()
patterns = analyze_project(project_dir)
frameworks = detect_frameworks(project_dir)

# Build output
output = {
    "project_name": project_dir.name,
    "project_type": frameworks[0].name if frameworks else "unknown",
    "analyzed_at": datetime.now().isoformat(),
    "frameworks": [
        {"name": p.name, "confidence": p.confidence, "version": ""}
        for p in frameworks
    ],
    "patterns": [
        {
            "name": p.name,
            "category": p.category,
            "confidence": p.confidence,
            "examples": p.examples,
            "description": p.description
        }
        for p in patterns if p.category != "framework"
    ],
    "recommended_skills": [],  # Populated based on patterns
    "recommended_agents": [],  # Populated based on analysis
    "commands": {},  # Extracted from package.json
    "quality_metrics": {}  # TypeScript, linting, etc.
}

# Save to .claude/​analysis.json
claude_dir = project_dir / ".claude"
claude_dir.mkdir(exist_ok=True)
(claude_dir / "analysis.json").write_text(json.dumps(output, indent=2))
print(json.dumps(output, indent=2))

Skill/​Agent Recommendation Logic

Based on detected patterns, recommend:

PatternRecommended SkillPriority
nextjs + vercel-configproject:deployhigh
prisma OR drizzleproject:db-migratehigh
supabaseproject:supabase-syncmedium
docker-composeproject:docker-devmedium
feature-flagsproject:feature-togglelow
PatternRecommended Agent
Large codebase (>100 files)performance-optimizer
React/​Vue componentsaccessibility-guardian
API routesapi-designer
Security-sensitivesecurity-auditor
Low test coveragetest-writer-fixer

Analysis Areas

1. Project Structure

# Map directory structure
find . -type d -name "node_modules" -prune -o -type d -print | head -50

# Find main entry points
ls index.* main.* app.* src/​index.* src/​main.* 2>/​dev/​null

# Count files by type
find . -name "node_modules" -prune -o -type f -print | \
  sed 's/​.*\.//' | sort | uniq -c | sort -rn | head -20

2. Technology Stack

Detect package managers:

ls package.json yarn.lock pnpm-lock.yaml Cargo.toml pyproject.toml go.mod 2>/​dev/​null

Detect frameworks:

  • Next.js: next.config.*, app/ or pages/
  • React: react in dependencies
  • Vue: vue.config.*
  • Express: express in dependencies
  • FastAPI: fastapi in dependencies
  • Rust: Cargo.toml

Detect databases:

  • Supabase: @supabase/​supabase-js
  • Prisma: prisma/​schema.prisma
  • MongoDB: mongoose
  • PostgreSQL: pg or postgres

3. Architecture Patterns

Frontend:

  • Component structure (atomic design, feature-based, etc.)
  • State management (Redux, Zustand, Context)
  • Routing patterns

Backend:

  • API design (REST, GraphQL, tRPC)
  • Service layer organization
  • Database access patterns

Common:

  • Error handling patterns
  • Logging approach
  • Configuration management

4. Code Quality

# Check for linting config
ls .eslintrc* eslint.config.* .prettierrc* biome.json 2>/​dev/​null

# Check TypeScript config
ls tsconfig.json 2>/​dev/​null && grep "strict" tsconfig.json

# Find TODO/​FIXME comments
grep -r "TODO\|FIXME" --include="*.ts" --include="*.tsx" --include="*.py" . | wc -l

5. Testing Coverage

# Find test files
find . -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" 2>/​dev/​null | wc -l

# Check test config
ls jest.config.* vitest.config.* pytest.ini 2>/​dev/​null

# Find coverage reports
ls coverage/ .coverage htmlcov/ 2>/​dev/​null

6. Dependencies

# Count dependencies
jq '.dependencies | length' package.json 2>/​dev/​null
jq '.devDependencies | length' package.json 2>/​dev/​null

# Check for outdated
npm outdated 2>/​dev/​null | head -10

# Check for vulnerabilities
npm audit --json 2>/​dev/​null | jq '.metadata.vulnerabilities'

7. CI/​CD and DevOps

# Find CI config
ls .github/​workflows/​*.yml .gitlab-ci.yml Jenkinsfile .circleci/​config.yml 2>/​dev/​null

# Find Docker
ls Dockerfile docker-compose.yml 2>/​dev/​null

# Find deployment config
ls vercel.json netlify.toml fly.toml 2>/​dev/​null

Output Format

# [Project Name] Analysis Report

## Summary

- **Type**: [Web App / API / CLI / Library]
- **Stack**: [Primary technologies]
- **Size**: [Files, Lines of code]
- **Health**: [Good / Needs attention / Critical issues]

## Technology Stack

### Frontend

- Framework: [Next.js 14 / React / Vue / etc.]
- Styling: [Tailwind / styled-components / etc.]
- State: [Redux / Zustand / Context]

### Backend

- Runtime: [Node.js / Python / Rust / Go]
- Framework: [Express / FastAPI / Actix]
- Database: [PostgreSQL / MongoDB / etc.]

### DevOps

- CI/​CD: [GitHub Actions / GitLab CI / etc.]
- Deployment: [Vercel / AWS / etc.]
- Container: [Docker / etc.]

## Architecture

### Directory Structure

\`\`\`
[Tree output of main directories]
\`\`\`

### Key Patterns

- [Pattern 1]: [Where used]
- [Pattern 2]: [Where used]

### Entry Points

- Main: `[path]`
- API: `[path]`
- Tests: `[path]`

## Code Quality

| Metric            | Value                | Status       |
| ----------------- | -------------------- | ------------ |
| Linting           | [Configured/​Missing] | [OK/​Warning] |
| TypeScript Strict | [Yes/​No]             | [OK/​Warning] |
| Test Coverage     | [X%]                 | [OK/​Warning] |
| TODO Comments     | [N]                  | [OK/​Warning] |

## Dependencies

### Production ([N] packages)

Top 5:

- [package]: [version]

### Security

- Vulnerabilities: [Low: X, Medium: Y, High: Z]

## Recommendations

### Critical

1. [Issue requiring immediate attention]

### High Priority

1. [Important improvement]

### Nice to Have

1. [Enhancement suggestion]

## Agent Opportunities

Based on analysis, these agents would be valuable:

- [agent-name]: [why]
- [agent-name]: [why]

## Next Steps

1. Run `/​generate-mcp` to create project-specific tools
2. Run `/​generate-skills` to capture discovered patterns
3. Run `/​setup-precommit` to configure quality gates

Integration

Called by:

  • Manual /​analyze-project command
  • After /​init-project

Informs:

  • /​generate-mcp - What tools to create
  • /​generate-skills - What patterns to capture
  • /​setup-precommit - What checks to configure

More skills from diegosouzapw

accessibility logo
diegosouzapw/awesome-omni-skill

accessibility

Accessibility guidelines for VS Code features — covers accessibility help dialogs, accessible views, verbosity settings, accessibility signals, ARIA alerts/status announcements, keyboard navigation, and ARIA labels/roles. Applies to both new interactive UI surfaces and updates to existing feature...

62 1
View
mermaid-diagrams logo
diegosouzapw/awesome-omni-skill

mermaid-diagrams

Mermaid diagram creation for flowcharts, sequences, ERDs, and more. Generate diagrams from text in markdown files. Use for documentation, architecture diagrams, and visual representations. Triggers on mermaid, flowchart, sequence diagram, ERD, entity relationship, gantt chart, pie chart, class di...

62 1
View
tauri2-react-rust logo
diegosouzapw/awesome-omni-skill

tauri2-react-rust

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built...

62 1
View
fp-ts-errors logo
diegosouzapw/awesome-omni-skill

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

62 0
View
ring:pre-dev-research logo
diegosouzapw/awesome-omni-skill

ring:pre-dev-research

Gate 0 research phase for pre-dev workflow. Dispatches 3 parallel research agents to gather codebase patterns, external best practices, and framework documentation BEFORE creating PRD/TRD. Outputs research.md with file:line references.

62 0
View
create-assistant logo
diegosouzapw/awesome-omni-skill

create-assistant

Create and configure Vapi voice AI assistants with models, voices, transcribers, tools, hooks, and advanced settings. Use when building voice agents, phone bots, customer support assistants, or any conversational AI that handles phone or web calls.

62 0
View
codex-headless logo
diegosouzapw/awesome-omni-skill

codex-headless

Delegiere Aufgaben an OpenAI Codex CLI im Headless-Mode. Nutzt ChatGPT Subscription (KEIN API Key). Nur Workspace-Zugriff, KEIN System-Zugriff. Auto-Accept mit --full-auto. Web-Recherche mit --search.

62 0
View
social-media-scheduler logo
diegosouzapw/awesome-omni-skill

social-media-scheduler

Generate a full week of social media content for any topic. Outputs platform-optimized posts for Twitter/X, LinkedIn, and Instagram with hashtags and posting times.

62 0
View
Data Privacy Compliance logo
diegosouzapw/awesome-omni-skill

Data Privacy Compliance

Data privacy and regulatory compliance specialist for GDPR, CCPA, HIPAA, and international data protection laws. Use when implementing privacy controls, conducting data protection impact assessments, ensuring regulatory compliance, or managing data subject rights. Expert in consent management, da...

62 0
View
triple-review logo
diegosouzapw/awesome-omni-skill

triple-review

Reviews a task using the TRIPLE protocol, as the review agent.

62 0
View
Tech Stack & Architecture Decision logo
diegosouzapw/awesome-omni-skill

Tech Stack & Architecture Decision

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies...

62 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View