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