codebase-classification
Classify codebases before modification to choose appropriate development approach
Install
mkdir -p .claude/skills/codebase-classification && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3001" && unzip -o skill.zip -d .claude/skills/codebase-classification && rm skill.zipInstalls to .claude/skills/codebase-classification
About this skill
Codebase Classification Skill
Analyze and classify codebases before making changes to ensure appropriate development approach.
Overview
Before modifying any codebase, classify it to determine whether to:
- Follow existing patterns (Disciplined)
- Gradually improve while following conventions (Transitional)
- Propose improvements to legacy patterns (Legacy)
- Establish best practices from scratch (Greenfield)
Classification Types
1. Disciplined Codebase
Signals:
- Consistent code style (formatting, naming conventions)
- Comprehensive test coverage (>70%)
- Clear module boundaries and interfaces
- Type hints/annotations throughout
- Up-to-date dependencies
- Active CI/CD pipeline
- Good documentation (README, docstrings)
Approach: Follow existing patterns strictly. Don't introduce new conventions.
2. Transitional Codebase
Signals:
- Mixed code quality (some areas good, others not)
- Partial test coverage (30-70%)
- Some type hints, inconsistent usage
- Active development with modernization efforts
- Dependencies somewhat current
Approach: Follow existing conventions in touched areas. Propose improvements for new code.
3. Legacy Codebase
Signals:
- Inconsistent patterns across the codebase
- Minimal or no tests (<30% coverage)
- No type hints
- Outdated dependencies
- Complex, undocumented logic
- Possibly unmaintained
Approach: Be careful with changes. Add tests before modifying. Propose gradual improvements.
4. Greenfield Codebase
Signals:
- New project (<6 months old)
- Few files (<20 source files)
- No established patterns yet
- Minimal or no tests (but not legacy)
- Active initial development
Approach: Establish best practices from the start. Set up proper structure, testing, CI.
Quick Classification Checklist
Run this analysis before making significant changes:
1. Check test coverage: Is there a test/ or tests/ directory? How comprehensive?
2. Check type hints: Are functions annotated? Is there py.typed or mypy config?
3. Check CI/CD: Is there .github/workflows/, .gitlab-ci.yml, or similar?
4. Check code style: Is there .pre-commit-config.yaml, ruff.toml, or similar?
5. Check dependencies: When was requirements.txt/pyproject.toml last updated?
6. Check documentation: Is there a comprehensive README? API docs?
Decision Matrix
| Signal | Disciplined | Transitional | Legacy | Greenfield |
|---|---|---|---|---|
| Test coverage | >70% | 30-70% | <30% | Varies (new) |
| Type hints | Comprehensive | Partial | None/minimal | Varies |
| CI/CD | Active | Present | None/broken | May be new |
| Code style | Consistent | Mixed | Inconsistent | Establishing |
| Dependencies | Current | Somewhat current | Outdated | Latest |
| Age | Any | Any | Usually old | <6 months |
Behavior Guidelines
When Disciplined
- Study existing patterns before writing new code
- Match naming conventions exactly
- Follow established module structure
- Add tests matching existing test style
- Don't propose architectural changes without strong justification
When Transitional
- Follow patterns in the specific area you're modifying
- Match quality of surrounding code or slightly better
- Add tests for new functionality
- Document rationale for any pattern deviations
When Legacy
- Add tests BEFORE modifying code
- Make minimal changes to achieve goal
- Document assumptions and findings
- Propose improvements as separate follow-up work
- Be extra careful with untested code paths
When Greenfield
- Establish best practices immediately
- Set up proper project structure
- Configure linting, formatting, type checking
- Write tests for new functionality
- Create comprehensive documentation
Examples
Identifying Disciplined Codebase
$ ls -la
pyproject.toml # Modern packaging
.pre-commit-config.yaml # Style enforcement
mypy.ini # Type checking
.github/workflows/ # CI/CD
$ wc -l tests/**/*.py
2500 total # Substantial tests
→ Classification: DISCIPLINED
→ Approach: Follow existing patterns strictly
Identifying Legacy Codebase
$ ls -la
setup.py # Old-style packaging
requirements.txt # Pinned 3 years ago
# No tests directory
# No CI configuration
$ grep -r "def " src/ | head -5
def process_data(x): # No type hints
def handle_input(data): # No docstrings
→ Classification: LEGACY
→ Approach: Careful changes, add tests first
Integration
This skill helps agents:
- Avoid imposing new patterns on well-structured codebases
- Avoid perpetuating bad patterns in legacy codebases
- Make appropriate improvement suggestions
- Set up proper structure for new projects
Related
- Tool: shell (for running analysis commands)
- Tool: read (for examining codebase structure)
More by gptme
View all skills by gptme →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
pdf-to-markdown
aliceisjustplaying
Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.
Related MCP Servers
Browse all serversClaude Context offers semantic code search and indexing with vector embeddings and AST-based code splitting. Natural lan
JsonDiffPatch: compare and patch JSON with a compact delta format capturing additions, edits, deletions, and array moves
Structured spec-driven development workflow for AI-assisted software development. Creates detailed specifications before
Integrate with Gemini CLI for large-scale file analysis, secure code execution, and advanced context control using Googl
DeepWiki converts deepwiki.com pages into clean Markdown, with fast, secure extraction—perfect as a PDF text, page, or i
Acemcp: semantic code search across codebases with incremental indexing. Find relevant snippets, file paths and line num
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.