@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.
package/dist/cli/index.js CHANGED
@@ -689,7 +689,28 @@ The handler file contains all necessary processing logic for the detected intent
689
689
  - Response guidelines
690
690
  - Memory update instructions`
691
691
  },
692
- // Step 6: Clarification Protocol (for ambiguous intents)
692
+ // Step 6: Post Response via Team Communicator
693
+ {
694
+ inline: true,
695
+ title: "Post Response to Team",
696
+ content: `## Post Response to the Team
697
+
698
+ After processing the message through the handler and composing your response:
699
+
700
+ {{INVOKE_TEAM_COMMUNICATOR}} to post the response back to the team.
701
+
702
+ **Context to include in the delegation:**
703
+ - The original message/question from the team member
704
+ - Your composed response with all gathered data
705
+ - Whether this should be a thread reply (if the original message was in a thread) or a new message
706
+ - The relevant channel (from project-context.md)
707
+
708
+ **Do NOT:**
709
+ - Skip posting and just display the response as text output
710
+ - Ask the user whether to post \u2014 the message came from the team, the response goes back to the team
711
+ - Compose a draft without sending it`
712
+ },
713
+ // Step 7: Clarification Protocol (for ambiguous intents)
693
714
  "clarification-protocol",
694
715
  // Step 8: Knowledge Base Update (library)
695
716
  "update-knowledge-base",
@@ -1492,6 +1513,40 @@ The input format determines the trigger source and context extraction strategy.`
1492
1513
  Store the detected trigger for use in output routing:
1493
1514
  - Set variable: \`TRIGGER_SOURCE\` = [GITHUB_PR | SLACK_MESSAGE | CI_CD | MANUAL]
1494
1515
  - This determines output formatting and delivery channel`
1516
+ },
1517
+ // Step 5c: Coverage Gap vs. Ambiguity (inline)
1518
+ {
1519
+ inline: true,
1520
+ title: "Coverage Gap vs. Ambiguity",
1521
+ content: `### Coverage Gap vs. Ambiguity
1522
+
1523
+ When the trigger indicates a feature has been implemented and is ready for testing (Jira "Ready to Test", PR merged, CI/CD pipeline):
1524
+
1525
+ **Missing test coverage for the referenced feature is a COVERAGE GAP, not an ambiguity.**
1526
+
1527
+ - The developer/team is asserting the feature exists and is ready for testing
1528
+ - "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
1529
+ - Do NOT classify as CRITICAL based on stale documentation or knowledge base gaps
1530
+ - If project-context.md or the Jira issue references the feature, assume it exists until browser exploration proves otherwise
1531
+ - Coverage gaps are handled in the "Create Tests for Coverage Gaps" step below \u2014 do NOT block here
1532
+
1533
+ ### If You Browse the App and Cannot Find the Referenced Feature
1534
+
1535
+ Apply the Clarification Protocol's **"Execution Obstacle vs. Requirement Ambiguity"** principle:
1536
+
1537
+ 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:
1538
+ - **Missing role/tier**: You're logged in as a basic user but the feature requires admin/premium access
1539
+ - **Missing test data**: Required test accounts or data haven't been configured in \`.env.testdata\`
1540
+ - **Feature flags**: The feature is behind a flag not enabled in the test environment
1541
+ - **Environment config**: The feature requires specific environment variables or deployment settings
1542
+
1543
+ **Action: PROCEED to "Create Tests for Coverage Gaps".** Do NOT BLOCK.
1544
+ - Create test cases and specs that reference the feature as described in the trigger
1545
+ - Add placeholder env vars to \`.env.testdata\` for any missing credentials
1546
+ - Notify the team (via team-communicator) about the access obstacle and what needs to be configured
1547
+ - Tests may fail until the obstacle is resolved \u2014 this is expected and acceptable
1548
+
1549
+ **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.`
1495
1550
  },
1496
1551
  // Step 6: Clarification Protocol (library)
1497
1552
  "clarification-protocol",
