@bugzy-ai/bugzy 1.7.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.js CHANGED
@@ -1550,6 +1550,35 @@ CHANGE_CONTEXT = {
1550
1550
  }
1551
1551
  \`\`\``
1552
1552
  },
1553
+ // Step 6b: Retrieve Code Change Details (conditional - changelog-historian)
1554
+ {
1555
+ inline: true,
1556
+ title: "Retrieve Code Change Details",
1557
+ content: `{{INVOKE_CHANGELOG_HISTORIAN}} to gather comprehensive context about recent code changes:
1558
+
1559
+ Explore version control history related to the verification scope.
1560
+
1561
+ Specifically gather:
1562
+ - Recent changes merged to the target branch
1563
+ - Change authors and contributors
1564
+ - Scope and impact of each change
1565
+ - Change descriptions and rationale
1566
+ - Related issues or tickets
1567
+ - Files and components affected
1568
+
1569
+ The agent will:
1570
+ 1. Check its memory for previously discovered repository context
1571
+ 2. Explore version control for relevant changes
1572
+ 3. Build comprehensive understanding of the change history
1573
+ 4. Return synthesized change information
1574
+
1575
+ Use this information to:
1576
+ - Identify which changes may have caused test failures
1577
+ - Understand the scope and risk of the changes
1578
+ - Enhance the verification report with change attribution
1579
+ - Provide better context for manual verification checklist`,
1580
+ conditionalOnSubagent: "changelog-historian"
1581
+ },
1553
1582
  // Step 7: Determine Test Scope (inline)
1554
1583
  {
1555
1584
  inline: true,
@@ -1844,7 +1873,7 @@ A successful verification includes:
1844
1873
  }
1845
1874
  ],
1846
1875
  requiredSubagents: ["test-runner", "test-debugger-fixer"],
1847
- optionalSubagents: ["documentation-researcher", "issue-tracker", "team-communicator"],
1876
+ optionalSubagents: ["documentation-researcher", "issue-tracker", "team-communicator", "changelog-historian"],
1848
1877
  dependentTasks: []
1849
1878
  };
1850
1879
  }
@@ -5398,6 +5427,129 @@ Maintain organized issue tracking:
5398
5427
 
