# =============================================================================
# OMGKIT Workflow Configuration
# =============================================================================
# This file configures your Git workflow, commit conventions, PR settings,
# code review automation, and deployment preferences.
#
# Documentation: https://omg.mintlify.app/skills/workflow-config
# Generated by: omgkit init
# =============================================================================

version: "1.0"

# =============================================================================
# GIT WORKFLOW
# =============================================================================
git:
  # Workflow type: trunk-based | gitflow | github-flow
  workflow: trunk-based

  # Main branch name
  main_branch: main

  # Branch naming prefixes
  branch_prefix:
    feature: "feature/"
    fix: "fix/"
    hotfix: "hotfix/"

  # Maximum branch age in days (for trunk-based)
  max_branch_age_days: 2

  # Auto-delete branch after merge
  delete_branch_on_merge: true

# =============================================================================
# COMMIT CONVENTIONS
# =============================================================================
commit:
  # Use conventional commits (type: subject)
  conventional: true

  # Require scope: type(scope): subject
  require_scope: false

  # Allowed commit types
  allowed_types:
    - feat      # New feature
    - fix       # Bug fix
    - docs      # Documentation
    - style     # Formatting
    - refactor  # Code restructuring
    - perf      # Performance
    - test      # Tests
    - chore     # Maintenance

  # Maximum subject line length
  max_subject_length: 72

# =============================================================================
# PULL REQUEST SETTINGS
# =============================================================================
pr:
  # PR template: auto | none | path/to/template.md
  template: auto

  # Require review before merge
  require_review: true

  # Minimum reviewers
  min_reviewers: 1

  # Create as draft by default
  draft_by_default: false

  # Squash merge commits
  squash_merge: true

  # Auto-labeling
  labels:
    enabled: true
    by_path:
      "src/api/**": ["backend"]
      "src/ui/**": ["frontend"]
      "tests/**": ["testing"]

# =============================================================================
# CODE REVIEW
# =============================================================================
review:
  # Enable Claude auto-review
  auto_review: true

  # Review checks
  checks:
    - security
    - performance
    - best-practices

  # Block merge on critical issues
  block_on_critical: true

# =============================================================================
# DEPLOYMENT
# =============================================================================
deploy:
  # Provider: vercel | netlify | aws | none
  provider: vercel

  # Production branch
  production_branch: main

  # Preview deployments for PRs
  preview_on_pr: true

  # Auto-deploy on merge
  auto_deploy: true

# =============================================================================
# GIT HOOKS
# =============================================================================
hooks:
  pre_commit:
    enabled: true
    actions:
      - lint
      - format

  commit_msg:
    enabled: true
    validate_conventional: true

  pre_push:
    enabled: true
    actions:
      - test

# =============================================================================
# TESTING AUTOMATION
# =============================================================================
testing:
  # Enforcement level: soft | standard | strict
  enforcement:
    level: standard

  # Auto-generate test tasks when creating features
  auto_generate_tasks: true

  # Coverage gates
  coverage_gates:
    unit:
      minimum: 80
      target: 90
    integration:
      minimum: 60
      target: 75
    overall:
      minimum: 75
      target: 85

  # Required test types
  required_test_types:
    - unit
    - integration

  # Block completion on test failure
  blocking:
    on_test_failure: true
    on_coverage_below_minimum: true

# =============================================================================
# FEATURE FLAGS
# =============================================================================
feature_flags:
  # Provider: none | vercel-edge | launchdarkly | unleash
  provider: none

  # Default state for new flags
  default_state: false

# =============================================================================
# REFERENCE-AWARE PLANNING
# =============================================================================
references:
  # Enable reference loading in sprints
  enabled: true

  # Auto-suggest relevant artifacts when creating sprints
  auto_suggest: true

  # Maximum tokens for reference content (prevent context overflow)
  max_tokens: 10000

  # Section extraction settings for PRD/spec files
  extract_sections:
    - requirements
    - user_stories
    - acceptance_criteria
    - constraints
    - api_endpoints

  # Propagate references to child commands
  propagation:
    # Pass sprint refs to team-run
    to_team_run: true

    # Pass sprint refs to individual tasks
    to_tasks: true

    # Pass refs to feature/fix commands
    to_dev_commands: true

  # Reference validation
  validation:
    # Check if referenced files exist
    check_exists: true

    # Warn if references are outdated (modified after sprint creation)
    check_freshness: true

    # Maximum file age in days before warning
    max_age_days: 30

# =============================================================================
# SPRINT SHIP CONFIGURATION
# =============================================================================
ship:
  # Run tests before shipping
  auto_test: true

  # Test command to run (uses package.json test script by default)
  test_command: "npm test"

  # Create PR instead of direct push
  create_pr: true

  # PR settings (when create_pr: true)
  pr:
    # Create as draft
    draft: false

    # Auto-assign reviewers
    reviewers: []

    # Auto-add labels
    labels: ["sprint-complete"]

  # Commit message settings
  commit:
    # Commit message prefix
    prefix: "feat(sprint)"

    # Include retrospective in commit body
    include_retrospective: true

    # Include metrics in commit body
    include_metrics: true

  # Ship behavior
  behavior:
    # Allow shipping with incomplete tasks (requires --force)
    allow_incomplete: false

    # Archive sprint after successful ship
    archive_sprint: true

    # Run lint/format before commit
    pre_commit_checks: true
