diff --git a/README.md b/README.md index 89a4031..e838064 100644 --- a/README.md +++ b/README.md @@ -28,26 +28,28 @@ BMad is a small **agent + workflow engine**. There is no external orchestrator ### Building Blocks -Each workflow directory contains these files, and each has a specific job: - -| File | What it does | When it loads | -| ----------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `SKILL.md` | Expert persona — identity, principles, critical actions, capabilities table | First — always in context | -| `workflow.yaml` | Machine-readable metadata — config variables, required tools, tags | Second — resolves `{project-root}`, `{config_source}`, `{test_artifacts}` | -| `workflow.md` | Human-readable entry point — goals, mode menu (Create/Edit/Validate), routes to first step | Second — presents mode choice | -| `instructions.md` | Workflow-specific rules and context (optional, supplements workflow.md) | On demand | -| `steps-c/*.md` | **Create** steps — primary execution, 5-9 sequential files | One at a time (just-in-time) | -| `steps-e/*.md` | **Edit** steps — always 2 files: assess target, apply edit | One at a time | -| `steps-v/*.md` | **Validate** steps — always 1 file: evaluate against checklist | On demand | -| `checklist.md` | Validation criteria — what "done" looks like for this workflow | Read by steps-v | -| `*-template.md` | Output skeleton with `{PLACEHOLDER}` vars — steps fill these in to produce the final artifact | Read by steps-c when generating output | -| `tea-index.csv` | Knowledge fragment index — id, name, tags, tier (core/extended/specialized), file path | Read by step-01 to decide which fragments to load | -| `knowledge/*.md` | 40 reusable fragments — standards, patterns, API references (e.g., `data-factories.md`, `pactjs-utils-overview.md`) | Selectively read into context based on tier + config flags | +TEA has two layers of files, and each has a specific job: + +| File / Scope | What it does | When it loads | +| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | +| `src/agents/bmad-tea/SKILL.md` | Murat's persona — identity, principles, critical actions, capabilities table | First — activates the TEA agent | +| `src/agents/bmad-tea/customize.toml` | Agent customization surface — menu items, persistent facts, activation hooks | During agent activation | +| `src/workflows/testarch//SKILL.md` | Workflow entrypoint — resolves workflow customization, picks mode, routes to the first step | When a TEA workflow is invoked | +| `src/workflows/testarch//customize.toml` | Workflow customization surface — activation hooks, persistent facts, optional `on_complete` behavior | During workflow activation | +| `src/workflows/testarch//workflow.yaml` | Machine-readable workflow metadata — descriptions, defaults, tool hints, output paths | Used by installer/tooling and workflow metadata lookups | +| `instructions.md` | Workflow-specific summary and operator notes | On demand | +| `steps-c/*.md` | **Create** steps — primary execution, 5-9 sequential files | One at a time (just-in-time) | +| `steps-e/*.md` | **Edit** steps — always 2 files: assess target, apply edit | One at a time | +| `steps-v/*.md` | **Validate** steps — always 1 file: evaluate against checklist | On demand | +| `checklist.md` | Validation criteria — what "done" looks like for this workflow | Read by steps-v | +| `*-template.md` | Output skeleton with `{PLACEHOLDER}` vars — steps fill these in to produce the final artifact | Read by steps-c when generating output | +| `src/agents/bmad-tea/resources/tea-index.csv` | Knowledge fragment index — id, name, tags, tier (core/extended/specialized), file path | Read to decide which shared TEA fragments to load | +| `resources/knowledge/*.md` | Reusable fragments — standards, patterns, API references | Selectively read into context based on tier + config | ```mermaid flowchart LR U[User] --> A[Agent Persona] - A --> W[Workflow Entry: workflow.md] + A --> W[Workflow Entry: workflow SKILL.md] W --> S[Step Files: steps-c / steps-e / steps-v] S --> K[Knowledge Fragments
tea-index.csv → knowledge/*.md] S --> T[Templates & Checklists
*-template.md, checklist.md] @@ -59,8 +61,8 @@ flowchart LR 1. **Trigger** — Direct commands are `/bmad:tea:automate` (Claude/Cursor/Windsurf) and `$bmad-tea-testarch-automate` (Codex). Load the conversational TEA menu with `$bmad-tea` in Codex. `TA` is an agent-menu trigger available only after TEA is activated; the capabilities table in `SKILL.md` maps `TA` to the `bmad-testarch-automate` skill. 2. **Agent loads** — `SKILL.md` injects the persona (identity, principles, critical actions) into the context window. -3. **Workflow loads** — `workflow.yaml` resolves config variables and `workflow.md` presents the mode menu (Create / Edit / Validate), then routes to the first step file. -4. **Step-by-step execution** — Only the current step file is in context (just-in-time loading). Each step explicitly names the next one (`nextStepFile: './step-02-...'`). The LLM reads, executes, saves output, then loads the next step. No future steps are ever preloaded. +3. **Workflow loads** — The workflow's `SKILL.md` becomes the entrypoint. It resolves the workflow block from `customize.toml`, loads persistent facts and config, decides the mode (Create / Edit / Validate), then routes to the first step file. +4. **Step-by-step execution** — Only the current step file is in context (just-in-time loading). Each step explicitly names the next one with a `{skill-root}`-anchored path. The LLM reads, executes, saves output, then loads the next step. No future steps are ever preloaded. 5. **Knowledge injection** — Step-01 reads `tea-index.csv` and selectively loads fragments by **tier** (core = always, extended = on-demand, specialized = only when relevant) and **config flags** (e.g., `tea_use_pactjs_utils`). This is deliberate context engineering: a backend project loads ~1,800 lines of fragments; a fullstack project loads ~4,500 lines. Conditional loading cuts context usage by 40-50%. 6. **Templates** — When a step produces output (e.g., a traceability matrix or test review report), it reads the `*-template.md` file and fills in the `{PLACEHOLDER}` values with computed results. The template provides consistent structure; the step provides the content. 7. **Subagent isolation** — Heavy workflows (e.g., `automate`) spawn parallel subagents that each run in an isolated context. Subagents write structured JSON to temp files. An aggregation step reads the JSON outputs — only the results enter the main context, not the full subagent history. @@ -84,12 +86,12 @@ BMad workflows and Claude Code Skills solve different problems at different scal The key insight is that there is **no external runtime engine** — the LLM _is_ the engine. BMad workflows are structured markdown that the LLM follows as instructions: "read this file, execute it completely, save your output, load the next file." Skills are a single tool in a toolbox; BMad workflows are a workshop with a process manual. -**How workflows become commands.** When you run `npx bmad-method install`, the installer generates tool-specific artifacts for your runtime (for example, Claude Code uses `.claude/commands/`, while Codex uses `.agents/skills/`). In Claude Code, `bmad-tea-testarch-automate.md` tells the LLM: "load the core workflow engine (`workflow.xml`), pass it this workflow config (`automate/workflow.yaml`), follow the instructions exactly." That launcher artifact is the bridge — it triggers the workflow entry point; the multi-step engine takes over from there. +**How workflows become commands.** When you run `npx bmad-method install`, the installer generates tool-specific artifacts for your runtime (for example, Claude Code uses `.claude/commands/`, while Codex uses `.agents/skills/`). Those launchers bridge into the installed TEA agent or workflow package. Once invoked, the workflow's `SKILL.md` is the conversational entrypoint, and the step-file process takes over from there. ```text .claude/commands/ # Generated by installer ├── bmad-tea.md # /tea → loads agent persona + menu -├── bmad-tea-testarch-automate.md # /automate → loads workflow.xml + workflow.yaml +├── bmad-tea-testarch-automate.md # /automate → invokes the automate workflow package ├── bmad-tea-testarch-test-design.md # /test-design → ... ├── bmad-bmm-create-prd.md # /create-prd → BMM workflow └── ... (61 commands total across all installed modules) @@ -174,7 +176,12 @@ Workflows load only the fragments required for the current task to stay focused src/ ├── module.yaml ├── agents/ -│ └── bmad-tea/ # Native skill: SKILL.md + bmad-skill-manifest.yaml +│ └── bmad-tea/ +│ ├── SKILL.md +│ ├── customize.toml +│ └── resources/ +│ ├── tea-index.csv +│ └── knowledge/ ├── workflows/ │ └── testarch/ │ ├── bmad-teach-me-testing/ @@ -186,11 +193,6 @@ src/ │ ├── bmad-testarch-test-design/ │ ├── bmad-testarch-test-review/ │ └── bmad-testarch-trace/ -└── agents/ - └── bmad-tea/ - └── resources/ - ├── tea-index.csv - └── knowledge/ ``` ## Extending TEA diff --git a/src/workflows/testarch/README.md b/src/workflows/testarch/README.md index 9c84829..51d2569 100644 --- a/src/workflows/testarch/README.md +++ b/src/workflows/testarch/README.md @@ -1,6 +1,6 @@ # TEA Workflow Step Files -This folder contains the Test Architect (TEA) workflows converted to step-file architecture for strict LLM compliance. Each workflow is tri-modal (create, edit, validate) and uses small, ordered step files instead of a single monolithic instruction file. +This folder contains the Test Architect (TEA) workflows converted to skill-driven step-file architecture for strict LLM compliance. Each workflow is tri-modal (create, edit, validate) and uses small, ordered step files routed from `SKILL.md` instead of a single monolithic instruction file. ## Why Step Files @@ -12,7 +12,8 @@ This folder contains the Test Architect (TEA) workflows converted to step-file a ``` / -├── workflow.md # Mode routing (create / edit / validate) +├── SKILL.md # Canonical entrypoint and mode routing +├── customize.toml # Workflow customization surface ├── workflow-plan.md # Design reference for step order and intent ├── workflow.yaml # Installer metadata ├── instructions.md # Short entrypoint / summary @@ -69,6 +70,7 @@ This folder contains the Test Architect (TEA) workflows converted to step-file a ## Notes -- `workflow.md` is the canonical entrypoint. `instructions.md` is a short summary for quick context. +- `SKILL.md` is the canonical entrypoint. `instructions.md` is a short summary for quick context. +- `customize.toml` defines activation hooks, persistent facts, and the optional `on_complete` hook. - Output files typically use `{test_artifacts}` or `{project-root}` variables. - If a workflow produces multiple artifacts (e.g., system-level vs epic-level), the step file will specify which templates and output paths to use. diff --git a/src/workflows/testarch/bmad-teach-me-testing/SKILL.md b/src/workflows/testarch/bmad-teach-me-testing/SKILL.md index ecfd2d4..eb4dcad 100644 --- a/src/workflows/testarch/bmad-teach-me-testing/SKILL.md +++ b/src/workflows/testarch/bmad-teach-me-testing/SKILL.md @@ -3,13 +3,127 @@ name: bmad-teach-me-testing description: 'Teach testing progressively through structured sessions. Use when user says "lets learn testing" or "I want to study test practices"' --- +# Teach Me Testing — TEA Academy + +**Goal:** Provide self-paced, multi-session learning that teaches testing fundamentals through advanced practices, scalable to entire teams without requiring instructor time. + +**Role:** In addition to your name, communication_style, and persona, you are also a Master Test Architect and Teaching Guide collaborating with learners at all levels. This is a partnership, not a lecture. You bring expertise in TEA methodology, testing principles, and teaching pedagogy, while the learner brings their role context, experience, and learning goals. Work together to build their testing knowledge progressively. + +**Meta-Context:** This workflow uses continuable architecture with state persistence across sessions. Users can pause and resume anytime, jump to any session based on experience, and learn at their own pace over 1-2 weeks. + +You will continue to operate with your given name, identity, and communication_style, merged with the details of this role description. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `project_name` +- `communication_language` +- `test_artifacts` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This uses **step-file architecture** for disciplined execution: + +### Core Principles + +- **Micro-file Design**: Each step is a self-contained instruction file that is part of an overall workflow that must be followed exactly +- **Just-In-Time Loading**: Only the current step file is in memory — never load future step files until told to do so +- **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed +- **State Tracking**: Document progress in progress file using `stepsCompleted` array and session tracking +- **Continuable Sessions**: Users can pause after any session and resume later with full context preserved +- **Tri-Modal Structure**: Separate step folders for Create (steps-c/), Edit (steps-e/), and Validate (steps-v/) modes + +### Step Processing Rules + +1. **READ COMPLETELY**: Always read the entire step file before taking any action +2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate +3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection +4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue) +5. **SAVE STATE**: Update `stepsCompleted` and session tracking in progress file before loading next step +6. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file + +### Critical Rules (NO EXCEPTIONS) + +- 🛑 **NEVER** load multiple step files simultaneously +- 📖 **ALWAYS** read entire step file before execution +- 🚫 **NEVER** skip steps or optimize the sequence +- 💾 **ALWAYS** update progress file after each session completion +- 🎯 **ALWAYS** follow the exact instructions in the step file +- ⏸️ **ALWAYS** halt at menus and wait for user input +- 📋 **NEVER** create mental todo lists from future steps +- ✅ **ALWAYS** communicate in `{communication_language}` + +## Initialization Sequence + +### 1. Mode Determination + +**Check if mode was specified in the command invocation:** + +- If user invoked with "create" or "teach" or "learn" or "start" or "resume" or "continue" → Set mode to **create** +- If user invoked with "validate" or "review" or "-v" or "--validate" → Set mode to **validate** +- If user invoked with "edit" or "modify" or "-e" or "--edit" → Set mode to **edit** + +**If mode is still unclear, ask user:** + +"Welcome to TEA Academy! What would you like to do? + +**[C]reate** — Start learning sessions (new or continue existing progress) +**[V]alidate** — Review workflow quality and generate validation report +**[E]dit** — Modify workflow content or structure + +Please select: [C]reate / [V]alidate / [E]dit" + +### 2. Route to First Step + +**IF mode == create:** +Load, read the full file, and then execute `{skill-root}/steps-c/step-01-init.md` to begin the teaching workflow. + +**IF mode == validate:** +Prompt for workflow path (if validating the workflow itself): "Which workflow would you like to validate?" +Then load, read the full file, and then execute `{skill-root}/steps-v/step-v-01-validate.md`. -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +**IF mode == edit:** +Prompt for what to edit: "What would you like to edit in the teaching workflow?" +Then load, read the full file, and then execute `{skill-root}/steps-e/step-e-01-assess-workflow.md`. diff --git a/src/workflows/testarch/bmad-teach-me-testing/checklist.md b/src/workflows/testarch/bmad-teach-me-testing/checklist.md index 5921ff5..a5a6688 100644 --- a/src/workflows/testarch/bmad-teach-me-testing/checklist.md +++ b/src/workflows/testarch/bmad-teach-me-testing/checklist.md @@ -8,10 +8,11 @@ Use this checklist to validate the teaching workflow meets quality standards. ## Foundation Quality -- [ ] **workflow.md** exists with proper frontmatter +- [ ] **SKILL.md** exists with proper frontmatter +- [ ] **customize.toml** defines activation hooks and persistent facts - [ ] Tri-modal routing logic present (Create/Edit/Validate) - [ ] Configuration loading references correct module (TEA) -- [ ] First step path correct (`./steps-c/step-01-init.md`) +- [ ] First step path correct (`{skill-root}/steps-c/step-01-init.md`) - [ ] Folder structure complete (steps-c/, steps-e/, steps-v/, data/, templates/) --- diff --git a/src/workflows/testarch/bmad-teach-me-testing/customize.toml b/src/workflows/testarch/bmad-teach-me-testing/customize.toml new file mode 100644 index 0000000..f7ba00d --- /dev/null +++ b/src/workflows/testarch/bmad-teach-me-testing/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-teach-me-testing. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, learning objectives). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-teach-me-testing/instructions.md b/src/workflows/testarch/bmad-teach-me-testing/instructions.md index 27db78a..15fec77 100644 --- a/src/workflows/testarch/bmad-teach-me-testing/instructions.md +++ b/src/workflows/testarch/bmad-teach-me-testing/instructions.md @@ -38,6 +38,13 @@ The workflow automatically detects existing progress and resumes where you left ## Workflow Structure +### Step Entrypoints + +- Create / start: `{skill-root}/steps-c/step-01-init.md` +- Continue existing progress: `{skill-root}/steps-c/step-01b-continue.md` +- Validate the workflow: `{skill-root}/steps-v/step-v-01-validate.md` +- Edit the workflow: `{skill-root}/steps-e/step-e-01-assess-workflow.md` + ### 7 Sessions 1. **Quick Start (30 min)** - TEA Lite intro, run automate workflow diff --git a/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md b/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md index f030134..a183623 100644 --- a/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md +++ b/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md @@ -337,3 +337,11 @@ Workflow ends here. User can run the workflow again to re-take sessions or explo - Proceeding to next step (this is final - no next step) **Master Rule:** Verify completion, generate certificate, celebrate achievement, end workflow. This is the finale. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-02-apply-edits.md b/src/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-02-apply-edits.md index 92555fc..1d9f2dd 100644 --- a/src/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-02-apply-edits.md +++ b/src/workflows/testarch/bmad-teach-me-testing/steps-e/step-e-02-apply-edits.md @@ -120,3 +120,11 @@ The teach-me-testing workflow has been updated. ✅ Edits applied to approved files only, changes validated, workflow integrity maintained, user informed of modifications. **Master Rule:** Show changes, get approval, apply edits, validate integrity. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-teach-me-testing/steps-v/step-v-01-validate.md b/src/workflows/testarch/bmad-teach-me-testing/steps-v/step-v-01-validate.md index 1ad253b..d930a19 100644 --- a/src/workflows/testarch/bmad-teach-me-testing/steps-v/step-v-01-validate.md +++ b/src/workflows/testarch/bmad-teach-me-testing/steps-v/step-v-01-validate.md @@ -63,7 +63,8 @@ This will validate: **Check:** -- [ ] workflow.md exists with proper frontmatter +- [ ] SKILL.md exists with proper frontmatter +- [ ] customize.toml defines workflow customization surface - [ ] Tri-modal routing logic present - [ ] Configuration loading correct - [ ] First step path correct @@ -261,3 +262,11 @@ Workflow is usable but could be improved. ✅ All validation checks run, comprehensive report generated, issues identified with remediation guidance, overall status determined. **Master Rule:** Check everything systematically, report findings clearly, provide actionable remediation. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-teach-me-testing/workflow.md b/src/workflows/testarch/bmad-teach-me-testing/workflow.md deleted file mode 100644 index d2db62e..0000000 --- a/src/workflows/testarch/bmad-teach-me-testing/workflow.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -name: bmad-teach-me-testing -description: 'Teach testing progressively through structured sessions. Use when user says "lets learn testing" or "I want to study test practices"' -web_bundle: true ---- - -# Teach Me Testing - TEA Academy - -**Goal:** Provide self-paced, multi-session learning that teaches testing fundamentals through advanced practices, scalable to entire teams without requiring instructor time. - -**Your Role:** In addition to your name, communication_style, and persona, you are also a Master Test Architect and Teaching Guide collaborating with learners at all levels. This is a partnership, not a lecture. You bring expertise in TEA methodology, testing principles, and teaching pedagogy, while the learner brings their role context, experience, and learning goals. Work together to build their testing knowledge progressively. - -**Meta-Context:** This workflow uses continuable architecture with state persistence across sessions. Users can pause and resume anytime, jump to any session based on experience, and learn at their own pace over 1-2 weeks. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This uses **step-file architecture** for disciplined execution: - -### Core Principles - -- **Micro-file Design**: Each step is a self-contained instruction file that is part of an overall workflow that must be followed exactly -- **Just-In-Time Loading**: Only the current step file is in memory - never load future step files until told to do so -- **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed -- **State Tracking**: Document progress in progress file using `stepsCompleted` array and session tracking -- **Continuable Sessions**: Users can pause after any session and resume later with full context preserved -- **Tri-Modal Structure**: Separate step folders for Create (steps-c/), Edit (steps-e/), and Validate (steps-v/) modes - -### Step Processing Rules - -1. **READ COMPLETELY**: Always read the entire step file before taking any action -2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate -3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection -4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue) -5. **SAVE STATE**: Update `stepsCompleted` and session tracking in progress file before loading next step -6. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file - -### Critical Rules (NO EXCEPTIONS) - -- 🛑 **NEVER** load multiple step files simultaneously -- 📖 **ALWAYS** read entire step file before execution -- 🚫 **NEVER** skip steps or optimize the sequence -- 💾 **ALWAYS** update progress file after each session completion -- 🎯 **ALWAYS** follow the exact instructions in the step file -- ⏸️ **ALWAYS** halt at menus and wait for user input -- 📋 **NEVER** create mental todo lists from future steps -- ✅ **ALWAYS** communicate in {communication_language} - ---- - -## INITIALIZATION SEQUENCE - -### 1. Configuration Loading - -Load and read full config from {project-root}/\_bmad/tea/config.yaml (or module config if TEA module installed) and resolve: - -- `project_name`, `user_name`, `communication_language`, `test_artifacts` -- TEA module variables: `test_artifacts` (base output folder for test-related artifacts) - -### 2. Mode Determination - -**Check if mode was specified in the command invocation:** - -- If user invoked with "create" or "teach" or "learn" or "start" → Set mode to **create** -- If user invoked with "validate" or "review" or "-v" or "--validate" → Set mode to **validate** -- If user invoked with "edit" or "modify" or "-e" or "--edit" → Set mode to **edit** - -**If mode is still unclear, ask user:** - -"Welcome to TEA Academy! What would you like to do? - -**[C]reate** - Start learning sessions (new or continue existing progress) -**[V]alidate** - Review workflow quality and generate validation report -**[E]dit** - Modify workflow content or structure - -Please select: [C]reate / [V]alidate / [E]dit" - -### 3. Route to First Step - -**IF mode == create:** -Load, read the full file and then execute `{skill-root}/steps-c/step-01-init.md` to begin the teaching workflow. - -**IF mode == validate:** -Prompt for workflow path (if validating the workflow itself): "Which workflow would you like to validate?" -Then load, read the full file and then execute `{skill-root}/steps-v/step-v-01-validate.md` - -**IF mode == edit:** -Prompt for what to edit: "What would you like to edit in the teaching workflow?" -Then load, read the full file and then execute `{skill-root}/steps-e/step-e-01-assess-workflow.md` diff --git a/src/workflows/testarch/bmad-testarch-atdd/SKILL.md b/src/workflows/testarch/bmad-testarch-atdd/SKILL.md index 7559fe3..5698d7f 100644 --- a/src/workflows/testarch/bmad-testarch-atdd/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-atdd/SKILL.md @@ -3,13 +3,83 @@ name: bmad-testarch-atdd description: 'Generate red-phase acceptance test scaffolds using the TDD cycle. Use when the user says "lets write acceptance tests" or "I want to do ATDD"' --- +# Acceptance Test-Driven Development (ATDD) + +**Goal:** Generate red-phase acceptance test scaffolds before implementation using TDD red-green-refactor cycle. + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +- **If C:** Load `{skill-root}/steps-c/step-01-preflight-and-context.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` diff --git a/src/workflows/testarch/bmad-testarch-atdd/customize.toml b/src/workflows/testarch/bmad-testarch-atdd/customize.toml new file mode 100644 index 0000000..cd54e80 --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-atdd/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-atdd. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-05-validate-and-complete.md b/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-05-validate-and-complete.md index 8ce2c69..df320d5 100644 --- a/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-05-validate-and-complete.md +++ b/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-05-validate-and-complete.md @@ -113,3 +113,11 @@ Report: - Skipped sequence steps or missing outputs **Master Rule:** Skipping steps is FORBIDDEN. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-atdd/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-atdd/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-atdd/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-atdd/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-atdd/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-atdd/steps-v/step-01-validate.md index ee5fb34..bf8522c 100644 --- a/src/workflows/testarch/bmad-testarch-atdd/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-atdd/steps-v/step-01-validate.md @@ -65,3 +65,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-atdd/workflow.md b/src/workflows/testarch/bmad-testarch-atdd/workflow.md deleted file mode 100644 index 7382d54..0000000 --- a/src/workflows/testarch/bmad-testarch-atdd/workflow.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: bmad-testarch-atdd -description: Generate red-phase acceptance test scaffolds using TDD cycle. Use when user says 'lets write acceptance tests' or 'I want to do ATDD' -web_bundle: true ---- - -# Acceptance Test-Driven Development (ATDD) - -**Goal:** Generate red-phase acceptance test scaffolds before implementation using TDD red-green-refactor cycle - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-preflight-and-context.md` -- **If R:** Load `{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` diff --git a/src/workflows/testarch/bmad-testarch-automate/SKILL.md b/src/workflows/testarch/bmad-testarch-automate/SKILL.md index e66e2b9..cebcd85 100644 --- a/src/workflows/testarch/bmad-testarch-automate/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-automate/SKILL.md @@ -3,13 +3,83 @@ name: bmad-testarch-automate description: 'Expand test automation coverage for codebase. Use when user says "lets expand test coverage" or "I want to automate tests"' --- +# Test Automation Expansion + +**Goal:** Expand test automation coverage after implementation or analyze existing codebase to generate a comprehensive test suite. + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +- **If C:** Load `{skill-root}/steps-c/step-01-preflight-and-context.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` diff --git a/src/workflows/testarch/bmad-testarch-automate/customize.toml b/src/workflows/testarch/bmad-testarch-automate/customize.toml new file mode 100644 index 0000000..6e8fbe4 --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-automate/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-automate. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-automate/steps-c/step-04-validate-and-summarize.md b/src/workflows/testarch/bmad-testarch-automate/steps-c/step-04-validate-and-summarize.md index e40c51c..6154c2b 100644 --- a/src/workflows/testarch/bmad-testarch-automate/steps-c/step-04-validate-and-summarize.md +++ b/src/workflows/testarch/bmad-testarch-automate/steps-c/step-04-validate-and-summarize.md @@ -104,3 +104,11 @@ Write `{outputFile}` including: - Skipped sequence steps or missing outputs **Master Rule:** Skipping steps is FORBIDDEN. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-automate/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-automate/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-automate/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-automate/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-automate/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-automate/steps-v/step-01-validate.md index 90aa08d..fcb075d 100644 --- a/src/workflows/testarch/bmad-testarch-automate/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-automate/steps-v/step-01-validate.md @@ -65,3 +65,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-automate/workflow.md b/src/workflows/testarch/bmad-testarch-automate/workflow.md deleted file mode 100644 index 7df92dc..0000000 --- a/src/workflows/testarch/bmad-testarch-automate/workflow.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: bmad-testarch-automate -description: Expand test automation coverage for codebase. Use when user says 'lets expand test coverage' or 'I want to automate tests' -web_bundle: true ---- - -# Test Automation Expansion - -**Goal:** Expand test automation coverage after implementation or analyze existing codebase to generate comprehensive test suite - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-preflight-and-context.md` -- **If R:** Load `{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` diff --git a/src/workflows/testarch/bmad-testarch-ci/SKILL.md b/src/workflows/testarch/bmad-testarch-ci/SKILL.md index 93123d1..9a07eb7 100644 --- a/src/workflows/testarch/bmad-testarch-ci/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-ci/SKILL.md @@ -3,13 +3,83 @@ name: bmad-testarch-ci description: 'Scaffold CI/CD quality pipeline with test execution. Use when the user says "lets setup CI pipeline" or "I want to create quality gates"' --- +# CI/CD Pipeline Setup + +**Goal:** Scaffold CI/CD quality pipeline with test execution, burn-in loops, and artifact collection. + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +- **If C:** Load `{skill-root}/steps-c/step-01-preflight.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` diff --git a/src/workflows/testarch/bmad-testarch-ci/customize.toml b/src/workflows/testarch/bmad-testarch-ci/customize.toml new file mode 100644 index 0000000..1e522e6 --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-ci/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-ci. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-ci/steps-c/step-04-validate-and-summary.md b/src/workflows/testarch/bmad-testarch-ci/steps-c/step-04-validate-and-summary.md index ae49309..73b4fd7 100644 --- a/src/workflows/testarch/bmad-testarch-ci/steps-c/step-04-validate-and-summary.md +++ b/src/workflows/testarch/bmad-testarch-ci/steps-c/step-04-validate-and-summary.md @@ -90,3 +90,11 @@ Report: - Skipped sequence steps or missing outputs **Master Rule:** Skipping steps is FORBIDDEN. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-ci/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-ci/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-ci/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-ci/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-ci/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-ci/steps-v/step-01-validate.md index 93c9053..a17b8a0 100644 --- a/src/workflows/testarch/bmad-testarch-ci/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-ci/steps-v/step-01-validate.md @@ -79,3 +79,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-ci/workflow.md b/src/workflows/testarch/bmad-testarch-ci/workflow.md deleted file mode 100644 index be77a79..0000000 --- a/src/workflows/testarch/bmad-testarch-ci/workflow.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: bmad-testarch-ci -description: Scaffold CI/CD quality pipeline with test execution. Use when user says 'lets setup CI pipeline' or 'I want to create quality gates' -web_bundle: true ---- - -# CI/CD Pipeline Setup - -**Goal:** Scaffold CI/CD quality pipeline with test execution, burn-in loops, and artifact collection - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-preflight.md` -- **If R:** Load `{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` diff --git a/src/workflows/testarch/bmad-testarch-framework/SKILL.md b/src/workflows/testarch/bmad-testarch-framework/SKILL.md index a9051d2..062d381 100644 --- a/src/workflows/testarch/bmad-testarch-framework/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-framework/SKILL.md @@ -3,13 +3,83 @@ name: bmad-testarch-framework description: 'Initialize test framework with Playwright or Cypress. Use when the user says "lets setup test framework" or "I want to initialize testing framework"' --- +# Test Framework Setup + +**Goal:** Initialize a production-ready test framework architecture (Playwright or Cypress) with fixtures, helpers, and configuration. + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +- **If C:** Load `{skill-root}/steps-c/step-01-preflight.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` diff --git a/src/workflows/testarch/bmad-testarch-framework/customize.toml b/src/workflows/testarch/bmad-testarch-framework/customize.toml new file mode 100644 index 0000000..1e287b4 --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-framework/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-framework. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-framework/steps-c/step-05-validate-and-summary.md b/src/workflows/testarch/bmad-testarch-framework/steps-c/step-05-validate-and-summary.md index 885a4b0..5b9f08c 100644 --- a/src/workflows/testarch/bmad-testarch-framework/steps-c/step-05-validate-and-summary.md +++ b/src/workflows/testarch/bmad-testarch-framework/steps-c/step-05-validate-and-summary.md @@ -91,3 +91,11 @@ Report: - Skipped sequence steps or missing outputs **Master Rule:** Skipping steps is FORBIDDEN. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-framework/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-framework/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-framework/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-framework/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-framework/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-framework/steps-v/step-01-validate.md index a881a5b..9400ce1 100644 --- a/src/workflows/testarch/bmad-testarch-framework/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-framework/steps-v/step-01-validate.md @@ -65,3 +65,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-framework/workflow.md b/src/workflows/testarch/bmad-testarch-framework/workflow.md deleted file mode 100644 index c0ff3fb..0000000 --- a/src/workflows/testarch/bmad-testarch-framework/workflow.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: bmad-testarch-framework -description: Initialize test framework with Playwright or Cypress. Use when user says 'lets setup test framework' or 'I want to initialize testing framework' -web_bundle: true ---- - -# Test Framework Setup - -**Goal:** Initialize production-ready test framework architecture (Playwright or Cypress) with fixtures, helpers, and configuration - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-preflight.md` -- **If R:** Load `{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` diff --git a/src/workflows/testarch/bmad-testarch-nfr/SKILL.md b/src/workflows/testarch/bmad-testarch-nfr/SKILL.md index cc57069..e3cacec 100644 --- a/src/workflows/testarch/bmad-testarch-nfr/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-nfr/SKILL.md @@ -3,13 +3,83 @@ name: bmad-testarch-nfr description: 'Assess NFRs like performance security and reliability. Use when the user says "lets assess NFRs" or "I want to evaluate non-functional requirements"' --- +# Non-Functional Requirements Assessment + +**Goal:** Assess non-functional requirements (performance, security, reliability, maintainability) before release with evidence-based validation. + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +- **If C:** Load `{skill-root}/steps-c/step-01-load-context.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` diff --git a/src/workflows/testarch/bmad-testarch-nfr/customize.toml b/src/workflows/testarch/bmad-testarch-nfr/customize.toml new file mode 100644 index 0000000..66bab72 --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-nfr/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-nfr. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-nfr/steps-c/step-05-generate-report.md b/src/workflows/testarch/bmad-testarch-nfr/steps-c/step-05-generate-report.md index d8303ae..e541854 100644 --- a/src/workflows/testarch/bmad-testarch-nfr/steps-c/step-05-generate-report.md +++ b/src/workflows/testarch/bmad-testarch-nfr/steps-c/step-05-generate-report.md @@ -106,3 +106,11 @@ Report: - Skipped sequence steps or missing outputs **Master Rule:** Skipping steps is FORBIDDEN. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-nfr/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-nfr/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-nfr/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-nfr/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-nfr/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-nfr/steps-v/step-01-validate.md index e886c7c..2286c33 100644 --- a/src/workflows/testarch/bmad-testarch-nfr/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-nfr/steps-v/step-01-validate.md @@ -65,3 +65,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-nfr/workflow.md b/src/workflows/testarch/bmad-testarch-nfr/workflow.md deleted file mode 100644 index 61f1f3f..0000000 --- a/src/workflows/testarch/bmad-testarch-nfr/workflow.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: bmad-testarch-nfr -description: Assess NFRs like performance security and reliability. Use when user says 'lets assess NFRs' or 'I want to evaluate non-functional requirements' -web_bundle: true ---- - -# Non-Functional Requirements Assessment - -**Goal:** Assess non-functional requirements (performance, security, reliability, maintainability) before release with evidence-based validation - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-load-context.md` -- **If R:** Load `{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` diff --git a/src/workflows/testarch/bmad-testarch-test-design/SKILL.md b/src/workflows/testarch/bmad-testarch-test-design/SKILL.md index 6dd0c30..cfe6853 100644 --- a/src/workflows/testarch/bmad-testarch-test-design/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-test-design/SKILL.md @@ -3,13 +3,85 @@ name: bmad-testarch-test-design description: 'Create system-level or epic-level test plans. Use when the user says "lets design test plan" or "I want to create test strategy"' --- +# Test Design and Risk Assessment + +**Goal:** Produce an epic-level test plan grounded in risk and testability assessment. + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step + +- **If C:** Load `{skill-root}/steps-c/step-01-detect-mode.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +Resume mode reads explicit progress metadata from the progress file (`workflowStatus`, `nextStep`, `totalSteps`) and falls back to legacy `lastStep` data when needed. diff --git a/src/workflows/testarch/bmad-testarch-test-design/customize.toml b/src/workflows/testarch/bmad-testarch-test-design/customize.toml new file mode 100644 index 0000000..571c873 --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-test-design/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-test-design. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-test-design/steps-c/step-05-generate-output.md b/src/workflows/testarch/bmad-testarch-test-design/steps-c/step-05-generate-output.md index 2f7977f..a6a4205 100644 --- a/src/workflows/testarch/bmad-testarch-test-design/steps-c/step-05-generate-output.md +++ b/src/workflows/testarch/bmad-testarch-test-design/steps-c/step-05-generate-output.md @@ -226,3 +226,11 @@ Summarize: - Skipped sequence steps or missing outputs **Master Rule:** Skipping steps is FORBIDDEN. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-test-design/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-test-design/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-test-design/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-test-design/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-test-design/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-test-design/steps-v/step-01-validate.md index 454e8eb..846decc 100644 --- a/src/workflows/testarch/bmad-testarch-test-design/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-test-design/steps-v/step-01-validate.md @@ -65,3 +65,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-test-design/workflow.md b/src/workflows/testarch/bmad-testarch-test-design/workflow.md deleted file mode 100644 index 2620336..0000000 --- a/src/workflows/testarch/bmad-testarch-test-design/workflow.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: bmad-testarch-test-design -description: Create system-level or epic-level test plans. Use when user says 'lets design test plan' or 'I want to create test strategy' -web_bundle: true ---- - -# Test Design and Risk Assessment - -**Goal:** Epic-level test plan (Phase 4) - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-detect-mode.md` -- **If R:** Load `{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` - -Resume mode reads explicit progress metadata from the progress file (`workflowStatus`, `nextStep`, `totalSteps`) and falls back to legacy `lastStep` data when needed. diff --git a/src/workflows/testarch/bmad-testarch-test-review/SKILL.md b/src/workflows/testarch/bmad-testarch-test-review/SKILL.md index a0b7ff4..948bb66 100644 --- a/src/workflows/testarch/bmad-testarch-test-review/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-test-review/SKILL.md @@ -3,13 +3,83 @@ name: bmad-testarch-test-review description: 'Review test quality using best practices validation. Use when user says "lets review tests" or "I want to evaluate test quality"' --- +# Test Quality Review + +**Goal:** Review test quality using a comprehensive knowledge base and best-practices validation. + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +- **If C:** Load `{skill-root}/steps-c/step-01-load-context.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` diff --git a/src/workflows/testarch/bmad-testarch-test-review/customize.toml b/src/workflows/testarch/bmad-testarch-test-review/customize.toml new file mode 100644 index 0000000..ab9006f --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-test-review/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-test-review. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-04-generate-report.md b/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-04-generate-report.md index 10d7005..852e26d 100644 --- a/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-04-generate-report.md +++ b/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-04-generate-report.md @@ -109,3 +109,11 @@ Report: - Skipped sequence steps or missing outputs **Master Rule:** Skipping steps is FORBIDDEN. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-test-review/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-test-review/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-test-review/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-test-review/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-test-review/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-test-review/steps-v/step-01-validate.md index 990a158..d126373 100644 --- a/src/workflows/testarch/bmad-testarch-test-review/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-test-review/steps-v/step-01-validate.md @@ -65,3 +65,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-test-review/workflow.md b/src/workflows/testarch/bmad-testarch-test-review/workflow.md deleted file mode 100644 index bda8a0d..0000000 --- a/src/workflows/testarch/bmad-testarch-test-review/workflow.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: bmad-testarch-test-review -description: Review test quality using best practices validation. Use when user says 'lets review tests' or 'I want to evaluate test quality' -web_bundle: true ---- - -# Test Quality Review - -**Goal:** Review test quality using comprehensive knowledge base and best practices validation - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-load-context.md` -- **If R:** Load `{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` diff --git a/src/workflows/testarch/bmad-testarch-trace/SKILL.md b/src/workflows/testarch/bmad-testarch-trace/SKILL.md index 1230d20..9fdcec4 100644 --- a/src/workflows/testarch/bmad-testarch-trace/SKILL.md +++ b/src/workflows/testarch/bmad-testarch-trace/SKILL.md @@ -3,13 +3,85 @@ name: bmad-testarch-trace description: 'Generate traceability matrix and quality gate decision. Use when the user says "lets create traceability matrix" or "I want to analyze test coverage"' --- +# Coverage Traceability & Quality Gate + +**Goal:** Generate a requirements-or-journeys-to-tests traceability matrix, analyze coverage, and make a quality gate decision (PASS / CONCERNS / FAIL / WAIVED). + +**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. + ## Conventions -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. +- 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}`-prefixed paths resolve from the project working directory. +- `{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}`. ## On Activation -Read `{skill-root}/workflow.md` and follow it exactly. +### Step 1: Resolve the Workflow Block + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-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. + +### Step 2: Execute Prepend Steps + +Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding. + +### Step 3: Load Persistent Facts + +Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. 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. + +### Step 4: Load Config + +Load config from `{project-root}/_bmad/tea/config.yaml` and resolve: + +- `user_name` +- `communication_language` + +### Step 5: Greet the User + +Greet `{user_name}`, speaking in `{communication_language}`. + +### Step 6: Execute Append Steps + +Execute each entry in `{workflow.activation_steps_append}` in order. + +Activation is complete. Begin the workflow below. + +## Workflow Architecture + +This workflow uses **tri-modal step-file architecture**: + +- **Create mode (steps-c/)**: primary execution flow for new runs and resume continuation +- **Validate mode (steps-v/)**: validation against checklist +- **Edit mode (steps-e/)**: revise existing outputs + +## Initialization Sequence + +### 1. Mode Determination + +"Welcome to the workflow. What would you like to do?" + +- **[C] Create** — Run the workflow from the beginning +- **[R] Resume** — Resume an interrupted Create workflow +- **[V] Validate** — Validate existing outputs +- **[E] Edit** — Edit existing outputs + +### 2. Route to First Step + +- **If C:** Load `{skill-root}/steps-c/step-01-load-context.md` +- **If R:** Load `{skill-root}/steps-c/step-01b-resume.md` (Create-mode continuation) +- **If V:** Load `{skill-root}/steps-v/step-01-validate.md` +- **If E:** Load `{skill-root}/steps-e/step-01-assess.md` -When `workflow.md`, step files, templates, or checklists reference sibling files with relative paths such as `steps-c/...`, `./instructions.md`, or `templates/...`, resolve them from `{skill-root}`, not from the workspace root. +Create mode resolves the coverage oracle automatically in this order: formal requirements, contract/spec artifacts, resolvable external pointers (when `allow_external_pointer_resolution` is enabled), then synthetic journeys/requirements inferred from source (when `allow_synthetic_oracle` is enabled and no formal oracle exists). diff --git a/src/workflows/testarch/bmad-testarch-trace/customize.toml b/src/workflows/testarch/bmad-testarch-trace/customize.toml new file mode 100644 index 0000000..6e5236e --- /dev/null +++ b/src/workflows/testarch/bmad-testarch-trace/customize.toml @@ -0,0 +1,40 @@ +# DO NOT EDIT -- overwritten on every update. +# +# Workflow customization surface for bmad-testarch-trace. Mirrors the +# agent customization shape under the [workflow] namespace. + +[workflow] + +# --- Configurable below. Overrides merge per BMad structural rules: --- +# scalars: override wins • arrays (persistent_facts, activation_steps_*): append + +# Steps to run before the standard activation (config load, greet). +# Overrides append. Use for pre-flight loads, compliance checks, etc. + +activation_steps_prepend = [] + +# Steps to run after greet but before the workflow begins. +# Overrides append. Use for context-heavy setup that should happen +# once the user has been acknowledged. + +activation_steps_append = [] + +# Persistent facts the workflow keeps in mind for the whole run +# (testing standards, framework conventions, compliance constraints). +# Distinct from the runtime memory sidecar — these are static context +# loaded on activation. Overrides append. +# +# Each entry is either: +# - a literal sentence, e.g. "Every test must run deterministically in CI." +# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/test-standards.md" +# (glob patterns are supported; matching files load in lexical path order as facts). + +persistent_facts = [ + "file:{project-root}/**/project-context.md", +] + +# Scalar: executed when the workflow reaches its terminal step in any +# mode (create, validate, edit), after the final outputs are produced. +# Override wins. Leave empty for no custom post-completion behavior. + +on_complete = "" diff --git a/src/workflows/testarch/bmad-testarch-trace/steps-c/step-05-gate-decision.md b/src/workflows/testarch/bmad-testarch-trace/steps-c/step-05-gate-decision.md index 3269da6..f22ad56 100644 --- a/src/workflows/testarch/bmad-testarch-trace/steps-c/step-05-gate-decision.md +++ b/src/workflows/testarch/bmad-testarch-trace/steps-c/step-05-gate-decision.md @@ -671,3 +671,11 @@ Then append the gate decision summary (from section 5 above) to the end of the e - Report missing or incomplete **Master Rule:** Gate decision MUST be deterministic based on clear criteria (P0 100%, P1 90/80, overall >=80) whenever `allow_gate` is true and `collection_status` is `COLLECTED`. `e2e-trace-summary.json` MUST be written before the workflow terminates. + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-trace/steps-e/step-02-apply-edit.md b/src/workflows/testarch/bmad-testarch-trace/steps-e/step-02-apply-edit.md index 77f808f..c096095 100644 --- a/src/workflows/testarch/bmad-testarch-trace/steps-e/step-02-apply-edit.md +++ b/src/workflows/testarch/bmad-testarch-trace/steps-e/step-02-apply-edit.md @@ -58,3 +58,11 @@ Summarize the edits applied. ### ❌ SYSTEM FAILURE: - Unconfirmed edits or missing update + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-trace/steps-v/step-01-validate.md b/src/workflows/testarch/bmad-testarch-trace/steps-v/step-01-validate.md index 125ae0b..f6b29a1 100644 --- a/src/workflows/testarch/bmad-testarch-trace/steps-v/step-01-validate.md +++ b/src/workflows/testarch/bmad-testarch-trace/steps-v/step-01-validate.md @@ -65,3 +65,11 @@ Write a validation report to `{outputFile}` with PASS/WARN/FAIL per section. - Skipped checklist items - No report produced + +## On Complete + +Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete` + +If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting. + +If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally. diff --git a/src/workflows/testarch/bmad-testarch-trace/workflow.md b/src/workflows/testarch/bmad-testarch-trace/workflow.md deleted file mode 100644 index acce71f..0000000 --- a/src/workflows/testarch/bmad-testarch-trace/workflow.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: bmad-testarch-trace -description: Generate traceability matrix and quality gate decision. Use when user says 'lets create traceability matrix' or 'I want to analyze test coverage' -web_bundle: true ---- - -# Coverage Traceability & Quality Gate - -**Goal:** Generate a requirements-or-journeys-to-tests traceability matrix, analyze coverage, and make quality gate decision (PASS/CONCERNS/FAIL/WAIVED) - -**Role:** You are the Master Test Architect. - ---- - -## PATH RESOLUTION - -- `{skill-root}` resolves to this workflow skill's installed directory. -- `{project-root}` resolves to the repository working directory. -- Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root. - ---- - -## WORKFLOW ARCHITECTURE - -This workflow uses **tri-modal step-file architecture**: - -- **Create mode (steps-c/)**: primary execution flow -- **Validate mode (steps-v/)**: validation against checklist -- **Edit mode (steps-e/)**: revise existing outputs - ---- - -## INITIALIZATION SEQUENCE - -### 1. Mode Determination - -"Welcome to the workflow. What would you like to do?" - -- **[C] Create** — Run the workflow -- **[R] Resume** — Resume an interrupted workflow -- **[V] Validate** — Validate existing outputs -- **[E] Edit** — Edit existing outputs - -### 2. Route to First Step - -- **If C:** Load `{skill-root}/steps-c/step-01-load-context.md` -- **If R:** Load `{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` - -Create mode resolves the coverage oracle automatically in this order: formal requirements, contract/spec artifacts, resolvable external pointers (when `allow_external_pointer_resolution` is enabled), then synthetic journeys/requirements inferred from source (when `allow_synthetic_oracle` is enabled and no formal oracle exists). diff --git a/test/test-installation-components.js b/test/test-installation-components.js index 680ffde..503dacc 100644 --- a/test/test-installation-components.js +++ b/test/test-installation-components.js @@ -240,48 +240,42 @@ async function runTests() { // ============================================================ console.log(`${colors.yellow}Test Suite 4: Workflow Structure${colors.reset}\n`); - const teachMeWorkflowPath = path.join(projectRoot, 'src/workflows/testarch/bmad-teach-me-testing/workflow.md'); - try { - if (await pathExists(teachMeWorkflowPath)) { - const teachMeContent = await fs.readFile(teachMeWorkflowPath, 'utf8'); - assert(teachMeContent.length > 0, 'bmad-teach-me-testing/workflow.md exists'); - assert(!teachMeContent.includes('_bmad/bmm/'), 'bmad-teach-me-testing has no _bmad/bmm/ references'); - } else { - assert(false, 'bmad-teach-me-testing workflow exists', 'src/workflows/testarch/bmad-teach-me-testing/workflow.md not found'); - } - } catch (error) { - assert(false, 'teach-me-testing workflow validates', error.message); - } - - const workflowDirs = { - 'bmad-testarch-framework': 'framework', - 'bmad-testarch-ci': 'ci', - 'bmad-testarch-test-design': 'test-design', - 'bmad-testarch-atdd': 'atdd', - 'bmad-testarch-automate': 'automate', - 'bmad-testarch-test-review': 'test-review', - 'bmad-testarch-nfr': 'nfr-assess', - 'bmad-testarch-trace': 'trace', - }; - - for (const [dirName, displayName] of Object.entries(workflowDirs)) { + const workflowDirs = [ + 'bmad-teach-me-testing', + 'bmad-testarch-framework', + 'bmad-testarch-ci', + 'bmad-testarch-test-design', + 'bmad-testarch-atdd', + 'bmad-testarch-automate', + 'bmad-testarch-test-review', + 'bmad-testarch-nfr', + 'bmad-testarch-trace', + ]; + + for (const dirName of workflowDirs) { const skillMdPath = path.join(projectRoot, `src/workflows/testarch/${dirName}/SKILL.md`); - const workflowMdPath = path.join(projectRoot, `src/workflows/testarch/${dirName}/workflow.md`); + const customizeTomlPath = path.join(projectRoot, `src/workflows/testarch/${dirName}/customize.toml`); const workflowYamlPath = path.join(projectRoot, `src/workflows/testarch/${dirName}/workflow.yaml`); const instructionsMdPath = path.join(projectRoot, `src/workflows/testarch/${dirName}/instructions.md`); if (await pathExists(skillMdPath)) { try { const skillContent = await fs.readFile(skillMdPath, 'utf8'); + assert(skillContent && skillContent.trim().length > 0, `${dirName}/SKILL.md is not empty`); assert(skillContent.includes('## On Activation'), `${dirName}/SKILL.md has On Activation section`); assert( - skillContent.includes('Read `{skill-root}/workflow.md` and follow it exactly.'), - `${dirName}/SKILL.md loads workflow.md from {skill-root}`, + skillContent.includes('resolve_customization.py --skill {skill-root} --key workflow'), + `${dirName}/SKILL.md resolves the workflow customization block`, ); + assert(skillContent.includes('{workflow.activation_steps_prepend}'), `${dirName}/SKILL.md executes prepend activation steps`); + assert(skillContent.includes('{workflow.activation_steps_append}'), `${dirName}/SKILL.md executes append activation steps`); + assert(skillContent.includes('{workflow.persistent_facts}'), `${dirName}/SKILL.md loads persistent facts`); assert( - skillContent.includes('resolve them from `{skill-root}`, not from the workspace root'), - `${dirName}/SKILL.md explains workspace-root-safe relative path resolution`, + skillContent.includes('Resolve sibling workflow files such as `instructions.md`'), + `${dirName}/SKILL.md explains sibling workflow path resolution`, ); + assert(/\{skill-root\}\/steps-[cev]\//.test(skillContent), `${dirName}/SKILL.md routes first step from {skill-root}`); + assert(!skillContent.includes('Read `{skill-root}/workflow.md`'), `${dirName}/SKILL.md no longer redirects to workflow.md`); assert(!skillContent.includes('[workflow.md](workflow.md)'), `${dirName}/SKILL.md no longer uses a bare relative workflow link`); } catch (error) { assert(false, `${dirName}/SKILL.md validates`, error.message); @@ -290,24 +284,29 @@ async function runTests() { assert(false, `${dirName}/SKILL.md exists`, `src/workflows/testarch/${dirName}/SKILL.md not found`); } - if (await pathExists(workflowMdPath)) { + if (await pathExists(customizeTomlPath)) { try { - const workflowContent = await fs.readFile(workflowMdPath, 'utf8'); - assert(workflowContent.includes('## PATH RESOLUTION'), `${dirName}/workflow.md documents path resolution`); + const customizeContent = await fs.readFile(customizeTomlPath, 'utf8'); + assert(customizeContent.includes('[workflow]'), `${dirName}/customize.toml has [workflow] section`); + assert(customizeContent.includes('activation_steps_prepend'), `${dirName}/customize.toml defines activation_steps_prepend`); + assert(customizeContent.includes('activation_steps_append'), `${dirName}/customize.toml defines activation_steps_append`); + assert(customizeContent.includes('persistent_facts'), `${dirName}/customize.toml defines persistent_facts`); + assert(customizeContent.includes('on_complete'), `${dirName}/customize.toml defines on_complete`); assert( - workflowContent.includes( - 'Resolve sibling workflow files such as `instructions.md`, `checklist.md`, `steps-c/...`, `steps-e/...`, `steps-v/...`, and templates from `{skill-root}`, not from the workspace root.', - ), - `${dirName}/workflow.md explains sibling workflow path resolution`, + customizeContent.includes('file:{project-root}/**/project-context.md'), + `${dirName}/customize.toml loads project-context.md as a persistent fact`, ); - assert(/\{skill-root\}\/steps-[cev]\//.test(workflowContent), `${dirName}/workflow.md routes first step from {skill-root}`); } catch (error) { - assert(false, `${dirName}/workflow.md validates`, error.message); + assert(false, `${dirName}/customize.toml validates`, error.message); } } else { - assert(false, `${dirName}/workflow.md exists`, `src/workflows/testarch/${dirName}/workflow.md not found`); + assert(false, `${dirName}/customize.toml exists`, `src/workflows/testarch/${dirName}/customize.toml not found`); } + // workflow.md was folded into SKILL.md and removed (PR: workflow customization rollout). + const legacyWorkflowMdPath = path.join(projectRoot, `src/workflows/testarch/${dirName}/workflow.md`); + assert(!(await pathExists(legacyWorkflowMdPath)), `${dirName}/workflow.md is removed (content lives in SKILL.md)`); + if (await pathExists(workflowYamlPath)) { try { const workflowYaml = yaml.load(await fs.readFile(workflowYamlPath, 'utf8'));