[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C43KEKJ9EK1PPM82TQRQSB":3,"skill-same:01M6C43KEKJ9EK1PPM82TQRQSB":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M6C43KEKJ9EK1PPM82TQRQSB","bdd-scenarios",null,"Structured Given\u002FWhen\u002FThen scenario authoring with ID traceability and CE Gate coverage gap detection. Use when writing or reviewing BDD scenarios in Agent Orchestra, classifying scenarios as [auto]\u002F[manual], managing scenario ID lifecycle, extracting scenario IDs for CE Gate pre-flight, generating Gherkin .feature files and step definitions for [auto] scenarios (Phase 2), or configuring framework runner dispatch for CE Gate (Phase 2). DO NOT USE FOR: general test strategy (use test-driven-development), or writing example-based unit tests.","Grimblaz\u002Fagent-orchestra","Grimblaz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F74755849?v=4","01M6C430M9XZDHGHPWQVTQ3KMA","01M6C430RJY3MMX0QAZ3X8DR3Y",3,"MIT","https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fbdd-scenarios\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"bdd","bdd scenarios","writing","test","unit tests","development","framework","ids","detection","lifecycle","strategy","coverage","use","auto","example","dispatch","2026-11-10 10:12:30",false,"---\nname: bdd-scenarios\ndescription: \"Structured Given\u002FWhen\u002FThen scenario authoring with ID traceability and CE Gate coverage gap detection. Use when writing or reviewing BDD scenarios in Agent Orchestra, classifying scenarios as [auto]\u002F[manual], managing scenario ID lifecycle, extracting scenario IDs for CE Gate pre-flight, generating Gherkin .feature files and step definitions for [auto] scenarios (Phase 2), or configuring framework runner dispatch for CE Gate (Phase 2). DO NOT USE FOR: general test strategy (use test-driven-development), or writing example-based unit tests.\"\n---\n\n# BDD Scenarios\n\nStructured Given\u002FWhen\u002FThen scenario authoring with ID traceability and CE Gate coverage gap detection for Agent Orchestra.\n\n## When to Use\n\n- Writing G\u002FW\u002FT scenarios in GitHub issues (Experience-Owner upstream framing)\n- Classifying scenarios as [auto] or [manual] (Issue-Planner)\n- Verifying scenario ID coverage at CE Gate (Code-Conductor pre-flight)\n- Per-scenario evaluation in adversarial CE prosecution (Code-Critic)\n- Reviewing scenario authoring and classification quality\n\n## G\u002FW\u002FT Authoring Patterns\n\n- Scenarios use numbered IDs: S1, S2, S3…\n- Heading convention: `### S{N} — {title} (Type)` where Type is Functional or Intent; emit concrete numbered IDs such as `### S1` and `### S2`, never literal `SN`\n- G\u002FW\u002FT clauses in customer language — see **Declarative-over-Imperative** below for details\n- Example template:\n\n  ```markdown\n  ### S1 — User completes onboarding (Functional)\n\n  Given a new user has opened the application for the first time\n  When they follow the onboarding prompts\n  Then they reach the home screen with personalized content\n  ```\n\n- Multiple Given or Then clauses allowed; And\u002FBut connectors supported for readability\n- Each scenario must be independently understandable\n\n### Declarative-over-Imperative\n\nStep text should describe _what the user intends_ (outcome or state change), not _how they interact with UI_ (action sequence). Declarative scenarios are more maintainable (survive UI redesigns), more reusable (same step across features), and decoupled from implementation (step definitions don't break when selectors change).\n\n| Imperative (avoid)                                        | Declarative (preferred)                                        |\n| --------------------------------------------------------- | -------------------------------------------------------------- |\n| `When I click the 'Sign in with Google' button`           | `When I choose to connect my Google account`                   |\n| `When the mock auth adapter returns a successful sign-in` | `Given a successful sign-in will occur for 'user@example.com'` |\n| `When I navigate to '\u002Fquests'`                            | `When I visit the quests area`                                 |\n| `Then I should see a 'Sign in with Google' button`        | `Then I see an option to connect my Google account`            |\n| `Then I should see a green checkmark icon`                | `Then the action is confirmed`                                 |\n\nThis rule narrows the broader \"no implementation details\" principle (see **Gotchas** below) to two actionable categories: imperative UI-interaction verbs and test-infrastructure leakage (adapter names, mock behavior, internal paths).\n\n**Validation scan** — when reviewing scenarios, flag any of these as signals to review (not automatic rejections — common English words like \"type\" or \"press\" may appear in legitimate customer-language scenarios; evaluate in context):\n\n- **Imperative verbs**: `click`, `navigate`, `tap`, `type`, `scroll`, `press`, `wait`\n- **Implementation nouns**: `mock`, `adapter`, `stub`, `spy`, `fixture`, path strings (e.g., `\u002Fquests`, `#submit-btn`, `.settings.json` — any string that reveals URL structure, CSS selectors, or file system paths)\n\nThis scan is especially important before Phase 2 Gherkin conversion — imperative step text produces unmaintainable step definitions.\n\n## Scenario Type Tags\n\n- **Functional**: Observable system behavior with clear pass\u002Ffail threshold. Use when the expected outcome is unambiguous and measurable.\n- **Intent**: User-experience quality or design intent. Use when the outcome requires judgment (e.g., \"feel\", \"clarity\", \"discoverability\").\n- Tag appears in the heading: `(Functional)` or `(Intent)`.\n\n## Classification Rubric ([auto]\u002F[manual])\n\nBDD classification performed by Issue-Planner when BDD is enabled:\n\n| Condition                                           | Classification        |\n| --------------------------------------------------- | --------------------- |\n| Functional + fully observable (grep\u002Fcode assertion) | `[auto]`              |\n| Intent + subjective judgment required               | `[manual]`            |\n| Functional but requires UI interaction              | `[manual]` (override) |\n| Any scenario requiring human judgment in CE Gate    | `[manual]` (override) |\n\nOverride rule: when in doubt, classify as `[manual]`. Test-Writer may reclassify `[auto]`↔`[manual]` during implementation; note the change in the plan and CE Gate evidence.\n\n## Service Dependency Annotations\n\nScenarios that require external services (auth emulators, backend APIs, databases) declare dependencies via `[requires: service-name:port]` annotations on the scenario heading, after the type tag:\n\n```markdown\n### S1 — User completes sign-in (Functional) [requires: firebase-emulator:9099]\n\n### S4 — OAuth flow with provider (Functional) [requires: auth-service:8080] [requires: api-gateway:3000]\n```\n\n- **Format**: `[requires: service-name:port]` — service-name is a human-readable label; port is the TCP port number\n- **Multiple services**: Use separate `[requires:]` annotations per dependency (AND semantics — all must be available)\n- **Extraction regex**: `\\[requires:\\s*([^:\\]]+):(\\d+)\\]` — captures service name (group 1) and port (group 2)\n- **CE Gate behavior**: Code-Conductor extracts annotations before delegation, checks each port via `check-port.ps1`, and marks scenarios with unavailable services as `INCONCLUSIVE (required service unavailable: service-name:port)` — excluding them from runner dispatch and Experience-Owner delegation. Fail-open: if `check-port.ps1` is unavailable or fails, all scenarios proceed normally.\n\n## Scenario ID Lifecycle\n\n- IDs are **immutable after plan approval** — once S1, S2, S3 are assigned in the issue body and the plan is approved, those IDs do not change.\n- If a scenario is split during implementation, the original ID remains; new sub-scenarios get the next sequential IDs (e.g., S1 stays S1; new scenario becomes S5).\n- IDs are **never reused** — when a scenario is **removed**, its ID is retired, not reassigned (the numbered `### S{N}` heading is preserved with `[REMOVED]` as the title — see ID Extraction Format below).\n- **Authority: the issue body is the authoritative source for scenario IDs**. The plan cites them; it does not define them. Post-approval additions to the issue body require a plan amendment.\n\n## ID Extraction Format\n\nWhen reading scenario IDs from an issue body:\n\n- Match the pattern `### S\\d+` headings within the `## Scenarios` section. Scope the extraction to content between the `## Scenarios` heading and the next H2 heading (`##`), or end-of-file if no subsequent H2 heading exists — do not match `### S\\d+` patterns outside this boundary.\n- Extract the full heading: `### S{N} — {title} (Type)` where `S{N}` is a concrete numbered ID such as `S1`\n- IDs are ordinal integers starting at 1; there must be **no gaps** in the sequence.\n- When a scenario is retired, keep its numbered `### S{N}` heading and replace the title with `[REMOVED]` (e.g., `### S2 — [REMOVED] (manual)`) instead of deleting the heading; this preserves the immutable ID space and allows extraction regex to still match retired-but-preserved headings.\n- For CE Gate pre-flight, extract all IDs present at plan-approval time and verify each appears in Experience-Owner's evidence summary\n\n## BDD Detection Mechanism\n\n### Source files and precedence\n\nBDD configuration is discovered by scanning these three files in priority order:\n\n```text\nAGENTS.md  ›  CLAUDE.md  ›  copilot-instructions.md\n```\n\nThe detector reads each file in this order and takes the **first file that contains a valid `## BDD Framework` heading at column 0** (a real level-2 Markdown heading, not a backticked mention or mid-line reference). This file becomes the **winning file** for the current detection pass. A higher-precedence file that lacks the heading is **skipped**, not treated as a disabling signal — detection continues to the next candidate. If no candidate file contains the heading, the result is the silent natural-language fallback (see **Silent fallback** below).\n\n**Precedence is BDD-config discovery order only.** This ordering does NOT modify or contradict instruction-merge precedence as documented in `skills\u002Fai-first-documentation\u002Frubric.md` E7. These are independent axes: E7 governs which instruction layers apply to agents; this section governs where BDD configuration lives. Do not conflate them. Note the orderings appear inverted (E7: `copilot-instructions.md` highest; BDD discovery: `AGENTS.md` first) — this is not a conflict: E7 answers _which instruction layer applies_, while BDD discovery answers _which file holds the opt-in config_; the two axes answer different questions.\n\n**Widened enablement surface (AC8)**: A bare `## BDD Framework` heading in `AGENTS.md` or `CLAUDE.md` enables Phase 1 BDD for any repo that uses those files as its primary instruction source. Repos that previously relied on `copilot-instructions.md` continue to work — the file is still the third candidate. Maintainers adding BDD to a repo via `AGENTS.md` or `CLAUDE.md` should be aware that a bare heading without a `bdd: {framework}` line activates Phase 1 only; Phase 2 requires both (see **Phase 2 Detection** below).\n\n### Discriminator\n\nFor each candidate file (in `AGENTS.md › CLAUDE.md › copilot-instructions.md` order), the detector checks:\n\n```bash\ngrep -nE '^## BDD Framework' \u003Ccandidate-file>\n```\n\nReturns at least one line → heading found; this file wins. The anchored `^` ensures only a true column-0 heading matches. A backticked mention such as `\\`## BDD Framework\\`` in a bullet point does NOT match. The naïve `grep -c \"## BDD Framework\"` returns false positives on prose descriptions; use the anchored grep.\n\nThe heading must appear at column 0 with no leading whitespace — CommonMark allows 1–3 spaces before an ATX heading, but the detector requires zero; an indented `## BDD Framework` will not be detected and silently advances to the next candidate file.\n\nIf a file contains more than one `## BDD Framework` heading, the **first** heading governs — subsequent headings in the same file are ignored.\n\n### Same-file `bdd:` read (Phase 2)\n\nWhen a winning file is found, Phase 2 dispatch reads `bdd: {framework}` from **that same winning file** — not from a hardcoded `copilot-instructions.md`. If the winning file is `AGENTS.md`, the `bdd:` line is expected under the `## BDD Framework` heading in `AGENTS.md`. See **Phase 2 Detection** below for the full two-condition check.\n\nScope the `bdd:` read to lines between the winning `## BDD Framework` heading and the next column-0 `##` heading (H2 boundary) — or end-of-file if no subsequent column-0 `##` heading exists — mirroring the `## Scenarios` extraction boundary.\n\nThe heading and `bdd:` line must be in the **same** winning file. A `bdd:` line in any lower-precedence file is never read — if the winning file has the heading but no `bdd:` line, the repo is Phase 1 only.\n\n### Silent fallback\n\nIf no candidate file contains a valid column-0 `## BDD Framework` heading, BDD is inactive. No error is emitted. Agents use the natural-language \u002F prose fallback silently. This is detect-only behavior — the absence of BDD config is never surfaced as a warning.\n\nA candidate file that cannot be read (absent, unreadable, or not a regular text file) is treated identically to a file lacking the heading — skipped, detection advances to the next candidate (fail-open).\n\n## Gotchas\n\n- **S-IDs vs Specification's AC-NNN format**: This skill uses S-IDs (S1, S2, S3) for CE Gate scenarios. Specification agent uses `AC-NNN` for acceptance criteria. These are different namespaces — do not mix them or treat AC-NNN as a scenario ID.\n- **Customer language principle**: G\u002FW\u002FT keywords are structural framing only. The clause content must be in customer terms — no method names, no file paths, no agent names, no implementation details. \"When the system calls ExperienceOwner.FrameScenarios()\" is wrong; \"When the team begins feature planning\" is correct. See also: **Declarative-over-Imperative** above for specific anti-patterns, preferred alternatives, and a validation scan. This gotcha states the broad principle (no implementation details); the subsection above provides actionable examples covering imperative UI verbs and test-infrastructure leakage.\n- **BDD detection gating**: All BDD-specific behavior (G\u002FW\u002FT authoring, classification, pre-flight, per-scenario prosecution) is conditional on a `## BDD Framework` **line-start heading** (column 0) being found in one of the candidate files (`AGENTS.md › CLAUDE.md › copilot-instructions.md`). Repos where no candidate file contains this heading keep the existing natural-language workflow unchanged — do not apply rubric, IDs, or pre-flight to natural-language scenarios. See **BDD Detection Mechanism** above for the full file-list and precedence rule.\n- **Issue-body source of truth**: The `## Scenarios` section in the GitHub issue body is the authoritative store for scenario IDs. Any abbreviated or derived authoring path (e.g., generating scenarios only in the plan's `[CE GATE]` step) **must** also write the full scenarios back into the issue body using the GitHub issue update tool — Code-Conductor's CE Gate pre-flight reads from the issue body and will treat missing issue-body scenarios as coverage gaps.\n- **Phase 2 scope boundary**: Phase 2 (Gherkin conversion + framework runner integration) is documented in the `## Phase 2: Gherkin Conversion & Framework Runner` section below. Phase 1 content (authoring, traceability, coverage detection) is unchanged.\n\n## Phase 2: Gherkin Conversion & Framework Runner\n\nPhase 2 extends Phase 1 by converting `[auto]` scenarios into runnable `.feature` files and dispatching the consumer's BDD framework runner at CE Gate validation.\n\n## Test-Writer Phase 2 Generation\n\nWhen Test-Writer is active and Phase 2 is enabled, use this skill as the authority for:\n\n- activation checks\n- `[auto]` versus `[manual]` generation scope\n- output directory selection\n- `.feature` file naming\n- stub idempotency\n- warning behavior for `bdd: true` and unrecognized frameworks\n\nKeep the Test-Writer agent body thin by pointing here instead of restating the full Phase 2 procedure.\n\n### Phase 2 Detection\n\nPhase 2 is active when **both** conditions are met in the **winning file** (the first of `AGENTS.md`, `CLAUDE.md`, `copilot-instructions.md` that contains a valid column-0 `## BDD Framework` heading — see **BDD Detection Mechanism** above):\n\n1. `## BDD Framework` **line-start heading** at column 0 is present **in the winning file** (Phase 1 condition; a mid-line mention does not qualify)\n2. A `bdd: {framework}` config line is present in that **same winning file** with a recognized framework name\n\n**Known migration case — `bdd: true`**: If a consumer repo was set up under Phase 1 only and still has `bdd: true` in a comment, emit a warning: _\"bdd: true detected — Phase 2 requires a recognized framework name. Set `bdd: {framework}` with one of: cucumber.js, behave, jest-cucumber, cucumber. Falling back to Phase 1 behavior.\"_ Then fall back to Phase 1.\n\n**Unrecognized framework name**: If a `bdd: {framework}` line is present but the value is not in the mapping table, emit a warning: _\"Unrecognized framework '{value}'. Recognized values: cucumber.js, behave, jest-cucumber, cucumber. Falling back to Phase 1 behavior.\"_ Then fall back to Phase 1.\n\n**Phase-1-only repos** (**line-start heading** (column 0) present in the winning file, no `bdd:` line in that file): Phase 2 detection requires BOTH conditions. A repo whose winning file has only the `## BDD Framework` line-start heading is Phase 1 only — behavior is unchanged.\n\n### Framework Mapping Table\n\n| Framework               | Tag Format | Default Output Dir             | Runner Command Template                       | Version Check Command       |\n| ----------------------- | ---------- | ------------------------------ | --------------------------------------------- | --------------------------- |\n| cucumber.js             | `@S{N}`    | `features\u002F`                    | `npx cucumber-js --tags @S{N}`                | `npx cucumber-js --version` |\n| behave                  | `@S{N}`    | `features\u002F`                    | `behave --tags @S{N}`                         | `behave --version`          |\n| jest-cucumber           | `@S{N}`    | `features\u002F`                    | `npx jest --testPathPattern features`         | `npx jest --version`        |\n| cucumber (JVM Cucumber) | `@S{N}`    | `src\u002Ftest\u002Fresources\u002Ffeatures\u002F` | `.\u002Fgradlew test -Dcucumber.filter.tags=@S{N}` | `.\u002Fgradlew --version`       |\n\n> **jest-cucumber limitation**: jest-cucumber does not support per-scenario Gherkin tag filtering via CLI. Runner dispatch for jest-cucumber runs the entire `features\u002F` directory as one suite. All `[auto]` scenarios receive the same evidence record (suite-level pass\u002Ffail rather than per-scenario). Conflict detection (`source: runner+eo, result: conflict`) is still reachable: if the suite fails and EO passes during the delegated re-exercise, the conflict is recorded at suite granularity (all `[auto]` scenarios may resolve to conflict). Per-scenario runner granularity is what is not available — the suite-level result applies uniformly to all `[auto]` scenarios.\n> **cucumber (JVM Cucumber) note**: Runner commands assume Gradle (`.\u002Fgradlew`). Maven-based projects will fail the pre-check and fall back to Phase 1 (EO exercises all scenarios). No runner dispatch occurs for Maven+Cucumber consumers.\n\n### Gherkin Conversion Rules\n\nFor each `[auto]` scenario in the issue's `## Scenarios` section:\n\n- Include a `Feature: Issue #{N} — {issue-title}` declaration at the top of every `.feature` file (required by all four supported parsers).\n- Add `@S{N}` tag directly above the `Scenario:` line\n- Map the scenario heading to `Scenario: {title}` (strip the `### S{N} —` prefix and type tag)\n- Map G\u002FW\u002FT clauses to Gherkin `Given`\u002F`When`\u002F`Then` keywords (1:1 mapping)\n- `And`\u002F`But` connectors preserved as-is\n\n**File layout**: One `.feature` file per issue (all `[auto]` scenarios in one file). File naming: `S{first}-S{last}-{issue-slug}.feature` (e.g., `S1-S3-task-manager-api-onboarding.feature`). Derive `{issue-slug}` from the issue title by: lowercasing, replacing spaces and non-alphanumeric characters with hyphens, collapsing consecutive hyphens, and truncating to 40 characters. Place in the framework-default output directory from the mapping table.\n\n**Example output**:\n\n```gherkin\nFeature: Issue #42 — Task Manager API Onboarding\n\n@S1\nScenario: User completes onboarding\n  Given a new user has opened the application for the first time\n  When they follow the onboarding prompts\n  Then they reach the home screen with personalized content\n```\n\n**`[manual]` exclusion**: Do NOT generate `.feature` files for `[manual]` scenarios — they are exercised by Experience-Owner only.\n\n### Step Definition Stubs\n\nGenerate step definition stubs alongside the `.feature` file **only if the stub file does not already exist**. On subsequent pipeline runs (e.g., when a new scenario is added), stubs are NOT regenerated — only the `.feature` file is regenerated. The consumer's assertion logic in existing stubs is preserved. Stubs link each `Then` clause to the scenario's Intent.\n\n**cucumber.js** (JavaScript\u002FTypeScript):\n\n```javascript\nconst { Given, When, Then } = require(\"@cucumber\u002Fcucumber\");\n\n\u002F\u002F S1 — User completes onboarding\nGiven(\n  \"a new user has opened the application for the first time\",\n  async function () {\n    \u002F\u002F TODO: implement setup\n    return \"pending\";\n  },\n);\nWhen(\"they follow the onboarding prompts\", async function () {\n  \u002F\u002F TODO: implement action\n  return \"pending\";\n});\nThen(\"they reach the home screen with personalized content\", async function () {\n  \u002F\u002F TODO: implement assertion — Intent: verify onboarding completion\n  return \"pending\";\n});\n```\n\n**behave** (Python):\n\n```python\nfrom behave import given, when, then\n\n# S1 — User completes onboarding\n@given('a new user has opened the application for the first time')\ndef step_impl(context):\n    pass  # TODO: implement setup\n\n@when('they follow the onboarding prompts')\ndef step_impl(context):\n    pass  # TODO: implement action\n\n@then('they reach the home screen with personalized content')\ndef step_impl(context):\n    pass  # TODO: implement assertion — Intent: verify onboarding completion\n```\n\n**jest-cucumber**: Use `loadFeature` + `defineFeature` pattern with steps mapped to `@S{N}` scenario.\n\n**cucumber (JVM Cucumber)** (Java):\n\n```java\nimport io.cucumber.java.en.Given;\nimport io.cucumber.java.en.When;\nimport io.cucumber.java.en.Then;\n\npublic class StepDefinitions {\n\n    \u002F\u002F S1 — User completes onboarding\n    @Given(\"a new user has opened the application for the first time\")\n    public void givenNewUserOpened() {\n        throw new io.cucumber.java.PendingException(); \u002F\u002F TODO: implement setup\n    }\n\n    @When(\"they follow the onboarding prompts\")\n    public void whenTheyFollowPrompts() {\n        throw new io.cucumber.java.PendingException(); \u002F\u002F TODO: implement action\n    }\n\n    @Then(\"they reach the home screen with personalized content\")\n    public void thenTheyReachHomeScreen() {\n        throw new io.cucumber.java.PendingException(); \u002F\u002F TODO: implement assertion — Intent: verify onboarding completion\n    }\n}\n```\n\n### Runner Dispatch Protocol\n\nCode-Conductor dispatches the framework runner at CE Gate. Process:\n\n1. **Pre-check**: Run version check command from mapping table. Non-zero exit → log warning, fall back to Phase 1 (EO exercises all scenarios).\n2. **Per-scenario dispatch**: For each `[auto]` scenario, run the runner command with `@S{N}` tag filtering. Capture exit code + stdout + stderr.\n3. **Evidence capture**: Record as a unified evidence record per scenario.\n4. **Conditional EO delegation**: Runner passed all `[auto]` → send only `[manual]` to EO. Some `[auto]` failed → add failed `[auto]` to EO list. Pre-check failed → send all to EO.\n5. **Evidence merge**: Combine runner evidence (for `[auto]`) with EO evidence (for `[manual]`) into the unified evidence record.\n\n> **Note on pending stubs**: Step definition stubs are generated as pending (e.g., `return 'pending'` in cucumber.js). **The consumer must implement the step definitions before runner dispatch produces per-scenario evidence at CE Gate time.** On the first CE Gate run after stub generation (before stubs are implemented), all `[auto]` scenarios will fail the runner dispatch — this is expected behavior. Code-Conductor will treat all `[auto]` failures as delegation triggers and fall back to EO exercising all scenarios (same as Phase 1).\n\n**Unified evidence record schema** (6 fields):\n\n| Field           | Type   | Description                           |\n| --------------- | ------ | ------------------------------------- |\n| `scenario_id`   | string | Scenario ID (e.g., `S1`)              |\n| `source`        | enum   | `runner` \\| `eo` \\| `runner+eo`       |\n| `result`        | enum   | `pass` \\| `fail` \\| `conflict`        |\n| `detail`        | string | Summary or first stderr line          |\n| `raw_exit_code` | int    | Runner exit code (runner source only) |\n| `evidence_type` | enum   | `live-interaction` \\| `code-audit` \\| `automated-runner` (conflict rows: compound of two values, see totality rules below) |\n\n**Evidence merge rules**:\n\n- Runner evidence is primary for `[auto]` scenarios; EO evidence is primary for `[manual]`.\n- Same-scenario conflict (runner-fail + EO-pass — EO exercises a failed `[auto]` scenario and yields a different result) → set `source: runner+eo`, `result: conflict` — passed to Code-Critic with both records. (Note: runner-pass + EO-fail is unreachable — runner-passed `[auto]` scenarios are excluded from EO delegation.)\n\n**`evidence_type` totality rules**:\n\n- `source: runner` rows: `evidence_type: automated-runner` (always — a runner dispatch is never a human\u002Fbrowser interaction).\n- `source: eo` rows: `evidence_type` is whatever Experience-Owner reports (`live-interaction` or `code-audit`) — EO's own methodology (see Experience-Owner shared body, out of scope for this file) determines which.\n- `source: runner+eo` (conflict) rows: `evidence_type: automated-runner+{eo-reported-type}` — the compound reflects EO's ACTUAL reported half (`automated-runner+live-interaction` or `automated-runner+code-audit`), not an assumed-always-live value; EO's Pre-Labeling Resolution Protocol (`Experience-Owner.agent.md`) permits EO to report `code-audit` for a delegated scenario, including a failed-runner one that produces a conflict row (compound literal — both provenances contributed and neither should be silently dropped).\n- Scenarios that never entered the evidence record at all (INCONCLUSIVE from a failed service pre-check, waived, not-covered, or aborted) have no `evidence_type` value — render `—` (em-dash) wherever these rows surface downstream (e.g. the PR-body coverage table), since there is no record to derive a type from.\n\n**Result format examples**:\n\n- `S1: runner-pass (exit 0, 1 scenario passed)`\n- `S2: runner-fail (exit 1, error: AssertionError: expected 200 but got 404)`\n\n### Runner Evidence in CE Prosecution\n\nCode-Critic evaluates runner evidence using the `source` field from the unified evidence record:\n\n- `source: runner`, `result: pass` → strong evidence for **Functional** lens (exit 0 + passing assertions)\n- `source: runner`, `result: fail` → classify as **Concern** with error context from `detail` field\n- `source: runner+eo`, `result: conflict` → **Concern** (not Issue) — include both records in findings, request clarification from Experience-Owner\n- `source: eo` (Phase 1 behavior or runner fallback) → existing per-scenario evaluation unchanged\n\n`source`-based CE prosecution guidance above is unchanged by the addition of `evidence_type` — `evidence_type` is a labeling\u002Freporting field for the maintainer-facing surface, not a new prosecution input this slice (declaration-only, owner decision M3 — enforcement\u002Fartifact-binding is a design-phase follow-up, not this slice).\n","# BDD Scenarios\n\nStructured Given\u002FWhen\u002FThen scenario authoring with ID traceability and CE Gate coverage gap detection for Agent Orchestra.\n\n## When to Use\n\n- Writing G\u002FW\u002FT scenarios in GitHub issues (Experience-Owner upstream framing)\n- Classifying scenarios as [auto] or [manual] (Issue-Planner)\n- Verifying scenario ID coverage at CE Gate (Code-Conductor pre-flight)\n- Per-scenario evaluation in adversarial CE prosecution (Code-Critic)\n- Reviewing scenario authoring and classification quality\n\n## G\u002FW\u002FT Authoring Patterns\n\n- Scenarios use numbered IDs: S1, S2, S3…\n- Heading convention: `### S{N} — {title} (Type)` where Type is Functional or Intent; emit concrete numbered IDs such as `### S1` and `### S2`, never literal `SN`\n- G\u002FW\u002FT clauses in customer language — see **Declarative-over-Imperative** below for details\n- Example template:\n\n  ```markdown\n  ### S1 — User completes onboarding (Functional)\n\n  Given a new user has opened the application for the first time\n  When they follow the onboarding prompts\n  Then they reach the home screen with personalized content\n  ```\n\n- Multiple Given or Then clauses allowed; And\u002FBut connectors supported for readability\n- Each scenario must be independently understandable\n\n### Declarative-over-Imperative\n\nStep text should describe _what the user intends_ (outcome or state change), not _how they interact with UI_ (action sequence). Declarative scenarios are more maintainable (survive UI redesigns), more reusable (same step across features), and decoupled from implementation (step definitions don't break when selectors change).\n\n| Imperative (avoid)                                        | Declarative (preferred)                                        |\n| --------------------------------------------------------- | -------------------------------------------------------------- |\n| `When I click the 'Sign in with Google' button`           | `When I choose to connect my Google account`                   |\n| `When the mock auth adapter returns a successful sign-in` | `Given a successful sign-in will occur for 'user@example.com'` |\n| `When I navigate to '\u002Fquests'`                            | `When I visit the quests area`                                 |\n| `Then I should see a 'Sign in with Google' button`        | `Then I see an option to connect my Google account`            |\n| `Then I should see a green checkmark icon`                | `Then the action is confirmed`                                 |\n\nThis rule narrows the broader \"no implementation details\" principle (see **Gotchas** below) to two actionable categories: imperative UI-interaction verbs and test-infrastructure leakage (adapter names, mock behavior, internal paths).\n\n**Validation scan** — when reviewing scenarios, flag any of these as signals to review (not automatic rejections — common English words like \"type\" or \"press\" may appear in legitimate customer-language scenarios; evaluate in context):\n\n- **Imperative verbs**: `click`, `navigate`, `tap`, `type`, `scroll`, `press`, `wait`\n- **Implementation nouns**: `mock`, `adapter`, `stub`, `spy`, `fixture`, path strings (e.g., `\u002Fquests`, `#submit-btn`, `.settings.json` — any string that reveals URL structure, CSS selectors, or file system paths)\n\nThis scan is especially important before Phase 2 Gherkin conversion — imperative step text produces unmaintainable step definitions.\n\n## Scenario Type Tags\n\n- **Functional**: Observable system behavior with clear pass\u002Ffail threshold. Use when the expected outcome is unambiguous and measurable.\n- **Intent**: User-experience quality or design intent. Use when the outcome requires judgment (e.g., \"feel\", \"clarity\", \"discoverability\").\n- Tag appears in the heading: `(Functional)` or `(Intent)`.\n\n## Classification Rubric ([auto]\u002F[manual])\n\nBDD classification performed by Issue-Planner when BDD is enabled:\n\n| Condition                                           | Classification        |\n| --------------------------------------------------- | --------------------- |\n| Functional + fully observable (grep\u002Fcode assertion) | `[auto]`              |\n| Intent + subjective judgment required               | `[manual]`            |\n| Functional but requires UI interaction              | `[manual]` (override) |\n| Any scenario requiring human judgment in CE Gate    | `[manual]` (override) |\n\nOverride rule: when in doubt, classify as `[manual]`. Test-Writer may reclassify `[auto]`↔`[manual]` during implementation; note the change in the plan and CE Gate evidence.\n\n## Service Dependency Annotations\n\nScenarios that require external services (auth emulators, backend APIs, databases) declare dependencies via `[requires: service-name:port]` annotations on the scenario heading, after the type tag:\n\n```markdown\n### S1 — User completes sign-in (Functional) [requires: firebase-emulator:9099]\n\n### S4 — OAuth flow with provider (Functional) [requires: auth-service:8080] [requires: api-gateway:3000]\n```\n\n- **Format**: `[requires: service-name:port]` — service-name is a human-readable label; port is the TCP port number\n- **Multiple services**: Use separate `[requires:]` annotations per dependency (AND semantics — all must be available)\n- **Extraction regex**: `\\[requires:\\s*([^:\\]]+):(\\d+)\\]` — captures service name (group 1) and port (group 2)\n- **CE Gate behavior**: Code-Conductor extracts annotations before delegation, checks each port via `check-port.ps1`, and marks scenarios with unavailable services as `INCONCLUSIVE (required service unavailable: service-name:port)` — excluding them from runner dispatch and Experience-Owner delegation. Fail-open: if `check-port.ps1` is unavailable or fails, all scenarios proceed normally.\n\n## Scenario ID Lifecycle\n\n- IDs are **immutable after plan approval** — once S1, S2, S3 are assigned in the issue body and the plan is approved, those IDs do not change.\n- If a scenario is split during implementation, the original ID remains; new sub-scenarios get the next sequential IDs (e.g., S1 stays S1; new scenario becomes S5).\n- IDs are **never reused** — when a scenario is **removed**, its ID is retired, not reassigned (the numbered `### S{N}` heading is preserved with `[REMOVED]` as the title — see ID Extraction Format below).\n- **Authority: the issue body is the authoritative source for scenario IDs**. The plan cites them; it does not define them. Post-approval additions to the issue body require a plan amendment.\n\n## ID Extraction Format\n\nWhen reading scenario IDs from an issue body:\n\n- Match the pattern `### S\\d+` headings within the `## Scenarios` section. Scope the extraction to content between the `## Scenarios` heading and the next H2 heading (`##`), or end-of-file if no subsequent H2 heading exists — do not match `### S\\d+` patterns outside this boundary.\n- Extract the full heading: `### S{N} — {title} (Type)` where `S{N}` is a concrete numbered ID such as `S1`\n- IDs are ordinal integers starting at 1; there must be **no gaps** in the sequence.\n- When a scenario is retired, keep its numbered `### S{N}` heading and replace the title with `[REMOVED]` (e.g., `### S2 — [REMOVED] (manual)`) instead of deleting the heading; this preserves the immutable ID space and allows extraction regex to still match retired-but-preserved headings.\n- For CE Gate pre-flight, extract all IDs present at plan-approval time and verify each appears in Experience-Owner's evidence summary\n\n## BDD Detection Mechanism\n\n### Source files and precedence\n\nBDD configuration is discovered by scanning these three files in priority order:\n\n```text\nAGENTS.md  ›  CLAUDE.md  ›  copilot-instructions.md\n```\n\nThe detector reads each file in this order and takes the **first file that contains a valid `## BDD Framework` heading at column 0** (a real level-2 Markdown heading, not a backticked mention or mid-line reference). This file becomes the **winning file** for the current detection pass. A higher-precedence file that lacks the heading is **skipped**, not treated as a disabling signal — detection continues to the next candidate. If no candidate file contains the heading, the result is the silent natural-language fallback (see **Silent fallback** below).\n\n**Precedence is BDD-config discovery order only.** This ordering does NOT modify or contradict instruction-merge precedence as documented in `skills\u002Fai-first-documentation\u002Frubric.md` E7. These are independent axes: E7 governs which instruction layers apply to agents; this section governs where BDD configuration lives. Do not conflate them. Note the orderings appear inverted (E7: `copilot-instructions.md` highest; BDD discovery: `AGENTS.md` first) — this is not a conflict: E7 answers _which instruction layer applies_, while BDD discovery answers _which file holds the opt-in config_; the two axes answer different questions.\n\n**Widened enablement surface (AC8)**: A bare `## BDD Framework` heading in `AGENTS.md` or `CLAUDE.md` enables Phase 1 BDD for any repo that uses those files as its primary instruction source. Repos that previously relied on `copilot-instructions.md` continue to work — the file is still the third candidate. Maintainers adding BDD to a repo via `AGENTS.md` or `CLAUDE.md` should be aware that a bare heading without a `bdd: {framework}` line activates Phase 1 only; Phase 2 requires both (see **Phase 2 Detection** below).\n\n### Discriminator\n\nFor each candidate file (in `AGENTS.md › CLAUDE.md › copilot-instructions.md` order), the detector checks:\n\n```bash\ngrep -nE '^## BDD Framework' \u003Ccandidate-file>\n```\n\nReturns at least one line → heading found; this file wins. The anchored `^` ensures only a true column-0 heading matches. A backticked mention such as `\\`## BDD Framework\\`` in a bullet point does NOT match. The naïve `grep -c \"## BDD Framework\"` returns false positives on prose descriptions; use the anchored grep.\n\nThe heading must appear at column 0 with no leading whitespace — CommonMark allows 1–3 spaces before an ATX heading, but the detector requires zero; an indented `## BDD Framework` will not be detected and silently advances to the next candidate file.\n\nIf a file contains more than one `## BDD Framework` heading, the **first** heading governs — subsequent headings in the same file are ignored.\n\n### Same-file `bdd:` read (Phase 2)\n\nWhen a winning file is found, Phase 2 dispatch reads `bdd: {framework}` from **that same winning file** — not from a hardcoded `copilot-instructions.md`. If the winning file is `AGENTS.md`, the `bdd:` line is expected under the `## BDD Framework` heading in `AGENTS.md`. See **Phase 2 Detection** below for the full two-condition check.\n\nScope the `bdd:` read to lines between the winning `## BDD Framework` heading and the next column-0 `##` heading (H2 boundary) — or end-of-file if no subsequent column-0 `##` heading exists — mirroring the `## Scenarios` extraction boundary.\n\nThe heading and `bdd:` line must be in the **same** winning file. A `bdd:` line in any lower-precedence file is never read — if the winning file has the heading but no `bdd:` line, the repo is Phase 1 only.\n\n### Silent fallback\n\nIf no candidate file contains a valid column-0 `## BDD Framework` heading, BDD is inactive. No error is emitted. Agents use the natural-language \u002F prose fallback silently. This is detect-only behavior — the absence of BDD config is never surfaced as a warning.\n\nA candidate file that cannot be read (absent, unreadable, or not a regular text file) is treated identically to a file lacking the heading — skipped, detection advances to the next candidate (fail-open).\n\n## Gotchas\n\n- **S-IDs vs Specification's AC-NNN format**: This skill uses S-IDs (S1, S2, S3) for CE Gate scenarios. Specification agent uses `AC-NNN` for acceptance criteria. These are different namespaces — do not mix them or treat AC-NNN as a scenario ID.\n- **Customer language principle**: G\u002FW\u002FT keywords are structural framing only. The clause content must be in customer terms — no method names, no file paths, no agent names, no implementation details. \"When the system calls ExperienceOwner.FrameScenarios()\" is wrong; \"When the team begins feature planning\" is correct. See also: **Declarative-over-Imperative** above for specific anti-patterns, preferred alternatives, and a validation scan. This gotcha states the broad principle (no implementation details); the subsection above provides actionable examples covering imperative UI verbs and test-infrastructure leakage.\n- **BDD detection gating**: All BDD-specific behavior (G\u002FW\u002FT authoring, classification, pre-flight, per-scenario prosecution) is conditional on a `## BDD Framework` **line-start heading** (column 0) being found in one of the candidate files (`AGENTS.md › CLAUDE.md › copilot-instructions.md`). Repos where no candidate file contains this heading keep the existing natural-language workflow unchanged — do not apply rubric, IDs, or pre-flight to natural-language scenarios. See **BDD Detection Mechanism** above for the full file-list and precedence rule.\n- **Issue-body source of truth**: The `## Scenarios` section in the GitHub issue body is the authoritative store for scenario IDs. Any abbreviated or derived authoring path (e.g., generating scenarios only in the plan's `[CE GATE]` step) **must** also write the full scenarios back into the issue body using the GitHub issue update tool — Code-Conductor's CE Gate pre-flight reads from the issue body and will treat missing issue-body scenarios as coverage gaps.\n- **Phase 2 scope boundary**: Phase 2 (Gherkin conversion + framework runner integration) is documented in the `## Phase 2: Gherkin Conversion & Framework Runner` section below. Phase 1 content (authoring, traceability, coverage detection) is unchanged.\n\n## Phase 2: Gherkin Conversion & Framework Runner\n\nPhase 2 extends Phase 1 by converting `[auto]` scenarios into runnable `.feature` files and dispatching the consumer's BDD framework runner at CE Gate validation.\n\n## Test-Writer Phase 2 Generation\n\nWhen Test-Writer is active and Phase 2 is enabled, use this skill as the authority for:\n\n- activation checks\n- `[auto]` versus `[manual]` generation scope\n- output directory selection\n- `.feature` file naming\n- stub idempotency\n- warning behavior for `bdd: true` and unrecognized frameworks\n\nKeep the Test-Writer agent body thin by pointing here instead of restating the full Phase 2 procedure.\n\n### Phase 2 Detection\n\nPhase 2 is active when **both** conditions are met in the **winning file** (the first of `AGENTS.md`, `CLAUDE.md`, `copilot-instructions.md` that contains a valid column-0 `## BDD Framework` heading — see **BDD Detection Mechanism** above):\n\n1. `## BDD Framework` **line-start heading** at column 0 is present **in the winning file** (Phase 1 condition; a mid-line mention does not qualify)\n2. A `bdd: {framework}` config line is present in that **same winning file** with a recognized framework name\n\n**Known migration case — `bdd: true`**: If a consumer repo was set up under Phase 1 only and still has `bdd: true` in a comment, emit a warning: _\"bdd: true detected — Phase 2 requires a recognized framework name. Set `bdd: {framework}` with one of: cucumber.js, behave, jest-cucumber, cucumber. Falling back to Phase 1 behavior.\"_ Then fall back to Phase 1.\n\n**Unrecognized framework name**: If a `bdd: {framework}` line is present but the value is not in the mapping table, emit a warning: _\"Unrecognized framework '{value}'. Recognized values: cucumber.js, behave, jest-cucumber, cucumber. Falling back to Phase 1 behavior.\"_ Then fall back to Phase 1.\n\n**Phase-1-only repos** (**line-start heading** (column 0) present in the winning file, no `bdd:` line in that file): Phase 2 detection requires BOTH conditions. A repo whose winning file has only the `## BDD Framework` line-start heading is Phase 1 only — behavior is unchanged.\n\n### Framework Mapping Table\n\n| Framework               | Tag Format | Default Output Dir             | Runner Command Template                       | Version Check Command       |\n| ----------------------- | ---------- | ------------------------------ | --------------------------------------------- | --------------------------- |\n| cucumber.js             | `@S{N}`    | `features\u002F`                    | `npx cucumber-js --tags @S{N}`                | `npx cucumber-js --version` |\n| behave                  | `@S{N}`    | `features\u002F`                    | `behave --tags @S{N}`                         | `behave --version`          |\n| jest-cucumber           | `@S{N}`    | `features\u002F`                    | `npx jest --testPathPattern features`         | `npx jest --version`        |\n| cucumber (JVM Cucumber) | `@S{N}`    | `src\u002Ftest\u002Fresources\u002Ffeatures\u002F` | `.\u002Fgradlew test -Dcucumber.filter.tags=@S{N}` | `.\u002Fgradlew --version`       |\n\n> **jest-cucumber limitation**: jest-cucumber does not support per-scenario Gherkin tag filtering via CLI. Runner dispatch for jest-cucumber runs the entire `features\u002F` directory as one suite. All `[auto]` scenarios receive the same evidence record (suite-level pass\u002Ffail rather than per-scenario). Conflict detection (`source: runner+eo, result: conflict`) is still reachable: if the suite fails and EO passes during the delegated re-exercise, the conflict is recorded at suite granularity (all `[auto]` scenarios may resolve to conflict). Per-scenario runner granularity is what is not available — the suite-level result applies uniformly to all `[auto]` scenarios.\n> **cucumber (JVM Cucumber) note**: Runner commands assume Gradle (`.\u002Fgradlew`). Maven-based projects will fail the pre-check and fall back to Phase 1 (EO exercises all scenarios). No runner dispatch occurs for Maven+Cucumber consumers.\n\n### Gherkin Conversion Rules\n\nFor each `[auto]` scenario in the issue's `## Scenarios` section:\n\n- Include a `Feature: Issue #{N} — {issue-title}` declaration at the top of every `.feature` file (required by all four supported parsers).\n- Add `@S{N}` tag directly above the `Scenario:` line\n- Map the scenario heading to `Scenario: {title}` (strip the `### S{N} —` prefix and type tag)\n- Map G\u002FW\u002FT clauses to Gherkin `Given`\u002F`When`\u002F`Then` keywords (1:1 mapping)\n- `And`\u002F`But` connectors preserved as-is\n\n**File layout**: One `.feature` file per issue (all `[auto]` scenarios in one file). File naming: `S{first}-S{last}-{issue-slug}.feature` (e.g., `S1-S3-task-manager-api-onboarding.feature`). Derive `{issue-slug}` from the issue title by: lowercasing, replacing spaces and non-alphanumeric characters with hyphens, collapsing consecutive hyphens, and truncating to 40 characters. Place in the framework-default output directory from the mapping table.\n\n**Example output**:\n\n```gherkin\nFeature: Issue #42 — Task Manager API Onboarding\n\n@S1\nScenario: User completes onboarding\n  Given a new user has opened the application for the first time\n  When they follow the onboarding prompts\n  Then they reach the home screen with personalized content\n```\n\n**`[manual]` exclusion**: Do NOT generate `.feature` files for `[manual]` scenarios — they are exercised by Experience-Owner only.\n\n### Step Definition Stubs\n\nGenerate step definition stubs alongside the `.feature` file **only if the stub file does not already exist**. On subsequent pipeline runs (e.g., when a new scenario is added), stubs are NOT regenerated — only the `.feature` file is regenerated. The consumer's assertion logic in existing stubs is preserved. Stubs link each `Then` clause to the scenario's Intent.\n\n**cucumber.js** (JavaScript\u002FTypeScript):\n\n```javascript\nconst { Given, When, Then } = require(\"@cucumber\u002Fcucumber\");\n\n\u002F\u002F S1 — User completes onboarding\nGiven(\n  \"a new user has opened the application for the first time\",\n  async function () {\n    \u002F\u002F TODO: implement setup\n    return \"pending\";\n  },\n);\nWhen(\"they follow the onboarding prompts\", async function () {\n  \u002F\u002F TODO: implement action\n  return \"pending\";\n});\nThen(\"they reach the home screen with personalized content\", async function () {\n  \u002F\u002F TODO: implement assertion — Intent: verify onboarding completion\n  return \"pending\";\n});\n```\n\n**behave** (Python):\n\n```python\nfrom behave import given, when, then\n\n# S1 — User completes onboarding\n@given('a new user has opened the application for the first time')\ndef step_impl(context):\n    pass  # TODO: implement setup\n\n@when('they follow the onboarding prompts')\ndef step_impl(context):\n    pass  # TODO: implement action\n\n@then('they reach the home screen with personalized content')\ndef step_impl(context):\n    pass  # TODO: implement assertion — Intent: verify onboarding completion\n```\n\n**jest-cucumber**: Use `loadFeature` + `defineFeature` pattern with steps mapped to `@S{N}` scenario.\n\n**cucumber (JVM Cucumber)** (Java):\n\n```java\nimport io.cucumber.java.en.Given;\nimport io.cucumber.java.en.When;\nimport io.cucumber.java.en.Then;\n\npublic class StepDefinitions {\n\n    \u002F\u002F S1 — User completes onboarding\n    @Given(\"a new user has opened the application for the first time\")\n    public void givenNewUserOpened() {\n        throw new io.cucumber.java.PendingException(); \u002F\u002F TODO: implement setup\n    }\n\n    @When(\"they follow the onboarding prompts\")\n    public void whenTheyFollowPrompts() {\n        throw new io.cucumber.java.PendingException(); \u002F\u002F TODO: implement action\n    }\n\n    @Then(\"they reach the home screen with personalized content\")\n    public void thenTheyReachHomeScreen() {\n        throw new io.cucumber.java.PendingException(); \u002F\u002F TODO: implement assertion — Intent: verify onboarding completion\n    }\n}\n```\n\n### Runner Dispatch Protocol\n\nCode-Conductor dispatches the framework runner at CE Gate. Process:\n\n1. **Pre-check**: Run version check command from mapping table. Non-zero exit → log warning, fall back to Phase 1 (EO exercises all scenarios).\n2. **Per-scenario dispatch**: For each `[auto]` scenario, run the runner command with `@S{N}` tag filtering. Capture exit code + stdout + stderr.\n3. **Evidence capture**: Record as a unified evidence record per scenario.\n4. **Conditional EO delegation**: Runner passed all `[auto]` → send only `[manual]` to EO. Some `[auto]` failed → add failed `[auto]` to EO list. Pre-check failed → send all to EO.\n5. **Evidence merge**: Combine runner evidence (for `[auto]`) with EO evidence (for `[manual]`) into the unified evidence record.\n\n> **Note on pending stubs**: Step definition stubs are generated as pending (e.g., `return 'pending'` in cucumber.js). **The consumer must implement the step definitions before runner dispatch produces per-scenario evidence at CE Gate time.** On the first CE Gate run after stub generation (before stubs are implemented), all `[auto]` scenarios will fail the runner dispatch — this is expected behavior. Code-Conductor will treat all `[auto]` failures as delegation triggers and fall back to EO exercising all scenarios (same as Phase 1).\n\n**Unified evidence record schema** (6 fields):\n\n| Field           | Type   | Description                           |\n| --------------- | ------ | ------------------------------------- |\n| `scenario_id`   | string | Scenario ID (e.g., `S1`)              |\n| `source`        | enum   | `runner` \\| `eo` \\| `runner+eo`       |\n| `result`        | enum   | `pass` \\| `fail` \\| `conflict`        |\n| `detail`        | string | Summary or first stderr line          |\n| `raw_exit_code` | int    | Runner exit code (runner source only) |\n| `evidence_type` | enum   | `live-interaction` \\| `code-audit` \\| `automated-runner` (conflict rows: compound of two values, see totality rules below) |\n\n**Evidence merge rules**:\n\n- Runner evidence is primary for `[auto]` scenarios; EO evidence is primary for `[manual]`.\n- Same-scenario conflict (runner-fail + EO-pass — EO exercises a failed `[auto]` scenario and yields a different result) → set `source: runner+eo`, `result: conflict` — passed to Code-Critic with both records. (Note: runner-pass + EO-fail is unreachable — runner-passed `[auto]` scenarios are excluded from EO delegation.)\n\n**`evidence_type` totality rules**:\n\n- `source: runner` rows: `evidence_type: automated-runner` (always — a runner dispatch is never a human\u002Fbrowser interaction).\n- `source: eo` rows: `evidence_type` is whatever Experience-Owner reports (`live-interaction` or `code-audit`) — EO's own methodology (see Experience-Owner shared body, out of scope for this file) determines which.\n- `source: runner+eo` (conflict) rows: `evidence_type: automated-runner+{eo-reported-type}` — the compound reflects EO's ACTUAL reported half (`automated-runner+live-interaction` or `automated-runner+code-audit`), not an assumed-always-live value; EO's Pre-Labeling Resolution Protocol (`Experience-Owner.agent.md`) permits EO to report `code-audit` for a delegated scenario, including a failed-runner one that produces a conflict row (compound literal — both provenances contributed and neither should be silently dropped).\n- Scenarios that never entered the evidence record at all (INCONCLUSIVE from a failed service pre-check, waived, not-covered, or aborted) have no `evidence_type` value — render `—` (em-dash) wherever these rows surface downstream (e.g. the PR-body coverage table), since there is no record to derive a type from.\n\n**Result format examples**:\n\n- `S1: runner-pass (exit 0, 1 scenario passed)`\n- `S2: runner-fail (exit 1, error: AssertionError: expected 200 but got 404)`\n\n### Runner Evidence in CE Prosecution\n\nCode-Critic evaluates runner evidence using the `source` field from the unified evidence record:\n\n- `source: runner`, `result: pass` → strong evidence for **Functional** lens (exit 0 + passing assertions)\n- `source: runner`, `result: fail` → classify as **Concern** with error context from `detail` field\n- `source: runner+eo`, `result: conflict` → **Concern** (not Issue) — include both records in findings, request clarification from Experience-Owner\n- `source: eo` (Phase 1 behavior or runner fallback) → existing per-scenario evaluation unchanged\n\n`source`-based CE prosecution guidance above is unchanged by the addition of `evidence_type` — `evidence_type` is a labeling\u002Freporting field for the maintainer-facing surface, not a new prosecution input this slice (declaration-only, owner decision M3 — enforcement\u002Fartifact-binding is a design-phase follow-up, not this slice).\n",{"name":5,"description":7},"main","d5486aacc32c9ca1b07173cfd530f8fe75c29e58","skills\u002Fbdd-scenarios",0,"https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra","https:\u002F\u002Fgithub.com\u002FGrimblaz","2026-08-16 01:12:46",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add Grimblaz\u002Fagent-orchestra --skill bdd-scenarios",{"tool":52,"command":53},"bunx","bunx skills add Grimblaz\u002Fagent-orchestra --skill bdd-scenarios",{"tool":55,"command":56},"pnpm","pnpm dlx skills add Grimblaz\u002Fagent-orchestra --skill bdd-scenarios","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fbdd-scenarios\u002FSKILL.md",true,[],[61,92,117,132,160,180],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":75,"publishedAt":34},"01M6C48YMJVFHM7DVGG1WWW5RJ","webapp-testing","Playwright end-to-end testing guidance for web apps, with practical patterns and setup steps. Use when creating or improving browser-based E2E coverage, test stability, and CI execution. DO NOT USE FOR: React component tests (use ui-testing), canvas game interaction (use browser-canvas-testing), TDD workflow (use test-driven-development), debugging failures (use systematic-debugging), or randomized property tests (use property-based-testing).","https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[67,72],{"categoryNo":68,"categoryName":69,"taxonomyType":70,"taxonomyTypeDesc":71},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":73,"categoryName":74,"taxonomyType":70,"taxonomyTypeDesc":71},"01JBSEEDCAT000000000000009","前端开发",[76,77,78,79,80,81,82,21,83,84,85,86,23,87,88,89,90,91,29,30],"testing","webapp testing","webapp","canvas","tdd","workflow","playwright","web","react","component","debugging","browser","ci","execution","e2e","game",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":34},"01M6C48TNNP2KCSQXV8YK7SK49","verification-before-completion","Evidence-based verification checklist before marking work complete. Use before PRs, releases, marking tickets done, or any \"I'm finished\" declaration; also when naming a baseline commit for a differential suite claim, when designing a mutation campaign or red-run evidence, when making an absence claim, a universal claim, or a one-time demonstration offered as a standing guarantee, when attributing a measurement or claiming a sweep or verification loop is complete, and when stating what a check or a CI suite will do about a change. DO NOT USE FOR: post-merge cleanup or archival (use post-pr-review) or processing GitHub review comments (use code-review-intake).","https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[99,100,101,102,103,104,105,106,107,108,109,110,88,111,112,113,114,30,115,116],"verification","verification before completion","review","change","commit","merge","pr","cleanup","run","code","code-review","intake","loop","verification loop","work","check","evidence","campaign",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":34},"01M6C48QZWNTP7JGKD32QZAKKX","validation-methodology","Reusable validation and review methodology for staged validation, failure triage, and prosecution-depth setup. Use when running validation ladders, triaging failures, or executing adversarial review passes. DO NOT USE FOR: CE Gate orchestration, specialist dispatch ownership, or step execution flow (keep those in Code-Conductor).","https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fvalidation-methodology\u002FSKILL.md",[],[124,125,126,101,127,128,129,130,108,131,89,30,33],"validation","methodology","validation methodology","triage","orchestration","setup","adversarial review","flow",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":146,"publishedAt":34},"01M6C48MCAHG5Z79BJ369CRYRZ","upstream-onboarding","Shared opening-phase protocol for upstream agents (Experience-Owner, Solution-Designer, Issue-Planner) and Code-Conductor when invoked on an existing GitHub issue. Renders a scaled context brief and runs a standards check on inherited work at each phase boundary. Use when a user-invocable agent receives a request referencing an existing GitHub issue and must load solution-authoring and upstream-onboarding at the opening phase. DO NOT USE FOR: subagent dispatches (which already operate within an assessed session context); post-merge review (use post-pr-review); research or non-tree subagents.","https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fupstream-onboarding\u002FSKILL.md",[138,141],{"categoryNo":139,"categoryName":140,"taxonomyType":70,"taxonomyTypeDesc":71},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":142,"categoryName":143,"taxonomyType":144,"taxonomyTypeDesc":145},"01JBSEEDCAT000000000000038","人力资源","PROFESSION","适用职业",[147,148,101,149,150,104,151,105,108,152,153,154,155,156,157,113,114,158,159,30],"onboarding","upstream onboarding","github","research","standards check","protocol","brief","boundary","designer","subagent","planner","user","session",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":174,"publishedAt":34},"01M6C48GPVE120TGPMD1CS365H","ui-testing","Resilient React component testing strategies focusing on user behavior. Use when writing or reviewing component-level React tests, fixing flaky component tests, or establishing React testing patterns. DO NOT USE FOR: Playwright E2E tests (use webapp-testing), canvas game interaction (use browser-canvas-testing), TDD workflow (use test-driven-development), debugging failures (use systematic-debugging), UI component design (use frontend-design), or randomized property tests (use property-based-testing).","https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fui-testing\u002FSKILL.md",[166,167,168,171],{"categoryNo":68,"categoryName":69,"taxonomyType":70,"taxonomyTypeDesc":71},{"categoryNo":73,"categoryName":74,"taxonomyType":70,"taxonomyTypeDesc":71},{"categoryNo":169,"categoryName":170,"taxonomyType":70,"taxonomyTypeDesc":71},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":172,"categoryName":173,"taxonomyType":144,"taxonomyTypeDesc":145},"01JBSEEDCAT000000000000032","设计师",[76,175,176,177,178,20,79,81,82,21,84,85,86,23,87,179,90,91,30,78],"ui","ui testing","frontend","design","testing patterns",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":188,"publishedAt":34},"01M6C48DRJ9XBDR2FW0W37DY53","ui-iteration","Reusable screenshot-driven UI polish workflow for iterative visual refinement. Use when improving layout, hierarchy, spacing, feedback, or Tailwind-based presentation through repeated review-and-adjust passes. DO NOT USE FOR: functional bug fixing, accessibility-only audits, or major redesign strategy work (use Code-Smith or frontend-design).","https:\u002F\u002Fgithub.com\u002FGrimblaz\u002Fagent-orchestra\u002Fblob\u002Fmain\u002Fskills\u002Fui-iteration\u002FSKILL.md",[186,187],{"categoryNo":73,"categoryName":74,"taxonomyType":70,"taxonomyTypeDesc":71},{"categoryNo":172,"categoryName":173,"taxonomyType":144,"taxonomyTypeDesc":145},[175,189,177,178,101,81,190,108,191,192,193,194,195,113,196,28,30,197],"ui iteration","accessibility","screenshot","Tailwind","polish","ui polish","feedback","redesign","only"]