bmad-tea-framework
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTest 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_styleConventions
约定
- Bare paths (e.g. ) resolve from the skill root.
instructions.md - resolves to this skill's installed directory (where
{skill-root}lives).customize.toml - is the nearest folder containing
{project-root}, starting at the project working directory and moving up through its parents._bmad/ - is the
{tea-knowledge}folder of theknowledge/skill, installed beside this one:bmod-tea.{skill-root}/../bmod-tea/knowledgethere lists every fragment by a path relative to that folder.tea-index.csv - resolves to the skill directory's basename.
{skill-name} - Resolve sibling workflow files such as ,
instructions.md,checklist.md,steps-c/...,steps-e/..., and templates fromsteps-v/....{skill-root}
- 裸路径(例如 )从 skill 根目录解析。
instructions.md - 解析为此 skill 的安装目录(
{skill-root}所在位置)。customize.toml - 是包含
{project-root}的最近文件夹,从项目工作目录开始逐级向上查找。_bmad/ - 是
{tea-knowledge}skill 的bmod-tea文件夹,与当前 skill 安装在同一位置:knowledge/。其中的{skill-root}/../bmod-tea/knowledge按相对于该文件夹的路径列出每个 fragment。tea-index.csv - 解析为 skill 目录的 basename。
{skill-name} - 从 解析同级 workflow 文件(如
{skill-root}、instructions.md、checklist.md、steps-c/...、steps-e/...)和 templates。steps-v/...
Read-Only Request Gate
只读请求门控
Before activation hooks or project writes, load 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.
{skill-root}/resources/setup-routing.md在任何 activation hooks 或项目写入之前,加载 并执行其第 1 节。这将确定 scope 以及缺少 framework 时的提供选项;如果用户拒绝,则停止本次运行。保留 CI adapter 中预设的 scope 和 operation。
{skill-root}/resources/setup-routing.mdOn Activation
激活时
Before resolving customizations or running hooks, inspect for , , , and . If any exists, stop and tell the user to run . Resolve any reported manual merge, then start a fresh chat. Do not continue with default settings while legacy overrides remain.
{project-root}/_bmad/custom/bmad-testarch-framework.tomlbmad-testarch-framework.user.tomlbmad-testarch-ci.tomlbmad-testarch-ci.user.tomlnpx --package=bmad-method-test-architecture-enterprise@3 tea-migrate-customizations --project-root {project-root}在解析 customizations 或运行 hooks 之前,检查 中是否存在 、、 和 。如果存在任何文件,停止并告知用户运行 。完成所报告的 manual merge 后,启动新的对话。只要 legacy overrides 仍然存在,就不要使用 default settings 继续执行。
{project-root}/_bmad/custom/bmad-testarch-framework.tomlbmad-testarch-framework.user.tomlbmad-testarch-ci.tomlbmad-testarch-ci.user.tomlnpx --package=bmad-method-test-architecture-enterprise@3 tea-migrate-customizations --project-root {project-root}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 workflowIf the script fails, resolve the block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
workflow- — defaults
{skill-root}/customize.toml - — team overrides
{project-root}/_bmad/custom/{skill-name}.toml - — personal overrides
{project-root}/_bmad/custom/{skill-name}.user.toml
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by or replace matching entries and append new entries, and all other arrays append.
codeidWhen scope includes CI, resolve through section 2 before any CI hook, greeting, contract freeze or worker launch. Retain canonical separately for explicit platform precedence. This resolution reads settings only; the activation stages below execute the applicable hooks and facts.
ci_workflowresources/setup-routing.mdworkflow执行:
uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --project-root {project-root} --key workflow如果脚本失败,按 base → team → user 的顺序读取以下三个文件,并采用与 resolver 相同的结构化合并规则,自行解析 block:
workflow- — 默认值
{skill-root}/customize.toml - — 团队覆盖项
{project-root}/_bmad/custom/{skill-name}.toml - — 个人覆盖项
{project-root}/_bmad/custom/{skill-name}.user.toml
缺少的文件将被跳过。标量值直接覆盖,table 深度合并,以 或 为键的 table 数组会替换匹配项并追加新项,其他所有数组均执行追加。
codeid当 scope 包含 CI 时,在任何 CI hook、问候、contract freeze 或 worker launch 之前,通过 第 2 节解析 。另行保留 canonical ,以遵循显式指定的平台优先级。此解析仅读取 settings;后续 activation stages 会执行适用的 hooks 和 facts。
{skill-root}/resources/setup-routing.mdci_workflowworkflowStep 2: Execute Prepend Steps
第 2 步:执行 Prepend Steps
When scope includes framework, execute each entry in in order through section 3. CI-only skips framework prepend/append hooks, persistent facts and completion hooks. When scope includes CI, execute each 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.
{workflow.activation_steps_prepend}{skill-root}/resources/setup-state.mdci_workflow.activation_steps_prepend当 scope 包含 framework 时,按照 第 3 节规定的协议,依次执行 中的每个 entry。CI-only 会跳过 framework 的 prepend/append hooks、persistent facts 和 completion hooks。当 scope 包含 CI 时,在 config/问候之前,立即按照同一持久化协议执行 中的每个 entry。request gate 已恢复当前 run 并持久化其 journal。执行每个 entry 前保存其 started marker,跳过已完成的 entry;如果任何已启动的 entry 结果不确定,则停止执行。
{skill-root}/resources/setup-state.md{workflow.activation_steps_prepend}{ci_workflow.activation_steps_prepend}Step 3: Load Persistent Facts
第 3 步:加载 Persistent Facts
When scope includes framework, treat every entry in as foundational context you carry for the rest of the workflow run. When scope includes CI, load here under the same rules. CI-only loads its CI facts and skips framework facts. Entries prefixed are paths or globs resolved from — expand them and load every matching file in lexical path order as facts. All other entries are facts verbatim.
{workflow.persistent_facts}ci_workflow.persistent_factsfile:{project-root}当 scope 包含 framework 时,将 中的每个 entry 视为整个 workflow run 中持续携带的基础上下文。当 scope 包含 CI 时,在此处按相同规则加载 。CI-only 仅加载其 CI facts,并跳过 framework facts。以 为前缀的 entry 是相对于 解析的 paths 或 globs;展开这些 paths 或 globs,并按字典路径顺序将每个匹配文件加载为 facts。其他所有 entry 均按原样作为 facts 加载。
{workflow.persistent_facts}{ci_workflow.persistent_facts}file:{project-root}Step 4: Load Config
第 4 步:加载配置
Run . If the script fails, merge , and yourself, in that order, with the merge rules above. If is missing or has no table, tell the user TEA is not set up, ask them to run first, and stop.
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.tomlmodules.teabmad setup teaEach and key is available as , and as in later steps. Replace inside a value with the project root. Setup answers are strings: read and as booleans.
coremodules.tea{<key>}config.<key>{project-root}"true""false"If does not exist, the TEA knowledge base is not installed. Tell the user, offer to install it with , run that on a yes, and stop until it is there.
{tea-knowledge}/tea-index.csvnpx skills add bmad-code-org/bmad-method-test-architecture-enterprise --skill bmod-tea执行:
uv run {project-root}/_bmad/scripts/resolve_config.py --project-root {project-root} --key core --key modules.tea如果脚本失败,请按照上述合并规则,依次手动合并 、 和 。如果 不存在或没有 table,请告知用户 TEA 尚未配置,要求其先运行 ,然后停止。
{project-root}/_bmad/config.toml{project-root}/_bmad/custom/config.toml{project-root}/_bmad/custom/config.user.toml_bmad/config.tomlmodules.teabmad setup tea每个 和 key 在后续步骤中既可作为 使用,也可作为 使用。将值中的 替换为项目根目录。设置项答案为字符串:将 和 读取为布尔值。
coremodules.tea{<key>}config.<key>{project-root}"true""false"如果 不存在,说明 TEA knowledge base 尚未安装。告知用户,并提出使用 安装;用户同意后运行该命令,并停止执行直至其存在。
{tea-knowledge}/tea-index.csvnpx skills add bmad-code-org/bmad-method-test-architecture-enterprise --skill bmod-teaStep 5: Greet the User
第 5 步:问候用户
Greet , speaking in .
{user_name}{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 when scope includes framework, then when scope includes CI. Save each applicable phase in after its entries succeed. Preserve the full journal and hook ledger through every scope and operation Resume.
{workflow.activation_steps_append}ci_workflow.activation_steps_appendactivation_completedActivation is complete. Begin the workflow below.
问候后,通过同一个逐项持久化 hook 协议执行每个适用的 append entry:当 scope 包含 framework 时执行 ,随后当 scope 包含 CI 时执行 。相关 entries 全部成功后,将每个适用 phase 保存到 。在每种 scope 和 operation 的 Resume 过程中,保留完整的 journal 和 hook ledger。
{workflow.activation_steps_append}{ci_workflow.activation_steps_append}activation_completedActivation 已完成。开始执行下面的 workflow。
Workflow Architecture
Workflow 架构
The existing framework steps at the skill root and the CI steps under share scope and operation routing. Select CI setup by asking for CI scope.
ci/bmad-tea-frameworkCreate and edit CI phases detect and render it through . Evaluate invokes with CI scope in create or edit mode.
ci/evaluation-ci-plan.json{skill-root}/ci/steps-c/step-03b-render-evaluation-plans.mdbmad-tea-frameworkskill root 中现有的 framework steps 与 下的 CI steps 共享 scope 和 operation 路由。要选择 CI setup,请向 请求 CI scope。
ci/bmad-tea-frameworkCreateEditci/evaluation-ci-plan.json{skill-root}/ci/steps-c/step-03b-render-evaluation-plans.mdEvaluatebmad-tea-frameworkInitialization Sequence
初始化流程
Load 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 询问。
{skill-root}/resources/setup-routing.mdFramework Phase
Framework Phase
- If C: Load
{skill-root}/steps-c/step-01-preflight.md - If R: Load only for a legacy Create checkpoint without a journal next position. Journal-backed Resume dispatches its saved C/E/V next file/subsection directly.
{skill-root}/steps-c/step-01b-resume.md - 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 checkpoint 没有 journal next position 时,加载
Create。由 journal 支持的{skill-root}/steps-c/step-01b-resume.md会直接调度其保存的 C/E/V 下一个 file/subsection。Resume - 如果为 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 bound to the canonical framework directory; do not replay CI activation at phase handoff.
{skill-root}- If C: Load
{skill-root}/ci/steps-c/step-01-preflight.md - If R: Load only for a legacy Create checkpoint without a journal next position. Journal-backed Resume dispatches its saved C/E/V next file/subsection directly.
{skill-root}/ci/steps-c/step-01b-resume.md - 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 before concurrent generation. Every phase terminal loads ; completion occurs after all requested phases satisfy their operation-specific completion criteria.
resources/setup-parallel.md{skill-root}/resources/setup-phase-completion.mdCI settings 和适用的 activation hooks 已在上方 activation stages 中处理。将 绑定至 canonical framework directory;在 phase handoff 时不要重新执行 CI activation。
{skill-root}- 如果为 C: 加载
{skill-root}/ci/steps-c/step-01-preflight.md - 如果为 R: 仅当 legacy checkpoint 没有 journal next position 时,加载
Create。由 journal 支持的{skill-root}/ci/steps-c/step-01b-resume.md会直接调度其保存的 C/E/V 下一个 file/subsection。Resume - 如果为 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。并发生成前阅读 。每个 phase 结束时都会加载 ;只有所有请求的 phases 均满足其 operation-specific completion criteria 后,整个流程才完成。
resources/setup-parallel.md{skill-root}/resources/setup-phase-completion.md