@xera-ai/skills 0.1.0 → 0.1.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/xera-report.md +49 -18
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@xera-ai/skills",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "files": ["*.md", "version.json"]
5
5
  }
package/xera-report.md CHANGED
@@ -3,29 +3,60 @@ name: xera-report
3
3
  description: Classify the latest run, draft a Jira comment, and post it. Use after `/xera-exec` when QA wants the diagnosis and Jira update.
4
4
  ---
5
5
 
6
- The user invoked `/xera-report <TICKET>`. If no key, ask.
6
+ You are running `/xera-report <TICKET>` (or you were dispatched to this step by `/xera-run`). If no ticket key is provided, ask the user.
7
7
 
8
- 1. Verify `.xera/{{TICKET}}/runs/` has at least one run directory. If not: "Run the test first with `/xera-exec {{TICKET}}`." STOP.
8
+ ## Important this skill does AI work
9
9
 
10
- 2. Run: `bun run xera:normalize {{TICKET}}`
10
+ Step 4 below is *cognitive work that YOU, the session, must do*. It is not a shell command. Do not skip it. Do not call `bun run xera:report` until **you have personally written the file `.xera/{{TICKET}}/classifier-input.json`** by reasoning over the run artifacts. The CLI helper consumes that JSON; it does not produce it.
11
+
12
+ ## Steps
13
+
14
+ 1. **Verify** `.xera/{{TICKET}}/runs/` has at least one run directory. If not, tell the user: "Run the test first with `/xera-exec {{TICKET}}`." then STOP.
15
+
16
+ 2. **Normalize the trace.** Run: `bun run xera:normalize {{TICKET}}`
11
17
  - Exit 0 → continue.
12
- - Otherwise show stderr, STOP.
18
+ - Otherwise show stderr to the user and STOP.
13
19
 
14
- 3. Read the latest `.xera/{{TICKET}}/runs/<latest>/normalized.json`. Also read:
20
+ 3. **Read** the latest `.xera/{{TICKET}}/runs/<latest>/normalized.json`. Also read every file below before proceeding to step 4:
15
21
  - `.xera/{{TICKET}}/test.feature`
16
22
  - `.xera/{{TICKET}}/story.md`
17
23
  - `.xera/{{TICKET}}/spec.ts`
18
- - `.xera/{{TICKET}}/status.json` (may not exist on first run)
24
+ - `.xera/{{TICKET}}/status.json` (may not exist on the first run — that's fine)
19
25
  - `.xera/{{TICKET}}/meta.json`
20
-
21
- 4. Read `node_modules/@xera-ai/prompts/diagnose-failure.md`. Follow its decision algorithm. Produce `classifier-input.json` matching the exact shape described. Save to `.xera/{{TICKET}}/classifier-input.json`.
22
-
23
- 5. Run: `bun run xera:report {{TICKET}} -- --input=.xera/{{TICKET}}/classifier-input.json`
24
-
25
- 6. Read the drafted Jira comment at `.xera/{{TICKET}}/jira-comment.draft.md`. Show it to the user. Ask: "Post to Jira? (Y/n)"
26
-
27
- 7. If yes:
28
- - If Atlassian MCP is available, use `addCommentToJiraIssue` with the draft as the body. Capture the comment id.
29
- - Else: run `bun run xera:post {{TICKET}}` (will use REST creds from .env).
30
-
31
- 8. Summarize result and link to the Jira comment (if MCP returned a URL).
26
+ - `node_modules/@xera-ai/prompts/diagnose-failure.md` (the prompt template — read it in full; the rest of step 4 follows ITS rules)
27
+
28
+ 4. **Classify (YOUR job, no CLI shortcut here).** Follow `diagnose-failure.md`'s decision algorithm scenario-by-scenario. For each scenario in `normalized.json`, decide:
29
+ - `class`: one of `PASS`, `REAL_BUG`, `SELECTOR_DRIFT`, `FLAKY`, `TEST_BUG`
30
+ - `confidence`: `low`, `medium`, or `high`
31
+ - `rationale`: 1–3 sentences in English citing concrete evidence (URL, HTTP status, element name, prior run timestamps, hash drift, etc.)
32
+
33
+ Then write a JSON file to `.xera/{{TICKET}}/classifier-input.json` with this exact shape:
34
+
35
+ ```json
36
+ {
37
+ "runId": "<runId from normalized.json>",
38
+ "scenarios": [
39
+ {
40
+ "name": "<scenario name>",
41
+ "outcome": "PASS" | "FAIL" | "SKIPPED",
42
+ "class": "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG",
43
+ "confidence": "low" | "medium" | "high",
44
+ "rationale": "..."
45
+ }
46
+ ],
47
+ "scenarioCounts": { "total": N, "passed": N, "failed": N, "skipped": N }
48
+ }
49
+ ```
50
+
51
+ **Do not skip this step.** If you find yourself about to call `bun run xera:report` without having written this file, stop and write the file first.
52
+
53
+ 5. **Aggregate + draft.** Run: `bun run xera:report {{TICKET}} -- --input=.xera/{{TICKET}}/classifier-input.json`
54
+ This CLI: aggregates per-scenario classifications into an overall verdict, updates `status.json` with history, and writes `jira-comment.draft.md`. If exit code is non-zero, surface the error to the user; do not proceed to post.
55
+
56
+ 6. **Show the draft.** Read `.xera/{{TICKET}}/jira-comment.draft.md`. Display its content to the user verbatim. Ask: "Post to Jira? (Y/n)" (default: Y, unless `meta.json.source === "local"` for SAMPLE tickets — then never post).
57
+
58
+ 7. **Post.** If user says yes (or `xera-run` is in auto mode with `postToJira: true`):
59
+ - If an Atlassian MCP tool is available in this session (e.g., `mcp__atlassian__addCommentToJiraIssue` or `mcp__plugin_engineering_atlassian__addCommentToJiraIssue`), call it with `{{TICKET}}` and the draft contents. Capture the comment id.
60
+ - Else run `bun run xera:post {{TICKET}}` (uses REST credentials from `.env`).
61
+
62
+ 8. **Summarize** to the user: overall classification, scenario pass/fail counts, the reproduce command (`bunx xera-internal exec {{TICKET}} --replay=<runId>`), and the Jira comment URL if available.