DEV Community

Cover image for Repo maintenance is boring. So I turned it into an RPG with GitHub Copilot CLI.
Maple๏ผ
Maple๏ผ

Posted on

Repo maintenance is boring. So I turned it into an RPG with GitHub Copilot CLI.

GitHub Copilot CLI Challenge Submission

This is a submission for the GitHub Copilot CLI Challenge

What I Built

git-quest (@maplekuo/git-quest) is an MCP (Model Context Protocol) server that integrates directly into GitHub Copilot CLI's tool system.

Key Features:

  • ๐ŸŽฎ 5 MCP tools: scan_quests, accept_quest, verify_quest, player_stats, quest_log
  • ๐Ÿ“œ 3 scanners: missing-docs (โ˜…โ˜†โ˜†), todo-hunter (โ˜…โ˜…โ˜†), missing-tests (โ˜…โ˜…โ˜…)
  • ๐Ÿ‰ Boss Quests: multi-issue files that require comprehensive cleanup
  • โš”๏ธ 6 levels: Novice โ†’ Apprentice โ†’ Journeyman โ†’ Expert โ†’ Master โ†’ Legend
  • ๐Ÿ… 6 badges: First Blood, Scribe, Exterminator, Guardian, Dragon Slayer, Perfectionist
  • ๐Ÿ’พ Persistent progress via .git-quest.json in your repo
  • ๐Ÿ”ง One-command setup: npx @maplekuo/git-quest setup

Tech Stack: TypeScript, Node.js, @modelcontextprotocol/sdk (stdio transport). Zero external dependencies beyond the MCP SDK.

Demo

Here's what it looks like in action. I pointed git-quest at a demo repository with intentionally messy code โ€” missing JSDoc, scattered TODOs, hack workarounds, and untested utilities.

Step 1: Scan for Quests

MCP connection and quest board scan showing 16 quests discovered

One command. Copilot CLI connects to the git-quest MCP server and scans the repo. 16 quests found โ€” each with a name, difficulty rating, type, and location. The quest board reads like a dungeon map: "The Undocumented AuthManager" (โ˜…โ˜†โ˜†), "The Cursed Workaround" (โ˜…โ˜…โ˜†), "Purify utils.ts" (โ˜…โ˜…โ˜…โ˜… Boss).

Step 2: Accept a Quest

Accepting The Undocumented AuthManager quest

"Accept quest 1" โ€” and you're locked in. The quest objective is clear: add JSDoc documentation to the AuthManager class in src/auth.ts. Difficulty: โ˜…โ˜†โ˜†. Reward: 10 XP. Simple enough for a first quest.

Step 3: Let Copilot CLI Solve It

Copilot CLI thinking and completing the quest with +10 XP

Copilot CLI verifying quest completion with +10 XP

Here's where it gets interesting. I just said "complete this quest" โ€” and Copilot CLI took over. It read the source file, analyzed the class structure, wrote proper JSDoc for every method, edited the file, and called verify_quest to check its own work. โœ… QUEST COMPLETE. +10 XP.

No copy-pasting. No tab-switching. The AI read the quest, understood the objective, fixed the code, and verified the result โ€” all in one agentic loop.

Step 4: A Harder Quest โ€” Fixing a HACK

Accepting The Cursed Workaround HACK quest

Time to raise the stakes. Quest 7: "The Cursed Workaround" โ€” a HACK comment buried in the authentication module at line 32. This isn't just adding docs; it requires understanding why the hack exists and replacing it with a proper implementation.

Step 5: Copilot's Deep Reasoning ๐Ÿ”ฅ

Copilot CLI deep reasoning about session management architecture

This screenshot is my favorite. Watch what Copilot CLI does when asked to fix the HACK:

It doesn't just delete the comment. It reasons about session management architecture. It considers multiple approaches โ€” HMAC-based tokens, session maps, token expiry strategies โ€” and then makes an architectural decision before writing a single line of code. This is Copilot CLI acting as a senior engineer, not a code completion tool.

Step 6: Level Up! ๐ŸŽ‰

Quest complete with +15 XP and level up to Apprentice

The HACK quest is done. src/auth.ts gains 46 new lines of proper session management code, replacing 2 lines of hack. +15 XP. Leveled up to Apprentice. The dopamine hit is real.

Step 7: Player Stats

Final player stats showing Level Apprentice, 25 XP, 2 quests, First Blood badge

