Tapd Story Pipeline logo

Tapd Story Pipeline

Organization
TencentBlueKing
tapd-story-pipeline

单需求实现流水线——把一个 TAPD 需求从零推进到代码提交。自动串联技术澄清、 开发计划、任务拆分、TDD 实现、架构/安全校验、代码提交六个阶段。 Use this skill whenever the user mentions 需求实现, 实现需求 #ID, 开发需求, TDD 开发单个需求, story pipeline, single story, 独立需求, 紧急需求, bug 修复, hotfix, or any single-story development workflow — even if the user just says "帮我实现这个需求" or "开发 #12345".

Overview

PublisherTencentBlueKing
Repositorybk-bcs
Skill nametapd-story-pipeline
Stars
840
Forks
263
Bundled files
15
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by TencentBlueKing on GitHub. Read the source before you install it.

Installation

Install the Tapd Story Pipeline AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/TencentBlueKing/bk-bcs/tree/master/.agents/skills/tapd-story-pipeline
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TencentBlueKing/bk-bcs.git /tmp/bk-bcs
mkdir -p .claude/skills
cp -r /tmp/bk-bcs/.agents/skills/tapd-story-pipeline .claude/skills/tapd-story-pipeline
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tapd Story Pipeline in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Tapd Story Pipeline on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Tapd Story Pipeline is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

单需求实现流水线

1. 定位

本 skill 把一个 TAPD 需求从 initialized 状态推进到 committed。它既是迭代调度器 tapd-iteration-runner 的"被调用函数",也是用户在迭代之外处理紧急需求 / bug / 独立轻量需求时的直接入口。

pipeline 自治原则:

  • 不创建 / 切换 git 分支——始终在调用方所在的当前分支工作
  • 不读 iteration-state.json——无迭代概念
  • 唯一状态契约:${WORKDIR}/meta.yaml
  • 外部对状态文件的修改必须遵循 references/state-mutation-guide.md
  • pipeline 启动时严格校验外部修改合法性,违规直接写 meta.yaml.last_failure.type=mutation_invalid 退出

2. 入参(按优先级回退)

入参来源
${ID}1. 调用方传入;2. 用户消息;3. 交互询问
${WORKDIR}1. 调用方传入;2. 默认 specs/stories/${ID}/(独立模式)或 specs/${VERSION}/${ID}/(runner 调度)
${WORKSPACE_ID}1. 调用方传入(runner 内联执行时作为入参注入 / 用户独立模式可显式给出);2. meta.yaml.workspace_id;3. 用户消息;4. project.json.workspace_id;5. 交互询问
${REQ_FILE}1. 调用方注入到 ${WORKDIR}/req.md;2. 不存在则通过 TAPD MCP stories_get 拉取并写入,参数 id=${ID}、workspace_id=${WORKSPACE_ID}
${AGENT_TOOL}1. 调用方传入;2. 默认 agent

pipeline 首次执行(meta.yaml 不存在)时,把 ${WORKSPACE_ID} / ${AGENT_TOOL} 落入 meta.yaml.workspace_id / meta.yaml.agent_tool,后续单次调起优先从 meta.yaml 读取,无需调用方每次重复注入。

3. 工作目录结构

${WORKDIR}/
├── req.md                  # 原始需求 + 技术澄清章节
├── context.md              # 当前 phase 的上下文白名单
├── meta.yaml               # 需求级状态机 + 元数据(唯一契约)
├── questions.md            # 澄清问题与答复(四态状态机)
├── spec.md / plan.md / research.md / data-model.md
├── plan-report.md
├── tasks.md
├── tasks-report.md
├── validate-arch-report.md / validate-security-report.md / validate-codereview-report.md
├── validate-test-report.md
├── commit.md               # commit 阶段产出
├── process.log             # 流式日志(串行阶段)
├── process-validate-arch.log        # validate 并行日志
├── process-validate-security.log
├── process-validate-codereview.log
├── process-validate-test.log          # validate-test 审查日志
├── process-validate-fix.log
└── iteration-patches/
    └── attempt-${N}.md     # 失败修补方案(外部写入,pipeline 读)

