From potenlab-workflow
Verifies and updates tests after code changes. Detects what changed (git diff, changes.json), compares against test-plan.md, then spawns qa-specialist agents to update test-plan.md and edit/create test files in /features, /tests, /supabase. Use after /developer or manual changes to keep tests in sync. Triggers on: verify test, verify tests, sync tests, update tests, check tests, test verify.
npx claudepluginhub potenlab/marketplace-potenlab --plugin potenlab-workflowThis skill uses the workspace's default tool permissions.
Detect code changes, compare against `test-plan.md`, and update both the test plan and test files to stay in sync.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Detect code changes, compare against test-plan.md, and update both the test plan and test files to stay in sync.
Use /verify-test when:
/developer and made changes to featurestest-plan.md reflects current behaviorDo NOT use when:
/generate-test/run-test-all or /run-test-phase/verify-test [scope]
|
v
+----------------------------------------------------------+
| STEP 1: Detect changes |
| - Read changes.json (if exists) |
| - Run git diff for modified files |
| - Identify affected features |
+----------------------------------------------------------+
|
v
+----------------------------------------------------------+
| STEP 2: Read context |
| - test-plan.md (current test scenarios) |
| - vitest-best-practices.md (testing rules) |
| - backend-plan.md (schema, RLS context) |
| - Existing test files for affected features |
+----------------------------------------------------------+
|
v
+----------------------------------------------------------+
| STEP 3: Analyze divergence |
| - Compare changed source vs test-plan.md |
| - Identify: new behavior, removed behavior, changed |
| behavior, new features without tests |
+----------------------------------------------------------+
|
v
+----------------------------------------------------------+
| STEP 4: Update test-plan.md |
| - Add new scenarios for new behavior |
| - Update existing scenarios for changed behavior |
| - Mark removed scenarios as deprecated |
+----------------------------------------------------------+
|
v
+----------------------------------------------------------+
| STEP 5: Spawn qa-specialist agents in PARALLEL |
| - One agent per affected feature |
| - Each agent EDITS existing test files |
| - Creates NEW test files only for new features |
+----------------------------------------------------------+
|
v
+----------------------------------------------------------+
| STEP 6: Report changes |
| - List all modified test files |
| - List all test-plan.md updates |
| - Suggest running /run-test-all to validate |
+----------------------------------------------------------+
Glob: **/changes.json
Read: [found path]
Extract from changes.json:
status: "completed" or "in_progress"affected_files and output arraysbug_fix, enhancement, refactor, new_featuregit diff --name-only HEAD~5
Collect modified files. Filter to source files only:
src/features/**/*.ts / *.tsxsupabase/**/*.sqlsrc/lib/**/*.tsIgnore test files themselves — we are updating those, not reading changes from them.
Map changed files to features:
src/features/auth/api/auth-queries.ts → feature: auth
src/features/orders/types/order.ts → feature: orders
supabase/migrations/20240101_add_col.sql → feature: (parse from migration)
Build {affected_features} list.
If the user provides a scope:
/verify-test auth → Only verify auth feature tests
/verify-test all → Verify all features (re-scan everything)
Extract scope directly. Do NOT ask questions — proceed to Step 2.
If no argument provided AND no changes.json exists, use git diff:
git diff --name-only HEAD~5
If git diff also shows no changes:
No changes detected. Nothing to verify. Make changes first with
/developer, or specify a feature:/verify-test auth
STOP.
If git diff shows changes, use those as the affected files.
### Detected Changes
| Source | Files Changed |
|--------|--------------|
| changes.json | {count} files across {batch_count} batches |
| git diff | {count} modified files |
| **Affected Features** | **{feature_list}** |
Glob: **/test-plan.md OR **/test.plan.md
Read: [found path]
Extract current test scenarios for the affected features.
If test-plan.md does NOT exist:
test-plan.mdnot found. Cannot compare changes. Use/generate-testto create tests from scratch.
STOP. Do NOT proceed.
Read: references/vitest-best-practices.md
Glob: **/backend-plan.md
Read: [found path]
For each file in {affected_files}, read the current version:
Read: src/features/{feature}/api/{file}.ts
Read: src/features/{feature}/types/{file}.ts
Read: src/features/{feature}/hooks/{file}.ts
Glob: tests/features/{feature}/**/*.test.ts
Glob: tests/rls/{feature}*.test.ts
Glob: tests/constraints/{feature}*.test.ts
Glob: supabase/**/{feature}*.test.ts
Read each existing test file to understand current test coverage.
Compare the changed source code against test-plan.md to identify:
| Category | Description | Action |
|---|---|---|
| New behavior | New functions, endpoints, or columns added | Add scenarios to test-plan.md + generate new tests |
| Changed behavior | Existing logic modified (different validation, new fields) | Update scenarios in test-plan.md + edit existing tests |
| Removed behavior | Functions or fields deleted | Mark as deprecated in test-plan.md + remove related tests |
| Schema changes | New columns, changed constraints, new RLS policies | Update constraint/RLS tests |
| New feature | Entirely new feature directory added | Add new section to test-plan.md + generate full test suite |
For each affected feature, create a change manifest:
Feature: auth
Changes:
- ADDED: password reset function (src/features/auth/api/auth-queries.ts:45)
- CHANGED: login validation now checks email format (src/features/auth/api/auth-queries.ts:12)
- SCHEMA: added reset_token column to profiles (supabase/migrations/...)
Test Impact:
- NEW: test password reset CRUD operations
- UPDATE: update login test to include email format validation
- NEW: test reset_token column constraints
Based on the change manifest, determine what needs updating in test-plan.md:
Use the Edit tool to make targeted changes to test-plan.md. Do NOT rewrite the entire file.
For each change:
Edit: [test-plan.md path]
old_string: [existing scenario text]
new_string: [updated scenario text]
For new scenarios, find the appropriate section and insert:
Edit: [test-plan.md path]
old_string: [last scenario in the feature section]
new_string: [last scenario + new scenarios appended]
### test-plan.md Updates
| Feature | Action | Scenarios |
|---------|--------|-----------|
| auth | Added | 3 new scenarios (password reset) |
| auth | Updated | 1 scenario (login validation) |
| orders | Removed | 1 deprecated scenario |
| **Total** | | **5 changes** |
For EACH affected feature, spawn a qa-specialist agent:
Task:
subagent_type: qa-specialist
description: "Verify tests: {feature_name}"
prompt: |
Update tests for the "{feature_name}" feature after code changes.
=== WHAT CHANGED ===
{change_manifest for this feature}
=== CONTEXT — Read ALL of these first (MANDATORY) ===
1. Read: references/vitest-best-practices.md
Apply ALL rules: AAA pattern, strict assertions, parameterized tests.
2. Read: [path to test-plan.md]
Find the UPDATED "{feature_name}" section (just edited in Step 4).
3. Read: [path to backend-plan.md]
Find tables, RLS policies, and constraints for "{feature_name}".
4. Read: tests/utils/supabase.ts
Use shared helpers: adminClient, createAuthClient, createTestUser, etc.
5. Read the CHANGED source files:
{list of changed source files for this feature}
6. Read the EXISTING test files:
{list of existing test files for this feature}
=== YOUR TASK ===
Based on the change manifest above:
**For CHANGED behavior:**
- EDIT existing test files using the Edit tool
- Update assertions, test data, and expectations to match new behavior
- Do NOT delete tests that are still valid
**For NEW behavior:**
- ADD new describe/it blocks to existing test files
- If no existing test file covers the new behavior, create a new test file
**For REMOVED behavior:**
- REMOVE test cases that test deleted functionality
- Clean up any orphaned setup/teardown code
**For SCHEMA changes:**
- Update constraint tests for new/changed columns
- Update RLS tests if policies changed
- Add new constraint tests for new constraints
=== OUTPUT PATHS ===
Edit existing files:
- tests/features/{feature_name}/{feature_name}.test.ts
- tests/rls/{feature_name}*.test.ts
- tests/constraints/{feature_name}*.test.ts
Create new files ONLY if needed:
- tests/features/{feature_name}/{new_area}.test.ts
=== RULES ===
- PREFER editing existing test files over creating new ones
- Use the Edit tool for surgical changes — do NOT rewrite entire files
- Follow AAA pattern, strict assertions (never toBeTruthy)
- Use it.each for parameterized RLS role tests
- Clean up test data in afterAll
- Do NOT create, alter, or drop tables
- Do NOT modify source code — only test files
=== RESPONSE FORMAT ===
When done, return:
"COMPLETED: {feature_name}
Files edited: [{list}]
Files created: [{list}]
Tests added: {count}
Tests updated: {count}
Tests removed: {count}"
If blocked, return:
"BLOCKED: {feature_name} — {reason}"
Spawn ALL feature agents in a SINGLE message for maximum parallelism.
If changes affect the database schema (new tables, new columns used in test helpers), spawn an additional agent FIRST:
Task:
subagent_type: qa-specialist
description: "Update shared test utilities"
prompt: |
Update tests/utils/supabase.ts to support new schema changes.
Changes detected:
{schema_changes}
Read: tests/utils/supabase.ts
Read: references/vitest-best-practices.md
Edit the file to add any new helper functions needed.
Do NOT remove existing helpers that are still in use.
Return: "COMPLETED: test-utils | Changes: {description}"
Wait for this to complete before spawning feature agents.
## Test Verification Complete
**Triggered by:** {source — changes.json batch C3 / git diff / manual}
**Affected features:** {feature_list}
**Timestamp:** {ISO timestamp}
### test-plan.md Changes
| Feature | Scenarios Added | Scenarios Updated | Scenarios Removed |
|---------|----------------|-------------------|-------------------|
| {feature} | {count} | {count} | {count} |
| **Total** | **{total}** | **{total}** | **{total}** |
### Test File Changes
| Feature | File | Action | Tests +/- |
|---------|------|--------|-----------|
| {feature} | {file path} | Edited | +{added} / -{removed} |
| {feature} | {file path} | Created | +{count} |
| {feature} | {file path} | Edited | ~{updated} |
### Summary
| Metric | Count |
|--------|-------|
| Features verified | {feature_count} |
| Test files edited | {edited_count} |
| Test files created | {created_count} |
| Tests added | {added_count} |
| Tests updated | {updated_count} |
| Tests removed | {removed_count} |
| Agents spawned | {agent_count} |
### Next Steps
1. Run tests for affected features: `/run-test-phase {phase}`
2. Run all tests: `/run-test-all`
3. Review test-plan.md changes: `Read docs/test-plan.md`
4. Make more changes: `/developer {request}`
5. Re-verify after fixes: `/verify-test`
STOP. Tell user:
"test-plan.md not found. Cannot compare changes against test plan.
Use /generate-test to create tests from scratch."
Tell user:
"No changes detected (no changes.json, no git diff).
Make changes first with /developer, or specify a feature: /verify-test auth"
STOP.
Warn but proceed:
"No existing tests found for {feature}. Will generate new tests instead of editing.
Consider running /generate-test {feature} for a full test suite."
Spawn qa-specialist in GENERATE mode (like /generate-test) for that feature only.
Warn and generate first:
"tests/utils/supabase.ts not found. Generating shared utilities first."
Spawn qa-specialist to create test utils (same as /generate-test Step 4.1).
Wait for completion before spawning feature agents.
1. Report which feature's test verification failed
2. Other agents' results are still valid
3. Suggest re-running: /verify-test {failed_feature}
Fall back to git diff.
If git diff also empty, STOP with "No changes detected."