Two quests down. Level: Apprentice. XP: 25. Quests completed: 2. Badge earned: First Blood ๐Ÿฉธ. The stat card makes you want to keep going โ€” there are 14 quests left and 5 more levels to climb.

Step 8: Boss Quest ๐Ÿ‰

Boss Quest Purify utils.ts with multi-step planning

And then there's the Boss Quest. "๐Ÿ‰ Purify utils.ts" (โ˜…โ˜…โ˜…โ˜…) โ€” a file with multiple issues that all need fixing: missing JSDoc, broken parsing logic, scattered TODOs, and no tests.

Copilot CLI plans a multi-step attack: add documentation, fix the parser, remove TODOs, create a test file. It reads utils.ts, edits it (+48 lines, -9 lines), creates utils.test.ts from scratch (+30 lines), and calls verify_quest. The boss doesn't go down easy โ€” verification catches remaining issues, and Copilot reports back honestly: "tell me which specific checks to target, or I can re-scan and iterate."

That's the beauty of the verification system. It's not a rubber stamp. The boss fight actually requires multiple rounds.

My Experience with GitHub Copilot CLI

Building git-quest: The One-Shot Story

I built git-quest almost entirely in a single Copilot CLI session. I wrote one comprehensive prompt โ€” essentially a PRD covering the full project structure, all 5 MCP tools, 3 scanners, the game system, setup CLI, and demo repo โ€” and Copilot CLI built it in one pass:

  • 10 TypeScript source files
  • Clean build with zero TypeScript errors
  • 363-line index.ts with all tool handlers
  • Setup CLI, demo repo, and package.json all wired up

It wasn't completely hands-free. I hit a few bumps:

  1. MCP config path: Copilot CLI's setup generated a config at ~/.config/github-copilot/mcp.json, but the correct path is ~/.copilot/mcp-config.json. This isn't well-documented and took trial-and-error to figure out.

  2. Build output mismatch: The config pointed to dist/index.js but TypeScript compiled to dist/src/index.js. A small path bug, but it meant the MCP server silently failed to load.

  3. The "why isn't it working" phase: My first scan attempt failed because Copilot CLI read the README instead of calling the MCP tool. Turns out the MCP server wasn't actually connected. Debugging MCP server loading is still rough โ€” there's no clear error message when it fails.

  4. Verification edge cases: The initial JSDoc verification searched too narrow a window (ยฑ5 lines from the function). After a few false negatives, I expanded the search window to ยฑ10/ยฑ15 lines, which fixed the issue.

But the core development story is real: one prompt, one session, one functional MCP server. The iteration was all in the details โ€” config paths, verification logic, npm publishing quirks.

What Surprised Me

The biggest surprise was watching Copilot CLI use git-quest's tools autonomously. I expected to manually orchestrate each step (scan โ†’ accept โ†’ edit โ†’ verify). Instead, Copilot CLI figured out the workflow on its own. It called accept_quest, read the relevant file, made edits, called verify_quest, and when verification failed, it re-edited and retried โ€” all without me telling it to.

This is the MCP protocol at work. By exposing structured tools with clear descriptions, Copilot CLI knows exactly when to call them and what the expected workflow is. git-quest isn't just a project built with Copilot CLI โ€” it's a project that makes Copilot CLI better at its job.

The Dual Role of Copilot CLI

There's a meta quality to this project that I find compelling:

  • Copilot CLI as developer tool: I used it to build git-quest itself.
  • Copilot CLI as quest solver: Users use it to complete quests that git-quest generates.
  • Copilot CLI as MCP client: It calls git-quest's tools to scan, accept, and verify.

It's Copilot CLI all the way down. The tool I used to build the project is the same tool that runs it.

Try It Yourself

# Install and set up (auto-configures MCP for Copilot CLI)
npx @maplekuo/git-quest setup

# Start Copilot CLI
copilot

# Scan your repo for quests
> use the git-quest scan_quests tool to scan this repo

# Accept and complete a quest
> accept quest 1
> complete this quest

# Check your progress
> show my player stats
Enter fullscreen mode Exit fullscreen mode

Works with any repo. The messier the codebase, the more quests you'll find. ๐ŸŽฎ

Repo maintenance is boring. But leveling up never gets old.

โš”๏ธ Go quest. โ†’ github.com/Mapleeeeeeeeeee/git-quest

Top comments (0)