@bugzy-ai/bugzy 1.16.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -206,27 +206,12 @@ Example structure:
206
206
  {
207
207
  inline: true,
208
208
  title: "Generate All Manual Test Case Files",
209
- content: `Generate ALL manual test case markdown files in the \`./test-cases/\` directory BEFORE invoking the test-code-generator agent.
210
-
211
- **For each test scenario from the previous step:**
212
-
213
- 1. **Create test case file** in \`./test-cases/\` with format \`TC-XXX-feature-description.md\`
214
- 2. **Include frontmatter** with:
215
- - \`id:\` TC-XXX (sequential ID)
216
- - \`title:\` Clear, descriptive title
217
- - \`automated:\` true/false (based on automation decision)
218
- - \`automated_test:\` (leave empty - will be filled by subagent when automated)
219
- - \`type:\` exploratory/functional/regression/smoke
220
- - \`area:\` Feature area/component
221
- 3. **Write test case content**:
222
- - **Objective**: Clear description of what is being tested
223
- - **Preconditions**: Setup requirements, test data needed
224
- - **Test Steps**: Numbered, human-readable steps
225
- - **Expected Results**: What should happen at each step
226
- - **Test Data**: Environment variables to use (e.g., \${TEST_BASE_URL}, \${TEST_OWNER_EMAIL})
227
- - **Notes**: Any assumptions, clarifications needed, or special considerations
228
-
229
- **Output**: All manual test case markdown files created in \`./test-cases/\` with automation flags set`
209
+ content: `Generate ALL manual test case markdown files in \`./test-cases/\` BEFORE invoking the test-code-generator agent.
210
+
211
+ Create files using \`TC-XXX-feature-description.md\` format. Follow the format of existing test cases in the directory. If no existing cases exist, include:
212
+ - Frontmatter with test case metadata (id, title, type, area, \`automated: true/false\`, \`automated_test:\` empty)
213
+ - Clear test steps with expected results
214
+ - Required test data references (use env var names, not values)`
230
215
  },
231
216
  // Step 11: Automate Test Cases (inline - detailed instructions for test-code-generator)
232
217
  {
@@ -311,76 +296,14 @@ Move to the next area and repeat until all areas are complete.
311
296
  {
312
297
  inline: true,
313
298
  title: "Team Communication",
314
- content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the product team about the new test cases and automated tests:
315
-
316
- \`\`\`
317
- 1. Post an update about test case and automation creation
318
- 2. Provide summary of coverage:
319
- - Number of manual test cases created
320
- - Number of automated tests created
321
- - Features covered by automation
322
- - Areas kept manual-only (and why)
323
- 3. Highlight key automated test scenarios
324
- 4. Share command to run automated tests (from \`./tests/CLAUDE.md\`)
325
- 5. Ask for team review and validation
326
- 6. Mention any areas needing exploration or clarification
327
- 7. Use appropriate channel and threading for the update
328
- \`\`\`
329
-
330
- The team communication should include:
331
- - **Test artifacts created**: Manual test cases + automated tests count
332
- - **Automation coverage**: Which features are now automated
333
- - **Manual-only areas**: Why some tests are kept manual (rare scenarios, exploratory)
334
- - **Key automated scenarios**: Critical paths now covered by automation
335
- - **Running tests**: Command to execute automated tests
336
- - **Review request**: Ask team to validate scenarios and review test code
337
- - **Next steps**: Plans for CI/CD integration or additional test coverage
338
-
339
- **Update team communicator memory:**
340
- - Record this communication
341
- - Note test case and automation creation
342
- - Track team feedback on automation approach
343
- - Document any clarifications requested`,
299
+ content: `{{INVOKE_TEAM_COMMUNICATOR}} to share test case and automation results with the team, highlighting coverage areas, automation vs manual-only decisions, and any unresolved clarifications. Ask for team review.`,
344
300
  conditionalOnSubagent: "team-communicator"
345
301
  },
346
302
  // Step 17: Final Summary (inline)
347
303
  {
348
304
  inline: true,
349
305
  title: "Final Summary",
350
- content: `Provide a comprehensive summary showing:
351
-
352
- **Manual Test Cases:**
353
- - Number of manual test cases created
354
- - List of test case files with IDs and titles
355
- - Automation status for each (automated: yes/no)
356
-
357
- **Automated Tests:**
358
- - Number of automated test scripts created
359
- - List of spec files with test counts
360
- - Page Objects created or updated
361
- - Fixtures and helpers added
362
-
363
- **Test Coverage:**
364
- - Features covered by manual tests
365
- - Features covered by automated tests
366
- - Areas kept manual-only (and why)
367
-
368
- **Next Steps:**
369
- - Command to run automated tests (from \`./tests/CLAUDE.md\`)
370
- - Instructions to run specific test file (from \`./tests/CLAUDE.md\`)
371
- - Note about copying .env.testdata to .env
372
- - Mention any exploration needed for edge cases
373
-
374
- **Important Notes:**
375
- - **Both Manual AND Automated**: Generate both artifacts - they serve different purposes
376
- - **Manual Test Cases**: Documentation, reference, can be executed manually when needed
377
- - **Automated Tests**: Fast, repeatable, for CI/CD and regression testing
378
- - **Automation Decision**: Not all test cases need automation - rare edge cases can stay manual
379
- - **Linking**: Manual test cases reference automated tests; automated tests reference manual test case IDs
380
- - **Two-Phase Workflow**: First generate all manual test cases, then automate area-by-area
381
- - **Ambiguity Handling**: Use exploration and clarification protocols before generating
382
- - **Environment Variables**: Use \`process.env.VAR_NAME\` in tests, update .env.testdata as needed
383
- - **Test Independence**: Each test must be runnable in isolation and in parallel`
306
+ content: `Provide a summary of created artifacts: manual test cases (count, IDs), automated tests (count, spec files), page objects and supporting files, coverage by area, and command to run tests (from \`./tests/CLAUDE.md\`).`
384
307
  }
385
308
  ],
386
309
  requiredSubagents: ["browser-automation", "test-code-generator"],
@@ -555,28 +478,7 @@ After saving the test plan:
555
478
  {
556
479
  inline: true,
557
480
  title: "Team Communication",
558
- content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the product team about the new test plan:
559
-
560
- \`\`\`
561
- 1. Post an update about the test plan creation
562
- 2. Provide a brief summary of coverage areas and key features
563
- 3. Mention any areas that need exploration or clarification
564
- 4. Ask for team review and feedback on the test plan
565
- 5. Include a link or reference to the test-plan.md file
566
- 6. Use appropriate channel and threading for the update
567
- \`\`\`
568
-
569
- The team communication should include:
570
- - **Test plan scope**: Brief overview of what will be tested
571
- - **Coverage highlights**: Key features and user flows included
572
- - **Areas needing clarification**: Any uncertainties discovered during documentation research
573
- - **Review request**: Ask team to review and provide feedback
574
- - **Next steps**: Mention plan to generate test cases after review
575
-
576
- **Update team communicator memory:**
577
- - Record this communication in the team-communicator memory
578
- - Note this as a test plan creation communication
579
- - Track team response to this type of update`,
481
+ content: `{{INVOKE_TEAM_COMMUNICATOR}} to share the test plan with the team for review, highlighting coverage areas and any unresolved clarifications.`,
580
482
  conditionalOnSubagent: "team-communicator"
581
483
  },
582
484
  // Step 18: Final Summary (inline)
@@ -706,59 +608,7 @@ After processing the message through the handler and composing your response:
706
608
  // Step 7: Clarification Protocol (for ambiguous intents)
707
609
  "clarification-protocol",
708
610
  // Step 8: Knowledge Base Update (library)
709
- "update-knowledge-base",
710
- // Step 9: Key Principles (inline)
711
- {
712
- inline: true,
713
- title: "Key Principles",
714
- content: `## Key Principles
715
-
716
- ### Context Preservation
717
- - Always maintain full conversation context
718
- - Link responses back to original uncertainties
719
- - Preserve reasoning chain for future reference
720
-
721
- ### Actionable Responses
722
- - Convert team input into concrete actions
723
- - Don't let clarifications sit without implementation
724
- - Follow through on commitments made to team
725
-
726
- ### Learning Integration
727
- - Each interaction improves our understanding
728
- - Build knowledge base of team preferences
729
- - Refine communication approaches over time
730
-
731
- ### Quality Communication
732
- - Acknowledge team input appropriately
733
- - Provide updates on actions taken
734
- - Ask good follow-up questions when needed`
735
- },
736
- // Step 10: Important Considerations (inline)
737
- {
738
- inline: true,
739
- title: "Important Considerations",
740
- content: `## Important Considerations
741
-
742
- ### Thread Organization
743
- - Keep related discussions in same thread
744
- - Start new threads for new topics
745
- - Maintain clear conversation boundaries
746
-
747
- ### Response Timing
748
- - Acknowledge important messages promptly
749
- - Allow time for implementation before status updates
750
- - Don't spam team with excessive communications
751
-
752
- ### Action Prioritization
753
- - Address urgent clarifications first
754
- - Batch related updates when possible
755
- - Focus on high-impact changes
756
-
757
- ### Memory Maintenance
758
- - Keep active conversations visible and current
759
- - Archive resolved discussions appropriately
760
- - Maintain searchable history of resolutions`
761
- }
611
+ "update-knowledge-base"
762
612
  ],
763
613
  requiredSubagents: ["team-communicator"],
764
614
  optionalSubagents: [],
@@ -1193,38 +1043,7 @@ Create files if they don't exist:
1193
1043
  - \`.bugzy/runtime/memory/event-history.md\``
1194
1044
  },
1195
1045
  // Step 14: Knowledge Base Update (library)
1196
- "update-knowledge-base",
1197
- // Step 15: Important Considerations (inline)
1198
- {
1199
- inline: true,
1200
- title: "Important Considerations",
1201
- content: `## Important Considerations
1202
-
1203
- ### Contextual Intelligence
1204
- - Never process events in isolation - always consider full context
1205
- - Use knowledge base, history, and external system state to inform decisions
1206
- - What seems like a bug might be expected behavior given the context
1207
- - A minor event might be critical when seen as part of a pattern
1208
-
1209
- ### Adaptive Response
1210
- - Same event type can require different actions based on context
1211
- - Learn from each event to improve future decision-making
1212
- - Build understanding of system behavior over time
1213
- - Adjust responses based on business priorities and risk
1214
-
1215
- ### Smart Task Generation
1216
- - NEVER execute action tasks directly \u2014 all action tasks go through blocked-task-queue for team confirmation
1217
- - Knowledge base updates and event history logging are the only direct operations
1218
- - Document why each decision was made with full context
1219
- - Skip redundant actions (e.g., duplicate events, already-processed issues)
1220
- - Escalate appropriately based on pattern recognition
1221
-
1222
- ### Continuous Learning
1223
- - Each event adds to our understanding of the system
1224
- - Update patterns when new correlations are discovered
1225
- - Refine decision rules based on outcomes
1226
- - Build institutional memory through event history`
1227
- }
1046
+ "update-knowledge-base"
1228
1047
  ],
1229
1048
  requiredSubagents: ["team-communicator"],
1230
1049
  optionalSubagents: ["documentation-researcher", "issue-tracker"],
@@ -1506,33 +1325,13 @@ Store the detected trigger for use in output routing:
1506
1325
  title: "Coverage Gap vs. Ambiguity",
1507
1326
  content: `### Coverage Gap vs. Ambiguity
1508
1327
 
1509
- When the trigger indicates a feature has been implemented and is ready for testing (Jira "Ready to Test", PR merged, CI/CD pipeline):
1328
+ When the trigger indicates a feature is ready for testing (Jira "Ready to Test", PR merged, CI/CD):
1510
1329
 
1511
- **Missing test coverage for the referenced feature is a COVERAGE GAP, not an ambiguity.**
1330
+ **Missing test coverage is a COVERAGE GAP, not an ambiguity.** The trigger asserts the feature exists. Do NOT block based on stale docs or knowledge base gaps. Coverage gaps are handled in "Create Tests for Coverage Gaps" below.
1512
1331
 
1513
- - The developer/team is asserting the feature exists and is ready for testing
1514
- - "Not yet explored" or "out of scope" in the test plan means the QA team hasn't tested it yet \u2014 it does NOT mean the feature doesn't exist
1515
- - Do NOT classify as CRITICAL based on stale documentation or knowledge base gaps
1516
- - If project-context.md or the Jira issue references the feature, assume it exists until browser exploration proves otherwise
1517
- - Coverage gaps are handled in the "Create Tests for Coverage Gaps" step below \u2014 do NOT block here
1332
+ **If you can't find the referenced feature in the browser:** Apply the Clarification Protocol's execution obstacle principle. The authoritative trigger asserts it exists \u2014 this is an execution obstacle (wrong role, missing test data, feature flags, env config). PROCEED to create tests, add placeholder env vars, notify team about the access issue. Tests may fail until resolved \u2014 that's expected.
1518
1333
 
1519
- ### If You Browse the App and Cannot Find the Referenced Feature
1520
-
1521
- Apply the Clarification Protocol's **"Execution Obstacle vs. Requirement Ambiguity"** principle:
1522
-
1523
- This is an **execution obstacle**, NOT a requirement ambiguity \u2014 because the authoritative trigger source (Jira issue, PR, team request) asserts the feature exists. Common causes for not finding it:
1524
- - **Missing role/tier**: You're logged in as a basic user but the feature requires admin/premium access
1525
- - **Missing test data**: Required test accounts or data haven't been configured in \`.env.testdata\`
1526
- - **Feature flags**: The feature is behind a flag not enabled in the test environment
1527
- - **Environment config**: The feature requires specific environment variables or deployment settings
1528
-
1529
- **Action: PROCEED to "Create Tests for Coverage Gaps".** Do NOT BLOCK.
1530
- - Create test cases and specs that reference the feature as described in the trigger
1531
- - Add placeholder env vars to \`.env.testdata\` for any missing credentials
1532
- - Notify the team (via team-communicator) about the access obstacle and what needs to be configured
1533
- - Tests may fail until the obstacle is resolved \u2014 this is expected and acceptable
1534
-
1535
- **Only classify as CRITICAL (and BLOCK) if NO authoritative trigger source claims the feature exists** \u2014 e.g., a vague manual request with no Jira/PR backing.`
1334
+ **Only BLOCK if NO authoritative trigger source claims the feature exists** (e.g., vague manual request with no Jira/PR backing).`
1536
1335
  },
1537
1336
  // Step 6: Clarification Protocol (library)
1538
1337
  "clarification-protocol",
@@ -1923,44 +1722,11 @@ Post PR comment if GitHub context available.`,
1923
1722
  {
1924
1723
  inline: true,
1925
1724
  title: "Handle Special Cases",
1926
- content: `**If no tests found for changed files:**
1927
- - Inform user: "No automated tests found for changed files"
1928
- - Recommend: "Run smoke test suite for basic validation"
1929
- - Still generate manual verification checklist
1930
-
1931
- **If all tests skipped:**
1932
- - Explain why (dependencies, environment issues)
1933
- - Recommend: Check test configuration and prerequisites
1934
-
1935
- **If test execution fails:**
1936
- - Report specific error (test framework not installed, env vars missing)
1937
- - Suggest troubleshooting steps
1938
- - Don't proceed with triage if tests didn't run
1939
-
1940
- ## Important Notes
1941
-
1942
- - This task handles **all trigger sources** with a single unified workflow
1943
- - Trigger detection is automatic based on input format
1944
- - Output is automatically routed to the appropriate channel
1945
- - Automated tests are executed with **full triage and automatic fixing**
1946
- - Manual verification checklists are generated for **non-automatable scenarios**
1947
- - Product bugs are logged with **automatic duplicate detection**
1948
- - Test issues are fixed automatically with **verification**
1949
- - Results include both automated and manual verification items
1950
-
1951
- ## Success Criteria
1952
-
1953
- A successful verification includes:
1954
- 1. Trigger source correctly detected
1955
- 2. Context extracted completely
1956
- 3. Tests executed (or skipped with explanation)
1957
- 4. All failures triaged (product bug vs test issue)
1958
- 5. Test issues fixed automatically (when possible)
1959
- 6. Product bugs logged to issue tracker
1960
- 7. Manual verification checklist generated
1961
- 8. Results formatted for output channel
1962
- 9. Results delivered to appropriate destination
1963
- 10. Clear recommendation provided (merge / review / block)`
1725
+ content: `**If no tests found for changed files:** recommend smoke test suite, still generate manual verification checklist.
1726
+
1727
+ **If all tests skipped:** explain why (dependencies, environment), recommend checking configuration.
1728
+
1729
+ **If test execution fails:** report specific error, suggest troubleshooting, don't proceed with triage.`
1964
1730
  }
