<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->

# API Reference — Detection Gap Remediation

## Agent Tools

| Tool | Description |
|---|---|
| Gap Prioritizer | `prioritize_gaps(gaps)` — Rank gaps by threat and feasibility |
| Sprint Planner | `plan_sprint(gaps, capacity)` — Select gaps for sprint |
| Progress Tracker | `track_remediation(original, remediated)` — Measure progress |

## CLI Usage

```bash
# Prioritize
node agent.js prioritize --gaps '[{"technique": "T1078", "threat_relevance": "high"}]'

# Plan sprint
node agent.js sprint --gaps '[{"technique": "T1078"}]' --capacity 5

# Track progress
node agent.js progress --original 20 --remediated 12
```

## Output Format

All commands return JSON with the following structure:

```json
{
  "action": "<command_name>",
  "...": "command-specific fields"
}
```

## Error Handling

- Invalid input returns `{"error": "description"}` with non-zero exit code
- JSON parsing errors are caught and reported with context
- Missing required arguments trigger argparse help display
