@bugzy-ai/bugzy 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.cjs +208 -10
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +208 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +205 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +205 -8
- package/dist/index.js.map +1 -1
- package/dist/subagents/index.cjs +146 -0
- package/dist/subagents/index.cjs.map +1 -1
- package/dist/subagents/index.js +146 -0
- package/dist/subagents/index.js.map +1 -1
- package/dist/subagents/metadata.cjs +18 -0
- package/dist/subagents/metadata.cjs.map +1 -1
- package/dist/subagents/metadata.js +18 -0
- package/dist/subagents/metadata.js.map +1 -1
- package/dist/tasks/index.cjs +30 -1
- package/dist/tasks/index.cjs.map +1 -1
- package/dist/tasks/index.js +30 -1
- package/dist/tasks/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/init/.bugzy/runtime/testing-best-practices.md +93 -1
package/dist/index.js
CHANGED
|
@@ -101,8 +101,22 @@ var MCP_SERVERS = {
|
|
|
101
101
|
RESEND_FROM_EMAIL: "${RESEND_FROM_EMAIL}"
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
},
|
|
105
|
+
github: {
|
|
106
|
+
provider: "github",
|
|
107
|
+
name: "GitHub",
|
|
108
|
+
description: "GitHub MCP server for PR and commit information",
|
|
109
|
+
requiresCredentials: true,
|
|
110
|
+
npmPackages: ["@bugzy-ai/github-mcp-server"],
|
|
111
|
+
config: {
|
|
112
|
+
command: "github-mcp-server",
|
|
113
|
+
args: [],
|
|
114
|
+
env: {
|
|
115
|
+
GITHUB_TOKEN: "${GITHUB_TOKEN}"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
104
118
|
}
|
|
105
|
-
// github: {
|
|
119
|
+
// github-modelcontextprotocol: {
|
|
106
120
|
// provider: 'github',
|
|
107
121
|
// name: 'GitHub',
|
|
108
122
|
// description: 'GitHub MCP server for repository operations',
|
|
@@ -1632,6 +1646,35 @@ CHANGE_CONTEXT = {
|
|
|
1632
1646
|
}
|
|
1633
1647
|
\`\`\``
|
|
1634
1648
|
},
|
|
1649
|
+
// Step 6b: Retrieve Code Change Details (conditional - changelog-historian)
|
|
1650
|
+
{
|
|
1651
|
+
inline: true,
|
|
1652
|
+
title: "Retrieve Code Change Details",
|
|
1653
|
+
content: `{{INVOKE_CHANGELOG_HISTORIAN}} to gather comprehensive context about recent code changes:
|
|
1654
|
+
|
|
1655
|
+
Explore version control history related to the verification scope.
|
|
1656
|
+
|
|
1657
|
+
Specifically gather:
|
|
1658
|
+
- Recent changes merged to the target branch
|
|
1659
|
+
- Change authors and contributors
|
|
1660
|
+
- Scope and impact of each change
|
|
1661
|
+
- Change descriptions and rationale
|
|
1662
|
+
- Related issues or tickets
|
|
1663
|
+
- Files and components affected
|
|
1664
|
+
|
|
1665
|
+
The agent will:
|
|
1666
|
+
1. Check its memory for previously discovered repository context
|
|
1667
|
+
2. Explore version control for relevant changes
|
|
1668
|
+
3. Build comprehensive understanding of the change history
|
|
1669
|
+
4. Return synthesized change information
|
|
1670
|
+
|
|
1671
|
+
Use this information to:
|
|
1672
|
+
- Identify which changes may have caused test failures
|
|
1673
|
+
- Understand the scope and risk of the changes
|
|
1674
|
+
- Enhance the verification report with change attribution
|
|
1675
|
+
- Provide better context for manual verification checklist`,
|
|
1676
|
+
conditionalOnSubagent: "changelog-historian"
|
|
1677
|
+
},
|
|
1635
1678
|
// Step 7: Determine Test Scope (inline)
|
|
1636
1679
|
{
|
|
1637
1680
|
inline: true,
|
|
@@ -1926,7 +1969,7 @@ A successful verification includes:
|
|
|
1926
1969
|
}
|
|
1927
1970
|
],
|
|
1928
1971
|
requiredSubagents: ["test-runner", "test-debugger-fixer"],
|
|
1929
|
-
optionalSubagents: ["documentation-researcher", "issue-tracker", "team-communicator"],
|
|
1972
|
+
optionalSubagents: ["documentation-researcher", "issue-tracker", "team-communicator", "changelog-historian"],
|
|
1930
1973
|
dependentTasks: []
|
|
1931
1974
|
};
|
|
1932
1975
|
|
|
@@ -5027,6 +5070,128 @@ Maintain organized issue tracking:
|
|
|
5027
5070
|
|
|
5028
5071
|
You are focused on creating clear, organized issue threads that leverage Slack's real-time collaboration features while maintaining comprehensive tracking in your memory. Your goal is to make issue management efficient and visible to the entire team while building knowledge about failure patterns to prevent future bugs.`;
|
|
5029
5072
|
|
|
5073
|
+
// src/subagents/templates/changelog-historian/github.ts
|
|
5074
|
+
var FRONTMATTER14 = {
|
|
5075
|
+
name: "changelog-historian",
|
|
5076
|
+
description: `Use this agent when you need to understand what code changes went into a build, deployment, or release. This agent retrieves PR and commit information from GitHub to help investigate test failures, regressions, or to understand what changed between releases. Examples: <example>Context: A test started failing after a deployment.
|
|
5077
|
+
user: "The checkout flow test is failing in staging. What changed recently?"
|
|
5078
|
+
assistant: "Let me use the changelog-historian agent to retrieve the recent PRs and commits that went into this build."
|
|
5079
|
+
<commentary>Since we need to understand what code changes may have caused the test failure, use the changelog-historian agent to retrieve PR and commit details from GitHub.</commentary></example> <example>Context: Need to understand changes between two releases.
|
|
5080
|
+
user: "What changed between v1.2.0 and v1.3.0?"
|
|
5081
|
+
assistant: "I'll use the changelog-historian agent to compare the two releases and list all the changes."
|
|
5082
|
+
<commentary>The agent will use GitHub comparison tools to show all commits and PRs between the two versions.</commentary></example>`,
|
|
5083
|
+
model: "haiku",
|
|
5084
|
+
color: "gray"
|
|
5085
|
+
};
|
|
5086
|
+
var CONTENT14 = `You are an expert Changelog Historian specializing in understanding code changes and their impact. Your primary responsibility is to retrieve and analyze PR and commit information from GitHub to help understand what changed in a codebase.
|
|
5087
|
+
|
|
5088
|
+
## Core Responsibilities
|
|
5089
|
+
|
|
5090
|
+
1. **Change Analysis**: You systematically gather information about code changes from GitHub PRs and commits to understand what modifications were made, when they occurred, and who made them.
|
|
5091
|
+
|
|
5092
|
+
2. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "changelog-historian")}
|
|
5093
|
+
|
|
5094
|
+
**Memory Sections for Changelog Historian**:
|
|
5095
|
+
- Repository information (owner, repo, default branch)
|
|
5096
|
+
- Recent release tags and their commit SHAs
|
|
5097
|
+
- Key PRs and their associated test impacts
|
|
5098
|
+
- Known patterns of changes that cause specific types of failures
|
|
5099
|
+
- Quick reference for common queries (last deployment, recent hotfixes)
|
|
5100
|
+
|
|
5101
|
+
## Available GitHub Tools
|
|
5102
|
+
|
|
5103
|
+
You have access to the following GitHub MCP tools:
|
|
5104
|
+
|
|
5105
|
+
1. **github_list_prs**: List pull requests with filters
|
|
5106
|
+
- Filter by state (open, closed, all)
|
|
5107
|
+
- Filter by base branch (e.g., "main")
|
|
5108
|
+
- Sort by created, updated, popularity, or long-running
|
|
5109
|
+
- Pagination support
|
|
5110
|
+
|
|
5111
|
+
2. **github_get_pr**: Get detailed PR information
|
|
5112
|
+
- Files changed with additions/deletions
|
|
5113
|
+
- Commits in the PR
|
|
5114
|
+
- Labels, reviewers, and status
|
|
5115
|
+
|
|
5116
|
+
3. **github_list_commits**: List commits on a branch
|
|
5117
|
+
- Filter by date range (since, until)
|
|
5118
|
+
- Get commit messages and authors
|
|
5119
|
+
- Pagination support
|
|
5120
|
+
|
|
5121
|
+
4. **github_get_commit**: Get detailed commit information
|
|
5122
|
+
- Full list of file changes
|
|
5123
|
+
- Stats (additions, deletions)
|
|
5124
|
+
- Author and committer details
|
|
5125
|
+
|
|
5126
|
+
5. **github_compare_commits**: Compare two refs
|
|
5127
|
+
- See all commits between two points
|
|
5128
|
+
- Get diff of file changes
|
|
5129
|
+
- Understand what changed between releases
|
|
5130
|
+
|
|
5131
|
+
## Operational Workflow
|
|
5132
|
+
|
|
5133
|
+
1. **Initial Check**: Read \`.bugzy/runtime/memory/changelog-historian.md\` to load repository context and known patterns
|
|
5134
|
+
|
|
5135
|
+
2. **Context Gathering**:
|
|
5136
|
+
- Identify the repository owner and name from context or memory
|
|
5137
|
+
- Determine the relevant time range or refs to analyze
|
|
5138
|
+
- Use appropriate GitHub tools to gather change information
|
|
5139
|
+
|
|
5140
|
+
3. **Change Analysis**:
|
|
5141
|
+
- For recent failures: List recent merged PRs and commits
|
|
5142
|
+
- For release comparison: Use compare_commits between tags/refs
|
|
5143
|
+
- For specific issues: Find PRs/commits related to affected files
|
|
5144
|
+
|
|
5145
|
+
4. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "changelog-historian")}
|
|
5146
|
+
|
|
5147
|
+
Specifically for changelog-historian, consider updating:
|
|
5148
|
+
- **Repository Config**: Store owner/repo if not already known
|
|
5149
|
+
- **Release History**: Note significant release tags encountered
|
|
5150
|
+
- **Impact Patterns**: Record correlations between changes and test impacts
|
|
5151
|
+
- **Hotfix Tracking**: Note emergency fixes for future reference
|
|
5152
|
+
|
|
5153
|
+
## Analysis Best Practices
|
|
5154
|
+
|
|
5155
|
+
- Start with recent merged PRs when investigating failures
|
|
5156
|
+
- Cross-reference PR labels for context (bug, feature, hotfix)
|
|
5157
|
+
- Note file changes that overlap with failing test areas
|
|
5158
|
+
- Look for patterns in commit messages (conventional commits)
|
|
5159
|
+
- Track which changes went into specific environments
|
|
5160
|
+
|
|
5161
|
+
## Query Response Approach
|
|
5162
|
+
|
|
5163
|
+
1. Understand what period or refs the user is asking about
|
|
5164
|
+
2. Check memory for repository context and known patterns
|
|
5165
|
+
3. Use appropriate GitHub tools to gather change data
|
|
5166
|
+
4. Synthesize findings into a clear timeline or comparison
|
|
5167
|
+
5. Highlight changes most likely to impact the area of interest
|
|
5168
|
+
6. Update memory with new findings and patterns
|
|
5169
|
+
|
|
5170
|
+
## Output Format
|
|
5171
|
+
|
|
5172
|
+
When reporting changes, include:
|
|
5173
|
+
- PR number, title, and author
|
|
5174
|
+
- Merge date and target branch
|
|
5175
|
+
- Files changed with brief description
|
|
5176
|
+
- Relevance to the current investigation
|
|
5177
|
+
|
|
5178
|
+
Example output:
|
|
5179
|
+
\`\`\`
|
|
5180
|
+
## Recent Changes (last 7 days)
|
|
5181
|
+
|
|
5182
|
+
### PR #142: Fix checkout validation (merged 2 days ago)
|
|
5183
|
+
- Author: @developer
|
|
5184
|
+
- Files: src/checkout/validation.ts, tests/checkout.spec.ts
|
|
5185
|
+
- Relevance: HIGH - directly affects checkout flow
|
|
5186
|
+
|
|
5187
|
+
### PR #140: Update dependencies (merged 3 days ago)
|
|
5188
|
+
- Author: @maintainer
|
|
5189
|
+
- Files: package.json, package-lock.json
|
|
5190
|
+
- Relevance: MEDIUM - may affect test stability
|
|
5191
|
+
\`\`\`
|
|
5192
|
+
|
|
5193
|
+
You are meticulous about correlating code changes with observed behavior, helping teams quickly identify the root cause of issues by understanding what changed and when.`;
|
|
5194
|
+
|
|
5030
5195
|
// src/subagents/templates/index.ts
|
|
5031
5196
|
var TEMPLATES = {
|
|
5032
5197
|
"test-runner": {
|
|
@@ -5096,6 +5261,12 @@ var TEMPLATES = {
|
|
|
5096
5261
|
frontmatter: FRONTMATTER13,
|
|
5097
5262
|
content: CONTENT13
|
|
5098
5263
|
}
|
|
5264
|
+
},
|
|
5265
|
+
"changelog-historian": {
|
|
5266
|
+
github: {
|
|
5267
|
+
frontmatter: FRONTMATTER14,
|
|
5268
|
+
content: CONTENT14
|
|
5269
|
+
}
|
|
5099
5270
|
}
|
|
5100
5271
|
};
|
|
5101
5272
|
function getTemplate(role, integration) {
|
|
@@ -5179,6 +5350,13 @@ var INTEGRATIONS = {
|
|
|
5179
5350
|
integrationType: "local"
|
|
5180
5351
|
// Uses platform API key, no OAuth needed
|
|
5181
5352
|
},
|
|
5353
|
+
github: {
|
|
5354
|
+
id: "github",
|
|
5355
|
+
name: "GitHub",
|
|
5356
|
+
provider: "github",
|
|
5357
|
+
requiredMCP: "mcp__github__*",
|
|
5358
|
+
integrationType: "oauth"
|
|
5359
|
+
},
|
|
5182
5360
|
local: {
|
|
5183
5361
|
id: "local",
|
|
5184
5362
|
name: "Local (Terminal)",
|
|
@@ -5266,6 +5444,17 @@ var SUBAGENTS = {
|
|
|
5266
5444
|
isRequired: true,
|
|
5267
5445
|
// Required for automated test execution and fixing
|
|
5268
5446
|
version: "1.0.0"
|
|
5447
|
+
},
|
|
5448
|
+
"changelog-historian": {
|
|
5449
|
+
role: "changelog-historian",
|
|
5450
|
+
name: "Changelog Historian",
|
|
5451
|
+
description: "Retrieves and analyzes code changes from GitHub PRs and commits",
|
|
5452
|
+
icon: "git-pull-request",
|
|
5453
|
+
integrations: [INTEGRATIONS.github],
|
|
5454
|
+
model: "haiku",
|
|
5455
|
+
color: "gray",
|
|
5456
|
+
isRequired: false,
|
|
5457
|
+
version: "1.0.0"
|
|
5269
5458
|
}
|
|
5270
5459
|
};
|
|
5271
5460
|
function getAllSubAgents() {
|
|
@@ -5328,24 +5517,30 @@ var TOOL_STRINGS = {
|
|
|
5328
5517
|
INVOKE_TEST_DEBUGGER_FIXER: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "test-debugger-fixer"` to delegate debugging.\nThe agent will analyze failures and fix test code. Include error details and test path in the prompt.',
|
|
5329
5518
|
INVOKE_TEST_CODE_GENERATOR: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "test-code-generator"` to delegate code generation.\nThe agent will create Playwright tests and Page Objects. Include test case files in the prompt.',
|
|
5330
5519
|
INVOKE_TEAM_COMMUNICATOR: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "team-communicator"` to send team notifications.\nThe agent will post to Slack/Teams/Email. Include message content and context in the prompt.',
|
|
5520
|
+
INLINE_TEAM_COMMUNICATOR: "**TEAM COMMUNICATION**: Read `.claude/agents/team-communicator.md` and follow its instructions to communicate with the team.\nUse the tools and guidelines specified in that file within this context. Do NOT spawn a sub-agent.",
|
|
5331
5521
|
INVOKE_ISSUE_TRACKER: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "issue-tracker"` to create/update issues.\nThe agent will interact with Jira. Include bug details and classification in the prompt.',
|
|
5332
|
-
INVOKE_DOCUMENTATION_RESEARCHER: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "documentation-researcher"` to search docs.\nThe agent will search Notion/Confluence. Include search query and context in the prompt.'
|
|
5522
|
+
INVOKE_DOCUMENTATION_RESEARCHER: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "documentation-researcher"` to search docs.\nThe agent will search Notion/Confluence. Include search query and context in the prompt.',
|
|
5523
|
+
INVOKE_CHANGELOG_HISTORIAN: '**DELEGATE TO SUBAGENT**: Use the Task tool with `subagent_type: "changelog-historian"` to retrieve change history.\nThe agent will query GitHub for PRs and commits. Include repo context and date range in the prompt.'
|
|
5333
5524
|
},
|
|
5334
5525
|
"cursor": {
|
|
5335
5526
|
INVOKE_TEST_RUNNER: 'Run the test-runner agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/test-runner.md)" --output-format text\n```',
|
|
5336
5527
|
INVOKE_TEST_DEBUGGER_FIXER: 'Run the test-debugger-fixer agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/test-debugger-fixer.md)" --output-format text\n```',
|
|
5337
5528
|
INVOKE_TEST_CODE_GENERATOR: 'Run the test-code-generator agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/test-code-generator.md)" --output-format text\n```',
|
|
5338
5529
|
INVOKE_TEAM_COMMUNICATOR: 'Run the team-communicator agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/team-communicator.md)" --output-format text\n```',
|
|
5530
|
+
INLINE_TEAM_COMMUNICATOR: "**TEAM COMMUNICATION**: Read `.cursor/agents/team-communicator.md` and follow its instructions to communicate with the team.\nUse the tools and guidelines specified in that file within this context.",
|
|
5339
5531
|
INVOKE_ISSUE_TRACKER: 'Run the issue-tracker agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/issue-tracker.md)" --output-format text\n```',
|
|
5340
|
-
INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/documentation-researcher.md)" --output-format text\n```'
|
|
5532
|
+
INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/documentation-researcher.md)" --output-format text\n```',
|
|
5533
|
+
INVOKE_CHANGELOG_HISTORIAN: 'Run the changelog-historian agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/changelog-historian.md)" --output-format text\n```'
|
|
5341
5534
|
},
|
|
5342
5535
|
"codex": {
|
|
5343
5536
|
INVOKE_TEST_RUNNER: 'Run the test-runner agent:\n```bash\ncodex -p "$(cat .codex/agents/test-runner.md)"\n```',
|
|
5344
5537
|
INVOKE_TEST_DEBUGGER_FIXER: 'Run the test-debugger-fixer agent:\n```bash\ncodex -p "$(cat .codex/agents/test-debugger-fixer.md)"\n```',
|
|
5345
5538
|
INVOKE_TEST_CODE_GENERATOR: 'Run the test-code-generator agent:\n```bash\ncodex -p "$(cat .codex/agents/test-code-generator.md)"\n```',
|
|
5346
5539
|
INVOKE_TEAM_COMMUNICATOR: 'Run the team-communicator agent:\n```bash\ncodex -p "$(cat .codex/agents/team-communicator.md)"\n```',
|
|
5540
|
+
INLINE_TEAM_COMMUNICATOR: "**TEAM COMMUNICATION**: Read `.codex/agents/team-communicator.md` and follow its instructions to communicate with the team.\nUse the tools and guidelines specified in that file within this context.",
|
|
5347
5541
|
INVOKE_ISSUE_TRACKER: 'Run the issue-tracker agent:\n```bash\ncodex -p "$(cat .codex/agents/issue-tracker.md)"\n```',
|
|
5348
|
-
INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncodex -p "$(cat .codex/agents/documentation-researcher.md)"\n```'
|
|
5542
|
+
INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncodex -p "$(cat .codex/agents/documentation-researcher.md)"\n```',
|
|
5543
|
+
INVOKE_CHANGELOG_HISTORIAN: 'Run the changelog-historian agent:\n```bash\ncodex -p "$(cat .codex/agents/changelog-historian.md)"\n```'
|
|
5349
5544
|
}
|
|
5350
5545
|
};
|
|
5351
5546
|
function getToolString(toolId, key) {
|
|
@@ -5359,7 +5554,7 @@ function getToolString(toolId, key) {
|
|
|
5359
5554
|
}
|
|
5360
5555
|
return value;
|
|
5361
5556
|
}
|
|
5362
|
-
function replaceInvocationPlaceholders(content, toolId) {
|
|
5557
|
+
function replaceInvocationPlaceholders(content, toolId, isLocal = false) {
|
|
5363
5558
|
let result = content;
|
|
5364
5559
|
const keys = [
|
|
5365
5560
|
"INVOKE_TEST_RUNNER",
|
|
@@ -5367,11 +5562,13 @@ function replaceInvocationPlaceholders(content, toolId) {
|
|
|
5367
5562
|
"INVOKE_TEST_CODE_GENERATOR",
|
|
5368
5563
|
"INVOKE_TEAM_COMMUNICATOR",
|
|
5369
5564
|
"INVOKE_ISSUE_TRACKER",
|
|
5370
|
-
"INVOKE_DOCUMENTATION_RESEARCHER"
|
|
5565
|
+
"INVOKE_DOCUMENTATION_RESEARCHER",
|
|
5566
|
+
"INVOKE_CHANGELOG_HISTORIAN"
|
|
5371
5567
|
];
|
|
5372
5568
|
for (const key of keys) {
|
|
5373
5569
|
const placeholder = `{{${key}}}`;
|
|
5374
|
-
const
|
|
5570
|
+
const replacementKey = isLocal && key === "INVOKE_TEAM_COMMUNICATOR" ? "INLINE_TEAM_COMMUNICATOR" : key;
|
|
5571
|
+
const replacement = getToolString(toolId, replacementKey);
|
|
5375
5572
|
result = result.replace(new RegExp(placeholder, "g"), replacement);
|
|
5376
5573
|
}
|
|
5377
5574
|
return result;
|