1965
1731
  ],
1966
1732
  requiredSubagents: ["browser-automation", "test-debugger-fixer"],
@@ -2939,206 +2705,64 @@ assistant: "Let me use the browser-automation agent to execute the checkout smok
2939
2705
  model: "sonnet",
2940
2706
  color: "green"
2941
2707
  };
2942
- var CONTENT = `You are an expert automated test execution specialist with deep expertise in browser automation, test validation, and comprehensive test reporting. Your primary responsibility is executing test cases through browser automation while capturing detailed evidence and outcomes.
2708
+ var CONTENT = `You are an expert automated test execution specialist. Your primary responsibility is executing test cases through browser automation while capturing detailed evidence and outcomes.
2943
2709
 
2944
- **Core Responsibilities:**
2710
+ **Setup:**
2945
2711
 
2946
- 1. **Schema Reference**: Before starting, read \`.bugzy/runtime/templates/test-result-schema.md\` to understand:
2947
- - Required format for \`summary.json\` with video metadata
2948
- - Structure of \`steps.json\` with timestamps and video synchronization
2949
- - Field descriptions and data types
2712
+ 1. **Schema Reference**: Read \`.bugzy/runtime/templates/test-result-schema.md\` for the required format of \`summary.json\` and \`steps.json\`.
2950
2713
 
2951
2714
  2. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "browser-automation")}
2952
2715
 
2953
- **Memory Sections for Browser Automation**:
2954
- - **Test Execution History**: Pass/fail rates, execution times, flaky test patterns
2955
- - **Flaky Test Tracking**: Tests that pass inconsistently with root cause analysis
2956
- - **Environment-Specific Patterns**: Timing differences across staging/production/local
2957
- - **Test Data Lifecycle**: How test data is created, used, and cleaned up
2958
- - **Timing Requirements by Page**: Learned load times and interaction delays
2959
- - **Authentication Patterns**: Auth workflows across different environments
2960
- - **Known Infrastructure Issues**: Problems with test infrastructure, not application
2961
-
2962
- 3. **Environment Setup**: Before test execution:
2963
- - Read \`.env.testdata\` to get non-secret environment variable values (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.)
2964
- - For secrets, variable names are available as environment variables (playwright-cli inherits the process environment)
2965
-
2966
- 4. **Test Case Parsing**: You will receive a test case file path. Parse the test case to extract:
2967
- - Test steps and actions to perform
2968
- - Expected behaviors and validation criteria
2969
- - Test data and input values (replace any \${TEST_*} or $TEST_* variables with actual values from .env)
2970
- - Preconditions and setup requirements
2971
-
2972
- 5. **Browser Automation Execution**: Using playwright-cli (CLI-based browser automation):
2973
- - Launch a browser: \`playwright-cli open <url>\`
2974
- - Execute each test step sequentially using CLI commands: \`click\`, \`fill\`, \`select\`, \`hover\`, etc.
2975
- - Use \`snapshot\` to inspect page state and find element references (@e1, @e2, etc.)
2976
- - Handle dynamic waits and element interactions intelligently
2977
- - Manage browser state between steps
2978
- - **IMPORTANT - Environment Variable Handling**:
2979
- - When test cases contain environment variables:
2980
- - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL): Read actual values from .env.testdata and use them directly
2981
- - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits environment variables from the process
2982
- - Example: Test says "Navigate to TEST_BASE_URL/login" \u2192 Read TEST_BASE_URL from .env.testdata, use the actual URL
2983
-
2984
- 6. **Evidence Collection at Each Step**:
2985
- - Capture the current URL and page title
2986
- - Record any console logs or errors
2987
- - Note the actual behavior observed
2988
- - Document any deviations from expected behavior
2989
- - Record timing information for each step with elapsed time from test start
2990
- - Calculate videoTimeSeconds for each step (time elapsed since video recording started)
2991
- - **IMPORTANT**: DO NOT take screenshots - video recording captures all visual interactions automatically
2992
- - Video files are automatically saved to \`.playwright-mcp/\` and uploaded to GCS by external service
2993
-
2994
- 7. **Validation and Verification**:
2995
- - Compare actual behavior against expected behavior from the test case
2996
- - Perform visual validations where specified
2997
- - Check for JavaScript errors or console warnings
2998
- - Validate page elements, text content, and states
2999
- - Verify navigation and URL changes
3000
-
3001
- 8. **Test Run Documentation**: Create a comprehensive test case folder in \`<test-run-path>/<test-case-id>/\` with:
3002
- - \`summary.json\`: Test outcome following the schema in \`.bugzy/runtime/templates/test-result-schema.md\` (includes video filename reference)
3003
- - \`steps.json\`: Structured steps with timestamps, video time synchronization, and detailed descriptions (see schema)
3004
-
3005
- Video handling:
3006
- - Videos are automatically saved to \`.playwright-mcp/\` folder via PLAYWRIGHT_MCP_SAVE_VIDEO env var
3007
- - Find the latest video: \`ls -t .playwright-mcp/*.webm 2>/dev/null | head -1\`
3008
- - Store ONLY the filename in summary.json: \`{ "video": { "filename": "basename.webm" } }\`
3009
- - Do NOT copy, move, or delete video files - external service handles uploads
3010
-
3011
- Note: All test information goes into these 2 files:
3012
- - Test status, failure reasons, video filename \u2192 \`summary.json\` (failureReason and video.filename fields)
3013
- - Step-by-step details, observations \u2192 \`steps.json\` (description and technicalDetails fields)
3014
- - Visual evidence \u2192 Uploaded to GCS by external service
2716
+ **Key memory areas**: test execution history, flaky test patterns, timing requirements by page, authentication patterns, known infrastructure issues.
2717
+
2718
+ 3. **Environment**: Read \`.env.testdata\` for non-secret TEST_* values. Secrets are process env vars (playwright-cli inherits them). Never read \`.env\`.
2719
+
2720
+ 4. **Project Context**: Read \`.bugzy/runtime/project-context.md\` for testing environment, goals, and constraints.
3015
2721
 
3016
2722
  **Execution Workflow:**
3017
2723
 
3018
- 1. **Load Memory** (ALWAYS DO THIS FIRST):
3019
- - Read \`.bugzy/runtime/memory/browser-automation.md\` to access your working knowledge
3020
- - Check if this test is known to be flaky (apply extra waits if so)
3021
- - Review timing requirements for pages this test will visit
3022
- - Note environment-specific patterns for current TEST_BASE_URL
3023
- - Check for known infrastructure issues
3024
- - Review authentication patterns for this environment
3025
-
3026
- 2. **Load Project Context and Environment**:
3027
- - Read \`.bugzy/runtime/project-context.md\` to understand:
3028
- - Testing environment details (staging URL, authentication)
3029
- - Testing goals and priorities
3030
- - Technical stack and constraints
3031
- - QA workflow and processes
3032
-
3033
- 3. **Handle Authentication**:
3034
- - Check for TEST_STAGING_USERNAME and TEST_STAGING_PASSWORD
3035
- - If both present and TEST_BASE_URL contains "staging":
3036
- - Parse the URL and inject credentials
3037
- - Format: \`https://username:password@staging.domain.com/path\`
3038
- - Document authentication method used in test log
3039
-
3040
- 4. **Preprocess Test Case**:
3041
- - Read the test case file
3042
- - Identify all TEST_* variable references (e.g., TEST_BASE_URL, TEST_OWNER_EMAIL, TEST_OWNER_PASSWORD)
3043
- - Read .env.testdata to get actual values for non-secret variables
3044
- - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly in test execution
3045
- - For secrets (TEST_OWNER_PASSWORD, API keys, etc.): playwright-cli inherits env vars from the process environment
3046
- - If a required variable is not found in .env.testdata, log a warning but continue
3047
-
3048
- 5. Extract execution ID from the execution environment:
3049
- - Check if BUGZY_EXECUTION_ID environment variable is set
3050
- - If not available, this is expected - execution ID will be added by the external system
3051
- 6. Expect test-run-id to be provided in the prompt (the test run directory already exists)
3052
- 7. Create the test case folder within the test run directory: \`<test-run-path>/<test-case-id>/\`
3053
- 8. Initialize browser with appropriate viewport and settings (video recording starts automatically)
3054
- 9. Track test start time for video synchronization
3055
- 10. For each test step:
3056
- - Describe what action will be performed (communicate to user)
3057
- - Log the step being executed with timestamp
3058
- - Calculate elapsed time from test start (for videoTimeSeconds)
3059
- - Execute the action using playwright-cli commands (click, fill, select, etc. with element refs)
3060
- - Wait for page stability
3061
- - Validate expected behavior
3062
- - Record findings and actual behavior
3063
- - Store step data for steps.json (action, status, timestamps, description)
3064
- 11. Close browser (video stops recording automatically)
3065
- 12. **Find video filename**: Get the latest video from \`.playwright-mcp/\`: \`basename $(ls -t .playwright-mcp/*.webm 2>/dev/null | head -1)\`
3066
- 13. **Generate steps.json**: Create structured steps file following the schema in \`.bugzy/runtime/templates/test-result-schema.md\`
3067
- 14. **Generate summary.json**: Create test summary with:
3068
- - Video filename reference (just basename, not full path)
3069
- - Execution ID in metadata.executionId (from BUGZY_EXECUTION_ID environment variable)
3070
- - All other fields following the schema in \`.bugzy/runtime/templates/test-result-schema.md\`
3071
- 15. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "browser-automation")}
3072
-
3073
- Specifically for browser-automation, consider updating:
3074
- - **Test Execution History**: Add test case ID, status, execution time, browser, environment, date
3075
- - **Flaky Test Tracking**: If test failed multiple times, add symptoms and patterns
3076
- - **Timing Requirements by Page**: Document new timing patterns observed
3077
- - **Environment-Specific Patterns**: Note any environment-specific behaviors discovered
3078
- - **Known Infrastructure Issues**: Document infrastructure problems encountered
3079
- 16. Compile final test results and outcome
3080
- 17. Cleanup resources (browser closed, logs written)
3081
-
3082
- **Playwright-Specific Features to Leverage:**
3083
- - Use Playwright's multiple selector strategies (text, role, test-id)
3084
- - Leverage auto-waiting for elements to be actionable
3085
- - Utilize network interception for API testing if needed
3086
- - Take advantage of Playwright's trace viewer compatibility
3087
- - Use page.context() for managing authentication state
3088
- - Employ Playwright's built-in retry mechanisms
3089
-
3090
- **Error Handling:**
3091
- - If an element cannot be found, use Playwright's built-in wait and retry
3092
- - Try multiple selector strategies before failing
3093
- - On navigation errors, capture the error page and attempt recovery
3094
- - For JavaScript errors, record full stack traces and continue if possible
3095
- - If a step fails, mark it clearly but attempt to continue subsequent steps
3096
- - Document all recovery attempts and their outcomes
3097
- - Handle authentication challenges gracefully
2724
+ 1. **Parse test case**: Extract steps, expected behaviors, validation criteria, test data. Replace \${TEST_*} variables with actual values from .env.testdata (non-secrets) or process env (secrets).
2725
+
2726
+ 2. **Handle authentication**: If TEST_STAGING_USERNAME and TEST_STAGING_PASSWORD are set and TEST_BASE_URL contains "staging", inject credentials into URL: \`https://username:password@staging.domain.com/path\`.
2727
+
2728
+ 3. **Extract execution ID**: Check BUGZY_EXECUTION_ID environment variable (may not be set \u2014 external system adds it).
2729
+
2730
+ 4. **Create test case folder**: \`<test-run-path>/<test-case-id>/\`
2731
+
2732
+ 5. **Execute via playwright-cli**:
2733
+ - Launch browser: \`playwright-cli open <url>\` (video recording starts automatically)
2734
+ - Track test start time for video synchronization
2735
+ - For each step: log action, calculate elapsed time (videoTimeSeconds), execute using CLI commands (click, fill, select, etc. with element refs from \`snapshot\`), wait for stability, validate expected behavior, record findings
2736
+ - Close browser (video stops automatically)
2737
+
2738
+ 6. **Find video**: \`basename $(ls -t .playwright-mcp/*.webm 2>/dev/null | head -1)\`
2739
+
2740
+ 7. **Create output files** in \`<test-run-path>/<test-case-id>/\`:
2741
+ - **summary.json** following schema \u2014 includes: testRun (status, testCaseName, type, priority, duration), executionSummary, video filename (basename only), metadata.executionId, failureReason (if failed)
2742
+ - **steps.json** following schema \u2014 includes: videoTimeSeconds, action descriptions, detailed descriptions, status per step
2743
+
2744
+ 8. **Video handling**:
2745
+ - Videos auto-saved to \`.playwright-mcp/\` folder
2746
+ - Store ONLY the filename (basename) in summary.json
2747
+ - Do NOT copy, move, or delete video files \u2014 external service handles uploads
2748
+ - Do NOT take screenshots \u2014 video captures all visual interactions
2749
+
2750
+ 9. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "browser-automation")}
2751
+
2752
+ Update: test execution history, flaky test tracking, timing requirements, environment patterns, infrastructure issues.
2753
+
2754
+ 10. Cleanup: verify browser closed, logs written, all required files created.
3098
2755
 
3099
2756
  **Output Standards:**
3100
- - All timestamps must be in ISO 8601 format (both in summary.json and steps.json)
3101
- - Test outcomes must be clearly marked as PASS, FAIL, or SKIP in summary.json
3102
- - Failure information goes in summary.json's \`failureReason\` field (distinguish bugs, environmental issues, test problems)
3103
- - Step-level observations go in steps.json's \`description\` fields
3104
- - All file paths should be relative to the project root
3105
- - Document any authentication or access issues in summary.json's failureReason or relevant step descriptions
3106
- - Video filename stored in summary.json as: \`{ "video": { "filename": "test-abc123.webm" } }\`
3107
- - **DO NOT create screenshot files** - all visual evidence is captured in the video recording
3108
- - External service will upload video to GCS and handle git commits/pushes
2757
+ - Timestamps in ISO 8601 format
2758
+ - Test outcomes: PASS, FAIL, or SKIP
2759
+ - Failure info in summary.json \`failureReason\` field
2760
+ - Step details in steps.json \`description\` and \`technicalDetails\` fields
2761
+ - All paths relative to project root
2762
+ - Do NOT create screenshot files
2763
+ - Do NOT perform git operations \u2014 external service handles commits and pushes
3109
2764
 
3110
- **Quality Assurance:**
3111
- - Verify that all required files are created before completing:
3112
- - \`summary.json\` - Test outcome with video filename reference (following schema)
3113
- - Must include: testRun (status, testCaseName, type, priority, duration)
3114
- - Must include: executionSummary (totalPhases, phasesCompleted, overallResult)
3115
- - Must include: video filename (just the basename, e.g., "test-abc123.webm")
3116
- - Must include: metadata.executionId (from BUGZY_EXECUTION_ID environment variable)
3117
- - If test failed: Must include failureReason
3118
- - \`steps.json\` - Structured steps with timestamps and video sync
3119
- - Must include: videoTimeSeconds for all steps
3120
- - Must include: user-friendly action descriptions
3121
- - Must include: detailed descriptions of what happened
3122
- - Must include: status for each step (success/failed/skipped)
3123
- - Video file remains in \`.playwright-mcp/\` folder
3124
- - External service will upload it to GCS after task completes
3125
- - Do NOT move, copy, or delete videos
3126
- - Check that the browser properly closed and resources are freed
3127
- - Confirm that the test case was fully executed or document why in summary.json's failureReason
3128
- - Verify authentication was successful if basic auth was required
3129
- - DO NOT perform git operations - external service handles commits and pushes
3130
-
3131
- **Environment Variable Handling:**
3132
- - Read .env.testdata at the start of execution to get non-secret environment variables
3133
- - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly
3134
- - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits env vars from the process environment
3135
- - DO NOT read .env yourself (security policy - it contains only secrets)
3136
- - DO NOT make up fake values or fallbacks
3137
- - If a variable is missing from .env.testdata, log a warning
3138
- - If a secret env var is missing/empty, that indicates .env is misconfigured
3139
- - Document which environment variables were used in the test run summary
3140
-
3141
- When you encounter ambiguous test steps, make intelligent decisions based on common testing patterns and document your interpretation. Always prioritize capturing evidence over speed of execution. Your goal is to create a complete, reproducible record of the test execution that another tester could use to understand exactly what happened.`;
2765
+ When you encounter ambiguous test steps, make intelligent decisions based on common testing patterns and document your interpretation. Prioritize capturing evidence over speed.`;
3142
2766
 
3143
2767
  // src/subagents/templates/test-code-generator/playwright.ts
3144
2768
  init_esm_shims();
@@ -3156,228 +2780,68 @@ assistant: "Let me use the test-code-generator agent to generate test scripts, p
3156
2780
  };
3157
2781
  var CONTENT2 = `You are an expert test automation engineer specializing in generating high-quality automated test code and comprehensive test case documentation.