4. meta.yaml 字段定义

需求级状态文件,保存在 ${WORKDIR}/meta.yaml。

完整字段定义见 references/context-and-meta-template.md §2。

决策常用字段速查:

你需要…读取字段
判断当前所处阶段phase
判断是否有失败last_failure(非空 = fail 卡点)
判断是否等待审查pending_review(非空 = confirm 卡点)
判断重试计数attempts / round
读取 TAPD 工作空间 IDworkspace_id
读取代码统计stats(commit 阶段写入)

字段语义、外部修改权限、卡点判定优先级详见 references/state-mutation-guide.md。

5. 单次执行流程

每次 pipeline 被调起,通过调用方传入的 action 语义指令决定行为。 pipeline 自行管理 meta.yaml 的所有状态变更——调用方不直接修改 meta.yaml。

1. 初始化:加载 meta.yaml(不存在 + action=execute → 按入参初始化为 phase=initialized),req.md就绪后,用TAPD MCP更新需求状态(v_status)为“doing”
2. 解析 action 指令,执行对应的状态变更:
   execute  → 首次初始化已在步骤 1 完成;非首次无变更
   approve  → phase=confirmed, pending_review=null
   reject   → 若 attempts < max_attempts:读 attempt-md 确定 target_phase, phase=target_phase,
               attempts+1, pending_review=null;否则写 attempts exhausted fail 并退出
   answer   → 校验 questions.md 无 [open], round+1
   retry    → 若 attempts < max_attempts:last_failure=null, attempts+1; 若有 attempt-md 则按 target
               回退 phase;否则写 attempts exhausted fail 并退出
   abort    → 写 last_failure.type=user_aborted, 退出
   对任一内部回退重入:先校验 attempts < max_attempts。
             若 attempts 已达到 max_attempts(当前为 3),不得再推进 attempts 或改变 phase,
             写 last_failure.type=semantic、message="attempts exhausted (3/3): {最近失败摘要}" 后退出。
3. 启动校验(见 references/state-mutation-guide.md §7):
   产物一致性 / questions.md 格式 / attempt-md 存在性
   不合法 → 写 last_failure.type=mutation_invalid 退出
4. 根据 phase 调用对应子 skill:
   initialized      → tapd-story-specify  → tech-clarified
   tech-clarified   → tapd-story-plan     → researched
   researched       → tapd-story-tasks    → tasks-generated
   tasks-generated  → 写 pending_review,退出(confirm 卡点)
   confirmed        → tapd-story-implement → implemented
   implemented      → tapd-story-validate  → validated
   validated        → tapd-story-commit    → committed
   committed        → 完工门禁:校验 ${WORKDIR}/commit.md 存在
                      (commit 子 skill 应已生成)。存在 → 退出(完工);
                      不存在 → 写 last_failure.type=semantic
                      (message="commit.md 缺失,终结产物不完整"),不得宣告完工
5. 子 skill 返回:
   5a. 记录成本度量(每次 subagent 回传后执行):
       1) 读取 ${WORK_DIR}/cost-events.jsonl 末尾
       2) 倒序查找匹配本次调用的事件:
          stage == 当前 stage AND attempt == 当前 attempt
          AND round == 当前 round AND ts_marker == 本次渲染 prompt 时使用的 TS
       3) 找到则 append 到 meta.yaml.stats.cost.per_call[](**必须记录 ts_event 字段**,
          作为后续对账去重主键),并累加到 total_input_tokens / total_output_tokens /
          total_cache_tokens / total_cached_write_tokens / total_cached_miss_tokens /
          total_credit / total_cost_usd(与 total_credit 同值)/
          total_duration_sec,subagent_calls +1
       4) 找不到(hook 未触发 / 写入未到达 / 时间戳不一致):
          **不视为终态**——记录一条 info 到 process.log(标注"待 commit 阶段对账补齐"),
          本次调用暂不累加。该遗漏事件将由 commit 阶段"成本最终对账门禁"(见
          tapd-story-commit/SKILL.md)以 ts_event 为键统一补齐,确保最终完整。
       此步骤纯记录,不影响 phase 推进。
   ok       → 推进 phase,回到步骤 4 继续推进
   blocked  → 写入 questions.md(追加 [open] 条目),退出
   fail     → 写入 last_failure(按错误类型分 system / semantic),退出