5399
5428
  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.`;
5400
5429
 
5430
+ // src/subagents/templates/changelog-historian/github.ts
5431
+ init_esm_shims();
5432
+ var FRONTMATTER14 = {
5433
+ name: "changelog-historian",
5434
+ 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.
5435
+ user: "The checkout flow test is failing in staging. What changed recently?"
5436
+ assistant: "Let me use the changelog-historian agent to retrieve the recent PRs and commits that went into this build."
5437
+ <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.
5438
+ user: "What changed between v1.2.0 and v1.3.0?"
5439
+ assistant: "I'll use the changelog-historian agent to compare the two releases and list all the changes."
5440
+ <commentary>The agent will use GitHub comparison tools to show all commits and PRs between the two versions.</commentary></example>`,
5441
+ model: "haiku",
5442
+ color: "gray"
5443
+ };
5444
+ 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.
5445
+
5446
+ ## Core Responsibilities
5447
+
5448
+ 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.
5449
+
5450
+ 2. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "changelog-historian")}
5451
+
5452
+ **Memory Sections for Changelog Historian**:
5453
+ - Repository information (owner, repo, default branch)
5454
+ - Recent release tags and their commit SHAs
5455
+ - Key PRs and their associated test impacts
5456
+ - Known patterns of changes that cause specific types of failures
5457
+ - Quick reference for common queries (last deployment, recent hotfixes)
5458
+
5459
+ ## Available GitHub Tools
5460
+
5461
+ You have access to the following GitHub MCP tools:
5462
+
5463
+ 1. **github_list_prs**: List pull requests with filters
5464
+ - Filter by state (open, closed, all)
5465
+ - Filter by base branch (e.g., "main")
5466
+ - Sort by created, updated, popularity, or long-running
5467
+ - Pagination support
5468
+
5469
+ 2. **github_get_pr**: Get detailed PR information
5470
+ - Files changed with additions/deletions
5471
+ - Commits in the PR
5472
+ - Labels, reviewers, and status
5473
+
5474
+ 3. **github_list_commits**: List commits on a branch
5475
+ - Filter by date range (since, until)
5476
+ - Get commit messages and authors
5477
+ - Pagination support
5478
+
5479
+ 4. **github_get_commit**: Get detailed commit information
5480
+ - Full list of file changes
5481
+ - Stats (additions, deletions)
5482
+ - Author and committer details
5483
+
5484
+ 5. **github_compare_commits**: Compare two refs
5485
+ - See all commits between two points
5486
+ - Get diff of file changes
5487
+ - Understand what changed between releases
5488
+
5489
+ ## Operational Workflow
5490
+
5491
+ 1. **Initial Check**: Read \`.bugzy/runtime/memory/changelog-historian.md\` to load repository context and known patterns
5492
+
5493
+ 2. **Context Gathering**:
5494
+ - Identify the repository owner and name from context or memory
5495
+ - Determine the relevant time range or refs to analyze
5496
+ - Use appropriate GitHub tools to gather change information
5497
+
5498
+ 3. **Change Analysis**:
5499
+ - For recent failures: List recent merged PRs and commits
5500
+ - For release comparison: Use compare_commits between tags/refs
5501
+ - For specific issues: Find PRs/commits related to affected files
5502
+
5503
+ 4. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "changelog-historian")}
5504
+
5505
+ Specifically for changelog-historian, consider updating:
5506
+ - **Repository Config**: Store owner/repo if not already known
5507
+ - **Release History**: Note significant release tags encountered
5508
+ - **Impact Patterns**: Record correlations between changes and test impacts
5509
+ - **Hotfix Tracking**: Note emergency fixes for future reference
5510
+
5511
+ ## Analysis Best Practices
5512
+
5513
+ - Start with recent merged PRs when investigating failures
5514
+ - Cross-reference PR labels for context (bug, feature, hotfix)
5515
+ - Note file changes that overlap with failing test areas
5516
+ - Look for patterns in commit messages (conventional commits)
5517
+ - Track which changes went into specific environments
5518
+
5519
+ ## Query Response Approach
5520
+
5521
+ 1. Understand what period or refs the user is asking about
5522
+ 2. Check memory for repository context and known patterns
5523
+ 3. Use appropriate GitHub tools to gather change data
5524
+ 4. Synthesize findings into a clear timeline or comparison
5525
+ 5. Highlight changes most likely to impact the area of interest
5526
+ 6. Update memory with new findings and patterns
5527
+
5528
+ ## Output Format
5529
+
5530
+ When reporting changes, include:
5531
+ - PR number, title, and author
5532
+ - Merge date and target branch
5533
+ - Files changed with brief description
5534
+ - Relevance to the current investigation
5535
+
5536
+ Example output:
5537
+ \`\`\`
5538
+ ## Recent Changes (last 7 days)
5539
+
5540
+ ### PR #142: Fix checkout validation (merged 2 days ago)
5541
+ - Author: @developer
5542
+ - Files: src/checkout/validation.ts, tests/checkout.spec.ts
5543
+ - Relevance: HIGH - directly affects checkout flow
5544
+
5545
+ ### PR #140: Update dependencies (merged 3 days ago)
5546
+ - Author: @maintainer
5547
+ - Files: package.json, package-lock.json
5548
+ - Relevance: MEDIUM - may affect test stability
5549
+ \`\`\`
5550
+
5551
+ 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.`;
5552
+
5401
5553
  // src/subagents/templates/index.ts
5402
5554
  var TEMPLATES = {
5403
5555
  "test-runner": {
@@ -5467,6 +5619,12 @@ var TEMPLATES = {
5467
5619
  frontmatter: FRONTMATTER13,
5468
5620
  content: CONTENT13
5469
5621
  }
5622
+ },
5623
+ "changelog-historian": {
5624
+ github: {
5625
+ frontmatter: FRONTMATTER14,
5626
+ content: CONTENT14
5627
+ }
5470
5628
  }
5471
5629
  };
