agentleFS
boyingliu01boyingliu01/xp-gate/skills/sprint-flow/SKILL.md

sprint-flow

Skill4 starsChanged 6 months agoMITView on GitHub

Orchestrates a 6-phase end-to-end feature development pipeline (PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE). Integrates grill-with-docs, batch-grill-me, delphi-review (R1 requirements + R2 design), TDD, ralph-loop, code-walkthrough, and native ship/land steps. Pauses at key gates for user decisions. Acknowledges emergent requirements with mandatory manual UAT in CLOSE phase.

  • Deletes or force-pushes
  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Every phase MUST output its header as the first line of that phase's output.

    line 183
  2. Distinctive:

    NEVER omit "Phase" keyword (not "## 1/6" or "PREP" alone)

    line 196
  3. Distinctive:

    NEVER merge phase output — each phase gets its own header

    line 197

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sprint Flow — 6-Phase Development Pipeline

Triggers

Trigger TypePhrases
中文"开发新功能", "一键开发", "/sprint-flow", "开发用户登录", "创建 XXX 模块"
English"/sprint-flow", "start sprint", "implement feature", "one-shot development", "build a feature"

Usage: /sprint-flow "[feature description]"

Examples:

  • /sprint-flow "开发访谈机器人,支持多轮对话"
  • /sprint-flow "实现用户认证模块,支持 OAuth2"
  • /sprint-flow "开发 REST API 端点"

Optional Parameters:

  • --no-isolate: Skip auto worktree isolation (⚠️ risk of polluting protected branches)
  • --branch-name <name>: Custom branch name (default: sprint/YYYY-MM-DD-NN)
  • --force: Force continue on current branch even if protected (⚠️ requires explicit confirmation)
  • --stop-at <phase>: Stop after specified phase (prep/design/build/verify/ship/close)
  • --resume-from <phase>: Resume from specified phase
  • --phase <phase>: Execute only single phase (prep-only/design-only/build-only/verify-only/ship-only/close-only)
  • --lang <language>: Specify project language (springboot/django/golang)
  • --type <project_type>: Specify project type (web-nextjs/web-react/web-vue/backend-go/backend-django/backend-springboot)
  • --spec <file>: Use existing specification.yaml file
  • --with-performance: Enable load/stress testing (backend projects)
  • --mode <build_mode>: Phase 3 BUILD build mode. Default = ralph-loop. parallel = legacy all-at-once mode
  • --status: View Sprint progress dashboard (read-only, no execution)

Security Notes

  • Sprint flow does NOT execute destructive commands (no rm -rf, git push --force, DROP TABLE, etc.)
  • git worktree remove only deletes temporary worktree directories created by the sprint, never affects the main repo
  • Phase 5 SHIP only creates PRs (gh pr create), never auto-merges without explicit user confirmation
  • Sprint flow does not download, install, or execute external binaries

Permissions

  • git: read/write (worktree, branch, commit)
  • gh (GitHub CLI): read/write (PR create, merge, CI query)
  • filesystem: read/write (project dir + .worktrees/ only)
  • network: read-only (CI status, canary health)

6-Phase Pipeline

PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
PhaseNameKey ActionsOutput
1/6PREPDetect protected branch → Create git worktree → AUTO-ESTIMATE sizing → Classify (lightweight/standard/complex)Worktree path + impact assessment
2/6DESIGNCONTEXT.md 预检 (#322) → grill-with-docs → R1 需求评审 → 设计文档+APPROVAL (HARD-GATE) → batch-grill-me → R2 delphi-review (3 distinct models, ≥90% consensus, max 5 rounds) → to-issues → specification.yamlspecification.yaml + slices-manifest.json + requirements-reviewed.json
3/6BUILDBUILD-ENTRY-CONTRACT → GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → blind-review (read-only subagent) → verificationMVP code
4/6VERIFYdelphi-review --mode code-walkthrough → test-specification-alignment (#367 HARD-GATE) → xp-gate check --all → browser (Layer 4) → learnings + xp-gate retroReview report + feedback-log.md + test-alignment-report.json
5/6SHIPVERSION-GATE → 分支完成决策 (4选项) → native ship (create PR) → native land (merge + CI + canary)PR URL + deploy status + merge confirmation
6/6CLOSESHIP→CLOSE GATE (merge verified) → Backup sprint-state → #369 返工指标 → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branchEmergent issues list + cleanup report + metrics

Hard Gates:

  • DESIGN → BUILD: R1 and R2 invoke all three expert roles independently, verify successful results with three distinct requested models, then aggregate APPROVED consensus ≥90% within 5 rounds, plus GITHOOKS-GATE + DELPHI-GATE + BUILD-ENTRY-CONTRACT (manifest schema + slice↔REQ)
  • VERIFY → SHIP: feedback-log.md must exist + test-alignment-report.json PASS (#367 程序化 HARD-GATE)
  • SHIP → CLOSE: PR must be merged to main + release completed (HARD-GATE)

⚠️ Required Output Format (MANDATORY for L3 Step Adherence)

Every phase MUST output its header as the first line of that phase's output. Format MUST be exact:

## Phase 1/6: PREP (准备工作)
## Phase 2/6: DESIGN (设计)
## Phase 3/6: BUILD (构建)
## Phase 4/6: VERIFY (验证)
## Phase 5/6: SHIP (发布)
## Phase 6/6: CLOSE (收尾)

Rules:

  1. First line of every phase output MUST be ## Phase X/6: NAME (中文名)
  2. NEVER omit "Phase" keyword (not "## 1/6" or "PREP" alone)
  3. NEVER merge phase output — each phase gets its own header
  4. On /sprint-flow trigger, first line MUST output: Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
  5. Each phase completion MUST write Phase Summary to .sprint-state/phase-outputs/phase-{N}-summary.md

Phase Transition — TodoWrite Embedded (MANDATORY, resolves #366)

  1. Sprint initialization: Phase 1 PREP MUST begin with npx xp-gate sprint-init "<task_description>" — this is the single entry point for sprint creation. NEVER manually write sprint-state.json.
  2. Phase transitions are embedded in TodoWrite items, not as separate post-actions. Each phase's TodoWrite item MUST include the phase-transition call as part of the same atomic step:

    TodoWrite item format:
    - "Phase N: <main task> + phase-transition N completed → N+1 in_progress --render"

    Example TodoWrite items for a sprint:

    - Phase 1: PREP — estimate + sprint-init + phase-transition 1 completed --render
    - Phase 2: DESIGN — delphi review + phase-transition 2 completed --render
    - Phase 3: BUILD — implementation + phase-transition 3 completed --render

    Rationale: TodoWrite items are the LLM's most consistently executed operations. Embedding phase-transition elevates it from "post-action meta-info" (priority 4, ignored) to "main task step" (priority 2, executed).

  3. NEVER manually write to sprint-state.json or manually render the dashboard. ALWAYS use:

    npx xp-gate phase-transition <phase> <status> --render [--outputs '<json>']
    • <phase>: 1-6
    • <status>: in_progress | completed | skipped | failed | paused
    • --render: Auto-renders ASCII progress dashboard after state update
    • --outputs '<json>': Optional JSON of phase outputs to record

    This is a HARD GATE — the CLI is the single source of truth for state transitions and dashboard rendering.

Phase Output Status Schema (MANDATORY per phase)

Each phase MUST close with structured status:

status: completed | blocked | user_decision_required
outputs: [list of files produced]
decisions: [list of decisions made]
next_phase_context: [key info for next phase]

Phase 1/6: PREP (准备工作)

触发条件:用户输入匹配 Triggers 表中任一短语,或显式调用 /sprint-flow。

输入:

输入来源必需
功能描述用户命令参数是
当前分支git branch --show-current自动检测
项目语言--lang 参数或自动检测否

步骤:

  1. 输出首行:Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
  2. 检测当前分支是否为保护分支(main/master/develop)
  3. 创建 git worktree 隔离(除非 --no-isolate):
    git worktree add .worktrees/sprint-$(date +%Y%m%d-%H%M%S) -b sprint/YYYY-MM-DD-NN
  4. AUTO-ESTIMATE 规模评估(分析功能描述复杂度)
  5. 分类:lightweight / standard / complex
  6. 执行 npx xp-gate sprint-init "<task_description>" 初始化状态
  7. 执行 npx xp-gate phase-transition 1 completed --render

输出:

输出物路径格式
Worktree 路径.worktrees/sprint-*目录
Sprint 状态.sprint-state/sprint-state.jsonJSON
Phase Summary.sprint-state/phase-outputs/phase-1-summary.mdMarkdown

详细参考:@references/phase-1-prep.md


门禁条件表 (Gate Conditions)

门禁位置条件失败处理
BUILD-ENTRY-CONTRACTPhase 2→3slices-manifest.json schema 合法 + slice↔REQ 一致BLOCK,返回 Phase 2 修复
GITHOOKS-GATEPhase 2→3hooks 已安装且可执行自动修复 (xp-gate doctor --fix),失败则 BLOCK
DELPHI-GATEPhase 2→3R2 delphi-review APPROVED (≥90%)重新设计或用户覆盖(记录原因)
VERSION-GATEPhase 4→5VERSION 文件与 package.json 一致执行 node scripts/sync-version.cjs
#367 EVIDENCE-GATEPhase 4→5test-alignment-report.json PASS + head_commit + spec_hashBLOCK(--skip-evidence 需 --reason,≤2 次/sprint)
SHIP→CLOSE GATEPhase 5→6PR 已合并 + release 完成BLOCK,等待合并确认
feedback-log GATEPhase 4→5feedback-log.md 存在BLOCK,必须完成 VERIFY

Phase 2–6 详细指令

Phase 2–6 的完整步骤、输入/输出契约、模板和 Skill 集成详情见 references/ 目录。本节提供路由摘要。

Phase参考文件核心 Skill 链
2/6 DESIGN@references/phase-2-design.mdCONTEXT.md 预检 → grill-with-docs → R1 需求评审 → 设计文档+APPROVAL → batch-grill-me → R2 delphi-review → to-issues
3/6 BUILD@references/phase-3-build.mdBUILD-ENTRY-CONTRACT → GITHOOKS-GATE → DELPHI-GATE → ralph-loop (TDD) → blind-review (read-only subagent)
4/6 VERIFY@references/phase-4-verify.mddelphi code-walkthrough → test-spec-alignment (#367) → xp-gate check --all → browser (Layer 4) → learnings + retro
5/6 SHIP@references/phase-5-ship.mdVERSION-GATE → 分支完成决策 (4选项) → native ship (PR) → native land (merge+CI+canary)
6/6 CLOSE@references/phase-6-close.mdSHIP→CLOSE GATE → backup → #369 返工指标 → USER ACCEPTANCE → emergent → cleanup

路径约定:@references/ 和 @templates/ 相对于 skill 目录(skills/sprint-flow/)解析。

完整参考文件索引:

文件内容
@references/phase-overview.md全阶段详情、Skill 集成、参数、输出契约
@references/orchestration-rules.mdAgent 调度、上下文继承、转换门禁
@references/force-levels.md阶段强制执行规则
@templates/Pain doc、emergent issues、sprint summary、progress 模板

Anti-Patterns

❌ Error✅ Correct
Route Q&A, explanation, or code-search requests to sprint-flowOnly trigger for explicit feature development/implementation requests
Skip Phase 1/6 PREP isolation, edit directly on main/master/developDefault: create worktree; only bypass with --no-isolate or --force + user confirmation
Skip AUTO-ESTIMATE and apply full heavy pipeline blindlyEvaluate lightweight/standard/complex first, follow recommended or user-confirmed flow
Skip Delphi review in DESIGN, go straight to BUILDAll requirement levels (lightweight/standard/complex) must pass R1 需求评审 + R2 delphi-review; APPROVED before coding
Skip TDD, implement code directlyPhase 3/6 BUILD must follow RED → GREEN → REFACTOR; tests and implementation delivered together
Skip user acceptance, go straight to ShipPhase 6/6 CLOSE USER ACCEPTANCE must be manual; never automate, skip, or fake
Enter CLOSE without SHIP completing merge to mainPhase 5/6 SHIP must complete merge to main + release before entering Phase 6/6 CLOSE; otherwise worktree cleanup leaves residue + UAT reviews unmerged code
Clean up CLOSE without backing up sprint-state first.sprint-state/ is inside worktree; it's lost on worktree removal. CLOSE step 1 MUST back up to repo-tracked path first
Keep adding random changes after verification failuresMax 3 fix cycles; if still failing, BLOCK and request user decision
Enter next phase without generating Phase SummaryEvery phase MUST write .sprint-state/phase-outputs/phase-{N}-summary.md and pass transition gate
Complete implementation change without running verificationAfter every file edit/refactor/feature, MUST run npm test + npm run lint + npx tsc --noEmit and record the structured verification event (see phase-3-build.md §In-Session Verification)

状态机 (State Machine)

stateDiagram-v2
    [*] --> PREP : trigger matched
    PREP --> DESIGN : worktree ready
    DESIGN --> BUILD : APPROVED ≥90%
    DESIGN --> DESIGN : REQUEST_CHANGES (max 5 Delphi rounds)
    BUILD --> VERIFY : tests pass
    BUILD --> BUILD : fix cycle (max 3)
    VERIFY --> SHIP : feedback-log exists
    VERIFY --> BUILD : critical issues found
    SHIP --> CLOSE : PR merged
    SHIP --> SHIP : CI failed (retry)
    CLOSE --> [*] : UAT confirmed
    BUILD --> BLOCKED : 3 fix cycles exhausted
    DESIGN --> BLOCKED : 5 Delphi rounds exhausted
    BLOCKED --> [*] : user decision

决策记录模板 (Decision Record)

每个用户决策点必须记录到 .sprint-state/decisions.md:

## Decision DR-{NNN}
- **Phase**: {phase_number}/6 {PHASE_NAME}
- **Question**: {what was asked}
- **Options**: {options presented}
- **Choice**: {user's selection}
- **Rationale**: {why this choice}
- **Timestamp**: {ISO 8601}

强制决策点:

决策点阶段触发条件
规模确认PREPAUTO-ESTIMATE 结果与用户预期不符
设计审批DESIGNdelphi-review 返回 REQUEST_CHANGES
修复策略BUILD修复循环达到 3 次上限
发布确认SHIPPR 创建后等待用户确认合并
UAT 结果CLOSE用户手动验收(必须手动,禁止自动化)

失败处理 (Failure Handling)

失败场景处理策略升级条件
Worktree 创建失败重试 1 次,失败则提示用户手动处理磁盘空间不足或权限问题
delphi-review 连续 REQUEST_CHANGES最多 3 轮重设计,超过则 BLOCK3 轮后仍未 APPROVED
BUILD 修复循环超限最多 3 次 fix cycle,超过则 BLOCK + 用户决策测试持续失败
CI 失败分析失败原因,尝试 1 次自动修复非 flaky 失败
PR 合并冲突提示用户手动解决始终(禁止自动 force)
工具缺失SKIP(不 BLOCK),记录到 phase summary始终不阻断

BLOCK 状态处理:

  1. 写入 .sprint-state/sprint-state.json 状态为 blocked
  2. 输出阻塞原因 + 已完成工作 + 建议操作
  3. 等待用户决策(继续/放弃/降级)
  4. 记录决策到 decisions.md

使用示例

场景命令说明
完整流水线/sprint-flow "开发访谈机器人"自动执行 6 阶段 → specification.yaml + PR URL
设计后停止/sprint-flow "开发认证模块" --stop-at design输出 specification.yaml 后停止,供评审
仅构建阶段/sprint-flow "开发 API" --lang django --phase build-only跳过准备/设计,直接 Build

底层 Skills 保持独立

所有被调用的 Skills 独立可用:delphi-review (单独评审), test-driven-development (TDD), grill-with-docs (需求访谈), batch-grill-me (批量决策), to-issues (切片拆分),sprint-flow 仅自动串联

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.