用途:为 OneKey 项目提供统一的 Git 工作流与约定,适用于创建分支、提交代码和发起 PR 的场景,触发词包括 git、branch、commit、PR、pull 等。
主要能力与规范:主分支为 x,流程为 x → 创建特性分支 → 开发 → PR 回 x;不要使用 onekey、master 或 main 作为基础分支,禁止直接在 x 分支上工作。分支命名:特性用 feat/description 或 feature/description,修复用 fix/description,重构用 refactor/description。提交信息采用 Conventional Commits:feat、fix、refactor、perf/optimize、chore、docs,格式为 type: 简短描述,使用小写,首行不超过 72 字符,可带 issue 号如 fix: resolve login bug OK-12345。Claude Code 提交不得包含 Generated with Claude Code 链接或 Co-Authored-By: Claude 签名,提交信息应与人工提交无差别。PR 命名与提交信息格式一致。
使用方式:创建分支可执行 git checkout x、git pull origin x、git checkout -b feat/my-new-feature。提交推荐使用 /commit 命令,它会自动运行 yarn lint:staged 和 yarn tsc:staged 并生成规范提交信息;也可手动执行 git add .、yarn lint:staged、yarn tsc:staged,通过后 git commit -m "feat: add user profile page"。推送与建 PR:git push -u origin feat/my-new-feature,再通过 GitHub UI 或 gh CLI 创建 PR。同步最新 x:git fetch origin、git rebase origin/x。
限制:提交前检查为强制要求,禁止提交未通过 lint 或 TypeScript 编译的代码。其他细节暂未提供。