bug-reproduce
Turn a known bug into a tight, red-capable reproducer, then prove the reproducer locks that…
Close out a local coding task on the bound daemon — stage, commit, branch, merge, push via cloud git — and when a merge conflicts, STOP and escalate with the file list instead of auto-resolving. Push reaches only the bare replica; prod-triggering tags are refused.
$ npx -y skills add Prismer-AI/PrismerCloud --skill git-ops --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/git-opsContext preview
The summary Claude sees to decide when to auto-load this skill.
Close out a local coding task on the bound daemon — stage, commit, branch, merge, push via cloud git — and when a merge conflicts, STOP and escalate with the file list instead of auto-resolving. Push reaches only the bare replica; prod-triggering tags are refused.
name: git-ops description: Close out a local coding task on the bound daemon — stage, commit, branch, merge, push via cloud git — and when a merge conflicts, STOP and escalate with the file list instead of auto-resolving. Push reaches only the bare replica; prod-triggering tags are refused. license: MIT scope: coding compatibility: - claude-code allowed-tools: - Bash metadata: category: vcs
收口一个本地 coding task 的 git 动作——在 workdir 上 `commit` / `branch` / `merge` / `push`,并把 branch+sha 落回 task metadata(`apc/05` §1 A2 · S8)。核心纪律:**merge 冲突绝不自动解决**——停手、列出冲突文件、escalate 给人,workdir 保持现场不回滚(`apc/00` §3 不变量 6)。
**什么时候用**:一个 coding task 改完,需要把改动收口成 commit / 分支、merge 回主线、并把 provenance(branch/sha)记到 task 上。
`cloud git` 的 cwd **永远不由你传**——它从 `--workdir <id>` 指向的 `IMWorkdir` 行读,daemon 侧再 jail 一次。`--workspace` / `--daemon` 默认取 dispatch env(`PRISMER_WORKSPACE_ID` / `PRISMER_DAEMON_ID`)。
| 命令 | 作用 | 关键 flag | | --- | --- | --- | | `cloud git workdirs` | 列 workspace 里的 repo workdir(拿 `<workdirId>`) | `--workspace` `--json` | | `cloud git commit <workdirId> -m <msg>` | 提交**已 staged** 的改动 | `-m/--message`(必填) | | `cloud git branch <workdirId> --name <b>` | 建并切到新分支 | `--name`(必填) | | `cloud git merge <workdirId> --source <ref>` | 把 `<ref>` merge 进当前分支(冲突→escalate,绝不自动解决) | `--source`(必填) | | `cloud git push <workdirId> --branch <b> \| --tag <t>` | push HEAD 到分支,或 push tag(prod tag 被拒) | `--branch` 或 `--tag`(二选一)· `--remote`(allowlist 纯名字,默认 origin) | | `cloud task meta set <task-id> --set-string k=v` | 把 provenance 写进 task metadata | `--set-string`(值恒字符串) |
cloud git workdirs --workspace "$PRISMER_WORKSPACE_ID" --json
从返回里挑本 task 对应的 repo workdir id(下称 `$WD`)。
# 在 workdir 的 repo cwd 里,只 stage 本 task 改的文件 git add path/to/file-a path/to/file-b git status --short # 确认只 stage 了 task-owned 文件
cloud git commit "$WD" -m "feat(x): 一句话说清这次改动" --json
从 stdout 的 `sha` 字段取真 commit sha(下称 `$SHA`)。
cloud git branch "$WD" --name "feat/task-$PRISMER_TASK_ID" --json
cloud git merge "$WD" --source feat/task-xxx --json > /tmp/merge.json; M=$?
Merge conflict — NOT auto-resolved. Escalate to a human. Conflicted files (<n>): <file-1> <file-2>
workdir 保持 daemon 留下的现场(`.git/MERGE_HEAD` 在、工作区有 `<<<<<<<` 标记),人可以直接进去看。冲突判据是 git 的**副作用**(未合并索引 / 进行中的 merge),不是错误文本——所以拼写错误的 ref 不会被误报成冲突。
# 分支: cloud git push "$WD" --branch feat/task-xxx --json # tag(非 prod): cloud git push "$WD" --tag k8s-test-20260724-v2.0.7 --json
cloud task meta set "$PRISMER_TASK_ID" \ --set-string git.branch=feat/task-xxx \ --set-string git.sha="$SHA"
**必须 `--set-string`**:`--set git.sha=1234567` 会把全数字 sha 变成 number。
本 skill 的判据不是「报告里出现了 `conflict` 这个词」,而是**判据拿只读 git plumbing 去真 object store 复核**(`structured-criteria.ts` 的 `git-claim-readback`),provenance 则回读真 task 行(`declared-id-readback`)。所以报告必须带这些**可机器解析的行**:
GIT-REPO: .e2e-tmp/<name>/work GIT-COMMIT: <full sha> | files: a.txt, b.txt GIT-BRANCH: <branch> | head: <full sha> GIT-PUSHED: <branch> | remote: origin GIT-REFUSED-TAG: k8s-prod-<date>-v<x.y.z> | remote: origin GIT-CONFLICT-REPO: .e2e-tmp/<name>/conflict GIT-CONFLICT-FILES: c.txt TASK: <task id> META: git.sha = <full sha> | type: string META: git.branch = <branch> | type: string
判据会判红的情况(任一):
**这些命令全是只读的**(`cat-file` / `show --name-only` / `rev-parse` / `ls-remote` / `diff --diff-filter=U` / `tag -l`)——判据本身绝不写任何仓库。
`TASK:` / `META:` 那两行走的是 API 回读,**凭据必须是真正跑命令的那个身份**(`APC_READBACK_TOKEN` / `DEV_JWT` / `PRISMER_API_KEY`;换账号回读会 403 ⇒ 假红)。凭据缺失或 API 不可达一律判红——「验不了」不算过。
1. **真 c
Repo: Prismer-AI/PrismerCloud
Turn a known bug into a tight, red-capable reproducer, then prove the reproducer locks that…
Review a diff against its acceptance criteria in four segments (convention adherence, bug…
Five-dimension design audit (frontend UI/UX · server data-model & flow · endpoint spec ·…
Before merge, mechanize Documentation-First — derive the code delta from git diff, then…
Diagnose the local dev machine before any APC loop step — run apc env doctor, classify each…
For a change point (function / type / endpoint / SQL column), enumerate its real blast radius…