鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

codebase-classification

根据代码库的结构、测试覆盖率、类型注解、依赖状态和文档完整性等特征,判断其属于规范、过渡、遗留或新建项目类型,并据此采取遵循既有模式、逐步改进、谨慎重构或建立最佳实践的相应开发策略,确保修改方式与项目现状匹配。

效率工具商业与营销软件开发
访问 GitHub
文档Skills.MD
name
codebase-classification
description
Classify codebases before modification to choose appropriate development approach

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:

▼
txt
复制代码
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

SignalDisciplinedTransitionalLegacyGreenfield
Test coverage>70%30-70%<30%Varies (new)
Type hintsComprehensivePartialNone/minimalVaries
CI/CDActivePresentNone/brokenMay be new
Code styleConsistentMixedInconsistentEstablishing
DependenciesCurrentSomewhat currentOutdatedLatest
AgeAnyAnyUsually 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

▼
txt
复制代码
$ 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

▼
txt
复制代码
$ 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:

  1. Avoid imposing new patterns on well-structured codebases
  2. Avoid perpetuating bad patterns in legacy codebases
  3. Make appropriate improvement suggestions
  4. Set up proper structure for new projects

Related

  • Tool: shell (for running analysis commands)
  • Tool: read (for examining codebase structure)
效率工具
商业与营销
软件开发

快捷安装

复制到终端去安装 Skill

npxskillsaddgptme/gptme--skill"codebase-classification"
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
朱雀AI检测助手朱雀AI检测助手
零感AI零感AI
Skills 推荐
debug
debug 是一个系统化定位软件缺陷根因的技能,适用于用户报告 'fix'、'broken'、'error' 等问题或测试意外失败时。它通过可验证的假设、最小复现、因果链分析和回归测试,确保在修复前准确定位根本原因。
retrieving-developer-knowledge
retrieving-developer-knowledge 用于搜索、获取和整合 Google 官方开发者文档,覆盖 Google Cloud、AI/Gemini、Android、Chrome、Web、Flutter、Go、Firebase 等平台,适用于查询 gcloud CLI 命令、API 语法、IAM 权限或架构对比等场景。
diff-intake
diff-intake 读取 PR 或分支差异,生成结构化 YAML 变更摘要,用于下游 analytics instrumentation 技能。适用于用户提交 PR 链接、分支对比或原始 diff 后需理解变更内容、评估分析覆盖或启动埋点流程的场景。
webapp-testing
提供本地 Web 应用的端到端测试能力,支持页面导航、元素交互、表单填写、动态等待、断言验证、截图捕获、浏览器日志收集及网络请求拦截,适用于前端功能验证与 UI 行为调试。
definition-of-done-generator
自动生成项目完成标准的规范定义与配置文件,提供符合企业级工作流要求的最佳实践指导,输出可直接投入生产环境的代码和验证结果,适用于需要标准化流程审批、合规审查及跨系统集成的复杂项目管理场景。