Get the FREE Ultimate OpenClaw Setup Guide →

analyze-codebase

npx machina-cli add skill hardness1020/VibeFlow/analyze-codebase --openclaw
Files (1)
SKILL.md
1.6 KB

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

To advance to the next stage: /manage-work advance <ID>

Source

git clone https://github.com/hardness1020/VibeFlow/blob/main/.claude/skills/analyze-codebase/SKILL.mdView on GitHub

Overview

Analyze-codebase enables Stage B by creating Discovery documents that capture spec-code alignment, dependencies, and reusable components. It analyzes existing specs and code, then outputs a structured disco-<ID>.md with five phases and a risk assessment, guiding next steps.

How This Skill Works

The skill analyzes existing specs and code, validates spec-code alignment, maps dependencies and side effects, and identifies reusable components. It outputs a Discovery document at docs/discovery/disco-<ID>.md encompassing Phase 0 through Phase 4 plus a risk assessment, and relies on scripts/validate_discovery.py for validation.

When to Use It

  • Starting Stage B of the VibeFlow docs-first workflow to document discovery
  • When you need to verify alignment between specifications and code before implementation
  • When mapping dependencies and potential side effects across modules
  • When identifying reusable components to reduce duplication
  • When preparing a go/no-go risk assessment for Stage B readiness

Quick Start

  1. Step 1: /analyze-codebase <ID>
  2. Step 2: Review docs/discovery/disco-<ID>.md and ensure all phases are present
  3. Step 3: Update docs/workflow-state.yaml and run /manage-work advance <ID>

Best Practices

  • Run analyze-codebase with a unique <ID> for traceable disco-<ID>.md outputs
  • Ensure all five phases (0–4) plus Risk Assessment are captured in the discovery doc
  • Validate the discovery with scripts/validate_discovery.py before proceeding
  • Keep disco-<ID>.md naming consistent and store under docs/discovery/
  • After completion, update docs/workflow-state.yaml and proceed with /manage-work advance <ID>

Example Use Cases

  • Analyze-codebase 030 to generate disco-030.md for a new checkout flow and document five phases
  • Analyze-codebase 112 to validate spec-code alignment for a microservice API and generate discovery
  • Analyze-codebase 207 to map dependencies and side effects across UI and backend components
  • Analyze-codebase 315 to identify reusable components for a shared UI library
  • Analyze-codebase 401 to perform risk assessment and provide a Go/No-Go recommendation

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers