š„ RepoDoctor - AI-Powered Repository Health Analysis with GitHub Copilot CLI
Source: Dev.to
RepoDoctor ā A CopilotāFirst CLI for Codebase Health
RepoDoctor is a Copilotāfirst CLI tool that revolutionizes how developers analyze and maintain their codebases. Instead of relying on rigid, hardācoded rules like traditional staticāanalysis tools, RepoDoctor acts as an intelligent orchestrator that delegates all analysis logic to the GitHub Copilot CLI.
Think of it as an AIāpowered ācode doctorā that can:
| Emoji | Capability |
|---|---|
| š | Diagnoses bloat ā identifies large files, build artifacts, and missing hygiene files |
| š | Creates onboarding guides ā generates comprehensive TOUR.md files for new contributors |
| š³ | Audits Dockerfiles ā provides security and optimization recommendations |
| š | Detects dead code ā finds unused code with confidence levels |
| š¬ | Performs health scans ā multiāmodule analysis with overall health scoring |
| š | Generates reports ā beautiful Markdown reports from scan results |
What makes RepoDoctor special?
Traditional tools like ESLint, Pylint, or SonarQube use static rules that canāt understand context. They tell you what is wrong but not why or how to fix it in your specific situation.
RepoDoctor is different because:
- ā Contextual AI Analysis ā understands your tech stack, project structure, and patterns
- ā Actionable Recommendations ā not just āthis is bad,ā but āhereās how to improve itā
- ā Zero Configuration ā no complex rule files or config needed
- ā Extensible Prompts ā easy to add new analysis types with prompt templates
- ā HumanāReadable Output ā generates documentation, not just error lists
Why it matters to me
As a developer Iāve spent countless hours:
- Onboarding new team members who struggle to understand large codebases
- Debugging performance issues caused by bloated repositories
- Reviewing PRs with potential security issues in Docker configurations
- Hunting for dead code that clutters the codebase
RepoDoctor solves these pain points by leveraging AI to provide intelligent, contextāaware analysis that actually helps developers improve code quality.
GitHub Repository:
PyPI Package:
Documentation:
Demo
(Insert demo GIF or screenshot here)
Installation
# From PyPI
pip install repodoc
# From uv
uv install repodoc
# Run without installing
uv tool run repodoc
Basic Commands
| Command | Description |
|---|---|
repodoc diet | Analyze repository bloat |
repodoc tour | Generate onboarding guide |
repodoc scan | Run full health scan |
repodoc report | Generate beautiful report |
Architecture ā AI as the Analysis Engine
Building RepoDoctor was a transformative experience that fundamentally changed how I approach software development. The GitHub Copilot CLI became the core architecture of the entire application.
Core Concepts
- Prompt Templates ā each analysis type (
diet,tour,docker, etc.) has a carefully crafted prompt. - Workflow Orchestration ā RepoDoctor manages file discovery, data collection, and output formatting.
- AI Delegation ā all actual analysis logic is delegated to the Copilot CLI.
- Schema Validation ā Pydantic schemas ensure the AI returns structured, reliable data.
Prompt Engineering as Code
The promptātemplate system supplies Copilot CLI with:
- Context ā file listings, directory structure, key metrics
- Instructions ā clear objectives and outputāformat requirements
- Constraints ā what to focus on, what to ignore
- Examples ā sample outputs to guide the AI
Iterative Development with Copilot CLI
During development Copilot CLI helped with:
Code Generation
# Boilerplate for Typer commands
# Pydantic schemas for each analysis type
# Async orchestration for subprocess management
Debugging
copilot "Why is this pytest fixture not mocking shutil.which correctly?"
copilot "How do I handle UTF-8 encoding on Windows for subprocess output?"
Architecture Decisions
copilot "Should I use sync or async for subprocess calls to GitHub Copilot CLI?"
copilot "What's the best way to cache analysis results for the report command?"
AIāPowered Documentation Generation
The tour command is my favorite featureāit uses Copilot CLI to generate comprehensive onboarding guides by analyzing:
- Project structure
- Code patterns
- Tech stack
- Dependencies
- Common workflows
What would take hours to write manually is produced in seconds with contextāaware understanding of the codebase.
Virtual Company ā A Collection of Specialized Agent Skills
One of my secret weapons was the Virtual Company projectāa collection of 27 specialized agent skills that enhance AI agents with domaināspecific expertise. These skills act as expert personas that guide Copilot CLI through complex workflows, turning it into a team of specialized experts (senior developer, tech writer, QA engineer, DevOps specialist, etc.).
Virtual Company (open source):
Before Copilot CLI + Virtual Company
| ā | Issue |
|---|---|
| Spent hours writing static analysis rules | |
| Struggled with complex regex patterns | |
| Wrote boilerplate code manually | |
| Contextāswitched between docs and coding |
After Copilot CLI + Virtual Company
| ā | Benefit |
|---|---|
| 10Ć faster development ā instant code generation & debugging | |
| Expertālevel guidance ā each skill provides specialized domain knowledge | |
| Better architecture ā async patterns suggested by the techālead skill | |
| Fewer bugs ā AIāreviewed code with the bugāhunter skill before running | |
| More creativity ā time spent on features, not implementation details | |
| Continuous learning ā Copilot taught new Python patterns & best practices | |
Comprehensive testing ā testāgenius skill helped achieve 48 passing tests |
Happy coding with RepoDoctor ā let AI keep your repository healthy!
r mocking
The most mindābending part? I built a tool powered by GitHub Copilot CLI, while using GitHub Copilot CLI to build it. š¤Æ
It was like:
- Using Copilot CLI to debug Copilot CLI integration
- Asking Copilot to generate prompts for Copilot
- Having Copilot help me test code that invokes Copilot
This recursive AIāassisted development felt like a glimpse into the future of software engineering.
Key Takeaways
- AIāFirst Architecture is Real ā RepoDoctor proves you can build production tools with AI as the core logic engine.
- Prompt Engineering Matters ā The quality of your prompts directly impacts output quality.
- Specialized Skills Amplify AI ā Using domaināspecific agent skills (e.g., Virtual Company) accelerates development exponentially.
- Copilot CLI for Everything ā From code generation to debugging to documentation.
- Ship Faster, Iterate Smarter ā Copilot CLI enabled rapid prototyping and validation.
- The Future is AIāNative ā Tools will increasingly delegate intelligence to AI rather than hardācode it.
Quick Start
uv install repodoc
cd your-project
repodoc scan
Links
- GitHub:
- PyPI:
Built with ā¤ļø and š¤ by @k1lgor using GitHub Copilot CLI.