Files
playbook/rulesets/cpp/index.md
T
cshandClaude Opus 4.6 8b93311cae 📝 docs(tsl): clarify syntax constraints and enhance test infrastructure
- Add TSF file naming constraint to syntax/02_core_model.md
- Clarify semicolon rules: syntax facts vs style preferences
- Separate control flow end semicolon rules (syntax allows both)
- Add function body semicolon requirements to syntax/05_functions_and_calls.md
- Move style preferences to code_style.md (control flow end semicolons)
- Remove cross-references from syntax docs to maintain independence
- Enhance Gitea workflow emoji for better CI output readability
- Fix CI test path from tests/ to test/
- Organize agent test results under test/agent/result/ directory
- Add complete Chinese translation of test cases (test_cases_zh.md)
- Clean up .gitignore to use unified test/agent/result/ directory
- Remove obsolete agent test artifacts (REPORTS_LOCATION.md, old results)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-21 17:04:50 +08:00

1.6 KiB
Raw Blame History

C++ 代理规则集

本规则集定义 AI/自动化代理在处理 C++ 代码时必须遵守的核心约束。

范围与优先级

  • 作为仓库级基线规则集使用;更靠近代码目录的规则更具体并可覆盖基线。
  • 当代理规则与 docs 冲突:安全/合规优先,其次保持仓库一致性。

代理工作原则(铁律)

  1. 先理解目标与上下文,再动手改代码
  2. 修改要小而清晰;避免无关重构
  3. 发现安全问题(内存安全/鉴权漏洞)立即标注或修复
  4. 不引入新依赖或工具,除非明确要求

C++ 核心约定(不可违反)

  • 语言标准:C++23;优先使用 Modules;避免裸指针、new/delete、C 风格字符串
  • 代码风格:Google C++ Style Guide;使用项目 .clang-format;头文件保护用 #pragma once
  • 命名规范:文件 lower_with_under.cpp/.h/.cppm;类型 CapWords;函数/变量 lower_with_under;常量 kCapWords;成员 lower_with_under_;命名空间 lower_with_under
  • Modules 工程:模块名点分层 lower_snake_case;接口文件 .cppm;修改 export module 必须更新 CMake module file-set
  • 构建与依赖:Conan 需提供 conan-release/conan-debugconan install + cmake --preset ...Windows 通过 Linux + Clang 交叉编译验证

权威来源

  • 代码风格:docs/cpp/code_style.md
  • 命名规范:docs/cpp/naming.md
  • 工具链:docs/cpp/toolchain.md
  • 依赖管理:docs/cpp/dependencies_conan.md
  • clangd 配置:docs/cpp/clangd.md

Skills(按需加载)

  • $commit-message

与开发规范的关系

  • 规范文档:docs/cpp/docs/common/