5472
5630
  function getTemplate(role, integration) {
@@ -5542,6 +5700,13 @@ var INTEGRATIONS = {
5542
5700
  integrationType: "local"
5543
5701
  // Uses platform API key, no OAuth needed
5544
5702
  },
5703
+ github: {
5704
+ id: "github",
5705
+ name: "GitHub",
5706
+ provider: "github",
5707
+ requiredMCP: "mcp__github__*",
5708
+ integrationType: "oauth"
5709
+ },
5545
5710
  local: {
5546
5711
  id: "local",
5547
5712
  name: "Local (Terminal)",
@@ -5629,6 +5794,17 @@ var SUBAGENTS = {
5629
5794
  isRequired: true,
5630
5795
  // Required for automated test execution and fixing
5631
5796
  version: "1.0.0"
5797
+ },
5798
+ "changelog-historian": {
5799
+ role: "changelog-historian",
5800
+ name: "Changelog Historian",
5801
+ description: "Retrieves and analyzes code changes from GitHub PRs and commits",
5802
+ icon: "git-pull-request",
5803
+ integrations: [INTEGRATIONS.github],
5804
+ model: "haiku",
5805
+ color: "gray",
5806
+ isRequired: false,
5807
+ version: "1.0.0"
5632
5808
  }
5633
5809
  };
5634
5810
  function getAllSubAgents() {
@@ -7358,7 +7534,8 @@ var TOOL_STRINGS = {
7358
7534
  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.',
7359
7535
  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.",
7360
7536
  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.',
7361
- 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.'
7537
+ 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.',
7538
+ 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.'
7362
7539
  },
7363
7540
  "cursor": {
7364
7541
  INVOKE_TEST_RUNNER: 'Run the test-runner agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/test-runner.md)" --output-format text\n```',
@@ -7367,7 +7544,8 @@ var TOOL_STRINGS = {
7367
7544
  INVOKE_TEAM_COMMUNICATOR: 'Run the team-communicator agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/team-communicator.md)" --output-format text\n```',
7368
7545
  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.",
7369
7546
  INVOKE_ISSUE_TRACKER: 'Run the issue-tracker agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/issue-tracker.md)" --output-format text\n```',
7370
- INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/documentation-researcher.md)" --output-format text\n```'
7547
+ INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/documentation-researcher.md)" --output-format text\n```',
7548
+ INVOKE_CHANGELOG_HISTORIAN: 'Run the changelog-historian agent:\n```bash\ncursor-agent -p "$(cat .cursor/agents/changelog-historian.md)" --output-format text\n```'
7371
7549
  },
7372
7550
  "codex": {
7373
7551
  INVOKE_TEST_RUNNER: 'Run the test-runner agent:\n```bash\ncodex -p "$(cat .codex/agents/test-runner.md)"\n```',
@@ -7376,7 +7554,8 @@ var TOOL_STRINGS = {
7376
7554
  INVOKE_TEAM_COMMUNICATOR: 'Run the team-communicator agent:\n```bash\ncodex -p "$(cat .codex/agents/team-communicator.md)"\n```',
7377
7555
  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.",
7378
7556
  INVOKE_ISSUE_TRACKER: 'Run the issue-tracker agent:\n```bash\ncodex -p "$(cat .codex/agents/issue-tracker.md)"\n```',
7379
- INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncodex -p "$(cat .codex/agents/documentation-researcher.md)"\n```'
7557
+ INVOKE_DOCUMENTATION_RESEARCHER: 'Run the documentation-researcher agent:\n```bash\ncodex -p "$(cat .codex/agents/documentation-researcher.md)"\n```',
7558
+ INVOKE_CHANGELOG_HISTORIAN: 'Run the changelog-historian agent:\n```bash\ncodex -p "$(cat .codex/agents/changelog-historian.md)"\n```'
7380
7559
  }
7381
7560
  };
7382
7561
  function getToolString(toolId, key) {
@@ -7398,7 +7577,8 @@ function replaceInvocationPlaceholders(content, toolId, isLocal = false) {
7398
7577
  "INVOKE_TEST_CODE_GENERATOR",
7399
7578
  "INVOKE_TEAM_COMMUNICATOR",
7400
7579
  "INVOKE_ISSUE_TRACKER",
7401
- "INVOKE_DOCUMENTATION_RESEARCHER"
7580
+ "INVOKE_DOCUMENTATION_RESEARCHER",
7581
+ "INVOKE_CHANGELOG_HISTORIAN"
7402
7582
  ];
7403
7583
  for (const key of keys) {
7404
7584
  const placeholder = `{{${key}}}`;
@@ -7652,8 +7832,22 @@ var MCP_SERVERS = {
7652
7832
  RESEND_FROM_EMAIL: "${RESEND_FROM_EMAIL}"
7653
7833
  }
7654
7834
  }
7835
+ },
7836
+ github: {
7837
+ provider: "github",
7838
+ name: "GitHub",
7839
+ description: "GitHub MCP server for PR and commit information",
7840
+ requiresCredentials: true,
7841
+ npmPackages: ["@bugzy-ai/github-mcp-server"],
7842
+ config: {
7843
+ command: "github-mcp-server",
7844
+ args: [],
7845
+ env: {
7846
+ GITHUB_TOKEN: "${GITHUB_TOKEN}"
7847
+ }
7848
+ }
7655
7849
  }
7656
- // github: {
7850
+ // github-modelcontextprotocol: {
7657
7851
  // provider: 'github',
7658
7852
  // name: 'GitHub',
7659
7853
  // description: 'GitHub MCP server for repository operations',