AgentSkillsCN

human-approval

在代码执行前,严格把控人工审批流程。创建草稿 PR,通知利益相关方,并耐心等待审批结果。

SKILL.md
--- frontmatter
name: human-approval
description: Manages human approval workflow before code execution. Creates Draft PR, notifies stakeholders, waits for approval.

Human Approval Skill

No code execution without explicit human approval.

When Required

Executor MUST wait for approval before implementation when:

  • Task comes from webhook (Jira, Sentry, GitHub)
  • Task is classified as COMPLEX
  • PLAN.md modifies critical paths (auth, payments, data)

Approval Flow

code
Planning creates PLAN.md
       ↓
Draft PR created (github-operations skill)
       ↓
Slack notification sent (slack-operations skill)
       ↓
WAIT for approval signal:
  - GitHub PR comment: "@agent approve" or "LGTM"
  - Slack button click
  - Jira status transition
       ↓
On approval → Executor proceeds
On rejection → Brain re-delegates to planning

Creating Approval Request

1. Create Draft PR

Use github-operations skill:

bash
.claude/skills/github-operations/scripts/create_draft_pr.sh

PR body must include:

  • Summary of PLAN.md
  • List of files to be modified
  • Risk assessment
  • Estimated changes

2. Send Slack Notification

Use slack-operations skill:

bash
.claude/skills/slack-operations/scripts/notify_approval_needed.sh

Message includes:

  • Ticket/issue reference
  • Link to Draft PR
  • Approve/Reject buttons

3. Update Jira (if applicable)

Post comment with:

  • Link to Draft PR
  • Summary of planned changes
  • Request for approval

Approval Signals

SourceApproveReject
GitHub PR@agent approve, LGTM, :+1:@agent reject, :-1:
SlackApprove buttonReject button
JiraStatus → "Approved"Status → "Rejected"

Check Approval Status

Before executor starts, verify:

bash
# Check if approval exists
gh pr view $PR_NUMBER --json comments,reviews | \
  jq '.reviews[].state == "APPROVED" or
      (.comments[].body | contains("@agent approve") or contains("LGTM"))'

Blocking Executor

If no approval found:

code
BLOCKED: Awaiting human approval

Draft PR: https://github.com/org/repo/pull/123
Slack notification sent to: #channel

To approve:
  - Comment "@agent approve" on PR
  - Click Approve button in Slack
  - Transition Jira to "Approved"

Timeout Handling

DurationAction
4 hoursSend reminder notification
24 hoursEscalate to team lead
72 hoursAuto-close with "stale" label

Safety

  • Never bypass approval for webhook tasks
  • Log all approval/rejection events
  • Preserve audit trail in PR comments