Skill Market

cpp coding standards

C++コアガイドラインに基づくC++コーディング標準(isocpp.github.io)。現代的で安全で慣用的なプラクティスを強制するためにC++コードを書き、レビュー、またはリファクタリングする場合に使用します。

GitHub
githubcommunity
0.0
0 installs262.1K GitHub starsby affaan-m

Skill Introduction

Overview
C++コアガイドラインに基づくC++コーディング標準(isocpp.github.io)。現代的で安全で慣用的なプラクティスを強制するためにC++コードを書き、レビュー、またはリファクタリングする場合に使用します。

Core value

Turns reusable Development know-how into an installable skill, helping users complete github, community work faster.

Target users

  • Developers, testers, and maintainers who handle Development tasks in Focus Code.
  • Teams that already trust workflows or content from affaan-m.
  • Users who want standardized prompts, steps, or conventions instead of repeating setup work.

Best practices

  • Read the skill content first to confirm required inputs, expected outputs, and dependencies.
  • Try it on a small task before relying on it for critical work.
  • Add project-specific constraints such as coding style, target platform, test expectations, and delivery format.
  • For external sources, verify the source link, version, and recent maintenance activity.

Best use cases

  • Tasks related to github, community that need a reusable execution flow.
  • Converting a community repo, team convention, or personal workflow into day-to-day assistance.
  • Starting from a proven skill instead of writing prompts or procedures from scratch.

Limits and boundaries

  • Results depend on the quality of the original skill content and may need human correction.
  • It does not replace code review, tests, security review, or professional judgment.
  • External tools, APIs, account permissions, and local dependencies still need separate setup.

Differentiation

  • Structured around Development, making it easier to discover and reuse than loose prompt snippets.
  • Marked as GitHub, which helps users judge trust and maintenance expectations.
  • Keeps the original source link available for repository, documentation, or discussion follow-up.
  • Tagged with github, community, so it can be filtered by concrete task intent.

Install and use

Install
Copy Install Command
focus install cpp-coding-standards-4122ae
View source

Detail Preview

SKILL.md

Primary filemarkdown3 KB

name: cpp-coding-standards description: C++コアガイドラインに基づくC++コーディング標準(isocpp.github.io)。現代的で安全で慣用的なプラクティスを強制するためにC++コードを書き、レビュー、またはリファクタリングする場合に使用します。 origin: ECC

C++コーディング標準(C++コアガイドライン)

C++コアガイドラインから派生した最新のC++(C++17/20/23)の包括的なコーディング標準。タイプセーフティ、リソースセーフティ、不変性、明確性を強制します。

使用時期

  • 新しいC++コードを書く(クラス、関数、テンプレート)
  • 既存のC++コードをレビューまたはリファクタリング
  • C++プロジェクトでアーキテクチャ決定を行う
  • C++コードベース全体で一貫性のあるスタイルを実施
  • 言語機能の選択(例:enum vs enum class、生ポインタ対スマートポインタ)

クロスカッティング原則

これらのテーマはガイドライン全体に繰り返され、基礎を形成:

  1. 至るところにRAII:リソースライフタイムをオブジェクトライフタイムにバインド
  2. デフォルトで不変性:const/constexprで開始;変更可能性は例外
  3. タイプセーフティ:型システムを使用してコンパイル時にエラーを防止
  4. 意図を表現:名前、タイプ、概念は目的を伝える必要があります
  5. 複雑性を最小化:シンプルなコードが正しいコード
  6. 値セマンティクス対ポインタセマンティクス:値で返すか、スコープ付きオブジェクトを好む

主要なルール

RuleSummary
P.1コード内のアイデアを直接表現
P.3意図を表現
P.4理想的には、プログラムは静的にタイプセーフである必要があります
P.5ランタイムチェックに対するコンパイル時チェック
P.8リソースをリークしない
P.10変更可能なデータより不変データを好む
I.1インターフェースを明示的にする
I.2非const グローバル変数を避ける
I.4インターフェースを正確にし、強く型付けされたものにする

スマートポインタと所有権

現代的なC++では、生ポインタの代わりにスマートポインタを使用:

  • std::unique_ptr<T> 単一所有者向け
  • std::shared_ptr<T> 共有所有権向け
  • std::weak_ptr<T> 循環参照を回避するため

Reviews

Overall rating

0.0
0.0

0 comments

No reviews yet