@juicesharp/rpiv-pi 0.4.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 (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +178 -0
  3. package/agents/codebase-analyzer.md +121 -0
  4. package/agents/codebase-locator.md +107 -0
  5. package/agents/codebase-pattern-finder.md +207 -0
  6. package/agents/integration-scanner.md +97 -0
  7. package/agents/precedent-locator.md +130 -0
  8. package/agents/test-case-locator.md +121 -0
  9. package/agents/thoughts-analyzer.md +147 -0
  10. package/agents/thoughts-locator.md +138 -0
  11. package/agents/web-search-researcher.md +107 -0
  12. package/extensions/rpiv-core/agents.ts +312 -0
  13. package/extensions/rpiv-core/git-context.ts +81 -0
  14. package/extensions/rpiv-core/guidance.ts +213 -0
  15. package/extensions/rpiv-core/index.ts +275 -0
  16. package/extensions/rpiv-core/package-checks.ts +51 -0
  17. package/package.json +36 -0
  18. package/scripts/migrate.js +242 -0
  19. package/scripts/types.js +1 -0
  20. package/skills/annotate-guidance/SKILL.md +303 -0
  21. package/skills/annotate-guidance/examples/root-dotnet-clean-arch.md +38 -0
  22. package/skills/annotate-guidance/examples/root-nodejs-monorepo.md +42 -0
  23. package/skills/annotate-guidance/examples/subfolder-database-layer.md +81 -0
  24. package/skills/annotate-guidance/examples/subfolder-dotnet-application.md +64 -0
  25. package/skills/annotate-guidance/examples/subfolder-schemas-layer.md +50 -0
  26. package/skills/annotate-guidance/templates/root-architecture.md +46 -0
  27. package/skills/annotate-guidance/templates/subfolder-architecture.md +57 -0
  28. package/skills/annotate-inline/SKILL.md +299 -0
  29. package/skills/annotate-inline/examples/root-dotnet-clean-arch.md +38 -0
  30. package/skills/annotate-inline/examples/root-nodejs-monorepo.md +42 -0
  31. package/skills/annotate-inline/examples/subfolder-database-layer.md +81 -0
  32. package/skills/annotate-inline/examples/subfolder-dotnet-application.md +64 -0
  33. package/skills/annotate-inline/examples/subfolder-schemas-layer.md +50 -0
  34. package/skills/annotate-inline/templates/root-claude-md.md +46 -0
  35. package/skills/annotate-inline/templates/subfolder-claude-md.md +57 -0
  36. package/skills/code-review/SKILL.md +184 -0
  37. package/skills/commit/SKILL.md +65 -0
  38. package/skills/create-handoff/SKILL.md +91 -0
  39. package/skills/design/SKILL.md +416 -0
  40. package/skills/discover/SKILL.md +242 -0
  41. package/skills/explore/SKILL.md +261 -0
  42. package/skills/implement/SKILL.md +74 -0
  43. package/skills/migrate-to-guidance/SKILL.md +88 -0
  44. package/skills/outline-test-cases/SKILL.md +348 -0
  45. package/skills/outline-test-cases/templates/feature-meta.md +43 -0
  46. package/skills/outline-test-cases/templates/outline-readme.md +36 -0
  47. package/skills/plan/SKILL.md +281 -0
  48. package/skills/research/SKILL.md +304 -0
  49. package/skills/resume-handoff/SKILL.md +207 -0
  50. package/skills/revise/SKILL.md +242 -0
  51. package/skills/validate/SKILL.md +175 -0
  52. package/skills/write-test-cases/SKILL.md +322 -0
  53. package/skills/write-test-cases/examples/customer-auth-flow.md +50 -0
  54. package/skills/write-test-cases/examples/order-management-suite.md +57 -0
  55. package/skills/write-test-cases/examples/order-placement-flow.md +54 -0
  56. package/skills/write-test-cases/examples/team-management-flow.md +56 -0
  57. package/skills/write-test-cases/examples/team-management-suite.md +54 -0
  58. package/skills/write-test-cases/templates/coverage-map.md +64 -0
  59. package/skills/write-test-cases/templates/regression-suite.md +63 -0
  60. package/skills/write-test-cases/templates/test-case.md +65 -0
@@ -0,0 +1,322 @@
1
+ ---
2
+ name: write-test-cases
3
+ description: Generate manual test case specifications for a single feature by analyzing code in parallel. Consumes outline-test-cases _meta.md when available for warm-start. Produces flow-based test cases with regression suite and project-wide coverage map. Outputs to .rpiv/test-cases/{feature}/ in the target project.
4
+ argument-hint: "[feature name, component path, feature slug, or _meta.md path] [additional instructions]"
5
+ ---
6
+
7
+ # Write Test Cases
8
+
9
+ You are tasked with generating manual test case specifications for a single feature by analyzing code in parallel and producing flow-based test case documents for QA teams.
10
+
11
+ ## Initial Setup
12
+
13
+ When this command is invoked, respond with:
14
+ ```
15
+ I'll generate test cases for this feature. Let me discover the relevant code and analyze it.
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ ## Steps
21
+
22
+ ### Step 1: Determine Feature Scope
23
+
24
+ Parse the user's input to determine the feature under test. Handle these input forms:
25
+
26
+ 1. **_meta.md path** (e.g., `.rpiv/test-cases/users/_meta.md`):
27
+ - Read the file. Extract `feature` from frontmatter. Mark as **has _meta.md**.
28
+
29
+ 2. **Feature folder or slug** (e.g., `.rpiv/test-cases/order-management/` or `order-management`):
30
+ - Check if `.rpiv/test-cases/{input}/_meta.md` exists
31
+ - If yes: read it, extract `feature`, mark as **has _meta.md**
32
+ - If no: treat as feature name
33
+
34
+ 3. **Source code path** (e.g., `src/orders/` or `src/api/controllers/OrdersController.ts`):
35
+ - Use the path directly as the starting point for analysis
36
+
37
+ 4. **Feature name with optional instructions** (e.g., `Order Management focus on refund edge cases`):
38
+ - Parse as `{feature identifier} [additional instructions]`
39
+ - Check if `.rpiv/test-cases/{slugified-name}/_meta.md` exists — if yes, read it and mark as **has _meta.md**
40
+ - Store additional instructions as supplemental context for agent prompts and checkpoint
41
+
42
+ 5. **No arguments provided**:
43
+ ```
44
+ I'll help you generate test cases. Please provide either:
45
+ 1. A feature name: `/skill:write-test-cases Order Management`
46
+ 2. A component path: `/skill:write-test-cases src/orders/`
47
+ 3. A feature slug: `/skill:write-test-cases order-management`
48
+ 4. A _meta.md path: `/skill:write-test-cases .rpiv/test-cases/orders/_meta.md`
49
+
50
+ Add instructions after the feature: `/skill:write-test-cases Order Management focus on refund edge cases`
51
+ ```
52
+ Then wait for input.
53
+
54
+ #### Warm-Start from _meta.md
55
+
56
+ When `_meta.md` is available, read it FULLY and extract:
57
+ - **Identity**: `feature`, `module`, `portal`, `slug` from frontmatter
58
+ - **Routes**: from `## Routes` section — route paths and component names
59
+ - **Endpoints**: from `## Endpoints` section — HTTP methods and paths
60
+ - **Scope decisions**: from `## Scope Decisions` section — in/out of scope items
61
+ - **Domain context**: from `## Domain Context` section — business rules and intentional behaviors
62
+ - **Checkpoint history**: from `## Checkpoint History` section — prior Q&A pairs
63
+
64
+ Report:
65
+ ```
66
+ [Warm-start]: Found _meta.md for "{feature}" ({module}, {portal}). {N} routes, {M} endpoints.
67
+ ```
68
+
69
+ When no _meta.md, detect the project's technology stack before spawning agents: check `package.json` for framework indicators (see Framework Detection Reference at end of document). If no `package.json`, check for `.csproj`/`.sln` (.NET), `pyproject.toml`/`requirements.txt` (Python). Use the detected framework to adapt Agent A's prompt in Step 2.
70
+
71
+ ### Step 2: Discover Feature Code (parallel agents)
72
+
73
+ Spawn the following agents in parallel using the Agent tool:
74
+
75
+ **Agent A — Web Layer Discovery:**
76
+ - subagent_type: `codebase-locator`
77
+ - When _meta.md is available: "Validate these known Web Layer entry points for {feature name}: {routes and endpoints from _meta.md}. Check if they still exist and find any NEW entry points not in this list. Report: confirmed (still exists), removed (no longer found), new (not in the list)."
78
+ - When no _meta.md: "Find all Web Layer entry points for the {feature name} feature{framework_hint}. Look for: controllers, route definitions, page components, form handlers, API endpoints. Search across all web layers (API, Admin, Customer Portal, Host, etc.). Also find frontend service files, HTTP clients, or API call sites that reference these endpoints — report which frontend pages call which backend URLs. For each entry point found, report: file path, HTTP method/route or page path, and a one-line description of what it does. Group by web layer."
79
+
80
+ {framework_hint} is " in this {Framework} project" when a framework is detected (e.g., " in this Angular project"), or empty string if none detected. See Framework Detection Reference at end of document.
81
+
82
+ **Agent B — Existing Test Cases:**
83
+ - subagent_type: `test-case-locator`
84
+ - Prompt: "Search for existing test cases related to {feature name} in .rpiv/test-cases/. Report any existing TCs with their IDs, titles, and priorities so we can avoid duplicates."
85
+
86
+ Wait for both agents to complete before proceeding.
87
+
88
+ ### Step 3: Analyze Feature Code (parallel agents)
89
+
90
+ Using the entry points discovered in Step 2 (validated against _meta.md when available), spawn analysis agents in parallel. When _meta.md is available, enrich prompts: append scope exclusions from `## Scope Decisions` as {scope_context}, domain rules from `## Domain Context` as {domain_context}, and endpoint list as {endpoint_scope}. When no _meta.md, omit these.
91
+
92
+ **Agent C — Code Analysis:**
93
+ - subagent_type: `codebase-analyzer`
94
+ - Prompt: "Analyze the {feature name} feature implementation in detail. Read the controllers/route handlers at {discovered paths}. For each endpoint/action, determine: 1) What user input is accepted (request body, query params, form fields)? 2) What validation rules exist — report specific limits (max lengths, regex patterns, required vs optional)? 3) What business logic is executed? 4) What are the success/error responses? 5) What authorization/permissions are required? Focus on understanding USER FLOWS — sequences of actions a user would perform to accomplish a goal. ALSO read the frontend page components and templates at {discovered frontend paths}. Extract what a QA tester would actually see: exact button labels, form field labels/placeholders, navigation items, table column headers, success/error messages, and conditional UI (role- or state-dependent elements). Resolve any i18n translation keys to displayed text. Report UI elements per page/route alongside the backend analysis.{scope_context}{domain_context}"
95
+
96
+ **Agent D — Postcondition Discovery:**
97
+ - subagent_type: `integration-scanner`
98
+ - Prompt: "Find all side effects triggered by {feature name} actions{endpoint_scope}. Look for: domain events published, message handlers invoked, email/notification triggers, external API calls, database cascades, cache invalidations, audit log entries, webhook dispatches. For each side effect, report: what triggers it (which action/endpoint), what it does, and where the handler code lives. These become postconditions in test cases.{scope_context}"
99
+
100
+ Wait for ALL agents to complete before proceeding.
101
+
102
+ ### Step 4: Synthesize Findings
103
+
104
+ Compile all agent results into a feature analysis:
105
+
106
+ 1. **Map user flows** — Group the discovered endpoints/pages into logical user journeys:
107
+ - Identify the natural sequence of actions (e.g., browse -> select -> configure -> checkout -> confirm)
108
+ - Each flow should represent a complete user goal, not isolated actions
109
+ - A feature typically produces 3-8 flows depending on complexity
110
+ - **When to separate**: If view and edit serve different user goals, keep them as separate flows. If a sub-operation (e.g., replace, export, bulk action) has its own trigger and confirmation, it deserves its own flow. If different user roles interact with the same entity differently, split by role.
111
+ - **Use real UI element names** from Agent C's frontend analysis — actual button labels, form field names, navigation text, displayed messages. Do not infer UI element names from backend action semantics.
112
+
113
+ 2. **Enrich with postconditions** — For each flow, attach the side effects discovered by the integration-scanner:
114
+ - Map domain events to specific flow steps
115
+ - Include cross-system effects (emails, webhooks, inventory changes)
116
+
117
+ 3. **Check for duplicates** — Cross-reference synthesized flows against existing TCs from test-case-locator:
118
+ - If an existing TC covers a flow, note it and skip that flow
119
+ - If partial overlap, note the gap to fill
120
+
121
+ 4. **Assign priorities**:
122
+ - **high**: Core happy path, payment/money flows, data integrity, security-critical
123
+ - **medium**: Alternative paths, common edge cases, permission boundaries
124
+ - **low**: Rare edge cases, cosmetic validation, error message wording
125
+
126
+ 5. **Determine test case IDs**:
127
+ - Module abbreviation: from _meta.md `module` field, or derive from feature name (e.g., Order Management -> ORD)
128
+ - Numbering: start at 001, or continue from highest existing TC ID if duplicates found
129
+ - Format: `TC-{MODULE}-{NNN}`
130
+
131
+ **Do NOT write test cases yet** — proceed to the developer checkpoint first.
132
+
133
+ ### Step 5: Developer Checkpoint
134
+
135
+ Present a flow summary, then ask grounded questions one at a time.
136
+
137
+ **Flow summary** (under 20 lines):
138
+ ```
139
+ ## Feature: [Feature Name]
140
+
141
+ Entry points: [N] endpoints across [M] web layers
142
+ Postconditions: [K] side effects discovered
143
+ Existing TCs: [X] found (will skip duplicates)
144
+
145
+ ### Proposed Test Cases:
146
+ 1. TC-{MOD}-001: {Flow title} (priority: high)
147
+ Steps: {brief flow summary — e.g., "browse -> add to cart -> checkout -> payment -> confirm"}
148
+ 2. TC-{MOD}-002: {Flow title} (priority: medium)
149
+ Steps: {brief flow summary}
150
+ [etc.]
151
+
152
+ Flows skipped (already covered): [list or "none"]
153
+ ```
154
+
155
+ When _meta.md is available, prepend:
156
+ ```
157
+ ### Prior Scope Decisions (from outline):
158
+ - {decision 1}
159
+ - {decision 2}
160
+ These are carried forward. I'll only ask about new findings.
161
+ ```
162
+
163
+ Then ask grounded questions — **one at a time**. Use a **❓ Question:** prefix so the developer knows their input is needed. Each question must reference real findings with file:line evidence and pull NEW information from the developer. Focus on:
164
+
165
+ - Missing flows the code analysis couldn't detect (e.g., "I found create/update/delete flows but no bulk import — is that a feature?")
166
+ - Postconditions the integration-scanner might have missed (e.g., "No webhook found for order status changes — is there an external notification I'm not seeing?")
167
+ - Priority overrides (e.g., "I marked refund flow as medium — should it be high given payment implications?")
168
+ - User roles and permissions that affect test preconditions
169
+ - Test data requirements not obvious from code
170
+
171
+ When _meta.md is available: skip questions already answered in `## Checkpoint History`. Only ask about new findings not covered by prior decisions.
172
+
173
+ **CRITICAL**: Ask ONE question at a time. Wait for the answer before asking the next. Lead with your most significant finding.
174
+
175
+ **Choosing question format:**
176
+
177
+ - **`ask_user_question` tool** — when your question has 2-4 concrete options from code analysis (pattern conflicts, integration choices, scope boundaries, priority overrides). The user can always pick "Other" for free-text. Example: Use the `ask_user_question` tool with the question "Found 2 mapping approaches — which should new code follow?". Options: "Manual mapping (Recommended)" (Used in OrderService (src/services/OrderService.ts:45) — 8 occurrences); "AutoMapper" (Used in UserService (src/services/UserService.ts:12) — 2 occurrences).
178
+
179
+ - **Free-text with ❓ Question: prefix** — when the question is open-ended and options can't be predicted (discovery, "what am I missing?", corrections). Example:
180
+ "❓ Question: Integration scanner found no background job registration for this area. Is that expected, or is there async processing I'm not seeing?"
181
+
182
+ **Batching**: When you have 2-4 independent questions (answers don't depend on each other), you MAY batch them in a single `ask_user_question` call. Keep dependent questions sequential.
183
+
184
+ **Classify each response:**
185
+
186
+ **Corrections** (e.g., "that flow doesn't exist", "wrong priority"):
187
+ - Update flow list. Record in notes.
188
+
189
+ **Missing flows** (e.g., "you missed the bulk export feature"):
190
+ - Spawn targeted **codebase-analyzer** (max 1 agent) to analyze the missing area.
191
+ - Add the flow to the list.
192
+
193
+ **Scope adjustments** (e.g., "skip admin flows, focus on customer portal"):
194
+ - Remove out-of-scope flows. Record the adjustment.
195
+
196
+ **Confirmations** (e.g., "looks good", "yes proceed"):
197
+ - Proceed to Step 6.
198
+
199
+ ### Step 6: Generate Test Case Documents
200
+
201
+ Read the templates before writing:
202
+ - Read the full test case template at `templates/test-case.md`
203
+ - Read the full regression suite template at `templates/regression-suite.md`
204
+
205
+ See `examples/order-placement-flow.md` (e-commerce order flow), `examples/customer-auth-flow.md` (authentication flow), and `examples/team-management-flow.md` (SaaS team management flow) for well-formed test case examples.
206
+
207
+ What makes these examples good:
208
+ - **Steps are user-centric** — "Navigate to...", "Click...", "Enter..." — not technical ("POST to /api/orders")
209
+ - **Expected results are observable** — what the user SEES, not internal state changes
210
+ - **Postconditions verify side effects** — email sent, inventory updated, audit logged
211
+ - **Edge cases are separate bullets** — not crammed into steps
212
+ - **Preconditions are specific** — exact user role, required test data, system state
213
+
214
+ See `examples/order-management-suite.md` and `examples/team-management-suite.md` for well-formed regression suite examples.
215
+
216
+ What makes these examples good:
217
+ - **Smoke subset is minimal** — 2-4 high-priority TCs covering critical paths
218
+ - **Priority ordering** — high -> medium -> low within the full regression table
219
+ - **Coverage map** cross-references TCs against feature sub-areas
220
+ - **Gaps section** flags known uncovered areas for future work
221
+
222
+ **For each confirmed flow**, generate a test case document:
223
+ - Follow the test-case.md template exactly
224
+ - Write user-facing actions in Steps (what they click/type/navigate), not API calls
225
+ - Use actual UI element names discovered by Agent C (button labels, form fields, navigation items, messages) — do NOT fabricate element names from backend semantics. If Agent C didn't find a specific label, describe the element generically (e.g., "submit button" not "Click 'Save Changes'")
226
+ - Expected results describe what the user observes (success message, redirect, updated list)
227
+ - Postconditions describe system-level side effects (from integration-scanner findings)
228
+ - Edge cases list variant scenarios worth separate testing
229
+ - Include preconditions: user role, required test data, system state
230
+ - Include `generated_at_commit` in frontmatter with current git commit hash
231
+
232
+ **After all TCs**, generate the regression suite document:
233
+ - Follow the regression-suite.md template
234
+ - List all TCs with priority ordering (high -> medium -> low)
235
+ - Mark smoke test subset (TCs that cover critical paths in minimal time)
236
+ - Include coverage map cross-referencing TCs to feature sub-areas
237
+ - Calculate total estimated execution time
238
+ - Include `git_commit` in overview with current commit hash
239
+
240
+ ### Step 7: Write Files & Update Artifacts
241
+
242
+ 1. **Determine output directory**:
243
+ - Target: `.rpiv/test-cases/{feature-slug}/` in the current working directory
244
+ - Feature slug: from _meta.md (when available) or kebab-case from feature name
245
+ - Create the directory if it doesn't exist
246
+
247
+ 2. **Write all files at once** using the Write tool:
248
+ - Individual TC files: `TC-{MOD}-{NNN}_{flow-slug}.md`
249
+ - Regression suite: `_regression-suite.md` (underscore prefix sorts it first)
250
+ - Do NOT ask for confirmation before each file — batch mode
251
+
252
+ 3. **Update _meta.md** (when it exists):
253
+ - Set `tc_count` to the number of TCs written
254
+ - Set `status` to `generated`
255
+ - Update `generated` date to current date
256
+ - Append new checkpoint Q&A pairs to `## Checkpoint History` under a new date header — only if new Q&A occurred during Step 5
257
+
258
+ 4. **Rebuild root coverage map** at `.rpiv/test-cases/_coverage-map.md`:
259
+ - Read the coverage map template at `templates/coverage-map.md`
260
+ - Glob for all `_regression-suite.md` files across `.rpiv/test-cases/*/`
261
+ - Glob for all `_meta.md` files across `.rpiv/test-cases/*/`
262
+ - Read each file's key data (frontmatter, summary stats, coverage map, smoke subset)
263
+ - Aggregate into the coverage map template
264
+ - Write the file (if only one feature exists, the map shows just that feature — it grows over time)
265
+
266
+ 5. **Present summary**:
267
+ ```
268
+ ## Test Cases Written
269
+
270
+ | File | Priority | Flow |
271
+ |------|----------|------|
272
+ | TC-ORD-001_place-order.md | high | Place and confirm order |
273
+ | TC-ORD-002_cancel-order.md | medium | Cancel order before fulfillment |
274
+ | _regression-suite.md | — | Feature summary (N TCs, ~Xm execution) |
275
+ | _coverage-map.md | — | Project-wide coverage (N features, M TCs) |
276
+
277
+ Output: `.rpiv/test-cases/{feature-slug}/`
278
+ Total: [N] test cases + 1 regression suite + 1 coverage map
279
+
280
+ Review the generated test cases and let me know if you'd like adjustments.
281
+ ```
282
+
283
+ ### Step 8: Handle Follow-ups
284
+
285
+ - **Add missing flows**: Spawn targeted codebase-analyzer, generate new TCs, regenerate regression suite and coverage map
286
+ - **Adjust priorities**: Edit TC frontmatter, regenerate regression suite and coverage map
287
+ - **Modify steps**: Edit specific TC files directly
288
+ - **Delete TCs**: Remove the file, regenerate regression suite and coverage map
289
+ - **Re-run for different feature**: User invokes the skill again with a new feature name
290
+
291
+ On any TC change: always regenerate `_regression-suite.md` and `_coverage-map.md` to keep them in sync.
292
+
293
+ ## Framework Detection Reference
294
+
295
+ | Indicator | Framework | Detection |
296
+ |-----------|-----------|-----------|
297
+ | `@angular/core` | Angular | `package.json` dependencies |
298
+ | `react-router-dom` / `react-router` / `@react-router` | React | `package.json` dependencies |
299
+ | `next` | Next.js | `package.json` dependencies |
300
+ | `vue-router` | Vue Router | `package.json` dependencies |
301
+ | `nuxt` | Nuxt | `package.json` dependencies |
302
+ | `.csproj` / `.sln` | .NET | File presence in project root |
303
+ | `pyproject.toml` / `requirements.txt` with Django/Flask/FastAPI | Python | File presence + dependency check |
304
+ | None found | Backend-only | Fallback — omit framework hint |
305
+
306
+ ## Important Notes
307
+
308
+ - **Manual test cases for QA teams** — NOT automated test code. Write in natural language from the user's perspective.
309
+ - **Flow-level granularity** — each TC covers a complete user journey, not a single endpoint.
310
+ - **Postconditions are critical** — side effects from domain events are what distinguish a thorough TC from a superficial one.
311
+ - **Never skip the developer checkpoint** — QA domain knowledge (which flows matter most, what edge cases exist in production) is the highest-value signal.
312
+ - **_meta.md is warm start, not truth** — always validate against live code via Agent A, even with _meta.md available.
313
+ - **File reading**: Always read templates FULLY (no limit/offset) before generating test cases.
314
+ - **Critical ordering**: Follow the numbered steps exactly.
315
+ - ALWAYS wait for discovery agents (Step 2) before spawning analysis agents (Step 3)
316
+ - ALWAYS wait for ALL agents to complete before synthesizing (Step 4)
317
+ - ALWAYS resolve all checkpoint questions (Step 5) before generating TCs (Step 6)
318
+ - ALWAYS regenerate regression suite and coverage map after any TC writes (Step 7)
319
+ - NEVER write test case files with placeholder values
320
+ - **Duplicate avoidance**: Always check existing TCs via test-case-locator before generating new ones.
321
+ - **ID continuity**: If existing TCs exist for this module, continue numbering from the highest existing ID.
322
+ - CC auto-loads CLAUDE.md files when agents read files in a directory — no need to scan for them explicitly.
@@ -0,0 +1,50 @@
1
+ ---
2
+ id: TC-AUTH-001
3
+ title: "Customer magic-link login"
4
+ feature: "Customer Authentication"
5
+ priority: high
6
+ type: functional
7
+ status: draft
8
+ tags: ["auth", "login", "magic-link", "customer-portal", "happy-path"]
9
+ generated_at_commit: abc1234
10
+ ---
11
+
12
+ # Customer magic-link login
13
+
14
+ ## Objective
15
+ Verify that a customer can request a magic-link login email, click the link, and be authenticated into the Customer Portal with the correct session and permissions.
16
+
17
+ ## Preconditions
18
+ - Customer account exists with email "test@example.com"
19
+ - Email delivery service is configured in test mode
20
+ - Customer is NOT currently logged in
21
+ - No active sessions exist for this customer
22
+
23
+ ## Steps
24
+ | # | Action | Expected Result |
25
+ |---|--------|-----------------|
26
+ | 1 | Navigate to Customer Portal login page | Login form displays with email field and "Send Magic Link" button |
27
+ | 2 | Enter "test@example.com" in email field | Email field validates format, no error shown |
28
+ | 3 | Click "Send Magic Link" | Success message: "Check your email for a login link". Button disabled for 60s |
29
+ | 4 | Open email inbox and find magic-link email | Email received within 2 minutes with one-time login URL |
30
+ | 5 | Click the magic-link URL in the email | Browser opens, brief loading state, redirects to Customer Portal dashboard |
31
+ | 6 | Verify dashboard displays correctly | Customer name in header, recent orders listed, subscription status visible |
32
+ | 7 | Refresh the page | Session persists — dashboard still shows, not redirected to login |
33
+
34
+ ## Postconditions
35
+ - Session token created and stored (verify via browser cookies/localStorage)
36
+ - Login event recorded in audit log with timestamp, IP address, and auth method "magic-link"
37
+ - Magic link marked as used — clicking same link again shows "Link expired" page
38
+ - Last login timestamp updated on customer record
39
+
40
+ ## Edge Cases
41
+ - Expired magic link (>15 minutes old) — verify "Link expired, request a new one" message
42
+ - Already-used magic link — verify "Link already used" message
43
+ - Non-existent email address — verify same success message shown (no email enumeration)
44
+ - Multiple magic links requested — verify only the most recent link works
45
+ - Magic link opened in different browser/device — verify it still works
46
+
47
+ ## Notes
48
+ - Related TCs: TC-AUTH-002 (logout), TC-AUTH-003 (session expiry)
49
+ - Dependencies: Email delivery service in test mode, ability to inspect test emails
50
+ - Known issues: Magic link emails may be delayed up to 2 minutes in test environments
@@ -0,0 +1,57 @@
1
+ # Order Management — Regression Suite
2
+
3
+ ## Overview
4
+ - Feature: Order Management
5
+ - Module: ORD
6
+ - Total test cases: 6
7
+ - Estimated execution: ~35 minutes
8
+ - Last generated: 2026-03-31
9
+ - Git commit: abc1234
10
+
11
+ ## Smoke Test Subset
12
+ | Priority | TC ID | Title | Est. Time |
13
+ |----------|-------|-------|-----------|
14
+ | high | TC-ORD-001 | Place order with physical products | ~5m |
15
+ | high | TC-ORD-004 | Process full refund | ~5m |
16
+
17
+ **Smoke total: ~10 minutes**
18
+
19
+ ## Full Regression
20
+
21
+ ### High Priority
22
+ | TC ID | Title | Type | Est. Time |
23
+ |-------|-------|------|-----------|
24
+ | TC-ORD-001 | Place order with physical products | functional | ~5m |
25
+ | TC-ORD-003 | Fulfill order and trigger shipping | functional | ~8m |
26
+ | TC-ORD-004 | Process full refund | functional | ~5m |
27
+
28
+ ### Medium Priority
29
+ | TC ID | Title | Type | Est. Time |
30
+ |-------|-------|------|-----------|
31
+ | TC-ORD-002 | Cancel order before fulfillment | functional | ~5m |
32
+ | TC-ORD-005 | Admin edits order line items | functional | ~5m |
33
+
34
+ ### Low Priority
35
+ | TC ID | Title | Type | Est. Time |
36
+ |-------|-------|------|-----------|
37
+ | TC-ORD-006 | Filter and search order list | regression | ~3m |
38
+
39
+ **Full regression total: ~31 minutes**
40
+
41
+ ## Coverage Map
42
+ | Area | TCs Covering |
43
+ |------|-------------|
44
+ | Order Creation | TC-ORD-001 |
45
+ | Order Cancellation | TC-ORD-002 |
46
+ | Fulfillment | TC-ORD-003 |
47
+ | Refunds | TC-ORD-004 |
48
+ | Order Editing | TC-ORD-005 |
49
+ | Order Listing/Search | TC-ORD-006 |
50
+ | Payment Processing | TC-ORD-001, TC-ORD-004 |
51
+ | Email Notifications | TC-ORD-001, TC-ORD-003, TC-ORD-004 |
52
+ | Inventory Updates | TC-ORD-001, TC-ORD-003, TC-ORD-004 |
53
+
54
+ ## Gaps
55
+ - Bulk order import — no TC generated, feature not yet implemented
56
+ - Partial refund flow — deferred, pending UX design for line-item selection
57
+ - Order export to CSV — low priority, cosmetic feature
@@ -0,0 +1,54 @@
1
+ ---
2
+ id: TC-ORD-001
3
+ title: "Place order with physical products"
4
+ feature: "Order Management"
5
+ priority: high
6
+ type: functional
7
+ status: draft
8
+ tags: ["orders", "checkout", "payment", "happy-path"]
9
+ generated_at_commit: abc1234
10
+ ---
11
+
12
+ # Place order with physical products
13
+
14
+ ## Objective
15
+ Verify that a customer can browse products, add them to cart, complete checkout with a valid credit card, and receive an order confirmation. This is the primary revenue-generating flow.
16
+
17
+ ## Preconditions
18
+ - Customer account exists with verified email
19
+ - At least 2 physical products are published with available inventory
20
+ - Stripe test mode is configured with valid API keys
21
+ - Customer is logged into the Customer Portal
22
+
23
+ ## Steps
24
+ | # | Action | Expected Result |
25
+ |---|--------|-----------------|
26
+ | 1 | Navigate to product catalog page | Product listing displays with prices and availability |
27
+ | 2 | Click "Add to Cart" on first product | Cart badge updates to show 1 item, toast confirms addition |
28
+ | 3 | Click "Add to Cart" on second product | Cart badge updates to 2 items |
29
+ | 4 | Click cart icon in navigation header | Cart drawer slides open showing both products with quantities and subtotal |
30
+ | 5 | Click "Proceed to Checkout" | Checkout page loads with shipping address form |
31
+ | 6 | Enter valid shipping address and select shipping method | Shipping cost calculates and order total updates |
32
+ | 7 | Enter valid test credit card (4242 4242 4242 4242) | Card field shows validated state with card brand icon |
33
+ | 8 | Click "Place Order" | Loading spinner appears, then redirects to order confirmation page |
34
+ | 9 | Verify order confirmation page | Order number displayed, line items match cart, total matches checkout |
35
+
36
+ ## Postconditions
37
+ - Order record created in database with status "pending_fulfillment"
38
+ - Order confirmation email sent to customer's email address
39
+ - Inventory quantity decremented for both purchased products
40
+ - Payment charge captured in Stripe (verify in Stripe dashboard)
41
+ - Webhook dispatched to fulfillment service with order details
42
+ - Audit log entry created with action "order.created" and customer ID
43
+
44
+ ## Edge Cases
45
+ - Order with quantity > 1 of same product — verify inventory deducts correct amount
46
+ - Order with product at maximum inventory — verify "last item" handling
47
+ - Payment gateway timeout — verify order is not created, customer sees retry option
48
+ - Browser back button during payment processing — verify no duplicate charges
49
+ - Coupon code applied at checkout — verify discount reflected in total and payment
50
+
51
+ ## Notes
52
+ - Related TCs: TC-ORD-002 (cancel order), TC-ORD-003 (refund order)
53
+ - Dependencies: Stripe test environment, fulfillment webhook endpoint
54
+ - Known issues: Intermittent Stripe webhook delay (up to 30s) may affect postcondition verification
@@ -0,0 +1,56 @@
1
+ ---
2
+ id: TC-TEAM-001
3
+ title: "Invite and onboard new team member"
4
+ feature: "Team Management"
5
+ priority: high
6
+ type: functional
7
+ status: draft
8
+ tags: ["team", "invitation", "onboarding", "roles", "happy-path"]
9
+ generated_at_commit: abc1234
10
+ ---
11
+
12
+ # Invite and onboard new team member
13
+
14
+ ## Objective
15
+ Verify that a workspace admin can invite a new team member by email, the invitee receives an invitation, and upon accepting they gain access to the workspace with the assigned role and permissions.
16
+
17
+ ## Preconditions
18
+ - Workspace exists with at least 1 admin user
19
+ - Admin user is logged into the workspace Settings area
20
+ - Invitation email service is configured in test mode
21
+ - Target email address ("newmember@example.com") is not already a workspace member
22
+ - Workspace is not at member limit
23
+
24
+ ## Steps
25
+ | # | Action | Expected Result |
26
+ |---|--------|-----------------|
27
+ | 1 | Navigate to Settings > Team Members page | Team members list displays with current members and their roles |
28
+ | 2 | Click "Invite Member" button | Invitation form appears with email field and role dropdown |
29
+ | 3 | Enter "newmember@example.com" in email field | Email field validates format, no error shown |
30
+ | 4 | Select "Editor" from role dropdown | Role selection highlights "Editor" with permission summary tooltip |
31
+ | 5 | Click "Send Invitation" | Success toast: "Invitation sent to newmember@example.com". Member appears in list with status "Invited" |
32
+ | 6 | Open invitee's email inbox | Invitation email received with workspace name and "Accept Invitation" button |
33
+ | 7 | Click "Accept Invitation" link in email | Browser opens account creation page (or login page if account exists) |
34
+ | 8 | Complete account creation with name and password | Account created, redirects to workspace dashboard |
35
+ | 9 | Verify workspace dashboard access | Dashboard loads with workspace content visible, "Editor" badge in profile menu |
36
+ | 10 | Return to admin's Team Members page | New member shows status "Active" with role "Editor" |
37
+
38
+ ## Postconditions
39
+ - Invitation record created with status "accepted" and acceptance timestamp
40
+ - New user account linked to workspace with "Editor" role
41
+ - Invitation email marked as used — re-clicking link shows "Already accepted" message
42
+ - Audit log entry created with action "team.member_invited" (admin) and "team.invitation_accepted" (invitee)
43
+ - Workspace member count incremented by 1
44
+ - Welcome notification sent to new member (in-app)
45
+
46
+ ## Edge Cases
47
+ - Invite email already associated with an existing account — verify login flow instead of signup
48
+ - Invite with "Admin" role — verify admin permissions granted after acceptance
49
+ - Re-invite after previous invitation expired — verify new invitation supersedes old
50
+ - Invite when workspace is at member limit — verify error message shown before sending
51
+ - Invited user closes browser mid-signup and returns via link later — verify flow resumes
52
+
53
+ ## Notes
54
+ - Related TCs: TC-TEAM-002 (change member role), TC-TEAM-003 (deactivate member)
55
+ - Dependencies: Email delivery service in test mode, invitation token service
56
+ - Known issues: Invitation emails may take up to 1 minute in test environments
@@ -0,0 +1,54 @@
1
+ # Team Management — Regression Suite
2
+
3
+ ## Overview
4
+ - Feature: Team Management
5
+ - Module: TEAM
6
+ - Total test cases: 5
7
+ - Estimated execution: ~28 minutes
8
+ - Last generated: 2026-04-01
9
+ - Git commit: abc1234
10
+
11
+ ## Smoke Test Subset
12
+ | Priority | TC ID | Title | Est. Time |
13
+ |----------|-------|-------|-----------|
14
+ | high | TC-TEAM-001 | Invite and onboard new team member | ~5m |
15
+ | high | TC-TEAM-003 | Deactivate team member | ~5m |
16
+
17
+ **Smoke total: ~10 minutes**
18
+
19
+ ## Full Regression
20
+
21
+ ### High Priority
22
+ | TC ID | Title | Type | Est. Time |
23
+ |-------|-------|------|-----------|
24
+ | TC-TEAM-001 | Invite and onboard new team member | functional | ~5m |
25
+ | TC-TEAM-003 | Deactivate team member | functional | ~5m |
26
+
27
+ ### Medium Priority
28
+ | TC ID | Title | Type | Est. Time |
29
+ |-------|-------|------|-----------|
30
+ | TC-TEAM-002 | Change member role | functional | ~5m |
31
+ | TC-TEAM-004 | Manage team member permissions | functional | ~5m |
32
+
33
+ ### Low Priority
34
+ | TC ID | Title | Type | Est. Time |
35
+ |-------|-------|------|-----------|
36
+ | TC-TEAM-005 | Filter and search team member list | regression | ~3m |
37
+
38
+ **Full regression total: ~23 minutes**
39
+
40
+ ## Coverage Map
41
+ | Area | TCs Covering |
42
+ |------|-------------|
43
+ | Invitation Flow | TC-TEAM-001 |
44
+ | Role Management | TC-TEAM-002 |
45
+ | Member Deactivation | TC-TEAM-003 |
46
+ | Permission Configuration | TC-TEAM-002, TC-TEAM-004 |
47
+ | Member Listing/Search | TC-TEAM-005 |
48
+ | Audit Logging | TC-TEAM-001, TC-TEAM-003 |
49
+ | Email Notifications | TC-TEAM-001, TC-TEAM-003 |
50
+
51
+ ## Gaps
52
+ - Bulk member import via CSV — feature exists but UI is in beta, deferred
53
+ - SSO/SAML integration — separate authentication feature, not team management
54
+ - Member activity reporting — read-only dashboard, low testing value
@@ -0,0 +1,64 @@
1
+ ```markdown
2
+ # {Project Name} — Test Case Coverage Map
3
+
4
+ ## Overview
5
+ - Project: {project name}
6
+ - Total features: {N} covered
7
+ - Total test cases: {N}
8
+ - Estimated full regression: ~{X} minutes
9
+ - Last updated: {YYYY-MM-DD}
10
+ - Git commit: {commit-hash}
11
+
12
+ ## Portal Summary
13
+
14
+ ### {Portal Name} ({N} features, {M} TCs, ~{X}m)
15
+ | Feature | Module | TCs | High | Med | Low | Smoke | Est. Time |
16
+ |---------|--------|-----|------|-----|-----|-------|-----------|
17
+ | {Feature Name} | {MOD} | {N} | {h} | {m} | {l} | {smoke count} | ~{X}m |
18
+
19
+ ## Project-Wide Smoke Suite
20
+ {Minimum TCs across ALL features for quick project-level sanity check}
21
+
22
+ | Portal | TC ID | Feature | Title | Est. Time |
23
+ |--------|-------|---------|-------|-----------|
24
+ | {portal} | TC-{MOD}-{NNN} | {feature} | {title} | ~{N}m |
25
+
26
+ **Project smoke total: ~{X} minutes**
27
+
28
+ ## Cross-Feature Coverage
29
+ {Areas that span multiple features — verify these when cross-cutting changes are made}
30
+
31
+ | Cross-Cutting Area | Features Involved | TCs Covering |
32
+ |-------------------|-------------------|-------------|
33
+ | {e.g., Payment Processing} | {Order Mgmt, Invoice Mgmt} | TC-ORD-001, TC-INV-003 |
34
+
35
+ ## Priority Distribution
36
+ | Priority | Count | Percentage |
37
+ |----------|-------|-----------|
38
+ | High | {N} | {X}% |
39
+ | Medium | {N} | {X}% |
40
+ | Low | {N} | {X}% |
41
+
42
+ ## Uncovered Areas
43
+ {Features or sub-areas without test cases — flagged for future work}
44
+ - {uncovered area} — {reason: not yet generated / out of scope / deferred}
45
+
46
+ ## Phantom Features (Backend-Only)
47
+ {Backend endpoints with no frontend exposure — skipped during generation. Populated from _meta.md data when available.}
48
+ - {controller/endpoint group} — {reason: platform API / webhook / deprecated / sub-service}
49
+
50
+ ## Test Data Requirements
51
+ {Aggregate test data needs across all features. Populated from _meta.md Test Data Requirements sections when available.}
52
+ - {e.g., "Stripe test mode with valid API keys (Order Mgmt, Invoice Mgmt)"}
53
+ - {e.g., "At least 2 published products with inventory (Order Mgmt, Product Mgmt)"}
54
+ ```
55
+
56
+ **Portal Summary** groups features by application/portal for QA team assignment. Each portal section includes aggregate stats. Portal names come from `_meta.md` `portal` field when available, or default to "General" when features were generated in standalone mode.
57
+
58
+ **Project-Wide Smoke Suite** selects the highest-priority TCs from each feature's smoke subset — typically 1-2 per feature. A QA tester should be able to run the project smoke suite in under 30 minutes.
59
+
60
+ **Cross-Feature Coverage** identifies shared concerns (payment, email, auth, inventory) and which TCs from different features exercise them. Useful when a cross-cutting change is made — QA knows exactly which TCs to re-run. Built by scanning postconditions across all regression suites for shared keywords.
61
+
62
+ **Phantom Features** documents what was NOT covered and why. Populated from `_meta.md` data (pipeline mode). In standalone mode, populated from phantom detection results. If no phantom data is available, omit this section.
63
+
64
+ **Test Data Requirements** consolidates prerequisites across all features so QA can set up a test environment once. Populated from `_meta.md` `## Test Data Requirements` sections. If no _meta.md data is available, omit this section.