This is a submission for the GitHub Copilot CLI Challenge
What I Built
Repo Doctor is an AI-powered CLI tool that acts as your repository's personal physician. It diagnoses GitHub repositories for health issues across 6 critical areas and prescribes actionable solutions.
π₯ The Problem
Every developer has inherited a codebase and wondered: "Is this repo healthy? What's missing? Where do I start?" Manually auditing a repository for best practices is tedious and easy to overlook.
π The Solution
Repo Doctor performs comprehensive health checks and delivers a diagnosis with:
- π Health Score β A 0-100% rating based on 6 categories
- π Prioritized Findings β P0 (critical), P1 (high), P2 (suggestions)
- π‘ Actionable Remediation β Specific fixes with code snippets
- π― Evidence-Based β Every finding backed by file evidence
6 Analysis Categories
| Category | What's Checked |
|---|---|
| π Docs & Onboarding | README quality, setup instructions, contributing guide |
| β‘ Developer Experience | Build scripts, lockfiles, project structure |
| π CI/CD | GitHub Actions, test automation, quality gates |
| π§ͺ Quality & Tests | Test framework, linting, code coverage |
| π Governance | LICENSE, CODE_OF_CONDUCT, SECURITY policy |
| π Security | Dependabot, secret scanning, security policy |
Two Analysis Modes
-
π Quick Scan (
/analyze) β Fast analysis via GitHub API (up to 20 file reads) -
π¬ Deep Analysis (
/deep) β Full source code scan using Repomix for comprehensive review
Demo
π GitHub Repository: github.com/glaucia86/repo-doctor
See it in Action
The CLI provides an interactive experience with:
- Real-time streaming analysis
- Slash commands (
/analyze,/deep,/copy,/export) - Beautiful terminal UI with progress indicators
- Prioritized findings with evidence and remediation steps
My Experience with GitHub Copilot CLI
Building with the GitHub Copilot SDK
Repo Doctor is built entirely with the GitHub Copilot SDK β the same AI agent runtime that powers Copilot CLI. This was my first deep dive into building an agentic CLI tool, and the experience was transformative.
How Copilot CLI Enhanced Development
1. Rapid Prototyping with Natural Language
Using Copilot CLI during development, I could quickly explore ideas:
$ copilot "How do I use defineTool() to create a custom tool that reads files from GitHub?"
The AI provided working examples that I adapted for my repoTools.ts, saving hours of documentation reading.
2. Architecture Decisions
When designing the agent's system prompt, Copilot CLI helped me iterate on the analysis strategy:
$ copilot "What's the best way to structure a repository health check?
I want to analyze docs, CI/CD, tests, and security."
This led to the 6-category framework with P0/P1/P2 prioritization.
3. Security Implementation
Copilot CLI was invaluable for implementing prompt injection protection:
$ copilot "How do I prevent prompt injection when the AI reads untrusted file content?"
The suggestions led to my content sanitization layer that wraps all file content with delimiters and detects malicious patterns.
Key Technical Highlights
Custom Tools with defineTool():
const readRepoFile = defineTool("read_repo_file", {
description: "Reads file content from repository with security sanitization",
parameters: { /* ... */ },
handler: async (args) => {
const sanitized = sanitizeFileContent(rawContent, path);
return { content: sanitized.content, securityFlags: sanitized.flags };
},
});
Streaming Session with Event Handling:
const session = await client.createSession({
model: "claude-sonnet-4",
streaming: true,
tools: repoTools({ token }),
systemMessage: { mode: "append", content: SYSTEM_PROMPT },
});
session.on((event) => {
if (event.type === "assistant.message_delta") {
process.stdout.write(event.data.deltaContent); // Real-time output
}
});
The Impact
Building Repo Doctor with GitHub Copilot CLI fundamentally changed how I approach CLI development:
- 10x faster iteration β Natural language queries replaced stack overflow searches
- Better architecture β AI suggestions led to cleaner patterns
- Security by default β Copilot helped identify edge cases I would have missed
- Joy of building β The interactive development loop made coding fun again
Tech Stack
- GitHub Copilot SDK β AI agent orchestration
- Octokit β GitHub API integration
- Repomix β Repository packing for deep analysis
- TypeScript β Type-safe development
- Zod β Runtime validation
- Chalk + Ora β Beautiful terminal UI
Repo Doctor is open source and available on GitHub. Give your repositories a health checkup! π©Ί

Top comments (0)