Skip to content

0-init

Initialize a new project or onboard an existing one. The single entry point — detects brownfield projects automatically, routes by codebase size, or asks Product Development vs Knowledge Work for greenfield.

Plugin: core-standards
Category: Other
Command: /0-init


Initialize Project

The single entry point for starting any new project or onboarding an existing one. Detects brownfield projects automatically, routes by codebase size (Document-First or PRD-First), or asks Product Development vs Knowledge Work for greenfield projects.

When to Use

  • Starting a new project/0-init
  • Onboarding an existing codebase/0-init (detects brownfield automatically)
  • Checking an existing project/vt-c-0-start (development) or /vt-c-pd-0-start (design) or /vt-c-kw-0-start (knowledge)

Project Type Routing

/0-init
   ├── Step 0: Brownfield Detection
   │     Scans for source files (*.ts, *.py, *.rb, etc.)
   │     │
   │     ├── No source files → Greenfield (Step 1)
   │     │     │
   │     │     ├── "Product Development"
   │     │     │     Next: /vt-c-pd-1-research → ... → /vt-c-3-build
   │     │     │
   │     │     └── "Knowledge Work"
   │     │           Next: /vt-c-kw-1-plan → ... → /vt-c-kw-4-publish
   │     │
   │     └── Source files found → Brownfield
   │           │
   │           ├── Small/Medium (<500 files) → Document-First
   │           │     Analyze → CLAUDE.md → Architecture doc → /vt-c-pd-2-prd
   │           │
   │           └── Large (>500 files) → PRD-First
   │                 Target module → Focused analysis → /vt-c-pd-2-prd
   └── --skip-analysis → /vt-c-repo-init --adopt → Step 1

Invocation

# Interactive — detects brownfield or asks workflow type
/0-init

# Direct — product development project (greenfield)
/0-init product my-app

# Direct — knowledge work project (greenfield)
/0-init knowledge market-research

# Skip brownfield analysis (for developers who know the codebase)
/0-init --skip-analysis

Execution Instructions

Step 0: Brownfield Detection

Detect whether this repo contains existing source code before asking about project type.

0a. Check for --skip-analysis flag:

If --skip-analysis is in the arguments: - Run /vt-c-repo-init --adopt for governance setup only - Skip to Step 1 (PD vs KW choice)

0b. Count source files:

find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \
  -o -name "*.py" -o -name "*.rb" -o -name "*.go" -o -name "*.java" \
  -o -name "*.rs" -o -name "*.swift" -o -name "*.kt" -o -name "*.cs" \
  -o -name "*.php" -o -name "*.vue" -o -name "*.svelte" \) \
  -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/vendor/*" \
  -not -path "*/dist/*" -not -path "*/build/*" -not -path "*/.worktrees/*" \
  -not -path "*/__pycache__/*" -not -path "*/.tox/*" -not -path "*/.venv/*" | wc -l

If 0 source files found (including repos with only config files like package.json): - This is a greenfield project → skip to Step 1

If ≥1 source files found: - Display: "Existing code detected ({N} source files)." - Use AskUserQuestion: - Yes — onboard existing project → proceed to Step 0c - No — starting fresh in this repo → skip to Step 1 - Skip analysis — I know this codebase → run /vt-c-repo-init --adopt, then skip to Step 1

0c. Edge case checks:

  1. Existing CLAUDE.md (EC-1): If CLAUDE.md exists, note: "Existing CLAUDE.md found — will be preserved and augmented with discovered conventions."

  2. Existing .design-state.yaml (EC-2): If .design-state.yaml exists, display what's already set up. Note: "Partially onboarded. Filling gaps only."

  3. Monorepo detection (EC-3): Check for multiple dependency manifests at different directory levels:

    find . -maxdepth 3 \( -name "package.json" -o -name "go.mod" -o -name "Cargo.toml" \
      -o -name "requirements.txt" -o -name "pyproject.toml" \) \
      -not -path "*/node_modules/*" | head -10
    
    If >1 found at different paths → AskUserQuestion: "Multiple apps/modules detected: {list}. Which one to onboard?"

0d. Size classification and routing:

Use the source file count from Step 0b: - Small (<50 files) or Medium (50-500 files) → Document-First route - Large (>500 files) → PRD-First route

Display: "Detected {N} source files. Routing to {Document-First|PRD-First} workflow."

Document-First route (small/medium codebases):

  1. Codebase analysis via Agent(subagent_type="Explore") — use focused glob patterns (e.g., src/**/*.ts), not recursive tree walks. Target completion within 2 minutes (NFR-1):
  2. Discover project structure (directories, entry points)
  3. Identify tech stack (frameworks, libraries, language versions)
  4. Extract conventions (naming, file organization, test patterns)
  5. Find existing documentation (README, wiki, inline comments)

  6. Generate or augment CLAUDE.md with discovered conventions:

    ## Repository Overview
    [project purpose, from README/package.json description]
    
    ## Tech Stack
    - Language: [name] [version from config]
    - Framework: [name] [version]
    - Database: [if detected]
    
    ## Build & Test Commands
    [extracted from package.json scripts / Makefile / etc.]
    
    ## Code Conventions
    - Naming: [camelCase/snake_case — from actual files]
    - File organization: [patterns discovered]
    - Test location: [co-located / separate test/ dir]
    
    ## Architecture
    [high-level module descriptions with purposes]
    
    If CLAUDE.md already exists (EC-1): append a ## Discovered Conventions section at the end. Never overwrite existing content.

  7. Generate architecture overview → write to docs/architecture-overview.md

  8. Run /vt-c-repo-init --adopt for governance setup (.design-state.yaml, .repo-manifest.yaml)

  9. Display next step:

    Analysis complete. Your codebase has been documented.
    
    Next: /vt-c-pd-2-prd
    Create a PRD from the analysis to define what you want to build or change.
    
    Then exit (do not proceed to Step 1).

PRD-First route (large codebases):

  1. Ask for target area via AskUserQuestion: "Which module or feature area are you working on?"
  2. Show detected top-level directories as options
  3. Include a free text option for specific paths

  4. Focused analysis of target module only via Agent(subagent_type="Explore") scoped to the target path:

  5. Module-level structure and conventions
  6. Dependencies and integration points with rest of codebase

  7. Generate or augment CLAUDE.md — same template as above but scoped to target module. If CLAUDE.md exists, append ## Discovered Conventions section.

  8. Run /vt-c-repo-init --adopt for governance setup

  9. Display next step:

    Focused analysis complete for {module}.
    
    Next: /vt-c-pd-2-prd
    Capture your requirements for this area, then generate specs.
    
    Then exit (do not proceed to Step 1).

Step 1: Parse Arguments

Extract from the invocation: - Mode: product or knowledge (optional — if missing, go to Step 2) - Project name: the directory/project name (optional — if missing, /vt-c-scaffold will ask)

If mode is provided, skip Step 2.

Step 2: Interactive Mode

If no mode argument was provided, use AskUserQuestion:

What type of project are you starting?

Options: - Product Development (Recommended) — For products leading to software. Includes user research, PRD, prototyping, and development phases. - Knowledge Work — For documentation, research, processes, or business deliverables. No code assumptions.

Step 3: Execute /vt-c-scaffold

Map the chosen mode to a scaffold type and execute the scaffold skill steps:

/0-init mode /vt-c-scaffold type Rationale
product design Creates design-specific structure + .design-state.yaml
knowledge knowledge Creates knowledge-specific structure

Execute the /vt-c-scaffold skill inline with the mapped type and project name. This creates: - Universal base (PRODUCT-VISION.md, PRD.md, CLAUDE.md, README.md, .gitignore) - 00-inbox/README.md (universal inbox) - 01-docs/journal/ (session journals) - Type-specific directories - Git initialization - Project registration in toolkit intake

Note: /vt-c-scaffold handles all file creation, existing file detection, and git init. Do not duplicate this logic.