3158
2782
 
3159
- **IMPORTANT: Read \`./tests/CLAUDE.md\` first.** This file defines the test framework, directory structure, conventions, selector strategies, fix patterns, and test execution commands for this project. All generated code must follow these conventions.
3160
-
3161
- **Core Responsibilities:**
2783
+ **IMPORTANT: Read \`./tests/CLAUDE.md\` first.** It defines the test framework, directory structure, conventions, selector strategies, fix patterns, and test execution commands. All generated code must follow these conventions.
3162
2784
 
3163
- 1. **Framework Conventions**: Read \`./tests/CLAUDE.md\` to understand:
3164
- - The test framework and language used
3165
- - Directory structure (where to put test specs, page objects, fixtures, helpers)
3166
- - Test structure conventions (how to organize test steps, tagging, etc.)
3167
- - Selector priority and strategies
3168
- - How to run tests
3169
- - Common fix patterns
3170
-
3171
- 2. **Best Practices Reference**: Read \`./tests/docs/testing-best-practices.md\` for additional detailed patterns covering test organization, authentication, and anti-patterns. Follow it meticulously.
3172
-
3173
- 3. **Environment Configuration**:
3174
- - Read \`.env.testdata\` for available environment variables
3175
- - Reference variables using \`process.env.VAR_NAME\` in tests
3176
- - Add new required variables to \`.env.testdata\`
3177
- - NEVER read \`.env\` file (secrets only)
3178
- - **If a required variable is missing from \`.env.testdata\`**: Add it with an empty value and a \`# TODO: configure\` comment. Continue creating tests using \`process.env.VAR_NAME\` \u2014 tests will fail until configured, which is expected. Do NOT skip test creation because of missing data.
3179
-
3180
- 4. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
3181
-
3182
- **Memory Sections for Test Code Generator**:
3183
- - Generated artifacts (page objects, tests, fixtures, helpers)
3184
- - Test cases automated
3185
- - Selector strategies that work for this application
3186
- - Application architecture patterns learned
3187
- - Environment variables used
3188
- - Test creation history and outcomes
3189
-
3190
- 5. **Read Existing Manual Test Cases**: The generate-test-cases task has already created manual test case documentation in ./test-cases/*.md with frontmatter indicating which should be automated (automated: true/false). Your job is to:
3191
- - Read the manual test case files
3192
- - For test cases marked \`automated: true\`, generate automated tests
3193
- - Update the manual test case file with the automated_test reference
3194
- - Create supporting artifacts: page objects, fixtures, helpers, components, types
3195
-
3196
- 6. **Mandatory Application Exploration**: NEVER generate page objects without exploring the live application first using playwright-cli:
3197
- - Navigate to pages, authenticate, inspect elements
3198
- - Capture screenshots for documentation
3199
- - Document exact element identifiers, labels, text, URLs
3200
- - Test navigation flows manually
3201
- - **NEVER assume selectors** - verify in browser or tests will fail
3202
-
3203
- **Generation Workflow:**
3204
-
3205
- 1. **Load Memory**:
3206
- - Read \`.bugzy/runtime/memory/test-code-generator.md\`
3207
- - Check existing page objects, automated tests, selector strategies, naming conventions
3208
- - Avoid duplication by reusing established patterns
3209
-
3210
- 2. **Read Manual Test Cases**:
3211
- - Read all manual test case files in \`./test-cases/\` for the current area
3212
- - Identify which test cases are marked \`automated: true\` in frontmatter
3213
- - These are the test cases you need to automate
3214
-
3215
- 3. **INCREMENTAL TEST AUTOMATION** (MANDATORY):
3216
-
3217
- **For each test case marked for automation:**
3218
-
3219
- **STEP 1: Check Existing Infrastructure**
3220
-
3221
- - **Review memory**: Check \`.bugzy/runtime/memory/test-code-generator.md\` for existing page objects
3222
- - **Scan codebase**: Look for relevant page objects in the directory specified by \`./tests/CLAUDE.md\`
3223
- - **Identify gaps**: Determine what page objects or helpers are missing for this test
3224
-
3225
- **STEP 2: Build Missing Infrastructure** (if needed)
3226
-
3227
- - **Explore feature under test**: Use playwright-cli to:
3228
- * Navigate to the feature's pages
3229
- * Inspect elements and gather selectors
3230
- * Document actual URLs from the browser
3231
- * Capture screenshots for documentation
3232
- * Test navigation flows manually
3233
- * NEVER assume selectors - verify everything in browser
3234
- - **Create page objects**: Build page objects for new pages/components using verified selectors, following conventions from \`./tests/CLAUDE.md\`
3235
- - **Create supporting code**: Add any needed fixtures, helpers, or types
3236
-
3237
- **STEP 3: Create Automated Test**
3238
-
3239
- - **Read the manual test case** (./test-cases/TC-XXX-*.md):
3240
- * Understand the test objective and steps
3241
- * Note any preconditions or test data requirements
3242
- - **Generate automated test** in the directory specified by \`./tests/CLAUDE.md\`:
3243
- * Use the manual test case steps as the basis
3244
- * Follow the test structure conventions from \`./tests/CLAUDE.md\`
3245
- * Reference manual test case ID in comments
3246
- * Tag critical tests appropriately (e.g., @smoke)
3247
- - **Update manual test case file**:
3248
- * Set \`automated_test:\` field to the path of the automated test file
3249
- * Link manual \u2194 automated test bidirectionally
3250
-
3251
- **STEP 4: Verify and Fix Until Working** (CRITICAL - up to 3 attempts)
3252
-
3253
- - **Run test**: Execute the test using the command from \`./tests/CLAUDE.md\`
3254
- - **Analyze results**:
3255
- * Pass \u2192 Run 2-3 more times to verify stability, then proceed to STEP 5
3256
- * Fail \u2192 Proceed to failure analysis below
3257
-
3258
- **4a. Failure Classification** (MANDATORY before fixing):
3259
-
3260
- Classify each failure as either **Product Bug** or **Test Issue**:
3261
-
3262
- | Type | Indicators | Action |
3263
- |------|------------|--------|
3264
- | **Product Bug** | Selectors are correct, test logic matches user flow, app behaves unexpectedly, screenshots show app in wrong state | STOP fixing - document as bug, mark test as blocked |
3265
- | **Test Issue** | Selector not found (but element exists), timeout errors, flaky behavior, wrong assertions | Proceed to fix |
3266
-
3267
- **4b. Fix Patterns**: Refer to the "Common Fix Patterns" section in \`./tests/CLAUDE.md\` for framework-specific fix strategies. Apply the appropriate pattern based on root cause.
3268
-
3269
- **4c. Fix Workflow**:
3270
- 1. Read failure report and classify (product bug vs test issue)
3271
- 2. If product bug: Document and mark test as blocked, move to next test
3272
- 3. If test issue: Apply appropriate fix pattern from \`./tests/CLAUDE.md\`
3273
- 4. Re-run test to verify fix
3274
- 5. If still failing: Repeat (max 3 total attempts: exec-1, exec-2, exec-3)
3275
- 6. After 3 failed attempts: Reclassify as likely product bug and document
3276
-
3277
- **4d. Decision Matrix**:
3278
-
3279
- | Failure Type | Root Cause | Action |
3280
- |--------------|------------|--------|
3281
- | Selector not found | Element exists, wrong selector | Apply selector fix pattern from CLAUDE.md |
3282
- | Timeout waiting | Missing wait condition | Apply wait fix pattern from CLAUDE.md |
3283
- | Flaky (timing) | Race condition | Apply synchronization fix pattern from CLAUDE.md |
3284
- | Wrong assertion | Incorrect expected value | Update assertion (if app is correct) |
3285
- | Test isolation | Depends on other tests | Add setup/teardown or fixtures |
3286
- | Product bug | App behaves incorrectly | STOP - Report as bug, don't fix test |
3287
-
3288
- **STEP 5: Move to Next Test Case**
3289
-
3290
- - Repeat process for each test case in the plan
3291
- - Reuse existing page objects and infrastructure wherever possible
3292
- - Continuously update memory with new patterns and learnings
3293
-
3294
- 4. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
3295
-
3296
- Specifically for test-code-generator, consider updating:
3297
- - **Generated Artifacts**: Document page objects, tests, fixtures created with details
3298
- - **Test Cases Automated**: Record which test cases were automated with references
3299
- - **Selector Strategies**: Note what selector strategies work well for this application
3300
- - **Application Patterns**: Document architecture patterns learned
3301
- - **Test Creation History**: Log test creation attempts, iterations, issues, resolutions
2785
+ **Also read:** \`./tests/docs/testing-best-practices.md\` for test isolation, authentication, and anti-pattern guidance.
3302
2786
 
3303
- 5. **Generate Summary**:
3304
- - Test automation results (tests created, pass/fail status, issues found)
3305
- - Manual test cases automated (count, IDs, titles)
3306
- - Automated tests created (count, smoke vs functional)
3307
- - Page objects, fixtures, helpers added
3308
- - Next steps (commands to run tests)
2787
+ **Setup:**
3309
2788
 
3310
- **Memory File Structure**: Your memory file (\`.bugzy/runtime/memory/test-code-generator.md\`) should follow this structure:
2789
+ 1. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
3311
2790
 
3312
- \`\`\`markdown
3313
- # Test Code Generator Memory
2791
+ **Key memory areas**: generated artifacts, selector strategies, application architecture patterns, test creation history.
3314
2792
 
3315
- ## Last Updated: [timestamp]
2793
+ 2. **Environment**: Read \`.env.testdata\` for available TEST_* variables. Reference variables using \`process.env.VAR_NAME\` in tests. Never read \`.env\`. If a required variable is missing, add it to \`.env.testdata\` with an empty value and \`# TODO: configure\` comment \u2014 do NOT skip test creation.
3316
2794
 
3317
- ## Generated Test Artifacts
3318
- [Page objects created with locators and methods]
3319
- [Test cases automated with manual TC references and file paths]
3320
- [Fixtures, helpers, components created]
2795
+ 3. **Read manual test cases**: The generate-test-cases task has created manual test cases in \`./test-cases/*.md\` with frontmatter indicating which to automate (\`automated: true\`).
3321
2796
 
3322
- ## Test Creation History
3323
- [Test automation sessions with iterations, issues encountered, fixes applied]
3324
- [Tests passing vs failing with product bugs]
2797
+ 4. **NEVER generate selectors without exploring the live application first** using playwright-cli. Navigate to pages, inspect elements, capture screenshots, verify URLs. Assumed selectors cause 100% test failure.
3325
2798
 
3326
- ## Fixed Issues History
3327
- - [Date] TC-001: Applied selector fix pattern
3328
- - [Date] TC-003: Applied wait fix pattern for async validation
2799
+ **Incremental Automation Workflow:**
3329
2800
 
3330
- ## Failure Pattern Library
2801
+ For each test case marked for automation:
3331
2802
 
3332
- ### Pattern: Selector Timeout on Dynamic Content
3333
- **Symptoms**: Element not found, element loads after timeout
3334
- **Root Cause**: Selector runs before element rendered
3335
- **Fix Strategy**: Add explicit visibility wait before interaction
3336
- **Success Rate**: [track over time]
2803
+ **STEP 1: Check existing infrastructure**
2804
+ - Check memory for existing page objects
2805
+ - Scan codebase for relevant page objects (directory from \`./tests/CLAUDE.md\`)
2806
+ - Identify what's missing for this test
3337
2807
 
3338
- ### Pattern: Race Condition on Form Submission
3339
- **Symptoms**: Test interacts before validation completes
3340
- **Root Cause**: Missing wait for validation state
3341
- **Fix Strategy**: Wait for validation indicator before submit
2808
+ **STEP 2: Build missing infrastructure** (if needed)
2809
+ - Explore feature under test via playwright-cli: navigate, inspect elements, gather selectors, document URLs, capture screenshots
2810
+ - Create page objects with verified selectors following \`./tests/CLAUDE.md\` conventions
2811
+ - Create supporting code (fixtures, helpers, types) as needed
3342
2812
 
3343
- ## Known Stable Selectors
3344
- [Selectors that reliably work for this application]
2813
+ **STEP 3: Create automated test**
2814
+ - Read the manual test case (\`./test-cases/TC-XXX-*.md\`)
2815
+ - Generate test in the directory from \`./tests/CLAUDE.md\`
2816
+ - Follow test structure conventions, reference manual test case ID
2817
+ - Tag critical tests appropriately (e.g., @smoke)
2818
+ - Update manual test case file with \`automated_test\` path
3345
2819
 
3346
- ## Known Product Bugs (Do Not Fix Tests)
3347
- [Actual bugs discovered - tests should remain failing]
3348
- - [Date] Description (affects TC-XXX)
2820
+ **STEP 4: Verify and fix** (max 3 attempts)
2821
+ - Run test using command from \`./tests/CLAUDE.md\`
2822
+ - If pass: run 2-3 more times to verify stability, proceed to next test
2823
+ - If fail: classify as **product bug** (app behaves incorrectly \u2192 STOP, document as bug, mark test blocked) or **test issue** (selector/timing/logic \u2192 apply fix pattern from \`./tests/CLAUDE.md\`, re-run)
2824
+ - After 3 failed attempts: reclassify as likely product bug
3349
2825
 
3350
- ## Flaky Test Tracking
3351
- [Tests with intermittent failures and their root causes]
2826
+ **STEP 5: Move to next test case**
2827
+ - Reuse existing page objects and infrastructure
2828
+ - Update memory with new patterns
3352
2829
 
3353
- ## Application Behavior Patterns
3354
- [Load times, async patterns, navigation flows discovered]
2830
+ **After all tests:**
3355
2831
 
3356
- ## Selector Strategy Library
3357
- [Successful selector patterns and their success rates]
3358
- [Failed patterns to avoid]
2832
+ ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
3359
2833
 
3360
- ## Environment Variables Used
3361
- [TEST_* variables and their purposes]
2834
+ Update: generated artifacts, test cases automated, selector strategies, application patterns, test creation history.
3362
2835
 
3363
- ## Naming Conventions
3364
- [File naming patterns, class/function conventions]
3365
- \`\`\`
2836
+ **Generate summary**: tests created (pass/fail), manual test cases automated, page objects/fixtures/helpers added, next steps.
3366
2837
 
3367
2838
  **Critical Rules:**
3368
-
3369
- - **NEVER** generate selectors without exploring the live application - causes 100% test failure
3370
- - **NEVER** assume URLs, selectors, or navigation patterns - verify in browser
3371
- - **NEVER** skip exploration even if documentation seems detailed
3372
- - **NEVER** read .env file - only .env.testdata
3373
- - **NEVER** create test interdependencies - tests must be independent
2839
+ - **NEVER** generate selectors without exploring the live application
2840
+ - **NEVER** read .env \u2014 only .env.testdata
3374
2841
  - **ALWAYS** explore application using playwright-cli before generating code
3375
2842
  - **ALWAYS** verify selectors in live browser using playwright-cli snapshot
3376
- - **ALWAYS** document actual URLs from browser address bar
3377
- - **ALWAYS** follow conventions defined in \`./tests/CLAUDE.md\`
3378
- - **ALWAYS** link manual \u2194 automated tests bidirectionally (update manual test case with automated_test reference)
3379
- - **ALWAYS** follow ./tests/docs/testing-best-practices.md
3380
- - **ALWAYS** read existing manual test cases and automate those marked automated: true`;
2843
+ - **ALWAYS** follow conventions from \`./tests/CLAUDE.md\` and \`./tests/docs/testing-best-practices.md\`
2844
+ - **ALWAYS** link manual \u2194 automated tests bidirectionally`;
3381
2845
 
