start-task
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Transition from idle to actively working on a Linear issue. Validate that the issue is ready
to start, create a branch, load all relevant context, and produce a brief plan. End with the
user confirming the approach before any code is written.
</objective>
<context>
Input: $ARGUMENTS — optional issue ID. If not provided, auto-select highest priority.
Requires: git repo (clean working tree), `linear` CLI authenticated
Optional: .planning/ directory, CLAUDE.md
</context>
<process>
<objective>
从空闲状态切换到主动处理Linear issue的工作状态。校验issue已具备启动条件,创建分支,加载所有相关上下文,并生成一份简短的执行计划。最终在编写任何代码前由用户确认方案。
</objective>
<context>
输入:$ARGUMENTS — 可选的issue ID。如果未提供,自动选择优先级最高的issue。
依赖:git仓库(工作区干净)、已完成身份认证的`linear` CLI
可选:.planning/ 目录、CLAUDE.md
</context>
<process>
0. Validate Environment
0. 环境校验
Check preconditions:
- Inside a git repo
- Working tree is clean (should be empty)
git status --porcelain- IF dirty: show the status and ask "Commit, stash, or abort?"
- CLI available
linear - On main/default branch (warn if starting from a feature branch)
Read project scope (silent):
- IF exists →
.linear-project, storePROJECT=$(cat .linear-project)PROJECT_FLAG - IF missing → continue unscoped (don't interrupt task flow with setup prompts)
检查前置条件:
- 位于git仓库内
- 工作区干净(返回结果为空)
git status --porcelain- 如果工作区有变更:展示状态并询问"提交、暂存还是终止操作?"
- CLI可用
linear - 位于主/默认分支(如果从功能分支启动则给出警告)
静默读取项目范围:
- 如果存在文件 →
.linear-project,存储PROJECT=$(cat .linear-project)PROJECT_FLAG - 如果不存在 → 继续无范围执行(不要弹出设置提示打断任务流程)
1. Select Issue
1. 选择Issue
If issue ID provided as argument:
- Fetch issue details with
linear issue view $ISSUE_ID - Verify it's assigned to me and not already Done
- If it's already In Progress, ask: "This is already started. Resume it or pick a different one?"
If no argument:
- — fetch backlog
linear issue list -s unstarted --limit 10 $PROJECT_FLAG - IF zero unstarted issues:
- Check for in-progress issues (): "No unstarted issues. You have N in-progress. Resume one?"
linear issue list -s started --limit 10 $PROJECT_FLAG - If also zero and scoped: "Backlog is empty for {project-name}. Create a new issue in Linear or check another project."
- If also zero and unscoped: "Backlog is empty. Create a new issue in Linear or check another team."
- Stop here.
- Check for in-progress issues (
- Sort by priority (Urgent > High > Medium > Low > None)
- IF single top-priority issue → auto-select it
- IF multiple issues share the same top priority → ask user to pick: "Multiple issues at the same priority. Which one?" Show issue IDs, titles, and due dates if available.
如果参数中提供了issue ID:
- 执行拉取issue详情
linear issue view $ISSUE_ID - 校验该issue已分配给我且状态未设为已完成
- 如果状态已经是进行中:询问"该issue已在处理中,要继续处理还是选择其他issue?"
如果未提供参数:
- 执行拉取待办事项
linear issue list -s unstarted --limit 10 $PROJECT_FLAG - 如果未启动的issue数量为0:
- 检查进行中的issue():"没有待启动的issue,你有N个进行中的issue,要继续处理其中一个吗?"
linear issue list -s started --limit 10 $PROJECT_FLAG - 如果进行中的issue也为0且已设置项目范围:"{project-name}的待办事项为空,请在Linear中创建新issue或者切换到其他项目。"
- 如果进行中的issue也为0且未设置项目范围:"待办事项为空,请在Linear中创建新issue或者切换到其他团队。"
- 流程终止。
- 检查进行中的issue(
- 按优先级排序(紧急 > 高 > 中 > 低 > 无)
- 如果只有一个最高优先级issue → 自动选择该issue
- 如果多个issue优先级同为最高 → 请用户选择: "多个issue优先级相同,请选择要处理的issue:" 展示issue ID、标题和截止日期(如有)。
2. Check Readiness
2. 就绪检查
Before starting, validate the issue is ready:
Check for blockers:
- — look for blocking relations
linear issue view $ISSUE_ID - IF blocked by another issue: "This is blocked by ENG-XXX (title). Want to start that one instead, or start this anyway?"
Check for missing context:
- Does the issue have a description? If empty or very short (< 50 chars): Ask: "This issue has no description. Can you give me a one-liner on what needs to happen?" Capture the answer and update the Linear issue description.
Check for GSD phase alignment:
- IF .planning/ROADMAP.md exists, check if this issue maps to a planned phase
- IF it does: note the phase number and load its CONTEXT.md or PLAN.md
- IF it doesn't: note it as ad-hoc work (still fine to proceed)
启动前,校验issue已准备就绪:
检查阻塞项:
- 执行— 查找阻塞关联关系
linear issue view $ISSUE_ID - 如果被其他issue阻塞:"该issue被ENG-XXX(标题)阻塞,你想先处理阻塞的issue,还是直接启动当前issue?"
检查缺失上下文:
- issue是否有描述?如果为空或者非常短(< 50字符): 询问:"该issue没有描述,你可以简单说明下需要完成什么内容吗?" 记录回答并更新Linear issue的描述。
检查GSD阶段对齐:
- 如果存在.planning/ROADMAP.md,检查该issue是否对应规划中的某个阶段
- 如果是:记录阶段编号并加载对应的CONTEXT.md或PLAN.md
- 如果不是:标记为临时工作(仍可正常推进)
3. Create Branch
3. 创建分支
- Extract a slug from the issue title (lowercase, hyphens, max 50 chars)
- Branch name format: (e.g.,
{team-prefix}-{number}-{slug})eng-123-add-auth-flow git checkout -b $BRANCH_NAME- Confirm: "Created branch: "
$BRANCH_NAME
- 从issue标题提取slug(小写、连字符连接,最长50字符)
- 分支名格式:(例如:
{团队前缀}-{编号}-{slug})eng-123-add-auth-flow - 执行
git checkout -b $BRANCH_NAME - 确认提示:"已创建分支:"
$BRANCH_NAME
4. Move to In Progress
4. 标记为进行中
linear issue update $ISSUE_ID -s "In Progress"- Confirm: "Linear issue moved to In Progress"
- 执行
linear issue update $ISSUE_ID -s "In Progress" - 确认提示:"Linear issue已更新为进行中状态"
5. Load Context & Plan
5. 加载上下文与制定计划
Gather all relevant context:
- Full issue description and comments from Linear
- Related GSD planning files (CONTEXT.md, RESEARCH.md, PLAN.md) if they exist
- CLAUDE.md for project conventions
- Quick scan of the codebase areas most likely affected (use issue description keywords)
Produce a brief implementation plan (3-7 bullet points):
Plan for ENG-123: Add user authentication flow
─────────────────────────────────────────────
1. Create auth middleware in src/middleware.ts
2. Add login page at app/(auth)/login/page.tsx
3. Implement session management with Convex Auth
4. Add protected route wrapper component
5. Write tests for auth flow收集所有相关上下文:
- Linear中的完整issue描述和评论
- 相关的GSD规划文件(CONTEXT.md、RESEARCH.md、PLAN.md,如有)
- 记录项目规范的CLAUDE.md
- 快速扫描最可能受影响的代码库区域(使用issue描述中的关键词)
生成一份简短的实现计划(3-7个要点):
Plan for ENG-123: Add user authentication flow
─────────────────────────────────────────────
1. Create auth middleware in src/middleware.ts
2. Add login page at app/(auth)/login/page.tsx
3. Implement session management with Convex Auth
4. Add protected route wrapper component
5. Write tests for auth flow6. Confirm Approach
6. 方案确认
Ask: "Ready to start with this plan, or want to adjust anything?"
- Proceed → begin implementation
- Adjust → ask what to change, update plan, re-confirm
- Wrong task → go back to step 1
<success_criteria>
- Issue selected with clear rationale
- All blockers and missing context surfaced before starting
- Clean branch created from main/default branch
- Linear issue moved to In Progress
- Implementation plan presented and confirmed by user
- User explicitly approved before any code changes </success_criteria>
询问:"准备好按这个计划启动了吗,还是需要调整内容?"
- 确认继续 → 开始实现
- 需要调整 → 询问修改内容,更新计划后重新确认
- 任务选错 → 返回步骤1
<success_criteria>
- 已按明确规则选择issue
- 启动前已暴露所有阻塞项和缺失的上下文
- 已从主/默认分支创建干净的分支
- Linear issue已更新为进行中状态
- 已展示实现计划并获得用户确认
- 代码修改前已获得用户明确批准 </success_criteria>