Step 4: Product Development Extras

Only for product mode:

  1. Verify .design-state.yaml: /vt-c-scaffold design creates this. Confirm it exists.

  2. Offer repo governance (optional): Use AskUserQuestion:

    Enable unified repo governance?
    Adds partition boundaries, Git LFS for binaries, and deployment integrity checks.
    
    Options:

  3. Yes (Recommended) — Run /vt-c-repo-init inline
  4. No — Skip, can enable later with /vt-c-repo-init

  5. GitHub remote: /vt-c-scaffold already offers this in its Step 8. No additional action needed.

Step 5: Display Workflow Overview

Show the complete workflow diagram for the chosen type.

Product Development:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project Initialized: [project-name] (Product Development)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Your Workflow:

  DESIGN PHASE
  ─────────────────────────────────────────────────────────────
  /vt-c-pd-1-research   User research (interviews, personas)
  /vt-c-pd-pid          Technical architecture & stack (PID)
  /vt-c-pd-2-prd        Create Product Requirements Document
  /vt-c-pd-3-prototype  Generate prototype with VisiTrans CD
  /vt-c-pd-4-validate   Usability testing and iteration
  /vt-c-pd-6-handoff    Development handoff

  DEVELOPMENT PHASE (per spec)
  ─────────────────────────────────────────────────────────────
  /vt-c-activate        Load next specs for development
  /vt-c-2-plan          Architecture & task breakdown
  /vt-c-3-build         Implementation with /vt-c-journal captures
  /vt-c-4-review        Code review (mandatory)
  /vt-c-5-finalize        Pre-merge checks

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Knowledge Work:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project Initialized: [project-name] (Knowledge Work)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Your Workflow:

  ─────────────────────────────────────────────────────────────
  /vt-c-kw-1-plan       Plan approach (research, structure, risks)
  /vt-c-kw-2-execute    Do the work with /vt-c-journal captures
  /vt-c-kw-3-review     Quality check deliverables
  /vt-c-kw-4-publish    Finalize and deliver
  ─────────────────────────────────────────────────────────────

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Step 6: Recommend Next Step

Product Development:

Next step: /vt-c-pd-1-research
Start with user research to understand your target users and their needs.

Supporting commands:
  /vt-c-journal      Capture decisions and learnings
  /vt-c-consolidate  Synthesize journal into docs

Knowledge Work:

Next step: /vt-c-kw-1-plan
Plan your approach, structure deliverables, and identify risks.

Supporting commands:
  /vt-c-journal      Capture decisions and learnings
  /vt-c-consolidate  Synthesize journal into docs

Edge Cases

  • Current directory already has source code: Step 0 detects this and offers brownfield onboarding. Config-only repos (package.json without source files) are treated as greenfield (EC-4).
  • Existing CLAUDE.md: Preserved and augmented with ## Discovered Conventions section — never overwritten (EC-1).
  • Existing .design-state.yaml: Treated as partially onboarded — gaps filled, existing setup preserved (EC-2).
  • Monorepo with multiple apps: Step 0 detects multiple dependency manifests and asks which module to onboard (EC-3).
  • 00-inbox/ already exists: /vt-c-scaffold skips creation, does not overwrite.
  • User wants OneDrive integration: After /0-init product, run /vt-c-pd-0-start which detects and sets up OneDrive project folders. /0-init creates the git repo structure; OneDrive structure is complementary.
  • User runs /vt-c-pd-0-start directly: Still works as before. /0-init is the recommended path, not the only path.
  • User runs /vt-c-scaffold directly: Still works for all project types including coding and mixed which are not exposed through /0-init.

Relationship to Other Skills

Skill Role Still standalone?
/vt-c-scaffold Internal building block — creates files and folders Yes
/vt-c-pd-0-start Checks existing PD project, shows phase status Yes
/vt-c-kw-0-start Checks existing KW project, shows prerequisites Yes
/vt-c-0-start Checks existing dev project, shows prerequisites Yes
/0-init New — creates a new project from scratch