@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/cli/index.cjs +184 -1
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +184 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +174 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +174 -1
- package/dist/index.js.map +1 -1
- package/dist/tasks/index.cjs +90 -1
- package/dist/tasks/index.cjs.map +1 -1
- package/dist/tasks/index.d.cts +1 -0
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.js +90 -1
- package/dist/tasks/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -277,6 +277,7 @@ var TASK_SLUGS = {
|
|
|
277
277
|
RUN_TESTS: "run-tests",
|
|
278
278
|
VERIFY_CHANGES: "verify-changes",
|
|
279
279
|
TRIAGE_RESULTS: "triage-results",
|
|
280
|
+
EXPLORE_TEST_CODEBASE: "explore-test-codebase",
|
|
280
281
|
/** @deprecated Use ONBOARD_TESTING instead */
|
|
281
282
|
FULL_TEST_COVERAGE: "onboard-testing"
|
|
282
283
|
};
|
|
@@ -2166,6 +2167,93 @@ Output this JSON as the final result of the task.`
|
|
|
2166
2167
|
dependentTasks: []
|
|
2167
2168
|
};
|
|
2168
2169
|
|
|
2170
|
+
// src/tasks/library/explore-test-codebase.ts
|
|
2171
|
+
var exploreTestCodebaseTask = {
|
|
2172
|
+
slug: TASK_SLUGS.EXPLORE_TEST_CODEBASE,
|
|
2173
|
+
name: "Explore Test Codebase",
|
|
2174
|
+
description: "Analyze external test repository to understand framework, coverage, and conventions",
|
|
2175
|
+
frontmatter: {
|
|
2176
|
+
description: "Analyze external test codebase for BYOT onboarding",
|
|
2177
|
+
"argument-hint": "--focus [area]"
|
|
2178
|
+
},
|
|
2179
|
+
steps: [
|
|
2180
|
+
// Step 1: Overview (inline)
|
|
2181
|
+
{
|
|
2182
|
+
inline: true,
|
|
2183
|
+
title: "Explore Test Codebase Overview",
|
|
2184
|
+
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.`
|
|
2185
|
+
},
|
|
2186
|
+
// Step 2: Security Notice
|
|
2187
|
+
"security-notice",
|
|
2188
|
+
// Step 3: Arguments (inline)
|
|
2189
|
+
{
|
|
2190
|
+
inline: true,
|
|
2191
|
+
title: "Arguments",
|
|
2192
|
+
content: `**Arguments**: $ARGUMENTS
|
|
2193
|
+
|
|
2194
|
+
**Parse:**
|
|
2195
|
+
- **focus**: specific area to analyze (default: comprehensive)`
|
|
2196
|
+
},
|
|
2197
|
+
// Setup
|
|
2198
|
+
"load-project-context",
|
|
2199
|
+
"read-knowledge-base",
|
|
2200
|
+
// Core analysis
|
|
2201
|
+
"analyze-test-codebase",
|
|
2202
|
+
// Generate results parser for normalizing test output
|
|
2203
|
+
"create-results-parser",
|
|
2204
|
+
// Optional: explore the app itself if URL is available
|
|
2205
|
+
{
|
|
2206
|
+
inline: true,
|
|
2207
|
+
title: "App Exploration (Optional)",
|
|
2208
|
+
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:
|
|
2209
|
+
|
|
2210
|
+
1. Navigate to the app URL
|
|
2211
|
+
2. Identify main navigation and key pages
|
|
2212
|
+
3. Map discovered features to test coverage from the codebase analysis
|
|
2213
|
+
4. Note any features that appear untested
|
|
2214
|
+
|
|
2215
|
+
This step helps correlate what the tests cover with what the application actually contains. Skip if no app URL is available.`,
|
|
2216
|
+
conditionalOnSubagent: "browser-automation"
|
|
2217
|
+
},
|
|
2218
|
+
// Generate output
|
|
2219
|
+
{
|
|
2220
|
+
inline: true,
|
|
2221
|
+
title: "Commit Analysis Results",
|
|
2222
|
+
content: `Commit all analysis artifacts to the project repository:
|
|
2223
|
+
|
|
2224
|
+
1. The test codebase analysis report (\`.bugzy/runtime/test-codebase-analysis.md\`)
|
|
2225
|
+
2. Any generated CLAUDE.md draft (if the external repo was missing one)
|
|
2226
|
+
|
|
2227
|
+
Use a clear commit message: "chore: analyze external test codebase"
|
|
2228
|
+
|
|
2229
|
+
These artifacts will be available to all future task executions for this project.`
|
|
2230
|
+
},
|
|
2231
|
+
// Team Communication (conditional)
|
|
2232
|
+
{
|
|
2233
|
+
inline: true,
|
|
2234
|
+
title: "Team Communication",
|
|
2235
|
+
content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the team about the test codebase analysis:
|
|
2236
|
+
|
|
2237
|
+
\`\`\`
|
|
2238
|
+
1. Post a summary of the analysis findings
|
|
2239
|
+
2. Include key information:
|
|
2240
|
+
- Test framework and runner identified
|
|
2241
|
+
- Number of test files and estimated test cases
|
|
2242
|
+
- Feature areas covered by existing tests
|
|
2243
|
+
- Any gaps or areas without test coverage
|
|
2244
|
+
3. Ask if the analysis looks accurate
|
|
2245
|
+
4. Use appropriate channel and threading
|
|
2246
|
+
\`\`\``,
|
|
2247
|
+
conditionalOnSubagent: "team-communicator"
|
|
2248
|
+
},
|
|
2249
|
+
// Maintenance
|
|
2250
|
+
"update-knowledge-base"
|
|
2251
|
+
],
|
|
2252
|
+
requiredSubagents: ["browser-automation"],
|
|
2253
|
+
optionalSubagents: ["team-communicator"],
|
|
2254
|
+
dependentTasks: []
|
|
2255
|
+
};
|
|
2256
|
+
|
|
2169
2257
|
// src/tasks/index.ts
|
|
2170
2258
|
var TASK_TEMPLATES = {
|
|
2171
2259
|
[TASK_SLUGS.GENERATE_TEST_CASES]: generateTestCasesTask,
|
|
@@ -2176,7 +2264,8 @@ var TASK_TEMPLATES = {
|
|
|
2176
2264
|
[TASK_SLUGS.VERIFY_CHANGES]: verifyChangesTask,
|
|
2177
2265
|
[TASK_SLUGS.ONBOARD_TESTING]: onboardTestingTask,
|
|
2178
2266
|
[TASK_SLUGS.EXPLORE_APPLICATION]: exploreApplicationTask,
|
|
2179
|
-
[TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask
|
|
2267
|
+
[TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask,
|
|
2268
|
+
[TASK_SLUGS.EXPLORE_TEST_CODEBASE]: exploreTestCodebaseTask
|
|
2180
2269
|
};
|
|
2181
2270
|
function getTaskTemplate(slug) {
|
|
2182
2271
|
return TASK_TEMPLATES[slug];
|
|
@@ -5459,6 +5548,89 @@ Requirements clear? \u2192 YES \u2192 Quick Exploration \u2192 Matches? \u2192 Y
|
|
|
5459
5548
|
tags: ["exploration", "protocol", "adaptive"]
|
|
5460
5549
|
};
|
|
5461
5550
|
|
|
5551
|
+
// src/tasks/steps/exploration/analyze-test-codebase.ts
|
|
5552
|
+
var analyzeTestCodebaseStep = {
|
|
5553
|
+
id: "analyze-test-codebase",
|
|
5554
|
+
title: "Analyze Test Codebase",
|
|
5555
|
+
category: "exploration",
|
|
5556
|
+
content: `## Analyze External Test Codebase
|
|
5557
|
+
|
|
5558
|
+
Thoroughly analyze the customer's external test repository to understand their testing framework, conventions, coverage, and codebase structure.
|
|
5559
|
+
|
|
5560
|
+
### Step 1: Check for CLAUDE.md
|
|
5561
|
+
|
|
5562
|
+
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.
|
|
5563
|
+
|
|
5564
|
+
### Step 2: Scan Directory Structure
|
|
5565
|
+
|
|
5566
|
+
Examine the repository structure to understand organization:
|
|
5567
|
+
- List top-level directories and files
|
|
5568
|
+
- Identify test directories (e.g., \`tests/\`, \`__tests__/\`, \`e2e/\`, \`spec/\`, \`cypress/\`)
|
|
5569
|
+
- Note configuration files (e.g., \`playwright.config.ts\`, \`cypress.config.ts\`, \`jest.config.js\`, \`vitest.config.ts\`)
|
|
5570
|
+
- Check \`package.json\` for test scripts and dependencies
|
|
5571
|
+
|
|
5572
|
+
### Step 3: Identify Test Framework
|
|
5573
|
+
|
|
5574
|
+
Determine the testing framework from configuration files and dependencies:
|
|
5575
|
+
- **Playwright**: \`playwright.config.ts\`, \`@playwright/test\` in dependencies
|
|
5576
|
+
- **Cypress**: \`cypress.config.ts\`, \`cypress\` in dependencies
|
|
5577
|
+
- **Jest**: \`jest.config.js\`, \`jest\` in dependencies
|
|
5578
|
+
- **Vitest**: \`vitest.config.ts\`, \`vitest\` in dependencies
|
|
5579
|
+
- **Other**: Check for \`mocha\`, \`ava\`, \`tap\`, custom runners
|
|
5580
|
+
|
|
5581
|
+
Note the test runner, assertion library, and any additional tooling (e.g., \`msw\`, \`testing-library\`, page objects).
|
|
5582
|
+
|
|
5583
|
+
### Step 4: Catalog Test Coverage
|
|
5584
|
+
|
|
5585
|
+
Analyze test files to understand what's being tested:
|
|
5586
|
+
- Read test file names and directory organization
|
|
5587
|
+
- Parse \`describe()\` / \`it()\` / \`test()\` blocks to understand test structure
|
|
5588
|
+
- Group tests by feature area (e.g., authentication, checkout, user management)
|
|
5589
|
+
- Count total test files and approximate number of test cases
|
|
5590
|
+
- Note any skipped or pending tests
|
|
5591
|
+
|
|
5592
|
+
### Step 5: Document Conventions
|
|
5593
|
+
|
|
5594
|
+
Identify testing patterns and conventions:
|
|
5595
|
+
- **Naming patterns**: How test files are named (e.g., \`*.spec.ts\`, \`*.test.ts\`, \`*.e2e.ts\`)
|
|
5596
|
+
- **Page Objects / Fixtures**: Look for page object patterns, custom fixtures, or helper utilities
|
|
5597
|
+
- **Data management**: How test data is handled (fixtures, factories, seeds)
|
|
5598
|
+
- **Environment configuration**: How environments are configured (.env files, config objects)
|
|
5599
|
+
- **CI integration**: Check for CI config files (GitHub Actions, CircleCI, etc.)
|
|
5600
|
+
|
|
5601
|
+
### Step 6: Generate Summary
|
|
5602
|
+
|
|
5603
|
+
Create a structured summary of findings and commit it to the project repository:
|
|
5604
|
+
|
|
5605
|
+
\`\`\`
|
|
5606
|
+
File: .bugzy/runtime/test-codebase-analysis.md
|
|
5607
|
+
|
|
5608
|
+
Contents:
|
|
5609
|
+
- Framework: [name and version]
|
|
5610
|
+
- Test runner: [runner]
|
|
5611
|
+
- Total test files: [count]
|
|
5612
|
+
- Estimated test cases: [count]
|
|
5613
|
+
- Feature areas covered: [list]
|
|
5614
|
+
- Key conventions: [summary]
|
|
5615
|
+
- Directory structure: [overview]
|
|
5616
|
+
- Notable patterns: [page objects, fixtures, etc.]
|
|
5617
|
+
\`\`\`
|
|
5618
|
+
|
|
5619
|
+
### Step 7: Generate CLAUDE.md (if missing)
|
|
5620
|
+
|
|
5621
|
+
If the external test repository does NOT have a \`CLAUDE.md\`, generate a framework-appropriate draft based on the analysis findings:
|
|
5622
|
+
- Include discovered framework and runner
|
|
5623
|
+
- Document build/run commands from package.json
|
|
5624
|
+
- Note key conventions discovered
|
|
5625
|
+
- Include directory structure overview
|
|
5626
|
+
- Save as a draft for customer review
|
|
5627
|
+
|
|
5628
|
+
**Important**: Do NOT use the Playwright-specific template \u2014 generate content based on what was actually discovered in the repository.
|
|
5629
|
+
|
|
5630
|
+
Commit the analysis results to the project repo so they are available for future task executions.`,
|
|
5631
|
+
tags: ["exploration", "byot", "analysis"]
|
|
5632
|
+
};
|
|
5633
|
+
|
|
5462
5634
|
// src/tasks/steps/clarification/clarification-protocol.ts
|
|
5463
5635
|
var clarificationProtocolStep = {
|
|
5464
5636
|
id: "clarification-protocol",
|
|
@@ -6640,6 +6812,7 @@ var STEP_LIBRARY = {
|
|
|
6640
6812
|
"gather-documentation": gatherDocumentationStep,
|
|
6641
6813
|
// Exploration
|
|
6642
6814
|
"exploration-protocol": explorationProtocolStep,
|
|
6815
|
+
"analyze-test-codebase": analyzeTestCodebaseStep,
|
|
6643
6816
|
// Clarification
|
|
6644
6817
|
"clarification-protocol": clarificationProtocolStep,
|
|
6645
6818
|
// Execution
|