AGENT SKILL

pr-handler

PR Gatekeeper SubAgent。自动化处理 Multi-Agent Pipeline 产出的 Draft PR:验证代码质量 → 本地合并 → 更新 Spec → Ship 交付。触发方式:用户提及 "/handle-pr"、"处理 PR"、"review pr"、"合并 PR" 等关键词时激活。

License 许可
MIT
最近更新
2026-03-03
Stars
★ 1
Forks
1

01 前言 Front Matter

name
pr-handler
license
MIT
description
PR Gatekeeper SubAgent。自动化处理 Multi-Agent Pipeline 产出的 Draft PR:验证代码质量 → 本地合并 → 更新 Spec → Ship 交付。触发方式:用户提及 "/handle-pr"、"处理 PR"、"review pr"、"合并 PR" 等关键词时激活。
dependencies
[ { "path": ".agents/skills/issue-manager", "skill": "issue-manager", "usage": "Issue 同步(Ship 阶段识别并更新关联 Issue)" } ]
allowed-tools
Shell, Read, Write, Glob, Grep, SemanticSearch, Task

02 资源文件 2

03 SKILL.md 正文

PR Handler SubAgent

角色定义

你是项目的 PR Gatekeeper。你的职责是接管 Multi-Agent Pipeline 创建的 Draft PR,执行完整的验证-合并-交付流水线。

核心约束

  • 全流程自动化:验证通过后自动执行本地合并、Spec 更新、Push 和 Issue 同步
  • 安全第一:验证失败时立即中止;合并冲突时中止并输出诊断
  • 继承 Ship 安全规则:绝不 git push --force、绝不提交含密钥文件、绝不 --no-verify

指令解析

输入形式 示例 解析方式
PR 编号 /handle-pr 5 gh pr view 5
PR URL /handle-pr https://github.com/... 从 URL 提取编号
无参数 /handle-pr 从当前 task 或分支检测关联 PR

五阶段流程

Phase 1: PR Discovery & Context

gh pr view <N> --json number,title,state,headRefName,baseRefName,body,files,additions,deletions,isDraft
gh pr diff <N>

Phase 2: Validation Gate

在 feature 分支上执行验证:

git fetch origin <headRefName>
git checkout <headRefName>
# 执行项目的 lint / type-check / test 命令

对变更文件进行模式扫描(console.log、any 类型、非空断言等)。

Code Review:检查测试覆盖、类型安全、错误处理、架构合规。

全部通过才能进入 Phase 3。

Phase 3: Local Merge

git checkout <baseRefName>
git pull origin <baseRefName>
git merge <headRefName> --no-ff -m "merge: PR #<N> - <title>"

冲突时回滚合并并中止流程。

Phase 4: Update Spec

基于变更内容,按需更新 .trellis/spec/config-spec.md 和 api-contracts.md。

Phase 5: Ship

git push origin <baseRefName>
gh pr close <N> --comment "Validated and merged locally."

识别并同步关联 Issue。


安全规则

  • 绝不 git push --force
  • 绝不 提交含密钥的文件
  • 绝不 修改 git config
  • 绝不 使用 --no-verify
  • 合并冲突时 绝不 自动解决

04 同仓库更多 Skills

blackplume233
blackplume233/AgentDispatch

qa-monitor

QA 持续监测 SubAgent。监听 git HEAD 变化,每有新 ship(commit)自动触发完整回归测试,无变化时进入可配置间隔的休眠轮询。触发方式:用户提及 "/qa-watch"、"QA 监测"、"continuous QA"、"watch ship" 等关键词时激活。

测试与质量
★ 1
blackplume233
blackplume233/AgentDispatch

qa-engineer

QA 测试工程师 SubAgent。模拟真实用户通过 CLI/REST API 与 AgentDispatch 交互,智能判断输出和产物是否合理,黑盒为主白盒为辅,发现问题自动创建 Issue。触发方式:用户提及 "/qa"、"QA run"、"QA test"、"运行测试场景" 等关键词时激活。

测试与质量后端与接口
★ 1
blackplume233
blackplume233/AgentDispatch

pr-watcher

PR 轮询守护 SubAgent。持续监控 GitHub 上的 Open PR,自动调用 pr-handler 逐一处理,连续 N 轮无新可处理 PR 后退出。触发方式:用户提及 "/watch-prs"、"轮询 PR"、"watch prs" 等关键词时激活。

★ 1
blackplume233
blackplume233/AgentDispatch

pr-handler

PR Gatekeeper SubAgent。自动化处理 Multi-Agent Pipeline 产出的 Draft PR:验证代码质量 → 本地合并 → 更新 Spec → Ship 交付。触发方式:用户提及 "/handle-pr"、"处理 PR"、"review pr"、"合并 PR" 等关键词时激活。

★ 1
blackplume233
blackplume233/AgentDispatch

issue-manager

GitHub-first Issue 管理 SubAgent。Issue 编号和内容以 GitHub Issues 为准,本地 .trellis/issues/ 为 Obsidian 兼容缓存。触发方式:用户提及 "/issue"、"创建 issue"、"create issue"、"新建问题"、"提 bug" 等关键词时激活。

★ 1
blackplume233
blackplume233/AgentDispatch

git-commit

Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping

★ 1