Validate

Orchestrate all validation agents to check and systematically fix all project issues until CI passes

btachinardi updated 9mo ago
Claude CodeGeneric
View source ↗
---
description: Orchestrate all validation agents to check and systematically fix all project issues until CI passes
allowed-tools: Bash(pnpm *:*), Task, Read
model: claude-sonnet-4-5
---

# /dev:validate

Orchestrate all validation agents to check and systematically fix all project issues until the entire CI pipeline passes.

## Objective

Run comprehensive validation across the entire project and systematically fix all issues by orchestrating specialized validation agents (ci-debugger, lint-debugger, test-debugger) until the project is in a clean, committable state with 100% CI success rate.

## Context & Prerequisites

**Project Context:**
- CI pipeline validates: bootstrap, lint, typecheck, test, build, security
- Specialized agents handle validation systematically:
  - `ci-debugger`: Full CI orchestration (recommended)
  - `lint-debugger`: Linting and type-checking fixes
  - `test-debugger`: Test failure debugging and fixes
- Command: `pnpm ci:local` simulates complete CI pipeline locally
- Project may be monorepo or single-project setup

**Specialized Validation Agents:**
- **ci-debugger**: Runs full CI pipeline, delegates to lint/test agents as needed, handles bootstrap/build/security
- **lint-debugger**: Fixes linting errors and type-checking failures
- **test-debugger**: Debugs and fixes test failures systematically

**Prerequisites:**
- Git repository initialized
- `pnpm-lock.yaml` exists (will be created if missing)
- Validation agent definitions exist in `.claude/agents/validation/`
- Node.js and pnpm installed

## Instructions

### Phase 1: Initial Assessment

**Objective:** Run quick checks to identify which validation areas have issues

**Steps:**

1. **Quick Status Check**

   Run a fast assessment of project health:
   ```bash
   pnpm ci:local

If pnpm-lock.yaml is missing:

  • Run pnpm install first to bootstrap dependencies
  • Then run pnpm ci:local
  1. Parse CI Results

    Analyze the output to identify which jobs are failing:

    • Setup / Bootstrap: Dependency resolution issues
    • Lint: Code style violations (ESLint, Prettier)
    • Type Check: TypeScript compilation errors
    • Test: Unit, integration, or e2e test failures
    • Build: Compilation or bundling failures
    • Security: Secret leaks (Gitleaks) or vulnerabilities (SBOM)
  2. Count Total Issues

    For each failing job type, count:

    • Total errors in lint job
    • Total type-checking errors
    • Total test failures
    • Build failures (yes/no)
    • Security issues found
  3. Present Assessment to User

    Show summary:

    Validation Assessment:
    - Bootstrap: [PASS/FAIL] - [Details]
    - Linting: [X errors found]
    - Type Checking: [Y errors found]
    - Tests: [Z failures found]
    - Build: [PASS/FAIL/SKIPPED]
    - Security: [PASS/FAIL/SKIPPED]
    
    Recommended approach: [Full CI / Individual Agents]
    
  4. Determine Strategy

    Choose validation approach:

    • Default (Recommended): Use ci-debugger for comprehensive CI pipeline validation
    • Alternative: Use individual agents for faster iteration during development

    Present both options to user if there are multiple failure types.

Validation:

  • Initial CI run completed
  • All failing jobs identified
  • Error counts captured
  • Strategy determined
  • User informed of scope

Phase 2: Execute Validation Strategy

Objective: Orchestrate validation agents to fix all issues systematically

IMPORTANT: Choose ONE of the following approaches based on Phase 1 assessment.


Option A: Full CI Validation (RECOMMENDED)

When to use:

  • Before pushing to GitHub
  • Before creating a PR
  • When ensuring complete CI pipeline health
  • When multiple job types are failing
  • Default for comprehensive validation

Steps:

  1. Invoke ci-debugger Agent

    Use the Task tool to delegate complete CI validation:

    Task(
      subagent_type="ci-debugger",
      description="Run complete CI pipeline validation and fix all failures",
      prompt="Execute full local CI pipeline using `pnpm ci:local`. Identify all failing jobs (bootstrap, lint, typecheck, test, build, security) and systematically fix them until 100% CI success rate is achieved. Delegate to lint-debugger for extensive lint/type issues and test-debugger for test failures as appropriate."
    )
    
  2. Wait for ci-debugger Completion

    The ci-debugger will:

    • Run complete CI pipeline
    • Fix bootstrap issues first (dependencies)
    • Fix type-checking errors (may delegate to lint-debugger)
    • Fix linting issues (may delegate to lint-debugger)
    • Fix test failures (may delegate to test-debugger)
    • Fix build issues
    • Handle security issues
    • Iterate until all jobs pass
  3. Review ci-debugger Results

    The agent will return:

    • Complete CI job status (all should be PASS)
    • Summary of all fixes applied
    • Files modified by category
    • Delegation summary (which agents were invoked)
    • Final validation confirmation
  4. Proceed to Phase 3

    Once ci-debugger reports 100% CI success, move to final validation.

Delegation Summary:

  • ci-debugger handles complete orchestration
  • Automatically delegates to lint-debugger when: >50 lint errors OR >20 type errors
  • Automatically delegates to test-debugger when: >10 test failures
  • Handles bootstrap, build, and security issues directly

Option B: Individual Agent Validation (FASTER ITERATION)

When to use:

  • During active development
  • When only specific job types are failing
  • For faster iteration cycles
  • When you know exactly which area needs fixing

Steps:

  1. Fix Linting and Type-Checking First (if failing)

    If lint or typecheck jobs failed in Phase 1:

    Task(
      subagent_type="lint-debugger",
      description="Fix all linting and type-checking errors",
      prompt="Run all linting and type-checking tools (ESLint, Prettier, TypeScript). Fix all errors systematically until
    

Maintain Validate?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Validate on getagentictools](https://getagentictools.com/loops/btachinardi-dev-validate?ref=badge)
npx agentictools info loops/btachinardi-dev-validate

The second line is the CLI lookup for this page — handy in READMEs and docs.