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

# API Reference — Implementing Gamified Security Training

## Agent Script

### Commands

| Command | Description |
|---|---|
| `node agent.js design --type ctf --difficulty progressive --teams 10` | Design a gamified training program |
| `node agent.js create-challenge --category phishing --difficulty medium` | Create a security challenge |
| `node agent.js leaderboard --period monthly --scope department` | Generate leaderboard report |
| `node agent.js measure-engagement --program gamified-q1 --baseline traditional-q4` | Measure gamification impact |

### Examples

```bash
# Primary workflow
node agent.js design --type ctf --difficulty progressive --teams 10

# Secondary analysis
node agent.js create-challenge --category phishing --difficulty medium

# Generate deliverable
node agent.js leaderboard --period monthly --scope department

# Measure and report
node agent.js measure-engagement --program gamified-q1 --baseline traditional-q4
```

## External Tools

| Tool | Command | Purpose |
|---|---|---|
| CTFd | `ctfd --create-event security-challenge` | CTF platform |
| KnowBe4 | `knowbe4 --gamification-report` | Gamified training metrics |
| Kahoot | `kahoot --create-quiz security-quiz` | Interactive quiz platform |

## Gamification Mechanics

| Mechanic | Purpose | Implementation |
|---|---|---|
| Points | Reward desired behaviors | Phishing reports, training completion |
| Badges | Recognition milestones | Achievement-based unlocks |
| Leaderboards | Competition and visibility | Department or team rankings |
| Challenges | Skill development | CTF, escape rooms, scenarios |
| Levels | Progression tracking | XP-based advancement |
| Rewards | Extrinsic motivation | Gift cards, swag, recognition |
