# Configuration File Schemas

## github-actions.yaml Schema

**Location:** `devforgeai/config/ci/github-actions.yaml`

```yaml
# DevForgeAI CI Configuration
# Generated by spec-driven-ci skill

cost_optimization:
  # Enable prompt caching for repeated context (90% savings)
  enable_prompt_caching: true       # boolean, default: true

  # Use Haiku model for routine operations (60x cheaper)
  prefer_haiku: true                # boolean, default: true

  # Maximum cost per story in USD
  max_cost_per_story: 0.15          # number, default: 0.15

  # Turn limits by story complexity
  max_turns:
    simple: 10                      # int, default: 10
    complex: 20                     # int, default: 20
    architecture: 30                # int, default: 30

workflow:
  # Maximum parallel jobs in matrix builds
  max_parallel_jobs: 5              # int, range: 1-10, default: 5

  # Job timeout in minutes
  timeout_minutes: 30               # int, range: 10-60, default: 30

  # GitHub Actions runner
  runner: ubuntu-latest             # string, default: "ubuntu-latest"

installer_testing:
  # Enable installer testing workflow
  enabled: false                    # boolean, default: false
```

## ci-answers.yaml Schema

**Location:** `devforgeai/config/ci/ci-answers.yaml`

```yaml
# DevForgeAI CI Headless Answers
# Pre-configured responses for AskUserQuestion in headless mode
#
# When Claude runs in GitHub Actions (headless mode), it cannot ask
# the user questions interactively. This file provides pre-configured
# answers that Claude reads instead of prompting.
#
# Format: Each entry maps a question pattern to a response.

answers:
  # Technology decisions
  - pattern: "technology|framework|library"
    response: "Use the technology specified in tech-stack.md"

  # Architecture decisions
  - pattern: "architecture|design pattern"
    response: "Follow architecture-constraints.md guidance"

  # Ambiguity resolution
  - pattern: "multiple approaches|which approach"
    response: "Use the simplest approach that meets acceptance criteria"

  # Deferral decisions
  - pattern: "defer|skip|postpone"
    response: "Do not defer any DoD items without explicit justification"

  # Test decisions
  - pattern: "test strategy|coverage"
    response: "Follow TDD workflow. Coverage thresholds: 95%/85%/80%"

  # Default fallback
  - pattern: ".*"
    response: "Use framework defaults from context files"
```

## Merge Rules

When an existing config file is found, merge using these rules:

1. **Existing values take priority** over defaults
2. **Missing keys** are filled from defaults
3. **Extra keys** in existing config are preserved
4. **Invalid values** (wrong type, out of range) trigger a warning and use the default instead

### Example Merge

Existing:
```yaml
cost_optimization:
  enable_prompt_caching: false  # User explicitly disabled
  prefer_haiku: true
```

After merge:
```yaml
cost_optimization:
  enable_prompt_caching: false  # Preserved from existing
  prefer_haiku: true            # Preserved from existing
  max_cost_per_story: 0.15      # Added from defaults
  max_turns:                    # Added from defaults
    simple: 10
    complex: 20
    architecture: 30

workflow:                        # Added from defaults
  max_parallel_jobs: 5
  timeout_minutes: 30
  runner: ubuntu-latest
```
