@orion-qa/orion 3.4.0 → 3.5.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 (71) hide show
  1. package/.claude/agents/change-agent.md +1 -1
  2. package/.claude/agents/requirement-analyst.md +1 -1
  3. package/.claude/agents/test-reporter.md +1 -1
  4. package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/BaseScreen.java +36 -2
  5. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/unit/UtilsTest.java +10 -0
  6. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/AutomationError.java +21 -0
  7. package/.claude/skills/automation-implementation/SKILL.md +2 -2
  8. package/.claude/skills/automation-implementation/references/patterns.md +14 -0
  9. package/.claude/skills/change-management/SKILL.md +1 -1
  10. package/.claude/skills/code-review/SKILL.md +1 -1
  11. package/.claude/skills/code-review/references/pattern-rules.md +4 -0
  12. package/.claude/skills/documentation/SKILL.md +2 -1
  13. package/.claude/skills/execution/SKILL.md +1 -0
  14. package/.claude/skills/failure-analysis/SKILL.md +1 -0
  15. package/.claude/skills/failure-analysis/references/bug-report-standard.md +27 -0
  16. package/.claude/skills/orion/SKILL.md +6 -3
  17. package/.claude/skills/orion/references/conversation.md +1 -1
  18. package/.claude/skills/orion/references/project-context-files.md +3 -1
  19. package/.claude/skills/orion/references/setup-card.md +3 -2
  20. package/.claude/skills/orion/scripts/browser_setup.mjs +4 -4
  21. package/.claude/skills/orion/scripts/case_check.mjs +69 -0
  22. package/.claude/skills/orion/scripts/cases_coverage.py +179 -0
  23. package/.claude/skills/orion/scripts/cases_export.py +3 -0
  24. package/.claude/skills/orion/scripts/cases_model.py +256 -0
  25. package/.claude/skills/orion/scripts/context_guard.mjs +172 -0
  26. package/.claude/skills/orion/scripts/graph.mjs +112 -22
  27. package/.claude/skills/orion/scripts/lib/scan.mjs +8 -2
  28. package/.claude/skills/orion/scripts/report_make.mjs +15 -11
  29. package/.claude/skills/orion/scripts/run_state.mjs +4 -0
  30. package/.claude/skills/orion/scripts/screen_map.mjs +392 -0
  31. package/.claude/skills/orion/scripts/suite_check.mjs +1 -1
  32. package/.claude/skills/playwright/templates/dotnet/PageObjects/BasePage.cs +46 -0
  33. package/.claude/skills/playwright/templates/dotnet/Tests/Unit/UtilsTests.cs +10 -0
  34. package/.claude/skills/playwright/templates/dotnet/Utils/AutomationError.cs +19 -1
  35. package/.claude/skills/playwright/templates/javascript/pageObjects/basePage.js +52 -0
  36. package/.claude/skills/playwright/templates/javascript/reporters/summaryReporter.js +18 -9
  37. package/.claude/skills/playwright/templates/javascript/tests/unit/basePage.test.js +51 -0
  38. package/.claude/skills/playwright/templates/javascript/utils/errors.js +9 -2
  39. package/.claude/skills/playwright/templates/project/pageObjects/basePage.ts +54 -1
  40. package/.claude/skills/playwright/templates/project/reporters/summaryReporter.ts +18 -9
  41. package/.claude/skills/playwright/templates/project/tests/unit/basePage.test.ts +52 -0
  42. package/.claude/skills/playwright/templates/project/utils/errors.ts +12 -2
  43. package/.claude/skills/playwright/templates/python/page_objects/base_page.py +43 -0
  44. package/.claude/skills/playwright/templates/python/tests/unit/test_fail_fast_helpers.py +57 -0
  45. package/.claude/skills/playwright/templates/python/utils/errors.py +7 -3
  46. package/.claude/skills/requests/templates/python-pytest/src/services/api_client.py +11 -1
  47. package/.claude/skills/requests/templates/python-pytest/tests/unit/test_api_client.py +16 -0
  48. package/.claude/skills/requirement-analysis/references/test-case-import.md +9 -1
  49. package/.claude/skills/requirement-analysis/scripts/tm.py +422 -2
  50. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Flags.java +19 -0
  51. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/ApiSpec.java +10 -3
  52. package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/BasePage.cs +89 -11
  53. package/.claude/skills/selenium/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +10 -0
  54. package/.claude/skills/selenium/templates/csharp-nunit/Utils/AutomationError.cs +19 -1
  55. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/BasePage.java +65 -8
  56. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +10 -0
  57. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/AutomationError.java +21 -0
  58. package/.claude/skills/selenium/templates/python-pytest/page_objects/base_page.py +70 -11
  59. package/.claude/skills/selenium/templates/python-pytest/tests/unit/test_fail_fast_helpers.py +43 -0
  60. package/.claude/skills/selenium/templates/python-pytest/utils/errors.py +7 -3
  61. package/.claude/skills/test-design/SKILL.md +1 -0
  62. package/.claude/skills/test-design/references/test-case-standard.md +31 -0
  63. package/.claude/skills/test-reporting/SKILL.md +1 -0
  64. package/.claude/skills/ui-observation/SKILL.md +5 -2
  65. package/.claude-plugin/plugin.json +1 -1
  66. package/.cursor/rules/orion-quiet.mdc +13 -0
  67. package/AGENTS.md +1 -1
  68. package/README.md +2 -2
  69. package/bin/orion.mjs +5 -1
  70. package/hosts/gemini-extension/gemini-extension.json +1 -1
  71. package/package.json +2 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: change-agent
3
3
  description: Pushes an approved diff to a work branch (mode push, before CI runs) or opens the pull request (mode pr, after the user accepts), only when the brief carries a recorded authorization D-nnn.
4
- tools: Read, Bash(cd:*), Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git rev-parse:*), Bash(git checkout -b:*), Bash(git switch:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*), mcp__github-write, mcp__bitbucket-write, mcp__ado-write__repo_repository, mcp__ado-write__repo_branch, mcp__ado-write__repo_pull_request, mcp__ado-write__repo_pull_request_write, mcp__gitlab-write
4
+ tools: Read, Bash(cd:*), Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git rev-parse:*), Bash(git checkout -b:*), Bash(git switch:*), Bash(git add:*), Bash(git commit:*), Bash(node .claude/skills/orion/scripts/context_guard.mjs check:*), Bash(git push:*), mcp__github-write, mcp__bitbucket-write, mcp__ado-write__repo_repository, mcp__ado-write__repo_branch, mcp__ado-write__repo_pull_request, mcp__ado-write__repo_pull_request_write, mcp__gitlab-write
5
5
  disallowedTools: Edit, Write, WebFetch
6
6
  mcpServers:
7
7
  - gitlab-write:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: requirement-analyst
3
3
  description: Turns a user story, issue key or requirement text into an Automation Intent with numbered acceptance criteria, business rules and open ambiguities. Delegate for Gate 1 (requirement validation).
4
- tools: Read, mcp__atlassian-read__atlassianUserInfo, mcp__atlassian-read__getAccessibleAtlassianResources, mcp__atlassian-read__getVisibleJiraProjects, mcp__atlassian-read__getJiraIssue, mcp__atlassian-read__searchJiraIssuesUsingJql, mcp__atlassian-read__getJiraIssueRemoteIssueLinks, mcp__atlassian-read__getConfluencePage, mcp__atlassian-read__searchConfluenceUsingCql, mcp__ado-read__wit_work_item, mcp__ado-read__wit_query, mcp__ado-read__testplan, mcp__trello-read, mcp__zephyr-read, Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py testrail-cases:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py testrail-cases:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py testrail-cases:*), Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py xray-tests:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py xray-tests:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py xray-tests:*), Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py xlsx-to-csv:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py xlsx-to-csv:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py xlsx-to-csv:*)
4
+ tools: Read, mcp__atlassian-read__atlassianUserInfo, mcp__atlassian-read__getAccessibleAtlassianResources, mcp__atlassian-read__getVisibleJiraProjects, mcp__atlassian-read__getJiraIssue, mcp__atlassian-read__searchJiraIssuesUsingJql, mcp__atlassian-read__getJiraIssueRemoteIssueLinks, mcp__atlassian-read__getConfluencePage, mcp__atlassian-read__searchConfluenceUsingCql, mcp__ado-read__wit_work_item, mcp__ado-read__wit_query, mcp__ado-read__testplan, mcp__trello-read, mcp__zephyr-read, Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py testrail-cases:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py testrail-cases:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py testrail-cases:*), Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py xray-tests:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py xray-tests:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py xray-tests:*), Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py xlsx-to-csv:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py xlsx-to-csv:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py xlsx-to-csv:*), Bash(python3 .claude/skills/orion/scripts/cases_model.py:*), Bash(py .claude/skills/orion/scripts/cases_model.py:*), Bash(python .claude/skills/orion/scripts/cases_model.py:*), Bash(python3 .claude/skills/orion/scripts/cases_coverage.py:*), Bash(py .claude/skills/orion/scripts/cases_coverage.py:*), Bash(python .claude/skills/orion/scripts/cases_coverage.py:*)
5
5
  disallowedTools: Edit, Write, Bash, WebFetch
6
6
  mcpServers:
7
7
  - trello-read:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: test-reporter
3
3
  description: Publishes validated reports, files approved defect drafts, exports accepted test cases and writes run results to test-management tools (Xray, Zephyr Scale, Azure Test Plans, TestRail) and Confluence, only with a recorded H9 authorization that lists every item; builds sprint, release and trend reports from run records. Delegate after Gate 8, after design-mode acceptance, for an approved defect draft, or for report mode.
