@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.
- package/package.json +1 -1
- package/xera-report.md +49 -18
package/package.json
CHANGED
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
|
-
|
|
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
|
-
|
|
8
|
+
## Important — this skill does AI work
|
|
9
9
|
|
|
10
|
-
|
|
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
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|