@bugzy-ai/bugzy 1.13.1 → 1.14.1

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.
@@ -697,7 +697,28 @@ The handler file contains all necessary processing logic for the detected intent
697
697
  - Response guidelines
698
698
  - Memory update instructions`
699
699
  },
700
- // Step 6: Clarification Protocol (for ambiguous intents)
700
+ // Step 6: Post Response via Team Communicator
701
+ {
702
+ inline: true,
703
+ title: "Post Response to Team",
704
+ content: `## Post Response to the Team
705
+
706
+ After processing the message through the handler and composing your response:
707
+
708
+ {{INVOKE_TEAM_COMMUNICATOR}} to post the response back to the team.
709
+
710
+ **Context to include in the delegation:**
711
+ - The original message/question from the team member
712
+ - Your composed response with all gathered data
713
+ - Whether this should be a thread reply (if the original message was in a thread) or a new message
714
+ - The relevant channel (from project-context.md)
715
+
716
+ **Do NOT:**
717
+ - Skip posting and just display the response as text output
718
+ - Ask the user whether to post \u2014 the message came from the team, the response goes back to the team
719
+ - Compose a draft without sending it`
720
+ },
721
+ // Step 7: Clarification Protocol (for ambiguous intents)
701
722
  "clarification-protocol",
702
723
  // Step 8: Knowledge Base Update (library)
703
724
  "update-knowledge-base",
@@ -1500,6 +1521,40 @@ The input format determines the trigger source and context extraction strategy.`
1500
1521
  Store the detected trigger for use in output routing:
1501
1522
  - Set variable: \`TRIGGER_SOURCE\` = [GITHUB_PR | SLACK_MESSAGE | CI_CD | MANUAL]
1502
1523
  - This determines output formatting and delivery channel`
1524
+ },
1525
+ // Step 5c: Coverage Gap vs. Ambiguity (inline)
1526
+ {
1527
+ inline: true,
1528
+ title: "Coverage Gap vs. Ambiguity",
1529
+ content: `### Coverage Gap vs. Ambiguity
1530
+
1531
+ When the trigger indicates a feature has been implemented and is ready for testing (Jira "Ready to Test", PR merged, CI/CD pipeline):
1532
+
1533
+ **Missing test coverage for the referenced feature is a COVERAGE GAP, not an ambiguity.**
1534
+
1535
+ - The developer/team is asserting the feature exists and is ready for testing
1536
+ - "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
1537
+ - Do NOT classify as CRITICAL based on stale documentation or knowledge base gaps
1538
+ - If project-context.md or the Jira issue references the feature, assume it exists until browser exploration proves otherwise
1539
+ - Coverage gaps are handled in the "Create Tests for Coverage Gaps" step below \u2014 do NOT block here
1540
+
1541
+ ### If You Browse the App and Cannot Find the Referenced Feature
1542
+
1543
+ Apply the Clarification Protocol's **"Execution Obstacle vs. Requirement Ambiguity"** principle:
1544
+
1545
+ 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:
1546
+ - **Missing role/tier**: You're logged in as a basic user but the feature requires admin/premium access
1547
+ - **Missing test data**: Required test accounts or data haven't been configured in \`.env.testdata\`
1548
+ - **Feature flags**: The feature is behind a flag not enabled in the test environment
1549
+ - **Environment config**: The feature requires specific environment variables or deployment settings
1550
+
1551
+ **Action: PROCEED to "Create Tests for Coverage Gaps".** Do NOT BLOCK.
1552
+ - Create test cases and specs that reference the feature as described in the trigger
1553
+ - Add placeholder env vars to \`.env.testdata\` for any missing credentials
1554
+ - Notify the team (via team-communicator) about the access obstacle and what needs to be configured
1555
+ - Tests may fail until the obstacle is resolved \u2014 this is expected and acceptable
1556
+
1557
+ **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.`
1503
1558
  },
1504
1559
  // Step 6: Clarification Protocol (library)
1505
1560
  "clarification-protocol",
