# Agent Player Achievements (AGPA) ๐
EN | ไธญๆ | ES | ํ๊ตญ์ด | ๆฅๆฌ่ช
Gamified achievement system for AI coding agents.
Earn XP, unlock trophies, level up โ just by doing what you already do.
Claude Code ยท Kilo Code ยท OpenCode ยท Hermes ยท OpenClaw
Quick Start ยท How It Works ยท Features ยท Supported Tools ยท CLI Commands ยท Community Packs ยท Dashboard ยท Security & Privacy ยท Contributing ยท FAQ
--- ### Without AGPA โ - **No visibility** into your coding habits across sessions - **Can't track progress** โ getting faster? Using more tools? No way to know - **No motivation** to explore your agent's full feature set - **Same routine** every day โ no surprises, no milestones ### With AGPA โ - **Auto-tracking** โ every tool call, file edit, and git commit logged automatically - **Steam-style dashboard** โ XP bar, levels, streaks, heatmaps, achievement showcase - **217 achievements** across 11 categories โ from "Hello World" to "Completionist" - **Instant feedback** โ terminal popups, macOS notifications, 8-bit sounds on unlock --- ## Dashboard Preview
![]() Home โ XP bar, streaks, agent stats |
![]() Achievements โ 217 achievements ร 11 categories |
![]() Sets โ themed collections with progress tracking |
![]() Detail Card โ rarity, unlock date, replay animation |
Stats row โ Streak + Heatmap โ Showcase โ Achievement grid with search/filter
```bash agpa dashboard # default :3867 agpa dashboard 8080 # custom port agpa dashboard --profile work # launch with specific profile ``` - **Stats**: XP, level, total achievements, streak, tasks, tool uses - **Heatmap**: GitHub-style 4-month activity grid - **Showcase**: Pinned favorite achievements (up to 6) - **Achievement Grid**: search, sort by rarity/category, filter unlocked/locked - **Sound toggle**: 8-bit rarity-graded effects - **Share button**: generates a beautiful bilingual card โ PNG download ## Architecture ``` โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Engine (src/engine/) โ โ track() / poll() โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ MCP Server Hook CLI (src/main.ts) (src/cli/hook.ts) โ โ STDIO long-lived short-lived subprocess โ (stdin pipe) โ โ Agent calls Hooks fire consciously automatically โ โ โโโโโโโดโโโโโโ โโโโโโโโดโโโโโโโ โ Manual โ โ Auto-track โ โ image.read โ โ tool.completeโ โ lang_used โ โ file.edit โ โ plan.mode โ โ session.* โ โ ... โ โ agent.spawn โ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โฒ โฑ event.log โ both write here โ engine.poll() โ state.json โ Dashboard ``` ## Project Structure ``` src/ โโโ main.ts # MCP Server entry (STDIO) โโโ tool-registry.ts # Central tool registration โโโ cli/ โ โโโ index.ts # Unified CLI entry (27 commands) โ โโโ hook.ts # Hook CLI (track + poll + auto modes) โ โโโ init.ts # Interactive install wizard โ โโโ dashboard.ts # Dashboard launcher โ โโโ doctor.ts # System diagnostic โ โโโ ... # 22 more CLI commands โโโ engine/ โ โโโ engine.ts # Core engine (track / poll / stats) โ โโโ evaluator.ts # 12 condition type evaluators โ โโโ store.ts # JSONL event log + state persistence โ โโโ types.ts # TypeScript interfaces โ โโโ yaml-parser.ts # YAML achievement definition parser โโโ dashboard/ โ โโโ server.ts # HTTP server + API routes โ โโโ api.ts # Card data, stats aggregation โ โโโ public/ # Zero-framework HTML/CSS/JS frontend โ โโโ customize-api.ts # Self-customize endpoint โโโ tools/ # MCP tool definitions (7 tools) โโโ utils/ # notify, validate, profile, pixel-art, battery, etc. โโโ verify/ โ โโโ auditor.ts # Achievement verification logic โโโ config.ts # Global configuration โโโ helpers.ts # Shared utilities pixel-art-output/ # Logo images (README) achievement-definitions.yaml # 217 achievement definitions (authoritative) scripts/ # dev tools (logo gen, pixel art gen, sounds) ``` ## ๐ Security & Privacy - **Local-first** โ All event data stays in `~/.agent-achievements/`. No telemetry, no cloud sync, no network calls at runtime. - **Auditable** โ The engine is pure TypeScript functions operating on JSONL files. No obfuscation, no binary blobs. - **Minimal dependencies** โ 5 runtime dependencies (`@modelcontextprotocol/sdk`, `yaml`, `zod`, `figlet`, `tsx`) โ all widely audited. - **STDIO isolation** โ The MCP server communicates via standard I/O only. No HTTP endpoints exposed. - **Hook sandbox** โ The Hook CLI runs as a sub-millisecond subprocess โ it cannot persist state or access the network. - **Supply chain** โ No native modules, no postinstall scripts, no binary downloads at install time. To report a vulnerability, see [SECURITY.md](SECURITY.md). ## ๐ฅ Contributing We welcome contributions! Whether it's an achievement pack, a Dashboard improvement, a new tool integration, or an engine fix โ there's a path for every skill level. - **[CONTRIBUTING.md](CONTRIBUTING.md)** โ setup, coding conventions, PR process, and 4 contribution paths - **[Creating Achievement Packs](docs/creating-achievements.md)** โ the complete guide to writing achievement definitions - **[`.github/ISSUE_TEMPLATE/`](.github/ISSUE_TEMPLATE/)** โ issue and PR templates ## ๐ Environment Variables | Variable | Description | Default | Values | |----------|-------------|---------|--------| | `AGPA_PROFILE` | Active profile name | `default` | any string | | `AGPA_LANG` | Interface language | `en` | `en`, `zh` | | `AGPA_ENABLED_CATEGORIES` | Filter which achievement categories are active | all | comma-separated (e.g. `onboarding,tool_mastery`) | | `AGPA_DEBUG` | Enable verbose debug logging | `false` | `true` | | `AGPA_SOUND` | Override sound effects | config setting | `on`, `off`, `true`, `false` | | `AGPA_SIMPLE_ANIMATIONS` | Use simplified terminal animations | `false` | `true` | | `AGPA_BANNER_THEME` | CLI startup banner style | `Arcade` | `Neon`, `Arcade`, `Gold` | | `AGPA_TELEMETRY` | Enable anonymous usage telemetry | `false` | `true`, `false` | | `AGPA_TELEMETRY_SERVER` | Custom telemetry endpoint URL | `''` (none) | URL string | | `AGPA_TOOL_SOURCE` | Override tool source identifier | auto-detected | `claude-code`, `hermes`, `openclaw`, etc. | | `AGPA_MODEL` | Current AI model name (for achievements) | `auto` | any model string | > [!TIP] > Environment variables override `config.json` settings. Set them in your shell profile or agent configuration for persistent overrides. ## FAQ **Q: Does this slow down my agent?** A: No. The Hook CLI is a sub-millisecond subprocess. The MCP server runs on STDIO with zero network overhead. **Q: Can I use it with multiple agents?** A: Yes. The init wizard auto-detects Claude Code, Kilo Code, OpenCode, Hermes, and OpenClaw. Each can have its own profile. **Q: My achievements aren't unlocking?** A: Run `agpa doctor` โ it diagnoses tracking status, hook registration, and event coverage. **Q: How is this different from WakaTime or coding activity trackers?** A: WakaTime tells you *what* you did โ hours, languages, projects. AGPA makes it *fun* โ XP, levels, achievements, streaks, and Steam-style dopamine hits. It's gamification layered on top of your existing workflow, not another dashboard to check. Think of it as the difference between a fitness tracker's raw step count and a Pokรฉmon Go badge โ same data, different experience. **Q: Can I customize achievement names?** A: Yes. `/customize` page in the dashboard lets you rename any achievement. ## Troubleshooting > [!IMPORTANT] > **First step for any issue:** Run `agpa doctor` โ it diagnoses tracking status, hook registration, event coverage, and configuration problems in one shot. | Symptom | Likely Cause | Fix | |---------|-------------|-----| | Achievements not unlocking | Hook/MCP not registered | Run `agpa doctor` to check hook registration + event coverage | | Dashboard won't start | Port 3867 already in use | `agpa dashboard 8080` (or any free port) | | `agpa init` fails | Agent tool not detected | Check supported tools list; use manual MCP JSON config as fallback | | No macOS notifications | `terminal-notifier` missing | Run `brew install terminal-notifier`, or `agpa init` auto-installs it | | Sound not playing | Audio context blocked by browser | Click anywhere on the dashboard page to enable audio | | Profile switching not working | Profile doesn't exist | `agpa profile list` to see available profiles, then `agpa profile switch