@@ -2357,6 +2412,204 @@ function validateEnvVars(mcpServers, envVars) {
2357
2412
  init_esm_shims();
2358
2413
  import * as fs3 from "fs";
2359
2414
  import * as path4 from "path";
2415
+
2416
+ // src/subagents/metadata.ts
2417
+ init_esm_shims();
2418
+ var INTEGRATIONS = {
2419
+ linear: {
2420
+ id: "linear",
2421
+ name: "Linear",
2422
+ provider: "linear",
2423
+ requiredMCP: "mcp__linear__*",
2424
+ integrationType: "oauth"
2425
+ },
2426
+ jira: {
2427
+ id: "jira",
2428
+ name: "Jira",
2429
+ provider: "jira",
2430
+ requiredMCP: "mcp__jira__*",
2431
+ integrationType: "oauth"
2432
+ },
2433
+ "jira-server": {
2434
+ id: "jira-server",
2435
+ name: "Jira Server",
2436
+ provider: "jira-server",
2437
+ requiredMCP: "mcp__jira-server__*",
2438
+ integrationType: "custom"
2439
+ },
2440
+ "azure-devops": {
2441
+ id: "azure-devops",
2442
+ name: "Azure DevOps",
2443
+ provider: "azure-devops",
2444
+ requiredMCP: "mcp__azure-devops__*",
2445
+ integrationType: "oauth"
2446
+ // Uses Nango with API key auth for PAT
2447
+ },
2448
+ notion: {
2449
+ id: "notion",
2450
+ name: "Notion",
2451
+ provider: "notion",
2452
+ requiredMCP: "mcp__notion__*",
2453
+ integrationType: "oauth"
2454
+ },
2455
+ confluence: {
2456
+ id: "confluence",
2457
+ name: "Confluence",
2458
+ provider: "confluence",
2459
+ requiredMCP: "mcp__confluence__*",
2460
+ integrationType: "oauth"
2461
+ },
2462
+ slack: {
2463
+ id: "slack",
2464
+ name: "Slack",
2465
+ provider: "slack",
2466
+ requiredMCP: "mcp__slack__*",
2467
+ integrationType: "oauth"
2468
+ },
2469
+ playwright: {
2470
+ id: "playwright",
2471
+ name: "Playwright",
2472
+ provider: "playwright",
2473
+ // No requiredMCP — uses playwright-cli (CLI tool), not MCP server
2474
+ isLocal: true,
2475
+ // Playwright runs locally, no external connector needed
2476
+ integrationType: "local"
2477
+ },
2478
+ teams: {
2479
+ id: "teams",
2480
+ name: "Microsoft Teams",
2481
+ provider: "teams",
2482
+ requiredMCP: "mcp__teams__*",
2483
+ integrationType: "oauth"
2484
+ },
2485
+ email: {
2486
+ id: "email",
2487
+ name: "Email",
2488
+ provider: "resend",
2489
+ requiredMCP: "mcp__resend__*",
2490
+ integrationType: "local"
2491
+ // Uses platform API key, no OAuth needed
2492
+ },
2493
+ github: {
2494
+ id: "github",
2495
+ name: "GitHub",
2496
+ provider: "github",
2497
+ requiredMCP: "mcp__github__*",
2498
+ integrationType: "oauth"
2499
+ },
2500
+ local: {
2501
+ id: "local",
2502
+ name: "Local (Terminal)",
2503
+ provider: "local",
2504
+ // No requiredMCP - uses built-in Claude Code tools (AskUserQuestion, text output)
2505
+ isLocal: true,
2506
+ integrationType: "local"
2507
+ }
2508
+ };
2509
+ var SUBAGENTS = {
2510
+ "test-runner": {
2511
+ role: "test-runner",
2512
+ name: "Test Runner",
2513
+ description: "Execute automated browser tests (always included)",
2514
+ icon: "play",
2515
+ integrations: [INTEGRATIONS.playwright],
2516
+ model: "sonnet",
2517
+ color: "green",
2518
+ isRequired: true,
2519
+ version: "1.0.0"
2520
+ },
2521
+ "team-communicator": {
2522
+ role: "team-communicator",
2523
+ name: "Team Communicator",
2524
+ description: "Send notifications and updates to your team",
2525
+ icon: "message-square",
2526
+ integrations: [INTEGRATIONS.slack, INTEGRATIONS.teams, INTEGRATIONS.email],
2527
+ model: "sonnet",
2528
+ color: "blue",
2529
+ isRequired: true,
2530
+ // Required - CLI uses 'local' (auto-configured), cloud uses email fallback
2531
+ defaultIntegration: "email",
2532
+ // Email fallback for cloud (CLI auto-configures 'local' separately)
2533
+ version: "1.0.0"
2534
+ },
2535
+ "issue-tracker": {
2536
+ role: "issue-tracker",
2537
+ name: "Issue Tracker",
2538
+ description: "Automatically create and track bugs and issues",
2539
+ icon: "bot",
2540
+ integrations: [
2541
+ // INTEGRATIONS.linear,
2542
+ INTEGRATIONS.jira,
2543
+ INTEGRATIONS["jira-server"],
2544
+ INTEGRATIONS["azure-devops"],
2545
+ INTEGRATIONS.notion,
2546
+ INTEGRATIONS.slack
2547
+ ],
2548
+ model: "sonnet",
2549
+ color: "red",
2550
+ version: "1.0.0"
2551
+ },
2552
+ "documentation-researcher": {
2553
+ role: "documentation-researcher",
2554
+ name: "Documentation Researcher",
2555
+ description: "Search and retrieve information from your documentation",
2556
+ icon: "file-search",
2557
+ integrations: [
2558
+ INTEGRATIONS.notion,
2559
+ INTEGRATIONS.jira
2560
+ // INTEGRATIONS.confluence
2561
+ ],
2562
+ model: "sonnet",
2563
+ color: "cyan",
2564
+ version: "1.0.0"
2565
+ },
2566
+ "test-code-generator": {
2567
+ role: "test-code-generator",
2568
+ name: "Test Code Generator",
2569
+ description: "Generate automated Playwright test scripts and Page Objects",
2570
+ icon: "code",
2571
+ integrations: [INTEGRATIONS.playwright],
2572
+ model: "sonnet",
2573
+ color: "purple",
2574
+ isRequired: true,
2575
+ // Required for automated test generation
2576
+ version: "1.0.0"
2577
+ },
2578
+ "test-debugger-fixer": {
2579
+ role: "test-debugger-fixer",
2580
+ name: "Test Debugger & Fixer",
2581
+ description: "Debug and fix failing automated tests automatically",
2582
+ icon: "wrench",
2583
+ integrations: [INTEGRATIONS.playwright],
2584
+ model: "sonnet",
2585
+ color: "yellow",
2586
+ isRequired: true,
2587
+ // Required for automated test execution and fixing
2588
+ version: "1.0.0"
2589
+ },
2590
+ "changelog-historian": {
2591
+ role: "changelog-historian",
2592
+ name: "Changelog Historian",
2593
+ description: "Retrieves and analyzes code changes from GitHub PRs and commits",
2594
+ icon: "git-pull-request",
2595
+ integrations: [INTEGRATIONS.github],
2596
+ model: "haiku",
2597
+ color: "gray",
2598
+ isRequired: false,
2599
+ version: "1.0.0"
2600
+ }
2601
+ };
2602
+ function getAllSubAgents() {
2603
+ return Object.values(SUBAGENTS);
2604
+ }
2605
+ function getIntegration(integrationId) {
2606
+ return INTEGRATIONS[integrationId];
2607
+ }
2608
+ function getRequiredSubAgents() {
2609
+ return Object.values(SUBAGENTS).filter((agent) => agent.isRequired);
2610
+ }
2611
+
2612
+ // src/cli/utils/validation.ts
2360
2613
  async function validateProjectStructure() {
2361
2614
  const config = await loadConfig();
2362
2615
  const tool = config ? getToolFromConfig(config) : DEFAULT_TOOL;
@@ -2419,7 +2672,10 @@ async function checkToolAvailable(command) {
2419
2672
  function getRequiredMCPs(subagents) {
2420
2673
  const mcps = /* @__PURE__ */ new Set();
2421
2674
  for (const [_role, integration] of Object.entries(subagents)) {
2422
- mcps.add(integration);
2675
+ const integrationMeta = getIntegration(integration);
2676
+ if (integrationMeta?.requiredMCP) {
2677
+ mcps.add(integration);
2678
+ }
2423
2679
  }
2424
2680
  return Array.from(mcps);
2425
2681
  }
@@ -2607,7 +2863,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2607
2863
 
2608
2864
  3. **Environment Setup**: Before test execution:
2609
2865
  - Read \`.env.testdata\` to get non-secret environment variable values (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.)
2610
- - For secrets, variable names will be passed to Playwright MCP which reads them from .env at runtime
2866
+ - For secrets, variable names are available as environment variables (playwright-cli inherits the process environment)
2611
2867
 
2612
2868
  4. **Test Case Parsing**: You will receive a test case file path. Parse the test case to extract:
2613
2869
  - Test steps and actions to perform
@@ -2615,16 +2871,16 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2615
2871
  - Test data and input values (replace any \${TEST_*} or $TEST_* variables with actual values from .env)
2616
2872
  - Preconditions and setup requirements
2617
2873
 
2618
- 5. **Browser Automation Execution**: Using the Playwright MCP server:
2619
- - Launch a browser instance with appropriate configuration
2620
- - Execute each test step sequentially
2874
+ 5. **Browser Automation Execution**: Using playwright-cli (CLI-based browser automation):
2875
+ - Launch a browser: \`playwright-cli open <url>\`
2876
+ - Execute each test step sequentially using CLI commands: \`click\`, \`fill\`, \`select\`, \`hover\`, etc.
2877
+ - Use \`snapshot\` to inspect page state and find element references (@e1, @e2, etc.)
2621
2878
  - Handle dynamic waits and element interactions intelligently
2622
2879
  - Manage browser state between steps
2623
2880
  - **IMPORTANT - Environment Variable Handling**:
2624
2881
  - When test cases contain environment variables:
2625
2882
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL): Read actual values from .env.testdata and use them directly
2626
- - For secrets (TEST_OWNER_PASSWORD, API keys): Pass variable name to Playwright MCP for runtime substitution
2627
- - Playwright MCP automatically reads .env for secrets and injects them at runtime
2883
+ - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits environment variables from the process
2628
2884
  - Example: Test says "Navigate to TEST_BASE_URL/login" \u2192 Read TEST_BASE_URL from .env.testdata, use the actual URL
2629
2885
 
2630
2886
  6. **Evidence Collection at Each Step**:
@@ -2649,7 +2905,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2649
2905
  - \`steps.json\`: Structured steps with timestamps, video time synchronization, and detailed descriptions (see schema)
2650
2906
 
2651
2907
  Video handling:
2652
- - Playwright automatically saves videos to \`.playwright-mcp/\` folder
2908
+ - Videos are automatically saved to \`.playwright-mcp/\` folder via PLAYWRIGHT_MCP_SAVE_VIDEO env var
2653
2909
  - Find the latest video: \`ls -t .playwright-mcp/*.webm 2>/dev/null | head -1\`
2654
2910
  - Store ONLY the filename in summary.json: \`{ "video": { "filename": "basename.webm" } }\`
2655
2911
  - Do NOT copy, move, or delete video files - external service handles uploads
@@ -2688,8 +2944,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2688
2944
  - Identify all TEST_* variable references (e.g., TEST_BASE_URL, TEST_OWNER_EMAIL, TEST_OWNER_PASSWORD)
2689
2945
  - Read .env.testdata to get actual values for non-secret variables
2690
2946
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly in test execution
2691
- - For secrets (TEST_OWNER_PASSWORD, API keys, etc.): Pass variable names to Playwright MCP for runtime injection from .env
2692
- - Playwright MCP will read .env and inject secret values during browser automation
2947
+ - For secrets (TEST_OWNER_PASSWORD, API keys, etc.): playwright-cli inherits env vars from the process environment
2693
2948
  - If a required variable is not found in .env.testdata, log a warning but continue
2694
2949
 
2695
2950
  5. Extract execution ID from the execution environment:
@@ -2703,7 +2958,7 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2703
2958
  - Describe what action will be performed (communicate to user)
2704
2959
  - Log the step being executed with timestamp
2705
2960
  - Calculate elapsed time from test start (for videoTimeSeconds)
2706
- - Execute the action using Playwright's robust selectors
2961
+ - Execute the action using playwright-cli commands (click, fill, select, etc. with element refs)
2707
2962
  - Wait for page stability
2708
2963
  - Validate expected behavior
2709
2964
  - Record findings and actual behavior
@@ -2778,12 +3033,11 @@ var CONTENT = `You are an expert automated test execution specialist with deep e
2778
3033
  **Environment Variable Handling:**
2779
3034
  - Read .env.testdata at the start of execution to get non-secret environment variables
2780
3035
  - For non-secrets (TEST_BASE_URL, TEST_OWNER_EMAIL, etc.): Use actual values from .env.testdata directly
2781
- - For secrets (TEST_OWNER_PASSWORD, API keys): Pass variable names to Playwright MCP for runtime injection
2782
- - Playwright MCP reads .env for secrets and injects them during browser automation
3036
+ - For secrets (TEST_OWNER_PASSWORD, API keys): playwright-cli inherits env vars from the process environment
2783
3037
  - DO NOT read .env yourself (security policy - it contains only secrets)
2784
3038
  - DO NOT make up fake values or fallbacks
2785
3039
  - If a variable is missing from .env.testdata, log a warning
2786
- - If Playwright MCP reports a secret is missing/empty, that indicates .env is misconfigured
3040
+ - If a secret env var is missing/empty, that indicates .env is misconfigured
2787
3041
  - Document which environment variables were used in the test run summary
2788
3042
 
2789
3043
  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.`;
@@ -2831,7 +3085,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2831
3085
  - Update the manual test case file with the automated_test reference
2832
3086
  - Create supporting artifacts: Page Objects, fixtures, helpers, components, types
2833
3087
 
2834
- 5. **Mandatory Application Exploration**: NEVER generate Page Objects without exploring the live application first using Playwright MCP tools:
3088
+ 5. **Mandatory Application Exploration**: NEVER generate Page Objects without exploring the live application first using playwright-cli:
2835
3089
  - Navigate to pages, authenticate, inspect elements
2836
3090
  - Capture screenshots for documentation
2837
3091
  - Document exact role names, labels, text, URLs
@@ -2862,7 +3116,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2862
3116
 
2863
3117
  **STEP 2: Build Missing Infrastructure** (if needed)
2864
3118
 
2865
- - **Explore feature under test**: Use Playwright MCP tools to:
3119
+ - **Explore feature under test**: Use playwright-cli to:
2866
3120
  * Navigate to the feature's pages
2867
3121
  * Inspect elements and gather selectors (role, label, text)
2868
3122
  * Document actual URLs from the browser
@@ -3069,8 +3323,8 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
3069
3323
  - Create test interdependencies - tests must be independent
3070
3324
 
3071
3325
  \u2705 **ALWAYS**:
3072
- - Explore application using Playwright MCP before generating code
3073
- - Verify selectors in live browser using browser_select tool
3326
+ - Explore application using playwright-cli before generating code
3327
+ - Verify selectors in live browser using playwright-cli snapshot
3074
3328
  - Document actual URLs from browser address bar
3075
3329
  - Take screenshots for documentation
3076
3330
  - Use role-based selectors as first priority
@@ -3143,7 +3397,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3143
3397
  - Brittle selectors (CSS classes, IDs that change)
3144
3398
 
3145
3399
  4. **Debug Using Browser**: When needed, explore the application manually:
3146
- - Use Playwright MCP to open browser
3400
+ - Use playwright-cli to open browser (\`playwright-cli open <url>\`)
3147
3401
  - Navigate to the relevant page
3148
3402
  - Inspect elements to find correct selectors
3149
3403
  - Manually perform test steps to understand actual behavior
@@ -3253,7 +3507,7 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3253
3507
  - Check for screenshot/trace file references
3254
3508
 
3255
3509
  **Step 3: Reproduce and Debug**
3256
- - Open browser via Playwright MCP if needed
3510
+ - Open browser via playwright-cli if needed (\`playwright-cli open <url>\`)
3257
3511
  - Navigate to relevant page
3258
3512
  - Manually execute test steps
3259
3513
  - Identify discrepancy between test expectations and actual behavior
@@ -3376,13 +3630,14 @@ var CONTENT3 = `You are an expert Playwright test debugger and fixer with deep e
3376
3630
  - NEVER read \`.env\` file (contains secrets only)
3377
3631
  - If test needs new environment variable, update \`.env.testdata\`
3378
3632
 
3379
- 9. **Using Playwright MCP for Debugging**:
3380
- - You have direct access to Playwright MCP
3381
- - Open browser: Request to launch Playwright
3382
- - Navigate: Go to URLs relevant to failing test
3383
- - Inspect elements: Find correct selectors
3384
- - Execute test steps manually: Understand actual behavior
3385
- - Close browser when done
3633
+ 9. **Using playwright-cli for Debugging**:
3634
+ - You have direct access to playwright-cli via Bash
3635
+ - Open browser: \`playwright-cli open <url>\`
3636
+ - Take snapshot: \`playwright-cli snapshot\` to get element refs (@e1, @e2, etc.)
3637
+ - Navigate: \`playwright-cli navigate <url>\`
3638
+ - Inspect elements: Use \`snapshot\` to find correct selectors and element refs
3639
+ - Execute test steps manually: Use \`click\`, \`fill\`, \`select\` commands
3640
+ - Close browser: \`playwright-cli close\`
3386
3641
 
3387
3642
  10. **Test Stability Best Practices**:
3388
3643
  - Replace all \`waitForTimeout()\` with specific waits
@@ -3679,6 +3934,24 @@ var CONTENT5 = `You are a Team Communication Specialist who communicates like a
3679
3934
 
3680
3935
  **Key Principle:** If it takes more than 30 seconds to read, it's too long.
3681
3936
 
3937
+ ## CRITICAL: Always Post Messages
3938
+
3939
+ When you are invoked, your job is to POST a message to Slack \u2014 not just compose one.
3940
+
3941
+ **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.
3942
+
3943
+ **NEVER:**
3944
+ - Return a draft without posting it
3945
+ - Ask "should I post this?" \u2014 if you were invoked, the answer is yes
3946
+ - Compose text and wait for approval before posting
3947
+
3948
+ **ALWAYS:**
3949
+ 1. Identify the correct channel (from project-context.md or the invocation context)
3950
+ 2. Compose the message following the guidelines below
3951
+ 3. Call the Slack API tool to POST the message
3952
+ 4. If a thread reply is needed, post main message first, then reply in thread
3953
+ 5. Report back: channel name, message timestamp, and confirmation it was posted
3954
+
3682
3955
  ## Message Type Detection
3683
3956
 
3684
3957
  Before composing, identify the message type:
@@ -6066,202 +6339,6 @@ function getTemplate(role, integration) {
6066
6339
  return TEMPLATES[role]?.[integration];
6067
6340
  }
6068
6341
 
6069
- // src/subagents/metadata.ts
6070
- init_esm_shims();
6071
- var INTEGRATIONS = {
6072
- linear: {
6073
- id: "linear",
6074
- name: "Linear",
6075
- provider: "linear",
6076
- requiredMCP: "mcp__linear__*",
6077
- integrationType: "oauth"
6078
- },
6079
- jira: {
6080
- id: "jira",
6081
- name: "Jira",
6082
- provider: "jira",
6083
- requiredMCP: "mcp__jira__*",
6084
- integrationType: "oauth"
6085
- },
6086
- "jira-server": {
6087
- id: "jira-server",
6088
- name: "Jira Server",
6089
- provider: "jira-server",
6090
- requiredMCP: "mcp__jira-server__*",
6091
- integrationType: "custom"
6092
- },
6093
- "azure-devops": {
6094
- id: "azure-devops",
6095
- name: "Azure DevOps",
6096
- provider: "azure-devops",
6097
- requiredMCP: "mcp__azure-devops__*",
6098
- integrationType: "oauth"
6099
- // Uses Nango with API key auth for PAT
6100
- },
6101
- notion: {
6102
- id: "notion",
6103
- name: "Notion",
6104
- provider: "notion",
6105
- requiredMCP: "mcp__notion__*",
6106
- integrationType: "oauth"
6107
- },
6108
- confluence: {
6109
- id: "confluence",
6110
- name: "Confluence",
6111
- provider: "confluence",
6112
- requiredMCP: "mcp__confluence__*",
6113
- integrationType: "oauth"
6114
- },
6115
- slack: {
6116
- id: "slack",
6117
- name: "Slack",
6118
- provider: "slack",
6119
- requiredMCP: "mcp__slack__*",
6120
- integrationType: "oauth"
6121
- },
6122
- playwright: {
6123
- id: "playwright",
6124
- name: "Playwright",
6125
- provider: "playwright",
6126
- requiredMCP: "mcp__playwright__*",
6127
- isLocal: true,
6128
- // Playwright runs locally, no external connector needed
6129
- integrationType: "local"
6130
- },
6131
- teams: {
6132
- id: "teams",
6133
- name: "Microsoft Teams",
6134
- provider: "teams",
6135
- requiredMCP: "mcp__teams__*",
6136
- integrationType: "oauth"
6137
- },
6138
- email: {
6139
- id: "email",
6140
- name: "Email",
6141
- provider: "resend",
6142
- requiredMCP: "mcp__resend__*",
6143
- integrationType: "local"
6144
- // Uses platform API key, no OAuth needed
6145
- },
6146
- github: {
6147
- id: "github",
6148
- name: "GitHub",
6149
- provider: "github",
6150
- requiredMCP: "mcp__github__*",
6151
- integrationType: "oauth"
6152
- },
6153
- local: {
6154
- id: "local",
6155
- name: "Local (Terminal)",
6156
- provider: "local",
6157
- // No requiredMCP - uses built-in Claude Code tools (AskUserQuestion, text output)
6158
- isLocal: true,
6159
- integrationType: "local"
6160
- }
6161
- };
6162
- var SUBAGENTS = {
6163
- "test-runner": {
6164
- role: "test-runner",
6165
- name: "Test Runner",
6166
- description: "Execute automated browser tests (always included)",
6167
- icon: "play",
6168
- integrations: [INTEGRATIONS.playwright],
6169
- model: "sonnet",
6170
- color: "green",
6171
- isRequired: true,
6172
- version: "1.0.0"
6173
- },
6174
- "team-communicator": {
6175
- role: "team-communicator",
6176
- name: "Team Communicator",
6177
- description: "Send notifications and updates to your team",
6178
- icon: "message-square",
6179
- integrations: [INTEGRATIONS.slack, INTEGRATIONS.teams, INTEGRATIONS.email],
6180
- model: "sonnet",
6181
- color: "blue",
6182
- isRequired: true,
6183
- // Required - CLI uses 'local' (auto-configured), cloud uses email fallback
6184
- defaultIntegration: "email",
6185
- // Email fallback for cloud (CLI auto-configures 'local' separately)
6186
- version: "1.0.0"
6187
- },
6188
- "issue-tracker": {
6189
- role: "issue-tracker",
6190
- name: "Issue Tracker",
6191
- description: "Automatically create and track bugs and issues",
6192
- icon: "bot",
6193
- integrations: [
6194
- // INTEGRATIONS.linear,
6195
- INTEGRATIONS.jira,
6196
- INTEGRATIONS["jira-server"],
6197
- INTEGRATIONS["azure-devops"],
6198
- INTEGRATIONS.notion,
6199
- INTEGRATIONS.slack
6200
- ],
6201
- model: "sonnet",
6202
- color: "red",
6203
- version: "1.0.0"
6204
- },
6205
- "documentation-researcher": {
6206
- role: "documentation-researcher",
6207
- name: "Documentation Researcher",
6208
- description: "Search and retrieve information from your documentation",
6209
- icon: "file-search",
6210
- integrations: [
6211
- INTEGRATIONS.notion,
6212
- INTEGRATIONS.jira
6213
- // INTEGRATIONS.confluence
6214
- ],
6215
- model: "sonnet",
6216
- color: "cyan",
6217
- version: "1.0.0"
6218
- },
6219
- "test-code-generator": {
6220
- role: "test-code-generator",
6221
- name: "Test Code Generator",
6222
- description: "Generate automated Playwright test scripts and Page Objects",
6223
- icon: "code",
6224
- integrations: [INTEGRATIONS.playwright],
6225
- model: "sonnet",
6226
- color: "purple",
6227
- isRequired: true,
6228
- // Required for automated test generation
6229
- version: "1.0.0"
6230
- },
6231
- "test-debugger-fixer": {
6232
- role: "test-debugger-fixer",
6233
- name: "Test Debugger & Fixer",
6234
- description: "Debug and fix failing automated tests automatically",
6235
- icon: "wrench",
6236
- integrations: [INTEGRATIONS.playwright],
6237
- model: "sonnet",
6238
- color: "yellow",
6239
- isRequired: true,
6240
- // Required for automated test execution and fixing
6241
- version: "1.0.0"
6242
- },
6243
- "changelog-historian": {
6244
- role: "changelog-historian",
6245
- name: "Changelog Historian",
6246
- description: "Retrieves and analyzes code changes from GitHub PRs and commits",
6247
- icon: "git-pull-request",
6248
- integrations: [INTEGRATIONS.github],
6249
- model: "haiku",
6250
- color: "gray",
6251
- isRequired: false,
6252
- version: "1.0.0"
6253
- }
6254
- };
6255
- function getAllSubAgents() {
6256
- return Object.values(SUBAGENTS);
6257
- }
6258
- function getIntegration(integrationId) {
6259
- return INTEGRATIONS[integrationId];
6260
- }
6261
- function getRequiredSubAgents() {
6262
- return Object.values(SUBAGENTS).filter((agent) => agent.isRequired);
6263
- }
6264
-
6265
6342
  // src/subagents/index.ts
6266
6343
  function buildSubagentConfig(role, integration) {
6267
6344
  const template = getTemplate(role, integration);
@@ -6616,7 +6693,9 @@ If the Clarification Protocol determined project maturity, adjust exploration de
6616
6693
  - **Growing project**: Use requirement clarity as-is (standard protocol)
6617
6694
  - **Mature project**: Trust knowledge base \u2014 can stay at suggested depth or go one level shallower if KB covers the feature
6618
6695
 
6619
- **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.
6696
+ **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:
6697
+ - 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.
6698
+ - 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.
6620
6699
 
6621
6700
  ### Quick Exploration (1-2 min)
6622
6701
 
@@ -6903,11 +6982,56 @@ If ambiguity is detected, assess its severity:
6903
6982
 
6904
6983
  | Severity | Characteristics | Examples | Action |
6905
6984
  |----------|----------------|----------|--------|
6906
- | **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 |
6985
+ | **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 |
6907
6986
  | **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 |
6908
6987
  | **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] |
6909
6988
  | **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 |
6910
6989
 
6990
+ ### Execution Obstacle vs. Requirement Ambiguity
6991
+
6992
+ Before classifying something as CRITICAL, distinguish between these two fundamentally different situations:
6993
+
6994
+ **Requirement Ambiguity** = *What* to test is unclear \u2192 severity assessment applies normally
6995
+ - No authoritative source describes the feature
6996
+ - The task description is vague or contradictory
6997
+ - You cannot determine what "correct" behavior looks like
6998
+ - \u2192 Apply severity table above. CRITICAL/HIGH \u2192 BLOCK.
6999
+
7000
+ **Execution Obstacle** = *What* to test is clear, but *how* to access/verify has obstacles \u2192 NEVER BLOCK
7001
+ - An authoritative trigger source (Jira issue, PR, team message) asserts the feature exists
7002
+ - You browsed the app but couldn't find/access the feature
7003
+ - The obstacle is likely: wrong user role/tier, missing test data, feature flags, environment config
7004
+ - \u2192 PROCEED with artifact creation (test cases, test specs). Notify team about the obstacle.
7005
+
7006
+ **The key test:** Does an authoritative trigger source (Jira, PR, team request) assert the feature exists?
7007
+ - **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.
7008
+ - **NO** \u2192 It may genuinely not exist. Apply CRITICAL severity, ask what was meant.
7009
+
7010
+ | Scenario | Trigger Says | Browser Shows | Classification | Action |
7011
+ |----------|-------------|---------------|----------------|--------|
7012
+ | 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 |
7013
+ | 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 |
7014
+ | 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 |
7015
+ | Jira says "fix sorting", but doesn't specify sort criteria | Feature exists | Feature exists | **Requirement ambiguity (HIGH)** | BLOCK, ask which sort criteria |
7016
+
7017
+ **Partial Feature Existence \u2014 URL found but requested functionality absent:**
7018
+
7019
+ A common edge case: a page/route loads successfully, but the SPECIFIC FUNCTIONALITY you were asked to test doesn't exist on it.
7020
+
7021
+ **Rule:** Evaluate whether the REQUESTED FUNCTIONALITY exists, not just whether a URL resolves.
7022
+
7023
+ | Page Exists | Requested Features Exist | Authoritative Trigger | Classification |
7024
+ |-------------|--------------------------|----------------------|----------------|
7025
+ | Yes | Yes | Any | Proceed normally |
7026
+ | Yes | No | Yes (Jira/PR says features built) | Execution obstacle \u2014 features behind flag/env |
7027
+ | Yes | No | No (manual request only) | **Requirement ambiguity (CRITICAL)** \u2014 ask what's expected |
7028
+ | No | N/A | Yes | Execution obstacle \u2014 page not deployed yet |
7029
+ | No | N/A | No | **Requirement ambiguity (CRITICAL)** \u2014 ask what was meant |
7030
+
7031
+ **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?"
7032
+
7033
+ **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.
7034
+
6911
7035
  ### Check Memory for Similar Clarifications
6912
7036
 
6913
7037
  Before asking, check if similar question was answered:
@@ -7053,7 +7177,7 @@ When reporting test results, always include an "Ambiguities" section if clarific
7053
7177
  ## Remember
7054
7178
 
7055
7179
  - **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
7056
- - **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
7180
+ - **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
7057
7181
  - **Ask correctly > guess poorly** - Specific questions lead to specific answers
7058
7182
  - **Never invent success criteria** - If the task says "improve" or "fix" without metrics, ask what "done" looks like
7059
7183
  - **Check memory first** - Avoid re-asking previously answered questions
@@ -7997,8 +8121,10 @@ function buildComposedTaskDefinition(taskSlug, projectSubAgents) {
7997
8121
  const configured = projectSubAgents.find((sa) => sa.role === role);
7998
8122
  if (configured) {
7999
8123
  const integrationMeta = getIntegration(configured.integration);
8000
- const mcpProvider = integrationMeta?.provider || configured.integration;
8001
- requiredMCPs.add(mcpProvider);
8124
+ if (integrationMeta?.requiredMCP) {
8125
+ const mcpProvider = integrationMeta.provider || configured.integration;
8126
+ requiredMCPs.add(mcpProvider);
8127
+ }
8002
8128
  }
8003
8129
  }
8004
8130
  const content = contentParts.join("\n\n");
@@ -8253,31 +8379,6 @@ var MCP_SERVERS = {
8253
8379
  }
8254
8380
  }
8255
8381
  },
8256
- playwright: {
8257
- provider: "playwright",
8258
- name: "Playwright",
8259
- description: "Playwright MCP server for browser automation",
8260
- requiresCredentials: false,
8261
- npmPackages: ["@playwright/mcp"],
8262
- config: {
8263
- command: "playwright-mcp",
8264
- args: [
8265
- "--browser",
8266
- "chromium",
8267
- "--secrets",
8268
- ".env",
8269
- "--no-sandbox",
8270
- "--viewport-size",
8271
- "1280x720"
8272
- ]
8273
- },
8274
- containerExtensions: {
8275
- args: ["--headless"],
8276
- env: {
8277
- PLAYWRIGHT_BROWSERS_PATH: "/opt/ms-playwright"
8278
- }
8279
- }
8280
- },
8281
8382
  notion: {
8282
8383
  provider: "notion",
8283
8384
  name: "Notion",