shunk031-github-cgd-identity
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese[!NOTE] After reading this, say:SKILL.md🎨 I read shunk031-github-cgd-identity.
[!NOTE] 阅读此后,请说:SKILL.md🎨 I read shunk031-github-cgd-identity.
CGD Dev Identity
CGD Dev Identity
Overview
概述
Perform git and gh write operations for creative-graphic-design organization repositories as the machine user (user ID 176740601), not a personal account. A bot-authored PR lets a human account formally review and approve it. Because GitHub does not permit users to approve their own PRs, creating a PR with a personal account would prevent the review flow from working.
creative-graphic-design-dev以 机器用户(用户 ID 176740601)而非个人账户,执行 creative-graphic-design 组织仓库的 git 和 gh 写操作。由 bot 创建的 PR 可让人类账户正式进行 review 和 approve。由于 GitHub 不允许用户 approve 自己创建的 PR,因此使用个人账户创建 PR 会导致 review 流程无法正常进行。
creative-graphic-design-devSetup
设置
Before starting write operations, perform the following checks in the working shell and worktree. Run them as a starting procedure rather than investigating only after a failure.
-
For repository writes, confirm thatpoints to
git remote get-url origin.github.com/creative-graphic-designIf it does not, this skill does not apply; use normal git identity and authentication. New-machinebootstrap is exempt.setup-gh-cgd -
Ensure that GitHub CLI has the bot account in its system credential store. On a new machine, run the interactive setup command once and authenticate in the browser as:
creative-graphic-design-devbashsetup-gh-cgdDo not useduring agent work. It changes the active account for the whole host and can race with concurrent sessions.gh auth switch -
Retrieve the stored bot token by account name and pass it only to each write command that uses gh or git credentials:bash
GH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" gh pr create ... GH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" git pushDo not export the token into a persistent shell and do not print it. The per-command prefix keeps account selection explicit and avoids changing GitHub CLI's global active account. -
Verify the GitHub identity and push permission for the organization repository.only confirms the logged-in account and cannot verify access to organization resources:
gh api userbashGH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" gh api user --jq .login GH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" gh api repos/creative-graphic-design/<repo> --jq .permissions.pushDo not start write operations unless the first command returnsand the second returnscreative-graphic-design-dev.true -
Set the commit author to the bot for each commit command:bash
git -c user.name=creative-graphic-design-dev \ -c user.email=176740601+creative-graphic-design-dev@users.noreply.github.com \ commit ...Do not usein a linked worktree: it writes to the sharedgit config user.name/emailand changes the author for the main checkout and concurrent worktrees as well..git/config -
Push over HTTPS because SSH does not use the proxy in this environment. Set an explicit push URL:bash
git remote set-url --push origin https://github.com/creative-graphic-design/<repo>
GH_TOKENx-access-token在开始写操作前,请在当前 shell 和 worktree 中执行以下检查。应将其作为启动流程执行,而不是只在失败后再调查。
-
对于仓库写操作,确认指向
git remote get-url origin。github.com/creative-graphic-design如果不符合,则此 skill 不适用;请使用常规 git identity 和 authentication。新机器上的bootstrap 不受此限制。setup-gh-cgd -
确保 GitHub CLI 的 system credential store 中已配置 bot account。在新机器上,运行一次交互式 setup 命令,并在浏览器中以身份完成 authentication:
creative-graphic-design-devbashsetup-gh-cgdAgent 工作期间不要使用。该命令会更改整台主机的活动账户,可能与并发 session 发生冲突。gh auth switch -
按账户名获取已存储的 bot token,并且仅将其传递给各个使用 gh 或 git credentials 的写命令:bash
GH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" gh pr create ... GH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" git push不要将 token export 到持久化 shell 中,也不要打印它。按命令添加前缀可以明确指定账户,同时避免更改 GitHub CLI 的全局活动账户。 -
验证 GitHub identity 以及组织仓库的 push permission。只能确认当前登录的账户,无法验证对组织资源的访问权限:
gh api userbashGH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" gh api user --jq .login GH_TOKEN="$(gh auth token --hostname github.com --user creative-graphic-design-dev)" gh api repos/creative-graphic-design/<repo> --jq .permissions.push除非第一个命令返回且第二个命令返回creative-graphic-design-dev,否则不要开始写操作。true -
对每个 commit 命令,将 commit author 设置为 bot:bash
git -c user.name=creative-graphic-design-dev \ -c user.email=176740601+creative-graphic-design-dev@users.noreply.github.com \ commit ...不要在 linked worktree 中使用。该操作会写入共享的git config user.name/email,同时更改主 checkout 和并发 worktree 的 author。.git/config -
通过 HTTPS 执行 push,因为此环境中的 SSH 不会使用 proxy。请设置明确的 push URL:bash
git remote set-url --push origin https://github.com/creative-graphic-design/<repo>
在同一个命令环境中, 同时适用于 gh 和 git credential helper。Credential helper 返回的 token 使用用户名 。
GH_TOKENx-access-tokenScope
适用范围
- This skill applies only to creative-graphic-design organization repositories on github.com. Do not use the stored bot credential or the bot commit identity for other hosts, organizations, or personal repositories; use normal authentication and the normal git identity there.
- Attribute every coding-agent write to a creative-graphic-design organization repository to the bot. This includes commits, pushes, PR creation and updates, PR replies, issue comments, labels, milestones, and user-requested merges.
- If any Setup verification fails, abandon the bot identity entirely: do not apply it partially, such as setting the bot commit author while the credential check failed or pushing through another account. Stop and report instead.
- The human () retains only PR approval in the GitHub UI and the decision to merge. Do not approve PRs as the bot.
shunk031
- 此 skill 仅适用于 github.com 上的 creative-graphic-design 组织仓库。不要在其他主机、组织或个人仓库中使用已存储的 bot credential 或 bot commit identity;在这些场景下应使用常规 authentication 和常规 git identity。
- 对 creative-graphic-design 组织仓库的所有 coding-agent 写操作,都必须使用 bot identity。这包括 commit、push、PR 创建与更新、PR 回复、issue 评论、label、milestone 以及用户请求的 merge。
- 如果任何 Setup 验证失败,请完全放弃 bot identity:不要局部应用该身份,例如在 credential 检查失败时仍设置 bot commit author,或通过其他账户执行 push。请停止操作并报告问题。
- 人类用户()仅负责在 GitHub UI 中 approve PR,以及决定是否 merge。不要以 bot 身份 approve PR。
shunk031
Troubleshooting
故障排查
- If fails or the stored credential is rejected, remove that account with
gh auth token --user creative-graphic-design-dev, then rerungh auth logout --hostname github.com --user creative-graphic-design-dev. This changes local authentication state and must be done interactively by the user.setup-gh-cgd - If the identity check succeeds but repository permission is , grant
falseaccess to the target repository before retrying. Reauthentication is unnecessary when only repository membership changes.creative-graphic-design-dev
- 如果 执行失败,或已存储的 credential 被拒绝,请使用
gh auth token --user creative-graphic-design-dev移除该账户,然后重新运行gh auth logout --hostname github.com --user creative-graphic-design-dev。此操作会更改本地 authentication 状态,必须由用户以交互方式完成。setup-gh-cgd - 如果 identity 检查成功,但仓库 permission 为 ,请先授予
false对目标仓库的访问权限,然后重试。如果仅更改了仓库 membership,则无需重新 authentication。creative-graphic-design-dev