4
- tools: Read, Grep, Glob, mcp__atlassian-read__getAccessibleAtlassianResources, mcp__atlassian-read__getJiraIssue, mcp__atlassian-read__searchJiraIssuesUsingJql, mcp__atlassian-read__getConfluencePage, mcp__atlassian-read__searchConfluenceUsingCql, mcp__atlassian-write__createJiraIssue, mcp__atlassian-write__addCommentToJiraIssue, mcp__atlassian-write__createConfluencePage, mcp__atlassian-write__updateConfluencePage, Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py testrail-add-result:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py testrail-add-result:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py testrail-add-result:*), Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py xray-import-junit:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py xray-import-junit:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py xray-import-junit:*)
4
+ tools: Read, Grep, Glob, mcp__atlassian-read__getAccessibleAtlassianResources, mcp__atlassian-read__getJiraIssue, mcp__atlassian-read__searchJiraIssuesUsingJql, mcp__atlassian-read__getConfluencePage, mcp__atlassian-read__searchConfluenceUsingCql, mcp__atlassian-write__createJiraIssue, mcp__atlassian-write__addCommentToJiraIssue, mcp__atlassian-write__createConfluencePage, mcp__atlassian-write__updateConfluencePage, Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py testrail-add-result:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py testrail-add-result:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py testrail-add-result:*), Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py xray-import-junit:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py xray-import-junit:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py xray-import-junit:*), Bash(python3 .claude/skills/requirement-analysis/scripts/tm.py push-cases:*), Bash(py .claude/skills/requirement-analysis/scripts/tm.py push-cases:*), Bash(python .claude/skills/requirement-analysis/scripts/tm.py push-cases:*), Bash(python3 .claude/skills/orion/scripts/cases_model.py to-json:*), Bash(py .claude/skills/orion/scripts/cases_model.py to-json:*), Bash(python .claude/skills/orion/scripts/cases_model.py to-json:*)
5
5
  disallowedTools: Edit, Write, Bash, WebFetch
6
6
  mcpServers:
7
7
  - atlassian-read:
@@ -56,7 +56,36 @@ public abstract class BaseScreen {
56
56
  * @return the element
57
57
  */
58
58
  protected WebElement visible(By locator) {
59
- return wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
59
+ return ensureVisible(locator, locator.toString());
60
+ }
61
+
62
+ /**
63
+ * Requires an element to be visible, and fails fast with a named reason when it isn't: what was missing, on which
64
+ * screen, after how long. One bounded wait (no polling loop, no Thread.sleep).
65
+ *
66
+ * @param locator the element's locator
67
+ * @param what the element in the user's words, e.g. "the Login button"
68
+ * @return the element
69
+ * @throws AutomationError "Wait for <what>: not visible within <n>s (screen: <screen>)"
70
+ */
71
+ protected WebElement ensureVisible(By locator, String what) {
72
+ try {
73
+ return wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
74
+ } catch (TimeoutException e) {
75
+ throw new AutomationError("Wait for", what, "not visible within " + Flags.timeout().toSeconds() + "s",
76
+ java.util.Map.of("screen", getClass().getSimpleName()));
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Asks whether an element is shown, without failing: for choosing a path in a screen action, never for what a
82
+ * test checks. @toolkit: kept for screen actions to reuse.
83
+ *
84
+ * @param locator the element's locator
85
+ * @return whether it is shown now (no implicit wait)
86
+ */
87
+ protected boolean isShown(By locator) {
88
+ return driver.findElements(locator).stream().anyMatch(WebElement::isDisplayed);
60
89
  }
61
90
 
62
91
  /**
@@ -77,7 +106,12 @@ public abstract class BaseScreen {
77
106
  * @param locator the element's locator
78
107
  */
79
108
  protected void tap(By locator) {
80
- wait.until(ExpectedConditions.elementToBeClickable(locator)).click();
109
+ try {
110
+ wait.until(ExpectedConditions.elementToBeClickable(locator)).click();
111
+ } catch (TimeoutException e) {
112
+ throw new AutomationError("Tap", locator.toString(), "not clickable within " + Flags.timeout().toSeconds() + "s",
113
+ java.util.Map.of("screen", getClass().getSimpleName()));
114
+ }
81
115
  }
82
116
 
83
117
  /**
@@ -3,6 +3,7 @@ package automation.tests.unit;
3
3
  import static org.testng.Assert.assertEquals;
4
4
  import static org.testng.Assert.assertTrue;
5
5
 
6
+ import automation.utils.AutomationError;
6
7
  import automation.utils.Dates;
7
8
  import automation.utils.RandomData;
8
9
  import java.time.LocalDate;
@@ -31,4 +32,13 @@ public class UtilsTest {
31
32
  public void addDaysAndIsoDateFromAFixedDay() {
32
33
  assertEquals(Dates.isoDate(Dates.addDays(1, LocalDate.of(2026, 1, 31))), "2026-02-01");
33
34
  }
35
+
36
+ /** AutomationError names what, where and how long, plus the screen; the three-part form is unchanged. */
37
+ @Test(groups = "unit")
38
+ public void automationErrorCarriesContext() {
39
+ assertEquals(new AutomationError("Wait for", "the Login button", "not visible within 10s",
40
+ java.util.Map.of("screen", "LoginScreen")).getMessage(),
41
+ "Wait for the Login button: not visible within 10s (screen: LoginScreen)");
42
+ assertEquals(new AutomationError("Open", "app", "not installed").getMessage(), "Open app: not installed");
43
+ }
34
44
  }
@@ -15,4 +15,25 @@ public class AutomationError extends RuntimeException {
15
15
  public AutomationError(String action, String where, String detail) {
16
16
  super(action + " " + where + ": " + detail);
17
17
  }
18
+
19
+ /**
20
+ * Builds the message from its three parts plus facts that help the reader, e.g. the screen or the item.
21
+ *
22
+ * @param action what the suite was doing
23
+ * @param where the URL or element it was acting on
24
+ * @param detail what came back
25
+ * @param context facts in order, e.g. {@code Map.of("screen", "LoginScreen")}; empty values are left out
26
+ */
27
+ public AutomationError(String action, String where, String detail, java.util.Map<String, String> context) {
28
+ super(action + " " + where + ": " + detail + facts(context));
29
+ }
30
+
31
+ /** @return " (key: value, …)" for the non-empty facts, or "" */
32
+ private static String facts(java.util.Map<String, String> context) {
33
+ String joined = context.entrySet().stream()
34
+ .filter(e -> e.getValue() != null && !e.getValue().isEmpty())
35
+ .map(e -> e.getKey() + ": " + e.getValue())
36
+ .collect(java.util.stream.Collectors.joining(", "));
37
+ return joined.isEmpty() ? "" : " (" + joined + ")";
38
+ }
18
39
  }
@@ -15,7 +15,7 @@ description: Writes or modifies automated tests in the project's existing style,
15
15
  0. **Where you write.** The test project from the brief's `project` field ([work-branch.md](../orion/references/work-branch.md)): `sut/<short-app-name>/` when the workspace is the agent install (it holds `.claude/` or `registry/`), else the existing suite. Never write `package.json`, `pages/`, `tests/`, `.env`, `node_modules/` or `test-results/` at the install root, and never use `project-context/` as the project. A suite already written elsewhere stays where it is unless the user asks. Record `base` (`git rev-parse HEAD`, or `none` when the repo has no commit) before the first edit. Claude Code: in `sut/<app>/` write there directly (no commit or worktree needed); in an existing repo with a commit, create a worktree on the brief's work branch before the first edit (`git worktree add ../<repo>-<run> -b <work_branch>`, run from inside the repo) and put its absolute path and `base` in `Artifacts`. Cursor and single-agent hosts: work on the local branch `work_branch` from the brief. Copilot Studio: write only to `work_branch` through the GitHub write tool, and only when the brief cites the H3 D-nnn for it; create the branch if it doesn't exist, and if it already exists but wasn't created in this run, stop with `needs_user` (never write into another run's branch). **Chat delivery** (`build` mode, no repo, or a host with no file system): write nothing; return every file in full in `Artifacts` as its path followed by one code block, start from the adapter's starter template, and mark compile, fail check and runs `not run` unless the brief says the host can run them.
16
16
  0a. **Packaging and render tasks** (`orion/references/delivery-formats.md`): a zip of the delivered project is made after the checks with the pack script there (next to the project folder, or at the top of your worktree; never outside it), and listed before you return its path. Test-case files (Excel, PDF, Word and the rest) are written by the orchestrator with `cases_export.py`, not by you.
17
17
  1. Load the adapter skills named in the technology profile. No adapter → stop with NEEDS_ADAPTER.
18
- - **New project** (the default stack, or one the user named): copy the adapter's starter template (`templates/<stack>/`, listed in its `templates/README.md`) into the test project, get its smoke test green, then continue. Never start from, copy or read code in the platform's `evals/` (fixtures and reference suites are the answer key) or another app's suite; every page object and test comes from this app's pages as you explored them. Structure follows the layers in [patterns.md](references/patterns.md): config, errors, base page, pages, flows, fixtures, data, tests, runner config.
18
+ - **New project** (the default stack, or one the user named): copy the adapter's starter template (`templates/<stack>/`, listed in its `templates/README.md`) into the test project, get its smoke test green, then continue. Starter parts the story and the site don't use (a sample API check for a site with no public API, a sign-out step the site does differently) are removed or adapted to the explored site without asking, and listed in the report under what was changed; never stop the build to ask about them. Never start from, copy or read code in the platform's `evals/` (fixtures and reference suites are the answer key) or another app's suite; every page object and test comes from this app's pages as you explored them. Structure follows the layers in [patterns.md](references/patterns.md): config, errors, base page, pages, flows, fixtures, data, tests, runner config.
19
19
  - **The account:** a test account the user pasted goes into the project's `.env` (`BASE_URL`, `E2E_USER`, `E2E_PASSWORD`; `HTTP_USER`, `HTTP_PASSWORD` only for a different browser login prompt), which the template's `.gitignore` ignores; check with `git check-ignore .env` before writing it. That is the only copy: never `playwright/.auth/http.json`, never a file outside the project, never a value in notes or logs. Write it with one command from inside the project (`printf … > .env` in bash; `[IO.File]::WriteAllLines` in PowerShell, never `>` there: [conversation.md](../orion/references/conversation.md) item 6) and never read it back (`grep -c '^NAME=' .env` checks a name); run git from inside the folder (`git check-ignore .env`), never `git -C`.
20
20
  - **New adapter** (H12 D-nnn): use the `adapter-authoring` skill instead of this procedure.
21
21
  2. Plan the files: new tests where the strategy says. **In an existing suite, the approved file plan is the limit** (the test-case checkpoint's "Files" line, recorded in `test-designs/<story>/design.md`): change the files it lists and create only the new files it lists. Everything else goes into the suite's existing files: test data into its data file (e.g. `data/users.ts`), never a new data, desc, helper or config file of Orion's own layout (no `*.desc.*`, no `resources/`, no `testData` file the suite doesn't have). A file the plan didn't list is needed: stop and say which and why; the orchestrator asks the user before it is added. Before returning, `git status --porcelain` lists every new and changed file; one outside the plan is removed. **Search before you add** (AGENTS rule 7): for every page object, method, locator, helper, fixture, data builder, sign-in or config you would add, search the repo first (Grep by name, selector, URL fragment, visible text) as well as the reuse report; reuse or extend what exists. Add new only when nothing fits, and list each search in `Findings` (`searched: <terms> → <hits> → reused <file:line> | new because <reason>`). An existing helper that is wrong for this case is extended or reported, never copied.
@@ -37,7 +37,7 @@ description: Writes or modifies automated tests in the project's existing style,
37
37
  7. **App login.** Use the project's existing sign-in (helper, fixture, setup project, base class) for the method the UI map's `Login` section records. If none exists, add one per [login-methods.md](../ui-observation/references/login-methods.md) section 5 for that method (form, HTTP auth prompt, SSO, saved session, MFA seed) in the project's pattern, with credentials from environment variables named in `environment-profile.md`; never in code, fixtures or URLs. Sign in once per worker or suite and reuse the session, unless the AC is about sign-in.
38
38
  8. **Traceability by id:** every test name carries the case id it implements and its AC (`TS-3 @AC-2 adds the first in-stock product at quantity 1`), or the project's own way of linking (tag, annotation). `@smoke` is not a case id. Every AC in the design is a test, or the result names it with the reason it isn't (Gate 8).
39
39
  9. **Format what you wrote, then check it.** Run the formatter Gate 4 names on the files you added or changed only, never the whole repo (`npx prettier --write <files>`; `ruff format <files>`; `dotnet format --include <files>`; Spotless `mvn spotless:apply` only where the project has it); no formatter named → skip and say so. Then run the project's compile/lint/type-check command (TypeScript: `npx tsc --noEmit`); a failure is fixed, never skipped. Install the dependencies with the project's lockfile or manifest command (`execution` step 2); in a build's test project that is part of the request, elsewhere the host asks (H10). **The browser goes where the runner looks by default** (`npx playwright install chromium` without `PLAYWRIGHT_BROWSERS_PATH`), or the path is set in the project's own script; never only in a temporary sandbox cache. The run that counts is the project's command from a normal shell with no sandbox browser variable; if the browser isn't on the default path, the result says so.
40
- 10. **Fail check (each new test).** Running a test executes project code, so do this only when the brief cites H6 for local or container runs, or a build request's D-nnn (its new tests, in its test project); otherwise write `fail check: not run — no H6`. Prove the test can fail: in your worktree, temporarily change the expected value of its main assertion in place (in the spec itself: no copy of the spec, no second config, no new file in the suite), run that one test with the project's own runner, confirm it fails on that assertion, then restore the file and confirm `git diff` for it matches your intended change only. Record the failing run as a `command` evidence row. Can't run tests here (no runner, Copilot Studio) → write `fail check: not run — <reason>` in Findings; the report carries it as a limitation.
40
+ 10. **Fail check (each new test).** Running a test executes project code, so do this only when the brief cites H6 for local or container runs, or a build request's D-nnn (its new tests, in its test project); otherwise write `fail check: not run — no H6`. Prove the test can fail: in your worktree, temporarily change the expected value of its main assertion in place (in the spec itself: no copy of the spec, no second config, no new file in the suite), run that one test with the project's own runner, confirm it fails on that assertion, then restore (several new tests: change each one's main expected value at once and run them together in one run; each must fail on its own assertion; any that doesn't is checked alone). Run that fail-check run with a short assertion wait where the project reads one from the environment (the starters: `EXPECT_TIMEOUT=3000`; a deliberately wrong value never appears, so a long wait only costs time; never in a counted run); a test that then fails on a different assertion is checked alone with the normal wait. Then restore the file and confirm `git diff` for it matches your intended change only. Record the failing run as a `command` evidence row. Can't run tests here (no runner, Copilot Studio) → write `fail check: not run — <reason>` in Findings; the report carries it as a limitation.
41
41
  11. For heals: apply exactly the approved change, nothing else.
42
42
  11a. **Keep screenshots out of the repo.** UI story in an existing repo where `git check-ignore -q .ui-map/` fails: add the line `.ui-map/` to the clone's local ignore list, the file `git rev-parse --git-path info/exclude` names, never to the suite's tracked `.gitignore` (the suite's ignore file isn't edited, [work-branch](../orion/references/work-branch.md)). It changes no tracked file, so it isn't in `Changes`.
43
43
  12. List every changed file in `Changes`, and every **shared** file you changed (page objects, helpers, fixtures, config) separately, so the reviewer can find the impacted tests.
@@ -38,6 +38,20 @@ The reviewer checks all three (pattern rules P14–P18); a suite that fails one
38
38
  | **tests** | one test per case, named with its case id (`TS-3 adds the first in-stock product at quantity 1`); calls page objects and services with data from the test-data file; every assertion here; network checks only if observed, next to the assertion they support | raw click chains when a page method exists; `innerText` passed between steps; branching on app state |
39
39
  | **runner config** | one worker from the start on a shared staging host; `fullyParallel: false` with it; device presets spread **first**, then `baseURL`, `httpCredentials`, `storageState`, so a preset can't overwrite them; timeouts as long as the observed page needs, stated once | `fullyParallel: true` with `workers: 1`; a raised timeout to hide a race; retries on |
40
40
 
41
+ ## Fail fast, named and bounded (every stack; rules U16, U17, P19, P20)
42
+ A test should **fail at once with a sentence that says what is wrong**, not run into a generic timeout. Every helper that waits uses one bounded wait (the project's configured wait, sized from the site) and, on failure, raises the project's error type naming *what*, *where* and *how long*. A helper that only asks ("is the menu open?") is separate, quick, and never what a test checks.
43
+
44
+ | Stack | Require it (fails, named) | Ask (yes/no, quick) |
45
+ |---|---|---|
46
+ | Playwright JS/TS | `await basePage.ensureVisible(locator, 'the Webhooks section')` → `Wait for the Webhooks section: not visible within 10s (page: …)`; tests: `expect(locator, 'Webhooks section').toBeVisible()` | `await basePage.isShown(locator, { timeout: 2000 })` |
47
+ | Playwright Python | `expect(locator, "Webhooks section").to_be_visible(timeout=…)`, or the base page's `ensure_visible(locator, "the Webhooks section")` | `locator.is_visible()` after one short `wait_for` in `try` |
48
+ | Playwright .NET | `await Expect(locator).ToBeVisibleAsync(new() { Timeout = … })` wrapped in the base page's `EnsureVisibleAsync(locator, "the Webhooks section")` | `await locator.IsVisibleAsync()` after a short wait |
49
+ | Selenium (Java/C#/Python) | `new WebDriverWait(driver, timeout).withMessage("the Webhooks section is not visible on " + url).until(visibilityOf…)` (C#: `wait.Message = …`; Python: `WebDriverWait(...).until(EC.visibility_of_element_located(...), "the Webhooks section …")`) | `!driver.findElements(by).isEmpty()` (no implicit wait), or a short `WebDriverWait` in `try` |
50
+ | Appium | the same `WebDriverWait` with a message, by accessibility id | `findElements(...).size() > 0` |
51
+ | API (requests, REST Assured, HttpClient, Newman, Karate) | the client checks the status and fails naming method, path, status and the first part of the body: `POST /tasks: HTTP 500, expected 201 (body: {"error":…})`; never returns a failed response for the test to puzzle over | a `GET` that returns `None`/`null` on 404, named `find…` |
52
+
53
+ **Also:** a search over pages or items stops at a maximum and fails naming it; an action checks its arguments first; more than two optional settings go by name; a setting is *set* to a state, not toggled. **Never:** a loop with `sleep` around a visibility check, `while (true)`, a fixed sleep "for the UI to settle", a fallback to other data, a `verify…` that returns `false`, a `throwError=false` flag on an action, a JavaScript click that bypasses what a user could do.
54
+
41
55
  ## Documentation, every language
42
56
  Every function, method, class and fixture has a documentation comment that says what it does, what it expects and what it returns: JSDoc `/** … */` (TypeScript, JavaScript), Javadoc (Java), a docstring (Python), `///` XML doc comments (C#). A generated file with an undocumented function fails the build; a class comment doesn't cover its methods. This applies whether or not the project used doc comments before.
43
57
 
@@ -16,7 +16,7 @@ The brief names a **mode** and the worktree path or work branch (`orion/referenc
16
16
  2. **mode: push** (before Gate 6, so CI can run the new tests):
17
17
  a. Create the branch named in D-nnn from the worktree's HEAD (`git checkout -b <branch>`; default form `<prefix>/<story-key>-<slug>-<YYYYMMDD-HHMM of the run id>`, prefix from the repo's convention, else `test/`; the run suffix keeps two users or runs on the same story apart). If it exists **from this run**, `git switch` to it; if it exists from anyone else's run, stop with `needs_user`: never reuse or overwrite another run's branch.
18
18
  b. Stage only files in the approved list. Anything else in the worktree → leave it and report it.
19
- c. Commit with the project's message convention (default `test(<scope>): <summary> (<KEY>)`); reference the issue key. `project-context/` changes go in a separate commit.
19
+ c. Commit with the project's message convention (default `test(<scope>): <summary> (<KEY>)`); reference the issue key. `project-context/` changes go in a separate commit, and only after `node .claude/skills/orion/scripts/context_guard.mjs check` exits 0 (no secret, e-mail address, screenshot or trace in what git would commit; it names file:line and kind, never the value). Exit 1 → leave `project-context/` uncommitted and report its findings; the test code commit goes ahead.
20
20
  d. Push the branch (never the default branch). The host asks the user first.
21
21
  e. Stop. No PR in this mode. Return the branch name and pushed commit SHA.
22
22
  3. **mode: pr** (after Gate 8): the branch is already pushed (from mode push or a final push under the same rules). Open the PR/MR to the target in D-nnn as a **draft** unless D-nnn says otherwise, titled `<KEY> <summary>`, with the description template below. Use the git provider's PR tool bound to you: GitHub `create_pull_request`, Azure DevOps `repo_pull_request_write` (`create`), Bitbucket's PR-create tool. Never set auto-complete or auto-merge, vote, or add/remove reviewers; the provider's own rules (CODEOWNERS, branch policies) request reviewers.
@@ -35,7 +35,7 @@ description: "Reviews an automation diff against the project's own conventions a
35
35
  # Code review
36
36
  | # | Severity | File:line | Finding | Rule (pattern-rules ID, adapter, convention row) |
37
37
  ## Pattern rules checked
38
- U1–U15, P1–P18: pass · hit (finding #) · n/a (why) · suggestion (project doesn't use the pattern)
38
+ U1–U17, P1–P20: pass · hit (finding #) · n/a (why) · suggestion (project doesn't use the pattern)
39
39
  ## Reused
40
40
  | Helper | Defined at (file:line) | Called at (file:line) |
41
41
  ## Impacted existing tests
@@ -20,6 +20,8 @@ One table for the implementer (self-check before returning) and the reviewer (ch
20
20
  | U13 | One place for the test account: the project's gitignored `.env`; config reads it lazily (importing a page never reads the env file or throws); no second credentials file; nothing outside the project; nothing at the agent-install root. | `throw` at module level in config; `dotenv` loaded in a page; `playwright/.auth/http.json`; paths under `~`, `.config`, `%USERPROFILE%`; `package.json`, `pages/`, `tests/` beside `.claude/` |
21
21
  | U14 | Runner config is coherent: no `fullyParallel: true` with `workers: 1`; one worker from the start on a shared staging host; device presets spread before `baseURL`, `httpCredentials`, `storageState`; retries off for the 3 counted runs. | `fullyParallel: true` next to `workers: 1`; `...devices[` after credential keys; `retries:` above 0 in the counted command |
22
22
  | U15 | Formatted: where the project or Gate 4 names a formatter, every new or changed file passes its check (`npx prettier --check <files>`, `ruff format --check <files>`, `dotnet format --verify-no-changes --include <files>`); files the run didn't touch are never reformatted. | the formatter's check on the changed files; a diff that reformats untouched code |
23
+ | U16 | **Fail fast, named, bounded (any stack).** Every wait in a helper or page/screen/API object has a limit (the project's configured wait, sized from the site), and a failure says *what* was missing, *where* (page, screen, endpoint) and *after how long*, through the project's error type (`AutomationError`, or its own). No unbounded loop (`while (true)`, `while not found`), no polling with sleeps, no retry loop without a maximum; a loop over pages or items has a maximum and fails naming it ("not found in 15 pages"). | `while (true)`, `while (!`, loops around `isVisible()`/`is_displayed()`/`isDisplayed()` with `sleep`/`waitForTimeout`/`Thread.sleep`/`time.sleep`, waits with no timeout, a generic timeout as the only failure message, an API helper that returns the response without checking its status |
24
+ | U17 | **No silent pass (any stack).** A helper never falls back to other data when the requested item isn't there (picking "the first value instead"), never swallows a failure behind a `throwError=false` / `fail_silently` flag in an action, and a `verify…`/`check…` method never returns `false` for "didn't match": it returns the data or throws, and the test asserts. Matching compares the whole expected value (or the named fields), not "any value contains any substring". A probe that may answer no is a separate, named helper (`isShown`, `is_present`) used only to choose a path, never as what a test checks. | `logger.warn(...)` followed by carrying on with another value, `catch { return false }` in a verify method, `throwError` / `raise_on_fail` parameters on actions, `.some(v => v.includes(` across all fields, `dispatchEvent('click')` / JS clicks that bypass what a user could do |
23
25
 
24
26
  ## P: the project's patterns (blocking for a new project from a starter template and for a project that already uses the pattern; otherwise follow the project and report the row as a non-blocking suggestion)
25
27
  | ID | Rule | Look for |
@@ -42,6 +44,8 @@ One table for the implementer (self-check before returning) and the reviewer (ch
42
44
  | P16 | **Test descriptions in the desc folder** (`resources/desc/<feature>.desc`, `<feature>_desc.py`, `desc/<Feature>Desc.java`, `Resources/Desc/<Feature>Desc.cs`): id, story, AC (one id, or a list when the case covers several), title, tags, preconditions, steps, expected; tests take title and tags from it (`titleOf`/`tagsOf`, `@case`, `@Case`, `[Case]`). | a hand-typed `'TS-3 …'` title in a spec; a case with no desc entry |
43
45
  | P17 | **Locators inside their page object**, built in the constructor; no separate locators file or folder; shared screen parts in `ShellPage`. | `locators/`, `*.locators.(js|ts)`, `selectors.json`; the same header locator in two pages |
44
46
  | P18 | **Dynamic, reusable, manageable** ([patterns.md](../../automation-implementation/references/patterns.md)): settings and switches only through `src/config`; which tests run chosen by tag (`@smoke`, `@write`) and runner project; helpers in `utils/`, HTTP in `src/services/`; tests split into `tests/ui`, `tests/api`, `tests/unit`. | `process.env` outside `src/config`; a spec edited or commented out to skip it; helper functions declared inside a spec |
47
+ | P19 | **Inputs checked first, options by name (any stack).** A page/screen/API method checks its required arguments before touching the app and fails naming the missing one; more than two optional settings go in one options object or named parameters with defaults (JS/TS object, Python keyword arguments, Java/C# builder or options class), never several positional booleans. | `fn(x, true, false, null)`, positional boolean flags, a method that fails deep in the UI because an argument was empty |
48
+ | P20 | **Set a state, don't toggle it (any stack).** An action that changes a setting brings it to the requested state (`setPermission(name, enabled)`), does nothing when it is already there, is safe to repeat, and returns whether it changed something; a save that isn't needed is cancelled. | `toggle…()` clicked unconditionally, a test that passes only from one starting state |
45
49
 
46
50
  ## M: maintainability (from structural reviews; non-blocking unless marked)
47
51
  Report these when the **diff** causes them; at most one line each; they never trigger a revision on their own. Evidence for M1, M4 and U9 comes from `reuse_check.mjs` (the implementer's `Findings` carry its line; release 1 is report-only: a hit is listed, not blocking). A helper in a file marked `@toolkit` is meant to be reused: a new function doing its job is an M4/U9 note.
@@ -24,7 +24,8 @@ The report follows [templates/project-context/report.md](../orion/templates/proj
24
24
  1. **Title and verdict.** `# <story title> · test report`, then one bold verdict (✅ Ready to accept · ⚠️ Ready, with notes · ❌ Not ready) and one sentence: what was built and how it ran.
25
25
  2. **Facts table:** story, app (URL and environment), tests (count, kind, tool and language, folder), runs (the counted run, any stability-check runs, and the fail check), date.
26
26
  3. **Coverage:** one row per requirement in plain words, the test that covers it, and its result as ✅ n/n · ❌ failed · ⚠️ flaky · ⏭ not run. Cases the user accepted that the story didn't name are marked *(added)*. A requirement with no test says why in the Test column.
27
- 4. **Needs your attention:** at most 5 lines, most important first, each ending with what the user can do. Left out when there is nothing.
27
+ 4. **Needs your attention:** at most 5 lines, most important first, each ending with what the user can do: only a decision for the user or a problem with the tests or the app. Never routine notes (a tracker that isn't connected when the story was pasted, approvals already given, Orion's own tools or rules). "Nothing: every requirement above has a passing test." when there is nothing.
28
+ 4b. **App issues seen:** every problem the app showed while it was explored or tested (an HTTP 4xx/5xx the page made, a console error, a message or element that contradicts the story), one ⚠️ line each with where and how often, and its bug-report draft in `project-context/defects.md` in the [bug-report standard](../failure-analysis/references/bug-report-standard.md). "None." when there were none. A test that still passes doesn't hide an app issue.
28
29
  5. **What was added:** tests, page objects, test data and test-case files, one line per kind.
29
30
  6. **Run it yourself:** the folder and one command.
30
31
  7. **Details for engineers**, inside `<details>`: runs and logs, review, failures and fixes, approvals with their decision ids, not checked, troubleshooting.
@@ -26,6 +26,7 @@ description: Runs automated tests with the project's own runner and configuratio
26
26
  4a. **Run mode** (existing tests only, `orion/references/modes.md`): the scope is the user's selection, run once, no fail check; flaky and failed counts as the runner reports them. **Stability check** (the user asks whether tests are stable or flaky, or to run them N times): run mode with the repeat column of step 5, N from the user (default 3), retries off; all N must agree, mixed results → FLAKY → recovery loop (the failure-analyst checks the live page for that step, a heal is proposed, and that fix is applied only on the user's yes, H14 as in fix mode), then the same N runs again.
27
27
  4a2. **Timeouts from the site, any stack.** Before the first run of a new or extended UI or API project: `node .claude/skills/orion/scripts/timing_profile.mjs --project <test project> --maps project-context/ui-maps/<story>.md` writes `timeouts.json` at the test project's root from the explored pages' Timing table; every starter's flags read it in their own terms (Playwright's navigation, action and expect timeouts; Selenium's and Appium's explicit wait; the API clients' request timeout), and an environment variable still wins. An existing suite that has its own timeout settings gets the measured values proposed in the report instead, never edited without the user's yes. After the counted runs, the same with `--results project-context/results/<run id>-<n>.json …` raises the test timeout when a test used more than half of it (never lowers). The report's details list each timeout with its `why`. No Timing table: the defaults stay, said so.
28
28
  4b. **Order, so failures cost minutes, not the whole run.** First run only the new tests once, stopping early (`--max-failures=5` for Playwright, the runner's equivalent elsewhere) and with as many workers as the suite's config allows. Failures go to the failure-analyst and are fixed or reported **before** any repeat or full run; never run the full existing suite, or the counted run, while a known failure is open. Then the counted run (step 5), then the impacted tests (step 6). The full existing suite runs only when the brief asks for it (a regression run, H6), once. Every run's wall time (from the runner's report) goes in the RESULT.
29
+ 4c. **New project (build mode): one run does it all.** The suite is the new tests, so the first run is the project's own command as the user will type it (`npm test`, retries off by the starter's config), with its results recorded (step 8a): it is the counted run and the proof of the user's command. Then the fail check (one pass for all tests, automation-implementation step 10), then `done_check.mjs … --no-run`. No separate smoke run of the starter after the story tests exist, no "final" run, no second full run.
29
30
  5. **New tests: 1 counted run, retries off.** The first run of step 4b is the counted run when every new test passed on its first attempt (retries off, through the project's command; record its results, step 8a): no second run. After a fix, the new tests run once more and that run counts. Keep its report. **Repeats only for a stability check** (step 4a) or when the brief names a run count: then N runs (default 3) with the repeat column below; all N must agree, mixed results → `failed`, class FLAKY, with the counts per run, one report per run.
30
31
  | Runner | Scope | N runs, retries off (stability check; N = 3 shown) |
31
32
  |---|---|---|
@@ -34,6 +34,7 @@ Decision tree (first match wins):
34
34
  # Failure analysis
35
35
  | Test | Class | Next likely | Evidence | In diff? |
36
36
  ## Defect drafts
37
+ Every draft has the fields and follows the rules of [references/bug-report-standard.md](references/bug-report-standard.md): `[Area]` title, environment, preconditions, numbered steps, expected (with its AC), actual (exact), reproducibility, severity and proposed priority, masked evidence, links.
37
38
  (each draft ends with: _Drafted by the AI failure-analyst; not filed until a person approves (H9)._)
38
39
  ```
39
40
 
@@ -0,0 +1,27 @@
1
+ # What a good bug report looks like
2
+
3
+ Built on ISO/IEC/IEEE 29119-3 (incident report), the ISTQB Foundation syllabus (defect report objectives and contents) and common tracker practice (Jira, Azure DevOps). A developer must be able to reproduce the bug from the report alone, and a lead must be able to rank it without opening anything else.
4
+
5
+ ## Fields (every defect draft)
6
+ | Field | Rule | Good | Bad |
7
+ |---|---|---|---|
8
+ | **Title** | `[Area] What is wrong + when`, at most ~12 words, no blame, no "doesn't work" | "[Sign in] /session returns 500 after a successful sign-in" | "Login broken", "Bug in app" |
9
+ | **Environment** | URL and environment name, app build or version if shown, browser and version, OS, role of the account, date and time with zone | https://… (test) · Chrome 1xx · Windows 11 · role Admin · 2026-11-20 09:30 PKT | — |
10
+ | **Preconditions** | Account role and state, data that must exist | Signed out, fresh browser | — |
11
+ | **Steps to reproduce** | Numbered, minimal, one action each, the UI's own words in **bold**, synthetic data | 1 Open the site · 2 Sign in with a User-role account · 3 Watch the network tab | "Use the app" |
12
+ | **Expected result** | What should happen, citing the story/AC or the standard behaviour | Sign-in completes with no server error (PR-1 AC-4) | — |
13
+ | **Actual result** | What happened, exact: message text, status code, what changed | `GET /session` → 500; the page still opens Daily Work Summary | "It fails" |
14
+ | **Reproducibility** | x of y attempts, and when it doesn't happen | 3 of 3, every sign-in | "sometimes" |
15
+ | **Severity** | Impact on the product: Critical (data loss, security, no workaround) · Major (a main flow broken) · Minor (a flow works with a workaround or wrong message) · Trivial (cosmetic) | Minor: the page still works | — |
16
+ | **Priority** | How soon to fix (set or proposed; the team decides) | Medium | — |
17
+ | **Evidence** | Screenshot, trace, failing test name, the relevant log or network line, secrets and personal data masked as `***` | `test-results/…/trace.zip`, network line | full logs, tokens |
18
+ | **Links** | The story, the test case, the failing test, any duplicate found | PR-1 · TS-5 · `signIn.spec.js:42` | — |
19
+
20
+ ## Rules
21
+ 1. **One bug per report.** Two symptoms with different causes are two drafts.
22
+ 2. **Reproduce first** from a fresh session before drafting; record the attempts. Not reproducible → say so, it stays a finding, not a defect.
23
+ 3. **Search for a duplicate** in the tracker (same area and symptom) and link it instead of filing again.
24
+ 4. **Facts, not guesses.** The suspected cause goes in an optional "Notes" line, marked as a guess.
25
+ 5. **No secrets, no real personal data** anywhere in the report or its attachments.
26
+ 6. **A test that fails because the app differs from the story is the app's bug, not the test's** (never change the test to pass); a story that is outdated is said so and asked about.
27
+ 7. **Drafted, not filed:** filing is H9, after the user sees the draft. Each draft ends with the line the failure-analysis skill names.
@@ -10,6 +10,9 @@ description: "Runs the end-to-end test-automation workflow for a requirement: va
10
10
  - `project-context/` in the target repo (created if missing)
11
11
  - The host: named by the entry command (`Host: <name>`); its row in [references/hosts.md](references/hosts.md) says how you delegate and what the host enforces (Copilot Studio: also its section "On Copilot Studio": status lines, call budget, missing connections)
12
12
 
13
+ ## Quiet run (every host, every mode)
14
+ The user sees only: the setup card · a setup message when something the request doesn't cover is missing · the test-case table · at most three one-line milestones in a build, each a result that just happened · the result. Nothing between tool calls: never "Next I'll…", "I'm reading…", "Now checking…", never the names of rules, skills, gates, agents, scripts or files. In a single-agent host this holds for every specialist step you do yourself ([status-lines.md](references/status-lines.md)).
15
+
13
16
  ## Procedure
14
17
  00. **Rules first, on every host.** Read `AGENTS.md` before anything else: the repo root, else `${CLAUDE_PLUGIN_ROOT}/AGENTS.md` in a plugin install. Don't rely on the host having loaded it (Claude Code skips it when the project has a `CLAUDE.md`; Codex prefers an `AGENTS.override.md`). Copilot Studio has no files: the rules are in your instructions. Not found anywhere → say so in your first sentence and run `doctor`. Then read [references/capabilities.md](references/capabilities.md): what the platform can do now, which agent does what, and where each template and rule lives.
15
18
  0e. **Greeting and start.** A greeting or empty request gets the capability card ([references/greeting.md](references/greeting.md); read only that file for it). A request to write, extend or design tests (full, build, design) gets the [setup card](references/setup-card.md) word for word (existing framework? existing test cases? style, tool and language, connections, site and scope, account, extra checks) and waits for go (the next story in the same chat: one "Same setup as before" line instead, conversation.md 1a); after exploring, the test-case table waits for go before any code. No other form or questions. The other modes get no card. Everything the user sees follows [references/conversation.md](references/conversation.md).
@@ -18,7 +21,7 @@ description: "Runs the end-to-end test-automation workflow for a requirement: va
18
21
  0b. **Report mode.** If the user asks for a report across runs, in any words ("how did the sprint go", "summary of runs"; shortcut `/orion report <scope>`: a run id, story, sprint or fix version, release, date range, or `trend`), delegate test-reporter in `aggregate` mode with the run files in scope. Read-only: no gates, no approvals; publishing the result is a separate H9 question.
19
22
  0a. **Design mode.** If the user wants only the test cases, in any words ("just the test cases", "no code yet"; shortcut `/orion design <story>`), run Gates 1–4 only, then Gate 7 on the design (every TS traces to an AC, every claim has evidence) and Gate 8 (the user accepts the test design). Gates 5 and 6 are recorded as `n/a — design mode`, not skipped silently. No implementer, executor or change-agent is delegated; the files the user asks for (Excel, PDF, Word and the rest) come from `cases_export.py`, which you run. The report is the test design and traceability matrix, plus the files in the formats the user chose ([references/delivery-formats.md](references/delivery-formats.md)). After you accept it, `/orion <story>` continues from Gate 5 with that design (Gates 1–4 are re-checked only if the requirement or the code changed since).
20
23
  0d. **Doctor.** If the requirement is `doctor`, follow [references/doctor.md](references/doctor.md) instead of this procedure and stop.
21
- 1. **Open the run.** If `project-context/` is missing, copy the templates in `templates/project-context/` (file roles: [references/project-context-files.md](references/project-context-files.md)). Create the run file `runs/R-<YYYYMMDD>-<HHMM>-<key>.md` from `templates/project-context/run.md` with gates 1–8 set to ○, and add one index line to `execution-history.md` (with a shell: `node .claude/skills/orion/scripts/run_state.mjs init <key> --requirement "<text>" --workflow <workflow>` does both and prints the path). One file per run, so two runs in the same repo never edit the same file.
24
+ 1. **Open the run.** If `project-context/` is missing, copy the templates in `templates/project-context/` (file roles: [references/project-context-files.md](references/project-context-files.md)). Create the run file `runs/R-<YYYYMMDD>-<HHMM>-<key>.md` from `templates/project-context/run.md` with gates 1–8 set to ○, and add one index line to `execution-history.md` (with a shell: `node .claude/skills/orion/scripts/run_state.mjs init <key> --requirement "<text>" --workflow <workflow>` does both, prints the path, and keeps `project-context/.gitignore` up to date so logs, the graph, tool backups, screenshots and traces stay local). One file per run, so two runs in the same repo never edit the same file.
22
25
  1r. **A run that is already open is continued, not restarted.** When the user says "continue" or "resume", or a new session starts on a story whose run file is open (`node .claude/skills/orion/scripts/run_state.mjs <run file> status` exits 0; 4 means it is COMPLETE), read that output instead of the conversation you no longer have: its `next:` gate is where the loop resumes and its `passed:` gates are not redone, unless the requirement text, the code (`git rev-parse HEAD` against the run's `base`) or the app (one fresh look at the start URL) changed since; a change re-opens the first gate it affects. Approvals this run already recorded in `decisions.md` (this run id, this user) stand; nothing else counts as one. Tell the user one line ("Picking up PR-1 where it stopped: the tests are written, running them 3 times now."), then carry on. Measured reason: rehearsal 1 (2026-11-18) was cut off by a usage limit mid-build and only finished because the same session could be continued.
23
26
  1a. **Blockers first.** If the request needs something this host or deployment lacks (a tool, connection, permission, adapter or environment), say so in the plain blocker message from [references/blockers.md](references/blockers.md) before collecting any other details, with the one action that unblocks it; while it stands, mention it in one sentence. Before every question, check that the answer changes what you can do now; otherwise leave it for later.
24
27
  2. **Read what is known.** Load `confirmed` facts. Re-check any `confirmed` fact older than the last commit before relying on it for Gate 3.
@@ -26,8 +29,8 @@ description: "Runs the end-to-end test-automation workflow for a requirement: va
26
29
  4. **Loop until COMPLETE or stopped.** For the first unmet gate, pick the cheapest action that advances it and one decision: CONTINUE · DELEGATE · PARALLELIZE · RETRY · REPLAN · ASK_USER · BLOCK · ESCALATE · COMPLETE.
27
30
  4b. **Budget.** At every gate start, in the same turn as the gate's first action, run `node .claude/skills/orion/scripts/run_state.mjs <run file> budget` (with `--usage <usage.json>` when `usage_report.mjs` has written one). Exit 3 (over the run budget in `retry-policy.md`, default 60 minutes and est. USD 10): before starting that gate, ask one line, "This run has taken <n> minutes (budget <m>). Carry on, and for how long, or stop here with what exists?", record question and reply, and do what the reply says (a new limit goes into the run file as `metric budget=<n> min`). Never stop silently, never overrun silently. Without a shell, compare the clock with the run's start time yourself.
28
31
  4c. **Lean by default (cost).** Context is paid again on every turn, so keep tool output small, on every host with a shell: rule files by section (`node .claude/skills/orion/scripts/rules.mjs <file> --list`, then `rules.mjs <file> <words of the section title>`; a SKILL.md is read whole when its skill starts); the suite by map (`codemap.mjs <suite> [--find <name>]`, then only the files to change, at the given lines); every test, build and install command through `quiet.mjs <command>` (full log in `project-context/logs/`). Briefs name the section or file:line, not "read X". On every host with hooks (Claude Code, Grok Build, Cursor, GitHub Copilot, Codex, Gemini CLI, Windsurf/Devin: [hosts.md](references/hosts.md)) the lean guard (`scripts/hooks/lean_guard.mjs`) blocks the wasteful form during an open run and names the lean one; `ORION_LEAN=off` turns it off. Where a host has no hooks, this rule is what holds. Every specialist has the same rule in its Boundaries; those with a shell (codebase-analyst, implementer, executor, failure-analyst) have `rules.mjs` and `codemap.mjs` in their tools, and the shell-free ones (reviewer, strategist, evidence-validator, requirement-analyst, test-reporter, environment-discovery, change-agent with its git-only shell) stay shell-free and read by section. After Gate 3, save the suite's map to `project-context/graph/codemap.md` (`codemap.mjs <suite> --out project-context/graph/codemap.md`, or write the map from codebase-analyst's RESULT) and point later briefs at it and at file:line.
29
- 4d. **Done is checked by machine, not by your word.** Before you show the result (and before COMPLETE), write the result message to `project-context/runs/<run id>.result.md` and run `node .claude/skills/orion/scripts/done_check.mjs --project <test project> --story <KEY> --run <run id> --report <report> --result-text project-context/runs/<run id>.result.md [--existing] [--known-failures <TS ids the result reports as app defects>] [--base <sha the work started from>]` (`--existing` for a suite you extended: its own architecture is not judged; `--base`, or a `base <sha>` on the run file's `code:` line, adds the `reuse` row: copied code or a pass-through method in the change fails it) (with a shell). Exit 0: show that result. Exit 1: each FAIL row's `next:` is the loop's next step (the recovery loop for a failing test, the missing results files, a coverage gap, a result rewritten shorter, the command fixed so it runs as given); act on the first, then run it again. At most 3 rounds (`retry-policy.md`, "Done check"); still failing → deliver **⚠️ Ready, with notes** (or ❌ Not ready when a test of the story fails or the command doesn't run), each failing row as one ⚠️ line, never ✅. Record each round with `run_state.mjs <run file> log done-check you <CONTINUE|COMPLETE> <pass|fail> none yes "<failed checks>"`. Without a shell (Copilot Studio), go through the same checks by reading and write `done check: by reading` in the run file. Measured reason: four rehearsals on a real site (2026-11-18) each reported themselves done with a `npm test` that stopped at once, no recorded runs, an unmentioned coverage gap or a result 50–300% over its length; the check catches every one of them.
30
- 5. **Delegate with a brief** ([references/task-brief.md](references/task-brief.md)). Gates 2 and 3 run in parallel. **Never stand in another agent for a specialist** (`general-purpose`, a built-in explore or review agent): it has none of the specialist's *Never* list. **If a specialist can't start** (Cursor's Task tool rejects the platform's agent types; a Claude Code start error), say so in one line, load that specialist's skills and do the step yourself; the run file names you, not the specialist, for that work ([references/hosts.md](references/hosts.md)). **Explore once:** for a UI story, Gate 2's brief asks environment-discovery to explore the app at the URL the user gave; when the MCP browser can't be used for this app (not set up for this project, or an HTTP auth prompt), the walk takes the runner route and goes to the implementer, which has a shell (`ui-observation`, Tools); save the UI map it returns as `project-context/ui-maps/<story>.md` and pass that path as `ui_map` in every later brief (test design, implementer, reviewer, failure-analyst). Rows a later `top-up` or `heal` returns are appended to the same file. Scripts are written only after the map exists; no step explores what the map already has. Never two writers on the same files. From Gate 5 on, every brief carries the code hand-off fields (worktree, base, work branch, where tests run, files) from [references/work-branch.md](references/work-branch.md); when tests run in CI, ask H3 for the work-branch push **before** Gate 6, never after. A build request covers running the new tests on this machine; CI, a container, or the rest of an existing suite is an H6 question when Gate 4 closes.
32
+ 4d. **Done is checked by machine, not by your word.** Before you show the result (and before COMPLETE), write the result message to `project-context/runs/<run id>.result.md` and run `node .claude/skills/orion/scripts/done_check.mjs --project <test project> --story <KEY> --run <run id> --report <report> --result-text project-context/runs/<run id>.result.md [--existing] [--known-failures <TS ids the result reports as app defects>] [--base <sha the work started from>]` (`--existing` for a suite you extended: its own architecture is not judged; `--base`, or a `base <sha>` on the run file's `code:` line, adds the `reuse` row: copied code or a pass-through method in the change fails it) (with a shell). Exit 0: show that result. Exit 1: each FAIL row's `next:` is the loop's next step (the recovery loop for a failing test, the missing results files, a coverage gap, a result rewritten shorter, the command fixed so it runs as given); act on the first, then run it again. At most 3 rounds (`retry-policy.md`, "Done check"); still failing → deliver **⚠️ Ready, with notes** (or ❌ Not ready when a test of the story fails or the command doesn't run), each failing row as one ⚠️ line, never ✅. Record each round with `run_state.mjs <run file> log done-check you <CONTINUE|COMPLETE> <pass|fail> none yes "<failed checks>"`. Without a shell (Copilot Studio), go through the same checks by reading and write `done check: by reading` in the run file. Measured reason: four rehearsals on a real site (2026-11-18) each reported themselves done with a `npm test` that stopped at once, no recorded runs, an unmentioned coverage gap or a result 50–300% over its length; the check catches every one of them. In a new project whose counted run was the user's own command (execution step 4c), pass `--no-run`: the command already ran and its results are recorded; never run the suite again just for this check.
33
+ 5. **Delegate with a brief** ([references/task-brief.md](references/task-brief.md)). Gates 2 and 3 run in parallel. **Never stand in another agent for a specialist** (`general-purpose`, a built-in explore or review agent): it has none of the specialist's *Never* list. **If a specialist can't start** (Cursor's Task tool rejects the platform's agent types; a Claude Code start error), say so in one line, load that specialist's skills and do the step yourself; the run file names you, not the specialist, for that work ([references/hosts.md](references/hosts.md)). **Explore once:** for a UI story, Gate 2's brief asks environment-discovery to explore the app at the URL the user gave; when the MCP browser can't be used for this app (not set up for this project, or an HTTP auth prompt), the walk takes the runner route and goes to the implementer, which has a shell (`ui-observation`, Tools); save the UI map it returns as `project-context/ui-maps/<story>.md` and pass that path as `ui_map` in every later brief (test design, implementer, reviewer, failure-analyst). **Screens explored before are checked, not re-walked** (with a shell, a Playwright JavaScript or TypeScript suite): when `project-context/ui-maps/screens/` holds screen files with a `checked:` date and the test project is installed, before Gate 2 run `node .claude/skills/orion/scripts/screen_map.mjs check --runner <test project>` and put its table in the Gate 2 brief as `screens:` (reuse · explore again, with the reason); any other exit than 0 or 1, or no such files, means explore as today, with no brief field. After Gate 2: `screen_map.mjs extract project-context/ui-maps/<story>.md` (no browser). After Gate 6, only when the story's tests passed (they just proved the locators): `screen_map.mjs record --runner <test project> --screens <the screen keys of this story's map>`. Neither step ever blocks or fails a run: a failure is one line in the run file. Rows a later `top-up` or `heal` returns are appended to the same file. Scripts are written only after the map exists; no step explores what the map already has. Never two writers on the same files. From Gate 5 on, every brief carries the code hand-off fields (worktree, base, work branch, where tests run, files) from [references/work-branch.md](references/work-branch.md); when tests run in CI, ask H3 for the work-branch push **before** Gate 6, never after. A build request covers running the new tests on this machine; CI, a container, or the rest of an existing suite is an H6 question when Gate 4 closes.
31
34
  6. **Accept or reject each RESULT** with the 7 checks in [references/task-brief.md](references/task-brief.md) (the 7th: the gate-specific content table). Rejected once → RETRY with the reason; that is the only revision. A RETRY must change something: if the fix needs a fact the writer can't get, DELEGATE environment-discovery for it first. Rejected again: the implementer's best version is **delivered as a draft** with the open findings listed as known issues (status `partial`), other agents ESCALATE with what exists; nothing ends empty. A disagreement about how the app behaves is settled by running the test or observing the app (H6), never by another review round; without a way to run it, it becomes a known issue.
32
35
  Gate 1 is delegated to requirement-analyst on every path, the existing-project path included (single-agent: its skill as its own step, recorded).
33
36
  6a. **Recover** Gate 6 failures with [references/recovery-loop.md](references/recovery-loop.md).
@@ -22,7 +22,7 @@ Two checkpoints, nothing more: the setup card (all questions at once, defaults i
22
22
  1a. **The next story in the same chat gets no greeting and no full card.** Once this chat has had a card answered (the answers are in `decisions.md` and the chat), a new story or request ("now automate the checkout story", a second issue key) reuses those answers: reply with one line, "Same setup as before: <tool · language · test project · site · account>. Say go, or change a line.", then the steps as usual. The full card comes back only for a different site or test project, or when the user asks for it. A greeting card is for a greeting only, never as a reply to a request.
23
23
  2. **"go", "yes", "ok" or "looks good" in reply to the card confirm exactly what the card lists** (every bold default on its 8 lines). A change ("use Java", "add it to this repo") updates the card; show only the changed lines and wait again. The card covers exploring the URL, installing the runner in the test project and running the new tests here; it never covers commit, push, PR, production, trackers or installs outside the test project (asked when they come up, AGENTS rule 2).
24
24
  2a. **A story that can't be read never stops the run.** The tracker isn't connected and the user didn't connect it, or the link can't be opened: say so in one line, offer the connection once (its row from [connect-tools.md](connect-tools.md)) and carry on in the same message: design the cases from the request's own words and the explored site, title the table "Story PR-1 not read: cases from your request and the site", and show it for go. Never end a turn asking only for acceptance criteria. "Not connected" is what the check shows now, not what the user may do later: a yes to the setup message, a go, or any reply other than "done" or the story's text leaves it unconnected, so carry on. A turn that offers the connection or asks for the story also shows the test-case table (or, before exploring has finished, keeps exploring in that turn); waiting for a tracker is never a stop.
25
- 3. **Second checkpoint: the test cases.** After exploring, show the test-case table with exactly this header, one line per case: `| ID | What it checks | Type | Priority | Expected result |` (Type: positive, negative, boundary or edge; Priority: High, Medium or Low; the ID is TS-n, never `#`, and tags such as `@smoke` stay out of the ID cell), say in one line where the cases came from (your request, the site, the coverage checklist, your imported cases) and anything the site changed from the plan, and, **in an existing suite, the file plan under the table**: "Files: change `pages/DashboardPage.ts` (add `openSettings()`), `tests/fixtures.ts`, `data/users.ts`; new `pages/SettingsPage.ts` (no page object for Settings yet), `tests/settings.spec.ts` (one spec per feature, as `login.spec.ts`)". Each new file says why no existing file fits. Then ask "**Shall I write these?** Reply **go**, or tell me what to change in your own words, like \"add a locked-out user\" or \"drop the fourth one\"." Go approves exactly that file plan: a file not in it is not created or changed without asking again An edit updates the table and asks again. Write code only after the user's reply. A design-only request stops here for acceptance. Under the question, one line says how to look closer: "Ask to see any case in full (\"show me the third one\", \"all of them\"), or for the cases as Excel, PDF, Word or any other file to review." (item 3b). After **go** on the table, a build runs to the end in the same turn: fill every starter `{{TOKEN}}` from the UI map (`suite_check.mjs` reports any left), run the smoke test, write the story's tests, run them 3 times and show the result; it never stops with tests unwritten or not run unless a blocker says what stopped it and the one fix.
25
+ 3. **Second checkpoint: the test cases.** After exploring, show the test-case table with exactly this header, one line per case: `| ID | What it checks | Type | Priority | Expected result |` (Type: positive, negative, boundary or edge; Priority: High, Medium or Low; the ID is TS-n, never `#`, and tags such as `@smoke` stay out of the ID cell), say in one line where the cases came from (your request, the site, the coverage checklist, your imported cases; **with imported cases, first the coverage summary from `cases_coverage.py`: "Add N · Update M · Keep K", the criteria it leaves uncovered and the cases to update, each with its reason**) and anything the site changed from the plan, and, **in an existing suite, the file plan under the table**: "Files: change `pages/DashboardPage.ts` (add `openSettings()`), `tests/fixtures.ts`, `data/users.ts`; new `pages/SettingsPage.ts` (no page object for Settings yet), `tests/settings.spec.ts` (one spec per feature, as `login.spec.ts`)". Each new file says why no existing file fits. **In a new project there is no file list**: at most one line ("All in `sut/<site>/`, built on the starter."). A story pasted in the request is the story: never say it wasn't read. Under the table, one line names the coverage-checklist cases left out, numbered, so none is dropped silently: "Also worth testing: 1 empty fields · 2 unknown email · 3 Enter submits · 4 still signed in after a reload · 5 sign-out. Say *add 1, 3*." (from the catalog for the story's feature types; omit the line when none is left). Then ask "**Shall I write these?** Reply **go**, or tell me what to change in your own words, like \"add a locked-out user\" or \"drop the fourth one\"." Go approves exactly that file plan: a file not in it is not created or changed without asking again An edit updates the table and asks again. Write code only after the user's reply. A design-only request stops here for acceptance. Under the question, one line says how to look closer: "Ask to see any case in full (\"show me the third one\", \"all of them\"), or for the cases as Excel, PDF, Word or any other file to review." (item 3b). After **go** on the table, a build runs to the end in the same turn: fill every starter `{{TOKEN}}` from the UI map (`suite_check.mjs` reports any left), run the smoke test, write the story's tests, run them once with retries off (and N times only when the user asks for a stability check) and show the result; it never stops with tests unwritten or not run unless a blocker says what stopped it and the one fix.
26
26
  3b. **Reviewing the cases, as long as the user likes.** At the test-case checkpoint, and again after the result, the user can look at any case in full and change it before anything is written or pushed, **in any words** ([plain-language.md](plain-language.md): "the third one", "the login case", "remove the last one" all work). The forms below are what each request does; the backticked ones are optional shortcuts, never something the user must type:
27
27
  - `show TS-3` · `show TS-2, TS-5` · `show all`: each case as a short card, nothing else in the message:
28
28
  `**TS-3 · <what it checks>** · <Type> · <Priority> · covers <AC-n (its words)>` then `Preconditions:` (one line), `Steps:` (numbered), `Expected:` (one line) and `Data:` (only when it has test data; a secret is its variable name, `E2E_PASSWORD`, never a value). Then the same question as the table.
@@ -20,7 +20,9 @@
20
20
  | test-case-map.md | orchestrator, from the implementer's and test-reporter's RESULTs (template): `<story>:TS-n` ↔ AC(s) ↔ desc entry ↔ test file:line ↔ external key ↔ last result |
21
21
  | results/<run id>-<n>.json | executor, by running `results_parse.mjs` on the runner's reports after each counted run (the one file a specialist writes here: a script's output, not a judgement). Per test: id, file, title, status, duration, attempts, failure signature; secrets masked |
22
22
  | defects.md | orchestrator: one line per defect draft the user accepted (template), with its test, results file and failure signature |
23
- | ui-maps/screens/<screen key>.md | orchestrator, from environment-discovery: a screen several stories use, kept once and referred to by story maps |
23
+ | ui-maps/screens/<screen key>.md | orchestrator, from environment-discovery: a screen several stories use, kept once and referred to by story maps. Through `screen_map.mjs`: `extract` (proven rows of a story map, by screen key), `record` (once the story's tests pass: what is on the page at load, signed in or out), `check` (later: reuse, or explore again with the reason). Locators only, never a secret |
24
+
25
+ Committed with the code: everything above except `logs/`, `graph/`, `tm-backups/`, screenshots, traces and `.env` files, which `project-context/.gitignore` keeps local (`context_guard.mjs ensure`, run by `run_state.mjs init`). Before a commit, `context_guard.mjs check` must exit 0 ([memory model](../../../../docs/memory-model.md)).
24
26
 
25
27
  Fact line: `- <fact> — <tag> — <evidence location>` with tag one of confirmed, inferred, unknown, needs-user.
26
28
  Newest confirmed evidence wins; the old fact moves to `## History` with the date. Secrets are never written, not even masked.
@@ -16,7 +16,7 @@ In a Claude Code **plugin** install these scripts aren't in the repo: run them f
16
16
  - **A browser to run tests**: Chrome or Edge installed (the check's `browser:` line); otherwise Playwright's own browser, a one-time download to the user's folder.
17
17
  - **The tool's runtime**: `node -v`, `java -version`, `mvn -v`, `dotnet --version`, `python --version` as the tool needs. A missing runtime is installed by the user, not by you: list it with its download page.
18
18
 
19
- Nothing missing: no message; carry on. Otherwise:
19
+ Nothing missing: no message; carry on. **Never asked, because the build request already covers it** (AGENTS rule 2): a new project's starter and its install in `sut/<site>/` (item 2): do it and carry on, it is said in the next message's first line. Otherwise:
20
20
  "**Before I start, I need to set up <n> thing<s>.** Nothing is installed or changed until you say yes.
21
21
  1. **Browser for exploring:** the `playwright` entry in <the host's file: `.cursor/mcp.json`, `.vscode/mcp.json`, `.gemini/settings.json`, `.codex/config.toml`, `.grok/config.toml`, or `.claude/settings.local.json`> for <site> (the platform's setup command). It starts after you <reload Cursor / reload VS Code / restart Gemini CLI / restart Codex / restart Grok Build / restart Claude Code>; until then I explore with the test project's Playwright.
22
22
  2. **Test project:** <tool> in `sut/<site>/` (<the install command>, about a minute).
@@ -24,7 +24,7 @@ Nothing missing: no message; carry on. Otherwise:
24
24
  4. **You install:** <runtime> (<download page>); I can't install it for you.
25
25
  5. **<Jira> (to read <PR-1>):** not connected. To connect it: <its row from connect-tools.md, one line>. I won't wait for it: I'll design the cases from your request and the site now, and re-check them against <PR-1> once it's connected.
26
26
  Reply **yes** to set up all, **yes, not 1** to skip one, or **no**."
27
- Number only the items that are missing, in this order. Item 1 is offered only when the check printed `setup in the chat`; when it didn't, item 1 is "**Browser for exploring:** <its `ready: no` reason>; to fix it: <its Fix>", for the user to do. On Cursor and VS Code, after item 1 is set up or when the check says ready, the same message also asks, as its last line before the reply line: "And please confirm `browser_run_code_unsafe` and the other unused browser tools are switched off (<where>); it runs any code on this machine." (once per workspace, recorded). Windsurf and other tools whose settings live elsewhere (exit 3): "**Browser for exploring:** I can't see your tool's MCP settings; make sure its `playwright` entry points at `sut/<site>/.env`."
27
+ Number only the items that are missing, in this order. Item 1 is offered only when the check printed `setup in the chat`; when it didn't, item 1 is "**Browser for exploring:** <its `ready: no` reason>; to fix it: <its Fix>", for the user to do. Never ask the user to switch browser tools off in their tool's settings: the agents use only the tools their skills list, the host asks before any other one runs, and the doctor ("is everything set up?") reports the setting. Windsurf and other tools whose settings live elsewhere (exit 3): "**Browser for exploring:** I can't see your tool's MCP settings; make sure its `playwright` entry points at `sut/<site>/.env`."
28
28
 
29
29
  Nothing else goes in this message, with one exception that saves a round: when line 7 (the login, which has no default) is still unanswered, the message ends, after the reply line, with "**Login:** paste it with your reply (it goes only into the git-ignored `.env`), or say *I'll add it*." The yes approves only the numbered items; a login pasted in the same reply is written as [conversation.md](conversation.md) item 6. Any other unanswered card line is asked in its own message **after** the setup is done. Only a yes typed after this message counts; the card's "go" never approves it, and it's never bundled with the card or another question. Record message and reply in `decisions.md`. On yes, do the items approved, in order: item 1 with `node .claude/skills/orion/scripts/browser_setup.mjs <URL>` from the workspace root (an existing suite: add `--env-file <its own env file>`, so the browser signs in with the suite's account and no `sut/<site>/` is created) (never edit the file yourself; if it exits 1 or 2, give its warning in one line and use the test project's Playwright); items 2 and 3 with the install commands (the host shows its own prompts). Then one line on what was set up and what needs a reload ("**All set:** the browser for saucedemo (starts after you reload Cursor), Playwright in `sut/saucedemo/`. Exploring now.") and carry on; it never repeats the browser-tools reminder (said once, in the setup message). If the reply brought no login and the site needs one, the same line ends with the login question, once ("…in `sut/saucedemo/`. **Login:** paste it, or say *I'll add it*."), never a separate message. The tracker item (5) is never waited for: it is the user's to do whenever they like, so after **yes** (or **no**, or any reply that isn't "done") the run carries on without it, by [conversation.md](conversation.md) item 2a, in the same turn: explore, then the test-case table titled "Story <PR-1> not read: cases from your request and the site". Never end the turn after this message with only "connect <Jira> or paste the story". A skipped item 1 means the test project's Playwright for this run. **no**, or a skipped item the run can't do without: say in one line what that stops (for example "Without the test project I can't explore or run tests: I'll design the test cases from your description and mark the screens not observed") and carry on with what's possible; don't ask again in this run. "done" or "reloaded" means: run the checks again, then continue.
30
30
 
@@ -53,6 +53,7 @@ Nothing else goes in this message, with one exception that saves a round: when l
53
53
  - **Lines 3 and 4, when line 1's default is the suite open here:** what the suite already uses, from its files (a quick look at its config, folders and one test; no exploring): `3. **Style:** <e.g. page objects in `pages/`, data in `data/`>, as your suite does` and `4. **Tool:** <e.g. Playwright + TypeScript>, as your suite does`. Never offer other tools for an existing suite; a different tool is only by the user's own words.
54
54
  - **Line 2, when the request names where the cases are** ("get all the test cases from Jira"): `2. **Existing test cases?** **yes, from <Jira> (<the project, filter or keys named>)**`.
55
55
  - **Line 5, when a tool is already connected in this chat** (its read tools answered, e.g. the Jira search already returned issues, or the request uses it and its tools are available): `5. **Connected:** <Jira (read-only)> · add another: Xray · TestRail · …`. A connected tool is never asked again in the same chat (conversation.md 1a).
56
+ - **Line 5, when the request already contains the story's text** (its acceptance criteria or a pasted description), even with a key such as PR-1: `5. **Connect:** **none (story in your request)** · Jira · …`. No Jira item in the setup message, no "not read" note in the table or the result: the pasted text is the story.
56
57
  - **Line 5, when the request names a story in a tracker** (a Jira link such as `…atlassian.net/browse/PR-1`, an issue key, an Azure DevOps work item or a GitHub issue): `5. **Connect:** **<Jira> (to read <PR-1> from your request)** · or none: paste the story`. Never `none` as the default when the request links a story. On **go**, a tracker that isn't connected yet is item 5 of the setup message (its row from [connect-tools.md](connect-tools.md)), which the run never waits for (conversation.md item 2a); connected, the story is read before anything else.
57
58
  - **Line 7, when the request already holds the account** (a user name and a password typed in it): `7. **Login:** **the account in your request** (written only to the git-ignored `.env`, never repeated)`, and conversation item 6 applies (write it, say once it may be worth rotating). Never ask for it again.
58
59
  - **Line 7, an existing suite:** its own env file (the one its config loads, e.g. `env-files/.env.dev`), checked with `env_check.mjs <that file>`; never `sut/<site>/.env`.
@@ -34,10 +34,10 @@ export const FORMATS = {
34
34
  };
35
35
  const NEXT = {
36
36
  'claude-code': 'Restart Claude Code in this folder and trust it when asked: the agents start the browser server themselves.',
37
- cursor: "Reload Cursor (Developer: Reload Window) and enable the 'playwright' server when it asks. REQUIRED before "
38
- + 'the first run, in Cursor Settings > MCP: switch OFF {off} (the file can\'t; the first runs any code on this machine).',
39
- 'github-copilot': "Reload VS Code and start the 'playwright' server when it asks. REQUIRED before the first run, in "
40
- + "Copilot Chat (Agent mode) > Configure Tools: untick {off} (the file can't; the first runs any code on this machine).",
37
+ cursor: "Reload Cursor (Developer: Reload Window), enable the 'playwright' server when it asks, and keep Cursor's "
38
+ + "approval prompts on: it asks before any browser tool the agents don't use.",
39
+ 'github-copilot': "Reload VS Code and start the 'playwright' server when it asks; keep tool approvals on: it asks "
40
+ + "before any browser tool the agents don't use.",
41
41
  'gemini-cli': 'Restart Gemini CLI in this folder (trust it if asked); the file allows only the browser tools the agents use.',
42
42
  codex: 'Restart Codex in this folder and trust the project; the file allows only the browser tools the agents use.',
43
43
  'grok-build': 'Restart Grok Build. Its docs show no per-tool switch: decline {off} if they are ever requested.',
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Test-case check: every case in a test design meets the test-case standard
4
+ * (.claude/skills/test-design/references/test-case-standard.md) before the user sees the table.
5
+ * node .claude/skills/orion/scripts/case_check.mjs project-context/test-designs/<story>/design.md
6
+ * Reads the first Markdown table whose rows start with a TS id. Findings, one per line; exit 0 none · 1 findings · 2 usage.
7
+ */
8
+ import fs from 'node:fs';
9
+
10
+ const REQUIRED = [
11
+ ['title', /^(what it checks|title)/i],
12
+ ['preconditions', /^preconditions/i],
13
+ ['steps', /^steps/i],
14
+ ['test data', /^test data/i],
15
+ ['expected', /^expected/i],
16
+ ['postconditions', /^postconditions/i],
17
+ ];
18
+ const VAGUE = /\b(works|working|correctly|properly|as expected|successfully|fine|ok|is displayed correctly|behaves)\b/i;
19
+
20
+ /** The cells of one Markdown table row. */
21
+ const cells = (line) => line.trim().replace(/^\||\|$/g, '').split('|').map((c) => c.trim());
22
+
23
+ export function check(text) {
24
+ const lines = text.split('\n');
25
+ const out = [];
26
+ let head = null;
27
+ let cases = 0;
28
+ for (let i = 0; i < lines.length; i++) {
29
+ const l = lines[i];
30
+ if (!l.trim().startsWith('|')) { if (cases) break; head = null; continue; }
31
+ const c = cells(l);
32
+ if (!head) {
33
+ if (c.some((x) => /^id$/i.test(x)) && c.some((x) => /^steps/i.test(x))) {
34
+ head = c;
35
+ const missing = REQUIRED.filter(([, re]) => !c.some((x) => re.test(x))).map(([n]) => n);
36
+ if (missing.length) out.push(`table: no column for ${missing.join(', ')}`);
37
+ }
38
+ continue;
39
+ }
40
+ if (/^[-: |]+$/.test(l.trim())) continue;
41
+ const id = c[head.findIndex((x) => /^id$/i.test(x))] || '';
42
+ if (!/^TS-\d+/.test(id)) continue;
43
+ cases++;
44
+ const get = (re) => { const k = head.findIndex((x) => re.test(x)); return k < 0 ? null : (c[k] || ''); };
45
+ for (const [name, re] of REQUIRED) {
46
+ const v = get(re);
47
+ if (v !== null && (!v || /^[-—–]$/.test(v))) out.push(`${id}: ${name} is empty`);
48
+ }
49
+ const title = get(REQUIRED[0][1]) || '';
50
+ if (title && title.split(/\s+/).length < 4) out.push(`${id}: title "${title}" doesn't say the action and the outcome`);
51
+ const steps = get(/^steps/i) || '';
52
+ if (/`/.test(steps)) out.push(`${id}: steps contain code or paths; write what a person does, with the screen's labels`);
53
+ if (!/(^|\s|<br>)1[.)]\s/.test(steps) && /[,;]|\band\b.*\b(click|enter|type|open|select)\b/i.test(steps)) out.push(`${id}: steps hold several actions; number them, one action each`);
54
+ const exp = get(/^expected/i) || '';
55
+ if (exp && VAGUE.test(exp) && !/["“].+["”]/.test(exp)) out.push(`${id}: expected result is vague ("${exp.match(VAGUE)[0]}"); say exactly what is shown or what changed`);
56
+ }
57
+ if (!head) out.push('no test-case table with ID and Steps columns found');
58
+ else if (!cases) out.push('the test-case table has no TS rows');
59
+ return { cases, findings: out };
60
+ }
61
+
62
+ if (process.argv[1] && process.argv[1].endsWith('case_check.mjs')) {
63
+ const f = process.argv[2];
64
+ if (!f || !fs.existsSync(f)) { console.log('usage: node .claude/skills/orion/scripts/case_check.mjs <design.md>'); process.exit(2); }
65
+ const { cases, findings } = check(fs.readFileSync(f, 'utf8'));
66
+ console.log(`case check: ${cases} case(s), ${findings.length} finding(s)`);
67
+ for (const x of findings) console.log(` - ${x}`);
68
+ process.exit(findings.length ? 1 : 0);
69
+ }