@bugzy-ai/bugzy 1.18.1 → 1.18.2

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/index.js CHANGED
@@ -221,6 +221,7 @@ var TASK_SLUGS = {
221
221
  RUN_TESTS: "run-tests",
222
222
  VERIFY_CHANGES: "verify-changes",
223
223
  TRIAGE_RESULTS: "triage-results",
224
+ EXPLORE_TEST_CODEBASE: "explore-test-codebase",
224
225
  /** @deprecated Use ONBOARD_TESTING instead */
225
226
  FULL_TEST_COVERAGE: "onboard-testing"
226
227
  };
@@ -2110,6 +2111,93 @@ Output this JSON as the final result of the task.`
2110
2111
  dependentTasks: []
2111
2112
  };
2112
2113
 
2114
+ // src/tasks/library/explore-test-codebase.ts
2115
+ var exploreTestCodebaseTask = {
2116
+ slug: TASK_SLUGS.EXPLORE_TEST_CODEBASE,
2117
+ name: "Explore Test Codebase",
2118
+ description: "Analyze external test repository to understand framework, coverage, and conventions",
2119
+ frontmatter: {
2120
+ description: "Analyze external test codebase for BYOT onboarding",
2121
+ "argument-hint": "--focus [area]"
2122
+ },
2123
+ steps: [
2124
+ // Step 1: Overview (inline)
2125
+ {
2126
+ inline: true,
2127
+ title: "Explore Test Codebase Overview",
2128
+ content: `Analyze the external test repository to understand the testing framework, test coverage, conventions, and codebase structure. This task is triggered during BYOT (Bring Your Own Tests) onboarding to help Bugzy understand the customer's existing test suite.`
2129
+ },
2130
+ // Step 2: Security Notice
2131
+ "security-notice",
2132
+ // Step 3: Arguments (inline)
2133
+ {
2134
+ inline: true,
2135
+ title: "Arguments",
2136
+ content: `**Arguments**: $ARGUMENTS
2137
+
2138
+ **Parse:**
2139
+ - **focus**: specific area to analyze (default: comprehensive)`
2140
+ },
2141
+ // Setup
2142
+ "load-project-context",
2143
+ "read-knowledge-base",
2144
+ // Core analysis
2145
+ "analyze-test-codebase",
2146
+ // Generate results parser for normalizing test output
2147
+ "create-results-parser",
2148
+ // Optional: explore the app itself if URL is available
2149
+ {
2150
+ inline: true,
2151
+ title: "App Exploration (Optional)",
2152
+ content: `If the project has an app URL configured (check \`.bugzy/runtime/project-context.md\` or env vars for TEST_APP_HOST), {{INVOKE_BROWSER_AUTOMATION}} to briefly explore the application:
2153
+
2154
+ 1. Navigate to the app URL
2155
+ 2. Identify main navigation and key pages
2156
+ 3. Map discovered features to test coverage from the codebase analysis
2157
+ 4. Note any features that appear untested
2158
+
2159
+ This step helps correlate what the tests cover with what the application actually contains. Skip if no app URL is available.`,
2160
+ conditionalOnSubagent: "browser-automation"
2161
+ },
2162
+ // Generate output
2163
+ {
2164
+ inline: true,
2165
+ title: "Commit Analysis Results",
2166
+ content: `Commit all analysis artifacts to the project repository:
2167
+
2168
+ 1. The test codebase analysis report (\`.bugzy/runtime/test-codebase-analysis.md\`)
2169
+ 2. Any generated CLAUDE.md draft (if the external repo was missing one)
2170
+
2171
+ Use a clear commit message: "chore: analyze external test codebase"
2172
+
2173
+ These artifacts will be available to all future task executions for this project.`
2174
+ },
2175
+ // Team Communication (conditional)
2176
+ {
2177
+ inline: true,
2178
+ title: "Team Communication",
2179
+ content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the team about the test codebase analysis:
2180
+
2181
+ \`\`\`
2182
+ 1. Post a summary of the analysis findings
2183
+ 2. Include key information:
2184
+ - Test framework and runner identified
2185
+ - Number of test files and estimated test cases
2186
+ - Feature areas covered by existing tests
2187
+ - Any gaps or areas without test coverage
2188
+ 3. Ask if the analysis looks accurate
2189
+ 4. Use appropriate channel and threading
2190
+ \`\`\``,
2191
+ conditionalOnSubagent: "team-communicator"
2192
+ },
2193
+ // Maintenance
2194
+ "update-knowledge-base"
2195
+ ],
2196
+ requiredSubagents: ["browser-automation"],
2197
+ optionalSubagents: ["team-communicator"],
2198
+ dependentTasks: []
2199
+ };
2200
+
2113
2201
  // src/tasks/index.ts
