mandrel 2.40.0 → 2.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.agents/README.md +2 -2
  2. package/.agents/agents/story-worker.md +24 -14
  3. package/.agents/docs/agentrc-reference.json +7 -2
  4. package/.agents/docs/configuration.md +5 -2
  5. package/.agents/instructions.md +5 -6
  6. package/.agents/rules/api-conventions.md +43 -7
  7. package/.agents/rules/ci-remediation.md +3 -14
  8. package/.agents/rules/gherkin-standards.md +21 -6
  9. package/.agents/rules/git-conventions.md +6 -5
  10. package/.agents/rules/security-baseline.md +6 -7
  11. package/.agents/rules/testing-standards.md +75 -198
  12. package/.agents/schemas/agentrc.schema.json +17 -2
  13. package/.agents/schemas/validation-evidence.schema.json +3 -1
  14. package/.agents/scripts/acceptance-eval.js +68 -3
  15. package/.agents/scripts/coverage-capture.js +25 -8
  16. package/.agents/scripts/install-matrix-assert.js +2 -2
  17. package/.agents/scripts/lib/audit-to-stories/epic-grouping-directive.js +6 -0
  18. package/.agents/scripts/lib/baselines/crap-preview-incremental.js +7 -2
  19. package/.agents/scripts/lib/baselines/git-base.js +74 -38
  20. package/.agents/scripts/lib/close-validation/gates.js +153 -25
  21. package/.agents/scripts/lib/close-validation/process.js +30 -1
  22. package/.agents/scripts/lib/close-validation/runner.js +5 -0
  23. package/.agents/scripts/lib/config/gates/crap-incremental-coverage.schema.js +33 -12
  24. package/.agents/scripts/lib/config/quality.js +36 -21
  25. package/.agents/scripts/lib/config-settings-schema-delivery.js +6 -0
  26. package/.agents/scripts/lib/coverage-capture-incremental.js +12 -6
  27. package/.agents/scripts/lib/crap-baseline-join.js +11 -7
  28. package/.agents/scripts/lib/full-suite-lock.js +311 -0
  29. package/.agents/scripts/lib/generated/agentrc-validator.js +1 -1
  30. package/.agents/scripts/lib/orchestration/check-baselines/phases/evaluate.js +11 -104
  31. package/.agents/scripts/lib/orchestration/check-baselines/phases/refresh-ack.js +320 -0
  32. package/.agents/scripts/lib/orchestration/check-baselines/phases/report.js +8 -1
  33. package/.agents/scripts/lib/orchestration/dependency-candidates.js +139 -0
  34. package/.agents/scripts/lib/orchestration/epic-candidates.js +159 -0
  35. package/.agents/scripts/lib/orchestration/epic-checklist.js +103 -0
  36. package/.agents/scripts/lib/orchestration/epic-container.js +18 -2
  37. package/.agents/scripts/lib/orchestration/plan-context.js +97 -36
  38. package/.agents/scripts/lib/orchestration/plan-persist/cross-plan-links.js +80 -0
  39. package/.agents/scripts/lib/orchestration/plan-persist/epic-adoption.js +192 -0
  40. package/.agents/scripts/lib/orchestration/plan-persist/epic-ops.js +5 -1
  41. package/.agents/scripts/lib/orchestration/plan-persist/external-deps.js +164 -0
  42. package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +14 -2
  43. package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +26 -5
  44. package/.agents/scripts/lib/orchestration/single-story-close/failed-terminal.js +83 -4
  45. package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +39 -7
  46. package/.agents/scripts/lib/orchestration/single-story-close/runner.js +70 -18
  47. package/.agents/scripts/lib/orchestration/ticket-validator.js +11 -1
  48. package/.agents/scripts/lib/orchestration/verify-credit.js +207 -0
  49. package/.agents/scripts/lib/single-story-sweep/sweep-lock.js +24 -0
  50. package/.agents/scripts/plan-persist.js +60 -1
  51. package/.agents/skills/core/browser-testing-with-devtools/SKILL.md +5 -10
  52. package/.agents/skills/core/browser-testing-with-devtools/reference.md +7 -46
  53. package/.agents/skills/core/code-review-and-quality/SKILL.md +0 -5
  54. package/.agents/skills/core/documentation-and-adrs/SKILL.md +0 -3
  55. package/.agents/skills/core/gates-and-baselines/SKILL.md +10 -137
  56. package/.agents/skills/core/gates-and-baselines/reference.md +103 -0
  57. package/.agents/skills/core/idea-refinement/SKILL.md +2 -18
  58. package/.agents/skills/core/security-and-hardening/SKILL.md +2 -4
  59. package/.agents/skills/core/security-and-hardening/reference.md +0 -70
  60. package/.agents/skills/skills.index.json +10 -70
  61. package/.agents/skills/stack/qa/gherkin-authoring/SKILL.md +4 -10
  62. package/.agents/skills/stack/qa/gherkin-authoring/reference.md +9 -113
  63. package/.agents/skills/stack/qa/playwright-bdd/SKILL.md +29 -154
  64. package/.agents/skills/stack/qa/qa-harness/SKILL.md +157 -98
  65. package/.agents/workflows/git-cleanup.md +3 -2
  66. package/.agents/workflows/git-deliver.md +3 -2
  67. package/.agents/workflows/helpers/acceptance-self-eval.md +12 -0
  68. package/.agents/workflows/helpers/deliver-digest.md +31 -10
  69. package/.agents/workflows/helpers/deliver-story-reference.md +50 -30
  70. package/.agents/workflows/helpers/deliver-story.md +23 -21
  71. package/.agents/workflows/helpers/plan-reference.md +82 -2
  72. package/.agents/workflows/mandrel-plan.md +45 -45
  73. package/.agents/workflows/qa-assist.md +20 -17
  74. package/.agents/workflows/qa-explore.md +30 -29
  75. package/.agents/workflows/qa-run.md +2 -1
  76. package/docs/CHANGELOG.md +32 -0
  77. package/package.json +1 -1
  78. package/.agents/rules/changelog-style.md +0 -180
  79. package/.agents/rules/shell-conventions.md +0 -61
  80. package/.agents/scripts/lib/qa/coverage-verdict.js +0 -214
  81. package/.agents/skills/core/api-and-interface-design/SKILL.md +0 -55
  82. package/.agents/skills/core/api-and-interface-design/reference.md +0 -76
  83. package/.agents/skills/core/debugging-and-error-recovery/SKILL.md +0 -45
  84. package/.agents/skills/core/debugging-and-error-recovery/reference.md +0 -56
  85. package/.agents/skills/core/git-workflow-and-versioning/SKILL.md +0 -54
  86. package/.agents/skills/core/idea-refinement/refinement-criteria.md +0 -155
  87. package/.agents/skills/core/idea-refinement/scripts/idea-refine.sh +0 -15
  88. package/.agents/skills/core/qa-coverage-mapping/SKILL.md +0 -105
  89. package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +0 -152
  90. package/.agents/skills/stack/qa/vitest/SKILL.md +0 -22
