Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/ibm-self-serve-assets/building-blocks/code-modernization-javanpx skills add ibm-self-serve-assets/building-blocks --skill code-modernization-javagit clone --depth 1 https://github.com/ibm-self-serve-assets/building-blocksWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00028 | $0.01223 |
| Opus 5 | $0.00014 | $0.00611 |
| Sonnet 5 | $0.00006 | $0.00245 |
| Haiku 4.5 | $0.00003 | $0.00122 |
Grade A, and why
code-modernization-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to code-modernization-expert — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Modernize legacy codebases systematically using proven enterprise patterns and automated transformations.
Supported Migrations
- Languages: Python 2→3, Java 8→21, JavaScript ES5→ES6+, TypeScript
- Frameworks: React Class→Hooks, Vue 2→3, Spring Boot 2→3, Django, Rails, Angular
- Architecture: Monolith→Microservices, REST→GraphQL, Callbacks→Async/Await
Use Glob to find all source files. Use Grep to identify:
- Framework versions (package.json, requirements.txt, pom.xml)
- Deprecated APIs and imports
- Code smells (TODO, FIXME, HACK)
- Security vulnerabilities
Generate Current State Report with:
- Languages, frameworks, versions
- Dependency health (outdated, vulnerable)
- Test coverage percentage
- Technical risks
See assessment-checklist.md for detailed items.
Categorize debt by severity and effort:
- Code quality (God classes, long methods, duplicates)
- Dependencies (EOL frameworks, vulnerable libraries)
- Testing gaps (low coverage, missing tests)
- Architecture issues (tight coupling, monolithic design)
Use prioritization matrix in debt-prioritization.md to rank items.
Create inventory with: Severity, Effort, Risk, Impact on velocity.
Choose based on context:
- Strangler Fig: Large monoliths, zero downtime required →
patterns/strangler-fig.md - Branch by Abstraction: Internal modules, service layers →
patterns/branch-by-abstraction.md - Seam-Based: Low test coverage, tightly coupled code →
patterns/seam-based.md - Parallel Run: Mission-critical, financial, healthcare systems →
patterns/parallel-run.md
Generate phased roadmap:
Preparation (1-2 weeks):
- Set up feature flags
- Implement monitoring/alerting
- Generate characterization tests
- Create rollback procedures (see
rollback-template.yaml)
Execution (Iterative per module):
- Read source files
- Generate tests capturing current behavior
- Apply transformations with Edit/MultiEdit
- Update imports and dependencies
- Run tests to validate
- Deploy incrementally (1% → 5% → 25% → 100%)
Validation:
- Run test suite
- Perform shadow testing
- Monitor error rates and latency
Cleanup:
- Remove legacy code
- Remove feature flags
- Update documentation
Apply language-specific changes:
Python 2→3: See migrations/python.md
- print statements → print()
- dict.iteritems() → dict.items()
- Add type hints, dataclasses, f-strings
Java 8→21: See migrations/java.md
- javax.* → jakarta.*
- Date → java.time.*
- POJOs → Records
- Add pattern matching, text blocks
JavaScript ES5→ES6+: See migrations/javascript.md
- var → let/const
- callbacks → async/await
- prototypes → classes
- Add template literals, modules
React Class→Hooks: See migrations/react.md
- constructor+state → useState
- componentDidMount → useEffect
- lifecycle methods → hooks
Create comprehensive coverage:
Characterization Tests: Capture current behavior (even if buggy) Golden Master Tests: Record production inputs/outputs Approval Tests: Snapshot complex outputs
See testing-strategies.md for examples.
Use Task tool to delegate test generation when needed.
Implement mitigation:
Risk Registry: Track risks with likelihood, impact, mitigation, owners
Rollback Plan: Define triggers (error rate, latency, bugs), immediate actions, validation steps
Monitoring: Track error rates, latency, business metrics, set alerts
See rollback-template.yaml for complete template.
Generate migration report with:
- Executive summary (current vs target, approach, timeline)
- Technical details (files modified, dependencies updated, tests added)
- Results (statistics, test results, performance impact)
- Lessons learned and next steps
What ships with it
15 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assessment-checklist.md 1.3 KB
- debt-prioritization.md 2.8 KB
- migrations/angular-to-react.md 3.4 KB
- migrations/java.md 2.2 KB
- migrations/javascript.md 2.4 KB
- migrations/php.md 3.0 KB
- migrations/python.md 3.4 KB
- migrations/react.md 3.6 KB
- migrations/ruby.md 3.1 KB
- patterns/branch-by-abstraction.md 1.8 KB
- patterns/parallel-run.md 2.0 KB
- patterns/seam-based.md 1.9 KB
- patterns/strangler-fig.md 2.5 KB
- rollback-template.yaml 2.5 KB
- testing-strategies.md 3.8 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 195 lines · 28 tokens per session scan A a916bb723100
code-modernization-expert is a skill published in the GitHub repository ibm-self-serve-assets/building-blocks (24 stars, last pushed 8d ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,223 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to code-modernization-expert, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…