finish-feature

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pre-operation Checks

操作前检查

Verify working tree is clean and current branch matches
feature/*
per
${CLAUDE_PLUGIN_ROOT}/references/invariants.md
.
根据
${CLAUDE_PLUGIN_ROOT}/references/invariants.md
,确认工作区是干净的,且当前分支符合
feature/*
格式。

Phase 1: Identify Feature

阶段1:识别功能

Goal: Determine feature name from current branch or argument.
Actions:
  1. If
    $ARGUMENTS
    provided, use it as feature name
  2. Otherwise, extract from current branch:
    git branch --show-current
    (strip
    feature/
    prefix)
目标:从当前分支或参数中确定功能名称。
操作:
  1. 如果提供了
    $ARGUMENTS
    ,将其用作功能名称
  2. 否则,从当前分支提取:
    git branch --show-current
    (去除
    feature/
    前缀)

Phase 2: Pre-finish Checks

阶段2:完成前检查

Goal: Run tests before finishing.
Actions:
  1. Identify test commands (check package.json, Makefile, etc.)
  2. Run tests if available; exit if tests fail
目标:在完成前运行测试。
操作:
  1. 识别测试命令(检查package.json、Makefile等)
  2. 如果有可用测试则运行;若测试失败则退出

Phase 3: Update Changelog

阶段3:更新变更日志

Goal: Document changes in CHANGELOG.md.
Actions:
  1. Ensure changes are in
    [Unreleased]
    section per
    ${CLAUDE_PLUGIN_ROOT}/examples/changelog.md
  2. Commit CHANGELOG updates with
    Co-Authored-By
    footer
目标:在CHANGELOG.md中记录变更。
操作:
  1. 确保变更记录在
    [Unreleased]
    部分,遵循
    ${CLAUDE_PLUGIN_ROOT}/examples/changelog.md
    的规范
  2. 提交CHANGELOG的更新,添加
    Co-Authored-By
    页脚

Phase 4: Finish Feature

阶段4:完成功能

Goal: Complete feature using git-flow-next CLI.
Actions:
  1. Run
    git flow feature finish $FEATURE_NAME
  2. Verify current branch:
    git branch --show-current
    (should be on develop)
  3. Push develop:
    git push origin develop
目标:使用git-flow-next CLI完成功能开发。
操作:
  1. 运行
    git flow feature finish $FEATURE_NAME
  2. 确认当前分支:
    git branch --show-current
    (应处于develop分支)
  3. 推送develop分支:
    git push origin develop