6. 退出前:刷新 history,落盘 meta.yaml

"推进到下一个卡点才退出" 的实现:步骤 5 ok 后回步骤 4 继续推进,而不是退出。 唯一例外是 tasks-generated → confirm 卡点——因 confirm 必须由外部决策。

6. confirm 卡点(内联逻辑,不是独立子 skill)

confirm是本主 SKILL 的内联逻辑:

进入条件:phase == tasks-generated 且 tapd-story-tasks 返回 ok。

行为:

  1. 把 spec.md、plan.md、tasks.md 路径写入 meta.yaml.pending_review.artifacts
  2. pending_review.ready_at 写入当前 ISO 8601 时间戳
  3. 退出 pipeline(不调用 implement)

推进条件(下次调起时):调用方发送语义指令 approve(通过)、reject(回退)或 abort(放弃)。 pipeline 收到指令后自行执行 meta.yaml 状态变更(见 §5 步骤 2)。

7. 子 skill 编排

顺序子 skill输入输出 phase卡点能力
1tapd-story-specifyreq.md + context.mdtech-clarified可 blocked
2tapd-story-planspec.md + context.mdresearched可 fail
3tapd-story-tasksplan.md + context.mdtasks-generated可 fail
—(内联)confirm 卡点spec / plan / tasksconfirmed(由外部)必然退出
4tapd-story-implementtasks.md + context.mdimplemented可 fail
5tapd-story-validate代码变更 + context.mdvalidated可 fail
6tapd-story-commit所有产物committed可 fail;写 stats

每个子 skill 通过其 SKILL.md 定义详细行为。pipeline 主编排只负责 "读 meta → 选子 skill → 落地结果",不重新编排子 skill 内部细节。

Attempt 上限

meta.yaml.max_attempts 当前固定为 3,attempts 从 1 起计。所有回退重入、reject 和 retry 在递增 attempts 前必须检查上限;达到上限时以 fail 卡点退出,等待调用方人工处理或 abort。完整状态写入规则见 references/state-mutation-guide.md 的“Attempt 上限”。

8. 与外部的通信契约

8.1 退出报告格式(主会话最后一条消息)

pipeline 退出前输出简短摘要:

Pipeline 已退出
- 需求 ID: ${ID}
- 工作目录: ${WORKDIR}
- 当前 phase: <phase>
- 卡点类型: <committed | confirm | blocked | fail | abort>
- 下一步指令: <approve | reject | answer | retry | abort>
- 说明: <简要描述卡点原因>

不要输出 process.log 内容,不要询问后续操作——退出后由调用方决策。

8.2 调用方语义指令

调用方通过语义指令与 pipeline 交互,不直接修改 meta.yaml。 完整指令集及触发条件见 references/state-mutation-guide.md §2。 调用方可修改的内容文件见 references/state-mutation-guide.md §5。

8.3 契约版本

本契约基于 tapd-story-pipeline v1.1.0 语义指令模式。如 pipeline 新增指令或修改卡点类型,需同步更新 references/state-mutation-guide.md 和 runner 调度逻辑。

9. Subagent 调度与日志

pipeline 内部各"重 token"子 skill 通过 Task(subagent_name=<AGENT>, ...) 拉 subagent, 按阶段分配专业 agent(详见 references/subagent-prompt-template.md 映射表):

阶段组执行 agent
specify / plan / tasks / validate-archtech-lead
implement(backend)/ validate-fix(后端问题)backend-developer
implement(frontend)/ validate-fix(前端问题)frontend-developer
validate-security / validate-codereviewcode-reviewer
validate-testqa-engineer

