From patrol-qa-automation
Update existing mobile UI test cases when code changes are detected. Accepts git diffs, PR references, or existing test case CSVs as input. Identifies affected UI test cases and produces updated/new/removed cases. Focuses exclusively on mobile visual/interaction test cases. Does NOT generate API, web, or backend test cases. Trigger: regenerate test cases, update test cases, refresh test cases, sync test cases with code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/patrol-qa-automation:regenerate-test-casesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Updates existing mobile UI test cases based on code changes. Compares
Updates existing mobile UI test cases based on code changes. Compares source code modifications against existing test coverage and produces incremental updates — adding new UI cases, modifying affected ones, and flagging obsolete cases for removal.
ONLY regenerate test cases for mobile app UI interactions.
When analyzing code diffs, focus on changes that affect:
Ignore changes that only affect:
impact-analysis skill)When impact-analysis has already been run, its structured JSON output
provides a pre-filtered, high-confidence list of affected test cases:
impact-analysis.recommended_action of MODIFY, CREATE,
or REMOVE.reason and impacted_by_scopes fields to understand WHY
each test case is affected.This is significantly more efficient than scanning raw diffs, especially for large PRs, because tomo_search uses AST-level scope detection to identify the precise blast radius.
When the user references a branch or asks to compare against main:
git diff <base_branch>...<current_branch> --stat to
identify changed files.git diff <base_branch>...<current_branch> for detailed
changes on relevant files.When the user provides a PR reference:
When the user points to an existing CSV in /test-cases/:
Input (Git Diff / PR / CSV reference)
│
▼
Identify Changed Code
- git diff --stat for file list
- Detailed diff for logic changes
- Categorize: added / modified / removed
│
▼
Load Existing Test Cases
- Read CSV from /test-cases/
- Map test cases to features/components
│
▼
Impact Analysis
- Which test cases are affected?
- What new scenarios are uncovered?
- What cases are now obsolete?
│
▼
Generate Delta
- NEW: Test cases for added functionality
- MODIFIED: Updated steps/expected results
- REMOVED: Flag obsolete test cases
│
▼
Output: Jira Comment + Updated CSV
| Code Change Type | Test Impact |
|---|---|
| New UI screen/widget | New test cases for screen states and interactions |
| Modified widget layout | Update visual assertions on related TCs |
| Changed navigation flow | Update steps on affected TCs |
| New loading/error state handling | New visual state test cases |
| Removed screen/feature | Flag related TCs as REMOVED |
| Modified form validation display | Update expected validation messages |
| New permission-gated UI | New permission test cases (UI access) |
| Changed gesture interactions | Update interaction steps |
Analyze file paths to determine UI-impacting areas:
**/screens/**, **/pages/** → Screen state & navigation test cases**/bloc/**, **/cubit/** → UI state rendering test cases**/widgets/**, **/components/** → Component interaction test cases**/routes/**, **/navigation/** → Navigation flow test cases**/theme/**, **/styles/** → Visual appearance test casesIgnore (no UI test impact):
**/repository/**, **/datasource/** → Skip (API layer)**/models/**, **/entities/** → Skip (data layer)**/services/** → Skip (backend logic)Before generating full test cases, present a summary:
## Test Case Impact Analysis
**Branch:** feature/xyz → main
**Files Changed:** 12
**Existing Test Cases:** 24 (from CSV)
### Impact Summary
- 🆕 NEW: 5 test cases (new functionality)
- ✏️ MODIFIED: 3 test cases (updated behavior)
- 🗑️ REMOVED: 2 test cases (obsolete)
- ✅ UNCHANGED: 14 test cases (not affected)
### Details:
| Action | TC ID | Title | Reason |
|--------|-------|-------|--------|
| NEW | TC025 | User able to ... | New endpoint added in user_repository.dart |
| MODIFIED | TC008 | User able to ... | Validation logic changed in form_bloc.dart |
| REMOVED | TC012 | User able to ... | Feature removed (settings_screen.dart deleted) |
Post the delta summary + new/modified test cases as a comment:
## Test Cases Update: {Ticket/PR Title}
*Regenerated by qa-test-case-generator | Trigger: {git diff / PR / manual}*
### Changes Summary
- 🆕 5 new | ✏️ 3 modified | 🗑️ 2 removed
### New Test Cases
| ID | Title | ... |
### Modified Test Cases
| ID | Title | Change Reason | ... |
### Removed Test Cases (Obsolete)
| ID | Title | Removal Reason |
Regenerate the full CSV with:
[REMOVED] tag)Filename: Same as original, or {identifier}_test_cases_v2.csv
if user prefers versioning.
IMPORTANT — Direct file writing only:
Write updated CSV content directly using create_file or
replace_string_in_file. Do NOT create Python scripts, shell scripts,
or any helper programs to generate the output. The agent has all the
data needed and must write the files itself in a single step.
Before running this skill, verify:
create-test-cases skill instead.create-test-cases first.npx claudepluginhub iqbal-mekari/claude-plugins --plugin patrol-qa-automationGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.