---
name: forge:config
description: View or edit FORGE configuration settings. Use when user says "forge config" or wants to change settings.
argument-hint: [key] [value]
allowed-tools:
  - Read
  - Write
  - Bash
---

<objective>
View current FORGE configuration or modify specific settings.

Purpose: Configure FORGE behavior for the project.
Output: Current settings or updated configuration.
</objective>

<execution_context>
**Load these files NOW:**

- @.planning/forge.config.json (Current configuration)
- @state/STATE.json (Project state)
</execution_context>

<context>
**Configuration File:** .planning/forge.config.json
**Operation:** View (no args) or Edit (key + value)
</context>

<process>
**Execute config command:**

1. **View Configuration** (no arguments)
   ```bash
   forge config
   ```

   Output:
   ```
   FORGE Configuration:
   ───────────────────────────────────────
   mode: interactive           # Interaction mode
   depth: standard            # Planning depth
   maxTeammates: 5            # Max agents per phase
   taskLimit: 6               # Max tasks per phase
   conventionalCommits: true   # Enforce commit format
   worktreeIsolation: true    # Use worktrees for tasks
   ```

2. **View Specific Key**
   ```bash
   forge config taskLimit
   # Output: taskLimit = 6
   ```

3. **Edit Setting**
   ```bash
   forge config maxTeammates 6
   # Updates: .planning/forge.config.json
   ```

4. **Validate Changes**
   - Check value type
   - Validate ranges (e.g., maxTeammates: 2-10)
   - Verify schema compliance
   - Update STATE.json if needed

5. **Available Settings**

   | Key | Type | Default | Description |
   |-----|------|---------|-------------|
   | mode | enum | interactive | yolo, interactive, standard |
   | depth | enum | standard | quick, standard, comprehensive |
   | maxTeammates | int | 5 | Max agents per phase (2-10) |
   | taskLimit | int | 6 | Max tasks per phase (5-6 recommended) |
   | conventionalCommits | bool | true | Enforce commit format |
   | worktreeIsolation | bool | true | Use worktrees for tasks |
   | autoMerge | bool | false | Auto-merge completed tasks |

6. **Config Schema**
   ```json
   {
     "$schema": "./config.schema.json",
     "mode": "interactive",
     "depth": "standard",
     "maxTeammates": 5,
     "taskLimit": 6,
     "conventionalCommits": true,
     "worktreeIsolation": true,
     "autoMerge": false
   }
   ```
</process>

<validation>
- Type checking (int, bool, enum)
- Range validation (e.g., maxTeammates: 2-10)
- Schema compliance
</validation>

<examples>
```bash
# View all config
forge config

# View specific setting
forge config taskLimit

# Change setting
forge config maxTeammates 6

# Reset to defaults
forge config --reset
```
</examples>
