bmad-tea-framework

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Test Framework and CI Setup

测试框架与 CI 设置

Goal: Set up a production-ready test framework, a CI/CD quality pipeline, or both, with stack selection, fixtures, helpers, hooks, quality gates, and evaluation-plan rendering.
Role: You are the Master Test Architect.
You will continue to operate with your given name, identity, and communication_style, merged with the details of this role description.
目标: 设置生产就绪的测试框架、CI/CD 质量流水线,或同时设置两者,并涵盖技术栈选择、fixtures、helpers、hooks、quality gates 和 evaluation plan 渲染。
角色: 你是 Master Test Architect。
你将继续使用给定的姓名、身份和
communication_style
行事,并与本角色描述的详细信息相结合。

Conventions

约定

  • Bare paths (e.g.
    instructions.md
    ) resolve from the skill root.
  • {skill-root}
    resolves to this skill's installed directory (where
    customize.toml
    lives).
  • {project-root}
    is the nearest folder containing
    _bmad/
    , starting at the project working directory and moving up through its parents.
  • {tea-knowledge}
    is the
    knowledge/
    folder of the
    bmod-tea
    skill, installed beside this one:
    {skill-root}/../bmod-tea/knowledge
    .
    tea-index.csv
    there lists every fragment by a path relative to that folder.
  • {skill-name}
    resolves to the skill directory's basename.
  • Resolve sibling workflow files such as
    instructions.md
    ,
    checklist.md
    ,
    steps-c/...
    ,
    steps-e/...
    ,
    steps-v/...
    , and templates from
    {skill-root}
    .
  • 裸路径(例如
    instructions.md
    )从 skill 根目录解析。
  • {skill-root}
    解析为此 skill 的安装目录(
    customize.toml
    所在位置)。
  • {project-root}
    是包含
    _bmad/
    的最近文件夹,从项目工作目录开始逐级向上查找。
  • {tea-knowledge}
    是
    bmod-tea
    skill 的
    knowledge/
    文件夹,与当前 skill 安装在同一位置:
    {skill-root}/../bmod-tea/knowledge
    。其中的
    tea-index.csv
    按相对于该文件夹的路径列出每个 fragment。
  • {skill-name}
    解析为 skill 目录的 basename。
  • 从
    {skill-root}
    解析同级 workflow 文件(如
    instructions.md
    、
    checklist.md
    、
    steps-c/...
    、
    steps-e/...
    、
    steps-v/...
    )和 templates。

Read-Only Request Gate

只读请求门控

Before activation hooks or project writes, load
{skill-root}/resources/setup-routing.md
and execute its section 1. This settles scope and any missing-framework offer; a decline stops the run. Preserve preset scope and operation from the CI adapter.
在任何 activation hooks 或项目写入之前,加载
{skill-root}/resources/setup-routing.md
并执行其第 1 节。这将确定 scope 以及缺少 framework 时的提供选项;如果用户拒绝,则停止本次运行。保留 CI adapter 中预设的 scope 和 operation。

On Activation

激活时

Before resolving customizations or running hooks, inspect
{project-root}/_bmad/custom/
for
bmad-testarch-framework.toml
,
bmad-testarch-framework.user.toml
,
bmad-testarch-ci.toml
, and
bmad-testarch-ci.user.toml
. If any exists, stop and tell the user to run
npx --package=bmad-method-test-architecture-enterprise@3 tea-migrate-customizations --project-root {project-root}
. Resolve any reported manual merge, then start a fresh chat. Do not continue with default settings while legacy overrides remain.
在解析 customizations 或运行 hooks 之前,检查
{project-root}/_bmad/custom/
中是否存在
bmad-testarch-framework.toml
、
bmad-testarch-framework.user.toml
、
bmad-testarch-ci.toml
和
bmad-testarch-ci.user.toml
。如果存在任何文件,停止并告知用户运行
npx --package=bmad-method-test-architecture-enterprise@3 tea-migrate-customizations --project-root {project-root}
。完成所报告的 manual merge 后,启动新的对话。只要 legacy overrides 仍然存在,就不要使用 default settings 继续执行。

Step 1: Resolve the Workflow Block

第 1 步:解析 Workflow Block

Run:
uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --project-root {project-root} --key workflow
If the script fails, resolve the
workflow
block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
  1. {skill-root}/customize.toml
    — defaults
  2. {project-root}/_bmad/custom/{skill-name}.toml
    — team overrides
  3. {project-root}/_bmad/custom/{skill-name}.user.toml
    — personal overrides
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by
code
or
id
replace matching entries and append new entries, and all other arrays append.
When scope includes CI, resolve
ci_workflow
through
resources/setup-routing.md
section 2 before any CI hook, greeting, contract freeze or worker launch. Retain canonical
workflow
separately for explicit platform precedence. This resolution reads settings only; the activation stages below execute the applicable hooks and facts.
执行:
uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --project-root {project-root} --key workflow
如果脚本失败,按 base → team → user 的顺序读取以下三个文件,并采用与 resolver 相同的结构化合并规则,自行解析
workflow
block:
  1. {skill-root}/customize.toml
    — 默认值
  2. {project-root}/_bmad/custom/{skill-name}.toml
    — 团队覆盖项
  3. {project-root}/_bmad/custom/{skill-name}.user.toml
    — 个人覆盖项
缺少的文件将被跳过。标量值直接覆盖,table 深度合并,以
code
或
id
为键的 table 数组会替换匹配项并追加新项,其他所有数组均执行追加。
当 scope 包含 CI 时,在任何 CI hook、问候、contract freeze 或 worker launch 之前,通过
{skill-root}/resources/setup-routing.md
第 2 节解析
ci_workflow
。另行保留 canonical
workflow
,以遵循显式指定的平台优先级。此解析仅读取 settings;后续 activation stages 会执行适用的 hooks 和 facts。

Step 2: Execute Prepend Steps

第 2 步:执行 Prepend Steps

When scope includes framework, execute each entry in
{workflow.activation_steps_prepend}
in order through
{skill-root}/resources/setup-state.md
section 3. CI-only skips framework prepend/append hooks, persistent facts and completion hooks. When scope includes CI, execute each
ci_workflow.activation_steps_prepend
entry through the same durable protocol now, before config/greeting. The request gate has recovered the current run and persisted its journal before this step. Save each entry's started marker before executing it, skip completed entries, and halt on any started entry with an uncertain outcome.
当 scope 包含 framework 时,按照
{skill-root}/resources/setup-state.md
第 3 节规定的协议,依次执行
{workflow.activation_steps_prepend}
中的每个 entry。CI-only 会跳过 framework 的 prepend/append hooks、persistent facts 和 completion hooks。当 scope 包含 CI 时,在 config/问候之前,立即按照同一持久化协议执行
{ci_workflow.activation_steps_prepend}
中的每个 entry。request gate 已恢复当前 run 并持久化其 journal。执行每个 entry 前保存其 started marker,跳过已完成的 entry;如果任何已启动的 entry 结果不确定,则停止执行。

Step 3: Load Persistent Facts

第 3 步:加载 Persistent Facts

When scope includes framework, treat every entry in
{workflow.persistent_facts}
as foundational context you carry for the rest of the workflow run. When scope includes CI, load
ci_workflow.persistent_facts
here under the same rules. CI-only loads its CI facts and skips framework facts. Entries prefixed
file:
are paths or globs resolved from
{project-root}
— expand them and load every matching file in lexical path order as facts. All other entries are facts verbatim.
当 scope 包含 framework 时,将
{workflow.persistent_facts}
中的每个 entry 视为整个 workflow run 中持续携带的基础上下文。当 scope 包含 CI 时,在此处按相同规则加载
{ci_workflow.persistent_facts}
。CI-only 仅加载其 CI facts,并跳过 framework facts。以
file:
为前缀的 entry 是相对于
{project-root}
解析的 paths 或 globs;展开这些 paths 或 globs,并按字典路径顺序将每个匹配文件加载为 facts。其他所有 entry 均按原样作为 facts 加载。

Step 4: Load Config

第 4 步:加载配置

Run
uv run {project-root}/_bmad/scripts/resolve_config.py --project-root {project-root} --key core --key modules.tea
. If the script fails, merge
{project-root}/_bmad/config.toml
,
{project-root}/_bmad/custom/config.toml
and
{project-root}/_bmad/custom/config.user.toml
yourself, in that order, with the merge rules above. If
_bmad/config.toml
is missing or has no
modules.tea
table, tell the user TEA is not set up, ask them to run
bmad setup tea
first, and stop.
Each
core
and
modules.tea
key is available as
{<key>}
, and as
config.<key>
in later steps. Replace
{project-root}
inside a value with the project root. Setup answers are strings: read
"true"
and
"false"
as booleans.
If
{tea-knowledge}/tea-index.csv
does not exist, the TEA knowledge base is not installed. Tell the user, offer to install it with
npx skills add bmad-code-org/bmad-method-test-architecture-enterprise --skill bmod-tea
, run that on a yes, and stop until it is there.
执行:
uv run {project-root}/_bmad/scripts/resolve_config.py --project-root {project-root} --key core --key modules.tea
如果脚本失败,请按照上述合并规则,依次手动合并
{project-root}/_bmad/config.toml
、
{project-root}/_bmad/custom/config.toml
和
{project-root}/_bmad/custom/config.user.toml
。如果
_bmad/config.toml
不存在或没有
modules.tea
table,请告知用户 TEA 尚未配置,要求其先运行
bmad setup tea
,然后停止。
每个
core
和
modules.tea
key 在后续步骤中既可作为
{<key>}
使用,也可作为
config.<key>
使用。将值中的
{project-root}
替换为项目根目录。设置项答案为字符串:将
"true"
和
"false"
读取为布尔值。
如果
{tea-knowledge}/tea-index.csv
不存在,说明 TEA knowledge base 尚未安装。告知用户,并提出使用
npx skills add bmad-code-org/bmad-method-test-architecture-enterprise --skill bmod-tea
安装;用户同意后运行该命令,并停止执行直至其存在。

Step 5: Greet the User

第 5 步:问候用户

Greet
{user_name}
, speaking in
{communication_language}
.
使用
{communication_language}
向
{user_name}
问候。

Step 6: Execute Append Steps

第 6 步:执行 Append Steps

After greeting, execute each applicable append entry through the same individual durable hook protocol: framework
{workflow.activation_steps_append}
when scope includes framework, then
ci_workflow.activation_steps_append
when scope includes CI. Save each applicable phase in
activation_completed
after its entries succeed. Preserve the full journal and hook ledger through every scope and operation Resume.
Activation is complete. Begin the workflow below.
问候后,通过同一个逐项持久化 hook 协议执行每个适用的 append entry:当 scope 包含 framework 时执行
{workflow.activation_steps_append}
,随后当 scope 包含 CI 时执行
{ci_workflow.activation_steps_append}
。相关 entries 全部成功后,将每个适用 phase 保存到
activation_completed
。在每种 scope 和 operation 的 Resume 过程中,保留完整的 journal 和 hook ledger。
Activation 已完成。开始执行下面的 workflow。

Workflow Architecture

Workflow 架构

The existing framework steps at the skill root and the CI steps under
ci/
share scope and operation routing. Select CI setup by asking
bmad-tea-framework
for CI scope.
Create and edit CI phases detect
ci/evaluation-ci-plan.json
and render it through
{skill-root}/ci/steps-c/step-03b-render-evaluation-plans.md
. Evaluate invokes
bmad-tea-framework
with CI scope in create or edit mode.
skill root 中现有的 framework steps 与
ci/
下的 CI steps 共享 scope 和 operation 路由。要选择 CI setup,请向
bmad-tea-framework
请求 CI scope。
Create
和
Edit
CI phases 会检测
ci/evaluation-ci-plan.json
,并通过
{skill-root}/ci/steps-c/step-03b-render-evaluation-plans.md
渲染它。
Evaluate
会在 create 或 edit 模式下调用
bmad-tea-framework
并传入 CI scope。

Initialization Sequence

初始化流程

Load
{skill-root}/resources/setup-routing.md
completely. Continue sections 2 through 4 after the read-only gate and canonical activation. Its checkpoint, customization, and completion rules apply to every step below. Do not repeat canonical activation or the scope question.
完整加载
{skill-root}/resources/setup-routing.md
。在 read-only gate 和 canonical activation 之后,继续执行其第 2 至第 4 节。其中的 checkpoint、customization 和 completion 规则适用于以下每个步骤。不要重复执行 canonical activation 或 scope 询问。

Framework Phase

Framework Phase

  • If C: Load
    {skill-root}/steps-c/step-01-preflight.md
  • If R: Load
    {skill-root}/steps-c/step-01b-resume.md
    only for a legacy Create checkpoint without a journal next position. Journal-backed Resume dispatches its saved C/E/V next file/subsection directly.
  • If V: Load
    {skill-root}/steps-v/step-01-validate.md
  • If E: Load
    {skill-root}/steps-e/step-01-assess.md
  • 如果为 C: 加载
    {skill-root}/steps-c/step-01-preflight.md
  • 如果为 R: 仅当 legacy
    Create
    checkpoint 没有 journal next position 时,加载
    {skill-root}/steps-c/step-01b-resume.md
    。由 journal 支持的
    Resume
    会直接调度其保存的 C/E/V 下一个 file/subsection。
  • 如果为 V: 加载
    {skill-root}/steps-v/step-01-validate.md
  • 如果为 E: 加载
    {skill-root}/steps-e/step-01-assess.md

CI Phase

CI Phase

CI settings and applicable activation hooks were handled in the activation stages above. Keep
{skill-root}
bound to the canonical framework directory; do not replay CI activation at phase handoff.
  • If C: Load
    {skill-root}/ci/steps-c/step-01-preflight.md
  • If R: Load
    {skill-root}/ci/steps-c/step-01b-resume.md
    only for a legacy Create checkpoint without a journal next position. Journal-backed Resume dispatches its saved C/E/V next file/subsection directly.
  • If V: Load
    {skill-root}/ci/steps-v/step-01-validate.md
  • If E: Load
    {skill-root}/ci/steps-e/step-01-assess.md
For both scope, the coordinator runs the applicable framework and CI phases under the same operation and agreed contract. Read
resources/setup-parallel.md
before concurrent generation. Every phase terminal loads
{skill-root}/resources/setup-phase-completion.md
; completion occurs after all requested phases satisfy their operation-specific completion criteria.
CI settings 和适用的 activation hooks 已在上方 activation stages 中处理。将
{skill-root}
绑定至 canonical framework directory;在 phase handoff 时不要重新执行 CI activation。
  • 如果为 C: 加载
    {skill-root}/ci/steps-c/step-01-preflight.md
  • 如果为 R: 仅当 legacy
    Create
    checkpoint 没有 journal next position 时,加载
    {skill-root}/ci/steps-c/step-01b-resume.md
    。由 journal 支持的
    Resume
    会直接调度其保存的 C/E/V 下一个 file/subsection。
  • 如果为 V: 加载
    {skill-root}/ci/steps-v/step-01-validate.md
  • 如果为 E: 加载
    {skill-root}/ci/steps-e/step-01-assess.md
对于两种 scope,coordinator 会在相同 operation 和约定 contract 下运行适用的 framework 与 CI phases。并发生成前阅读
resources/setup-parallel.md
。每个 phase 结束时都会加载
{skill-root}/resources/setup-phase-completion.md
;只有所有请求的 phases 均满足其 operation-specific completion criteria 后,整个流程才完成。