Back to Skills

analysis-codebase

verified

Use when user asks to "analyze codebase", "scan project", "detect tech stack", or mentions "codebase analysis", "existing code", "collision risk", "brownfield", or "project context".

View on GitHub

Marketplace

humaninloop-plugins

deepeshBodh/human-in-loop

Plugin

humaninloop

Repository

deepeshBodh/human-in-loop
9stars

plugins/humaninloop/skills/analysis-codebase/SKILL.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/deepeshBodh/human-in-loop/blob/main/plugins/humaninloop/skills/analysis-codebase/SKILL.md -a claude-code --skill analysis-codebase

Installation paths:

Claude
.claude/skills/analysis-codebase/
Powered by add-skill CLI

Instructions

# Analyzing Codebase

## Overview

Systematically analyze existing codebases to extract structural information. Supports three modes: Context (project characteristics), Brownfield (entities and collision risks), and Setup-Brownfield (comprehensive analysis for `/humaninloop:setup`).

## When to Use

- Setting up constitution on existing codebase (brownfield projects)
- Planning new features against existing code
- Understanding tech stack before making changes
- Detecting collision risks for new entities or endpoints
- Running `/humaninloop:setup` on projects with existing code
- Gathering project context for governance decisions

## When NOT to Use

- **Greenfield projects**: No existing code to analyze; start with `humaninloop:authoring-constitution` directly
- **Single-file scripts**: No architectural patterns to extract
- **Documentation-only review**: Use standard file reading instead
- **Before project directory exists**: Nothing to analyze yet
- **When user provides complete context**: Skip analysis if user already documented tech stack and patterns

## Common Mistakes

| Mistake | Problem | Fix |
|---------|---------|-----|
| Assuming framework | Guessing without evidence | Verify with code patterns |
| Missing directories | Only checking standard paths | Projects vary, explore |
| Over-extracting | Analyzing every file | Focus on config and patterns |
| Ignoring governance | Missing existing decisions | Check README, CLAUDE.md, ADRs |
| Inventing findings | Documenting assumptions | Only report what is found |

## Mode Selection

| Mode | When to Use | Output |
|------|-------------|--------|
| **Context** | Setting up constitution, understanding project DNA | Markdown report for humans |
| **Brownfield** | Planning new features against existing code | JSON inventory with collision risks |
| **Setup-Brownfield** | `/humaninloop:setup` on existing codebase | `codebase-analysis.md` with inventory + assessment |

## Project Type Detection

Identify project typ

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
11487 chars