2114
2202
  var TASK_TEMPLATES = {
2115
2203
  [TASK_SLUGS.GENERATE_TEST_CASES]: generateTestCasesTask,
@@ -2120,7 +2208,8 @@ var TASK_TEMPLATES = {
2120
2208
  [TASK_SLUGS.VERIFY_CHANGES]: verifyChangesTask,
2121
2209
  [TASK_SLUGS.ONBOARD_TESTING]: onboardTestingTask,
2122
2210
  [TASK_SLUGS.EXPLORE_APPLICATION]: exploreApplicationTask,
2123
- [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask
2211
+ [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask,
2212
+ [TASK_SLUGS.EXPLORE_TEST_CODEBASE]: exploreTestCodebaseTask
2124
2213
  };
2125
2214
  function getTaskTemplate(slug) {
2126
2215
  return TASK_TEMPLATES[slug];
@@ -5403,6 +5492,89 @@ Requirements clear? \u2192 YES \u2192 Quick Exploration \u2192 Matches? \u2192 Y
5403
5492
  tags: ["exploration", "protocol", "adaptive"]
5404
5493
  };
5405
5494
 
5495
+ // src/tasks/steps/exploration/analyze-test-codebase.ts
5496
+ var analyzeTestCodebaseStep = {
5497
+ id: "analyze-test-codebase",
5498
+ title: "Analyze Test Codebase",
5499
+ category: "exploration",
5500
+ content: `## Analyze External Test Codebase
5501
+
5502
+ Thoroughly analyze the customer's external test repository to understand their testing framework, conventions, coverage, and codebase structure.
5503
+
5504
+ ### Step 1: Check for CLAUDE.md
5505
+
5506
+ Look for a \`CLAUDE.md\` file in the test repository root (\`./tests/CLAUDE.md\` or \`./CLAUDE.md\`). If it exists, read it to understand the project's documented conventions, setup instructions, and testing patterns.
5507
+
5508
+ ### Step 2: Scan Directory Structure
5509
+
5510
+ Examine the repository structure to understand organization:
5511
+ - List top-level directories and files
5512
+ - Identify test directories (e.g., \`tests/\`, \`__tests__/\`, \`e2e/\`, \`spec/\`, \`cypress/\`)
5513
+ - Note configuration files (e.g., \`playwright.config.ts\`, \`cypress.config.ts\`, \`jest.config.js\`, \`vitest.config.ts\`)
5514
+ - Check \`package.json\` for test scripts and dependencies
5515
+
5516
+ ### Step 3: Identify Test Framework
5517
+
5518
+ Determine the testing framework from configuration files and dependencies:
5519
+ - **Playwright**: \`playwright.config.ts\`, \`@playwright/test\` in dependencies
5520
+ - **Cypress**: \`cypress.config.ts\`, \`cypress\` in dependencies
5521
+ - **Jest**: \`jest.config.js\`, \`jest\` in dependencies
5522
+ - **Vitest**: \`vitest.config.ts\`, \`vitest\` in dependencies
5523
+ - **Other**: Check for \`mocha\`, \`ava\`, \`tap\`, custom runners
5524
+
5525
+ Note the test runner, assertion library, and any additional tooling (e.g., \`msw\`, \`testing-library\`, page objects).
5526
+
5527
+ ### Step 4: Catalog Test Coverage
5528
+
5529
+ Analyze test files to understand what's being tested:
5530
+ - Read test file names and directory organization
5531
+ - Parse \`describe()\` / \`it()\` / \`test()\` blocks to understand test structure
5532
+ - Group tests by feature area (e.g., authentication, checkout, user management)
5533
+ - Count total test files and approximate number of test cases
5534
+ - Note any skipped or pending tests
5535
+
5536
+ ### Step 5: Document Conventions
5537
+
5538
+ Identify testing patterns and conventions:
5539
+ - **Naming patterns**: How test files are named (e.g., \`*.spec.ts\`, \`*.test.ts\`, \`*.e2e.ts\`)
5540
+ - **Page Objects / Fixtures**: Look for page object patterns, custom fixtures, or helper utilities
5541
+ - **Data management**: How test data is handled (fixtures, factories, seeds)
5542
+ - **Environment configuration**: How environments are configured (.env files, config objects)
5543
+ - **CI integration**: Check for CI config files (GitHub Actions, CircleCI, etc.)
5544
+
5545
+ ### Step 6: Generate Summary
5546
+
5547
+ Create a structured summary of findings and commit it to the project repository:
5548
+
5549
+ \`\`\`
5550
+ File: .bugzy/runtime/test-codebase-analysis.md
5551
+
5552
+ Contents:
5553
+ - Framework: [name and version]
5554
+ - Test runner: [runner]
5555
+ - Total test files: [count]
5556
+ - Estimated test cases: [count]
5557
+ - Feature areas covered: [list]
5558
+ - Key conventions: [summary]
5559
+ - Directory structure: [overview]
5560
+ - Notable patterns: [page objects, fixtures, etc.]
5561
+ \`\`\`
5562
+
5563
+ ### Step 7: Generate CLAUDE.md (if missing)
5564
+
5565
+ If the external test repository does NOT have a \`CLAUDE.md\`, generate a framework-appropriate draft based on the analysis findings:
5566
+ - Include discovered framework and runner
5567
+ - Document build/run commands from package.json
5568
+ - Note key conventions discovered
5569
+ - Include directory structure overview
5570
+ - Save as a draft for customer review
5571
+
5572
+ **Important**: Do NOT use the Playwright-specific template \u2014 generate content based on what was actually discovered in the repository.
5573
+
5574
+ Commit the analysis results to the project repo so they are available for future task executions.`,
5575
+ tags: ["exploration", "byot", "analysis"]
5576
+ };
5577
+
5406
5578
  // src/tasks/steps/clarification/clarification-protocol.ts
5407
5579
  var clarificationProtocolStep = {
5408
5580
  id: "clarification-protocol",
@@ -6584,6 +6756,7 @@ var STEP_LIBRARY = {
6584
6756
  "gather-documentation": gatherDocumentationStep,
6585
6757
  // Exploration
6586
6758
  "exploration-protocol": explorationProtocolStep,
6759
+ "analyze-test-codebase": analyzeTestCodebaseStep,
6587
6760
  // Clarification
6588
6761
  "clarification-protocol": clarificationProtocolStep,
6589
6762
  // Execution