@@ -3,102 +3,9 @@
3
3
  **Read this when** a task engages one of the sections below and the Policy
4
4
  Capsule in [`SKILL.md`](SKILL.md) does not settle it on its own. The capsule is
5
5
  the contract; this file is the reference material behind it. The enforcement
6
- rules (tag taxonomy, forbidden patterns, Outline conventions) are owned by the
7
- SSOT rule, [`gherkin-standards.md`](../../../../rules/gherkin-standards.md).
8
-
9
- ## Canonical Given / When / Then Phrasing
10
-
11
- `.feature` prose is written for a product-minded reader, not a test harness.
12
- Each clause has exactly one job:
13
-
14
- - **Given** — a precondition that is *already true* when the scenario starts.
15
- Stative, past or present tense. No actions.
16
- - Good: `Given a signed-in account-owner with an unpaid invoice`.
17
- - Bad: `Given the user clicks the login button` (that's a When).
18
- - **When** — the single business action under test. One verb, one actor, one
19
- event. Splitting a When into multiple clauses is almost always wrong — move
20
- the extra clauses into Given.
21
- - Good: `When they issue the invoice`.
22
- - Bad: `When they log in and issue the invoice and download the PDF`.
23
- - **Then** — an observable, user-visible outcome. Assert what the *user* sees or
24
- what the *business* records, not what the system emits internally.
25
- - Good: `Then the invoice appears in the issued invoices list`.
26
- - Bad: `Then a 201 is returned` (forbidden; see
27
- [gherkin-standards § Forbidden Patterns](../../../../rules/gherkin-standards.md#forbidden-patterns)).
28
- - **And / But** — continuation clauses. They inherit the mood of the most recent
29
- Given/When/Then. Never start a scenario with And/But.
30
-
31
- Voice and tense: third-person, present tense, role-qualified noun actors
32
- (`the user`, `a billing-admin`, not "I" or "we"). One clause, one fact —
33
- comma-chained facts hide compound assertions. Numbers and identifiers go in
34
- `Examples` tables or fixtures, not inline prose.
35
-
36
- ## Translating PRD Acceptance Criteria to Scenarios
37
-
38
- PRD ACs are the raw material. The authoring move is **one AC → one scenario**
39
- unless the AC encodes a matrix (then it becomes a Scenario Outline — see below).
40
-
41
- Walkthrough — a PRD AC from a billing feature:
42
-
43
- > **AC-3:** When a billing-admin issues an invoice for a customer with a
44
- > negative balance, the system rejects the issue and shows an error naming the
45
- > outstanding amount.
46
-
47
- Translation steps:
48
-
49
- 1. **Identify the domain.** Billing → tag the scenario `@domain-billing`.
50
- 2. **Identify the actor and precondition.** "billing-admin", "customer with a
51
- negative balance" → two Givens.
52
- 3. **Identify the single action.** "issues an invoice" → one When.
53
- 4. **Identify the observable outcome.** "rejects the issue and shows an error
54
- naming the outstanding amount" → two Thens (business outcome, then
55
- user-visible detail).
56
- 5. **Pick the risk tag.** If the originating ticket was `risk::high`, add
57
- `@risk-high`.
58
-
59
- Resulting scenario:
60
-
61
- ```gherkin
62
- @domain-billing @risk-high
63
- Scenario: Issuing an invoice is rejected when the customer has a negative balance
64
- Given a signed-in billing-admin
65
- And a customer with a negative account balance
66
- When the billing-admin issues an invoice for that customer
67
- Then the issue is rejected
68
- And the rejection message names the outstanding amount
69
- ```
70
-
71
- Heuristics:
72
-
73
- - If a single AC needs more than **one When**, it is really two ACs. Split
74
- before you write.
75
- - If a Then starts with "and the database has…" or "and the API returned…", you
76
- have crossed into step-definition or contract-test territory. Rewrite it as
77
- user-visible language or move the assertion to a contract test.
78
- - If an AC says "the system logs X", that's an engineering non-functional
79
- requirement — cover it with a focused unit or integration test, not a
80
- `.feature` file.
81
-
82
- ## Background vs. Given, Outline vs. Multi-Scenario
83
-
84
- Two authoring decisions authors routinely get wrong.
85
-
86
- **Background vs. Given.** `Background` runs before **every** scenario in the
87
- file. Use it only when every scenario genuinely shares the precondition **and**
88
- it has no per-scenario variation (no `<placeholders>`, no per-scenario data).
89
- Prefer a per-scenario Given when only some scenarios need the precondition, when
90
- it varies by role/plan/fixture, or when a reader cannot understand the scenario
91
- without scrolling up. Rule of thumb: if you find yourself writing *"except in
92
- the admin scenario, where the Background step is actually…"*, delete the
93
- Background.
94
-
95
- **Scenario Outline vs. multiple Scenarios.** Use `Scenario Outline` when the
96
- **same behavior** is exercised across a **bounded matrix** (roles, plan tiers,
97
- locales) — the Givens/When/Thens are identical and only the data varies. Use
98
- multiple `Scenario` blocks when the Givens differ structurally, the When verb
99
- differs, or the Then outcomes differ in kind, not just value. Keep `Examples`
100
- tables under ~12 rows, and split them by tag when rows need different tags
101
- (e.g. `@risk-high` on admin rows only).
6
+ rules (tag taxonomy, forbidden patterns, Outline conventions, step reuse) are
7
+ owned by the SSOT rule,
8
+ [`gherkin-standards.md`](../../../../rules/gherkin-standards.md).
102
9
 
103
10
  ## Step-Definition Library Structure
104
11
 
@@ -122,22 +29,11 @@ tests/
122
29
  - Step text follows the scenario text verbatim — divergence between scenario
123
30
  prose and step text is a bug. Parameterize only over values that actually
124
31
  vary; keep implementations ≤20 lines (a longer one signals a missing helper).
125
-
126
- **Reuse before authoring** — the non-negotiable workflow is in
127
- [gherkin-standards § Step Reuse](../../../../rules/gherkin-standards.md#step-reuse--grep-before-you-write):
128
-
129
- 1. Search for the verb: `rg -n "issues? an invoice" tests/steps`.
130
- 2. If the phrase exists, **change your scenario** to use it — do not fork a
131
- near-duplicate step.
132
- 3. If a near-match exists, extend the existing step and update every call site
133
- in the same PR.
134
- 4. Only when no reasonable match exists, add a new step in the correct domain
135
- directory.
136
-
137
- **Deprecation.** When a step is superseded, move the old definition into
138
- `steps/_deprecated/` with a comment naming the replacement, migrate every call
139
- site in the same PR, and delete the `_deprecated/` entry when the migration
140
- lands. Never leave two live step definitions that mean the same thing.
32
+ - **Reuse before authoring, and deprecate cleanly.** Both are the SSOT rule's:
33
+ [gherkin-standards § Step Reuse](../../../../rules/gherkin-standards.md#step-reuse--grep-before-you-write).
34
+ A superseded definition moves into `steps/_deprecated/` with a comment naming
35
+ its replacement, every call site migrates in the same PR, and the
36
+ `_deprecated/` entry is deleted when the migration lands.
141
37
 
142
38
  ## Authoring Checklist
143
39
 
@@ -151,7 +47,7 @@ Before opening a PR that adds or edits a `.feature` file:
151
47
  - [ ] `Background` is justified (applies to every scenario in the file).
152
48
  - [ ] If a Scenario Outline is used, the matrix is bounded (≤12 rows) and the
153
49
  shape is truly identical across rows.
154
- - [ ] Every step phrase grep-matches an existing step definition **or** is
50
+ - [ ] Every step phrase matches an existing step definition **or** is
155
51
  accompanied by a new step definition in the right domain directory.
156
52
  - [ ] Reads standalone — a product reader who has never seen the codebase can
157
53
  understand the intent without opening a step file.
@@ -13,14 +13,15 @@ vendor: playwright
13
13
 
14
14
  ## Policy Capsule
15
15
 
16
- - Complete the pre-authoring grep-for-existing-steps checklist before writing any new scenario text; record the matches in your output.
16
+ - Complete the step-reuse sequence in [`gherkin-standards.md` § Step Reuse](../../../../rules/gherkin-standards.md#step-reuse--grep-before-you-write) before any scenario text is written, and report its results; that rule is the only home for it.
17
17
  - Keep `.feature` files free of Playwright API calls — scenarios describe intent, step definitions translate to browser actions.
18
- - Generate step bindings into a dedicated directory (e.g. `.features-gen/`) and add it to `.gitignore`; never commit generated specs.
19
- - Drive runs by tag expression (`--grep "@smoke and not @flaky"`), not filename globs; use the canonical `@smoke`/`@risk-high`/`@platform-*`/`@domain-*` taxonomy.
18
+ - Generate step bindings into a dedicated directory (e.g. `.features-gen/`) and add it to `.gitignore`; never commit generated specs, and point `testDir` at that directory.
19
+ - Drive runs by tag expression (`npx bddgen && npx playwright test --grep "@smoke and not @flaky"`), not filename globs; fail the run when generation matches zero scenarios.
20
20
  - Inject fixtures via `createBdd` rather than pulling singletons from module scope; reset persistent state through fixture teardown, not stray `After` hooks.
21
21
  - Reuse `storageState` for authenticated scenarios — create a logged-in user fixture instead of repeating login steps in `Background`.
22
- - Keep `trace: 'on-first-retry'` (or `'retain-on-failure'`) enabled; reproduce failures by `@scenario-id` tag, not by title.
22
+ - Keep `trace: 'on-first-retry'` (or `'retain-on-failure'`) enabled; reproduce failures by `@scenario-id` tag, not by title, and use `PWDEBUG=1` rather than `page.pause()` in step files.
23
23
  - Shard with Playwright's native `--shard=i/N`; never partition by tag expression across CI jobs.
24
+ - Use Playwright projects (not Cucumber profiles) for browser matrix fan-out, so sharding, retries, and trace config stay in one place.
24
25
 
25
26
  Guidance for running Gherkin `.feature` files against Playwright via
26
27
  `playwright-bdd`. Pairs with the `gherkin-authoring` skill (scenario prose) and
@@ -30,157 +31,31 @@ between them.
30
31
  > **Version:** consumers pick their own `playwright-bdd` version. This skill
31
32
  > documents behavioral constraints, not a pinned release.
32
33
 
33
- ## Pre-authoring checklist (mandatory)
34
-
35
- The agent MUST complete every item below AND MUST include the results in its
36
- output report BEFORE any scenario text is written. See
37
- [§ Step Reuse — Grep Before You Write](../../../../rules/gherkin-standards.md#step-reuse--grep-before-you-write)
38
- for rationale.
39
-
40
- 1. Run `rg` against the project's steps directory and list every step signature
41
- you will reuse. Format: one `Given/When/Then "…"` per line.
42
- 2. For each scenario line you plan to author, identify the matching existing
43
- step. For any line with no match, either rephrase to reuse an existing step
44
- or record it as a gap. Do NOT author new step definitions during scenario
45
- authoring.
46
- 3. State the canonical domain tag and platform tag you will apply (or note
47
- "Cross-Platform no platform tag" per `gherkin-standards.md`).
48
- 4. Confirm the AC's `data-testid`, URL, and payload hints will be stripped from
49
- scenario prose.
50
-
51
- If you cannot complete every item, stop and report — do not proceed to scenario
52
- authoring.
53
-
54
- ## 1. Core Principles
55
-
56
- - **One source of truth per scenario:** `.feature` files describe intent; step
57
- definitions translate intent into Playwright calls. Never author browser
58
- actions in `.feature` prose.
59
- - **Deterministic tag filtering:** every scenario carries enough tags that any
60
- CI shard can be selected by a tag expression without inspecting file paths.
61
- - **Fixture-per-scenario isolation:** scenarios must not share mutable state.
62
- Treat each scenario as a fresh browser context.
63
- - **Trace-first debugging:** keep the Playwright Trace Viewer workflow intact —
64
- `playwright-bdd` wraps Playwright, it does not replace its diagnostics.
65
-
66
- ## 2. Config Patterns
67
-
68
- - Generate step-definition bindings into a dedicated output directory (commonly
69
- `.features-gen/`) and add it to `.gitignore`. Do not commit generated specs.
70
- - Point `playwright.config.ts` at the generated directory via `testDir`; keep a
71
- single `defineBddConfig` block that lists `features` and `steps` paths.
72
- - Register the Cucumber HTML/JSON reporter alongside the Playwright HTML
73
- reporter so a headless CI invocation emits machine-readable evidence
74
- alongside the agent-driven `/qa-run` sweep.
75
- - Use Playwright projects (not Cucumber profiles) for browser matrix fan-out —
76
- keeps sharding, retries, and trace config in one place.
77
-
78
- ## 3. Fixture Composition
79
-
80
- - Extend Playwright's `test` via `playwright-bdd`'s `createBdd` so fixtures
81
- (auth state, API clients, seeded data) are injected into `Given`/`When`/
82
- `Then` callbacks by name, not pulled from module-level singletons.
83
- - Layer fixtures: base Playwright fixtures → domain fixtures (authenticated
84
- user, seeded tenant) → scenario-scoped helpers. Each layer depends only on the
85
- layer below.
86
- - Reset persistent state with fixture teardown, not with `After` hooks buried in
87
- step files — teardown order is then deterministic and visible in the fixture
88
- graph.
89
- - Reuse `storageState` for authenticated scenarios; create a "logged-in user"
90
- fixture rather than repeating login steps in `Background`.
91
-
92
- ## 4. Tag-Filtered Execution
93
-
94
- - Drive runs via tag expressions, not filename globs:
95
- `npx bddgen && npx playwright test --grep "@smoke and not @flaky"`.
96
- - Use the canonical tag taxonomy defined in
97
- [`.agents/rules/gherkin-standards.md`](../../../../rules/gherkin-standards.md#tag-taxonomy)
98
- (`@smoke`, `@risk-high`, `@platform-*`, `@domain-*`). Do not invent parallel
99
- tag vocabularies in the runner config; extend via `@domain-*` only.
100
- - Wire tag-filtered headless runs to a single npm script so operators never
101
- reconstruct the generate-then-run sequence by hand; the agent-driven
102
- `/qa-run` selector mirrors the same tag expressions for browser sweeps.
103
- - Fail the run if generation produces zero matching scenarios — a silent empty
104
- suite is worse than a red build.
105
-
106
- ## 5. Debug & Trace Workflow
107
-
108
- - Keep `trace: 'on-first-retry'` (or `'retain-on-failure'`) in the Playwright
109
- config. `playwright-bdd` preserves the trace attachment because each scenario
110
- maps to a Playwright test.
111
- - Reproduce a single failing scenario with `--grep "@scenario-id"` rather than
112
- the scenario title — titles change, tags are stable.
113
- - Open traces with `npx playwright show-trace` against the artifact produced
114
- under `test-results/`; the trace timeline annotates each `Given`/`When`/
115
- `Then` step, which is the primary debug affordance.
116
- - For step-definition bugs, run with `PWDEBUG=1` to drop into the inspector at
117
- the failing step — do not add `page.pause()` calls inside step files.
118
-
119
- ## 6. Sharding & CI Notes
120
-
121
- - Shard with Playwright's native `--shard=i/N`; do not partition by tag
122
- expression across jobs — tag-sharding makes flake triage non-deterministic.
123
- - Run `bddgen` once per job before `playwright test`; cache the generated
124
- directory only if the cache key includes every `.feature` and step file.
125
- - Publish the Cucumber HTML/JSON report as the evidence artifact, alongside
126
- the Playwright HTML report and any trace zips.
127
- - Quarantine `@flaky` scenarios with a dedicated job that does not gate the
128
- merge queue; do not silently retry flakes in the main suite.
129
-
130
- ## Recommended invocation template
131
-
132
- Use this template when invoking a subagent to author a `.feature` file from an
133
- Acceptance Criterion.
134
-
135
- ```text
136
- You are an AI coding agent. Your sole task is to invoke the
137
- **stack/qa/playwright-bdd** skill (defined in this repo) to author one new
138
- acceptance scenario from a single Acceptance Criterion. You receive nothing
139
- about this codebase except the AC text and the skill itself — you must
140
- discover everything else (existing step library, naming conventions, etc.)
141
- through the skill's prescribed workflow.
142
-
143
- Follow the skill's guidance precisely. Your output will be evaluated
144
- against `.agents/rules/gherkin-standards.md`.
145
-
146
- **Skill to invoke.** Read `.agents/skills/stack/qa/playwright-bdd/SKILL.md`
147
- and follow it. Also read `.agents/rules/gherkin-standards.md` (which the
148
- skill references).
149
-
150
- **The Acceptance Criterion (your sole input).** {{AC_TEXT}}
151
-
152
- **Your task.**
153
- 1. Read the skill and the gherkin rule.
154
- 2. Per the skill's "Step Reuse — Grep Before You Write" section, grep
155
- {{STEPS_DIR}} to discover the existing step vocabulary BEFORE
156
- authoring. List the matches you found.
157
- 3. Author a NEW `.feature` file at {{OUTPUT_PATH}} that covers this AC.
158
- 4. You are FORBIDDEN from editing any file under {{STEPS_DIR}}. This
159
- task tests scenario authorship and step REUSE. If a step you need does
160
- not exist, you must either rephrase the scenario to reuse what exists,
161
- or report that as a gap (do not silently invent).
162
- 5. Tag the feature/scenario per the canonical taxonomy in
163
- `gherkin-standards.md`.
164
- 6. Honor every "Forbidden Patterns" rule. `data-testid` hints in the AC
165
- parentheses are for the step-definition layer; they MUST NOT appear in
166
- your scenario text.
167
-
168
- **Report back.** Sections A–E: discovered steps, exact `.feature` content,
169
- step-coverage analysis, forbidden-patterns self-audit, uncertainty/gaps.
170
- ```
171
-
172
- This template encodes the invocation prompt used in the Epic C pilot of
173
- dsj1984/athlete-portal, where a general-purpose subagent — given only an AC and
174
- a pointer to this skill — produced a publishable scenario on the first attempt
175
- with **zero Forbidden-Patterns violations**, reused **4 of 5** needed steps from
176
- the existing library, and surfaced the single remaining step as a clean, named
177
- gap rather than inventing one. Future maintainers: resist the urge to "simplify"
178
- this template. Its explicit grep-before-author step, the hard prohibition on
179
- editing the steps directory, and the mandated gap-report section are what forced
180
- those outcomes.
181
-
182
- ## 7. Cross-References
34
+ ## Project-Specific Wiring
35
+
36
+ The capsule above is the contract. Three points bind this runtime to the rest
37
+ of the framework:
38
+
39
+ - **Tags come from one taxonomy.** Selection uses the canonical set defined in
40
+ [`.agents/rules/gherkin-standards.md` § Tag Taxonomy](../../../../rules/gherkin-standards.md#tag-taxonomy)
41
+ (`@smoke`, `@risk-high`, `@platform-*`, `@domain-*`, `@flaky`, `@skip`). Do
42
+ not invent parallel tag vocabularies in the runner config; extend via
43
+ `@domain-*` only. The agent-driven `/qa-run` selector mirrors the same tag
44
+ expressions, so a scenario set is addressable identically from both surfaces.
45
+ - **`@flaky` runs in its own non-gating job.** Quarantine `@flaky` scenarios in
46
+ a dedicated CI job that does not gate the merge queue, and never silently
47
+ retry flakes inside the gating suite. `@flaky` is a debt marker with an owner,
48
+ not a permanent label.
49
+ - **The Cucumber JSON report is the headless evidence artifact.** Register the
50
+ Cucumber HTML/JSON reporter alongside the Playwright HTML reporter and publish
51
+ it (with the trace zips) so a headless CI invocation emits machine-readable
52
+ evidence next to the agent-driven [`/qa-run`](../../../../workflows/qa-run.md)
53
+ sweep. Wire the generate-then-run sequence to a single npm script so operators
54
+ never reconstruct it by hand.
55
+
56
+ ## Cross-References
183
57
 
184
58
  - Scenario authoring rules: `.agents/rules/gherkin-standards.md`.
59
+ - Scenario authoring skill: `.agents/skills/stack/qa/gherkin-authoring/SKILL.md`.
185
60
  - Browser-level conventions: `.agents/skills/stack/qa/playwright/SKILL.md`.
186
61
  - Operator entry point: `.agents/workflows/qa-run.md`.