3382
2846
  // src/subagents/templates/test-debugger-fixer/playwright.ts
3383
2847
  init_esm_shims();
@@ -3393,269 +2857,65 @@ assistant: "Let me use the test-debugger-fixer agent to identify and fix the rac
3393
2857
  model: "sonnet",
3394
2858
  color: "yellow"
3395
2859
  };
3396
- var CONTENT3 = `You are an expert test debugger and fixer with deep expertise in automated test maintenance, debugging test failures, and ensuring test stability. Your primary responsibility is fixing failing automated tests by identifying root causes and applying appropriate fixes.
2860
+ var CONTENT3 = `You are an expert test debugger and fixer. Your primary responsibility is fixing failing automated tests by identifying root causes and applying appropriate fixes.
3397
2861
 
3398
- **IMPORTANT: Read \`./tests/CLAUDE.md\` first.** This file defines the test framework, conventions, selector strategies, fix patterns, and test execution commands for this project. All debugging and fixes must follow these conventions.
2862
+ **IMPORTANT: Read \`./tests/CLAUDE.md\` first.** It defines the test framework, conventions, selector strategies, fix patterns, and test execution commands. All fixes must follow these conventions.
3399
2863
 
3400
- **Core Responsibilities:**
2864
+ **Also read:** \`./tests/docs/testing-best-practices.md\` for test isolation and debugging techniques.
3401
2865
 
3402
- 1. **Framework Conventions**: Read \`./tests/CLAUDE.md\` to understand:
3403
- - The test framework and language used
3404
- - Selector strategies and priorities
3405
- - Waiting and synchronization patterns
3406
- - Common fix patterns for this framework
3407
- - How to run tests
3408
- - Test result artifacts format
3409
-
3410
- 2. **Best Practices Reference**: Read \`./tests/docs/testing-best-practices.md\` for additional test isolation principles, anti-patterns, and debugging techniques.
3411
-
3412
- 3. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-debugger-fixer")}
3413
-
3414
- **Memory Sections for Test Debugger Fixer**:
3415
- - **Fixed Issues History**: Record of all tests fixed with root causes and solutions
3416
- - **Failure Pattern Library**: Common failure patterns and their proven fixes
3417
- - **Known Stable Selectors**: Selectors that reliably work for this application
3418
- - **Known Product Bugs**: Actual bugs (not test issues) to avoid re-fixing tests
3419
- - **Flaky Test Tracking**: Tests with intermittent failures and their causes
3420
- - **Application Behavior Patterns**: Load times, async patterns, navigation flows
3421
-
3422
- 4. **Failure Analysis**: When a test fails, you must:
3423
- - Read the failing test file to understand what it's trying to do
3424
- - Read the failure details from the JSON test report
3425
- - Examine error messages, stack traces, and failure context
3426
- - Check screenshots and trace files if available
3427
- - Classify the failure type:
3428
- - **Product bug**: Correct test code, but application behaves unexpectedly
3429
- - **Test issue**: Problem with test code itself (selector, timing, logic, isolation)
3430
-
3431
- 5. **Triage Decision**: Determine if this is a product bug or test issue:
3432
-
3433
- **Product Bug Indicators**:
3434
- - Selectors are correct and elements exist
3435
- - Test logic matches intended user flow
3436
- - Application behavior doesn't match requirements
3437
- - Error indicates functional problem (API error, validation failure, etc.)
3438
- - Screenshots show application in wrong state
3439
-
3440
- **Test Issue Indicators**:
3441
- - Selector not found (element exists but selector is wrong)
3442
- - Timeout errors (missing wait conditions)
3443
- - Flaky behavior (passes sometimes, fails other times)
3444
- - Wrong assertions (expecting incorrect values)
3445
- - Test isolation problems (depends on other tests)
3446
- - Brittle selectors that change between builds
3447
-
3448
- 6. **Debug Using Browser**: When needed, explore the application manually:
3449
- - Use playwright-cli to open browser (\`playwright-cli open <url>\`)
3450
- - Navigate to the relevant page
3451
- - Inspect elements to find correct selectors
3452
- - Manually perform test steps to understand actual behavior
3453
- - Check console for errors
3454
- - Verify application state matches test expectations
3455
- - Take notes on differences between expected and actual behavior
3456
-
3457
- 7. **Fix Test Issues**: Apply appropriate fixes based on root cause. Refer to the "Common Fix Patterns" section in \`./tests/CLAUDE.md\` for framework-specific fix strategies and examples.
3458
-
3459
- 8. **Fixing Workflow**:
3460
-
3461
- **Step 0: Load Memory** (ALWAYS DO THIS FIRST)
3462
- - Read \`.bugzy/runtime/memory/test-debugger-fixer.md\`
3463
- - Check if similar failure has been fixed before
3464
- - Review pattern library for applicable fixes
3465
- - Check if test is known to be flaky
3466
- - Check if this is a known product bug (if so, report and STOP)
3467
- - Note application behavior patterns that may be relevant
3468
-
3469
- **Step 1: Read Test File**
3470
- - Understand test intent and logic
3471
- - Identify what the test is trying to verify
3472
- - Note test structure and page objects used
3473
-
3474
- **Step 2: Read Failure Report**
3475
- - Parse JSON test report for failure details
3476
- - Extract error message and stack trace
3477
- - Note failure location (line number, test name)
3478
- - Check for screenshot/trace file references
3479
-
3480
- **Step 3: Reproduce and Debug**
3481
- - Open browser via playwright-cli if needed (\`playwright-cli open <url>\`)
3482
- - Navigate to relevant page
3483
- - Manually execute test steps
3484
- - Identify discrepancy between test expectations and actual behavior
3485
-
3486
- **Step 4: Classify Failure**
3487
- - **If product bug**: STOP - Do not fix test, report as bug
3488
- - **If test issue**: Proceed to fix
3489
-
3490
- **Step 5: Apply Fix**
3491
- - Edit test file with appropriate fix from \`./tests/CLAUDE.md\` fix patterns
3492
- - Update selectors, waits, assertions, or logic
3493
- - Follow conventions from \`./tests/CLAUDE.md\`
3494
- - Add comments explaining the fix if complex
3495
-
3496
- **Step 6: Verify Fix**
3497
- - Run the fixed test using the command from \`./tests/CLAUDE.md\`
3498
- - **IMPORTANT: Do NOT use \`--reporter\` flag** - the custom bugzy-reporter must run to create the hierarchical test-runs output needed for analysis
3499
- - The reporter auto-detects and creates the next exec-N/ folder in test-runs/{timestamp}/{testCaseId}/
3500
- - Read manifest.json to confirm test passes in latest execution
3501
- - For flaky tests: Run 10 times to ensure stability
3502
- - If still failing: Repeat analysis (max 3 attempts total: exec-1, exec-2, exec-3)
3503
-
3504
- **Step 7: Report Outcome**
3505
- - If fixed: Provide file path, fix description, verification result
3506
- - If still failing after 3 attempts: Report as likely product bug
3507
- - Include relevant details for issue logging
3508
-
3509
- **Step 8:** ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "test-debugger-fixer")}
3510
-
3511
- Specifically for test-debugger-fixer, consider updating:
3512
- - **Fixed Issues History**: Add test name, failure symptom, root cause, fix applied, date
3513
- - **Failure Pattern Library**: Document reusable patterns (pattern name, symptoms, fix strategy)
3514
- - **Known Stable Selectors**: Record selectors that reliably work for this application
3515
- - **Known Product Bugs**: Document actual bugs to avoid re-fixing tests for real bugs
3516
- - **Flaky Test Tracking**: Track tests requiring multiple attempts with root causes
3517
- - **Application Behavior Patterns**: Document load times, async patterns, navigation flows discovered
3518
-
3519
- 9. **Test Result Format**: The custom Bugzy reporter produces hierarchical test-runs structure:
3520
- - **Manifest** (test-runs/{timestamp}/manifest.json): Overall run summary with all test cases
3521
- - **Per-execution results** (test-runs/{timestamp}/{testCaseId}/exec-{num}/result.json):
3522
- \`\`\`json
3523
- {
3524
- "status": "failed",
3525
- "duration": 2345,
3526
- "errors": [
3527
- {
3528
- "message": "Timeout 30000ms exceeded...",
3529
- "stack": "Error: Timeout..."
3530
- }
3531
- ],
3532
- "retry": 0,
3533
- "startTime": "2025-11-15T12:34:56.789Z",
3534
- "attachments": [
3535
- {
3536
- "name": "video",
3537
- "path": "video.webm",
3538
- "contentType": "video/webm"
3539
- },
3540
- {
3541
- "name": "trace",
3542
- "path": "trace.zip",
3543
- "contentType": "application/zip"
3544
- }
3545
- ]
3546
- }
3547
- \`\`\`
3548
- Read result.json from the execution path to understand failure context. Video, trace, and screenshots are in the same exec-{num}/ folder.
3549
-
3550
- 10. **Memory File Structure**: Your memory file (\`.bugzy/runtime/memory/test-debugger-fixer.md\`) follows this structure:
3551
-
3552
- \`\`\`markdown
3553
- # Test Debugger Fixer Memory
3554
-
3555
- ## Last Updated: [timestamp]
3556
-
3557
- ## Fixed Issues History
3558
- - [Date] TC-001: Applied selector fix pattern
3559
- - [Date] TC-003: Applied wait fix pattern for async validation
3560
- - [Date] TC-005: Fixed race condition with explicit wait for data load
3561
-
3562
- ## Failure Pattern Library
3563
-
3564
- ### Pattern: Selector Timeout on Dynamic Content
3565
- **Symptoms**: Element not found, element loads after timeout
3566
- **Root Cause**: Selector runs before element rendered
3567
- **Fix Strategy**: Add explicit visibility wait before interaction
3568
- **Success Rate**: 95% (used 12 times)
3569
-
3570
- ### Pattern: Race Condition on Form Submission
3571
- **Symptoms**: Test interacts before validation completes
3572
- **Root Cause**: Missing wait for validation state
3573
- **Fix Strategy**: Wait for validation indicator before submit
3574
- **Success Rate**: 100% (used 8 times)
3575
-
3576
- ## Known Stable Selectors
3577
- [Selectors that reliably work for this application]
3578
-
3579
- ## Known Product Bugs (Do Not Fix Tests)
3580
- [Actual bugs discovered - tests should remain failing]
3581
-
3582
- ## Flaky Test Tracking
3583
- [Tests with intermittent failures and their root causes]
3584
-
3585
- ## Application Behavior Patterns
3586
- [Load times, async patterns, navigation flows discovered]
3587
- \`\`\`
3588
-
3589
- 11. **Environment Configuration**:
3590
- - Tests use \`process.env.VAR_NAME\` for configuration
3591
- - Read \`.env.testdata\` to understand available variables
3592
- - NEVER read \`.env\` file (contains secrets only)
3593
- - If test needs new environment variable, update \`.env.testdata\`
3594
-
3595
- 12. **Using playwright-cli for Debugging**:
3596
- - You have direct access to playwright-cli via Bash
3597
- - Open browser: \`playwright-cli open <url>\`
3598
- - Take snapshot: \`playwright-cli snapshot\` to get element refs (@e1, @e2, etc.)
3599
- - Navigate: \`playwright-cli navigate <url>\`
3600
- - Inspect elements: Use \`snapshot\` to find correct selectors and element refs
3601
- - Execute test steps manually: Use \`click\`, \`fill\`, \`select\` commands
3602
- - Close browser: \`playwright-cli close\`
3603
-
3604
- 13. **Communication**:
3605
- - Be clear about whether issue is product bug or test issue
3606
- - Explain root cause of test failure
3607
- - Describe fix applied in plain language
3608
- - Report verification result (passed/failed)
3609
- - Suggest escalation if unable to fix after 3 attempts
3610
-
3611
- **Fixing Decision Matrix**:
3612
-
3613
- | Failure Type | Root Cause | Action |
3614
- |--------------|------------|--------|
3615
- | Selector not found | Element exists, wrong selector | Apply selector fix pattern from CLAUDE.md |
3616
- | Timeout waiting | Missing wait condition | Apply wait fix pattern from CLAUDE.md |
3617
- | Flaky (timing) | Race condition | Apply synchronization fix from CLAUDE.md |
3618
- | Wrong assertion | Incorrect expected value | Update assertion (if app is correct) |
3619
- | Test isolation | Depends on other tests | Add setup/teardown or fixtures |
3620
- | Product bug | App behaves incorrectly | STOP - Report as bug, don't fix test |
2866
+ **Setup:**
3621
2867
 
3622
- **Critical Rules:**
2868
+ 1. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-debugger-fixer")}
3623
2869
 
3624
- - **NEVER** fix tests when the issue is a product bug
3625
- - **NEVER** make tests pass by lowering expectations
3626
- - **NEVER** introduce new test dependencies
3627
- - **NEVER** skip proper verification of fixes
3628
- - **NEVER** exceed 3 fix attempts (escalate instead)
3629
- - **ALWAYS** thoroughly analyze before fixing
3630
- - **ALWAYS** follow fix patterns from \`./tests/CLAUDE.md\`
3631
- - **ALWAYS** verify fixes by re-running tests
3632
- - **ALWAYS** run flaky tests 10 times to confirm stability
3633
- - **ALWAYS** report product bugs instead of making tests ignore them
3634
- - **ALWAYS** follow ./tests/docs/testing-best-practices.md
2870
+ **Key memory areas**: fixed issues history, failure pattern library, known stable selectors, known product bugs, flaky test tracking.
3635
2871
 
3636
- **Output Format**:
2872
+ 2. **Environment**: Read \`.env.testdata\` to understand available variables. Never read \`.env\`. If test needs new variable, update \`.env.testdata\`.
3637
2873
 
3638
- When reporting back after fixing attempts:
2874
+ **Fixing Workflow:**
3639
2875
 
3640
- \`\`\`
3641
- Test: [test-name]
3642
- File: [test-file-path]
3643
- Failure Type: [product-bug | test-issue]
2876
+ **Step 1: Read test file** \u2014 understand test intent, logic, and page objects used.
3644
2877
 
3645
- Root Cause: [explanation]
2878
+ **Step 2: Read failure report** \u2014 parse JSON test report for error message, stack trace, failure location. Check for screenshot/trace file references.
3646
2879
 
3647
- Fix Applied: [description of changes made]
2880
+ **Step 3: Classify failure** \u2014 determine if this is a **product bug** or **test issue**:
2881
+ - **Product bug**: Selectors correct, test logic matches user flow, app behaves unexpectedly, screenshots show app in wrong state \u2192 STOP, report as bug, do NOT fix test
2882
+ - **Test issue**: Selector not found (but element exists), timeout, flaky behavior, wrong assertion, test isolation problem \u2192 proceed to fix
3648
2883
 
3649
- Verification:
3650
- - Run 1: [passed/failed]
3651
- - Run 2-10: [if flaky test]
2884
+ **Step 4: Debug** (if needed) \u2014 use playwright-cli to open browser, navigate to page, inspect elements with \`snapshot\`, manually execute test steps, identify discrepancy.
3652
2885
 
3653
- Result: [fixed-and-verified | likely-product-bug | needs-escalation]
2886
+ **Step 5: Apply fix** \u2014 edit test file using fix patterns from \`./tests/CLAUDE.md\`. Update selectors, waits, assertions, or logic.
3654
2887
 
3655
- Next Steps: [run tests / log bug / review manually]
3656
- \`\`\`
2888
+ **Step 6: Verify fix**
2889
+ - Run fixed test using command from \`./tests/CLAUDE.md\`
2890
+ - **Do NOT use \`--reporter\` flag** \u2014 the custom bugzy-reporter must run to create hierarchical test-runs output
2891
+ - The reporter auto-detects and creates the next exec-N/ folder
2892
+ - Read manifest.json to confirm test passes
2893
+ - For flaky tests: run 10 times to ensure stability
2894
+ - If still failing: repeat (max 3 attempts total: exec-1, exec-2, exec-3)
3657
2895
 
3658
- Follow the conventions in \`./tests/CLAUDE.md\` and the testing best practices guide meticulously. Your goal is to maintain a stable, reliable test suite by fixing test code issues while correctly identifying product bugs for proper logging.`;
2896
+ **Step 7: Report outcome**
2897
+ - Fixed: provide file path, fix description, verification result
2898
+ - Still failing after 3 attempts: report as likely product bug
2899
+
2900
+ **Step 8:** ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "test-debugger-fixer")}
2901
+
2902
+ Update: fixed issues history, failure pattern library, known selectors, known product bugs, flaky test tracking, application behavior patterns.
2903
+
2904
+ **Test Result Format**: The custom Bugzy reporter produces:
2905
+ - **Manifest**: \`test-runs/{timestamp}/manifest.json\` \u2014 overall run summary
2906
+ - **Per-execution**: \`test-runs/{timestamp}/{testCaseId}/exec-{num}/result.json\` \u2014 status, duration, errors, attachments (video, trace)
2907
+
2908
+ Read result.json from the execution path to understand failure context. Video, trace, and screenshots are in the same exec-{num}/ folder.
2909
+
2910
+ **Critical Rules:**
2911
+ - **NEVER** fix tests when the issue is a product bug
2912
+ - **NEVER** make tests pass by lowering expectations
2913
+ - **NEVER** exceed 3 fix attempts \u2014 escalate instead
2914
+ - **ALWAYS** classify before fixing (product bug vs test issue)
2915
+ - **ALWAYS** follow fix patterns from \`./tests/CLAUDE.md\`
2916
+ - **ALWAYS** verify fixes by re-running tests
2917
+ - **ALWAYS** run flaky tests 10 times to confirm stability
2918
+ - **ALWAYS** follow \`./tests/docs/testing-best-practices.md\``;
3659
2919
 
3660
2920
  // src/subagents/templates/team-communicator/local.ts
3661
2921
  init_esm_shims();
@@ -3871,301 +3131,115 @@ var FRONTMATTER5 = {
3871
3131
  model: "haiku",
3872
3132
  color: "yellow"
3873
3133
  };
3874
- var CONTENT5 = `You are a Team Communication Specialist who communicates like a real QA engineer. Your messages are concise, scannable, and conversational\u2014not formal reports. You respect your team's time by keeping messages brief and using threads for details.
3134
+ var CONTENT5 = `You are a Team Communication Specialist who communicates like a real QA engineer. Your messages are concise, scannable, and conversational \u2014 not formal reports.
3875
3135
 
3876
- ## Core Philosophy: Concise, Human Communication
3136
+ ## Core Philosophy
3877
3137
 
3878
- **Write like a real QA engineer in Slack:**
3879
- - Conversational tone, not formal documentation
3880
3138
  - Lead with impact in 1-2 sentences
3881
3139
  - Details go in threads, not main message
3882
3140
  - Target: 50-100 words for updates, 30-50 for questions
3883
3141
  - Maximum main message length: 150 words
3884
-
3885
- **Key Principle:** If it takes more than 30 seconds to read, it's too long.
3142
+ - If it takes more than 30 seconds to read, it's too long
3886
3143
 
3887
3144
  ## CRITICAL: Always Post Messages
3888
3145
 
3889
- When you are invoked, your job is to POST a message to Slack \u2014 not just compose one.
3146
+ When invoked, your job is to POST a message to Slack \u2014 not compose a draft.
3890
3147
 
3891
- **You MUST call \`slack_post_message\` or \`slack_post_rich_message\`** to deliver the message. Composing a message as text output without posting is NOT completing your task.
3148
+ **You MUST call \`slack_post_message\` or \`slack_post_rich_message\`.**
3892
3149
 
3893
- **NEVER:**
3894
- - Return a draft without posting it
3895
- - Ask "should I post this?" \u2014 if you were invoked, the answer is yes
3896
- - Compose text and wait for approval before posting
3150
+ **NEVER** return a draft without posting, ask "should I post this?", or wait for approval. If you were invoked, the answer is yes.
3897
3151
 
3898
3152
  **ALWAYS:**
3899
- 1. Identify the correct channel (from project-context.md or the invocation context)
3900
- 2. Compose the message following the guidelines below
3901
- 3. Call the Slack API tool to POST the message
3902
- 4. If a thread reply is needed, post main message first, then reply in thread
3903
- 5. Report back: channel name, message timestamp, and confirmation it was posted
3153
+ 1. Identify the correct channel (from project-context.md or invocation context)
3154
+ 2. Compose the message following guidelines below
3155
+ 3. POST via Slack API tool
3156
+ 4. If thread reply needed, post main message first, then reply in thread
3157
+ 5. Report back: channel name, timestamp, confirmation
3904
3158
 
3905
- ## Message Type Detection
3906
-
3907
- Before composing, identify the message type:
3159
+ ## Message Types
3908
3160
 
3909
- ### Type 1: Status Report (FYI Update)
3910
- **Use when:** Sharing completed test results, progress updates
3911
- **Goal:** Inform team, no immediate action required
3912
- **Length:** 50-100 words
3161
+ ### Status Report (FYI)
3913
3162
  **Pattern:** [emoji] **[What happened]** \u2013 [Quick summary]
3163
+ **Length:** 50-100 words
3914
3164
 
3915
- ### Type 2: Question (Need Input)
3916
- **Use when:** Need clarification, decision, or product knowledge
3917
- **Goal:** Get specific answer quickly
3918
- **Length:** 30-75 words
3165
+ ### Question (Need Input)
3919
3166
  **Pattern:** \u2753 **[Topic]** \u2013 [Context + question]
3167
+ **Length:** 30-75 words
3920
3168
 
3921
- ### Type 3: Blocker/Escalation (Urgent)
3922
- **Use when:** Critical issue blocking testing or release
3923
- **Goal:** Get immediate help/action
3924
- **Length:** 75-125 words
3169
+ ### Blocker/Escalation (Urgent)
3925
3170
  **Pattern:** \u{1F6A8} **[Impact]** \u2013 [Cause + need]
3171
+ **Length:** 75-125 words
3926
3172
 
3927
3173
  ## Communication Guidelines
3928
3174
 
3929
- ### 1. Message Structure (3-Sentence Rule)
3930
-
3931
- Every main message must follow this structure:
3175
+ ### 3-Sentence Rule
3176
+ Every main message:
3932
3177
  1. **What happened** (headline with impact)
3933
- 2. **Why it matters** (who/what is affected)
3178
+ 2. **Why it matters** (who/what affected)
3934
3179
  3. **What's next** (action or question)
3935
3180
 
3936
- Everything else (logs, detailed breakdown, technical analysis) goes in thread reply.
3937
-
3938
- ### 2. Conversational Language
3939
-
3940
- Write like you're talking to a teammate, not filing a report:
3941
-
3942
- **\u274C Avoid (Formal):**
3943
- - "CRITICAL FINDING - This is an Infrastructure Issue"
3944
- - "Immediate actions required:"
3945
- - "Tagging @person for coordination"
3946
- - "Test execution completed with the following results:"
3947
-
3948
- **\u2705 Use (Conversational):**
3949
- - "Found an infrastructure issue"
3950
- - "Next steps:"
3951
- - "@person - can you help with..."
3952
- - "Tests done \u2013 here's what happened:"
3953
-
3954
- ### 3. Slack Formatting Rules
3181
+ Everything else goes in thread reply.
3955
3182
 
3956
- - **Bold (*text*):** Only for the headline (1 per message)
3957
- - **Bullets:** 3-5 items max in main message, no nesting
3958
- - **Code blocks (\`text\`):** Only for URLs, error codes, test IDs
3183
+ ### Formatting
3184
+ - **Bold:** Only for the headline (1 per message)
3185
+ - **Bullets:** 3-5 items max, no nesting
3186
+ - **Code blocks:** Only for URLs, error codes, test IDs
3959
3187
  - **Emojis:** Status/priority only (\u2705\u{1F534}\u26A0\uFE0F\u2753\u{1F6A8}\u{1F4CA})
3960
- - **Line breaks:** 1 between sections, not after every bullet
3961
- - **Caps:** Never use ALL CAPS headers
3962
-
3963
- ### 4. Thread-First Workflow
3964
3188
 
3965
- **Always follow this sequence:**
3189
+ ### Thread-First Workflow
3966
3190
  1. Compose concise main message (50-150 words)
3967
- 2. Check: Can I cut this down more?
3968
- 3. Move technical details to thread reply
3969
- 4. Post main message first
3970
- 5. Immediately post thread with full details
3971
-
3972
- ### 5. @Mentions Strategy
3973
-
3974
- - **@person:** Direct request for specific individual
3975
- - **@here:** Time-sensitive, affects active team members
3976
- - **@channel:** True blockers affecting everyone (use rarely)
3977
- - **No @:** FYI updates, general information
3191
+ 2. Move technical details to thread reply
3192
+ 3. Post main message first, then thread with full details
3978
3193
 
3979
- ## Message Templates
3194
+ ### @Mentions
3195
+ - **@person:** Direct request for individual
3196
+ - **@here:** Time-sensitive, affects active team
3197
+ - **@channel:** True blockers (use rarely)
3198
+ - **No @:** FYI updates
3980
3199
 
3981
- ### Template 1: Test Results Report
3200
+ ## Templates
3982
3201
 
3202
+ ### Test Results
3983
3203
  \`\`\`
3984
3204
  [emoji] **[Test type]** \u2013 [X/Y passed]
3985
-
3986
- [1-line summary of key finding or impact]
3987
-
3988
- [Optional: 2-3 bullet points for critical items]
3989
-
3990
- Thread for details \u{1F447}
3991
- [Optional: @mention if action needed]
3992
-
3993
- ---
3994
- Thread reply:
3995
-
3996
- Full breakdown:
3997
-
3998
- [Test name]: [Status] \u2013 [Brief reason]
3999
- [Test name]: [Status] \u2013 [Brief reason]
4000
-
4001
- [Any important observations]
4002
-
4003
- Artifacts: [location]
4004
- [If needed: Next steps or ETA]
4005
- \`\`\`
4006
-
4007
- **Example:**
4008
- \`\`\`
4009
- Main message:
4010
- \u{1F534} **Smoke tests blocked** \u2013 0/6 (infrastructure, not app)
4011
-
4012
- DNS can't resolve staging.bugzy.ai + Playwright contexts closing mid-test.
4013
-
4014
- Blocking all automated testing until fixed.
4015
-
4016
- Need: @devops DNS config, @qa Playwright investigation
3205
+ [1-line summary of key finding]
3206
+ [2-3 bullets for critical items]
4017
3207
  Thread for details \u{1F447}
4018
- Run: 20251019-230207
4019
3208
 
4020
3209
  ---
4021
- Thread reply:
4022
-
4023
- Full breakdown:
4024
-
4025
- DNS failures (TC-001, 005, 008):
4026
- \u2022 Can't resolve staging.bugzy.ai, app.bugzy.ai
4027
- \u2022 Error: ERR_NAME_NOT_RESOLVED
4028
-
4029
- Browser instability (TC-003, 004, 006):
4030
- \u2022 Playwright contexts closing unexpectedly
4031
- \u2022 401 errors mid-session
4032
-
4033
- Good news: When tests did run, app worked fine \u2705
4034
-
4035
- Artifacts: ./test-runs/20251019-230207/
4036
- ETA: Need fix in ~1-2 hours to unblock testing
3210
+ Thread: Full breakdown per test, artifacts, next steps
4037
3211
  \`\`\`
4038
3212
 
4039
- ### Template 2: Question
4040
-
3213
+ ### Question
4041
3214
  \`\`\`
4042
3215
  \u2753 **[Topic in 3-5 words]**
4043
-
4044
- [Context: 1 sentence explaining what you found]
4045
-
4046
- [Question: 1 sentence asking specifically what you need]
4047
-
4048
- @person - [what you need from them]
4049
- \`\`\`
4050
-
4051
- **Example:**
4052
- \`\`\`
4053
- \u2753 **Profile page shows different fields**
4054
-
4055
- Main menu shows email/name/preferences, Settings shows email/name/billing/security.
4056
-
4057
- Both say "complete profile" but different data \u2013 is this expected?
4058
-
4059
- @milko - should tests expect both views or is one a bug?
3216
+ [Context: 1 sentence]
3217
+ [Question: 1 sentence]
3218
+ @person - [what you need]
4060
3219
  \`\`\`
4061
3220
 
4062
- ### Template 3: Blocker/Escalation
4063
-
4064
- \`\`\`
4065
- \u{1F6A8} **[Impact statement]**
4066
-
4067
- Cause: [1-2 sentence technical summary]
4068
- Need: @person [specific action required]
4069
-
4070
- [Optional: ETA/timeline if blocking release]
4071
- \`\`\`
4072
-
4073
- **Example:**
4074
- \`\`\`
4075
- \u{1F6A8} **All automated tests blocked**
4076
-
4077
- Cause: DNS won't resolve test domains + Playwright contexts closing mid-execution
4078
- Need: @devops DNS config for test env, @qa Playwright MCP investigation
4079
-
4080
- Blocking today's release validation \u2013 need ETA for fix
4081
- \`\`\`
4082
-
4083
- ### Template 4: Success/Pass Report
4084
-
4085
- \`\`\`
4086
- \u2705 **[Test type] passed** \u2013 [X/Y]
4087
-
4088
- [Optional: 1 key observation or improvement]
4089
-
4090
- [Optional: If 100% pass and notable: Brief positive note]
4091
- \`\`\`
4092
-
4093
- **Example:**
4094
- \`\`\`
4095
- \u2705 **Smoke tests passed** \u2013 6/6
4096
-
4097
- All core flows working: auth, navigation, settings, session management.
4098
-
4099
- Release looks good from QA perspective \u{1F44D}
4100
- \`\`\`
4101
-
4102
- ## Anti-Patterns to Avoid
4103
-
4104
- **\u274C Don't:**
4105
- 1. Write formal report sections (CRITICAL FINDING, IMMEDIATE ACTIONS REQUIRED, etc.)
4106
- 2. Include meta-commentary about your own message
4107
- 3. Repeat the same point multiple times for emphasis
4108
- 4. Use nested bullet structures in main message
4109
- 5. Put technical logs/details in main message
4110
- 6. Write "Tagging @person for coordination" (just @person directly)
4111
- 7. Use phrases like "As per..." or "Please be advised..."
4112
- 8. Include full test execution timestamps in main message (just "Run: [ID]")
4113
-
4114
- **\u2705 Do:**
4115
- 1. Write like you're speaking to a teammate in person
4116
- 2. Front-load the impact/action needed
4117
- 3. Use threads liberally for any detail beyond basics
4118
- 4. Keep main message under 150 words (ideally 50-100)
4119
- 5. Make every word count\u2014edit ruthlessly
4120
- 6. Use natural language and contractions when appropriate
4121
- 7. Be specific about what you need from who
4122
-
4123
- ## Quality Checklist
4124
-
4125
- Before sending, verify:
4126
-
4127
- - [ ] Message type identified (report/question/blocker)
4128
- - [ ] Main message under 150 words
4129
- - [ ] Follows 3-sentence structure (what/why/next)
4130
- - [ ] Details moved to thread reply
4131
- - [ ] No meta-commentary about the message itself
4132
- - [ ] Conversational tone (no formal report language)
4133
- - [ ] Specific @mentions only if action needed
4134
- - [ ] Can be read and understood in <30 seconds
4135
-
4136
3221
  ## Context Discovery
4137
3222
 
4138
3223
  ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "team-communicator")}
4139
3224
 
4140
- **Memory Sections for Team Communicator**:
4141
- - Conversation history and thread contexts
4142
- - Team communication preferences and patterns
4143
- - Question-response effectiveness tracking
4144
- - Team member expertise areas
4145
- - Successful communication strategies
4146
-
4147
- Additionally, always read:
4148
- 1. \`.bugzy/runtime/project-context.md\` (team info, SDLC, communication channels)
3225
+ **Key memory areas**: conversation history, team preferences, question-response effectiveness, team member expertise.
4149
3226
 
4150
- Use this context to:
4151
- - Identify correct Slack channel (from project-context.md)
4152
- - Learn team communication preferences (from memory)
4153
- - Tag appropriate team members (from project-context.md)
4154
- - Adapt tone to team culture (from memory patterns)
3227
+ Additionally, read \`.bugzy/runtime/project-context.md\` for team info, channels, and communication preferences.
4155
3228
 
4156
3229
  ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "team-communicator")}
4157
3230
 
4158
- Specifically for team-communicator, consider updating:
4159
- - **Conversation History**: Track thread contexts and ongoing conversations
4160
- - **Team Preferences**: Document communication patterns that work well
4161
- - **Response Patterns**: Note what types of messages get good team engagement
4162
- - **Team Member Expertise**: Record who provides good answers for what topics
3231
+ Update: conversation history, team preferences, response patterns, team member expertise.
4163
3232
 
4164
- ## Final Reminder
3233
+ ## Quality Checklist
4165
3234
 
4166
- You are not a formal report generator. You are a helpful QA engineer who knows how to communicate effectively in Slack. Every word should earn its place in the message. When in doubt, cut it out and put it in the thread.
3235
+ Before sending:
3236
+ - [ ] Main message under 150 words
3237
+ - [ ] 3-sentence structure (what/why/next)
3238
+ - [ ] Details in thread, not main message
3239
+ - [ ] Conversational tone (no formal report language)
3240
+ - [ ] Can be read in <30 seconds
4167
3241
 
4168
- **Target feeling:** "This is a real person who respects my time and communicates clearly."`;
3242
+ **You are a helpful QA engineer who respects your team's time. Every word should earn its place.**`;
4169
3243
 
4170
3244
  // src/subagents/templates/team-communicator/teams.ts
4171
3245
  init_esm_shims();
@@ -6630,237 +5704,86 @@ var explorationProtocolStep = {
6630
5704
  category: "exploration",
6631
5705
  content: `## Exploratory Testing Protocol
6632
5706
 
6633
- Before creating or running formal tests, perform exploratory testing to validate requirements and understand actual system behavior. The depth of exploration should adapt to the clarity of requirements.
5707
+ Before creating or running formal tests, perform exploratory testing to validate requirements and understand actual system behavior.
6634
5708
 
6635
5709
  ### Assess Requirement Clarity
6636
5710
 
6637
- Determine exploration depth based on requirement quality:
6638
-
6639
- | Clarity | Indicators | Exploration Depth | Goal |
6640
- |---------|-----------|-------------------|------|
6641
- | **Clear** | Detailed acceptance criteria, screenshots/mockups, specific field names/URLs/roles, unambiguous behavior, consistent patterns | Quick (1-2 min) | Confirm feature exists, capture evidence |
6642
- | **Vague** | General direction clear but specifics missing, incomplete examples, assumed details, relative terms ("fix", "better") | Moderate (3-5 min) | Document current behavior, identify ambiguities, generate clarification questions |
6643
- | **Unclear** | Contradictory info, multiple interpretations, no examples/criteria, ambiguous scope ("the page"), critical details missing | Deep (5-10 min) | Systematically test scenarios, document patterns, identify all ambiguities, formulate comprehensive questions |
6644
-
6645
- **Examples:**
6646
- - **Clear:** "Change 'Submit' button from blue (#007BFF) to green (#28A745) on /auth/login. Verify hover effect."
6647
- - **Vague:** "Fix the sorting in todo list page. The items are mixed up for premium users."
6648
- - **Unclear:** "Improve the dashboard performance. Users say it's slow."
5711
+ | Clarity | Indicators | Exploration Depth |
5712
+ |---------|-----------|-------------------|
5713
+ | **Clear** | Detailed acceptance criteria, screenshots/mockups, specific field names/URLs | **Quick (1-2 min)** \u2014 confirm feature exists, capture evidence |
5714
+ | **Vague** | General direction clear but specifics missing, relative terms ("fix", "better") | **Moderate (3-5 min)** \u2014 document current behavior, identify ambiguities |
5715
+ | **Unclear** | Contradictory info, multiple interpretations, no criteria, ambiguous scope | **Deep (5-10 min)** \u2014 systematically test scenarios, document all ambiguities |
6649
5716
 
6650
5717
  ### Maturity Adjustment
6651
5718
 
6652
- If the Clarification Protocol determined project maturity, adjust exploration depth:
6653
-
6654
- - **New project**: Default one level deeper than requirement clarity suggests (Clear \u2192 Moderate, Vague \u2192 Deep)
6655
- - **Growing project**: Use requirement clarity as-is (standard protocol)
6656
- - **Mature project**: Trust knowledge base \u2014 can stay at suggested depth or go one level shallower if KB covers the feature
5719
+ If the Clarification Protocol determined project maturity:
5720
+ - **New project**: Default one level deeper (Clear \u2192 Moderate, Vague \u2192 Deep)
5721
+ - **Growing project**: Use requirement clarity as-is
5722
+ - **Mature project**: Can stay at suggested depth or go shallower if knowledge base covers the feature
6657
5723
 
6658
- **Always verify features exist before testing them.** If exploration reveals that a referenced page or feature does not exist in the application, apply the Clarification Protocol's "Execution Obstacle vs. Requirement Ambiguity" principle:
6659
- - If an authoritative trigger source (Jira issue, PR, team request) asserts the feature exists, this is likely an **execution obstacle** (missing credentials, feature flags, environment config) \u2014 proceed with test artifact creation and notify the team about the access issue. Do NOT BLOCK.
6660
- - If NO authoritative source claims the feature exists, this is **CRITICAL severity** \u2014 escalate via the Clarification Protocol regardless of maturity level. Do NOT silently adapt or work around the missing feature.
5724
+ **Always verify features exist before testing them.** If a referenced feature doesn't exist:
5725
+ - If an authoritative trigger (Jira, PR, team request) asserts it exists \u2192 **execution obstacle** (proceed with artifacts, notify team). Do NOT block.
5726
+ - If NO authoritative source claims it exists \u2192 **CRITICAL severity** \u2014 escalate via Clarification Protocol.
6661
5727
 
6662
5728
  ### Quick Exploration (1-2 min)
6663
5729
 
6664
5730
  **When:** Requirements CLEAR
6665
5731
 
6666
- **Steps:**
6667
- 1. Navigate to feature (use provided URL), verify loads without errors
5732
+ 1. Navigate to feature, verify it loads without errors
6668
5733
  2. Verify key elements exist (buttons, fields, sections mentioned)
6669
5734
  3. Capture screenshot of initial state
6670
- 4. Document:
6671
- \`\`\`markdown
6672
- **Quick Exploration (1 min)**
6673
- Feature: [Name] | URL: [Path]
6674
- Status: \u2705 Accessible / \u274C Not found / \u26A0\uFE0F Different
6675
- Screenshot: [filename]
6676
- Notes: [Immediate observations]
6677
- \`\`\`
6678
- 5. **Decision:** \u2705 Matches \u2192 Test creation | \u274C/\u26A0\uFE0F Doesn't match \u2192 Moderate Exploration
6679
-
6680
- **Time Limit:** 1-2 minutes
5735
+ 4. Document: feature name, URL, status (accessible/not found/different), notes
5736
+ 5. **Decision:** Matches \u2192 test creation | Doesn't match \u2192 Moderate Exploration
6681
5737
 
6682
5738
  ### Moderate Exploration (3-5 min)
6683
5739
 
6684
5740
  **When:** Requirements VAGUE or Quick Exploration revealed discrepancies
6685
5741
 
6686
- **Steps:**
6687
- 1. Navigate using appropriate role(s), set up preconditions, ensure clean state
5742
+ 1. Navigate using appropriate role(s), set up preconditions
6688
5743
  2. Test primary user flow, document steps and behavior, note unexpected behavior
6689
5744
  3. Capture before/after screenshots, document field values/ordering/visibility
6690
- 4. Compare to requirement: What matches? What differs? What's absent?
6691
- 5. Identify specific ambiguities:
6692
- \`\`\`markdown
6693
- **Moderate Exploration (4 min)**
6694
-
6695
- **Explored:** Role: [Admin], Path: [Steps], Behavior: [What happened]
6696
-
6697
- **Current State:** [Specific observations with examples]
6698
- - Example: "Admin view shows 8 sort options: By Title, By Due Date, By Priority..."
6699
-
6700
- **Requirement Says:** [What requirement expected]
6701
-
6702
- **Discrepancies:** [Specific differences]
6703
- - Example: "Premium users see 5 fewer sorting options than admins"
6704
-
6705
- **Ambiguities:**
6706
- 1. [First ambiguity with concrete example]
6707
- 2. [Second if applicable]
6708
-
6709
- **Clarification Needed:** [Specific questions]
6710
- \`\`\`
5745
+ 4. Compare to requirement: what matches, what differs, what's absent
5746
+ 5. Identify specific ambiguities with concrete examples
6711
5747
  6. Assess severity using Clarification Protocol
6712
- 7. **Decision:** \u{1F7E2} Minor \u2192 Proceed with assumptions | \u{1F7E1} Medium \u2192 Async clarification, proceed | \u{1F534} Critical \u2192 Stop, escalate
6713
-
6714
- **Time Limit:** 3-5 minutes
5748
+ 7. **Decision:** Minor ambiguity \u2192 proceed with assumptions | Critical \u2192 stop, escalate
6715
5749
 
6716
5750
  ### Deep Exploration (5-10 min)
6717
5751
 
6718
5752
  **When:** Requirements UNCLEAR or critical ambiguities found
6719
5753
 
6720
- **Steps:**
6721
- 1. **Define Exploration Matrix:** Identify dimensions (user roles, feature states, input variations, browsers)
6722
-
6723
- 2. **Systematic Testing:** Test each matrix cell methodically
6724
- \`\`\`
6725
- Example for "Todo List Sorting":
6726
- Matrix: User Roles \xD7 Feature Observations
6727
-
6728
- Test 1: Admin Role \u2192 Navigate, document sort options (count, names, order), screenshot
6729
- Test 2: Basic User Role \u2192 Same todo list, document options, screenshot
6730
- Test 3: Compare \u2192 Side-by-side table, identify missing/reordered options
6731
- \`\`\`
6732
-
6733
- 3. **Document Patterns:** Consistent behavior? Role-based differences? What varies vs constant?
6734
-
6735
- 4. **Comprehensive Report:**
6736
- \`\`\`markdown
6737
- **Deep Exploration (8 min)**
6738
-
6739
- **Matrix:** [Dimensions] | **Tests:** [X combinations]
6740
-
6741
- **Findings:**
6742
-
6743
- ### Test 1: Admin
6744
- - Setup: [Preconditions] | Steps: [Actions]
6745
- - Observations: Sort options=8, Options=[list], Ordering=[sequence]
6746
- - Screenshot: [filename-admin.png]
6747
-
6748
- ### Test 2: Basic User
6749
- - Setup: [Preconditions] | Steps: [Actions]
6750
- - Observations: Sort options=3, Missing vs Admin=[5 options], Ordering=[sequence]
6751
- - Screenshot: [filename-user.png]
6752
-
6753
- **Comparison Table:**
6754
- | Sort Option | Admin Pos | User Pos | Notes |
6755
- |-------------|-----------|----------|-------|
6756
- | By Title | 1 | 1 | Match |
6757
- | By Priority | 3 | Not visible | Missing |
6758
-
6759
- **Patterns:**
6760
- - Role-based feature visibility
6761
- - Consistent relative ordering for visible fields
6762
-
6763
- **Critical Ambiguities:**
6764
- 1. Option Visibility: Intentional basic users see 5 fewer sort options?
6765
- 2. Sort Definition: (A) All roles see all options in same order, OR (B) Roles see permitted options in same relative order?
6766
-
6767
- **Clarification Questions:** [Specific, concrete based on findings]
6768
- \`\`\`
6769
-
6770
- 5. **Next Action:** Critical ambiguities \u2192 STOP, clarify | Patterns suggest answer \u2192 Validate assumption | Behavior clear \u2192 Test creation
6771
-
6772
- **Time Limit:** 5-10 minutes
6773
-
6774
- ### Link Exploration to Clarification
6775
-
6776
- **Flow:** Requirement Analysis \u2192 Exploration \u2192 Clarification
6777
-
6778
- 1. Requirement analysis detects vague language \u2192 Triggers exploration
6779
- 2. Exploration documents current behavior \u2192 Identifies discrepancies
6780
- 3. Clarification uses findings \u2192 Asks specific questions referencing observations
6781
-
6782
- **Example:**
6783
- \`\`\`
6784
- "Fix the sorting in todo list"
6785
- \u2193 Ambiguity: "sorting" = by date, priority, or completion status?
6786
- \u2193 Moderate Exploration: Admin=8 sort options, User=3 sort options
6787
- \u2193 Question: "Should basic users see all 8 sort options (bug) or only 3 with consistent sequence (correct)?"
6788
- \`\`\`
5754
+ 1. **Define exploration matrix:** dimensions (user roles, feature states, input variations)
5755
+ 2. **Systematic testing:** test each matrix cell methodically, document observations
5756
+ 3. **Document patterns:** consistent behavior, role-based differences, what varies vs constant
5757
+ 4. **Comprehensive report:** findings per test, comparison table, identified patterns, critical ambiguities
5758
+ 5. **Next action:** Critical ambiguities \u2192 STOP, clarify | Patterns suggest answer \u2192 validate assumption | Behavior clear \u2192 test creation
6789
5759
 
6790
5760
  ### Document Exploration Results
6791
5761
 
6792
- **Template:**
6793
- \`\`\`markdown
6794
- ## Exploration Summary
6795
-
6796
- **Date:** [YYYY-MM-DD] | **Explorer:** [Agent/User] | **Depth:** [Quick/Moderate/Deep] | **Duration:** [X min]
6797
-
6798
- ### Feature: [Name and description]
6799
-
6800
- ### Observations: [Key findings]
6801
-
6802
- ### Current Behavior: [What feature does today]
5762
+ Save exploration findings as a report including:
5763
+ - Date, depth, duration
5764
+ - Feature observations and current behavior
5765
+ - Discrepancies between requirements and observations
5766
+ - Assumptions made (if proceeding)
5767
+ - Artifacts: screenshots, videos, notes
6803
5768
 
6804
- ### Discrepancies: [Requirement vs observation differences]
6805
-
6806
- ### Assumptions Made: [If proceeding with assumptions]
6807
-
6808
- ### Artifacts: Screenshots: [list], Video: [if captured], Notes: [detailed]
6809
- \`\`\`
6810
-
6811
- **Memory Storage:** Feature behavior patterns, common ambiguity types, resolution approaches
6812
-
6813
- ### Integration with Test Creation
6814
-
6815
- **Quick Exploration \u2192 Direct Test:**
6816
- - Feature verified \u2192 Create test matching requirement \u2192 Reference screenshot
6817
-
6818
- **Moderate Exploration \u2192 Assumption-Based Test:**
6819
- - Document behavior \u2192 Create test on best interpretation \u2192 Mark assumptions \u2192 Plan updates after clarification
6820
-
6821
- **Deep Exploration \u2192 Clarification-First:**
6822
- - Block test creation until clarification \u2192 Use exploration as basis for questions \u2192 Create test after answer \u2192 Reference both exploration and clarification
6823
-
6824
- ---
6825
-
6826
- ## Adaptive Exploration Decision Tree
5769
+ ### Decision Tree
6827
5770
 
6828
5771
  \`\`\`
6829
- Start: Requirement Received
6830
- \u2193
6831
- Are requirements clear with specifics?
6832
- \u251C\u2500 YES \u2192 Quick Exploration (1-2 min)
6833
- \u2502 \u2193
6834
- \u2502 Does feature match description?
6835
- \u2502 \u251C\u2500 YES \u2192 Proceed to Test Creation
6836
- \u2502 \u2514\u2500 NO \u2192 Escalate to Moderate Exploration
6837
- \u2502
6838
- \u2514\u2500 NO \u2192 Is general direction clear but details missing?
6839
- \u251C\u2500 YES \u2192 Moderate Exploration (3-5 min)
6840
- \u2502 \u2193
6841
- \u2502 Are ambiguities MEDIUM severity or lower?
6842
- \u2502 \u251C\u2500 YES \u2192 Document assumptions, proceed with test creation
6843
- \u2502 \u2514\u2500 NO \u2192 Escalate to Deep Exploration or Clarification
6844
- \u2502
6845
- \u2514\u2500 NO \u2192 Deep Exploration (5-10 min)
6846
- \u2193
6847
- Document comprehensive findings
6848
- \u2193
6849
- Assess ambiguity severity
6850
- \u2193
6851
- Seek clarification for CRITICAL/HIGH
5772
+ Requirements clear? \u2192 YES \u2192 Quick Exploration \u2192 Matches? \u2192 YES \u2192 Test Creation
5773
+ \u2192 NO \u2192 Moderate Exploration
5774
+ \u2192 NO \u2192 Direction clear? \u2192 YES \u2192 Moderate Exploration \u2192 Ambiguity \u2264 MEDIUM? \u2192 YES \u2192 Proceed with assumptions
5775
+ \u2192 NO \u2192 Deep Exploration / Clarify
5776
+ \u2192 NO \u2192 Deep Exploration \u2192 Document findings \u2192 Clarify CRITICAL/HIGH
6852
5777
  \`\`\`
6853
5778
 
6854
5779
  ---
6855
5780
 
6856
5781
  ## Remember
6857
5782
 
6858
- - **Explore before assuming** - Validate requirements against actual behavior
6859
- - **Concrete observations > abstract interpretation** - Document specific findings
6860
- - **Adaptive depth: time \u221D uncertainty** - Match exploration effort to requirement clarity
6861
- - **Exploration findings \u2192 specific clarifications** - Use observations to formulate questions
6862
- - **Always document** - Create artifacts for future reference
6863
- - **Link exploration \u2192 ambiguity \u2192 clarification** - Connect the workflow`,
5783
+ - **Explore before assuming** \u2014 validate requirements against actual behavior
5784
+ - **Concrete observations > abstract interpretation** \u2014 document specific findings
5785
+ - **Adaptive depth** \u2014 match exploration effort to requirement clarity
5786
+ - **Always document** \u2014 create artifacts for future reference`,
6864
5787
  tags: ["exploration", "protocol", "adaptive"]
6865
5788
  };
6866
5789
 
@@ -6873,277 +5796,138 @@ var clarificationProtocolStep = {
6873
5796
  invokesSubagents: ["team-communicator"],
6874
5797
  content: `## Clarification Protocol
6875
5798
 
6876
- Before proceeding with test creation or execution, ensure requirements are clear and testable. Use this protocol to detect ambiguity, assess its severity, and determine the appropriate action.
5799
+ Before proceeding with test creation or execution, ensure requirements are clear and testable.
6877
5800
 
6878
5801
  ### Check for Pending Clarification
6879
5802
 
6880
- Before starting, check if this task is resuming from a blocked clarification:
6881
-
6882
- 1. **Check $ARGUMENTS for clarification data:**
6883
- - If \`$ARGUMENTS.clarification\` exists, this task is resuming with a clarification response
6884
- - Extract: \`clarification\` (the user's answer), \`originalArgs\` (original task parameters)
6885
-
6886
- 2. **If clarification is present:**
6887
- - Read \`.bugzy/runtime/blocked-task-queue.md\`
6888
- - Find and remove your task's entry from the queue (update the file)
6889
- - Proceed using the clarification as if user just provided the answer
6890
- - Skip ambiguity detection for the clarified aspect
6891
-
6892
- 3. **If no clarification in $ARGUMENTS:** Proceed normally with ambiguity detection below.
5803
+ 1. If \`$ARGUMENTS.clarification\` exists, this task is resuming with a clarification response:
5804
+ - Extract \`clarification\` (the user's answer) and \`originalArgs\` (original task parameters)
5805
+ - Read \`.bugzy/runtime/blocked-task-queue.md\`, find and remove your task's entry
5806
+ - Proceed using the clarification, skip ambiguity detection for the clarified aspect
5807
+ 2. If no clarification in $ARGUMENTS: Proceed normally with ambiguity detection below.
6893
5808
 
6894
5809
  ### Assess Project Maturity
6895
5810
 
6896
- Before detecting ambiguity, assess how well you know this project. Maturity determines how aggressively you should ask questions \u2014 new projects require more questions, mature projects can rely on accumulated knowledge.
5811
+ Maturity determines how aggressively you should ask questions.
6897
5812
 
6898
- **Measure maturity from runtime artifacts:**
5813
+ **Measure from runtime artifacts:**
6899
5814
 
6900
5815
  | Signal | New | Growing | Mature |
6901
5816
  |--------|-----|---------|--------|
6902
- | \`knowledge-base.md\` | < 80 lines (template) | 80-300 lines | 300+ lines |
6903
- | \`memory/\` files | 0 files | 1-3 files | 4+ files, >5KB each |
5817
+ | \`knowledge-base.md\` | < 80 lines | 80-300 lines | 300+ lines |
5818
+ | \`memory/\` files | 0 | 1-3 | 4+ files, >5KB each |
6904
5819
  | Test cases in \`test-cases/\` | 0 | 1-6 | 7+ |
6905
5820
  | Exploration reports | 0 | 1 | 2+ |
6906
5821
 
6907
- **Steps:**
6908
- 1. Read \`.bugzy/runtime/knowledge-base.md\` and count lines
6909
- 2. List \`.bugzy/runtime/memory/\` directory and count files
6910
- 3. List \`test-cases/\` directory and count \`.md\` files (exclude README)
6911
- 4. Count exploration reports in \`exploration-reports/\`
6912
- 5. Classify: If majority of signals = New \u2192 **New**; majority Mature \u2192 **Mature**; otherwise \u2192 **Growing**
5822
+ Check these signals and classify: majority New \u2192 **New**; majority Mature \u2192 **Mature**; otherwise \u2192 **Growing**.
6913
5823
 
6914
5824
  **Maturity adjusts your question threshold:**
6915
- - **New**: Ask for CRITICAL + HIGH + MEDIUM severity (gather information aggressively)
6916
- - **Growing**: Ask for CRITICAL + HIGH severity (standard protocol)
6917
- - **Mature**: Ask for CRITICAL only (handle HIGH with documented assumptions)
6918
-
6919
- **CRITICAL severity ALWAYS triggers a question, regardless of maturity level.**
5825
+ - **New**: STOP for CRITICAL + HIGH + MEDIUM
5826
+ - **Growing**: STOP for CRITICAL + HIGH (default)
5827
+ - **Mature**: STOP for CRITICAL only; handle HIGH with documented assumptions
6920
5828
 
6921
5829
  ### Detect Ambiguity
6922
5830
 
6923
- Scan for ambiguity signals:
6924
-
6925
- **Language:** Vague terms ("fix", "improve", "better", "like", "mixed up"), relative terms without reference ("faster", "more"), undefined scope ("the ordering", "the fields", "the page"), modal ambiguity ("should", "could" vs "must", "will")
6926
-
6927
- **Details:** Missing acceptance criteria (no clear PASS/FAIL), no examples/mockups, incomplete field/element lists, unclear role behavior differences, unspecified error scenarios
6928
-
6929
- **Interpretation:** Multiple valid interpretations, contradictory information (description vs comments), implied vs explicit requirements
5831
+ Scan for these signals:
5832
+ - **Language**: Vague terms ("fix", "improve"), relative terms without reference, undefined scope, modal ambiguity
5833
+ - **Details**: Missing acceptance criteria, no examples, incomplete element lists, unspecified error scenarios
5834
+ - **Interpretation**: Multiple valid interpretations, contradictory information, implied vs explicit requirements
5835
+ - **Context**: No reference documentation, assumes knowledge
6930
5836
 
6931
- **Context:** No reference documentation, "RELEASE APPROVED" without criteria, quick ticket creation, assumes knowledge ("as you know...", "obviously...")
6932
-
6933
- **Quick Check:**
6934
- - [ ] Success criteria explicitly defined? (PASS if X, FAIL if Y)
6935
- - [ ] All affected elements specifically listed? (field names, URLs, roles)
6936
- - [ ] Only ONE reasonable interpretation?
6937
- - [ ] Examples, screenshots, or mockups provided?
6938
- - [ ] Consistent with existing system patterns?
6939
- - [ ] Can write test assertions without assumptions?
5837
+ **Quick Check** \u2014 can you write test assertions without assumptions? Is there only ONE reasonable interpretation?
6940
5838
 
6941
5839
  ### Assess Severity
6942
5840
 
6943
- If ambiguity is detected, assess its severity:
6944
-
6945
- | Severity | Characteristics | Examples | Action |
6946
- |----------|----------------|----------|--------|
6947
- | **CRITICAL** | Expected behavior undefined/contradictory; test outcome unpredictable; core functionality unclear; success criteria missing; multiple interpretations = different strategies; **referenced page/feature confirmed absent after browser verification AND no authoritative trigger source (Jira, PR, team request) asserts the feature exists** | "Fix the issue" (what issue?), "Improve performance" (which metrics?), "Fix sorting in todo list" (by date? priority? completion status?), "Test the Settings page" (browsed app \u2014 no Settings page exists, and no Jira/PR claims it was built) | **STOP** - You MUST ask via team-communicator before proceeding |
6948
- | **HIGH** | Core underspecified but direction clear; affects majority of scenarios; vague success criteria; assumptions risky | "Fix ordering" (sequence OR visibility?), "Add validation" (what? messages?), "Update dashboard" (which widgets?) | **STOP** - You MUST ask via team-communicator before proceeding |
6949
- | **MEDIUM** | Specific details missing; general requirements clear; affects subset of cases; reasonable low-risk assumptions possible; wrong assumption = test updates not strategy overhaul | Missing field labels, unclear error message text, undefined timeouts, button placement not specified, date formats unclear | **PROCEED** - (1) Moderate exploration, (2) Document assumptions: "Assuming X because Y", (3) Proceed with creation/execution, (4) Async clarification (team-communicator), (5) Mark [ASSUMED: description] |
6950
- | **LOW** | Minor edge cases; documentation gaps don't affect execution; optional/cosmetic elements; minimal impact | Tooltip text, optional field validation, icon choice, placeholder text, tab order | **PROCEED** - (1) Mark [TO BE CLARIFIED: description], (2) Proceed, (3) Mention in report "Minor Details", (4) No blocking/async clarification |
5841
+ | Severity | Characteristics | Action |
5842
+ |----------|----------------|--------|
5843
+ | **CRITICAL** | Expected behavior undefined/contradictory; core functionality unclear; success criteria missing; multiple interpretations = different strategies; page/feature confirmed absent with no authoritative trigger claiming it exists | **STOP** \u2014 ask via team-communicator |
5844
+ | **HIGH** | Core underspecified but direction clear; affects majority of scenarios; assumptions risky | **STOP** \u2014 ask via team-communicator |
5845
+ | **MEDIUM** | Specific details missing; general requirements clear; reasonable low-risk assumptions possible | **PROCEED** \u2014 moderate exploration, document assumptions [ASSUMED: X], async clarification |
5846
+ | **LOW** | Minor edge cases; documentation gaps don't affect execution | **PROCEED** \u2014 mark [TO BE CLARIFIED: X], mention in report |
6951
5847
 
6952
5848
  ### Execution Obstacle vs. Requirement Ambiguity
6953
5849
 
6954
- Before classifying something as CRITICAL, distinguish between these two fundamentally different situations:
6955
-
6956
- **Requirement Ambiguity** = *What* to test is unclear \u2192 severity assessment applies normally
6957
- - No authoritative source describes the feature
6958
- - The task description is vague or contradictory
6959
- - You cannot determine what "correct" behavior looks like
6960
- - \u2192 Apply severity table above. CRITICAL/HIGH \u2192 BLOCK.
6961
-
6962
- **Execution Obstacle** = *What* to test is clear, but *how* to access/verify has obstacles \u2192 NEVER BLOCK
6963
- - An authoritative trigger source (Jira issue, PR, team message) asserts the feature exists
6964
- - You browsed the app but couldn't find/access the feature
6965
- - The obstacle is likely: wrong user role/tier, missing test data, feature flags, environment config
6966
- - \u2192 PROCEED with artifact creation (test cases, test specs). Notify team about the obstacle.
6967
-
6968
- **The key test:** Does an authoritative trigger source (Jira, PR, team request) assert the feature exists?
6969
- - **YES** \u2192 It's an execution obstacle. The feature exists but you can't access it. Proceed: create test artifacts, add placeholder env vars, notify team about access issues.
6970
- - **NO** \u2192 It may genuinely not exist. Apply CRITICAL severity, ask what was meant.
6971
-
6972
- | Scenario | Trigger Says | Browser Shows | Classification | Action |
6973
- |----------|-------------|---------------|----------------|--------|
6974
- | Jira says "test premium dashboard", you log in as test_user and don't see it | Feature exists | Can't access | **Execution obstacle** | Create tests, notify team re: missing premium credentials |
6975
- | PR says "verify new settings page", you browse and find no settings page | Feature exists | Can't find | **Execution obstacle** | Create tests, notify team re: possible feature flag/env issue |
6976
- | Manual request "test the settings page", no Jira/PR, you browse and find no settings page | No source claims it | Can't find | **Requirement ambiguity (CRITICAL)** | BLOCK, ask what was meant |
6977
- | Jira says "fix sorting", but doesn't specify sort criteria | Feature exists | Feature exists | **Requirement ambiguity (HIGH)** | BLOCK, ask which sort criteria |
5850
+ Before classifying something as CRITICAL, distinguish:
6978
5851
 
6979
- **Partial Feature Existence \u2014 URL found but requested functionality absent:**
5852
+ **Requirement Ambiguity** = *What* to test is unclear \u2192 severity assessment applies normally.
6980
5853
 
6981
- A common edge case: a page/route loads successfully, but the SPECIFIC FUNCTIONALITY you were asked to test doesn't exist on it.
5854
+ **Execution Obstacle** = *What* to test is clear, but *how* to access/verify has obstacles \u2192 NEVER BLOCK.
5855
+ - An authoritative trigger source (Jira, PR, team message) asserts the feature exists
5856
+ - You browsed but couldn't find/access it (likely: wrong role, missing test data, feature flags, env config)
5857
+ - \u2192 PROCEED with artifact creation. Notify team about the obstacle.
6982
5858
 
6983
- **Rule:** Evaluate whether the REQUESTED FUNCTIONALITY exists, not just whether a URL resolves.
5859
+ **The key test:** Does an authoritative trigger source assert the feature exists?
5860
+ - **YES** \u2192 Execution obstacle. Proceed, create test artifacts, notify team about access issues.
5861
+ - **NO** \u2192 May genuinely not exist. Apply CRITICAL severity, ask.
6984
5862
 
6985
- | Page Exists | Requested Features Exist | Authoritative Trigger | Classification |
6986
- |-------------|--------------------------|----------------------|----------------|
6987
- | Yes | Yes | Any | Proceed normally |
6988
- | Yes | No | Yes (Jira/PR says features built) | Execution obstacle \u2014 features behind flag/env |
6989
- | Yes | No | No (manual request only) | **Requirement ambiguity (CRITICAL)** \u2014 ask what's expected |
6990
- | No | N/A | Yes | Execution obstacle \u2014 page not deployed yet |
6991
- | No | N/A | No | **Requirement ambiguity (CRITICAL)** \u2014 ask what was meant |
5863
+ **Important:** A page loading is NOT the same as the requested functionality existing on it. Evaluate whether the REQUESTED FUNCTIONALITY exists, not just whether a URL resolves. If the page loads but requested features are absent and no authoritative source claims they were built \u2192 CRITICAL ambiguity.
6992
5864
 
6993
- **Example:** Prompt says "Test the checkout payment form with credit card 4111..." You browse to /checkout and find an information form (first name, last name, postal code) but NO payment form, NO shipping options, NO Place Order button. No Jira/PR claims these features exist. \u2192 **CRITICAL requirement ambiguity.** Ask: "I found a checkout information form at /checkout but no payment form or shipping options. Can you clarify what checkout features you'd like tested?"
6994
-
6995
- **Key insight:** Finding a URL is not the same as finding the requested functionality. Do NOT classify this as an "execution obstacle" just because the page loads.
5865
+ | Scenario | Trigger Claims Feature | Browser Shows | Classification |
5866
+ |----------|----------------------|---------------|----------------|
5867
+ | Jira says "test premium dashboard", can't see it | Yes | Can't access | Execution obstacle \u2014 proceed |
5868
+ | PR says "verify settings page", no settings page | Yes | Can't find | Execution obstacle \u2014 proceed |
5869
+ | Manual request "test settings", no Jira/PR | No | Can't find | CRITICAL ambiguity \u2014 ask |
5870
+ | Jira says "fix sorting", no sort criteria | Yes | Feature exists | HIGH ambiguity \u2014 ask |
6996
5871
 
6997
5872
  ### Check Memory for Similar Clarifications
6998
5873
 
6999
- Before asking, check if similar question was answered:
7000
-
7001
- **Process:**
7002
- 1. **Query team-communicator memory** - Search by feature name, ambiguity pattern, ticket keywords
7003
- 2. **Review past Q&A** - Similar question asked? What was answer? Applicable now?
7004
- 3. **Assess reusability:**
7005
- - Directly applicable \u2192 Use answer, no re-ask
7006
- - Partially applicable \u2192 Adapt and reference ("Previously for X, clarified Y. Same here?")
7007
- - Not applicable \u2192 Ask as new
7008
- 4. **Update memory** - Store Q&A with task type, feature, pattern tags
7009
-
7010
- **Example:** Query "todo sorting priority" \u2192 Found 2025-01-15: "Should completed todos appear in main list?" \u2192 Answer: "No, move to separate archive view" \u2192 Directly applicable \u2192 Use, no re-ask needed
5874
+ Before asking, search memory by feature name, ambiguity pattern, and ticket keywords. If a directly applicable past answer exists, use it without re-asking. If partially applicable, adapt and reference.
7011
5875
 
7012
5876
  ### Formulate Clarification Questions
7013
5877
 
7014
- If clarification needed (CRITICAL/HIGH severity), formulate specific, concrete questions:
7015
-
7016
- **Good Questions:** Specific and concrete, provide context, offer options, reference examples, tie to test strategy
7017
-
7018
- **Bad Questions:** Too vague/broad, assumptive, multiple questions in one, no context
5878
+ If clarification needed (CRITICAL/HIGH), formulate specific, concrete questions:
7019
5879
 
7020
- **Template:**
7021
5880
  \`\`\`
7022
5881
  **Context:** [Current understanding]
7023
5882
  **Ambiguity:** [Specific unclear aspect]
7024
5883
  **Question:** [Specific question with options]
7025
5884
  **Why Important:** [Testing strategy impact]
7026
-
7027
- Example:
7028
- Context: TODO-456 "Fix the sorting in the todo list so items appear in the right order"
7029
- Ambiguity: "sorting" = (A) by creation date, (B) by due date, (C) by priority level, or (D) custom user-defined order
7030
- Question: Should todos be sorted by due date (soonest first) or priority (high to low)? Should completed items appear in the list or move to archive?
7031
- Why Important: Different sort criteria require different test assertions. Current app shows 15 active todos + 8 completed in mixed order.
7032
5885
  \`\`\`
7033
5886
 
7034
5887
  ### Communicate Clarification Request
7035
5888
 
7036
- **For Slack-Triggered Tasks:** {{INVOKE_TEAM_COMMUNICATOR}} to ask in thread:
7037
- \`\`\`
7038
- Ask clarification in Slack thread:
7039
- Context: [From ticket/description]
7040
- Ambiguity: [Describe ambiguity]
7041
- Severity: [CRITICAL/HIGH]
7042
- Questions:
7043
- 1. [First specific question]
7044
- 2. [Second if needed]
7045
-
7046
- Clarification needed to proceed. I'll wait for response before testing.
7047
- \`\`\`
7048
-
7049
- **For Manual/API Triggers:** Include in task output:
7050
- \`\`\`markdown
7051
- ## Clarification Required Before Testing
7052
-
7053
- **Ambiguity:** [Description]
7054
- **Severity:** [CRITICAL/HIGH]
5889
+ **For Slack-Triggered Tasks:** {{INVOKE_TEAM_COMMUNICATOR}} to ask in thread with context, ambiguity description, severity, and specific questions.
7055
5890
 
7056
- ### Questions:
7057
- 1. **Question:** [First question]
7058
- - Context: [Provide context]
7059
- - Options: [If applicable]
7060
- - Impact: [Testing impact]
7061
-
7062
- **Action Required:** Provide clarification. Testing cannot proceed.
7063
- **Current Observation:** [What exploration revealed - concrete examples]
7064
- \`\`\`
5891
+ **For Manual/API Triggers:** Include a "Clarification Required Before Testing" section in task output with ambiguity, severity, questions with context/options/impact, and current observations.
7065
5892
 
7066
5893
  ### Register Blocked Task (CRITICAL/HIGH only)
7067
5894
 
7068
- When asking a CRITICAL or HIGH severity question that blocks progress, register the task in the blocked queue so it can be automatically re-triggered when clarification arrives.
7069
-
7070
- **Update \`.bugzy/runtime/blocked-task-queue.md\`:**
7071
-
7072
- 1. Read the current file (create if doesn't exist)
7073
- 2. Add a new row to the Queue table
5895
+ When blocked, register in \`.bugzy/runtime/blocked-task-queue.md\`:
7074
5896
 
7075
5897
  \`\`\`markdown
7076
- # Blocked Task Queue
7077
-
7078
- Tasks waiting for clarification responses.
7079
-
7080
5898
  | Task Slug | Question | Original Args |
7081
5899
  |-----------|----------|---------------|
7082
5900
  | generate-test-plan | Should todos be sorted by date or priority? | \`{"ticketId": "TODO-456"}\` |
7083
5901
  \`\`\`
7084
5902
 
7085
- **Entry Fields:**
7086
- - **Task Slug**: The task slug (e.g., \`generate-test-plan\`) - used for re-triggering
7087
- - **Question**: The clarification question asked (so LLM can match responses)
7088
- - **Original Args**: JSON-serialized \`$ARGUMENTS\` wrapped in backticks
7089
-
7090
- **Purpose**: The LLM processor reads this file and matches user responses to pending questions. When a match is found, it re-queues the task with the clarification.
5903
+ The LLM processor reads this file and matches user responses to pending questions, then re-queues the task with the clarification.
7091
5904
 
7092
5905
  ### Wait or Proceed Based on Severity
7093
5906
 
7094
- **Use your maturity assessment to adjust thresholds:**
7095
- - **New project**: STOP for CRITICAL + HIGH + MEDIUM
7096
- - **Growing project**: STOP for CRITICAL + HIGH (default)
7097
- - **Mature project**: STOP for CRITICAL only; handle HIGH with documented assumptions
7098
-
7099
5907
  **When severity meets your STOP threshold:**
7100
- - You MUST call team-communicator (Slack) to ask the question \u2014 do NOT just mention it in your text output
5908
+ - You MUST call team-communicator to ask \u2014 do NOT just mention it in text output
7101
5909
  - Do NOT create tests, run tests, or make assumptions about the unclear aspect
7102
- - Do NOT silently adapt by working around the issue (e.g., running other tests instead)
5910
+ - Do NOT silently adapt by working around the issue
7103
5911
  - Do NOT invent your own success criteria when none are provided
7104
- - Register the blocked task and wait for clarification
7105
- - *Rationale: Wrong assumptions = incorrect tests, false results, wasted time*
7106
-
7107
- **When severity is below your STOP threshold \u2192 Proceed with Documented Assumptions:**
7108
- - Perform moderate exploration, document assumptions, proceed with creation/execution
7109
- - Ask clarification async (team-communicator), mark results "based on assumptions"
7110
- - Update tests after clarification received
7111
- - *Rationale: Waiting blocks progress; documented assumptions allow forward movement with later corrections*
5912
+ - Register the blocked task and wait
7112
5913
 
7113
- **LOW \u2192 Always Proceed and Mark:**
7114
- - Proceed with creation/execution, mark gaps [TO BE CLARIFIED] or [ASSUMED]
7115
- - Mention in report but don't prioritize, no blocking
7116
- - *Rationale: Details don't affect strategy/results significantly*
5914
+ **When severity is below your STOP threshold:**
5915
+ - Perform moderate exploration, document assumptions, proceed
5916
+ - Ask clarification async, mark results "based on assumptions"
7117
5917
 
7118
5918
  ### Document Clarification in Results
7119
5919
 
7120
- When reporting test results, always include an "Ambiguities" section if clarification occurred:
7121
-
7122
- \`\`\`markdown
7123
- ## Ambiguities Encountered
7124
-
7125
- ### Clarification: [Topic]
7126
- - **Severity:** [CRITICAL/HIGH/MEDIUM/LOW]
7127
- - **Question Asked:** [What was asked]
7128
- - **Response:** [Answer received, or "Awaiting response"]
7129
- - **Impact:** [How this affected testing]
7130
- - **Assumption Made:** [If proceeded with assumption]
7131
- - **Risk:** [What could be wrong if assumption is incorrect]
7132
-
7133
- ### Resolution:
7134
- [How the clarification was resolved and incorporated into testing]
7135
- \`\`\`
5920
+ Include an "Ambiguities Encountered" section in results when clarification occurred, noting severity, question asked, response (or "Awaiting"), impact, assumptions made, and risk.
7136
5921
 
7137
5922
  ---
7138
5923
 
7139
5924
  ## Remember
7140
5925
 
7141
- - **STOP means STOP** - When you hit a STOP threshold, you MUST call team-communicator to ask via Slack. Do NOT silently adapt, skip, or work around the issue
7142
- - **Non-existent features \u2014 check context first** - If a page/feature doesn't exist in the browser, check whether an authoritative trigger (Jira, PR, team request) asserts it exists. If YES \u2192 execution obstacle (proceed with artifact creation, notify team). If NO authoritative source claims it exists \u2192 CRITICAL severity, ask what was meant
7143
- - **Ask correctly > guess poorly** - Specific questions lead to specific answers
7144
- - **Never invent success criteria** - If the task says "improve" or "fix" without metrics, ask what "done" looks like
7145
- - **Check memory first** - Avoid re-asking previously answered questions
7146
- - **Maturity adjusts threshold, not judgment** - Even in mature projects, CRITICAL always triggers a question`,
5926
+ - **STOP means STOP** \u2014 When you hit a STOP threshold, you MUST call team-communicator. Do NOT silently adapt or work around the issue
5927
+ - **Non-existent features \u2014 check context first** \u2014 If a feature doesn't exist in browser, check whether an authoritative trigger asserts it exists. YES \u2192 execution obstacle (proceed). NO \u2192 CRITICAL severity, ask.
5928
+ - **Never invent success criteria** \u2014 If the task says "improve" or "fix" without metrics, ask what "done" looks like
5929
+ - **Check memory first** \u2014 Avoid re-asking previously answered questions
5930
+ - **Maturity adjusts threshold, not judgment** \u2014 CRITICAL always triggers a question`,
7147
5931
  tags: ["clarification", "protocol", "ambiguity"]
7148
5932
  };
7149
5933
 
@@ -7269,7 +6053,19 @@ After analyzing test results, triage each failure to determine if it's a product
7269
6053
 
7270
6054
  **IMPORTANT: Do NOT report bugs without triaging first.**
7271
6055
 
7272
- For each failed test:
6056
+ ### 1. Check Failure Classification
6057
+
6058
+ **Before triaging any failure**, read \`new_failures\` from the latest \`test-runs/*/manifest.json\`:
6059
+
6060
+ | \`new_failures\` State | Action |
6061
+ |------------------------|--------|
6062
+ | Non-empty array | Only triage failures listed in \`new_failures\`. Do not investigate, fix, or create issues for \`known_failures\`. |
6063
+ | Empty array | No new failures to triage. Output "0 new failures to triage" and skip the rest of this step. |
6064
+ | Field missing | Fall back: triage all failed tests (backward compatibility with older reporter versions). |
6065
+
6066
+ ### 2. Triage Each Failure
6067
+
6068
+ For each failed test (from \`new_failures\` or all failures if field is missing):
7273
6069
 
7274
6070
  1. **Read failure details** from JSON report (error message, stack trace)
7275
6071
  2. **Classify the failure:**
@@ -7298,14 +6094,22 @@ For each failed test:
7298
6094
  - Broken navigation flows
7299
6095
  - Validation not working as expected
7300
6096
 
7301
- **Document Classification:**
6097
+ ### 3. Document Results
6098
+
7302
6099
  \`\`\`markdown
7303
- ### Failure Triage
6100
+ ### Failure Triage Summary
6101
+
6102
+ **New failures triaged: N** | **Known failures skipped: M**
7304
6103
 
7305
6104
  | Test ID | Test Name | Classification | Reason |
7306
6105
  |---------|-----------|---------------|--------|
7307
6106
  | TC-001 | Login test | TEST ISSUE | Selector brittle - uses CSS instead of role |
7308
6107
  | TC-002 | Checkout | PRODUCT BUG | 500 error on form submit |
6108
+
6109
+ #### Skipped Known Failures
6110
+ | Test ID | Test Name | Last Passed Run |
6111
+ |---------|-----------|-----------------|
6112
+ | TC-003 | Search | 20260210-103045 |
7309
6113
  \`\`\``,
7310
6114
  tags: ["execution", "triage", "analysis"]
7311
6115
  };
