# Analyze Codebase

> Codebase discovery and analysis for Stage B of the VibeFlow docs-first workflow

- Skill: `hardness1020/analyze-codebase` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add hardness1020/analyze-codebase`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hardness1020/analyze-codebase/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- Author: hardness1020 (https://skillmd.com/u/hardness1020)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/hardness1020/analyze-codebase

---


# analyze-codebase

Codebase discovery and analysis for Stage B of the VibeFlow docs-first workflow.

## Purpose

This skill creates Discovery documents for Stage B:
- Analyze existing specs and code
- Validate spec-code alignment
- Map dependencies and side effects
- Identify reusable components

## Workflow

```
Stage B: Discovery
    │
    ├── Analyze existing specs and code
    ├── Validate spec-code alignment
    ├── Map dependencies and side effects
    └── Identify reusable components
```

## Usage

### Create Discovery Document

```
/analyze-codebase <ID>
```

Creates `docs/discovery/disco-<ID>.md` with all 5 phases.

Example:
```
/analyze-codebase 030
```

## Document Requirements

### Discovery (`docs/discovery/disco-<ID>.md`)

Required phases:
- Phase 0: Spec Discovery (analyze existing specs)
- Phase 1: Spec-Code Validation (verify accuracy)
- Phase 2: Test Impact Analysis (test update checklist)
- Phase 3: Dependency & Side Effect Mapping
- Phase 4: Reusable Component Discovery
- Risk Assessment & Go/No-Go Recommendation

## Validation

- `scripts/validate_discovery.py` — Validate discovery document

## References

See `references/`:
- `discovery-guide.md` — Discovery phases guide

## Manifest Update

After completing Stage B, update `docs/workflow-state.yaml`:

- Set `stage: B`
- Set `docs.discovery: docs/discovery/disco-<ID>.md`

## Git Commit

After completing this stage, ask the user for permission before committing:

```bash
git add docs/discovery/disco-<ID>.md docs/workflow-state.yaml
git commit -m "feat(discovery): codebase analysis for <slug> (#ft-<ID>)"
```

Replace `<ID>` and `<slug>` with actual values.

## Auto-Advance

After the commit is complete, directly run `/manage-work advance <ID>` to advance to the next stage.

