mirror of
https://github.com/trailofbits/skills.git
synced 2026-09-14 14:28:48 +08:00
293fb74c31
* Add modern-cpp plugin for C++20/23/26 best practices
Modern C++ skill guiding Claude toward modern idioms with a security
emphasis. Mirrors modern-python in spirit but focuses on language
standards rather than toolchain.
Features tiered by practical usability:
- Tier 1 (Use Today): C++20/23 features with solid compiler support
- Tier 2 (Deploy Now): Compiler hardening, sanitizers, hardened libc++
- Tier 3 (Plan For): C++26 reflection
- Tier 4 (Watch): Contracts, std::execution
Includes SKILL.md entry point + 6 reference docs:
- anti-patterns.md (30+ legacy-to-modern swaps)
- cpp20-features.md (concepts, ranges, span, format, coroutines)
- cpp23-features.md (expected, print, deducing this, flat_map)
- cpp26-features.md (reflection, contracts, memory safety)
- compiler-hardening.md (flags, sanitizers, hardened libc++)
- safe-idioms.md (security patterns by vulnerability class)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove .codex/ sidecar
AGENTS.md bans runtime sidecars: Claude marketplace metadata is the single
canonical source and Codex reads it through that compatibility. The rule landed
in f09e5c7 (#173) on 2026-06-05, after this PR opened.
* modern-cpp: address review feedback
Use std::forward_like for the deducing-this example. vector::operator[]
is not ref-qualified, so forwarding the object dropped the rvalue case
and the example did not collapse all four overloads it claimed to.
Move the custom-awaiter note out of the 'When NOT to Use' list, where it
read as a contradiction.
* modern-cpp: fix two standard-version errors
- Four rows in the anti-patterns Standard column said C++11 for
features that shipped in C++98: std::copy, std::fill, static_cast,
and explicit. The column exists so a reader on a pinned toolchain
knows the minimum standard, so a wrong cell sends them upgrading for
something they already have.
- The span example called data.at(0), which does not exist until C++26
(P2821), so the snippet did not compile under the C++20 the doc is
scoped to. The comment also credited hardened libc++ for checking
.at() when hardening actually checks operator[], front and back.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Dan Guido <dan@trailofbits.com>