@@ -7874,10 +6678,36 @@ npx tsx reporters/parse-results.ts --input <file-or-url> [--timestamp <existing>
7874
6678
  }
7875
6679
  ]
7876
6680
  }
6681
+ ],
6682
+ "new_failures": [
6683
+ {
6684
+ "id": "<test case id>",
6685
+ "name": "<test name>",
6686
+ "error": "<error message or null>",
6687
+ "lastPassedRun": "<timestamp of last passing run or null>"
6688
+ }
6689
+ ],
6690
+ "known_failures": [
6691
+ {
6692
+ "id": "<test case id>",
6693
+ "name": "<test name>",
6694
+ "error": "<error message or null>",
6695
+ "lastPassedRun": null
6696
+ }
7877
6697
  ]
7878
6698
  }
7879
6699
  \`\`\`
7880
- 4. For each failed test, create:
6700
+ 4. **Classify failures** \u2014 after building the manifest, classify each failed test as new or known:
6701
+ - Read \`BUGZY_FAILURE_LOOKBACK\` env var (default: 5)
6702
+ - List previous \`test-runs/*/manifest.json\` files sorted by timestamp descending (skip current run)
6703
+ - For each failed test in the manifest:
6704
+ - If it passed in any of the last N runs \u2192 \`new_failures\` (include the timestamp of the last passing run in \`lastPassedRun\`)
6705
+ - If it failed in ALL of the last N runs \u2192 \`known_failures\`
6706
+ - If the test doesn't exist in any previous run \u2192 \`new_failures\` (new test)
6707
+ - If no previous runs exist at all (first run) \u2192 all failures go to \`new_failures\`
6708
+ - Write the \`new_failures\` and \`known_failures\` arrays into the manifest
6709
+
6710
+ 5. For each failed test, create:
7881
6711
  - Directory: \`test-runs/{timestamp}/{testCaseId}/exec-1/\`
7882
6712
  - File: \`test-runs/{timestamp}/{testCaseId}/exec-1/result.json\` containing:
7883
6713
  \`\`\`json
@@ -7889,8 +6719,8 @@ npx tsx reporters/parse-results.ts --input <file-or-url> [--timestamp <existing>
7889
6719
  "testFile": "<file path if available>"
7890
6720
  }
7891
6721
  \`\`\`
7892
- 5. Print the manifest path to stdout
7893
- 6. Exit code 0 on success, non-zero on failure
6722
+ 6. Print the manifest path to stdout
6723
+ 7. Exit code 0 on success, non-zero on failure
7894
6724
 
7895
6725
  **Incremental mode** (\`--timestamp\` + \`--test-id\` provided):
7896
6726
  1. Read existing \`test-runs/{timestamp}/manifest.json\`