10cg/aria-plugin/branch-finisher

Claude Code and agent skill by 10cg/aria-plugin

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

分支开发完成后的收尾工作执行器,负责测试验证、worktree 清理。 使用场景:分支开发完成后的收尾工作

Install

npx vskill@latest install 10cg/aria-plugin/branch-finisher

SKILL.md

The same SKILL.md was published earlier as 10cg/aria-plugin/branch-finisher.

Branch Finisher (分支完成器)

版本: 1.0.0 | 十步循环: B.2 → C.1
更新: 2026-01-21 - 初始版本

快速开始

我应该使用这个 skill 吗?
场景使用 branch-finisher?
完成分支开发,准备提交✅ 是
需要运行测试验证✅ 是
需要清理 worktree✅ 是
刚开始开发❌ 否,使用 branch-manager
代码审查中❌ 否,使用 subagent-driver
不应该使用的场景
  • 分支刚创建 → 使用 branch-manager
  • 任务执行中 → 使用 subagent-driver
  • 需要创建 PR → 使用 branch-manager (C.2)

配置 (config-loader)

执行前读取 .aria/config.json,缺失则使用默认值。参见 config-loader。

字段默认值说明
benchmarks.require_before_mergetrue合并前是否要求 AB 基准测试

核心功能

功能说明
测试前置验证确保所有测试通过后才能继续
4 选项完成流程提供标准化的完成选项
Worktree 清理智能决策是否清理 worktree
状态同步与 subagent-driver 状态同步

执行流程

┌─────────────────────────────────────────────────────────────┐
│ Branch Finisher 执行流程 │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. 接收完成信号 │
│ ├─ 来自 subagent-driver (所有任务完成) │
│ └─ 来自用户手动触发 │
│ │
│ 2. 测试前置验证 │
│ ├─ 运行测试套件 │
│ ├─ 检查测试覆盖率 │
│ └─ 构建验证 (跟随 framework_build_check 三态) │
│ │
│ 2.5 Skill 变更 AB 验证 (v1.7.0 新增) │
│ ├─ 检测分支 diff 中是否包含 SKILL.md 变更 │
│ ├─ Zone 分类: 逻辑变更 vs 文档变更 │
│ ├─ 检查 ab-results/ 中是否有新鲜 AB 结果 │
│ └─ 缺失时: warn/block (由 config 控制) │
│ 详见 references/ab-benchmark-gate.md │
│ │
│ 3. 变更摘要 │
│ ├─ 收集所有变更文件 │
│ ├─ 统计代码行数变化 │
│ └─ 列出完成的任务 │
│ │
│ 4. 4 选项完成流程 │
│ ├─ [1] 提交并创建 PR │
│ ├─ [2] 继续修改 │
│ ├─ [3] 放弃变更 │
│ └─ [4] 暂停保存 │
│ │
│ 5. Worktree 清理决策 │
│ ├─ 选项 1: 清理 worktree │
│ ├─ 选项 2: 保留 worktree │
│ └─ 选项 3: 稍后决定 │
│ │
│ 6. 执行选择的操作 │
│ └─ 调用相应的后续 skill │
│ │
└─────────────────────────────────────────────────────────────┘

测试前置验证

