requirementbot 0.0.0-stage → 0.1.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 (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +197 -2
  3. package/bin/requirementbot.js +21 -0
  4. package/package.json +53 -4
  5. package/prompts/README.md +18 -0
  6. package/prompts/check.md +15 -0
  7. package/prompts/fix.md +4 -0
  8. package/prompts/from-code.md +12 -0
  9. package/prompts/from-docs.md +11 -0
  10. package/prompts/from-issues.md +14 -0
  11. package/prompts/mdq.md +8 -0
  12. package/prompts/partials/non-interactive.md +1 -0
  13. package/prompts/partials/subagents.md +1 -0
  14. package/prompts/report.md +8 -0
  15. package/prompts/system.md +9 -0
  16. package/skills/SOURCE.md +14 -0
  17. package/skills/catalog-features/SKILL.md +168 -0
  18. package/skills/catalog-features/references/layout.md +87 -0
  19. package/skills/detect-product-mismatches/SKILL.md +147 -0
  20. package/skills/detect-product-mismatches/references/features.md +84 -0
  21. package/skills/detect-product-mismatches/references/layout.md +99 -0
  22. package/skills/pull-request-diff-analyzer/SKILL.md +141 -0
  23. package/skills/qa-explain-behavior/SKILL.md +112 -0
  24. package/skills/qa-explain-behavior/references/answer-shapes.md +116 -0
  25. package/skills/qa-explain-behavior/references/examples.md +157 -0
  26. package/skills/qa-pr-requirements-analyzer/SKILL.md +149 -0
  27. package/skills/qa-pr-requirements-analyzer/references/summary-example.md +54 -0
  28. package/skills/qa-requirement-reviewer/SKILL.md +126 -0
  29. package/skills/qa-requirement-reviewer/references/requirements_reviewer_examples.md +128 -0
  30. package/skills/qa-thinking/SKILL.md +46 -0
  31. package/skills/requirements-from-code/SKILL.md +114 -0
  32. package/skills/requirements-from-code/references/behaviors.md +42 -0
  33. package/skills/requirements-from-code/references/layout.md +100 -0
  34. package/skills/requirements-from-expected/SKILL.md +116 -0
  35. package/skills/requirements-from-expected/references/behaviors.md +49 -0
  36. package/skills/requirements-from-expected/references/layout.md +74 -0
  37. package/skills/requirements-from-expected/references/merge.md +34 -0
  38. package/skills/write-user-story/SKILL.md +42 -0
  39. package/src/agent/agent.js +278 -0
  40. package/src/agent/auth.js +209 -0
  41. package/src/agent/prompt.js +36 -0
  42. package/src/branding.js +27 -0
  43. package/src/cli.js +26 -0
  44. package/src/commands/agent-command.js +61 -0
  45. package/src/commands/check.js +26 -0
  46. package/src/commands/command.js +40 -0
  47. package/src/commands/connect.js +33 -0
  48. package/src/commands/disconnect.js +18 -0
  49. package/src/commands/generate-from-code.js +20 -0
  50. package/src/commands/generate-from-docs.js +38 -0
  51. package/src/commands/generate-from-issues.js +41 -0
  52. package/src/commands/index.js +40 -0
  53. package/src/commands/login.js +44 -0
  54. package/src/commands/logout.js +17 -0
  55. package/src/commands/models.js +11 -0
  56. package/src/commands/pull.js +15 -0
  57. package/src/commands/push.js +29 -0
  58. package/src/commands/query.js +31 -0
  59. package/src/commands/report.js +23 -0
  60. package/src/commands/skills.js +20 -0
  61. package/src/commands/sources.js +16 -0
  62. package/src/commands/update-from-code.js +7 -0
  63. package/src/commands/update-from-docs.js +7 -0
  64. package/src/commands/update-from-issues.js +7 -0
  65. package/src/config.js +90 -0
  66. package/src/files.js +25 -0
  67. package/src/github.js +50 -0
  68. package/src/http.js +19 -0
  69. package/src/requirements.js +139 -0
  70. package/src/sources/adf.js +48 -0
  71. package/src/sources/github.js +81 -0
  72. package/src/sources/index.js +41 -0
  73. package/src/sources/jira.js +135 -0
  74. package/src/sources/pages.js +67 -0
  75. package/src/sources/source.js +60 -0
  76. package/src/transports/confluence.js +114 -0
  77. package/src/transports/git.js +90 -0
  78. package/src/transports/github.js +42 -0
  79. package/src/transports/index.js +36 -0
  80. package/src/transports/notion.js +108 -0
  81. package/src/transports/page-tree.js +119 -0
  82. package/src/transports/transport.js +41 -0
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: qa-explain-behavior
3
+ description: Answers QA questions about product behavior — what features exist, how user flows work, what business rules apply, what edge cases the system handles, and what is or is not implemented. Use whenever the user asks a question about WHAT the system does (features, flows, rules, conditions, who-can-do-what, when-does-X-happen, is-Y-supported). Trigger even when the user does not say "QA" — phrases like "what happens when…", "can a user…", "is it possible to…", "does the system…", "is X implemented", "what should I test for…", "what are the edge cases of…", or "walk me through the flow for…" all qualify. Do NOT trigger for questions that are clearly about implementation (architecture, database schema, code structure, performance, types, dependencies).
4
+ license: MIT
5
+ metadata:
6
+ author: Testomat.io
7
+ version: 1.0.0
8
+ ---
9
+
10
+ # QA Explain Behavior
11
+
12
+ Answer a QA engineer who is testing the product. They care about **product behavior**, not implementation. Read the codebase like a manual and translate it into plain-language descriptions of what the system does.
13
+
14
+ | What | File |
15
+ |------|------|
16
+ | Output shape per question type — feature, flow, yes/no, permissions, edge cases | [references/answer-shapes.md](references/answer-shapes.md) |
17
+ | Worked answers, plus bad-vs-good contrasts | [references/examples.md](references/examples.md) |
18
+
19
+ ## The mindset shift
20
+
21
+ The QA engineer is not going to read the code. They are going to click buttons, fill forms, and try to break things. The answer should help them know what to click, what to expect, and where the product might fail. Describe the product like someone who has used it end-to-end.
22
+
23
+ A QA engineer's mental model is built from:
24
+
25
+ - **Actors** — who is doing this: guest, member, admin, owner, integration.
26
+ - **Actions** — what they do: click, submit, upload, invite.
27
+ - **Outcomes** — what they see or what changes: page, message, email, status.
28
+ - **Rules** — when it's allowed, when it's blocked, what limits apply.
29
+ - **Edge cases** — empty state, very large input, duplicate, expired, offline.
30
+
31
+ Frame every answer in those terms.
32
+
33
+ ## What to investigate
34
+
35
+ Look at the parts of the codebase that **describe behavior**, not the parts that describe data:
36
+
37
+ - **Service and controller layers** — what user actions exist, and the multi-step flows behind them.
38
+ - **Business logic** — the rules that decide what is allowed, what changes, and what happens next.
39
+ - **Authorization and permissions system** — who can do what, and whether the block is in the UI, on the server, or both.
40
+ - **Feature flags** — what is switched on, off, or limited to certain accounts.
41
+ - **Configuration** — limits, defaults, and behavior that differs per environment or plan.
42
+ - **Models** — only *validations*, *state machines*, *callbacks*, and *scopes with business meaning*. Not columns, associations, or types.
43
+ - **Views, serializers, mailers** — what the user sees and receives.
44
+ - **Background jobs** — what happens after the user-visible action: notifications, syncs, cleanups.
45
+ - **Tests** — they describe expected behavior in plain English; very useful.
46
+
47
+ ## What to ignore
48
+
49
+ Unless the user explicitly asks, never mention:
50
+
51
+ - Database tables, columns, indexes, schema.
52
+ - Class names, file paths, line numbers, module structure.
53
+ - Framework terminology and internals — ORM concepts, callbacks, middleware, queues, dependencies.
54
+ - Variable names, method names, parameters, types.
55
+ - SQL, code snippets, regex.
56
+ - Performance, scaling, architecture decisions.
57
+ - Migration history, refactors.
58
+
59
+ If the user wants this, they will ask. The default is product-level only.
60
+
61
+ ## How to answer
62
+
63
+ **Be compact.** A QA engineer scans, they don't read paragraphs. Short bullets, short sentences, plain words.
64
+
65
+ **Lead with the answer.** No preamble, no restating the question, no "Let me explain…".
66
+
67
+ **Use product vocabulary, not code vocabulary:**
68
+
69
+ - "the user", "the admin", "the workspace owner" — not `current_user`.
70
+ - "the settings page" — not a controller action name.
71
+ - "an email is sent" — not a mailer class.
72
+ - "it's blocked" — not "validation fails".
73
+ - "in the background" — not the name of the queue.
74
+
75
+ **Structure by what a tester needs.** When describing a feature, default to this shape:
76
+
77
+ ```
78
+ **What it does:** one line
79
+ **Who can do it:** roles / permissions
80
+ **How to trigger it:** user action(s)
81
+ **What happens:** outcomes (UI, emails, notifications, status changes)
82
+ **Rules / limits:** validations, conditions
83
+ **Edge cases:** empty, duplicate, large, expired, blocked, etc.
84
+ **Not implemented:** anything the QA might expect that does NOT exist
85
+ ```
86
+
87
+ For flow questions, describe the flow as numbered steps from the user's point of view. For "is X supported?" questions, answer **yes** or **no** first, then a one-line reason, then any nuance. Permission questions, edge-case sweeps, failure behavior, comparisons, and how to phrase uncertainty each have their own shape in [references/answer-shapes.md](references/answer-shapes.md).
88
+
89
+ **Surface what is missing.** The most valuable thing a QA engineer can hear is "this is not implemented", "there is no UI for this — only the API supports it", or "this only works for paying accounts". Always look for gaps and call them out: a flag, a TODO, a commented-out path, an action reachable only via API.
90
+
91
+ **Be honest about uncertainty.** If the codebase is ambiguous, say "I see X but I'm not sure whether Y" rather than guessing. A QA testing on a wrong assumption is worse than a QA who knows to verify.
92
+
93
+ ## Do not write code
94
+
95
+ Never produce code blocks, schema, configuration snippets, or pseudocode unless the user explicitly asks ("show me the code", "give me the SQL"). The default response is prose and bullets only. When tempted to paste code "to be helpful", describe the behavior instead.
96
+
97
+ When the product **is** a CLI or an API, the commands, flags, and endpoints a user types are product surface, not implementation — name them exactly, the same way you would name a button.
98
+
99
+ [references/examples.md](references/examples.md) has worked answers — a full feature description, a flow walkthrough, an edge-case sweep — and two bad-vs-good contrasts showing what code leaking into an answer looks like.
100
+
101
+ ## Next actions
102
+
103
+ Offer after the answer:
104
+
105
+ - Turn the behavior into risk scenarios → `qa-thinking` skill.
106
+ - Turn it into test cases or a checklist → `qa-write-test-cases` skill.
107
+ - Map which tests already cover it → `qa-test-code-coverage` skill.
108
+ - Persist current behavior as product requirements → `requirements-from-code` skill.
109
+
110
+ ## Final reminder
111
+
112
+ Compact. Plain language. Behavior, not code. Highlight gaps. No code unless asked.
@@ -0,0 +1,116 @@
1
+ # Answer shapes
2
+
3
+ Pick the shape that matches the question. Skip any section that doesn't apply —
4
+ never pad with "N/A" or "None". Bullets over paragraphs, short lines, plain
5
+ words.
6
+
7
+ ## Feature description — "what does X do", "explain X"
8
+
9
+ The default shape. Most questions land here.
10
+
11
+ ```
12
+ **What it does:** one line
13
+ **Who can do it:** roles / permissions
14
+ **How to trigger it:** the clicks, in order
15
+ **What happens:** outcomes — screen, message, email, status change, background work
16
+ **Rules / limits:** validations, conditions, plan gating
17
+ **Edge cases:** empty, duplicate, too large, expired, blocked, concurrent
18
+ **Not implemented:** anything a tester would reasonably expect that doesn't exist
19
+ ```
20
+
21
+ ## Flow walkthrough — "walk me through…", "how does someone…"
22
+
23
+ Numbered steps from the user's point of view, one screen per step. Say where
24
+ the flow can branch or die.
25
+
26
+ ```
27
+ 1. User clicks **X** on the … page.
28
+ 2. …
29
+ 3. …
30
+
31
+ **Branches:**
32
+ - If <condition>, they land on … instead.
33
+ - If <condition>, it stops with "<the actual message>".
34
+
35
+ **After it finishes:** <emails, notifications, anything delayed>
36
+ ```
37
+
38
+ ## Yes / no — "is X supported", "can I…", "is there a way to…"
39
+
40
+ Answer in the first word. Then one line of why. Then nuance, if any.
41
+
42
+ ```
43
+ Yes — partially.
44
+ - <what works, and where>
45
+ - <what doesn't>
46
+ - <what exists in the API but has no UI>
47
+ ```
48
+
49
+ If it's a flat no, one or two lines is the whole answer. Don't inflate it.
50
+
51
+ ## Permissions — "can a *role* do X", "who can…"
52
+
53
+ Say whether the block is in the UI, on the server, or both — a tester needs to
54
+ know if they can get past it by calling the API directly.
55
+
56
+ ```
57
+ No. Guests can view … but cannot …
58
+ The button is hidden for guests, and the action is blocked server-side too.
59
+ ```
60
+
61
+ For several roles at once, use a small table:
62
+
63
+ ```
64
+ | Role | Create | Edit | Delete |
65
+ |---|---|---|---|
66
+ | Owner | ✅ | ✅ | ✅ |
67
+ | Member | ✅ | ✅ | ❌ |
68
+ | Guest | ❌ | ❌ | ❌ |
69
+ ```
70
+
71
+ ## Edge cases — "what could go wrong", "what should I test"
72
+
73
+ Group by the kind of input or state, so the list is walkable as a test session.
74
+ Each line is a condition plus what actually happens.
75
+
76
+ ```
77
+ **Empty / missing:** …
78
+ **Duplicate:** …
79
+ **Too large / too many:** …
80
+ **Wrong format:** …
81
+ **Expired / stale:** …
82
+ **Permissions:** …
83
+ **Concurrent:** two people doing this at once …
84
+ **External failure:** the integration is down / the upload fails …
85
+ ```
86
+
87
+ ## Failure behaviour — "what happens if it fails"
88
+
89
+ Testers need the observable result, not the exception.
90
+
91
+ ```
92
+ **What the user sees:** the actual message or screen
93
+ **What state it's left in:** saved / not saved / half-saved
94
+ **Whether it retries:** automatically, manually, or not at all
95
+ ```
96
+
97
+ ## Comparison — "what's the difference between X and Y"
98
+
99
+ Two columns, same rows. Only rows where they actually differ.
100
+
101
+ ## Phrasing uncertainty
102
+
103
+ Never guess silently. Use the shape "I can see X, but I couldn't confirm Y":
104
+
105
+ - "The API accepts this, but I couldn't find a UI that reaches it."
106
+ - "There's a limit of 100 here, but I'm not sure whether it's enforced on
107
+ import as well — worth verifying."
108
+ - "This looks gated by a feature flag. Whether it's on for your account, I
109
+ can't tell from the code."
110
+
111
+ ## Length
112
+
113
+ Match the question. A yes/no question gets two lines. A "walk me through the
114
+ whole import flow" gets a full shape. If your answer runs past about a screen,
115
+ either the question was broad or you're explaining implementation — check
116
+ which.
@@ -0,0 +1,157 @@
1
+ # Worked examples
2
+
3
+ > The product below is **invented** — a generic workspace app with members,
4
+ > documents and file imports. These examples show the shape and register of a
5
+ > good answer, not real behaviour. Always answer from what you actually find in
6
+ > the codebase in front of you.
7
+
8
+ ## Example 1 — feature description
9
+
10
+ **Q: "What happens when a user is invited to a workspace?"**
11
+
12
+ ```
13
+ **What it does:** sends an invitation so someone can join a workspace with a chosen role.
14
+ **Who can do it:** workspace owner and admins.
15
+ **How to trigger:** Workspace Settings → Members → "Invite" → enter email + pick role.
16
+ **What happens:**
17
+ - Invitation email is sent to that address.
18
+ - Pending invite shows in the members list.
19
+ - If the email matches an existing user, they accept by clicking the link and the workspace appears in their sidebar.
20
+ - If not, they're prompted to register first; after register they land on the workspace.
21
+ **Rules:**
22
+ - Email must be valid.
23
+ - Same email can't have two pending invites for the same workspace.
24
+ - Role must be one of: owner, admin, member, guest.
25
+ **Edge cases:**
26
+ - Invite link expires after 7 days.
27
+ - If the invited user is already a member, the invite is rejected with a message.
28
+ - Re-sending an invite resets the expiry.
29
+ **Not implemented:** bulk invite via CSV is not available in the UI.
30
+ ```
31
+
32
+ Why it works: every line is something a tester can act on. The last line is the
33
+ most valuable one in the answer.
34
+
35
+ ## Example 2 — permission question
36
+
37
+ **Q: "Can a guest delete a document?"**
38
+
39
+ ```
40
+ No. Guests can view documents but cannot edit, create, or delete them. The
41
+ delete button is hidden for guests, and the action is also blocked server-side.
42
+ ```
43
+
44
+ Two lines, and it answers the follow-up question a tester was about to ask —
45
+ whether the block survives a direct API call.
46
+
47
+ ## Example 3 — support question with nuance
48
+
49
+ **Q: "Is there a way to export a document?"**
50
+
51
+ ```
52
+ Yes — partially.
53
+ - CSV export is available from the document page (top-right menu).
54
+ - PDF export is **not** implemented.
55
+ - The raw JSON can be retrieved via API, but there's no UI button for it.
56
+ ```
57
+
58
+ "Yes — partially" in the first line, then exactly where the line falls.
59
+
60
+ ## Example 4 — flow walkthrough
61
+
62
+ **Q: "Walk me through importing records from a file."**
63
+
64
+ ```
65
+ 1. Workspace → Data → "Import" → pick a file (CSV or XLSX).
66
+ 2. A preview shows the first rows with a column-mapping step — you map each
67
+ column to a field (name, owner, category, tags).
68
+ 3. Confirm. The import runs in the background; the page shows a progress state.
69
+ 4. When it finishes you get an in-app notification with a summary: created,
70
+ updated, skipped.
71
+
72
+ **Branches:**
73
+ - If a row has no name, it's skipped and counted in "skipped".
74
+ - If a record with the same name already exists in that category, it's updated
75
+ rather than duplicated.
76
+ - If the whole file can't be parsed, nothing is imported and you get an error
77
+ on the same screen.
78
+
79
+ **Rules / limits:**
80
+ - File must be under 10 MB.
81
+ - Only CSV and XLSX; other extensions are rejected before upload.
82
+
83
+ **Edge cases:**
84
+ - An empty file imports nothing and reports "0 created".
85
+ - Closing the tab doesn't cancel the import — it keeps running.
86
+
87
+ **Not implemented:** there's no way to undo or roll back an import.
88
+ ```
89
+
90
+ ## Example 5 — edge-case sweep
91
+
92
+ **Q: "What should I test around document deletion?"**
93
+
94
+ ```
95
+ **Permissions:** owner and admin can delete; member and guest cannot (hidden and blocked server-side).
96
+ **Empty:** deleting a document with no content works and removes it immediately.
97
+ **In use:** a document open in someone else's tab can be deleted — their next save fails with a generic error, which is worth checking.
98
+ **Linked data:** attached files are removed in the background, so they can outlive the document by a few seconds.
99
+ **Concurrent:** two admins deleting the same document at once — the second gets a "not found" error rather than a friendly message.
100
+ **Undo:** there is none, and there's no confirmation step on the API — only in the UI.
101
+ ```
102
+
103
+ ## Contrast — the same question answered badly
104
+
105
+ **Q: "What happens when an import finishes?"**
106
+
107
+ ❌ **Bad — implementation leaking through:**
108
+
109
+ ```
110
+ When the import completes, the imports controller calls the finalizer service,
111
+ which updates the status column on the imports table to "finished" via a
112
+ persistence callback. A post-commit hook enqueues the notification job on the
113
+ background queue, which reads the workspace notification settings and delivers
114
+ through the import mailer.
115
+ ```
116
+
117
+ ✅ **Good — same facts, tester's language:**
118
+
119
+ ```
120
+ **What happens:**
121
+ - The import's status changes to "Finished" and the page updates with the final created/updated/skipped counts.
122
+ - Everyone subscribed to the workspace gets an email summary — sent in the background, so it can arrive a few seconds late.
123
+ - The import appears in the workspace's history.
124
+ **Edge cases:**
125
+ - An import with no valid rows still finishes, showing 0 created.
126
+ - If notifications are turned off for the workspace, no email is sent — the import still finishes normally.
127
+ ```
128
+
129
+ The bad version is not wrong, it's unusable: nothing in it can be clicked,
130
+ observed, or verified from the UI.
131
+
132
+ ## Contrast — padding vs. answering
133
+
134
+ **Q: "Can I rename a workspace?"**
135
+
136
+ ❌ **Bad:**
137
+
138
+ ```
139
+ Great question! Let me walk you through workspace renaming. Workspaces in the
140
+ system have a name attribute which can be modified. Here's what I found:
141
+ **What it does:** allows renaming a workspace.
142
+ **Who can do it:** users with permission.
143
+ **Rules / limits:** N/A
144
+ **Edge cases:** N/A
145
+ ```
146
+
147
+ ✅ **Good:**
148
+
149
+ ```
150
+ Yes. Workspace Settings → General → change the name → Save.
151
+ Only the workspace owner can do it; admins see the field disabled.
152
+ The name must be unique inside the account, 3–60 characters.
153
+ The workspace URL doesn't change when you rename — it keeps the original slug.
154
+ ```
155
+
156
+ No preamble, no empty sections, and it ends on the detail a tester would
157
+ otherwise discover the hard way.
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: qa-pr-requirements-analyzer
3
+ description: Analyze a pull request's context - title, description, comments, linked issues, attached schemas/images — to understand the original intent, verify scope against the linked ticket, surface ambiguities and edge cases, and produce a structured requirements summary with testable acceptance criteria. Use this skill when the user wants to understand WHAT a PR is supposed to do (not just what code changed), check whether the PR matches its linked ticket/task or generate acceptance criteria from PR/ticket context rather than from code.
4
+ license: MIT
5
+ metadata:
6
+ author: Testomat.io
7
+ version: 1.1.0
8
+ ---
9
+
10
+ # QA PR Requirements Analyzer
11
+
12
+ Reviews a pull request's human-written context — title, description, comments, linked tickets, attached images — to extract the original requirements, verify scope, and produce a requirements summary that downstream skills (`qa-write-test-cases`) can consume.
13
+
14
+ Complement of `pull-request-diff-analyzer`:
15
+
16
+ | Skill | Input | Output | Focus |
17
+ |-------|-------|--------|-------|
18
+ | `pull-request-diff-analyzer` | git diff, changed files | AC from code changes | "what the code does" |
19
+ | `qa-pr-requirements-analyzer` | PR title, description, comments, linked issue | summary of requirements with scope verification, AC | "what the PR is supposed to do" |
20
+
21
+ - Use them together for a full picture.
22
+ - If the user only wants to know what code changed, use `pull-request-diff-analyzer` instead.
23
+
24
+ ## Step 1: Detect PR Context
25
+
26
+ Accept, in priority order:
27
+ 1. A PR number or URL from the user prompt (e.g. `https://github.com/org/repo/pull/1234`).
28
+ 2. The open PR for the current branch: `gh pr view --json number,title,baseRefName,headRefName,url`.
29
+ 3. A ticket key only (Jira `PRJ-123`, Linear, etc) — analyze the ticket, then check for any open PR referencing it.
30
+
31
+ - If none are detectable, ask the user for a PR number/URL, branch name, or ticket key.
32
+ - If the branch exists only locally, ask the user to push it or provide the PR details directly.
33
+
34
+ ## Step 2: Read PR Context
35
+
36
+ Collect what the developer and team wrote — not the code. Detect available MCP/CLI tools and pull:
37
+ - PR metadata (title, description, comments, labels, milestone, assignees) — via Jira/Linear/GitHub MCP if enabled, else `gh` CLI.
38
+ - Embedded images/diagrams in the body — read them (vision-capable agent or `fetch` + describe); they often capture UI changes, error states, or flows that text misses.
39
+ - Linked tickets — parse the PR body and branch name for ticket references.
40
+
41
+ **Do not fabricate ticket content or add incorrect information.**
42
+
43
+ ## Step 3: Resolve Linked Tickets
44
+
45
+ The PR description is often a thin summary; the ticket has the real requirements. Use the first available tool:
46
+
47
+ 1. Jira/Linear MCP if enabled — fetch issue summary, description, AC, comments, linked issues, attachments.
48
+ 2. GitHub MCP if enabled — fetch the linked issue.
49
+ 3. `gh` CLI fallback — `gh issue view {N} --json title,body,comments,labels`. For Jira/Linear without an MCP, ask the user to paste the issue content.
50
+ 4. No access — note the gap explicitly in the output and continue with what you have.
51
+
52
+ ## Step 4: Verify Scope and Detect Ambiguities
53
+
54
+ Compare what the PR does against what the ticket asked for. These are questions to raise, not assertions that the code is wrong.
55
+
56
+ Scope verification — build three lists:
57
+ - In scope — ticket requirements addressed by the PR (description or code, see Step 5).
58
+ - Out of scope — ticket requirements with no corresponding PR change. These are the most valuable output of this skill.
59
+ - Extra (not in ticket) — PR changes not mentioned in the ticket. Flag for review (intentional or accidental?).
60
+
61
+ Ambiguities, edge cases, open questions — surface only issues supported by the available context. **Do not invent new requirements** or assume the product should handle a scenario unless the ticket, PR description, comments, or surrounding context suggest it is relevant. Look for:
62
+ - Underspecified behavior — the ticket describes a capability but omits important details (e.g. export is required, but format, naming, permissions, or empty-state behavior are not defined).
63
+ - Unanswered comments — questions in PR or ticket comments with no visible resolution.
64
+ - Conflicting requirements — different parts of the ticket, comments, or PR description disagree.
65
+ - Potentially relevant edge cases — scenarios related to the stated requirements whose expected behavior is not specified. Present these as questions, not requirements.
66
+ - **Never report an edge case solely because it is a common software concern.**
67
+ - Only raise an edge case when the ticket, PR description, affected domain, or discussion suggests it may be relevant.
68
+
69
+ ## Step 5: Identify Affected Files
70
+
71
+ Do not do a deep code review — that is `pull-request-diff-analyzer`. Prefer files mentioned in the PR description or ticket; cross-check with `git diff {base}...HEAD --name-only` only if the description doesn't enumerate them.
72
+
73
+ **Short-circuit (no source behavior):** if every changed file is non-source (`*.md`, `docs/**`, `tests/**`, configs, CI, deps, lock files):
74
+ - Do not invent AC. Do not invoke `pull-request-diff-analyzer`.
75
+ - Produce a short summary: PR title, type (`docs`/`chore`/`ci`/`deps`), one-sentence `Changes`, full file list.
76
+ - Add the note `> No source code behavior changed. Acceptance criteria generation is not applicable for this PR.`
77
+ - Stop here.
78
+
79
+ **Empty PR description:** if there is no body and the branch name doesn't encode intent:
80
+ - Pull `git log {base}..HEAD --pretty=format:"%s%n%b"`.
81
+ - Combine with changed files and branch name into a tentative one-sentence `Changes`.
82
+ - Mark `> PR description was empty. Summary derived from branch name, commits, and changed files only.`
83
+ - If a linked ticket exists, prefer the ticket as source of truth and note the empty body under "Ambiguities".
84
+
85
+ ## Step 6: Generate the Requirements Summary
86
+
87
+ **Save to a `.md` file only if the original prompt explicitly requests saving.** Write it to the user-specified folder.
88
+
89
+ Filename: slugify the PR title (lowercase, dashes, no special chars, max 40 chars), append the PR number. Example: `Add user export to CSV` → `add-user-export-to-csv-pr-1234.md`.
90
+
91
+ Output template (filled example: [summary-example.md](./references/summary-example.md)):
92
+
93
+ ```md
94
+ ## PR Requirements Summary
95
+
96
+ **PR:** {title}
97
+ **Branch:** {headRefName} → {baseRefName}
98
+ **Type:** {feature | bugfix | refactor | deps}
99
+ **Linked Tickets:** ... (only if any exist)
100
+
101
+ **Source of Truth:**
102
+ - PR description: {present | empty — derived from commits/branch}
103
+ - Jira/GitHub ticket: {resolved | not resolved — no MCP available}
104
+ - Most reliable source: {PR description | ticket | commits}
105
+
106
+ **Changes Overview:** ... (1-2 sentences — intent, not implementation)
107
+
108
+ **Impacted Areas:**
109
+ - Payment processing (6 source files)
110
+ - Billing configuration (2 config files)
111
+ - ... (bullet list, only meaningful business/technical impact; omit if empty)
112
+
113
+ **High Level Key files (up to 5):**
114
+ - `path/to/file.ts` — source
115
+ - ... (categorized: source | config | test | docs | migration | deps)
116
+
117
+ **Scope Verification:**
118
+ - ✅ In scope: {ticket requirement → where in PR it is addressed}
119
+ - ⚠️ Out of scope: {ticket requirement not addressed in PR}
120
+ - ➕ Extra (not in ticket): {change present in PR but not in ticket}
121
+
122
+ **Ambiguities, Edge Cases & Open Questions:**
123
+ - ... (underspecified behavior / unanswered comment / conflicting requirement / missing edge case)
124
+ - ... (empty input / permissions / error path / performance / backward compatibility / ...)
125
+ - ...
126
+
127
+ **Acceptance Criteria:**
128
+ - {action to perform} → {expected result}
129
+ - ...
130
+ ```
131
+
132
+ Summary rules:
133
+ - Concise, high-level, requirements-not-implementation — this is a requirements document, not a code review.
134
+ - `Changes Overview` is 1-2 sentences.
135
+ - `Impacted Areas` — meaningful bullets; omit the section if empty.
136
+ - `Source of Truth` is required — tells downstream skills what to trust when sources disagree.
137
+ - `Acceptance Criteria` — testable, user-oriented, written as "action → expected result". If no source-code behavior changed, replace this section with the explicit "not applicable" note from Step 5.
138
+ - Omit empty sections instead of writing `None`/`N/A` — except the "no source code changed" note, which must be explicit.
139
+ - Avoid generic statements like "code cleanup", "minor fixes", "various improvements" — name what changed or omit it.
140
+
141
+ ## References
142
+
143
+ | Description | File |
144
+ |-------------|------|
145
+ | Filled example of the output summary | [summary-example.md](./references/summary-example.md) |
146
+ | `.testeiya/` directory convention | `../scan-automation-project/SKILL.md` |
147
+ | Code-focused PR analysis (companion skill) | `../pull-request-diff-analyzer/SKILL.md` |
148
+ | Downstream: generate test cases from requirements | `../qa-write-test-cases/SKILL.md` |
149
+ | Downstream: sync generated cases to Testomat.io | `../sync-test-cases-with-tms/SKILL.md` |
@@ -0,0 +1,54 @@
1
+ # PR Requirements Summary — Example
2
+
3
+ A filled-in example of the artifact produced by the `qa-pr-requirements-analyzer` skill.
4
+
5
+ ---
6
+
7
+ ## PR Requirements Summary
8
+
9
+ **PR:** Add user export to CSV
10
+ **Branch:** feature/PRJ-789-user-export → main
11
+ **Type:** feature
12
+ **Linked Tickets:** PRJ-789
13
+
14
+ **Source of Truth:**
15
+ - PR description: present (detailed, includes AC checklist and screenshot of the export modal)
16
+ - Jira/GitHub ticket: resolved (PRJ-789)
17
+ - Most reliable source: PR description + ticket (consistent, no conflicts)
18
+
19
+ **Changes Overview:** Adds a CSV export action on the user list page that streams all currently filtered users to a downloadable file, with an email notification when exports exceed 10k rows.
20
+
21
+ **Impacted Areas:**
22
+ - User list page UI (new "Export" action).
23
+ - User data export pipeline (CSV generation, streaming, email delivery).
24
+ - Permission checks for export (admin-only).
25
+
26
+ **High Level Key files (up to 5):**
27
+ - `src/pages/UserList.tsx` — source
28
+ - `src/services/ExportService.ts` — source
29
+ - `src/api/export.ts` — source
30
+ - `src/components/ExportModal.tsx` — source
31
+ - `i18n/en.json` — config
32
+
33
+ **Scope Verification:**
34
+ - ✅ In scope: PRJ-789 AC1 (export button on the user list) — addressed in `src/pages/UserList.tsx` and `src/components/ExportModal.tsx`
35
+ - ✅ In scope: PRJ-789 AC2 (admin-only) — addressed in `ExportService.ts` permission check
36
+ - ⚠️ Out of scope: PRJ-789 AC3 (email notification for >10k exports) — no implementation found
37
+ - ➕ Extra (not in ticket): i18n strings for German locale (`i18n/de.json`) — ticket only mentioned English
38
+
39
+ **Ambiguities, Edge Cases & Open Questions:**
40
+ - CSV column order not specified — needs product confirmation.
41
+ - Concurrent exports by the same admin — no rate limiting or deduplication specified.
42
+ - 50k+ user export (memory/timeout) — no performance budget in the ticket.
43
+ - CSV date/time localization (UTC vs. user locale) — not specified.
44
+ - Backward compatibility with existing scheduled exports (if any) — not addressed.
45
+
46
+ **Acceptance Criteria:**
47
+ - Admin opens user list with filters and clicks "Export" → modal appears with row count estimate
48
+ - Admin starts export with <10k matching users → CSV downloads with columns `id, name, email, created_at` in that order
49
+ - Non-admin opens user list → "Export" action is hidden (or returns 403 via API)
50
+ - Admin triggers >10k user export → export is queued, email sent when ready *(NOT IMPLEMENTED — see Scope Verification)*
51
+ - User without email is included → email field is empty string in CSV
52
+ - Empty filtered list → button disabled OR empty CSV with header only
53
+ - 50k+ user export completes without server timeout or OOM
54
+ - German admin sees the export modal translated