Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 0 additions & 278 deletions .agents/hook/enforce_gh_review_approval.sh

This file was deleted.

41 changes: 17 additions & 24 deletions .agents/rules/common/development-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,25 @@ The Feature Implementation Workflow describes the development pipeline: research
- Ensure branch is up to date with target branch
- Only request review after these checks pass

## GitHub Issue / PR Review Approval (mandatory before `gh ... create`)
## Autonomous issue / PR policy

`gh issue create|edit` and `gh pr create|edit` publish content to a
public, indexed repo. The user must see and approve the draft BEFORE it
lands. Enforced by `.claude/hook/enforce_gh_review_approval.sh`
(PreToolUse on Bash), which denies these commands until the session
transcript contains an explicit user approval phrase -- the same
transcript-based approval discipline as
`enforce_shellcheck_disable_approval.sh`.
Issues and PRs are created and merged by agents without a per-item human
draft approval. The gate is technical, not conversational: a PR merges once
TDD is done and CI (`ci-passed`) is green -- push, `gh pr create`, arm
`gh pr merge --auto`, let the aggregator decide. No draft file, no
approval phrase, no wait for the maintainer.

Default flow:
The only thing that still needs the maintainer's explicit consent is a
**release tag** (`.claude/script/release-tag.sh`; see
`doc/process/release.md`).

1. Write the draft in the user's working language (zh-TW) to a local
file, e.g. `/tmp/<slug>.zh.md`.
2. Show the path (and/or a short summary) and ask the user to review it.
3. After the user approves, translate the approved content to English.
4. Run `gh issue create` / `gh pr create` with the English `--body-file`.
English-only enforcement (`enforce_gh_english.sh`) still runs.
What still applies to every `gh issue|pr create|comment`:

Approval phrases (case-insensitive; any one is enough):
- English-only, emoji-free titles / bodies for this repository's issues
and PRs (`enforce_gh_english.sh`).
- `--body-file` for bodies (`enforce_gh_body_file.sh`) and the issue
template (`enforce_gh_issue_template.sh`).

- `approve issue` / `issue ok` -> authorizes `gh issue create|edit`
- `approve pr` / `pr ok` -> authorizes `gh pr create|edit`
- `skip review` -> the explicit opt-out; authorizes either kind when the
user says to go straight to create ("just open the issue" style).

The canonical tokens stay English so the hook check is locale-agnostic.
Emergency bypass (leaves an audit trail in shell history):
`ECC_ALLOW_GH_REVIEW=1`.
History: the previous transcript-approval gate
(`enforce_gh_review_approval.sh`, issue #34) was retired on 2026-09-19 --
see `doc/changelog/CHANGELOG.md`.
33 changes: 14 additions & 19 deletions .agents/rules/zh/development-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,22 @@
- 确保分支已与目标分支同步
- 仅在这些检查通过后请求审查

## GitHub Issue / PR 审查批准(`gh ... create` 前必需)
## 自主 Issue / PR 策略

`gh issue create|edit` 与 `gh pr create|edit` 会把内容发布到一个公开且被
索引的仓库。用户必须在内容落地之前看到并批准草稿。由
`.claude/hook/enforce_gh_review_approval.sh`(Bash 的 PreToolUse)强制执行:
在会话记录(transcript)包含明确的用户批准短语之前,拒绝这些命令 --
与 `enforce_shellcheck_disable_approval.sh` 相同的基于记录的批准机制。
Issue 与 PR 由代理自主创建与合并,不再逐项等待人工审批草稿。门槛是技术性
的而非对话性的:完成 TDD 且 CI(`ci-passed`)为绿后,PR 即可合并 -- 推送、
`gh pr create`、启用 `gh pr merge --auto`,交由聚合检查决定。不需要草稿文件、
不需要批准短语、不需要等待维护者。

默认流程:
唯一仍需维护者明确同意的是**发布标签**(`.claude/script/release-tag.sh`;
参见 `doc/process/release.md`)。

1. 用用户的工作语言(zh-TW)把草稿写到本地文件,例如 `/tmp/<slug>.zh.md`。
2. 展示该路径(以及/或简短摘要),请用户审查。
3. 用户批准后,把批准的内容翻译为英文。
4. 用英文的 `--body-file` 运行 `gh issue create` / `gh pr create`。
英文强制检查(`enforce_gh_english.sh`)仍会运行。
对每个 `gh issue|pr create|comment` 仍然适用的规则:

批准短语(大小写不敏感;任意一个即可):
- 本仓库的 issue / PR 标题与正文必须为纯英文且不含 emoji
(`enforce_gh_english.sh`)。
- 正文使用 `--body-file`(`enforce_gh_body_file.sh`),并遵循 issue 模板
(`enforce_gh_issue_template.sh`)。

- `approve issue` / `issue ok` -> 授权 `gh issue create|edit`
- `approve pr` / `pr ok` -> 授权 `gh pr create|edit`
- `skip review` -> 显式跳过;当用户表示直接开 issue/PR 时授权两种。

规范 token 保持英文,使钩子检查与语言无关。
应急绕过(会在 shell 历史留下审计痕迹):`ECC_ALLOW_GH_REVIEW=1`。
历史:先前基于会话记录的审批门(`enforce_gh_review_approval.sh`,issue #34)
已于 2026-09-19 退役 -- 参见 `doc/changelog/CHANGELOG.md`。
4 changes: 0 additions & 4 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.claude/hook/enforce_gh_english.sh"
},
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.claude/hook/enforce_gh_review_approval.sh"
},
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.claude/hook/remind_ci_auto_merge.sh"
Expand Down
Loading
Loading