DEV Community

Cover image for πŸ₯ RepoDoctor - AI-Powered Repository Health Analysis with GitHub Copilot CLI
k1lgor
k1lgor

Posted on

πŸ₯ RepoDoctor - AI-Powered Repository Health Analysis with GitHub Copilot CLI

GitHub Copilot CLI Challenge Submission

This is a submission for the GitHub Copilot CLI Challenge

What I Built

RepoDoctor - Your Repository's AI Doctor 🩺

RepoDoctor is a Copilot-first CLI tool that revolutionizes how developers analyze and maintain their codebases. Instead of relying on rigid, hardcoded rules like traditional static analysis tools, RepoDoctor acts as an intelligent orchestrator that delegates all analysis logic to GitHub Copilot CLI.

Think of it as having an AI-powered code doctor that:

  • πŸ” 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's 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 configuration 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 their code quality.

Project Links

Demo

repodoc

repodoc-docker

repodoc-diet

repodoc-report

repodoc-deadcode

Quick Installation & Usage

# Install from PyPI
pip install repodoc

# Install from uv
uv install repodoc

# Use repodoc without installation
uv tool run repodoc

# Analyze repository bloat
repodoc diet

# Generate onboarding guide
repodoc tour

# Run full health scan
repodoc scan

# Generate beautiful report
repodoc report
Enter fullscreen mode Exit fullscreen mode

My Experience with GitHub Copilot CLI

Building RepoDoctor was a transformative experience that fundamentally changed how I approach software development. GitHub Copilot CLI wasn't just a tool I usedβ€”it became the core architecture of my entire application.

The Copilot-First Architecture

Instead of building traditional static analysis with hardcoded rules, I had a radical idea: What if the AI itself is the analysis engine?

This led to RepoDoctor's unique architecture:

  1. Prompt Templates - Each analysis type (diet, tour, docker, etc.) has a carefully crafted prompt
  2. Workflow Orchestration - RepoDoctor manages file discovery, data collection, and output formatting
  3. AI Delegation - All actual analysis logic is delegated to GitHub Copilot CLI
  4. Schema Validation - Pydantic schemas ensure the AI returns structured, reliable data

How I Used GitHub Copilot CLI

1. Prompt Engineering as Code

I created a sophisticated prompt template system that provides 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

2. Iterative Development with Copilot CLI

During development, Copilot CLI helped me:

Code Generation:

  • Generated boilerplate for CLI commands with Typer
  • Created Pydantic schemas for each analysis type
  • Built async orchestration code for subprocess management

Debugging:

# When tests failed, I asked Copilot:
copilot "Why is this pytest fixture not mocking shutil.which correctly?"
copilot "How do I handle UTF-8 encoding on Windows for subprocess output?"
Enter fullscreen mode Exit fullscreen mode

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?"
Enter fullscreen mode Exit fullscreen mode

3. 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

This would have taken hours to write manually, but Copilot CLI generates it in seconds with context-aware understanding of the codebase.

Leveraging Agent Skills

One of my secret weapons during development was my 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 GitHub Copilot CLI through complex workflows.

These skills transformed GitHub Copilot CLI from a general assistant into a team of specialized experts, each bringing deep domain knowledge to different aspects of the project. It's like having a senior developer, tech writer, QA engineer, and DevOps specialist all working together!

Virtual Company is open source: https://github.com/k1lgor/virtual-company

Impact on My Development Experience

Before GitHub Copilot CLI:

  • ❌ Spent hours writing static analysis rules
  • ❌ Struggled with complex regex patterns
  • ❌ Wrote boilerplate code manually
  • ❌ Context-switched between docs and coding

With GitHub Copilot CLI + Virtual Company Skills:

  • βœ… 10x faster development - Instant code generation and debugging
  • βœ… Expert-level guidance - Each skill provides specialized domain knowledge
  • βœ… Better architecture - Copilot with tech-lead skill suggested async patterns I wouldn't have considered
  • βœ… Fewer bugs - AI-reviewed code with bug-hunter skill before I even ran it
  • βœ… More creativity - Spent time on features, not implementation details
  • βœ… Continuous learning - Copilot taught me new Python patterns and best practices
  • βœ… Comprehensive testing - Test-genius skill helped achieve 48 passing tests with proper mocking

The Meta Experience

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

  1. AI-First Architecture is Real - RepoDoctor proves you can build production tools with AI as the core logic engine
  2. Prompt Engineering Matters - The quality of your prompts directly impacts output quality
  3. Specialized Skills Amplify AI - Using domain-specific agent skills (Virtual Company) accelerates development exponentially
  4. Copilot CLI for Everything - From code generation to debugging to documentation
  5. Ship Faster, Iterate Smarter - Copilot CLI enabled rapid prototyping and validation
  6. The Future is AI-Native - Tools will increasingly delegate intelligence to AI rather than hardcode it

Try RepoDoctor Today!

uv install repodoc
cd your-project
repodoc scan
Enter fullscreen mode Exit fullscreen mode

GitHub: https://github.com/k1lgor/RepoDoctor

PyPI: https://pypi.org/project/repodoc/


Built with ❀️ and πŸ€– by @k1lgor using GitHub Copilot CLI

Top comments (0)