feature-release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feature Release Skill

Feature发布Skill

Purpose

用途

Merge the validated feature to main branch via PR, optionally tag a release, and clean up the feature worktree. Phase 5 of the feature lifecycle (design → plan → implement → validate → release).
通过PR将已验证的功能合并到主分支,可选择打发布标签,并清理功能工作区。这是功能生命周期的第5阶段(设计→规划→实现→验证→发布)。

Operator Context

操作者上下文

Hardcoded Behaviors (Always Apply)

硬编码行为(始终生效)

  • CLAUDE.md Compliance: Read and follow repository CLAUDE.md
  • Validation Required: CANNOT release without validation passing
  • State Management via Script: All state operations through
    python3 ~/.claude/scripts/feature-state.py
  • PR-Based Merge: Always merge via pull request, never direct push to main
  • Conventional Commits: Use conventional commit format
  • No Attribution Lines: No "Co-Authored-By" or "Generated with Claude Code"
  • 遵循CLAUDE.md规范:阅读并遵循仓库的CLAUDE.md文档
  • 必须通过验证:未通过验证时绝对不能执行发布
  • 通过脚本管理状态:所有状态操作需通过
    python3 ~/.claude/scripts/feature-state.py
    完成
  • 基于PR合并:始终通过拉取请求(PR)合并,绝不直接推送到main分支
  • 规范提交格式:使用Conventional Commits提交格式
  • 无归属行:禁止添加“Co-Authored-By”或“Generated with Claude Code”行

Default Behaviors (ON unless disabled)

默认行为(开启状态,除非手动禁用)

  • Context Loading: Read all artifacts (design, plan, implement, validate)
  • Squash Merge: Squash feature branch into single commit on main
  • Worktree Cleanup: Remove worktree after successful merge
  • Feature State Archive: Move feature state to completed
  • 加载上下文:读取所有相关工件(设计、规划、实现、验证文档)
  • 压缩合并:将功能分支压缩为单个提交合并到main分支
  • 清理工作区:合并成功后删除工作区
  • 归档功能状态:将功能状态标记为已完成

Optional Behaviors (OFF unless enabled)

可选行为(关闭状态,除非手动启用)

  • Version Bump: Bump version number based on change type
  • Changelog Update: Add entry to CHANGELOG.md
  • Tag Release: Create git tag after merge
  • 版本号升级:根据变更类型升级版本号
  • 更新变更日志:在CHANGELOG.md中添加条目
  • 打发布标签:合并后创建git tag

What This Skill CAN Do

本Skill可执行的操作

  • Create pull requests from feature branches
  • Generate PR descriptions from design/plan/validation artifacts
  • Clean up worktrees and feature state after merge
  • Archive completed feature state
  • 从功能分支创建拉取请求(PR)
  • 根据设计/规划/验证工件生成PR描述
  • 合并后清理工作区和功能状态
  • 归档已完成的功能状态

What This Skill CANNOT Do

本Skill不可执行的操作

  • Release without passing validation
  • Push directly to main
  • Skip PR review process
  • Delete feature branch before merge confirmation
  • 未通过验证时执行发布
  • 直接推送到main分支
  • 跳过PR审核流程
  • 合并确认前删除功能分支

Instructions

操作步骤

Phase 0: PRIME

阶段0:准备

  1. Verify feature state is
    release
    and
    validate
    is completed.
  2. Load all artifacts: design, plan, implementation summary, validation report.
  3. Check gate:
    python3 ~/.claude/scripts/feature-state.py gate FEATURE release.merge-strategy
Gate: All artifacts loaded. Validation passed. Proceed.
  1. 验证功能状态为
    release
    validate
    已完成。
  2. 加载所有工件:设计文档、规划文档、实现摘要、验证报告。
  3. 检查准入条件:
    python3 ~/.claude/scripts/feature-state.py gate FEATURE release.merge-strategy
准入要求:所有工件已加载,验证已通过。方可继续。

Phase 1: EXECUTE (Release)

阶段1:执行(发布)

Step 1: Generate PR Content
From the accumulated artifacts, generate:
markdown
undefined
步骤1:生成PR内容
根据收集到的工件,生成如下格式的PR描述:
markdown
undefined

Summary

摘要

[From design document problem statement]
[来自设计文档的问题描述]

Changes

变更内容

[From implementation artifact — what was built]
[来自实现工件——已完成的开发内容]

Testing

测试情况

[From validation report — what was verified]
[来自验证报告——已验证的内容]

Design Decision

设计决策

[From design document — why this approach]

**Step 2: Create PR**

Use our existing pr-pipeline patterns:
1. Ensure feature branch is pushed
2. Create PR via `gh pr create`
3. Link to design decisions

**Step 3: Post-Merge Cleanup** (after PR is merged)

1. Clean up worktree:
   ```bash
   python3 ~/.claude/scripts/feature-state.py worktree FEATURE cleanup
  1. Archive feature state:
    bash
    python3 ~/.claude/scripts/feature-state.py complete FEATURE
  2. Update L0 (remove feature from active list).
Gate: PR created/merged. Cleanup complete.
[来自设计文档——采用该方案的原因]

**步骤2:创建PR**

遵循现有PR流水线模式:
1. 确保功能分支已推送到远程仓库
2. 通过`gh pr create`命令创建PR
3. 关联设计决策文档

**步骤3:合并后清理**(PR合并成功后执行)

1. 清理工作区:
   ```bash
   python3 ~/.claude/scripts/feature-state.py worktree FEATURE cleanup
  1. 归档功能状态:
    bash
    python3 ~/.claude/scripts/feature-state.py complete FEATURE
  2. 更新L0列表(从活跃列表中移除该功能)。
准入要求:PR已创建/合并,清理工作已完成。

Phase 2: VALIDATE

阶段2:验证

  • PR was created successfully
  • Feature branch exists on remote
  • PR description includes design context
  • PR已成功创建
  • 功能分支已存在于远程仓库
  • PR描述包含设计上下文

Phase 3: CHECKPOINT

阶段3:检查点

  1. Save release artifact:
    bash
    echo "RELEASE_NOTES" | python3 ~/.claude/scripts/feature-state.py checkpoint FEATURE release
  2. Record learnings — final pass, capture insights from the full lifecycle:
    bash
    python3 ~/.claude/scripts/learning-db.py record TOPIC KEY "VALUE" --category design
    Focus on: architectural decisions, workflow improvements, agent performance, patterns to reuse.
  3. Report completion:
    Feature [NAME] released successfully.
    - Design → Plan → Implement → Validate → Release: complete
    - PR: [URL]
    - Retro findings: [N] recorded, [M] promoted to context
  1. 保存发布工件:
    bash
    echo "RELEASE_NOTES" | python3 ~/.claude/scripts/feature-state.py checkpoint FEATURE release
  2. 记录经验总结——最终环节,收集全生命周期的洞察:
    bash
    python3 ~/.claude/scripts/learning-db.py record TOPIC KEY "VALUE" --category design
    重点关注:架构决策、工作流改进、Agent性能、可复用模式。
  3. 报告完成情况:
    功能[NAME]发布成功。
    - 流程:设计→规划→实现→验证→发布:已完成
    - PR链接:[URL]
    - 复盘发现:已记录[N]条,[M]条已纳入上下文

References

参考文档

  • PR Pipeline
  • Git Commit Flow
  • Retro Loop
  • State Conventions
  • PR流水线
  • Git提交流
  • 复盘循环
  • 状态规范