aim-common-rules
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUNNC AIM Team — Repository & Code Standards
UNNC AIM 团队 — 仓库与代码规范
This skill is the single entry point for the team's standards. It consolidates and operationalizes the written rules that live in the org repo under :
unnc-aim/.githubprofile/- Repository naming / branch / commit rules ←
profile/README.md - C++ standard ←
profile/standard.cpp.md - Python standard ←
profile/standard.py.md - TypeScript / Go / CMake standards ← /
profile/standard.ts.md/standard.go.mdstandard.cmake.md - Docs style (Markdown / YAML / JSON) ←
profile/standard.docs.md
Those written docs remain the source of truth; this skill (which lives in ) turns them into actionable checklists plus ready-to-copy rule files ().
unnc-aim/aim-common-agentic-skillsassets/Language rule for generated artifacts: documentation prose is language-agnostic, but all code, code comments, and commit messages must be in American English (e.g.,color,behavior— not colour, behaviour, optimise).optimize
此 skill 是团队规范的单一入口。它将组织仓库 中 下的书面规则整合并转化为可执行准则:
unnc-aim/.githubprofile/- 仓库命名 / 分支 / commit 规则 ←
profile/README.md - C++ 标准 ←
profile/standard.cpp.md - Python 标准 ←
profile/standard.py.md - TypeScript / Go / CMake 标准 ← /
profile/standard.ts.md/standard.go.mdstandard.cmake.md - 文档风格(Markdown / YAML / JSON)←
profile/standard.docs.md
这些书面文档仍是最终依据;此 skill(位于 )将其转化为可执行检查清单及可直接复制的规则文件()。
unnc-aim/aim-common-agentic-skillsassets/生成产物的语言规则: 文档正文与语言无关,但所有代码、代码注释和 commit message 都必须使用美式英语(例如:、color、behavior,而不是 colour、behaviour、optimise)。optimize
Where to look
查阅指南
| Task | Read | Copy this file |
|---|---|---|
| Create / name a repo, validate a ROS2 package name | references/repo-naming.md | — |
| Clone & organize a competition workspace (git submodules) | references/workspace-organization.md | — |
| Create a branch, write a commit message, follow the agent git-safety rules, set up recommended git config | references/git-workflow.md | assets/.gitattributes |
| Format / configure Python | references/python-formatting.md | assets/setup.cfg |
| Format / configure C++ | references/cpp-formatting.md | assets/.clang-format + assets/.clang-tidy |
| Format / configure TypeScript (Prettier, ESLint, pnpm) | references/ts-formatting.md | assets/.prettierrc + assets/eslint.config.js |
| Format Go | references/go-formatting.md | — |
| Style a CMakeLists.txt | references/cmake-style.md | — |
Markdown / YAML / JSON style ( | references/docs-style.md | assets/.editorconfig |
| Set up VS Code (extensions, Pylance, format-on-save, spelling) | references/python-formatting.md §3, §5, §6 + | assets/.vscode/extensions.json + assets/.vscode/settings.json |
| 任务 | 查阅 | 复制此文件 |
|---|---|---|
| 创建 / 命名仓库,验证 ROS2 package 名称 | references/repo-naming.md | — |
| 克隆并组织竞赛 workspace(Git submodule) | references/workspace-organization.md | — |
| 创建分支、编写 commit message、遵循 Agent Git 安全规则、设置推荐的 Git 配置 | references/git-workflow.md | assets/.gitattributes |
| 格式化 / 配置 Python | references/python-formatting.md | assets/setup.cfg |
| 格式化 / 配置 C++ | references/cpp-formatting.md | assets/.clang-format + assets/.clang-tidy |
| 格式化 / 配置 TypeScript(Prettier、ESLint、pnpm) | references/ts-formatting.md | assets/.prettierrc + assets/eslint.config.js |
| 格式化 Go | references/go-formatting.md | — |
| 设置 CMakeLists.txt 样式 | references/cmake-style.md | — |
Markdown / YAML / JSON 样式( | references/docs-style.md | assets/.editorconfig |
| 设置 VS Code(扩展、Pylance、保存时格式化、拼写检查) | references/python-formatting.md §3、§5、§6 + | assets/.vscode/extensions.json + assets/.vscode/settings.json |
Naming quick reference (most-used — read this first)
命名快速参考(最常用——请先阅读此部分)
| Repo type | Pattern | Separator | Example |
|---|---|---|---|
| Competition (one year / one match / one robot) | | underscore | |
| Internal / academic-year (non-competition) | | hyphen | |
| External / reusable / lib | | free | |
- Year/match tokens: = 2026 Robocon;
26RC= 2025 RoboMaster;25RM= academic year 2025-2026 (only in2526).aim-* - Segment casing: 2-digit year (); match abbreviation ALL CAPS (
26/RC/UC); robot name, when present, run-together PascalCase (UL,Sentry,NormalHero); package segment lowercaseR1.snake_case - ROS2 package-name consistency: if the repo is a single ROS package, the in
<name>must match the repo's "package" segment; prefixes likepackage.xmlare usually dropped inros2_(e.g.<name>→ros2_hik_camera).<name>hik_camera</name> - Default branch is always (never
main); competition / stable repos must not push directly tomaster— use a Pull Request.main
Full rules, decision tree, and known inconsistencies: references/repo-naming.md.
| 仓库类型 | 模式 | 分隔符 | 示例 |
|---|---|---|---|
| 竞赛(一年 / 一场比赛 / 一台机器人) | | 下划线 | |
| 内部 / 学年(非竞赛) | | 连字符 | |
| 外部 / 可复用 / lib | | 不限 | |
- 年份 / 赛事标记:= 2026 Robocon;
26RC= 2025 RoboMaster;25RM= 2025-2026 学年(仅用于2526)。aim-* - 各分段的大小写: 2 位年份();赛事缩写全部大写(
26/RC/UC);机器人名称(如有)使用连写 PascalCase(UL、Sentry、NormalHero);package 分段使用小写R1。snake_case - ROS2 package 名称一致性: 如果仓库是单个 ROS package,则 中的
package.xml必须与仓库的“package”分段一致;<name>等前缀通常会从ros2_中移除(例如,<name>→ros2_hik_camera)。<name>hik_camera</name> - 默认分支始终为 (绝不使用
main);竞赛 / 稳定仓库不得直接推送到master——应使用 Pull Request。main
完整规则、决策树和已知的不一致之处:references/repo-naming.md。
Commit message quick reference (Conventional Commits)
Commit message 快速参考(Conventional Commits)
text
<type>(<scope>): <subject>
<blank line>
<body> # optional, wrap at <=72 chars
<blank line>
<footer> # optional: BREAKING CHANGE: ... / Closes #123typefeat | fix | docs | style | refactor | test | chore | perf | ci | buildsubjectAgent rules: never run / unless the user explicitly asks in the current task, never call the CLI without explicit permission (any subcommand), never add an AI trailer to any commit, and after any code-changing task suggest a commit message — one line, ≤50 chars including the type prefix, American English — instead of committing. Details: references/git-workflow.md §5.
git commitgit pushghCo-Authored-By:The committer is you, AI or not: credit for what your AI gets right and blame for what it gets wrong both land on you, the user — so review the diff and commit yourself, with no AI co-author trailer. Policy: references/git-workflow.md §0.
text
<type>(<scope>): <subject>
<blank line>
<body> # optional, wrap at <=72 chars
<blank line>
<footer> # optional: BREAKING CHANGE: ... / Closes #123typefeat | fix | docs | style | refactor | test | chore | perf | ci | buildsubjectAgent 规则: 除非用户在当前任务中明确要求,否则绝不运行 / ;未经明确许可,绝不调用 CLI 的任何子命令;绝不向任何 commit 添加 AI trailer;完成任何代码变更任务后,不要直接提交,而应建议一条 commit message——单行、包含 type 前缀在内不超过 50 个字符、使用美式英语。详情:references/git-workflow.md §5。
git commitgit pushghCo-Authored-By:无论是否使用 AI,提交者都是你: 你的 AI 做对之处的功劳和做错之处的责任最终都落在你——用户——身上,因此请审查 diff 并自行提交,不要添加 AI 联合署名 trailer。政策:references/git-workflow.md §0。
How members adopt this skill
团队成员采用此 skill 的方式
This skill lives in . Install it with the open skills CLI (), which auto-detects every local agent (Claude Code / Cursor / Codex / …) and installs the whole skill directory for all of them:
unnc-aim/aim-common-agentic-skillsnpx skillsbash
npx skills add unnc-aim/aim-common-agentic-skills --skill aim-common-rules -g- installs globally (every project you open — recommended for individuals); omit
-gto install into the current project's-g(recommended for competition / collaborative repos — commit it so the whole team gets it on clone)..agents/skills/ - Update later with .
npx skills update
Prefer a manual copy?the whole skill directory intocp -R(global) or~/.claude/skills/(per repo). The directory —<your-repo>/.claude/skills/+SKILL.md+references/— must travel together.assets/
Whether or not you use AI, copy the canonical formatting rule files into your repo root and commit them, so everyone's editors / CI agree:
| Language | Copy as | Source |
|---|---|---|
| C++ | | assets/.clang-format, assets/.clang-tidy |
| Python | the | assets/setup.cfg |
Members not using AI: just readand copyreferences/*.md— no Claude Code required.assets/
此 skill 位于 。使用开源的 skills CLI()安装,它能自动检测所有本地 Agent(Claude Code / Cursor / Codex / …),并为所有 Agent 安装整个 skill 目录:
unnc-aim/aim-common-agentic-skillsnpx skillsbash
npx skills add unnc-aim/aim-common-agentic-skills --skill aim-common-rules -g- 表示全局安装(适用于你打开的每个项目——个人用户推荐);省略
-g则安装到当前项目的-g(竞赛 / 协作仓库推荐——将其提交,让所有成员克隆后即可使用)。.agents/skills/ - 后续可通过 更新。
npx skills update
更倾向于手动复制?使用将整个 skill 目录复制到cp -R(全局)或~/.claude/skills/(单个仓库)。该目录——<your-repo>/.claude/skills/+SKILL.md+references/——必须一并保留。assets/
无论是否使用 AI,请将标准格式规则文件复制到仓库根目录并提交,以确保所有成员的编辑器 / CI 配置一致:
| 语言 | 复制为 | 来源 |
|---|---|---|
| C++ | | assets/.clang-format、assets/.clang-tidy |
| Python | | assets/setup.cfg |
不使用 AI 的成员:只需阅读并复制references/*.md——无需 Claude Code。assets/
Repo setup — proactively offer editor config
仓库设置——主动提供编辑器配置
When you help create or set up a repo (a new project, or onboarding an existing one), proactively offer to add the team's VS Code config under so everyone who opens the repo gets the same extensions, formatting, and spelling baseline. Templates: assets/.vscode/extensions.json + assets/.vscode/settings.json.
.vscode/- Ask first. Propose it (e.g. "Want me to add +
.vscode/extensions.jsonwith the team's editor config?") and write files only on confirmation — never silently create files in the user's repo..vscode/settings.json - Merge, don't overwrite. If or
.vscode/extensions.jsonalready exists, merge by hand (add missing extension IDs to.vscode/settings.json; append missing settings /recommendations) instead of replacing.cSpell.words - Or just install locally. If the user prefers not to commit the files, offer to run per extension (after confirming), or point them to the list in
code --install-extension <id>§1.6.profile/README.md - Spelling (Code Spell Checker). When flags a word, first check whether it is a real typo; if it is a correct term spelled in American English (team / domain jargon, acronym, proper noun), add it to the
cSpellarray incSpell.words. Do not disable the checker or leave genuine typos in place..vscode/settings.json
settings.json当你帮助创建或设置仓库时(新项目,或为现有项目完成初始配置),主动提出在 下添加团队 VS Code 配置,使所有打开仓库的人都能获得相同的扩展、格式化和拼写检查基线。模板:assets/.vscode/extensions.json + assets/.vscode/settings.json。
.vscode/- 先询问。 提出建议(例如,“需要我添加 +
.vscode/extensions.json及团队编辑器配置吗?”),并仅在获得确认后写入文件——绝不要在用户仓库中擅自创建文件。.vscode/settings.json - 合并,不要覆盖。 如果 或
.vscode/extensions.json已存在,则手动合并(向.vscode/settings.json添加缺失的扩展 ID;向设置 /recommendations追加缺失项),而不是替换。cSpell.words - 或者只在本地安装。 如果用户不希望提交这些文件,可提出按每个扩展运行 (确认后),或指向
code --install-extension <id>§1.6 中的列表。profile/README.md - 拼写(Code Spell Checker)。 当 标记某个词时,先检查它是否为真实拼写错误;如果它是拼写正确的美式英语术语(团队 / 领域术语、缩写、专有名词),将其加入
cSpell中的.vscode/settings.json数组。不要禁用检查器,也不要保留真正的拼写错误。cSpell.words
settings.jsonKey gotchas
关键易错点
- clang-format only does layout, not naming. C++ naming rules (functions / variables
snake_case/ classescamelBack/ macros & constantsPascalCase/ structsUPPER_CASE) are enforced by human review or the provided_t. See references/cpp-formatting.md..clang-tidy - The vendored uses
ros2_hik_camera/.clang-tidyvariables, which conflicts with the writtenlower_case(standard.cpp.md). New repos follow the written standard; the team should reconcile. Details in cpp-formatting.md.camelBack - Python line length is 79 (matches the default used in
autopep8CI). Changing it to 99/100 would break that repo's CI.aim-py-2526-courseworks - autopep8 does not sort imports. Sort them with isort (; see references/python-formatting.md §5), and run it before autopep8. The
line_length = 79CI runs only autopep8, so isort is a recommended addition, not yet gated.aim-py-2526-courseworks - examples show 4-space indent, but the team's actual
standard.cpp.md(Google base) uses 2 spaces — the.clang-formatwins..clang-format - Inside a competition workspace (, e.g.
*_ws): add competition-prefixed repos as git submodules under26RC_R2_wswith the prefix stripped (src/→26RC_R2_arm_controller). The prefix is redundant — the workspace name already carries the year/match/robot. See references/workspace-organization.md.src/arm_controller
- clang-format 只处理布局,不处理命名。 C++ 命名规则(函数使用 / 变量使用
snake_case/ 类使用camelBack/ 宏和常量使用PascalCase/ struct 使用UPPER_CASE)通过人工审查或提供的_t强制执行。参见 references/cpp-formatting.md。.clang-tidy - 随仓库内置的 使用
ros2_hik_camera/.clang-tidy变量名,这与书面lower_case(standard.cpp.md)冲突。新仓库遵循书面标准;团队应协调解决两者。详情见 cpp-formatting.md。camelBack - Python 行长度为 79(与 CI 使用的
aim-py-2526-courseworks默认值一致)。将其改为 99/100 会导致该仓库的 CI 失败。autopep8 - autopep8 不会排序 import。 请使用 isort 对 import 排序(;参见 references/python-formatting.md §5),并在 autopep8 之前运行。
line_length = 79CI 当前仅运行 autopep8,因此 isort 是推荐项,尚未成为强制门禁。aim-py-2526-courseworks - 示例使用 4 空格缩进,但团队实际使用的
standard.cpp.md(Google base)采用 2 空格——以.clang-format为准。.clang-format - 在竞赛 workspace(,例如
*_ws)中:将带竞赛前缀的仓库作为 Git submodule 添加到26RC_R2_ws下,并移除前缀(src/→26RC_R2_arm_controller)。此前缀是冗余的——workspace 名称已经包含年份、赛事和机器人信息。参见 references/workspace-organization.md。src/arm_controller