Skip to content

Add modern-cpp plugin for C++20/23/26 best practices#142

Draft
wizardengineer wants to merge 1 commit intomainfrom
modern-cpp-plugin
Draft

Add modern-cpp plugin for C++20/23/26 best practices#142
wizardengineer wants to merge 1 commit intomainfrom
modern-cpp-plugin

Conversation

@wizardengineer
Copy link
Copy Markdown

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)

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>
@wizardengineer wizardengineer requested a review from dguido as a code owner April 1, 2026 18:16
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

@frabert frabert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👍


- CPU-bound parallel work (coroutines cooperate, they don't parallelize)
- Simple synchronous code (unnecessary complexity)
- Writing the low-level promise_type / awaiter machinery from scratch (use library types)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue that sometimes writing custom awaiters specifically is required for efficiently adapting libraries with async methods to coroutines, so maybe this rule needs relaxing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see what you're saying. What would you suggest?

Do you think it would make sense to have something like

Suggested change
- Writing the low-level promise_type / awaiter machinery from scratch (use library types)
- Reimplementing coroutine types (`generator`, `task`) that libraries already provide
- Custom awaiters are fine when adapting async libraries to coroutines — that's often the only way to bridge callback-based APIs

or should I just remove the - Writing the low-level...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants