@bugzy-ai/bugzy 1.13.0 → 1.14.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.
@@ -268,6 +268,9 @@ Before invoking the agent, identify the test cases for the current area:
268
268
  - Existing automated tests: ./tests/specs/
269
269
  - Existing Page Objects: ./tests/pages/
270
270
 
271
+ **Knowledge Base Patterns (MUST APPLY):**
272
+ Include ALL relevant testing patterns from the knowledge base that apply to this area. For example, if the KB documents timing behaviors (animation delays, loading states), selector gotchas, or recommended assertion approaches \u2014 list them here explicitly and instruct the agent to use the specific patterns described (e.g., specific assertion methods with specific timeouts). The test-code-generator does not have access to the knowledge base, so you MUST relay the exact patterns and recommended code approaches.
273
+
271
274
  **The agent should:**
272
275
  1. Read the manual test case files for this area
273
276
  2. Check existing Page Object infrastructure for this area
@@ -276,6 +279,7 @@ Before invoking the agent, identify the test cases for the current area:
276
279
  5. For each test case marked \`automated: true\`:
277
280
  - Create automated Playwright test in ./tests/specs/
278
281
  - Update the manual test case file to reference the automated test path
282
+ - Apply ALL knowledge base patterns listed above (timing, selectors, assertions)
279
283
  6. Run and iterate on each test until it passes or fails with a product bug
280
284
  7. Update .env.testdata with any new variables
281
285
 
@@ -1496,6 +1500,40 @@ The input format determines the trigger source and context extraction strategy.`
1496
1500
  Store the detected trigger for use in output routing:
1497
1501
  - Set variable: \`TRIGGER_SOURCE\` = [GITHUB_PR | SLACK_MESSAGE | CI_CD | MANUAL]
1498
1502
  - This determines output formatting and delivery channel`
1503
+ },
1504
+ // Step 5c: Coverage Gap vs. Ambiguity (inline)
1505
+ {
1506
+ inline: true,
1507
+ title: "Coverage Gap vs. Ambiguity",
1508
+ content: `### Coverage Gap vs. Ambiguity
1509
+
1510
+ When the trigger indicates a feature has been implemented and is ready for testing (Jira "Ready to Test", PR merged, CI/CD pipeline):
1511
+
1512
+ **Missing test coverage for the referenced feature is a COVERAGE GAP, not an ambiguity.**
1513
+
1514
+ - The developer/team is asserting the feature exists and is ready for testing
1515
+ - "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
1516
+ - Do NOT classify as CRITICAL based on stale documentation or knowledge base gaps
1517
+ - If project-context.md or the Jira issue references the feature, assume it exists until browser exploration proves otherwise
1518
+ - Coverage gaps are handled in the "Create Tests for Coverage Gaps" step below \u2014 do NOT block here
1519
+
1520
+ ### If You Browse the App and Cannot Find the Referenced Feature
1521
+
1522
+ Apply the Clarification Protocol's **"Execution Obstacle vs. Requirement Ambiguity"** principle:
1523
+
1524
+ This is an **execution obstacle**, NOT a requirement ambiguity \u2014 because the authoritative trigger source (Jira issue, PR, team request) asserts the feature exists. Common causes for not finding it:
1525
+ - **Missing role/tier**: You're logged in as a basic user but the feature requires admin/premium access
1526
+ - **Missing test data**: Required test accounts or data haven't been configured in \`.env.testdata\`
1527
+ - **Feature flags**: The feature is behind a flag not enabled in the test environment
1528
+ - **Environment config**: The feature requires specific environment variables or deployment settings
1529
+
1530
+ **Action: PROCEED to "Create Tests for Coverage Gaps".** Do NOT BLOCK.
1531
+ - Create test cases and specs that reference the feature as described in the trigger
1532
+ - Add placeholder env vars to \`.env.testdata\` for any missing credentials
1533
+ - Notify the team (via team-communicator) about the access obstacle and what needs to be configured
1534
+ - Tests may fail until the obstacle is resolved \u2014 this is expected and acceptable
1535
+
1536
+ **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.`
1499
1537
  },
1500
1538
  // Step 6: Clarification Protocol (library)
1501
1539
  "clarification-protocol",
@@ -2361,6 +2399,204 @@ function validateEnvVars(mcpServers, envVars) {
2361
2399
  init_cjs_shims();
2362
2400
  var fs3 = __toESM(require("fs"), 1);
2363
2401
  var path3 = __toESM(require("path"), 1);
2402
+
2403
+ // src/subagents/metadata.ts
2404
+ init_cjs_shims();
2405
+ var INTEGRATIONS = {
2406
+ linear: {
2407
+ id: "linear",
2408
+ name: "Linear",
2409
+ provider: "linear",
2410
+ requiredMCP: "mcp__linear__*",
2411
+ integrationType: "oauth"
2412
+ },
2413
+ jira: {
2414
+ id: "jira",
2415
+ name: "Jira",
2416
+ provider: "jira",
2417
+ requiredMCP: "mcp__jira__*",
2418
+ integrationType: "oauth"
2419
+ },
2420
+ "jira-server": {
2421
+ id: "jira-server",
2422
+ name: "Jira Server",
2423
+ provider: "jira-server",
2424
+ requiredMCP: "mcp__jira-server__*",
2425
+ integrationType: "custom"
2426
+ },
2427
+ "azure-devops": {
2428
+ id: "azure-devops",
2429
+ name: "Azure DevOps",
2430
+ provider: "azure-devops",
2431
+ requiredMCP: "mcp__azure-devops__*",
2432
+ integrationType: "oauth"
2433
+ // Uses Nango with API key auth for PAT
2434
+ },
2435
+ notion: {
2436
+ id: "notion",
2437
+ name: "Notion",
2438
+ provider: "notion",
2439
+ requiredMCP: "mcp__notion__*",
2440
+ integrationType: "oauth"
2441
+ },
2442
+ confluence: {
2443
+ id: "confluence",
2444
+ name: "Confluence",
2445
+ provider: "confluence",
2446
+ requiredMCP: "mcp__confluence__*",
2447
+ integrationType: "oauth"
2448
+ },
2449
+ slack: {
2450
+ id: "slack",
2451
+ name: "Slack",
2452
+ provider: "slack",
2453
+ requiredMCP: "mcp__slack__*",
2454
+ integrationType: "oauth"
2455
+ },
2456
+ playwright: {
2457
+ id: "playwright",
2458
+ name: "Playwright",
2459
+ provider: "playwright",
2460
+ // No requiredMCP — uses playwright-cli (CLI tool), not MCP server
2461
+ isLocal: true,
2462
+ // Playwright runs locally, no external connector needed
2463
+ integrationType: "local"
2464
+ },
2465
+ teams: {
2466
+ id: "teams",
2467
+ name: "Microsoft Teams",
2468
+ provider: "teams",
2469
+ requiredMCP: "mcp__teams__*",
2470
+ integrationType: "oauth"
2471
+ },
2472
+ email: {
2473
+ id: "email",
2474
+ name: "Email",
2475
+ provider: "resend",
2476
+ requiredMCP: "mcp__resend__*",
2477
+ integrationType: "local"
2478
+ // Uses platform API key, no OAuth needed
2479
+ },
2480
+ github: {
2481
+ id: "github",
2482
+ name: "GitHub",
2483
+ provider: "github",
2484
+ requiredMCP: "mcp__github__*",
2485
+ integrationType: "oauth"
2486
+ },
2487
+ local: {
2488
+ id: "local",
2489
+ name: "Local (Terminal)",
2490
+ provider: "local",
2491
+ // No requiredMCP - uses built-in Claude Code tools (AskUserQuestion, text output)
2492
+ isLocal: true,
2493
+ integrationType: "local"
2494
+ }
2495
+ };
2496
+ var SUBAGENTS = {
2497
+ "test-runner": {
2498
+ role: "test-runner",
2499
+ name: "Test Runner",
2500
+ description: "Execute automated browser tests (always included)",
2501
+ icon: "play",
2502
+ integrations: [INTEGRATIONS.playwright],
2503
+ model: "sonnet",
2504
+ color: "green",
2505
+ isRequired: true,
2506
+ version: "1.0.0"
2507
+ },
2508
+ "team-communicator": {
2509
+ role: "team-communicator",
2510
+ name: "Team Communicator",
2511
+ description: "Send notifications and updates to your team",
2512
+ icon: "message-square",
2513
+ integrations: [INTEGRATIONS.slack, INTEGRATIONS.teams, INTEGRATIONS.email],
2514
+ model: "sonnet",
2515
+ color: "blue",
2516
+ isRequired: true,
2517
+ // Required - CLI uses 'local' (auto-configured), cloud uses email fallback
2518
+ defaultIntegration: "email",
2519
+ // Email fallback for cloud (CLI auto-configures 'local' separately)
2520
+ version: "1.0.0"
2521
+ },
2522
+ "issue-tracker": {
2523
+ role: "issue-tracker",
2524
+ name: "Issue Tracker",
2525
+ description: "Automatically create and track bugs and issues",
2526
+ icon: "bot",
2527
+ integrations: [
2528
+ // INTEGRATIONS.linear,
2529
+ INTEGRATIONS.jira,
2530
+ INTEGRATIONS["jira-server"],
2531
+ INTEGRATIONS["azure-devops"],
2532
+ INTEGRATIONS.notion,
2533
+ INTEGRATIONS.slack
2534
+ ],
2535
+ model: "sonnet",
2536
+ color: "red",
2537
+ version: "1.0.0"
2538
+ },
2539
+ "documentation-researcher": {
2540
+ role: "documentation-researcher",
2541
+ name: "Documentation Researcher",
2542
+ description: "Search and retrieve information from your documentation",
2543
+ icon: "file-search",
2544
+ integrations: [
2545
+ INTEGRATIONS.notion,
2546
+ INTEGRATIONS.jira
2547
+ // INTEGRATIONS.confluence
2548
+ ],
2549
+ model: "sonnet",
2550
+ color: "cyan",
2551
+ version: "1.0.0"
2552
+ },
2553
+ "test-code-generator": {
2554
+ role: "test-code-generator",
2555
+ name: "Test Code Generator",
2556
+ description: "Generate automated Playwright test scripts and Page Objects",
2557
+ icon: "code",
2558
+ integrations: [INTEGRATIONS.playwright],
2559
+ model: "sonnet",
2560
+ color: "purple",
2561
+ isRequired: true,
2562
+ // Required for automated test generation
2563
+ version: "1.0.0"
2564
+ },
2565
+ "test-debugger-fixer": {
2566
+ role: "test-debugger-fixer",
2567
+ name: "Test Debugger & Fixer",
2568
+ description: "Debug and fix failing automated tests automatically",
2569
+ icon: "wrench",
2570
+ integrations: [INTEGRATIONS.playwright],
2571
+ model: "sonnet",
2572
+ color: "yellow",
2573
+ isRequired: true,
2574
+ // Required for automated test execution and fixing
2575
+ version: "1.0.0"
2576
+ },
2577
+ "changelog-historian": {
2578
+ role: "changelog-historian",
2579
+ name: "Changelog Historian",
2580
+ description: "Retrieves and analyzes code changes from GitHub PRs and commits",
2581
+ icon: "git-pull-request",
2582
+ integrations: [INTEGRATIONS.github],
2583
+ model: "haiku",
2584
+ color: "gray",
2585
+ isRequired: false,
2586
+ version: "1.0.0"
2587
+ }
2588
+ };
2589
+ function getAllSubAgents() {
2590
+ return Object.values(SUBAGENTS);
2591
+ }
2592
+ function getIntegration(integrationId) {
2593
+ return INTEGRATIONS[integrationId];
2594
+ }
2595
+ function getRequiredSubAgents() {
2596
+ return Object.values(SUBAGENTS).filter((agent) => agent.isRequired);
2597
+ }
2598
+
2599
+ // src/cli/utils/validation.ts
2364
2600
  async function validateProjectStructure() {
2365
2601
  const config = await loadConfig();
2366
2602
  const tool = config ? getToolFromConfig(config) : DEFAULT_TOOL;
@@ -2423,7 +2659,10 @@ async function checkToolAvailable(command) {
2423
2659
  function getRequiredMCPs(subagents) {
2424
2660
  const mcps = /* @__PURE__ */ new Set();
2425
2661
  for (const [_role, integration] of Object.entries(subagents)) {
2426
- mcps.add(integration);
2662
+ const integrationMeta = getIntegration(integration);
2663
+ if (integrationMeta?.requiredMCP) {
2664
+ mcps.add(integration);
2665
+ }
2427
2666
  }
2428
2667
  return Array.from(mcps);
2429
2668
  }
@@ -2611,7 +2850,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2611
2850
 
2612
2851
  3. **Environment Setup**: Before test execution:
2613
2852
  - Read \`.env.testdata\` to get non-secret environment variable values (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.)
2614
- - For secrets, variable names will be passed to Playwright MCP which reads them from .env at runtime
2853
+ - For secrets, variable names are available as environment variables (playwright-cli inherits the process environment)
2615
2854
 
2616
2855
  4. **Test Case Parsing**: You will receive a test case file path. Parse the test case to extract:
2617
2856
  - Test steps and actions to perform
@@ -2619,16 +2858,16 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2619
2858
  - Test data and input values (replace any \${TEST_*} or $TEST_* variables with actual values from .env)
2620
2859
  - Preconditions and setup requirements
2621
2860
 
2622
- 5. **Browser Automation Execution**: Using the Playwright MCP server:
2623
- - Launch a browser instance with appropriate configuration
2624
- - Execute each test step sequentially
2861
+ 5. **Browser Automation Execution**: Using playwright-cli (CLI-based browser automation):
2862
+ - Launch a browser: \`playwright-cli open <url>\`
2863
+ - Execute each test step sequentially using CLI commands: \`click\`, \`fill\`, \`select\`, \`hover\`, etc.
2864
+ - Use \`snapshot\` to inspect page state and find element references (@e1, @e2, etc.)
2625
2865
  - Handle dynamic waits and element interactions intelligently
2626
2866
  - Manage browser state between steps
2627
2867
  - **IMPORTANT - Environment Variable Handling**:
2628
2868
  - When test cases contain environment variables:
2629
2869
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL): Read actual values from .env.testdata and use them directly
2630
- - For secrets (TEST_OWNER_PASSWORD, API keys): Pass variable name to Playwright MCP for runtime substitution
2631
- - Playwright MCP automatically reads .env for secrets and injects them at runtime
2870
+ - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits environment variables from the process
2632
2871
  - Example: Test says "Navigate to TEST_BASE_URL/login" \u2192 Read TEST_BASE_URL from .env.testdata, use the actual URL
2633
2872
 
2634
2873
  6. **Evidence Collection at Each Step**:
@@ -2653,7 +2892,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2653
2892
  - \`steps.json\`: Structured steps with timestamps, video time synchronization, and detailed descriptions (see schema)
2654
2893
 
2655
2894
  Video handling:
2656
- - Playwright automatically saves videos to \`.playwright-mcp/\` folder
2895
+ - Videos are automatically saved to \`.playwright-mcp/\` folder via PLAYWRIGHT_MCP_SAVE_VIDEO env var
2657
2896
  - Find the latest video: \`ls -t .playwright-mcp/*.webm 2>/dev/null | head -1\`
2658
2897
  - Store ONLY the filename in summary.json: \`{ "video": { "filename": "basename.webm" } }\`
2659
2898
  - Do NOT copy, move, or delete video files - external service handles uploads
@@ -2692,8 +2931,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2692
2931
  - Identify all TEST_* variable references (e.g., TEST_BASE_URL, TEST_OWNER_EMAIL, TEST_OWNER_PASSWORD)
2693
2932
  - Read .env.testdata to get actual values for non-secret variables
2694
2933
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly in test execution
2695
- - For secrets (TEST_OWNER_PASSWORD, API keys, etc.): Pass variable names to Playwright MCP for runtime injection from .env
2696
- - Playwright MCP will read .env and inject secret values during browser automation
2934
+ - For secrets (TEST_OWNER_PASSWORD, API keys, etc.): playwright-cli inherits env vars from the process environment
2697
2935
  - If a required variable is not found in .env.testdata, log a warning but continue
2698
2936
 
2699
2937
  5. Extract execution ID from the execution environment:
@@ -2707,7 +2945,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2707
2945
  - Describe what action will be performed (communicate to user)
2708
2946
  - Log the step being executed with timestamp
2709
2947
  - Calculate elapsed time from test start (for videoTimeSeconds)
2710
- - Execute the action using Playwright's robust selectors
2948
+ - Execute the action using playwright-cli commands (click, fill, select, etc. with element refs)
2711
2949
  - Wait for page stability
2712
2950
  - Validate expected behavior
2713
2951
  - Record findings and actual behavior
@@ -2782,12 +3020,11 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2782
3020
  **Environment Variable Handling:**
2783
3021
  - Read .env.testdata at the start of execution to get non-secret environment variables
2784
3022
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly
2785
- - For secrets (TEST_OWNER_PASSWORD, API keys): Pass variable names to Playwright MCP for runtime injection
2786
- - Playwright MCP reads .env for secrets and injects them during browser automation
3023
+ - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits env vars from the process environment
2787
3024
  - DO NOT read .env yourself (security policy - it contains only secrets)
2788
3025
  - DO NOT make up fake values or fallbacks
2789
3026
  - If a variable is missing from .env.testdata, log a warning
2790
- - If Playwright MCP reports a secret is missing/empty, that indicates .env is misconfigured
3027
+ - If a secret env var is missing/empty, that indicates .env is misconfigured
2791
3028
  - Document which environment variables were used in the test run summary
2792
3029
 
2793
3030
  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.`;
@@ -2835,7 +3072,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2835
3072
  - Update the manual test case file with the automated_test reference
2836
3073
  - Create supporting artifacts: Page Objects, fixtures, helpers, components, types
2837
3074
 
2838
- 5. **Mandatory Application Exploration**: NEVER generate Page Objects without exploring the live application first using Playwright MCP tools:
3075
+ 5. **Mandatory Application Exploration**: NEVER generate Page Objects without exploring the live application first using playwright-cli:
2839
3076
  - Navigate to pages, authenticate, inspect elements
2840
3077
  - Capture screenshots for documentation
2841
3078
  - Document exact role names, labels, text, URLs
@@ -2866,7 +3103,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2866
3103
 
2867
3104
  **STEP 2: Build Missing Infrastructure** (if needed)
2868
3105
 
2869
- - **Explore feature under test**: Use Playwright MCP tools to:
3106
+ - **Explore feature under test**: Use playwright-cli to:
2870
3107
  * Navigate to the feature's pages
2871
3108
  * Inspect elements and gather selectors (role, label, text)
2872
3109
  * Document actual URLs from the browser
@@ -3073,8 +3310,8 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
3073
3310
  - Create test interdependencies - tests must be independent
3074
3311
 
3075
3312
  \u2705 **ALWAYS**:
3076
- - Explore application using Playwright MCP before generating code
3077
- - Verify selectors in live browser using browser_select tool
3313
+ - Explore application using playwright-cli before generating code
3314
+ - Verify selectors in live browser using playwright-cli snapshot
3078
3315
  - Document actual URLs from browser address bar
3079
3316
  - Take screenshots for documentation
3080
3317
  - Use role-based selectors as first priority
@@ -3147,7 +3384,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3147
3384
  - Brittle selectors (CSS classes, IDs that change)
3148
3385
 
3149
3386
  4. **Debug Using Browser**: When needed, explore the application manually:
3150
- - Use Playwright MCP to open browser
3387
+ - Use playwright-cli to open browser (\`playwright-cli open <url>\`)
3151
3388
  - Navigate to the relevant page
3152
3389
  - Inspect elements to find correct selectors
3153
3390
  - Manually perform test steps to understand actual behavior
@@ -3257,7 +3494,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3257
3494
  - Check for screenshot/trace file references
3258
3495
 
3259
3496
  **Step 3: Reproduce and Debug**
3260
- - Open browser via Playwright MCP if needed
3497
+ - Open browser via playwright-cli if needed (\`playwright-cli open <url>\`)
3261
3498
  - Navigate to relevant page
3262
3499
  - Manually execute test steps
3263
3500
  - Identify discrepancy between test expectations and actual behavior
@@ -3380,13 +3617,14 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3380
3617
  - NEVER read \`.env\` file (contains secrets only)
3381
3618
  - If test needs new environment variable, update \`.env.testdata\`
3382
3619
 
3383
- 9. **Using Playwright MCP for Debugging**:
3384
- - You have direct access to Playwright MCP
3385
- - Open browser: Request to launch Playwright
3386
- - Navigate: Go to URLs relevant to failing test
3387
- - Inspect elements: Find correct selectors
3388
- - Execute test steps manually: Understand actual behavior
3389
- - Close browser when done
3620
+ 9. **Using playwright-cli for Debugging**:
3621
+ - You have direct access to playwright-cli via Bash
3622
+ - Open browser: \`playwright-cli open <url>\`
3623
+ - Take snapshot: \`playwright-cli snapshot\` to get element refs (@e1, @e2, etc.)
3624
+ - Navigate: \`playwright-cli navigate <url>\`
3625
+ - Inspect elements: Use \`snapshot\` to find correct selectors and element refs
3626
+ - Execute test steps manually: Use \`click\`, \`fill\`, \`select\` commands
3627
+ - Close browser: \`playwright-cli close\`
3390
3628
 
3391
3629
  10. **Test Stability Best Practices**:
3392
3630
  - Replace all \`waitForTimeout()\` with specific waits
@@ -3683,6 +3921,24 @@ var CONTENT5 = `You are a Team Communication Specialist who communicates like a
3683
3921
 
3684
3922
  **Key Principle:** If it takes more than 30 seconds to read, it's too long.
3685
3923
 
3924
+ ## CRITICAL: Always Post Messages
3925
+
3926
+ When you are invoked, your job is to POST a message to Slack \u2014 not just compose one.
3927
+
3928
+ **You MUST call \`slack_post_message\` or \`slack_post_rich_message\`** to deliver the message. Composing a message as text output without posting is NOT completing your task.
3929
+
3930
+ **NEVER:**
3931
+ - Return a draft without posting it
3932
+ - Ask "should I post this?" \u2014 if you were invoked, the answer is yes
3933
+ - Compose text and wait for approval before posting
3934
+
3935
+ **ALWAYS:**
3936
+ 1. Identify the correct channel (from project-context.md or the invocation context)
3937
+ 2. Compose the message following the guidelines below
3938
+ 3. Call the Slack API tool to POST the message
3939
+ 4. If a thread reply is needed, post main message first, then reply in thread
3940
+ 5. Report back: channel name, message timestamp, and confirmation it was posted
3941
+
3686
3942
  ## Message Type Detection
3687
3943
 
3688
3944
  Before composing, identify the message type:
@@ -6070,202 +6326,6 @@ function getTemplate(role, integration) {
6070
6326
  return TEMPLATES[role]?.[integration];
6071
6327
  }
6072
6328
 
6073
- // src/subagents/metadata.ts
6074
- init_cjs_shims();
6075
- var INTEGRATIONS = {
6076
- linear: {
6077
- id: "linear",
6078
- name: "Linear",
6079
- provider: "linear",
6080
- requiredMCP: "mcp__linear__*",
6081
- integrationType: "oauth"
6082
- },
6083
- jira: {
6084
- id: "jira",
6085
- name: "Jira",
6086
- provider: "jira",
6087
- requiredMCP: "mcp__jira__*",
6088
- integrationType: "oauth"
6089
- },
6090
- "jira-server": {
6091
- id: "jira-server",
6092
- name: "Jira Server",
6093
- provider: "jira-server",
6094
- requiredMCP: "mcp__jira-server__*",
6095
- integrationType: "custom"
6096
- },
6097
- "azure-devops": {
6098
- id: "azure-devops",
6099
- name: "Azure DevOps",
6100
- provider: "azure-devops",
6101
- requiredMCP: "mcp__azure-devops__*",
6102
- integrationType: "oauth"
6103
- // Uses Nango with API key auth for PAT
6104
- },
6105
- notion: {
6106
- id: "notion",
6107
- name: "Notion",
6108
- provider: "notion",
6109
- requiredMCP: "mcp__notion__*",
6110
- integrationType: "oauth"
6111
- },
6112
- confluence: {
6113
- id: "confluence",
6114
- name: "Confluence",
6115
- provider: "confluence",
6116
- requiredMCP: "mcp__confluence__*",
6117
- integrationType: "oauth"
6118
- },
6119
- slack: {
6120
- id: "slack",
6121
- name: "Slack",
6122
- provider: "slack",
6123
- requiredMCP: "mcp__slack__*",
6124
- integrationType: "oauth"
6125
- },
6126
- playwright: {
6127
- id: "playwright",
6128
- name: "Playwright",
6129
- provider: "playwright",
6130
- requiredMCP: "mcp__playwright__*",
6131
- isLocal: true,
6132
- // Playwright runs locally, no external connector needed
6133
- integrationType: "local"
6134
- },
6135
- teams: {
6136
- id: "teams",
6137
- name: "Microsoft Teams",
6138
- provider: "teams",
6139
- requiredMCP: "mcp__teams__*",
6140
- integrationType: "oauth"
6141
- },
6142
- email: {
6143
- id: "email",
6144
- name: "Email",
6145
- provider: "resend",
6146
- requiredMCP: "mcp__resend__*",
6147
- integrationType: "local"
6148
- // Uses platform API key, no OAuth needed
6149
- },
6150
- github: {
6151
- id: "github",
6152
- name: "GitHub",
6153
- provider: "github",
6154
- requiredMCP: "mcp__github__*",
6155
- integrationType: "oauth"
6156
- },
6157
- local: {
6158
- id: "local",
6159
- name: "Local (Terminal)",
6160
- provider: "local",
6161
- // No requiredMCP - uses built-in Claude Code tools (AskUserQuestion, text output)
6162
- isLocal: true,
6163
- integrationType: "local"
6164
- }
6165
- };
6166
- var SUBAGENTS = {
6167
- "test-runner": {
6168
- role: "test-runner",
6169
- name: "Test Runner",
6170
- description: "Execute automated browser tests (always included)",
6171
- icon: "play",
6172
- integrations: [INTEGRATIONS.playwright],
6173
- model: "sonnet",
6174
- color: "green",
6175
- isRequired: true,
6176
- version: "1.0.0"
6177
- },
6178
- "team-communicator": {
6179
- role: "team-communicator",
6180
- name: "Team Communicator",
6181
- description: "Send notifications and updates to your team",
6182
- icon: "message-square",
6183
- integrations: [INTEGRATIONS.slack, INTEGRATIONS.teams, INTEGRATIONS.email],
6184
- model: "sonnet",
6185
- color: "blue",
6186
- isRequired: true,
6187
- // Required - CLI uses 'local' (auto-configured), cloud uses email fallback
6188
- defaultIntegration: "email",
6189
- // Email fallback for cloud (CLI auto-configures 'local' separately)
6190
- version: "1.0.0"
6191
- },
6192
- "issue-tracker": {
6193
- role: "issue-tracker",
6194
- name: "Issue Tracker",
6195
- description: "Automatically create and track bugs and issues",
6196
- icon: "bot",
6197
- integrations: [
6198
- // INTEGRATIONS.linear,
6199
- INTEGRATIONS.jira,
6200
- INTEGRATIONS["jira-server"],
6201
- INTEGRATIONS["azure-devops"],
6202
- INTEGRATIONS.notion,
6203
- INTEGRATIONS.slack
6204
- ],
6205
- model: "sonnet",
6206
- color: "red",
6207
- version: "1.0.0"
6208
- },
6209
- "documentation-researcher": {
6210
- role: "documentation-researcher",
6211
- name: "Documentation Researcher",
6212
- description: "Search and retrieve information from your documentation",
6213
- icon: "file-search",
6214
- integrations: [
6215
- INTEGRATIONS.notion,
6216
- INTEGRATIONS.jira
6217
- // INTEGRATIONS.confluence
6218
- ],
6219
- model: "sonnet",
6220
- color: "cyan",
6221
- version: "1.0.0"
6222
- },
6223
- "test-code-generator": {
6224
- role: "test-code-generator",
6225
- name: "Test Code Generator",
6226
- description: "Generate automated Playwright test scripts and Page Objects",
6227
- icon: "code",
6228
- integrations: [INTEGRATIONS.playwright],
6229
- model: "sonnet",
6230
- color: "purple",
6231
- isRequired: true,
6232
- // Required for automated test generation
6233
- version: "1.0.0"
6234
- },
6235
- "test-debugger-fixer": {
6236
- role: "test-debugger-fixer",
6237
- name: "Test Debugger & Fixer",
6238
- description: "Debug and fix failing automated tests automatically",
6239
- icon: "wrench",
6240
- integrations: [INTEGRATIONS.playwright],
6241
- model: "sonnet",
6242
- color: "yellow",
6243
- isRequired: true,
6244
- // Required for automated test execution and fixing
6245
- version: "1.0.0"
6246
- },
6247
- "changelog-historian": {
6248
- role: "changelog-historian",
6249
- name: "Changelog Historian",
6250
- description: "Retrieves and analyzes code changes from GitHub PRs and commits",
6251
- icon: "git-pull-request",
6252
- integrations: [INTEGRATIONS.github],
6253
- model: "haiku",
6254
- color: "gray",
6255
- isRequired: false,
6256
- version: "1.0.0"
6257
- }
6258
- };
6259
- function getAllSubAgents() {
6260
- return Object.values(SUBAGENTS);
6261
- }
6262
- function getIntegration(integrationId) {
6263
- return INTEGRATIONS[integrationId];
6264
- }
6265
- function getRequiredSubAgents() {
6266
- return Object.values(SUBAGENTS).filter((agent) => agent.isRequired);
6267
- }
6268
-
6269
6329
  // src/subagents/index.ts
6270
6330
  function buildSubagentConfig(role, integration) {
6271
6331
  const template = getTemplate(role, integration);
@@ -6467,6 +6527,8 @@ Before proceeding, read the curated knowledge base to inform your work:
6467
6527
  - Build on existing understanding
6468
6528
  - Maintain consistency with established practices
6469
6529
 
6530
+ 3. **Relay to subagents**: Subagents do NOT read the knowledge base directly. When delegating work, you MUST include relevant KB patterns in your delegation message \u2014 especially testing patterns (timing, selectors, assertion approaches) that affect test reliability.
6531
+
6470
6532
  **Note:** The knowledge base may not exist yet or may be empty. If it doesn't exist or is empty, proceed without this context and help build it as you work.`,
6471
6533
  tags: ["setup", "context"]
6472
6534
  };
@@ -6618,7 +6680,9 @@ If the Clarification Protocol determined project maturity, adjust exploration de
6618
6680
  - **Growing project**: Use requirement clarity as-is (standard protocol)
6619
6681
  - **Mature project**: Trust knowledge base \u2014 can stay at suggested depth or go one level shallower if KB covers the feature
6620
6682
 
6621
- **Always verify features exist before testing them.** If exploration reveals that a referenced page or feature does not exist in the application, this is CRITICAL severity \u2014 escalate via the Clarification Protocol regardless of maturity level. Do NOT silently adapt or work around the missing feature.
6683
+ **Always verify features exist before testing them.** If exploration reveals that a referenced page or feature does not exist in the application, apply the Clarification Protocol's "Execution Obstacle vs. Requirement Ambiguity" principle:
6684
+ - If an authoritative trigger source (Jira issue, PR, team request) asserts the feature exists, this is likely an **execution obstacle** (missing credentials, feature flags, environment config) \u2014 proceed with test artifact creation and notify the team about the access issue. Do NOT BLOCK.
6685
+ - If NO authoritative source claims the feature exists, this is **CRITICAL severity** \u2014 escalate via the Clarification Protocol regardless of maturity level. Do NOT silently adapt or work around the missing feature.
6622
6686
 
6623
6687
  ### Quick Exploration (1-2 min)
6624
6688
 
@@ -6905,11 +6969,56 @@ If ambiguity is detected, assess its severity:
6905
6969
 
6906
6970
  | Severity | Characteristics | Examples | Action |
6907
6971
  |----------|----------------|----------|--------|
6908
- | **CRITICAL** | Expected behavior undefined/contradictory; test outcome unpredictable; core functionality unclear; success criteria missing; multiple interpretations = different strategies; **referenced page/feature does not exist in the application** | "Fix the issue" (what issue?), "Improve performance" (which metrics?), "Fix sorting in todo list" (by date? priority? completion status?), "Test the Settings page" (no Settings page exists), "Verify the checkout flow" (no checkout page found) | **STOP** - You MUST ask via team-communicator before proceeding |
6972
+ | **CRITICAL** | Expected behavior undefined/contradictory; test outcome unpredictable; core functionality unclear; success criteria missing; multiple interpretations = different strategies; **referenced page/feature confirmed absent after browser verification AND no authoritative trigger source (Jira, PR, team request) asserts the feature exists** | "Fix the issue" (what issue?), "Improve performance" (which metrics?), "Fix sorting in todo list" (by date? priority? completion status?), "Test the Settings page" (browsed app \u2014 no Settings page exists, and no Jira/PR claims it was built) | **STOP** - You MUST ask via team-communicator before proceeding |
6909
6973
  | **HIGH** | Core underspecified but direction clear; affects majority of scenarios; vague success criteria; assumptions risky | "Fix ordering" (sequence OR visibility?), "Add validation" (what? messages?), "Update dashboard" (which widgets?) | **STOP** - You MUST ask via team-communicator before proceeding |
6910
6974
  | **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] |
6911
6975
  | **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 |
6912
6976
 
6977
+ ### Execution Obstacle vs. Requirement Ambiguity
6978
+
6979
+ Before classifying something as CRITICAL, distinguish between these two fundamentally different situations:
6980
+
6981
+ **Requirement Ambiguity** = *What* to test is unclear \u2192 severity assessment applies normally
6982
+ - No authoritative source describes the feature
6983
+ - The task description is vague or contradictory
6984
+ - You cannot determine what "correct" behavior looks like
6985
+ - \u2192 Apply severity table above. CRITICAL/HIGH \u2192 BLOCK.
6986
+
6987
+ **Execution Obstacle** = *What* to test is clear, but *how* to access/verify has obstacles \u2192 NEVER BLOCK
6988
+ - An authoritative trigger source (Jira issue, PR, team message) asserts the feature exists
6989
+ - You browsed the app but couldn't find/access the feature
6990
+ - The obstacle is likely: wrong user role/tier, missing test data, feature flags, environment config
6991
+ - \u2192 PROCEED with artifact creation (test cases, test specs). Notify team about the obstacle.
6992
+
6993
+ **The key test:** Does an authoritative trigger source (Jira, PR, team request) assert the feature exists?
6994
+ - **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.
6995
+ - **NO** \u2192 It may genuinely not exist. Apply CRITICAL severity, ask what was meant.
6996
+
6997
+ | Scenario | Trigger Says | Browser Shows | Classification | Action |
6998
+ |----------|-------------|---------------|----------------|--------|
6999
+ | 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 |
7000
+ | 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 |
7001
+ | 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 |
7002
+ | Jira says "fix sorting", but doesn't specify sort criteria | Feature exists | Feature exists | **Requirement ambiguity (HIGH)** | BLOCK, ask which sort criteria |
7003
+
7004
+ **Partial Feature Existence \u2014 URL found but requested functionality absent:**
7005
+
7006
+ A common edge case: a page/route loads successfully, but the SPECIFIC FUNCTIONALITY you were asked to test doesn't exist on it.
7007
+
7008
+ **Rule:** Evaluate whether the REQUESTED FUNCTIONALITY exists, not just whether a URL resolves.
7009
+
7010
+ | Page Exists | Requested Features Exist | Authoritative Trigger | Classification |
7011
+ |-------------|--------------------------|----------------------|----------------|
7012
+ | Yes | Yes | Any | Proceed normally |
7013
+ | Yes | No | Yes (Jira/PR says features built) | Execution obstacle \u2014 features behind flag/env |
7014
+ | Yes | No | No (manual request only) | **Requirement ambiguity (CRITICAL)** \u2014 ask what's expected |
7015
+ | No | N/A | Yes | Execution obstacle \u2014 page not deployed yet |
7016
+ | No | N/A | No | **Requirement ambiguity (CRITICAL)** \u2014 ask what was meant |
7017
+
7018
+ **Example:** Prompt says "Test the checkout payment form with credit card 4111..." You browse to /checkout and find an information form (first name, last name, postal code) but NO payment form, NO shipping options, NO Place Order button. No Jira/PR claims these features exist. \u2192 **CRITICAL requirement ambiguity.** Ask: "I found a checkout information form at /checkout but no payment form or shipping options. Can you clarify what checkout features you'd like tested?"
7019
+
7020
+ **Key insight:** Finding a URL is not the same as finding the requested functionality. Do NOT classify this as an "execution obstacle" just because the page loads.
7021
+
6913
7022
  ### Check Memory for Similar Clarifications
6914
7023
 
6915
7024
  Before asking, check if similar question was answered:
@@ -7055,7 +7164,7 @@ When reporting test results, always include an "Ambiguities" section if clarific
7055
7164
  ## Remember
7056
7165
 
7057
7166
  - **STOP means STOP** - When you hit a STOP threshold, you MUST call team-communicator to ask via Slack. Do NOT silently adapt, skip, or work around the issue
7058
- - **Non-existent features = CRITICAL** - If a page, component, or feature referenced in the task does not exist, this is always CRITICAL severity \u2014 ask what was meant
7167
+ - **Non-existent features \u2014 check context first** - If a page/feature doesn't exist in the browser, check whether an authoritative trigger (Jira, PR, team request) asserts it exists. If YES \u2192 execution obstacle (proceed with artifact creation, notify team). If NO authoritative source claims it exists \u2192 CRITICAL severity, ask what was meant
7059
7168
  - **Ask correctly > guess poorly** - Specific questions lead to specific answers
7060
7169
  - **Never invent success criteria** - If the task says "improve" or "fix" without metrics, ask what "done" looks like
7061
7170
  - **Check memory first** - Avoid re-asking previously answered questions
@@ -7999,8 +8108,10 @@ function buildComposedTaskDefinition(taskSlug, projectSubAgents) {
7999
8108
  const configured = projectSubAgents.find((sa) => sa.role === role);
8000
8109
  if (configured) {
8001
8110
  const integrationMeta = getIntegration(configured.integration);
8002
- const mcpProvider = integrationMeta?.provider || configured.integration;
8003
- requiredMCPs.add(mcpProvider);
8111
+ if (integrationMeta?.requiredMCP) {
8112
+ const mcpProvider = integrationMeta.provider || configured.integration;
8113
+ requiredMCPs.add(mcpProvider);
8114
+ }
8004
8115
  }
8005
8116
  }
8006
8117
  const content = contentParts.join("\n\n");
@@ -8255,31 +8366,6 @@ var MCP_SERVERS = {
8255
8366
  }
8256
8367
  }
8257
8368
  },
8258
- playwright: {
8259
- provider: "playwright",
8260
- name: "Playwright",
8261
- description: "Playwright MCP server for browser automation",
8262
- requiresCredentials: false,
8263
- npmPackages: ["@playwright/mcp"],
8264
- config: {
8265
- command: "playwright-mcp",
8266
- args: [
8267
- "--browser",
8268
- "chromium",
8269
- "--secrets",
8270
- ".env",
8271
- "--no-sandbox",
8272
- "--viewport-size",
8273
- "1280x720"
8274
- ]
8275
- },
8276
- containerExtensions: {
8277
- args: ["--headless"],
8278
- env: {
8279
- PLAYWRIGHT_BROWSERS_PATH: "/opt/ms-playwright"
8280
- }
8281
- }
8282
- },
8283
8369
  notion: {
8284
8370
  provider: "notion",
8285
8371
  name: "Notion",