Agent Skillstimeplus-io/proton › cpp-coding

cpp-coding

GitHub

规范Timeplus/Proton C++20代码编写、审查与重构,涵盖命名、IProcessor模式、检查点及clang-format格式。适用于所有C++代码变更、新增、修复及风格咨询场景。

.claude/skills/cpp-coding/SKILL.md timeplus-io/proton

Trigger Scenarios

C++代码编写 C++代码审查 C++代码重构 C++代码修复 C++风格咨询

Install

npx skills add timeplus-io/proton --skill cpp-coding -g -y
More Options

Non-standard path

npx skills add https://github.com/timeplus-io/proton/tree/develop/.claude/skills/cpp-coding -g -y

Use without installing

npx skills use timeplus-io/proton@cpp-coding

指定 Agent (Claude Code)

npx skills add timeplus-io/proton --skill cpp-coding -a claude-code -g -y

安装 repo 全部 skill

npx skills add timeplus-io/proton --all -g -y

预览 repo 内 skill

npx skills add timeplus-io/proton --list

SKILL.md

Frontmatter
{
    "name": "cpp-coding",
    "description": "Write or review Timeplus\/Proton C++20 code covering naming conventions, Proton fences, clang-format, IProcessor patterns, and checkpointing. Make sure to use this skill for any C++ code changes, additions, or reviews in this codebase, including small fixes, new functions, refactoring, or style questions, even if the user doesn't explicitly mention coding conventions."
}

C++ Coding

Language

C++20. Prefer standard library over custom implementations when appropriate.

Naming conventions

Element Style Example
Functions lowerCamelCase processStreamData(), handleWindowClose()
Variables lowercase_with_underscores event_count, window_start
Classes PascalCase StorageStream, AggregatedDataVariants
Constants PascalCase or UPPER_CASE Per existing codebase convention
Namespaces PascalCase DB::Streaming

Proton fences

/// proton: starts
if (isStreamingQuery()) { handleStreamingPath(); }
/// proton: ends
  • Use ONLY in ClickHouse-inherited code (upstream-synced files)
  • NEVER fence in src/Storages/Stream/ or namespace DB::Streaming
  • NEVER nest fences

IProcessor pattern (streaming transforms)

All streaming transforms in src/Processors/Transforms/Streaming/ follow:

class MyTransform : public IProcessor {
    Status prepare() override;  // O(1), non-blocking, check readiness
    void work() override;       // Do actual processing
};

Stateful processors MUST also implement:

  • hasState() → return true
  • checkpoint(CheckpointContextPtr) → serialize state
  • recover(CheckpointContextPtr) → restore from checkpoint

Formatting

Only formats changed code blocks (not entire files). Uses .clang-format config at repo root. The configured brace style is Allman-like: opening braces normally go on a new line.

git clang-format              # format unstaged changes in-place
git clang-format --staged     # format staged changes in-place
git clang-format --diff       # dry-run: show what would change
git clang-format <commit>     # format changes since <commit>

Comments

Use ///. Explain why, not what:

/// Use 10 seconds to allow late events
watermark_delay = 10;

Version History

  • 7be2219 Current 2026-08-20 08:20

Same Skill Collection

.claude/skills/alloc-profile/SKILL.md
.claude/skills/build-and-verify/SKILL.md
.claude/skills/ci-diagnostics/SKILL.md
.claude/skills/create-worktree/SKILL.md
.claude/skills/review/SKILL.md
.claude/skills/sql-usage/SKILL.md

Metadata

Files
0
Version
7be2219
Hash
d94d82b7
Indexed
2026-08-20 08:20

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-28 01:41
浙ICP备14020137号-1 $Carte des visiteurs$