AgentSkillsCN

human-approval

在代码执行前,严格把控人工审批流程。当代码变更需要审批、需要创建草稿 PR,或在继续推进前需等待利益相关方的批准时,可使用此方法。

SKILL.md
--- frontmatter
name: human-approval
description: Manages human approval workflow before code execution. Use when code changes require approval, creating draft PRs, or waiting for stakeholder approval before proceeding.

Human Approval Skill

No code execution without explicit human approval.

Quick Reference

  • Templates: See templates.md for approval workflow communications

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 MCP tool github:create_pull_request with draft=true:

See github-operations/flow.md for complete workflow.

PR body must include:

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

2. Send Slack Notification

Use MCP tool slack:post_message with approval blocks:

See slack-operations/flow.md for complete workflow.

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