验证项目
验证项说明阻塞级别
单元测试所有单元测试通过阻塞
集成测试集成测试通过 (如有)阻塞
类型检查TypeScript/mypy 等类型检查阻塞
Lint 检查ESLint/Pylint 等代码检查警告
构建验证跟随 phase_b_developer.framework_build_check (见下; 10CG/Aria#231)三态 (config 决定)
覆盖率检查测试覆盖率达标 (可选)警告
Skill AB 验证SKILL.md 逻辑变更需要 AB 测试结果 (详见)可配置 (warn/block)

构建验证三态 — 本项不设无条件阻塞; 行为由 config-loader 的 phase_b_developer.framework_build_check 决定 (Aria #95 开关; 构建归属 CI 的项目本机不跑构建):

phase_b_developer.framework_build_check行为
enabled: false (默认)跳过 — 非阻塞; 输出 build: skipped (framework_build_check disabled) 并注明构建归属 (CI / 未配置)
enabled: true, mode: advisory执行 command; 失败 → 警告 (可继续)
enabled: true, mode: blocking执行 command; 失败 → 阻塞
验证流程
yaml
测试验证流程:
1. 检测项目类型:
- Node.js: npm test / pnpm test
- Python: pytest / python -m unittest
- Rust: cargo test
- Flutter: flutter test
- Go: go test ./...
2. 运行测试:
- 执行测试命令
- 收集测试结果
- 记录失败的测试
3. 构建验证 (读 framework_build_check 三态):
- enabled=false → 跳过, 记 build: skipped (注明归属 CI/未配置)
- enabled=true → 执行 command; mode=advisory 失败记警告, mode=blocking 失败记阻塞
4. 验证结果:
- 全部通过 → 继续
- 有失败 → 阻塞,显示失败详情
- 有警告 → 显示警告,询问是否继续
验证输出
yaml
成功输出:
tests:
total: 42
passed: 42
failed: 0
skipped: 0
coverage: 85%
build: success # enabled=true 且构建通过
lint: pass
构建未启用 (默认):
tests:
total: 42
passed: 42
failed: 0
skipped: 0
build: skipped (framework_build_check disabled — 构建归属: CI/未配置)
失败输出:
tests:
total: 42
passed: 40
failed: 2
skipped: 0
failed_tests:
- test_auth.py::test_login_invalid_password
- test_auth.py::test_register_duplicate_email
build: failed # enabled=true 且构建失败 (advisory=警告 / blocking=阻塞)
lint: 3 warnings

4 选项完成流程

选项定义
┌─────────────────────────────────────────────────────────────┐
│ 4 选项完成流程 │
├─────────────────────────────────────────────────────────────┤
│ │
│ [1] 提交并创建 PR (Commit & PR) │
│ → 提交所有变更 │
│ → 创建 Pull Request │
│ → 清理 worktree (如适用) │
│ │
│ [2] 继续修改 (Continue Editing) │
│ → 返回开发状态 │
│ → 保留所有变更 │
│ → 可以继续使用 subagent-driver │
│ │
│ [3] 放弃变更 (Discard Changes) │
│ → 撤销所有变更 │
│ → 删除分支 │
│ → 清理 worktree (如适用) │
│ │
│ [4] 暂停保存 (Pause & Save) │
│ → 保存当前状态 │
│ → 可以稍后恢复 │
│ → 保留 worktree │
│ │
└─────────────────────────────────────────────────────────────┘
交互示例
┌─────────────────────────────────────────────────────────────┐
│ │
│ ✅ 分支开发完成 │
│ │
│ 分支: feature/backend/TASK-001-user-auth │
│ 模式: Worktree (L2 隔离) │
│ │
│ 测试验证: ✅ 通过 (42/42) │
│ 覆盖率: 85% │
│ 构建: ⏭️ 跳过 (framework_build_check 未启用) │
│ │
│ 变更摘要: │
│ - 修改: 5 个文件 (+142, -28) │
│ - 新增: 2 个文件 (+85) │
│ - 删除: 0 个文件 │
│ │
│ 完成的任务: │
│ ✅ TASK-001: 实现用户认证 │
│ ✅ TASK-002: 添加登录 API │
│ ✅ TASK-003: 添加注册 API │
│ │
│ 请选择下一步: │
│ [1] 提交并创建 PR │
│ [2] 继续修改 │
│ [3] 放弃变更 │
│ [4] 暂停保存 │
│ │
│ 选择 [1/2/3/4]: _ │
│ │
└─────────────────────────────────────────────────────────────┘

Worktree 清理决策

清理时机
选项清理 Worktree?原因
[1] 提交并创建 PR✅ 是 (默认)开发完成,不再需要
[2] 继续修改❌ 否还需要继续开发
[3] 放弃变更✅ 是变更已撤销
[4] 暂停保存❌ 否稍后可能恢复
清理流程
yaml
Worktree 清理流程:
1. 确认清理:
- 显示 worktree 路径
- 询问用户确认
2. 执行清理:
- cd 回主目录
- git worktree remove {path}
- git worktree prune
3. 验证清理:
- 检查 worktree 已删除
- 检查分支状态
清理选项
┌─────────────────────────────────────────────────────────────┐
│ │
│ Worktree 清理 │
│ │
│ 路径: .git/worktrees/TASK-001-user-auth │
│ 大小: 约 50MB │
│ │
│ 请选择: │
│ [1] 立即清理 (推荐) │
│ [2] 保留 worktree │
│ [3] 稍后决定 │
│ │
│ 选择 [1/2/3]: _ │
│ │
└─────────────────────────────────────────────────────────────┘

输入参数

参数必需说明示例
branch_name✅分支名feature/backend/TASK-001-user-auth
session_id❌subagent-driver 会话 IDsess-20260121-001
worktree_path❌worktree 路径 (如适用).git/worktrees/TASK-001
skip_tests❌跳过测试验证 (不推荐)false
auto_cleanup❌自动清理 worktreefalse

输出

yaml
成功输出 (选项 1):
action: "commit_and_pr"
branch_name: "feature/backend/TASK-001-user-auth"
commit_hash: "abc1234"
pr_url: "https://forgejo.example.com/repo/pulls/42"
worktree_cleaned: true
next_step: "等待 PR 审核"
成功输出 (选项 2):
action: "continue_editing"
branch_name: "feature/backend/TASK-001-user-auth"
worktree_path: ".git/worktrees/TASK-001-user-auth"
next_step: "继续开发"
成功输出 (选项 3):
action: "discard_changes"
branch_deleted: true
worktree_cleaned: true
next_step: "返回 develop 分支"
成功输出 (选项 4):
action: "pause_and_save"
state_file: ".claude/branch-state/TASK-001.yaml"
resume_command: "branch-finisher --resume TASK-001"
next_step: "稍后恢复"

与其他 Skills 集成

与 subagent-driver 集成
yaml
集成点:
输入:
- session_id: 从 subagent-driver 获取
- completed_tasks: 已完成的任务列表
- changes: 所有变更文件
触发:
- subagent-driver 所有任务完成时自动触发
- 或用户手动调用
输出:
- 完成状态反馈给 subagent-driver
- 更新会话状态
与 branch-manager 集成
yaml
集成点:
选项 1 (提交并创建 PR):
- 调用 commit-msg-generator 生成提交消息
- 调用 branch-manager C.2 创建 PR
选项 3 (放弃变更):
- 调用 branch-manager 删除分支
Worktree 清理:
- 使用 branch-manager 的 worktree 清理模板
与 tdd-enforcer 集成
yaml
集成点:
测试验证:
- 调用 tdd-enforcer 运行测试
- 获取测试结果和覆盖率
- 验证 TDD 流程完整性

Red Flags

使用 branch-finisher 的危险信号
场景为什么危险正确做法
跳过测试验证可能提交有 bug 的代码始终运行测试
测试失败仍提交破坏主分支稳定性修复测试后再提交
不清理 worktree磁盘空间浪费完成后清理
放弃大量变更工作丢失确认前仔细检查

职责边界

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/10cg/aria-plugin/branch-finisher/badge)](https://verified-skill.com/skills/10cg/aria-plugin/branch-finisher)

Something wrong with this skill or its page? Tell us.