CtrlK
BlogDocsLog inGet started
Tessl Logo

cpp-modernize

Load when modernizing, migrating, or upgrading C++ code from older standards (C++98/03/11/14) to modern C++ (17/20/23), or when applying systematic code improvements that preserve behavior.

70

Quality

86%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

C++ Modernize Skill

Use this skill for C++ modernization, migration, and systematic refactoring.

Critical Rule

Do not modernize code before preserving behavior.

Separate changes into:

  1. Safety fixes (do first)
  2. Behavior-preserving refactors
  3. Style improvements (do last)
  4. Performance changes (measure before and after)

Never mix safety-critical changes with large style rewrites.

Before Starting

  1. Confirm tests exist and pass.
  2. Identify the current C++ standard.
  3. Check build system and compiler flags.
  4. Check for -fno-exceptions or other constraints.
  5. Identify ABI boundaries that must not change.

Common Modernization Paths

FromToRisk
Raw new/deleteRAII / smart pointersMedium (classify ownership first)
Raw loopsAlgorithms / rangesLow (verify behavior)
NULLnullptrLow
typedefusingLow
Manual resource managementRAII wrappersMedium (check move semantics)
C-style arraysstd::array / std::vectorMedium (check sizeof, pointer arithmetic)
boost::optionalstd::optionalLow (check API compatibility)
SFINAEConceptsLow (C++20+)

Gotchas

  • Do not replace legacy code that works without tests.
  • Do not change public ABI without a migration plan.
  • auto can hide surprising type deductions.
  • std::string_view does not own — check lifetime.
  • Modern does not always mean better for embedded/constrained environments.
Repository
zhxc372/cpp-ai-constitution
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.