@@ -2365,6 +2420,204 @@ function validateEnvVars(mcpServers, envVars) {
2365
2420
  init_cjs_shims();
2366
2421
  var fs3 = __toESM(require("fs"), 1);
2367
2422
  var path3 = __toESM(require("path"), 1);
2423
+
2424
+ // src/subagents/metadata.ts
2425
+ init_cjs_shims();
2426
+ var INTEGRATIONS = {
2427
+ linear: {
2428
+ id: "linear",
2429
+ name: "Linear",
2430
+ provider: "linear",
2431
+ requiredMCP: "mcp__linear__*",
2432
+ integrationType: "oauth"
2433
+ },
2434
+ jira: {
2435
+ id: "jira",
2436
+ name: "Jira",
2437
+ provider: "jira",
2438
+ requiredMCP: "mcp__jira__*",
2439
+ integrationType: "oauth"
2440
+ },
2441
+ "jira-server": {
2442
+ id: "jira-server",
2443
+ name: "Jira Server",
2444
+ provider: "jira-server",
2445
+ requiredMCP: "mcp__jira-server__*",
2446
+ integrationType: "custom"
2447
+ },
2448
+ "azure-devops": {
2449
+ id: "azure-devops",
2450
+ name: "Azure DevOps",
2451
+ provider: "azure-devops",
2452
+ requiredMCP: "mcp__azure-devops__*",
2453
+ integrationType: "oauth"
2454
+ // Uses Nango with API key auth for PAT
2455
+ },
2456
+ notion: {
2457
+ id: "notion",
2458
+ name: "Notion",
2459
+ provider: "notion",
2460
+ requiredMCP: "mcp__notion__*",
2461
+ integrationType: "oauth"
2462
+ },
2463
+ confluence: {
2464
+ id: "confluence",
2465
+ name: "Confluence",
2466
+ provider: "confluence",
2467
+ requiredMCP: "mcp__confluence__*",
2468
+ integrationType: "oauth"
2469
+ },
2470
+ slack: {
2471
+ id: "slack",
2472
+ name: "Slack",
2473
+ provider: "slack",
2474
+ requiredMCP: "mcp__slack__*",
2475
+ integrationType: "oauth"
2476
+ },
2477
+ playwright: {
2478
+ id: "playwright",
2479
+ name: "Playwright",
2480
+ provider: "playwright",
2481
+ // No requiredMCP — uses playwright-cli (CLI tool), not MCP server
2482
+ isLocal: true,
2483
+ // Playwright runs locally, no external connector needed
2484
+ integrationType: "local"
2485
+ },
2486
+ teams: {
2487
+ id: "teams",
2488
+ name: "Microsoft Teams",
2489
+ provider: "teams",
2490
+ requiredMCP: "mcp__teams__*",
2491
+ integrationType: "oauth"
2492
+ },
2493
+ email: {
2494
+ id: "email",
2495
+ name: "Email",
2496
+ provider: "resend",
2497
+ requiredMCP: "mcp__resend__*",
2498
+ integrationType: "local"
2499
+ // Uses platform API key, no OAuth needed
2500
+ },
2501
+ github: {
2502
+ id: "github",
2503
+ name: "GitHub",
2504
+ provider: "github",
2505
+ requiredMCP: "mcp__github__*",
2506
+ integrationType: "oauth"
2507
+ },
2508
+ local: {
2509
+ id: "local",
2510
+ name: "Local (Terminal)",
2511
+ provider: "local",
2512
+ // No requiredMCP - uses built-in Claude Code tools (AskUserQuestion, text output)
2513
+ isLocal: true,
2514
+ integrationType: "local"
2515
+ }
2516
+ };
2517
+ var SUBAGENTS = {
2518
+ "test-runner": {
2519
+ role: "test-runner",
2520
+ name: "Test Runner",
2521
+ description: "Execute automated browser tests (always included)",
2522
+ icon: "play",
2523
+ integrations: [INTEGRATIONS.playwright],
2524
+ model: "sonnet",
2525
+ color: "green",
2526
+ isRequired: true,
2527
+ version: "1.0.0"
2528
+ },
2529
+ "team-communicator": {
2530
+ role: "team-communicator",
2531
+ name: "Team Communicator",
2532
+ description: "Send notifications and updates to your team",
2533
+ icon: "message-square",
2534
+ integrations: [INTEGRATIONS.slack, INTEGRATIONS.teams, INTEGRATIONS.email],
2535
+ model: "sonnet",
2536
+ color: "blue",
2537
+ isRequired: true,
2538
+ // Required - CLI uses 'local' (auto-configured), cloud uses email fallback
2539
+ defaultIntegration: "email",
2540
+ // Email fallback for cloud (CLI auto-configures 'local' separately)
2541
+ version: "1.0.0"
2542
+ },
2543
+ "issue-tracker": {
2544
+ role: "issue-tracker",
2545
+ name: "Issue Tracker",
2546
+ description: "Automatically create and track bugs and issues",
2547
+ icon: "bot",
2548
+ integrations: [
2549
+ // INTEGRATIONS.linear,
2550
+ INTEGRATIONS.jira,
2551
+ INTEGRATIONS["jira-server"],
2552
+ INTEGRATIONS["azure-devops"],
2553
+ INTEGRATIONS.notion,
2554
+ INTEGRATIONS.slack
2555
+ ],
2556
+ model: "sonnet",
2557
+ color: "red",
2558
+ version: "1.0.0"
2559
+ },
2560
+ "documentation-researcher": {
2561
+ role: "documentation-researcher",
2562
+ name: "Documentation Researcher",
2563
+ description: "Search and retrieve information from your documentation",
2564
+ icon: "file-search",
2565
+ integrations: [
2566
+ INTEGRATIONS.notion,
2567
+ INTEGRATIONS.jira
2568
+ // INTEGRATIONS.confluence
2569
+ ],
2570
+ model: "sonnet",
2571
+ color: "cyan",
2572
+ version: "1.0.0"
2573
+ },
2574
+ "test-code-generator": {
2575
+ role: "test-code-generator",
2576
+ name: "Test Code Generator",
2577
+ description: "Generate automated Playwright test scripts and Page Objects",
2578
+ icon: "code",
2579
+ integrations: [INTEGRATIONS.playwright],
2580
+ model: "sonnet",
2581
+ color: "purple",
2582
+ isRequired: true,
2583
+ // Required for automated test generation
2584
+ version: "1.0.0"
2585
+ },
2586
+ "test-debugger-fixer": {
2587
+ role: "test-debugger-fixer",
2588
+ name: "Test Debugger & Fixer",
2589
+ description: "Debug and fix failing automated tests automatically",
2590
+ icon: "wrench",
2591
+ integrations: [INTEGRATIONS.playwright],
2592
+ model: "sonnet",
2593
+ color: "yellow",
2594
+ isRequired: true,
2595
+ // Required for automated test execution and fixing
2596
+ version: "1.0.0"
2597
+ },
2598
+ "changelog-historian": {
2599
+ role: "changelog-historian",
2600
+ name: "Changelog Historian",
2601
+ description: "Retrieves and analyzes code changes from GitHub PRs and commits",
2602
+ icon: "git-pull-request",
2603
+ integrations: [INTEGRATIONS.github],
2604
+ model: "haiku",
2605
+ color: "gray",
2606
+ isRequired: false,
2607
+ version: "1.0.0"
2608
+ }
2609
+ };
2610
+ function getAllSubAgents() {
2611
+ return Object.values(SUBAGENTS);
2612
+ }
2613
+ function getIntegration(integrationId) {
2614
+ return INTEGRATIONS[integrationId];
2615
+ }
2616
+ function getRequiredSubAgents() {
2617
+ return Object.values(SUBAGENTS).filter((agent) => agent.isRequired);
2618
+ }
2619
+
2620
+ // src/cli/utils/validation.ts
2368
2621
  async function validateProjectStructure() {
2369
2622
  const config = await loadConfig();
2370
2623
  const tool = config ? getToolFromConfig(config) : DEFAULT_TOOL;
@@ -2427,7 +2680,10 @@ async function checkToolAvailable(command) {
2427
2680
  function getRequiredMCPs(subagents) {
2428
2681
  const mcps = /* @__PURE__ */ new Set();
2429
2682
  for (const [_role, integration] of Object.entries(subagents)) {
2430
- mcps.add(integration);
2683
+ const integrationMeta = getIntegration(integration);
2684
+ if (integrationMeta?.requiredMCP) {
2685
+ mcps.add(integration);
2686
+ }
2431
2687
  }
2432
2688
  return Array.from(mcps);
2433
2689
  }
@@ -2615,7 +2871,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2615
2871
 
2616
2872
  3. **Environment Setup**: Before test execution:
2617
2873
  - Read \`.env.testdata\` to get non-secret environment variable values (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.)
2618
- - For secrets, variable names will be passed to Playwright MCP which reads them from .env at runtime
2874
+ - For secrets, variable names are available as environment variables (playwright-cli inherits the process environment)
2619
2875
 
2620
2876
  4. **Test Case Parsing**: You will receive a test case file path. Parse the test case to extract:
2621
2877
  - Test steps and actions to perform
@@ -2623,16 +2879,16 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2623
2879
  - Test data and input values (replace any \${TEST_*} or $TEST_* variables with actual values from .env)
2624
2880
  - Preconditions and setup requirements
2625
2881
 
2626
- 5. **Browser Automation Execution**: Using the Playwright MCP server:
2627
- - Launch a browser instance with appropriate configuration
2628
- - Execute each test step sequentially
2882
+ 5. **Browser Automation Execution**: Using playwright-cli (CLI-based browser automation):
2883
+ - Launch a browser: \`playwright-cli open <url>\`
2884
+ - Execute each test step sequentially using CLI commands: \`click\`, \`fill\`, \`select\`, \`hover\`, etc.
2885
+ - Use \`snapshot\` to inspect page state and find element references (@e1, @e2, etc.)
2629
2886
  - Handle dynamic waits and element interactions intelligently
2630
2887
  - Manage browser state between steps
2631
2888
  - **IMPORTANT - Environment Variable Handling**:
2632
2889
  - When test cases contain environment variables:
2633
2890
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL): Read actual values from .env.testdata and use them directly
2634
- - For secrets (TEST_OWNER_PASSWORD, API keys): Pass variable name to Playwright MCP for runtime substitution
2635
- - Playwright MCP automatically reads .env for secrets and injects them at runtime
2891
+ - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits environment variables from the process
2636
2892
  - Example: Test says "Navigate to TEST_BASE_URL/login" \u2192 Read TEST_BASE_URL from .env.testdata, use the actual URL
2637
2893
 
2638
2894
  6. **Evidence Collection at Each Step**:
@@ -2657,7 +2913,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2657
2913
  - \`steps.json\`: Structured steps with timestamps, video time synchronization, and detailed descriptions (see schema)
2658
2914
 
2659
2915
  Video handling:
2660
- - Playwright automatically saves videos to \`.playwright-mcp/\` folder
2916
+ - Videos are automatically saved to \`.playwright-mcp/\` folder via PLAYWRIGHT_MCP_SAVE_VIDEO env var
2661
2917
  - Find the latest video: \`ls -t .playwright-mcp/*.webm 2>/dev/null | head -1\`
2662
2918
  - Store ONLY the filename in summary.json: \`{ "video": { "filename": "basename.webm" } }\`
2663
2919
  - Do NOT copy, move, or delete video files - external service handles uploads
@@ -2696,8 +2952,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2696
2952
  - Identify all TEST_* variable references (e.g., TEST_BASE_URL, TEST_OWNER_EMAIL, TEST_OWNER_PASSWORD)
2697
2953
  - Read .env.testdata to get actual values for non-secret variables
2698
2954
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly in test execution
2699
- - For secrets (TEST_OWNER_PASSWORD, API keys, etc.): Pass variable names to Playwright MCP for runtime injection from .env
2700
- - Playwright MCP will read .env and inject secret values during browser automation
2955
+ - For secrets (TEST_OWNER_PASSWORD, API keys, etc.): playwright-cli inherits env vars from the process environment
2701
2956
  - If a required variable is not found in .env.testdata, log a warning but continue
2702
2957
 
2703
2958
  5. Extract execution ID from the execution environment:
@@ -2711,7 +2966,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2711
2966
  - Describe what action will be performed (communicate to user)
2712
2967
  - Log the step being executed with timestamp
2713
2968
  - Calculate elapsed time from test start (for videoTimeSeconds)
2714
- - Execute the action using Playwright's robust selectors
2969
+ - Execute the action using playwright-cli commands (click, fill, select, etc. with element refs)
2715
2970
  - Wait for page stability
2716
2971
  - Validate expected behavior
2717
2972
  - Record findings and actual behavior
@@ -2786,12 +3041,11 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2786
3041
  **Environment Variable Handling:**
2787
3042
  - Read .env.testdata at the start of execution to get non-secret environment variables
2788
3043
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly
2789
- - For secrets (TEST_OWNER_PASSWORD, API keys): Pass variable names to Playwright MCP for runtime injection
2790
- - Playwright MCP reads .env for secrets and injects them during browser automation
3044
+ - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits env vars from the process environment
2791
3045
  - DO NOT read .env yourself (security policy - it contains only secrets)
2792
3046
  - DO NOT make up fake values or fallbacks
2793
3047
  - If a variable is missing from .env.testdata, log a warning
2794
- - If Playwright MCP reports a secret is missing/empty, that indicates .env is misconfigured
3048
+ - If a secret env var is missing/empty, that indicates .env is misconfigured
2795
3049
  - Document which environment variables were used in the test run summary
2796
3050
 
2797
3051
  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.`;
@@ -2839,7 +3093,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2839
3093
  - Update the manual test case file with the automated_test reference
2840
3094
  - Create supporting artifacts: Page Objects, fixtures, helpers, components, types
2841
3095
 
2842
- 5. **Mandatory Application Exploration**: NEVER generate Page Objects without exploring the live application first using Playwright MCP tools:
3096
+ 5. **Mandatory Application Exploration**: NEVER generate Page Objects without exploring the live application first using playwright-cli:
2843
3097
  - Navigate to pages, authenticate, inspect elements
2844
3098
  - Capture screenshots for documentation
2845
3099
  - Document exact role names, labels, text, URLs
@@ -2870,7 +3124,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2870
3124
 
2871
3125
  **STEP 2: Build Missing Infrastructure** (if needed)
2872
3126
 
2873
- - **Explore feature under test**: Use Playwright MCP tools to:
3127
+ - **Explore feature under test**: Use playwright-cli to:
2874
3128
  * Navigate to the feature's pages
2875
3129
  * Inspect elements and gather selectors (role, label, text)
2876
3130
  * Document actual URLs from the browser
@@ -3077,8 +3331,8 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
3077
3331
  - Create test interdependencies - tests must be independent
3078
3332
 
3079
3333
  \u2705 **ALWAYS**:
3080
- - Explore application using Playwright MCP before generating code
3081
- - Verify selectors in live browser using browser_select tool
3334
+ - Explore application using playwright-cli before generating code
3335
+ - Verify selectors in live browser using playwright-cli snapshot
3082
3336
  - Document actual URLs from browser address bar
3083
3337
  - Take screenshots for documentation
3084
3338
  - Use role-based selectors as first priority
@@ -3151,7 +3405,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3151
3405
  - Brittle selectors (CSS classes, IDs that change)
3152
3406
 
3153
3407
  4. **Debug Using Browser**: When needed, explore the application manually:
3154
- - Use Playwright MCP to open browser
3408
+ - Use playwright-cli to open browser (\`playwright-cli open <url>\`)
3155
3409
  - Navigate to the relevant page
3156
3410
  - Inspect elements to find correct selectors
3157
3411
  - Manually perform test steps to understand actual behavior
@@ -3261,7 +3515,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3261
3515
  - Check for screenshot/trace file references
3262
3516
 
3263
3517
  **Step 3: Reproduce and Debug**
3264
- - Open browser via Playwright MCP if needed
3518
+ - Open browser via playwright-cli if needed (\`playwright-cli open <url>\`)
3265
3519
  - Navigate to relevant page
3266
3520
  - Manually execute test steps
3267
3521
  - Identify discrepancy between test expectations and actual behavior
@@ -3384,13 +3638,14 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3384
3638
  - NEVER read \`.env\` file (contains secrets only)
3385
3639
  - If test needs new environment variable, update \`.env.testdata\`
3386
3640
 
3387
- 9. **Using Playwright MCP for Debugging**:
3388
- - You have direct access to Playwright MCP
3389
- - Open browser: Request to launch Playwright
3390
- - Navigate: Go to URLs relevant to failing test
3391
- - Inspect elements: Find correct selectors
3392
- - Execute test steps manually: Understand actual behavior
3393
- - Close browser when done
3641
+ 9. **Using playwright-cli for Debugging**:
3642
+ - You have direct access to playwright-cli via Bash
3643
+ - Open browser: \`playwright-cli open <url>\`
3644
+ - Take snapshot: \`playwright-cli snapshot\` to get element refs (@e1, @e2, etc.)
3645
+ - Navigate: \`playwright-cli navigate <url>\`
3646
+ - Inspect elements: Use \`snapshot\` to find correct selectors and element refs
3647
+ - Execute test steps manually: Use \`click\`, \`fill\`, \`select\` commands
3648
+ - Close browser: \`playwright-cli close\`
3394
3649
 
3395
3650
  10. **Test Stability Best Practices**:
3396
3651
  - Replace all \`waitForTimeout()\` with specific waits
@@ -3687,6 +3942,24 @@ var CONTENT5 = `You are a Team Communication Specialist who communicates like a
3687
3942
 
3688
3943
  **Key Principle:** If it takes more than 30 seconds to read, it's too long.
3689
3944
 
3945
+ ## CRITICAL: Always Post Messages
3946
+
3947
+ When you are invoked, your job is to POST a message to Slack \u2014 not just compose one.
3948
+
3949
+ **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.
3950
+
3951
+ **NEVER:**
3952
+ - Return a draft without posting it
3953
+ - Ask "should I post this?" \u2014 if you were invoked, the answer is yes
3954
+ - Compose text and wait for approval before posting
3955
+
3956
+ **ALWAYS:**
3957
+ 1. Identify the correct channel (from project-context.md or the invocation context)
3958
+ 2. Compose the message following the guidelines below
3959
+ 3. Call the Slack API tool to POST the message
3960
+ 4. If a thread reply is needed, post main message first, then reply in thread
3961
+ 5. Report back: channel name, message timestamp, and confirmation it was posted
3962
+
3690
3963
  ## Message Type Detection
3691
3964
 
3692
3965
  Before composing, identify the message type:
@@ -6074,202 +6347,6 @@ function getTemplate(role, integration) {
6074
6347
  return TEMPLATES[role]?.[integration];
6075
6348
  }
6076
6349
 
6077
- // src/subagents/metadata.ts
6078
- init_cjs_shims();
6079
- var INTEGRATIONS = {
6080
- linear: {
6081
- id: "linear",
6082
- name: "Linear",
6083
- provider: "linear",
6084
- requiredMCP: "mcp__linear__*",
6085
- integrationType: "oauth"
6086
- },
6087
- jira: {
6088
- id: "jira",
6089
- name: "Jira",
6090
- provider: "jira",
6091
- requiredMCP: "mcp__jira__*",
6092
- integrationType: "oauth"
6093
- },
6094
- "jira-server": {
6095
- id: "jira-server",
6096
- name: "Jira Server",
6097
- provider: "jira-server",
6098
- requiredMCP: "mcp__jira-server__*",
6099
- integrationType: "custom"
6100
- },
6101
- "azure-devops": {
6102
- id: "azure-devops",
6103
- name: "Azure DevOps",
6104
- provider: "azure-devops",
6105
- requiredMCP: "mcp__azure-devops__*",
6106
- integrationType: "oauth"
6107
- // Uses Nango with API key auth for PAT
6108
- },
6109
- notion: {
6110
- id: "notion",
6111
- name: "Notion",
6112
- provider: "notion",
6113
- requiredMCP: "mcp__notion__*",
6114
- integrationType: "oauth"
6115
- },
6116
- confluence: {
6117
- id: "confluence",
6118
- name: "Confluence",
6119
- provider: "confluence",
6120
- requiredMCP: "mcp__confluence__*",
6121
- integrationType: "oauth"
6122
- },
6123
- slack: {
6124
- id: "slack",
6125
- name: "Slack",
6126
- provider: "slack",
6127
- requiredMCP: "mcp__slack__*",
6128
- integrationType: "oauth"
6129
- },
6130
- playwright: {
6131
- id: "playwright",
6132
- name: "Playwright",
6133
- provider: "playwright",
6134
- requiredMCP: "mcp__playwright__*",
6135
- isLocal: true,
6136
- // Playwright runs locally, no external connector needed
6137
- integrationType: "local"
6138
- },
6139
- teams: {
6140
- id: "teams",
6141
- name: "Microsoft Teams",
6142
- provider: "teams",
6143
- requiredMCP: "mcp__teams__*",
6144
- integrationType: "oauth"
6145
- },
6146
- email: {
6147
- id: "email",
6148
- name: "Email",
6149
- provider: "resend",
6150
- requiredMCP: "mcp__resend__*",
6151
- integrationType: "local"
6152
- // Uses platform API key, no OAuth needed
6153
- },
6154
- github: {
6155
- id: "github",
6156
- name: "GitHub",
6157
- provider: "github",
6158
- requiredMCP: "mcp__github__*",
6159
- integrationType: "oauth"
6160
- },
6161
- local: {
6162
- id: "local",
6163
- name: "Local (Terminal)",
6164
- provider: "local",
6165
- // No requiredMCP - uses built-in Claude Code tools (AskUserQuestion, text output)
6166
- isLocal: true,
6167
- integrationType: "local"
6168
- }
6169
- };
6170
- var SUBAGENTS = {
6171
- "test-runner": {
6172
- role: "test-runner",
6173
- name: "Test Runner",
6174
- description: "Execute automated browser tests (always included)",
6175
- icon: "play",
6176
- integrations: [INTEGRATIONS.playwright],
6177
- model: "sonnet",
6178
- color: "green",
6179
- isRequired: true,
6180
- version: "1.0.0"
6181
- },
6182
- "team-communicator": {
6183
- role: "team-communicator",
6184
- name: "Team Communicator",
6185
- description: "Send notifications and updates to your team",
6186
- icon: "message-square",
6187
- integrations: [INTEGRATIONS.slack, INTEGRATIONS.teams, INTEGRATIONS.email],
6188
- model: "sonnet",
6189
- color: "blue",
6190
- isRequired: true,
6191
- // Required - CLI uses 'local' (auto-configured), cloud uses email fallback
6192
- defaultIntegration: "email",
6193
- // Email fallback for cloud (CLI auto-configures 'local' separately)
6194
- version: "1.0.0"
6195
- },
6196
- "issue-tracker": {
6197
- role: "issue-tracker",
6198
- name: "Issue Tracker",
6199
- description: "Automatically create and track bugs and issues",
6200
- icon: "bot",
6201
- integrations: [
6202
- // INTEGRATIONS.linear,
6203
- INTEGRATIONS.jira,
6204
- INTEGRATIONS["jira-server"],
6205
- INTEGRATIONS["azure-devops"],
6206
- INTEGRATIONS.notion,
6207
- INTEGRATIONS.slack
6208
- ],
6209
- model: "sonnet",
6210
- color: "red",
6211
- version: "1.0.0"
6212
- },
6213
- "documentation-researcher": {
6214
- role: "documentation-researcher",
6215
- name: "Documentation Researcher",
6216
- description: "Search and retrieve information from your documentation",
6217
- icon: "file-search",
6218
- integrations: [
6219
- INTEGRATIONS.notion,
6220
- INTEGRATIONS.jira
6221
- // INTEGRATIONS.confluence
6222
- ],
6223
- model: "sonnet",
6224
- color: "cyan",
6225
- version: "1.0.0"
6226
- },
6227
- "test-code-generator": {
6228
- role: "test-code-generator",
6229
- name: "Test Code Generator",
6230
- description: "Generate automated Playwright test scripts and Page Objects",
6231
- icon: "code",
6232
- integrations: [INTEGRATIONS.playwright],
6233
- model: "sonnet",
6234
- color: "purple",
6235
- isRequired: true,
6236
- // Required for automated test generation
6237
- version: "1.0.0"
6238
- },
6239
- "test-debugger-fixer": {
6240
- role: "test-debugger-fixer",
6241
- name: "Test Debugger & Fixer",
6242
- description: "Debug and fix failing automated tests automatically",
6243
- icon: "wrench",
6244
- integrations: [INTEGRATIONS.playwright],
6245
- model: "sonnet",
6246
- color: "yellow",
6247
- isRequired: true,
6248
- // Required for automated test execution and fixing
6249
- version: "1.0.0"
6250
- },
6251
- "changelog-historian": {
6252
- role: "changelog-historian",
6253
- name: "Changelog Historian",
6254
- description: "Retrieves and analyzes code changes from GitHub PRs and commits",
6255
- icon: "git-pull-request",
6256
- integrations: [INTEGRATIONS.github],
6257
- model: "haiku",
6258
- color: "gray",
6259
- isRequired: false,
6260
- version: "1.0.0"
6261
- }
6262
- };
6263
- function getAllSubAgents() {
6264
- return Object.values(SUBAGENTS);
6265
- }
6266
- function getIntegration(integrationId) {
6267
- return INTEGRATIONS[integrationId];
6268
- }
6269
- function getRequiredSubAgents() {
6270
- return Object.values(SUBAGENTS).filter((agent) => agent.isRequired);
6271
- }
6272
-
6273
6350
  // src/subagents/index.ts
6274
6351
  function buildSubagentConfig(role, integration) {
6275
6352
  const template = getTemplate(role, integration);
@@ -6624,7 +6701,9 @@ If the Clarification Protocol determined project maturity, adjust exploration de
6624
6701
  - **Growing project**: Use requirement clarity as-is (standard protocol)
6625
6702
  - **Mature project**: Trust knowledge base \u2014 can stay at suggested depth or go one level shallower if KB covers the feature
6626
6703
 
6627
- **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.
6704
+ **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:
6705
+ - 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.
6706
+ - 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.
6628
6707
 
6629
6708
  ### Quick Exploration (1-2 min)
6630
6709
 
@@ -6911,11 +6990,56 @@ If ambiguity is detected, assess its severity:
6911
6990
 
6912
6991
  | Severity | Characteristics | Examples | Action |
6913
6992
  |----------|----------------|----------|--------|
6914
- | **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 |
6993
+ | **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 |
6915
6994
  | **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 |
6916
6995
  | **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] |
6917
6996
  | **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 |
6918
6997
 
6998
+ ### Execution Obstacle vs. Requirement Ambiguity
6999
+
7000
+ Before classifying something as CRITICAL, distinguish between these two fundamentally different situations:
7001
+
7002
+ **Requirement Ambiguity** = *What* to test is unclear \u2192 severity assessment applies normally
7003
+ - No authoritative source describes the feature
7004
+ - The task description is vague or contradictory
7005
+ - You cannot determine what "correct" behavior looks like
7006
+ - \u2192 Apply severity table above. CRITICAL/HIGH \u2192 BLOCK.
7007
+
7008
+ **Execution Obstacle** = *What* to test is clear, but *how* to access/verify has obstacles \u2192 NEVER BLOCK
7009
+ - An authoritative trigger source (Jira issue, PR, team message) asserts the feature exists
7010
+ - You browsed the app but couldn't find/access the feature
7011
+ - The obstacle is likely: wrong user role/tier, missing test data, feature flags, environment config
7012
+ - \u2192 PROCEED with artifact creation (test cases, test specs). Notify team about the obstacle.
7013
+
7014
+ **The key test:** Does an authoritative trigger source (Jira, PR, team request) assert the feature exists?
7015
+ - **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.
7016
+ - **NO** \u2192 It may genuinely not exist. Apply CRITICAL severity, ask what was meant.
7017
+
7018
+ | Scenario | Trigger Says | Browser Shows | Classification | Action |
7019
+ |----------|-------------|---------------|----------------|--------|
7020
+ | 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 |
7021
+ | 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 |
7022
+ | 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 |
7023
+ | Jira says "fix sorting", but doesn't specify sort criteria | Feature exists | Feature exists | **Requirement ambiguity (HIGH)** | BLOCK, ask which sort criteria |
7024
+
7025
+ **Partial Feature Existence \u2014 URL found but requested functionality absent:**
7026
+
7027
+ A common edge case: a page/route loads successfully, but the SPECIFIC FUNCTIONALITY you were asked to test doesn't exist on it.
7028
+
7029
+ **Rule:** Evaluate whether the REQUESTED FUNCTIONALITY exists, not just whether a URL resolves.
7030
+
7031
+ | Page Exists | Requested Features Exist | Authoritative Trigger | Classification |
7032
+ |-------------|--------------------------|----------------------|----------------|
7033
+ | Yes | Yes | Any | Proceed normally |
7034
+ | Yes | No | Yes (Jira/PR says features built) | Execution obstacle \u2014 features behind flag/env |
7035
+ | Yes | No | No (manual request only) | **Requirement ambiguity (CRITICAL)** \u2014 ask what's expected |
7036
+ | No | N/A | Yes | Execution obstacle \u2014 page not deployed yet |
7037
+ | No | N/A | No | **Requirement ambiguity (CRITICAL)** \u2014 ask what was meant |
7038
+
7039
+ **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?"
7040
+
7041
+ **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.
7042
+
6919
7043
  ### Check Memory for Similar Clarifications
6920
7044
 
6921
7045
  Before asking, check if similar question was answered:
@@ -7061,7 +7185,7 @@ When reporting test results, always include an "Ambiguities" section if clarific
7061
7185
  ## Remember
7062
7186
 
7063
7187
  - **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
7064
- - **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
7188
+ - **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
7065
7189
  - **Ask correctly > guess poorly** - Specific questions lead to specific answers
7066
7190
  - **Never invent success criteria** - If the task says "improve" or "fix" without metrics, ask what "done" looks like
7067
7191
  - **Check memory first** - Avoid re-asking previously answered questions
@@ -8005,8 +8129,10 @@ function buildComposedTaskDefinition(taskSlug, projectSubAgents) {
8005
8129
  const configured = projectSubAgents.find((sa) => sa.role === role);
8006
8130
  if (configured) {
8007
8131
  const integrationMeta = getIntegration(configured.integration);
8008
- const mcpProvider = integrationMeta?.provider || configured.integration;
8009
- requiredMCPs.add(mcpProvider);
8132
+ if (integrationMeta?.requiredMCP) {
8133
+ const mcpProvider = integrationMeta.provider || configured.integration;
8134
+ requiredMCPs.add(mcpProvider);
8135
+ }
8010
8136
  }
8011
8137
  }
8012
8138
  const content = contentParts.join("\n\n");
@@ -8261,31 +8387,6 @@ var MCP_SERVERS = {
8261
8387
  }
8262
8388
  }
8263
8389
  },
8264
- playwright: {
8265
- provider: "playwright",
8266
- name: "Playwright",
8267
- description: "Playwright MCP server for browser automation",
8268
- requiresCredentials: false,
8269
- npmPackages: ["@playwright/mcp"],
8270
- config: {
8271
- command: "playwright-mcp",
8272
- args: [
8273
- "--browser",
8274
- "chromium",
8275
- "--secrets",
8276
- ".env",
8277
- "--no-sandbox",
8278
- "--viewport-size",
8279
- "1280x720"
8280
- ]
8281
- },
8282
- containerExtensions: {
8283
- args: ["--headless"],
8284
- env: {
8285
- PLAYWRIGHT_BROWSERS_PATH: "/opt/ms-playwright"
8286
- }
8287
- }
8288
- },
8289
8390
  notion: {
8290
8391
  provider: "notion",
8291
8392
  name: "Notion",