Classify codebases before modification to choose appropriate development approach
Analyze and classify codebases before making changes to ensure appropriate development approach.
Before modifying any codebase, classify it to determine whether to:
Signals:
Approach: Follow existing patterns strictly. Don't introduce new conventions.
Signals:
Approach: Follow existing conventions in touched areas. Propose improvements for new code.
Signals:
Approach: Be careful with changes. Add tests before modifying. Propose gradual improvements.
Signals:
Approach: Establish best practices from the start. Set up proper structure, testing, CI.
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?
| 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 |
$ 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
$ 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
This skill helps agents: