@roopesh.yadava/qa-pack 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -18,7 +18,9 @@ On install, the postinstall script copies all skills and commands into `.claude/
18
18
  npm update @roopesh.yadava/qa-pack
19
19
  ```
20
20
 
21
- Skill files are overwritten with the latest version. Your `CLAUDE.md`, `.mcp.json`, `.env`, and — critically — `product_context/` (your accumulated run history and known bugs) are **never touched**.
21
+ Skill files are overwritten with the latest version. Your `CLAUDE.md`, `.mcp.json`, `.env`, and — critically — `product_context/` (your accumulated run history and known bugs) are **never touched**. The installed `SKILLS_CONTEXT.md` is stamped with the pack version, so you can always check which version a repo is running.
22
+
23
+ **Upgrading from 1.0.x:** credentials used to live in `product_context/{PRODUCT}/context.md` — skills now read them from `.env` instead. Move your username/password/OTP into `.env` and delete them from any existing `context.md`.
22
24
 
23
25
  ## First-time setup
24
26
 
@@ -51,24 +53,39 @@ Automation is **reuse-first**: existing `.feature` files and step definitions ar
51
53
  before any Gherkin is written, drafted steps must match existing ones (exact → parameterized
52
54
  → reworded) before a new step definition is allowed, and each run reports its reuse %.
53
55
 
54
- ## Triggers
56
+ ## Commands to run skills
57
+
58
+ Every skill is plain-English triggered — no slash command required — except `/qa-agent`
59
+ and `/write-acceptance-criteria`, which are also available as explicit slash commands.
60
+
61
+ ### QA Agent (orchestrator)
55
62
 
56
- | Say this | What happens |
63
+ | Command | What happens |
57
64
  |---|---|
58
- | `run qa PROJ-123` | Structured flow — context, questions, then phase menu |
59
- | `manual test PROJ-123` | Phase 1 — manual testing + bug filing |
60
- | `automate PROJ-123` | Phase 2 — reuse-first BDD automation |
61
- | `full QA PROJ-123` | Phase 3 — manual first, then automation |
62
- | `accessibility test PROJ-123` | WCAG 2.1 A/AA audit |
63
- | `ui test PROJ-123` | Live app vs Figma design diff |
64
- | `file a bug` | Files bug directly to Jira |
65
- | `/write-acceptance-criteria PROJ-123` | Generates AC, appends to Jira card |
65
+ | `/qa-agent PROJ-123` or `run qa PROJ-123` | Loads context, asks only the missing gaps, then shows the phase menu |
66
+ | `manual test PROJ-123` / `test PROJ-123` / `do QA on PROJ-123` | Phase 1 — manual testing + bug filing + charter |
67
+ | `automate PROJ-123` / `write automation for PROJ-123` | Phase 2 — reuse-first BDD automation |
68
+ | `full QA PROJ-123` / `run everything for PROJ-123` / `end to end PROJ-123` | Phase 3 — manual first, then automation |
69
+ | `run qa PROJ-123 --reset-context` | Same as above but ignores saved product context and starts fresh (overwrites it on completion) |
70
+
71
+ ### Standalone skills (no card required, or card optional)
72
+
73
+ | Command | Skill | What happens |
74
+ |---|---|---|
75
+ | `ui test` / `check design` / `compare with figma` | ui-test-figma | Live app vs Figma design diff |
76
+ | `accessibility test PROJ-123` / `a11y test [URL]` | accessibility-testing | WCAG 2.1 A/AA audit, files bugs on the card if given |
77
+ | `file a bug` / `log a bug` | bug-reporting | Interactive bug filing to Jira (new or existing card) |
78
+ | `generate a test charter` / `create a charter` | test-charter | Publishes a Test Charter from a saved execution report |
79
+ | `delete files` / `clean up outputs` | delete-files | Prompts to delete/keep files in `outputs/` |
80
+ | `/write-acceptance-criteria PROJ-123` | write-acceptance-criteria | Generates AC, appends to the Jira card description |
81
+ | `/impacted-tests` / `which tests are impacted by this pull` | impacted-tests | After pulling dev changes into a test branch, reports which Cucumber feature files are at risk — report-only, no card needed |
66
82
 
67
83
  ## What postinstall does
68
84
 
69
85
  | File | Behaviour |
70
86
  |---|---|
71
87
  | `.claude/skills/*/SKILL.md` + companion `.md` files | Always overwritten (versioned logic) |
88
+ | `.claude/skills/SKILLS_CONTEXT.md` | Always overwritten + stamped with the installed pack version |
72
89
  | `.claude/commands/*.md` | Always overwritten |
73
90
  | `.claude/skills/qa-agent/product_context/**` | **Never touched** after first seed |
74
91
  | `.claude/settings.json` | Created once, never overwritten |
@@ -89,10 +106,14 @@ If you installed an older qa-pack version and already committed the skill files,
89
106
  ## Publishing (maintainers)
90
107
 
91
108
  ```bash
92
- # In qa-pack/ repo, bump version and push
93
- npm version patch # or minor / major
94
- git add . && git commit -m "your message" && git push origin main
95
- # GitHub Actions publishes to npmjs automatically
109
+ # In qa-pack/ repo commit your changes first (npm version needs a clean tree)
110
+ git add . && git commit -m "your message"
111
+
112
+ # Bump: patch = fixes, minor = new/changed skill behavior, major = breaking
113
+ npm version minor -m "release: v%s — short description"
114
+
115
+ git push origin main --follow-tags
116
+ # GitHub Actions publishes to npmjs automatically (triggers on package.json change on main)
96
117
  ```
97
118
 
98
119
  ## Requirements
@@ -100,3 +121,5 @@ git add . && git commit -m "your message" && git push origin main
100
121
  - Claude Code CLI
101
122
  - Node.js 18+
102
123
  - Atlassian MCP connected in Claude Code (for Jira)
124
+ - Playwright MCP — configured automatically via the seeded `.mcp.json`
125
+ - Python 3 — only if you enable the optional token tracking (`QA_TRACKING_DIR` in `.env`)
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: impacted-tests
3
+ description: Map the source changes a developer-branch pull brought in to the BDD/Cucumber feature files they can break, and print a report.
4
+ argument-hint: "[base-branch-or-commit] [changed file paths...]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ Invoke the `impacted-tests` skill.
9
+
10
+ If the user provided a base branch/commit or explicit file paths as arguments, pass them
11
+ directly into the skill so it skips diff auto-detection and uses those instead.
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: impacted-tests
3
+ description: After pulling a developer branch into a test branch, analyze ONLY the src changes that pull brought in and map them to the BDD/Cucumber test files (feature files, step definitions, page objects) they can break, then print a report. Report-only - it never runs tests; the QA opens and runs the listed files manually. Repo-agnostic - it auto-discovers the test folder, framework, and diff base at runtime. Use when the user asks "which tests are impacted by this pull" or "map dev changes to tests". Usage - /impacted-tests [base-branch-or-commit] [changed file paths...]
4
+ ---
5
+
6
+ # Impacted Tests Analyzer
7
+
8
+ Map the source-code changes a developer-branch pull brought in to the BDD test files they can break, so QA can review/run those tests locally before CI. This skill is **repo-agnostic**: it discovers everything about the project at runtime. Do NOT assume any specific folder names, framework version, or paths — always run Step 0 first.
9
+
10
+ ## Token-efficiency rules (mandatory)
11
+
12
+ - Work from the **diff**, never by reading whole source files. `git diff --name-only` / `-U0` gives everything needed.
13
+ - Map with `grep -rl` / `grep -rn` (filenames + line numbers only); never `cat` a feature/step/page file in full. Read at most ±10 lines around a hit, and only when a mapping is ambiguous.
14
+ - Batch all greps for one identifier list into a single command with `-E "id1|id2|..."`.
15
+ - Never search `node_modules`, `dist`, `build`, `coverage*`, or other generated/vendor dirs.
16
+ - If the diff spans more than ~30 src files, delegate the mapping (Step 3) to one `Explore` subagent (breadth: medium) with the identifier list; ask it to return only file paths + one-line reasons.
17
+
18
+ ## Step 0 — Discover the project (do this first, every run)
19
+
20
+ Detect these facts by inspection; keep the results in mind for later steps. Do NOT hardcode.
21
+
22
+ 1. **Test root**: the folder holding BDD tests. Find it, don't assume:
23
+ ```bash
24
+ ls -d test tests e2e cypress 2>/dev/null
25
+ git ls-files '*.feature' | sed 's#/[^/]*$##' | sort -u | head
26
+ ```
27
+ The common ancestor of the `*.feature` files is the test root. Feature files, step definitions, and page objects all live under it (subfolder names vary per repo — discover them, e.g. `git ls-files "$TEST_ROOT/**" | sed 's#[^/]*$##' | sort -u`).
28
+ 2. **Framework + run command**: read `package.json` scripts and any cucumber config (`cucumber.js`, `cucumber.cjs`, `cucumber.json`, `.cucumberrc*`). Derive the single-feature run command from the test script or CI script rather than inventing one. If none is discoverable, fall back to `npx cucumber-js <feature-path>`. (This is only for the manual-run footer in the report — the skill never runs anything itself.)
29
+ 3. **Source root**: the app code the tests exercise — usually `src/`, else the top-level dir(s) that are neither the test root nor config/vendor. Confirm with `git ls-files | grep -vE "^($TEST_ROOT|node_modules|dist)" | ...`.
30
+
31
+ If there are no `*.feature` files anywhere, tell the user this skill targets BDD/Cucumber repos and stop.
32
+
33
+ ## Step 1 — Collect the diff from the most recent pull INTO the current branch
34
+
35
+ The input is exactly what the last pull brought into **this** branch — no need to know or name the developer branch. When you `git pull` (or merge) another branch into your current branch, git records a merge commit whose second parent is the pulled tip; `$MERGE^1..$MERGE` is precisely "what that pull added on top of my branch". That is the primary and preferred signal:
36
+
37
+ ```bash
38
+ # Primary: the most recent merge commit on the CURRENT branch = the most recent pull into it
39
+ MERGE=$(git log --merges -1 --format=%H)
40
+ git log -1 --format='%s (merged in: %p)' $MERGE # sanity check — this is the pull you just did
41
+ git diff --name-status $MERGE^1 $MERGE -- <SRC_ROOT>
42
+ DIFF_RANGE="$MERGE^1 $MERGE"
43
+ ```
44
+ Fallbacks, in order (only if there is no merge commit — e.g. a fast-forward pull, or you pulled before creating any commit):
45
+ - User passed a base ref/commit as the first argument: `git diff --name-status <arg>...HEAD -- <SRC_ROOT>` — use this whenever the auto-detected pull is wrong.
46
+ - Otherwise diff against the current branch's upstream/tracking ref if set (`@{u}`), else against whichever of `origin/develop-temp`, `origin/develop`, `origin/main`, `origin/master` exists: `git diff --name-status HEAD...<ref> -- <SRC_ROOT>`.
47
+ - User passed explicit file paths or a pasted diff: use those directly.
48
+
49
+ If the src diff is empty everywhere, tell the user no pulled source changes were found (ask when they last pulled, or to pass the base ref explicitly) and stop — do NOT fall back to analyzing their own test edits.
50
+
51
+ Scope: only files under `<SRC_ROOT>` are analysis input. Ignore unit-test files in the diff (`*.test.*`, `*.spec.*`, `__tests__/`) — they are not BDD-flow relevant. The QA's own changed test files are NOT impact findings (mention them, if at all, in one closing line).
52
+
53
+ ## Step 2 — Extract impact identifiers (from the diff only)
54
+
55
+ Build a small identifier list without opening files (use `$DIFF_RANGE` from Step 1):
56
+
57
+ ```bash
58
+ git diff -U0 $DIFF_RANGE -- <SRC_ROOT> | grep -oE 'data-testid="[^"]+"' | sort -u # changed testids
59
+ git diff -U0 $DIFF_RANGE -- <SRC_ROOT> | grep -E '^[+-]' | grep -oE '"[A-Z][A-Za-z0-9 /&-]{3,40}"' | sort -u # added/removed UI strings
60
+ ```
61
+ Identifiers = (a) changed `data-testid`/locator attribute values, (b) component/page basenames from the changed file paths, (c) route/path strings in the diff, (d) user-facing label/heading/button/message strings added or removed. `data-testid` and UI strings are the strongest signals; include **removed** ones too — a deleted locator is exactly what breaks a test.
62
+
63
+ ## Step 3 — Map identifiers to test files, then down to scenarios
64
+
65
+ Chain cheapest-first, filenames only, all under the discovered `<TEST_ROOT>`:
66
+
67
+ 1. **Filename match**: identifier keywords vs feature/step filenames (`git ls-files "$TEST_ROOT/**/*.feature" "$TEST_ROOT/**/*.[jt]s" | grep -iE "kw1|kw2"`).
68
+ 2. **Content match**: `grep -rilE "id1|id2|LabelText" "$TEST_ROOT" --include="*.feature" --include="*.js" --include="*.ts"`.
69
+ 3. **Close the chain**: for a hit in a step-definition or page-object that has no same-named feature, grep its distinctive step text into the feature files to find the owning feature(s).
70
+ 4. **Resolve to scenarios**: for each impacted feature file, `grep -nE "Scenario:|Example:|Rule:|<step text>" <feature>` to get the affected scenario title(s) and line number(s). The report cites the **feature file + scenario + line**, because testers navigate by scenario, not by step-definition code.
71
+
72
+ Risk level (two only): 🔴 **Will fail** = a locator/step the test uses was removed or renamed; 🟡 **At risk** = shares a changed screen/component/steps but locators likely survive.
73
+
74
+ ## Step 4 — Output the report
75
+
76
+ The report IS the deliverable. In this exact order:
77
+
78
+ 1. FIRST save it to `outputs/impacted-tests-report.md` with the Write tool (create `outputs/` if needed) so it survives the session.
79
+ 2. THEN print it as the **final text message of the turn** — no tool calls after it, printed exactly ONCE, beginning with `## Impacted tests report`. Never print it before a tool call and repeat it after.
80
+
81
+ Format (per-line, not a table — tables wrap badly in terminals):
82
+
83
+ ```
84
+ ## Impacted tests report
85
+
86
+ Analyzed <N> source files pulled from <ref> (merge <shorthash>).
87
+
88
+ **Impacted test files (<N>) — highest risk first:**
89
+
90
+ 1. 🔴 <TEST_ROOT>/path/to/Some.feature
91
+ **Will fail** — Example: "<scenario title>" (<TEST_ROOT>/path/to/Some.feature:34) — <one sentence, in tester/UI terms, of what the developer changed>.
92
+
93
+ 2. 🟡 <TEST_ROOT>/path/to/Another.feature
94
+ At risk — Rule: "<rule title>" (<TEST_ROOT>/path/to/Another.feature:41) — <one sentence>.
95
+
96
+ **Coverage gaps (no test exercises these yet):**
97
+ - <new dev functionality with no scenario> — needs a new scenario.
98
+
99
+ **To run any of these manually** (start your app first):
100
+ <discovered single-feature run command> <feature-path>
101
+ ```
102
+
103
+ Rules for each entry:
104
+ - Risk marker first, then ONE sentence citing the affected scenario by its `Scenario:`/`Example:`/`Rule:` title with a clickable `feature-path:line`, describing the change in **UI/tester terms** ("the dropdown was replaced with an input + Verify button").
105
+ - Do NOT reference step-definition filenames, page objects, or source component filenames in the reasons — testers read feature files, not code. Source filenames may appear only in the coverage-gaps section when there is no feature to point to.
106
+ - **Hyperlink rule**: write feature paths as bare repo-relative paths in plain text (with `:line`) — NOT as `[label](path)` markdown links. Terminals auto-detect plain paths and make them ctrl+clickable; a markdown label hides the path and breaks that.
107
+ - No confidence column, no per-source-file table, no separate flat path list — the numbered paths ARE the list.
108
+
109
+ ## Step 5 — Stop
110
+
111
+ The report is the deliverable. Do NOT run any test, do NOT ask whether to run them — the QA reviews the report and runs files manually using the footer command. End the turn after printing the report.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roopesh.yadava/qa-pack",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "AI-powered QA agent skills for Claude Code — manual testing, BDD automation, accessibility, UI/Figma diff, bug reporting",
5
5
  "scripts": {
6
6
  "postinstall": "node bin/postinstall.js"