speckit-executor-agent 不再承接设计/实现/评审类阶段,仅在需要时用于工具性任务。 阶段事件日志(banner / 错误 / 产物路径)追加到 ${WORKDIR}/process.log。 成本数据由宿主 IDE PostToolUse hook 自动采集到 ${WORKDIR}/cost-events.jsonl, pipeline 步骤 5a 即时 best-effort 倒序匹配后写入 meta.yaml.stats.cost(详见 §5 步骤 5a)。 因 hook 为异步写入,5a 可能 miss;commit 阶段设有"成本最终对账门禁" (见 tapd-story-commit/SKILL.md),以 ts_event 为去重主键全量补齐遗漏事件, 保证 meta.yaml.stats.cost 最终与 cost-events.jsonl 完整对齐。

详细 prompt 模板见 references/subagent-prompt-template.md。 代问 / 回退重入协议见 references/reentry-protocol.md。 错误分类与 last_failure 字段格式见 references/error-handling.md。

tapd-story-commit 是唯一在主会话中直接执行的子 skill,不拉 subagent。

10. 平台约定

OSShell备注
Linux / macOSBash默认
WindowsPowerShell首次运行设置 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8

11. 参考文件

文件用途
references/state-mutation-guide.md必读:语义指令集 + 状态管理规则 + 内容文件权限
references/context-and-meta-template.mdmeta.yaml / context.md 模板与字段说明
references/subagent-prompt-template.md子 skill 内调用 speckit 的 SUBAGENT_PROMPT 骨架
references/reentry-protocol.md代问重入 / 回退重入协议
references/shared-reentry-conventions.md子 skill 通用可重入约定
references/questions-md-template.mdquestions.md 四态状态机
references/error-handling.md需求层错误处理规则
references/commit-conventions.mdcommit 阶段规范
tapd-story-specify/references/technical-clarification-guide.md技术澄清维度与最佳实践
tapd-story-specify/references/technical-clarification-template.md技术澄清文档模板

12. Example: 单需求 Happy Path

用户输入:"帮我实现需求 #1234567890,workspace 20000001"

第 1 次调起(initialized → tasks-generated):

  • 加载 meta.yaml(不存在 → 初始化 phase=initialized)
  • specify:技术澄清 + subagent 生成 spec.md → phase=tech-clarified
  • plan:subagent 生成 plan.md + plan-report.md(verdict=pass)→ phase=researched
  • tasks:subagent 生成 tasks.md + tasks-report.md(verdict=pass)→ phase=tasks-generated
  • 写入 pending_review → 退出(confirm 卡点)

外部操作:

  • 用户审查 spec.md / plan.md / tasks.md → 通过
  • 设置 phase=confirmed, pending_review=null

第 2 次调起(confirmed → committed):

  • implement:subagent TDD 实现 + 测试全绿 → phase=implemented
  • validate:四段并行校验全 LGTM → phase=validated
  • commit:统计变更 + 构建 commit message + git add/commit + TAPD 状态更新 → phase=committed
  • 退出(完工)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Tapd Story Pipeline AI skill do?

单需求实现流水线——把一个 TAPD 需求从零推进到代码提交。自动串联技术澄清、 开发计划、任务拆分、TDD 实现、架构/安全校验、代码提交六个阶段。 Use this skill whenever the user mentions 需求实现, 实现需求 #ID, 开发需求, TDD 开发单个需求, story pipeline, single story, 独立需求, 紧急需求, bug 修复, hotfix, or any single-story development workflow — even if the user just says "帮我实现这个需求" or "开发 #12345".

Why use Tapd Story Pipeline on TypingMind?

Because you install it once and use it with any model. Tapd Story Pipeline is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Tapd Story Pipeline in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/TencentBlueKing/bk-bcs/tree/master/.agents/skills/tapd-story-pipeline. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Tapd Story Pipeline?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Tapd Story Pipeline?

As many as you like. As long as a model supports skills, you can use Tapd Story Pipeline with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Tapd Story Pipeline AI skill free?

It is published on GitHub by TencentBlueKing. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