Skip to content

πŸ” An intelligent Claude Code agent that analyzes repository structure and provides actionable recommendations based on community best practices. Supports 7+ languages, 10+ frameworks, with security scanning and automated reorganization scripts.

License

Notifications You must be signed in to change notification settings

flyingrobots/claude-repo-expert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claude Repository Expert

A specialized Claude agent that analyzes project repositories and provides actionable recommendations to align them with community best practices and industry standards.

What It Does

The Repository Expert agent comprehensively analyzes your codebase structure, identifies organizational issues, and generates detailed reports with prioritized recommendations for improvement. It acts as an automated code organization consultant that understands best practices across multiple programming languages and frameworks.

Key Features

  • Multi-Language Support: Analyzes Node.js, Python, Go, Rust, Java, Ruby, C#/.NET projects
  • Framework Detection: Recognizes Next.js, Vite, Django, Rails, Angular, and other popular frameworks
  • Comprehensive Analysis: Examines directory structure, file organization, configuration, and compliance
  • Prioritized Recommendations: Categorizes issues by urgency (Critical/Important/Enhancement)
  • Actionable Output: Generates implementation scripts and configuration templates
  • Visual Reports: Creates Mermaid diagrams showing current vs. recommended structure
  • Security Analysis: Identifies exposed secrets and security anti-patterns
  • Performance Optimization: Suggests improvements for build times and repository size

How It Works

The agent follows a systematic 4-phase analysis process:

Phase 1: Discovery & Analysis

  • Project Type Detection: Identifies language and framework from key files
  • Structure Mapping: Maps directory tree and analyzes organization patterns
  • Standards Compliance: Checks for documentation, CI/CD, testing, and code quality tools

Phase 2: Best Practices Mapping

  • Language Standards: Compares against established conventions for each ecosystem
  • Framework Patterns: Applies framework-specific organizational requirements
  • Project Scale: Adjusts recommendations based on project size and complexity

Phase 3: Generate Recommendations

  • Executive Summary: High-level overview with organization score
  • Detailed Findings: Categorized analysis of current state
  • Priority Matrix: Critical β†’ Important β†’ Enhancement classification
  • Implementation Guide: Step-by-step instructions for improvements

Phase 4: Visual Report

  • Structure Diagrams: Before/after visualizations using Mermaid
  • Migration Path: Clear roadmap for reorganization
  • Templates: Ready-to-use configuration files and boilerplates

Installation/Setup

This agent works with Claude Code. To use it:

  1. Save the agent definition to ~/.claude/agents/repo-expert.md
  2. Invoke the agent in Claude Code

Usage Examples

Basic Repository Analysis

@agent repo-expert "Analyze this repository structure and provide recommendations"

Framework-Specific Analysis

@agent repo-expert "Analyze this Next.js project for best practices compliance"

Security-Focused Review

@agent repo-expert "Focus on security issues in this repository organization"

Large Project Analysis

@agent repo-expert "Analyze this monorepo and suggest improvements for team workflow"

Output Format

The agent generates several deliverables:

1. Analysis Report (REPO_ANALYSIS.md)

# Repository Analysis Report
Generated: [timestamp]
Repository: [repo-name]

## Executive Summary
- **Project Type:** React/TypeScript Web App
- **Organization Score:** 6/10
- **Critical Issues:** 3
- **Quick Wins:** 5

## Current Structure Analysis
### βœ… What's Working Well
- TypeScript configuration is comprehensive
- Testing infrastructure exists

### ⚠️ Areas for Improvement  
- Source files mixed with config in root
- Inconsistent import paths

### 🚫 Critical Issues
- No .gitignore for sensitive files
- Missing CI/CD pipeline

## Priority-Based Recommendations
### πŸ”₯ Priority 1: Critical (Fix This Week)
- Create comprehensive .gitignore
- Move source files to src/ directory
- Set up GitHub Actions workflow

### ⚑ Priority 2: Important (Fix This Month)
- Standardize directory naming conventions
- Separate concerns into modules
- Add pre-commit hooks

### πŸ’‘ Priority 3: Enhancement (Fix Eventually)
- Implement absolute import paths
- Add Storybook for component development
- Set up automated dependency updates

2. Implementation Script (reorganize.sh)

#!/bin/bash
# Repository Organization Script
# Generated by Repository Organization Expert

echo "πŸš€ Starting repository reorganization..."

# Create standard directories
mkdir -p src/{components,lib,types} tests/{unit,integration} docs scripts

# Move source files
find . -name "*.ts" -not -path "./node_modules/*" -exec mv {} src/ \;

# Create .gitignore
cat > .gitignore << 'EOF'
node_modules/
dist/
.env
.env.local
*.log
EOF

echo "βœ… Reorganization complete!"

3. Configuration Templates (repo-templates/)

  • Language-specific .gitignore files
  • CI/CD workflow templates
  • Linting and formatting configurations
  • README templates

4. Visual Diagrams

Mermaid diagrams showing current issues and recommended structure with migration paths.

Supported Project Types

Languages

  • Node.js/JavaScript/TypeScript: React, Vue, Angular, Express, etc.
  • Python: Django, Flask, FastAPI, CLI tools, data science projects
  • Go: Web services, CLI tools, microservices
  • Rust: CLI tools, web services, system programming
  • Java: Spring Boot, Maven/Gradle projects
  • Ruby: Rails applications, gems
  • C#/.NET: Web APIs, console applications

Project Categories

  • Web applications (SPA, SSR, static sites)
  • API services and microservices
  • Command-line tools
  • Libraries and packages
  • Mobile applications
  • Documentation sites
  • Monorepos and multi-package projects

Configuration

The agent automatically adapts its recommendations based on:

  • Project Size: Different standards for small/medium/large projects
  • Team Context: Respects existing conventions in CONTRIBUTING.md
  • Framework Requirements: Follows framework-specific patterns
  • Monorepo Detection: Adjusts for Lerna, Nx, Rush configurations

Contributing

To improve the Repository Expert agent:

  1. Add New Language Support: Extend the best practices mapping section
  2. Framework Patterns: Add detection and conventions for new frameworks
  3. Templates: Contribute configuration templates for different toolchains
  4. Analysis Rules: Suggest new organizational anti-patterns to detect
  5. Output Formats: Propose new report formats or visualization types

Areas particularly welcome for contribution:

  • Mobile development patterns (React Native, Flutter)
  • DevOps and infrastructure as code patterns
  • Data science project structures
  • Documentation site generators beyond standard patterns

License

MIT License - Feel free to use, modify, and distribute this agent definition.


Generated by: Repository Organization Expert Agent
Compatibility: Claude with changeling system
Last Updated: August 2025

About

πŸ” An intelligent Claude Code agent that analyzes repository structure and provides actionable recommendations based on community best practices. Supports 7+ languages, 10+ frameworks, with security scanning and automated reorganization scripts.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published