From fota-code-bundles
Start a new isolated development task with branch + worktree(交互式版本)
How this skill is triggered — by the user, by Claude, or both
Slash command
/fota-code-bundles:start-taskThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
启动新的隔离开发任务,支持创建分支和可选的 worktree。通过交互式询问让用户自定义命名和工作方式。
启动新的隔离开发任务,支持创建分支和可选的 worktree。通过交互式询问让用户自定义命名和工作方式。
/start-task [文档路径或任务描述]# 指定文档
/start-task docs/05-plans/sprint-4-load-control.md
# 直接描述
/start-task 实现 Sentinel 限流集成
# 空输入(从上下文推断)
/start-task
根据 $ARGUMENTS 的内容判断输入类型:
if $ARGUMENTS 是文件路径(以 docs/ 开头或 .md 结尾):
→ 从文档读取任务信息
→ 文档路径: $ARGUMENTS
→ 任务名称: 从文档标题或文件名提取
→ 任务类型: 从文件路径推断(如 plans/ → feature)
elif $ARGUMENTS 是非空文本:
→ 直接作为任务描述
→ 任务名称: 提取关键信息生成 kebab-case
→ 任务类型: 根据关键词推断
else (空):
→ 从当前对话上下文推断
→ 查找最近讨论的 sprint 文档或任务
→ 如果无法推断,询问用户
任务类型推断规则:
fix/修复/bug → fixrefactor/重构 → refactortest/测试 → testdocs/文档 → docschore/杂项/清理 → chorefeature建议的分支名格式:<type>/<name>(如 feature/sentinel-integration)
使用 AskUserQuestion 询问用户分支命名:
问题: 是否采用建议的分支名?
选项:
采用建议 → 使用 <type>/<name> 格式自定义名称 → 用户输入自定义分支名如果选择自定义,获取用户输入的分支名。
验证分支名:
- 结尾/ 和 -)使用 AskUserQuestion 询问:
问题: 是否为分支创建独立的 worktree?
选项:
创建 worktree → 在 ../worktrees/ 下创建独立工作目录不创建 → 仅创建分支,不创建 worktreeWorktree 命名格式:../worktrees/<type>-<name>(如 ../worktrees/feature-sentinel-integration)
检查并创建分支:
# 检查分支是否存在
if ! git show-ref --verify --quiet "refs/heads/$BRANCH"; then
git branch "$BRANCH"
fi
检查并创建 worktree:
# 检查 worktree 是否存在
if ! git worktree list | grep -q "$WORKTREE_PATH"; then
git worktree add "$WORKTREE_PATH" "$BRANCH"
fi
检查并创建分支:
# 检查分支是否存在
if ! git show-ref --verify --quiet "refs/heads/$BRANCH"; then
git branch "$BRANCH"
fi
询问是否切换分支:
使用 AskUserQuestion 询问:
问题: 是否切换到新创建的分支?
选项:
切换 → 执行 git checkout "$BRANCH"保留当前 → 保持在当前分支重要:如果当前 worktree 有未提交的更改,切换前必须警告用户并中止。
根据用户选择输出相应的概览:
创建了 Worktree:
✅ 任务已准备就绪
📋 任务信息
类型: <type>
名称: <name>
描述: <description>
🌿 Git 信息
分支: <branch>
Worktree: <worktree-path>
📂 切换到任务目录
cd <worktree-path>
📄 任务文档(如适用)
<doc-path>
未创建 Worktree(已切换分支):
✅ 任务已准备就绪
📋 任务信息
类型: <type>
名称: <name>
描述: <description>
🌿 Git 信息
分支: <branch>
当前位置: <current-worktree>
📄 任务文档(如适用)
<doc-path>
未创建 Worktree(保留当前分支):
✅ 任务已准备就绪
📋 任务信息
类型: <type>
名称: <name>
描述: <description>
🌿 Git 信息
分支: <branch>
当前分支: <current-branch>
💡 切换到新分支
git checkout <branch>
📄 任务文档(如适用)
<doc-path>
/start-task docs/05-plans/sprint-4-load-control.md
询问流程:
feature/sprint-4-load-control输出:
✅ 任务已准备就绪
📋 任务信息
类型: feature
名称: sprint-4-load-control
描述: 动态周期调整与系统可观测性
🌿 Git 信息
分支: feature/sprint-4-load-control
Worktree: ../worktrees/feature-sprint-4-load-control
📂 切换到任务目录
cd ../worktrees/feature-sprint-4-load-control
📄 任务文档
docs/05-plans/sprint-4-load-control.md
/start-task 修复登录超时问题
询问流程:
fix/login-timeout输出:
✅ 任务已准备就绪
📋 任务信息
类型: fix
名称: login-timeout
描述: 修复登录超时问题
🌿 Git 信息
分支: fix/login-timeout
当前位置: /workspace/code/wewins/wewins-fota-new
/start-task 添加用户头像功能
询问流程:
feature/avatar-upload-v2输出:
✅ 任务已准备就绪
📋 任务信息
类型: feature
名称: avatar-upload-v2
描述: 添加用户头像功能
🌿 Git 信息
分支: feature/avatar-upload-v2
Worktree: ../worktrees/feature-avatar-upload-v2
npx claudepluginhub leiax00/wewins-fota-new --plugin fota-code-bundlesCreates synced feature branches for new tasks: pulls latest main, fetches context from Jira tickets/GitHub issues/local specs, pushes {type}/{task-number}/{slug} branches.
Starts a new feature workflow by creating a git worktree, upgrading dependencies, opening a draft PR, and initializing state. Requires a pre-decomposed GitHub issue number as argument.
Creates traceable Git branches for current tasks using ticket IDs or short summaries (e.g., <ticket-id>-<short-kebab-summary>). Inspects git status, safely switches/creates, reports uncommitted work.