skills/team/python-modernization-analyzer/SKILL.md
Analyzes legacy Python codebases and produces actionable modernization plans. Primary migration paths include Python 2 to 3.12+, sync to async, Flask/Django monolith to FastAPI, requirements.txt to pyproject.toml, and bare classes to Pydantic/dataclasses. Does NOT perform the migration — assesses, quantifies risk, and plans.
npx skillsauth add michaelalber/ai-toolkit python-modernization-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"The best time to modernize was five years ago. The second best time is now." -- Adapted from software engineering practice
"Big bang rewrites fail. Incremental migration succeeds." -- Martin Fowler, Refactoring
Legacy Python codebases accumulate technical debt in predictable patterns: Python 2 syntax that
2to3 can partially fix, synchronous I/O that blocks under load, monolithic Flask/Django apps that
resist scaling, requirements.txt files with unpinned dependencies, and bare dictionaries where
Pydantic models would provide safety.
This skill assesses, quantifies, and plans — it does NOT perform the migration. The output is a prioritized modernization plan with risk scores, effort estimates, and a recommended migration sequence. The plan is the deliverable; execution is a separate task.
Non-Negotiable Constraints:
grep -r "from flask" is evidence; "I think this is Flask" is not.What this skill is NOT: a migration execution tool (it produces a plan, not code); a code-quality
review (use python-architecture-checklist); a security review (use python-security-review).
The 10 domain principles and the knowledge-base lookup queries that ground every decision live in
references/domain-principles.md.
Inventory the codebase: Python version(s); framework (Flask/Django/FastAPI/bare/none); packaging
(requirements.txt/setup.py/setup.cfg/pyproject.toml); test framework and coverage; async
usage; ORM/database access pattern; deployment method.
Full detection command set (Python 2 markers, framework greps, packaging, coverage, async,
2to3 -l, pyupgrade --dry-run) is in references/scan-commands.md.
Score each migration path by effort, risk, and blocker potential. The migration-path catalog (tool
references/scan-commands.md; scoring dimensions and the full risk table
are in references/migration-risk-matrix.md.Produce a prioritized, phased plan, each phase leaving the app in a working state: 0. Prerequisites — tests, CI/CD, Docker (if missing)
Deliver the plan with evidence, risk scores, and effort estimates. Use the risk scoring table in
references/migration-risk-matrix.md and the deliverable layout in ## Output Template below.
Apply the domain principles throughout (references/domain-principles.md), and follow the AI
discipline rules in references/discipline-and-recovery.md at every phase.
<python-modernization-state>
phase: SCAN | ASSESS | PLAN | REPORT | COMPLETE
python_version: [2.x / 3.x / unknown]
framework: flask | django | fastapi | bare | unknown
packaging: requirements_txt | setup_py | pyproject_toml | unknown
test_coverage: none | low | medium | high | unknown
async_usage: none | partial | full
migration_paths_identified: 0
blockers_identified: 0
last_action: [description]
next_action: [description]
</python-modernization-state>
The full Modernization Assessment Summary (Markdown — header block, migration-paths table, blockers
table, phased plan) is in references/assessment-summary-template.md. Before/after compatibility
examples for Python 2→3, sync→async, and Flask→FastAPI are in references/compatibility-patterns.md.
Evidence before recommendation, quantify before scoring, and incremental plans only — with worked
WRONG/RIGHT examples, the 10-row anti-pattern catalog, and error-recovery procedures (tools missing,
unknown dependency compatibility, zero test coverage) — are in references/discipline-and-recovery.md.
| Skill | Relationship |
|-------|-------------|
| python-architecture-checklist | Run architecture review after modernization to verify the new structure meets quality gates. |
| python-security-review | Run security review after framework migration — new frameworks have different security patterns. |
| alembic-migration-manager | Database migration is often part of modernization. Use this skill for the migration lifecycle. |
| fastapi-scaffolder | When the modernization plan includes FastAPI adoption, use this skill for endpoint scaffolding. |
| legacy-migration-analyzer | Cross-reference for teams with mixed Python/.NET stacks. Assessment philosophy is identical; tooling differs. |
development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.