# ============================================================================
# CONFIGURATION TEMPLATE - vibe-validate for Node.js Applications
# ============================================================================
#
# USAGE:
#   1. Copy this file to your project root as 'vibe-validate.config.yaml'
#   2. Customize the validation phases and commands for your project
#   3. Run: vibe-validate validate
#
# This template is optimized for Node.js applications including backend services,
# REST APIs, Express/Fastify apps, CLI tools, and serverless functions.
# It includes pre-configured validation phases for type checking, linting,
# unit tests, integration tests, and building.
#
# Learn more: https://github.com/jdutton/vibe-validate/blob/main/docs/skills/setting-up-projects/configuration-reference.md
# ============================================================================

$schema: https://unpkg.com/@vibe-validate/config/config.schema.json

# Git settings
git:
  mainBranch: main

# Pre-commit hooks configuration
hooks:
  preCommit:
    enabled: true
    # Secret scanning prevents accidental credential commits
    secretScanning:
      enabled: true
      # Autodetect mode (recommended): Automatically uses optimal commands
      #
      # vibe-validate automatically optimizes for pre-commit performance:
      #   gitleaks:   Only scans staged files (0.2s)
      #   secretlint: Only scans staged files (0.8s)
      #
      # 1. gitleaks (RECOMMENDED - fastest, 160+ secret types):
      #    macOS: brew install gitleaks
      #    Create .gitleaks.toml or .gitleaksignore to enable autodetect
      #
      # 2. secretlint (npm-based, always available):
      #    npm install --save-dev @secretlint/secretlint-rule-preset-recommend secretlint
      #    Create .secretlintrc.json to enable autodetect
      #
      # 3. Both tools (defense-in-depth):
      #    Create both config files - runs both automatically
      #
      # 4. Explicit command (advanced):
      #    scanCommand: "gitleaks protect --staged --verbose"

# Validation configuration
validation:
  phases:
    - name: Pre-Qualification
      parallel: true
      steps:
        - name: TypeScript
          command: tsc --noEmit
        - name: ESLint
          command: eslint src/

    - name: Testing
      parallel: true
      steps:
        - name: Unit Tests
          command: npm run test:unit
        - name: Integration Tests
          command: npm run test:integration

    - name: Build
      steps:
        - name: Build
          command: npm run build
