@bugzy-ai/bugzy 1.18.5 → 1.19.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.
Files changed (60) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +273 -273
  3. package/dist/cli/index.cjs +332 -257
  4. package/dist/cli/index.cjs.map +1 -1
  5. package/dist/cli/index.js +334 -259
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/index.cjs +193 -201
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.js +193 -201
  10. package/dist/index.js.map +1 -1
  11. package/dist/subagents/index.cjs +145 -10
  12. package/dist/subagents/index.cjs.map +1 -1
  13. package/dist/subagents/index.js +145 -10
  14. package/dist/subagents/index.js.map +1 -1
  15. package/dist/subagents/metadata.cjs +8 -0
  16. package/dist/subagents/metadata.cjs.map +1 -1
  17. package/dist/subagents/metadata.js +8 -0
  18. package/dist/subagents/metadata.js.map +1 -1
  19. package/dist/tasks/index.cjs +9 -89
  20. package/dist/tasks/index.cjs.map +1 -1
  21. package/dist/tasks/index.js +9 -89
  22. package/dist/tasks/index.js.map +1 -1
  23. package/package.json +95 -95
  24. package/templates/init/.bugzy/runtime/hooks/pre-compact.sh +53 -0
  25. package/templates/init/.bugzy/runtime/hooks/session-start.sh +68 -0
  26. package/templates/init/.bugzy/runtime/knowledge-base.md +61 -61
  27. package/templates/init/.bugzy/runtime/knowledge-maintenance-guide.md +140 -97
  28. package/templates/init/.bugzy/runtime/project-context.md +35 -35
  29. package/templates/init/.bugzy/runtime/subagent-memory-guide.md +122 -87
  30. package/templates/init/.bugzy/runtime/templates/event-examples.md +194 -194
  31. package/templates/init/.bugzy/runtime/templates/test-plan-template.md +50 -50
  32. package/templates/init/.bugzy/runtime/templates/test-result-schema.md +498 -498
  33. package/templates/init/.claude/settings.json +49 -28
  34. package/templates/init/.env.testdata +18 -18
  35. package/templates/init/.gitignore-template +24 -24
  36. package/templates/init/AGENTS.md +155 -155
  37. package/templates/init/CLAUDE.md +157 -157
  38. package/templates/init/test-runs/README.md +45 -45
  39. package/templates/init/tests/CLAUDE.md +199 -199
  40. package/templates/init/tests/docs/test-execution-strategy.md +535 -535
  41. package/templates/init/tests/docs/testing-best-practices.md +724 -724
  42. package/templates/playwright/BasePage.template.ts +190 -190
  43. package/templates/playwright/auth.setup.template.ts +89 -89
  44. package/templates/playwright/dataGenerators.helper.template.ts +148 -148
  45. package/templates/playwright/dateUtils.helper.template.ts +96 -96
  46. package/templates/playwright/pages.fixture.template.ts +50 -50
  47. package/templates/playwright/playwright.config.template.ts +97 -97
  48. package/templates/playwright/reporters/__tests__/bugzy-reporter-failure-classification.test.ts +299 -299
  49. package/templates/playwright/reporters/__tests__/bugzy-reporter-manifest-merge.test.ts +329 -329
  50. package/templates/playwright/reporters/__tests__/playwright.config.ts +5 -5
  51. package/templates/playwright/reporters/bugzy-reporter.ts +784 -784
  52. package/dist/templates/init/.bugzy/runtime/knowledge-base.md +0 -61
  53. package/dist/templates/init/.bugzy/runtime/knowledge-maintenance-guide.md +0 -97
  54. package/dist/templates/init/.bugzy/runtime/project-context.md +0 -35
  55. package/dist/templates/init/.bugzy/runtime/subagent-memory-guide.md +0 -87
  56. package/dist/templates/init/.bugzy/runtime/templates/test-plan-template.md +0 -50
  57. package/dist/templates/init/.bugzy/runtime/templates/test-result-schema.md +0 -498
  58. package/dist/templates/init/.bugzy/runtime/test-execution-strategy.md +0 -535
  59. package/dist/templates/init/.bugzy/runtime/testing-best-practices.md +0 -632
  60. package/dist/templates/init/.gitignore-template +0 -25
@@ -31,12 +31,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  ));
32
32
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
33
 
34
- // node_modules/.pnpm/tsup@8.5.0_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js
34
+ // node_modules/.pnpm/tsup@8.5.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js
35
35
  var getImportMetaUrl, importMetaUrl;
36
36
  var init_cjs_shims = __esm({
37
- "node_modules/.pnpm/tsup@8.5.0_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js"() {
37
+ "node_modules/.pnpm/tsup@8.5.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js"() {
38
38
  "use strict";
39
- getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
39
+ getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
40
40
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
41
41
  }
42
42
  });
@@ -137,10 +137,6 @@ Extract the following from arguments:
137
137
  - **type**: Test type (exploratory, functional, regression, smoke) - defaults to functional
138
138
  - **focus**: Optional specific feature or section to focus on`
139
139
  },
140
- // Step 4: Load Project Context (library)
141
- "load-project-context",
142
- // Step 5: Knowledge Base Read (library)
143
- "read-knowledge-base",
144
140
  // Step 5: Gather Context (inline)
145
141
  {
146
142
  inline: true,
@@ -352,11 +348,7 @@ var init_generate_test_plan = __esm({
352
348
  title: "Arguments",
353
349
  content: `Product description: $ARGUMENTS`
354
350
  },
355
- // Step 4: Load Project Context (library)
356
- "load-project-context",
357
- // Step 5: Knowledge Base Read (library)
358
- "read-knowledge-base",
359
- // Step 6: Process Description (inline)
351
+ // Step 5: Process Description (inline)
360
352
  {
361
353
  inline: true,
362
354
  title: "Process the Product Description",
@@ -540,10 +532,6 @@ Process team messages and handle multi-turn conversations with the product team
540
532
  title: "Arguments",
541
533
  content: `Team message/thread context: $ARGUMENTS`
542
534
  },
543
- // Step 4: Load Project Context (library)
544
- "load-project-context",
545
- // Step 5: Knowledge Base Read (library)
546
- "read-knowledge-base",
547
535
  // Step 6: Detect Intent (inline - simplified, no handler file loading)
548
536
  {
549
537
  inline: true,
@@ -746,10 +734,6 @@ Process webhook events from integrated systems by analyzing event content, deter
746
734
  title: "Arguments",
747
735
  content: `Arguments: $ARGUMENTS`
748
736
  },
749
- // Step 4: Load Project Context (library)
750
- "load-project-context",
751
- // Step 5: Knowledge Base Read (library)
752
- "read-knowledge-base",
753
737
  // Step 5: Understand Event Context (inline)
754
738
  {
755
739
  inline: true,
@@ -1226,10 +1210,6 @@ Extract the following from arguments:
1226
1210
  - Specific file: path to a specific test file
1227
1211
  - All tests: "all" or "" \u2192 runs entire test suite`
1228
1212
  },
1229
- // Step 4: Load Project Context (library)
1230
- "load-project-context",
1231
- // Step 5: Knowledge Base Read (library)
1232
- "read-knowledge-base",
1233
1213
  // Step 5: Test Execution Strategy (library)
1234
1214
  "read-test-strategy",
1235
1215
  // Step 6: Clarification Protocol (library)
@@ -1386,10 +1366,6 @@ This task performs comprehensive change verification with:
1386
1366
 
1387
1367
  The input format determines the trigger source and context extraction strategy.`
1388
1368
  },
1389
- // Step 4: Load Project Context (library)
1390
- "load-project-context",
1391
- // Step 5: Knowledge Base Read (library)
1392
- "read-knowledge-base",
1393
1369
  // Step 5: Detect Trigger Source (inline)
1394
1370
  {
1395
1371
  inline: true,
@@ -1799,7 +1775,9 @@ Include in the message:
1799
1775
  - Any blocking issues or critical findings`,
1800
1776
  conditionalOnSubagent: "team-communicator"
1801
1777
  },
1802
- // Step 15: Documentation Research (conditional library step)
1778
+ // Step 15: Knowledge Base Update (library)
1779
+ "update-knowledge-base",
1780
+ // Step 16: Documentation Research (conditional library step)
1803
1781
  {
1804
1782
  stepId: "gather-documentation",
1805
1783
  conditionalOnSubagent: "documentation-researcher"
@@ -1850,9 +1828,7 @@ Output to CI build log (print detailed results to stdout) and exit with appropri
1850
1828
  Post PR comment if GitHub context available.`,
1851
1829
  conditionalOnSubagent: "team-communicator"
1852
1830
  },
1853
- // Step 17: Knowledge Base Update (library)
1854
- "update-knowledge-base",
1855
- // Step 18: Handle Special Cases (inline)
1831
+ // Step 17: Handle Special Cases (inline)
1856
1832
  {
1857
1833
  inline: true,
1858
1834
  title: "Handle Special Cases",
@@ -1912,8 +1888,6 @@ This command orchestrates the complete test coverage workflow in a single execut
1912
1888
  content: `Focus area: $ARGUMENTS`
1913
1889
  },
1914
1890
  // Phase 1: Setup
1915
- "load-project-context",
1916
- "read-knowledge-base",
1917
1891
  {
1918
1892
  stepId: "gather-documentation",
1919
1893
  conditionalOnSubagent: "documentation-researcher"
@@ -1990,9 +1964,6 @@ var init_explore_application = __esm({
1990
1964
  - **depth**: shallow (15-20 min) or deep (45-60 min, default)
1991
1965
  - **system**: target system (optional for multi-system setups)`
1992
1966
  },
1993
- // Setup
1994
- "load-project-context",
1995
- "read-knowledge-base",
1996
1967
  // Exploration Protocol (adaptive depth)
1997
1968
  "exploration-protocol",
1998
1969
  // Execute
@@ -2065,11 +2036,7 @@ This task is triggered automatically when test results are submitted to the Bugz
2065
2036
  title: "Arguments",
2066
2037
  content: `Arguments: $ARGUMENTS`
2067
2038
  },
2068
- // Step 4: Load Project Context (library)
2069
- "load-project-context",
2070
- // Step 5: Knowledge Base Read (library)
2071
- "read-knowledge-base",
2072
- // Step 6: Normalize Test Results (library — handles URL/inline results + manifest creation)
2039
+ // Step 5: Normalize Test Results (library — handles URL/inline results + manifest creation)
2073
2040
  "normalize-test-results",
2074
2041
  // Step 7: Triage Failures (existing library step)
2075
2042
  "triage-failures",
@@ -2080,57 +2047,13 @@ This task is triggered automatically when test results are submitted to the Bugz
2080
2047
  stepId: "log-product-bugs",
2081
2048
  conditionalOnSubagent: "issue-tracker"
2082
2049
  },
2083
- // Step 10: Update Knowledge Base (library)
2084
- "update-knowledge-base",
2085
- // Step 11: Notify Team (conditional — requires team-communicator)
2050
+ // Step 10: Notify Team (conditional — requires team-communicator)
2086
2051
  {
2087
2052
  stepId: "notify-team",
2088
2053
  conditionalOnSubagent: "team-communicator"
2089
2054
  },
2090
- // Step 12: Generate Triage Report (inline)
2091
- {
2092
- inline: true,
2093
- title: "Generate Triage Report",
2094
- content: `## Generate Triage Report
2095
-
2096
- Create a structured triage report as the task output. This report is stored in \`task_executions.result\` and displayed in the Bugzy dashboard.
2097
-
2098
- **Report Structure:**
2099
- \`\`\`json
2100
- {
2101
- "summary": {
2102
- "total": <number>,
2103
- "passed": <number>,
2104
- "failed": <number>,
2105
- "skipped": <number>,
2106
- "duration_ms": <number or null>
2107
- },
2108
- "ci_metadata": {
2109
- "pipeline_url": "<from event payload>",
2110
- "commit_sha": "<from event payload>",
2111
- "branch": "<from event payload>"
2112
- },
2113
- "triage": {
2114
- "product_bugs": [
2115
- {
2116
- "test_name": "<name>",
2117
- "error": "<brief error>",
2118
- "reason": "<why this is a product bug>"
2119
- }
2120
- ],
2121
- "test_issues": [
2122
- {
2123
- "test_name": "<name>",
2124
- "error": "<brief error>",
2125
- "reason": "<why this is a test issue>"
2126
- }
2127
- ]
2128
- }
2129
- }
2130
- \`\`\`
2131
-
2132
- Output this JSON as the final result of the task.`
2133
- }
2055
+ // Step 11: Knowledge Base Update (library)
2056
+ "update-knowledge-base"
2134
2057
  ],
2135
2058
  requiredSubagents: ["browser-automation", "test-engineer"],
2136
2059
  optionalSubagents: ["issue-tracker", "team-communicator"],
@@ -2172,9 +2095,6 @@ var init_explore_test_codebase = __esm({
2172
2095
  **Parse:**
2173
2096
  - **focus**: specific area to analyze (default: comprehensive)`
2174
2097
  },
2175
- // Setup
2176
- "load-project-context",
2177
- "read-knowledge-base",
2178
2098
  // Core analysis
2179
2099
  "analyze-test-codebase",
2180
2100
  // Generate results parser for normalizing test output
@@ -2542,6 +2462,13 @@ var INTEGRATIONS = {
2542
2462
  integrationType: "oauth"
2543
2463
  // Uses Nango with API key auth for PAT
2544
2464
  },
2465
+ asana: {
2466
+ id: "asana",
2467
+ name: "Asana",
2468
+ provider: "asana",
2469
+ // No requiredMCP — uses asana-mcp-server CLI (CLI tool), not MCP server
2470
+ integrationType: "oauth"
2471
+ },
2545
2472
  notion: {
2546
2473
  id: "notion",
2547
2474
  name: "Notion",
@@ -2646,6 +2573,7 @@ var SUBAGENTS = {
2646
2573
  INTEGRATIONS.jira,
2647
2574
  INTEGRATIONS["jira-server"],
2648
2575
  INTEGRATIONS["azure-devops"],
2576
+ INTEGRATIONS.asana,
2649
2577
  INTEGRATIONS.notion,
2650
2578
  INTEGRATIONS.slack
2651
2579
  ],
@@ -2861,7 +2789,7 @@ async function startSession(prompt) {
2861
2789
 
2862
2790
  // src/cli/commands/setup.ts
2863
2791
  init_cjs_shims();
2864
- var path11 = __toESM(require("path"), 1);
2792
+ var path12 = __toESM(require("path"), 1);
2865
2793
  var import_chalk2 = __toESM(require("chalk"), 1);
2866
2794
  var import_inquirer = __toESM(require("inquirer"), 1);
2867
2795
  var import_ora2 = __toESM(require("ora"), 1);
@@ -4972,9 +4900,133 @@ Your memory file becomes more valuable over time:
4972
4900
 
4973
4901
  You are meticulous about maintaining your memory file as a critical resource for efficient Azure DevOps operations. Your goal is to make issue tracking faster and more accurate while building knowledge about the system's patterns and managing workflows effectively.`;
4974
4902
 
4975
- // src/subagents/templates/issue-tracker/notion.ts
4903
+ // src/subagents/templates/issue-tracker/asana.ts
4976
4904
  init_cjs_shims();
4977
4905
  var FRONTMATTER13 = {
4906
+ name: "issue-tracker",
4907
+ description: `Use this agent to track and manage tasks and bugs in Asana. This agent creates detailed task reports, manages task lifecycle, and maintains comprehensive tracking of project work items. Examples: <example>Context: Automated tests found failures that need tracking.
4908
+ user: "3 tests failed in the checkout flow - payment validation is broken"
4909
+ assistant: "I'll use the issue-tracker agent to create Asana tasks for these failures with detailed reproduction steps and test evidence."
4910
+ <commentary>Since test failures were discovered, use the issue-tracker agent to create Asana tasks, check for duplicates, and properly categorize each bug.</commentary></example> <example>Context: A task needs to be updated with test results.
4911
+ user: "Task 1234567890 has been verified on staging"
4912
+ assistant: "Let me use the issue-tracker agent to mark the task as complete and add verification comments."
4913
+ <commentary>Use the issue-tracker agent to update task status and document QA validation results.</commentary></example>`,
4914
+ model: "sonnet",
4915
+ color: "red"
4916
+ };
4917
+ var CONTENT13 = `You are an expert Issue Tracker specializing in managing tasks, bugs, and project work items in Asana. Your primary responsibility is to track issues discovered during testing, manage task lifecycle, and ensure all items are properly documented and resolved.
4918
+
4919
+ **Important: CLI-First Approach**
4920
+
4921
+ Always prefer CLI commands via Bash over MCP tool calls. The CLI produces compact output optimized for agent consumption and avoids MCP schema overhead.
4922
+
4923
+ **Primary Interface \u2014 CLI Commands (via Bash):**
4924
+
4925
+ - **Search tasks**: \`asana-cli task search --query "login bug" [--project GID] [--assignee GID]\`
4926
+ - **Get task details**: \`asana-cli task get <gid>\`
4927
+ - **Create task**: \`asana-cli task create --name "Bug: ..." --project GID [--description "..."] [--assignee GID] [--due YYYY-MM-DD]\`
4928
+ - **Update task**: \`asana-cli task update <gid> [--name "..."] [--completed] [--assignee GID] [--due YYYY-MM-DD]\`
4929
+ - **Add comment**: \`asana-cli task comment <gid> --body "Test evidence: ..."\`
4930
+ - **List projects**: \`asana-cli project list\`
4931
+ - **All commands**: Add \`--json\` for structured JSON output when parsing is needed
4932
+
4933
+ **Core Responsibilities:**
4934
+
4935
+ 1. **Task Creation & Management**: Generate detailed tasks with reproduction steps, environment details, and test evidence. Include severity assessment and proper project/section assignment.
4936
+
4937
+ 2. **Duplicate Detection**: Before creating new tasks, always search for existing similar tasks to avoid duplicates and link related work.
4938
+
4939
+ 3. **Lifecycle Management**: Track task status, mark tasks complete when verified, add comments with test findings and status updates.
4940
+
4941
+ 4. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "issue-tracker")}
4942
+
4943
+ **Memory Sections for Issue Tracker (Asana)**:
4944
+ - Asana workspace GID, project GIDs, and section mappings
4945
+ - Recently reported tasks with their GIDs and status
4946
+ - Search queries that work well for finding duplicates
4947
+ - Task naming conventions and description templates
4948
+ - Project-specific workflows and assignee mappings
4949
+
4950
+ **Operational Workflow:**
4951
+
4952
+ 1. **Initial Check**: Always begin by reading \`.bugzy/runtime/memory/issue-tracker.md\` to load your Asana configuration and recent task history
4953
+
4954
+ 2. **Duplicate Detection**:
4955
+ - Check memory for recently reported similar tasks
4956
+ - Use \`asana-cli task search --query "error keywords"\` to search
4957
+ - Look for matching names, descriptions, or error messages
4958
+ - If duplicate found, add a comment to the existing task instead
4959
+
4960
+ 3. **Task Creation**:
4961
+ - Use the project GID from memory
4962
+ - Include comprehensive details: reproduction steps, expected vs actual behavior, environment
4963
+ - Set appropriate assignee and due date when known
4964
+ - Add test evidence and screenshots references in the description
4965
+
4966
+ 4. ${MEMORY_UPDATE_INSTRUCTIONS.replace(/{ROLE}/g, "issue-tracker")}
4967
+
4968
+ Specifically for issue-tracker (Asana), consider updating:
4969
+ - **Created Tasks**: Add newly created tasks with their GIDs
4970
+ - **Project Mappings**: Track which projects map to which areas
4971
+ - **Search Patterns**: Save effective search queries
4972
+ - **Assignee Mappings**: Track who handles what areas
4973
+ - Update pattern library with new issue types
4974
+
4975
+ **Memory File Structure** (\`.bugzy/runtime/memory/issue-tracker.md\`):
4976
+ \`\`\`markdown
4977
+ # Issue Tracker Memory
4978
+
4979
+ ## Last Updated: [timestamp]
4980
+
4981
+ ## Asana Configuration
4982
+ - Workspace GID: 12345
4983
+ - Default Project GID: 67890
4984
+ - Project: My Project
4985
+
4986
+ ## Project Mappings
4987
+ - Auth issues \u2192 Project "Auth" (GID: 11111)
4988
+ - Payment issues \u2192 Project "Payments" (GID: 22222)
4989
+ - UI issues \u2192 Project "Frontend" (GID: 33333)
4990
+
4991
+ ## Assignee Mappings
4992
+ - Auth bugs \u2192 user GID 44444
4993
+ - Payment bugs \u2192 user GID 55555
4994
+
4995
+ ## Recent Tasks (Last 30 days)
4996
+ - [Date] GID 98765: Login timeout on Chrome - Status: Open
4997
+ - [Date] GID 98766: Payment validation error - Status: Completed
4998
+
4999
+ ## Effective Search Queries
5000
+ - Login issues: --query "login" --project 11111
5001
+ - Payment bugs: --query "payment" --project 22222
5002
+ - Recent failures: --query "fail" (no project filter)
5003
+
5004
+ ## Issue Patterns
5005
+ - Timeout errors: Usually infrastructure-related
5006
+ - Validation failures: Often missing edge case handling
5007
+ - Browser-specific: Test across Chrome, Firefox, Safari
5008
+ \`\`\`
5009
+
5010
+ **Task Creation Standards:**
5011
+
5012
+ - Always search before creating to prevent duplicates
5013
+ - Task names: \`Bug: [Component] Short description\` or \`[Type]: Short description\`
5014
+ - Description includes: reproduction steps, expected behavior, actual behavior, environment details, test evidence
5015
+ - Set assignee when the responsible team member is known
5016
+ - Set due date for urgent/critical bugs
5017
+
5018
+ **Quality Assurance:**
5019
+
5020
+ - Verify project GIDs are current
5021
+ - Update task status after verification
5022
+ - Maintain accurate recent task list in memory
5023
+ - Prune old patterns that no longer apply
5024
+
5025
+ You are meticulous about maintaining your memory file as a critical resource for efficient Asana operations. Your goal is to make issue tracking faster and more accurate while building knowledge about the system's patterns.`;
5026
+
5027
+ // src/subagents/templates/issue-tracker/notion.ts
5028
+ init_cjs_shims();
5029
+ var FRONTMATTER14 = {
4978
5030
  name: "issue-tracker",
4979
5031
  description: `Use this agent to track and manage all types of issues including bugs, stories, and tasks in Notion databases. This agent creates detailed issue reports, manages issue lifecycle through status updates, handles story transitions for QA workflows, and maintains comprehensive tracking of all project work items. Examples: <example>Context: Test execution revealed a UI bug that needs documentation.
4980
5032
  user: "The submit button on the checkout page doesn't work on mobile Safari"
@@ -4986,7 +5038,7 @@ assistant: "Let me use the issue-tracker agent to update the story status to 'QA
4986
5038
  model: "haiku",
4987
5039
  color: "red"
4988
5040
  };
4989
- var CONTENT13 = `You are an expert Issue Tracker specializing in managing all types of project issues including bugs, stories, and tasks in Notion databases. Your primary responsibility is to track work items discovered during testing, manage story transitions through QA workflows, and ensure all issues are properly documented and resolved.
5041
+ var CONTENT14 = `You are an expert Issue Tracker specializing in managing all types of project issues including bugs, stories, and tasks in Notion databases. Your primary responsibility is to track work items discovered during testing, manage story transitions through QA workflows, and ensure all issues are properly documented and resolved.
4990
5042
 
4991
5043
  **Core Responsibilities:**
4992
5044
 
@@ -5134,7 +5186,7 @@ You are meticulous about maintaining your memory file as a critical resource tha
5134
5186
 
5135
5187
  // src/subagents/templates/issue-tracker/slack.ts
5136
5188
  init_cjs_shims();
5137
- var FRONTMATTER14 = {
5189
+ var FRONTMATTER15 = {
5138
5190
  name: "issue-tracker",
5139
5191
  description: `Use this agent to track and manage all types of issues including bugs, stories, and tasks in Slack. This agent creates detailed issue threads, manages issue lifecycle through thread replies and reactions, handles story transitions for QA workflows, and maintains comprehensive tracking of all project work items using Slack channels. Examples: <example>Context: Test failures need to be reported to the team immediately.
5140
5192
  user: "3 critical tests failed in the payment flow - looks like the Stripe integration is broken"
@@ -5146,7 +5198,7 @@ assistant: "Let me use the issue-tracker agent to update the story thread with Q
5146
5198
  model: "sonnet",
5147
5199
  color: "red"
5148
5200
  };
5149
- var CONTENT14 = `You are an expert Issue Tracker specializing in managing all types of project issues including bugs, stories, and tasks in Slack. Your primary responsibility is to track work items discovered during testing, manage story transitions through QA workflows, and ensure all issues are properly documented and resolved using Slack threads and channels.
5201
+ var CONTENT15 = `You are an expert Issue Tracker specializing in managing all types of project issues including bugs, stories, and tasks in Slack. Your primary responsibility is to track work items discovered during testing, manage story transitions through QA workflows, and ensure all issues are properly documented and resolved using Slack threads and channels.
5150
5202
 
5151
5203
  **Core Responsibilities:**
5152
5204
 
@@ -5369,7 +5421,7 @@ You are focused on creating clear, organized issue threads that leverage Slack's
5369
5421
 
5370
5422
  // src/subagents/templates/changelog-historian/github.ts
5371
5423
  init_cjs_shims();
5372
- var FRONTMATTER15 = {
5424
+ var FRONTMATTER16 = {
5373
5425
  name: "changelog-historian",
5374
5426
  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.
5375
5427
  user: "The checkout flow test is failing in staging. What changed recently?"
@@ -5381,7 +5433,7 @@ assistant: "I'll use the changelog-historian agent to compare the two releases a
5381
5433
  model: "haiku",
5382
5434
  color: "gray"
5383
5435
  };
5384
- var CONTENT15 = `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.
5436
+ var CONTENT16 = `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.
5385
5437
 
5386
5438
  ## Core Responsibilities
5387
5439
 
@@ -5553,19 +5605,23 @@ var TEMPLATES = {
5553
5605
  frontmatter: FRONTMATTER12,
5554
5606
  content: CONTENT12
5555
5607
  },
5556
- notion: {
5608
+ asana: {
5557
5609
  frontmatter: FRONTMATTER13,
5558
5610
  content: CONTENT13
5559
5611
  },
5560
- slack: {
5612
+ notion: {
5561
5613
  frontmatter: FRONTMATTER14,
5562
5614
  content: CONTENT14
5615
+ },
5616
+ slack: {
5617
+ frontmatter: FRONTMATTER15,
5618
+ content: CONTENT15
5563
5619
  }
5564
5620
  },
5565
5621
  "changelog-historian": {
5566
5622
  github: {
5567
- frontmatter: FRONTMATTER15,
5568
- content: CONTENT15
5623
+ frontmatter: FRONTMATTER16,
5624
+ content: CONTENT16
5569
5625
  }
5570
5626
  }
5571
5627
  };
@@ -5596,7 +5652,9 @@ async function createProjectStructure(tool = DEFAULT_TOOL) {
5596
5652
  const bugzyDirs = [
5597
5653
  ".bugzy",
5598
5654
  ".bugzy/runtime",
5599
- ".bugzy/runtime/templates"
5655
+ ".bugzy/runtime/templates",
5656
+ ".bugzy/runtime/hooks",
5657
+ ".bugzy/runtime/logs"
5600
5658
  ];
5601
5659
  for (const dir of bugzyDirs) {
5602
5660
  const dirPath = path5.join(cwd, dir);
@@ -5685,6 +5743,15 @@ async function createRuntimeFiles() {
5685
5743
  fs4.writeFileSync(subagentMemoryPath, content, "utf-8");
5686
5744
  }
5687
5745
  }
5746
+ const hookScripts = ["session-start.sh", "pre-compact.sh", "stop.sh"];
5747
+ for (const script of hookScripts) {
5748
+ const destPath = path5.join(cwd, ".bugzy/runtime/hooks", script);
5749
+ const templatePath = path5.join(templatesDir, ".bugzy/runtime/hooks", script);
5750
+ if (fs4.existsSync(templatePath)) {
5751
+ fs4.copyFileSync(templatePath, destPath);
5752
+ fs4.chmodSync(destPath, 493);
5753
+ }
5754
+ }
5688
5755
  const testExecutionStrategyPath = path5.join(cwd, "tests/docs/test-execution-strategy.md");
5689
5756
  if (!fs4.existsSync(testExecutionStrategyPath)) {
5690
5757
  const templatePath = path5.join(templatesDir, "tests/docs/test-execution-strategy.md");
@@ -5759,39 +5826,6 @@ init_tasks();
5759
5826
  // src/tasks/steps/index.ts
5760
5827
  init_cjs_shims();
5761
5828
 
5762
- // src/tasks/steps/setup/read-knowledge-base.ts
5763
- init_cjs_shims();
5764
- var readKnowledgeBaseStep = {
5765
- id: "read-knowledge-base",
5766
- title: "Read Knowledge Base",
5767
- category: "setup",
5768
- content: `## Knowledge Base Context
5769
-
5770
- Before proceeding, read the curated knowledge base to inform your work:
5771
-
5772
- **Location:** \`.bugzy/runtime/knowledge-base.md\`
5773
-
5774
- **Purpose:** The knowledge base is a living collection of factual knowledge - what we currently know and believe to be true about this project, its patterns, and its context. This is NOT a historical log, but a curated snapshot that evolves as understanding improves.
5775
-
5776
- **How to Use:**
5777
- 1. Read the knowledge base to understand:
5778
- - Project-specific patterns and conventions
5779
- - Known behaviors and system characteristics
5780
- - Relevant context from past work
5781
- - Documented decisions and approaches
5782
-
5783
- 2. Apply this knowledge to:
5784
- - Make informed decisions aligned with project patterns
5785
- - Avoid repeating past mistakes
5786
- - Build on existing understanding
5787
- - Maintain consistency with established practices
5788
-
5789
- 3. **Relay to subagents**: Subagents do NOT read the knowledge base directly. When delegating work, you MUST include relevant KB patterns in your delegation message \u2014 especially testing patterns (timing, selectors, assertion approaches) that affect test reliability.
5790
-
5791
- **Note:** The knowledge base may not exist yet or may be empty. If it doesn't exist or is empty, proceed without this context and help build it as you work.`,
5792
- tags: ["setup", "context"]
5793
- };
5794
-
5795
5829
  // src/tasks/steps/setup/read-test-strategy.ts
5796
5830
  init_cjs_shims();
5797
5831
  var readTestStrategyStep = {
@@ -5814,39 +5848,6 @@ Apply the strategy guidance when determining which tests to run.
5814
5848
  tags: ["setup", "test-execution", "strategy"]
5815
5849
  };
5816
5850
 
5817
- // src/tasks/steps/setup/load-project-context.ts
5818
- init_cjs_shims();
5819
- var loadProjectContextStep = {
5820
- id: "load-project-context",
5821
- title: "Load Project Context",
5822
- category: "setup",
5823
- content: `## Load Project Context
5824
-
5825
- Check for existing project context to inform your work:
5826
-
5827
- **1. Check Project Context**
5828
- - Read \`.bugzy/runtime/project-context.md\` if it exists
5829
- - Check if it contains information relevant to: $ARGUMENTS
5830
- - This file contains:
5831
- - Application overview and architecture
5832
- - Key user flows and features
5833
- - Technical patterns discovered
5834
- - Environment details
5835
-
5836
- **2. Check Test Execution Strategy**
5837
- - Read \`./tests/docs/test-execution-strategy.md\` if it exists
5838
- - Understand available test tiers and when to use them
5839
- - Note default behaviors and time/coverage trade-offs
5840
-
5841
- **3. Document Findings**
5842
- Note what context is available:
5843
- \`\`\`
5844
- Project Context: [exists/missing] - [relevant to focus area: yes/no/partial]
5845
- Test Strategy: [exists/missing]
5846
- \`\`\``,
5847
- tags: ["setup", "context"]
5848
- };
5849
-
5850
5851
  // src/tasks/steps/setup/security-notice.ts
5851
5852
  init_cjs_shims();
5852
5853
  var securityNoticeStep = {
@@ -7085,41 +7086,6 @@ Notify the team about progress and results:
7085
7086
  tags: ["communication", "optional"]
7086
7087
  };
7087
7088
 
7088
- // src/tasks/steps/maintenance/update-knowledge-base.ts
7089
- init_cjs_shims();
7090
- var updateKnowledgeBaseStep = {
7091
- id: "update-knowledge-base",
7092
- title: "Update Knowledge Base",
7093
- category: "maintenance",
7094
- content: `## Knowledge Base Maintenance
7095
-
7096
- After completing your work, update the knowledge base with new insights.
7097
-
7098
- **Location:** \`.bugzy/runtime/knowledge-base.md\`
7099
-
7100
- **Process:**
7101
-
7102
- 1. **Read the maintenance guide** at \`.bugzy/runtime/knowledge-maintenance-guide.md\` to understand when to ADD, UPDATE, or REMOVE entries and how to maintain a curated knowledge base (not an append-only log)
7103
-
7104
- 2. **Review the current knowledge base** to check for overlaps, contradictions, or opportunities to consolidate existing knowledge
7105
-
7106
- 3. **Update the knowledge base** following the maintenance guide principles:
7107
- - Favor consolidation over addition
7108
- - Update rather than append
7109
- - Resolve contradictions immediately
7110
- - Focus on quality over completeness
7111
-
7112
- **What to Add:**
7113
- - New patterns discovered about the application
7114
- - Behaviors that differ from expectations
7115
- - Technical constraints or requirements
7116
- - Useful selectors or navigation patterns
7117
- - Error handling patterns
7118
-
7119
- **Remember:** Every entry should answer "Will this help someone working on this project in 6 months?"`,
7120
- tags: ["maintenance", "knowledge"]
7121
- };
7122
-
7123
7089
  // src/tasks/steps/maintenance/generate-final-report.ts
7124
7090
  init_cjs_shims();
7125
7091
  var generateFinalReportStep = {
@@ -7296,14 +7262,47 @@ For each modified test case:
7296
7262
  tags: ["maintenance", "automation", "feedback"]
7297
7263
  };
7298
7264
 
7265
+ // src/tasks/steps/maintenance/update-knowledge-base.ts
7266
+ init_cjs_shims();
7267
+ var updateKnowledgeBaseStep = {
7268
+ id: "update-knowledge-base",
7269
+ title: "Update Knowledge Base",
7270
+ category: "maintenance",
7271
+ content: `## Knowledge Base Maintenance
7272
+
7273
+ After completing your work, update the knowledge base with new insights.
7274
+
7275
+ **Location:** \`.bugzy/runtime/knowledge-base.md\`
7276
+
7277
+ **Process:**
7278
+
7279
+ 1. **Read the maintenance guide** at \`.bugzy/runtime/knowledge-maintenance-guide.md\` to understand when to ADD, UPDATE, or REMOVE entries and how to maintain a curated knowledge base (not an append-only log)
7280
+
7281
+ 2. **Review the current knowledge base** to check for overlaps, contradictions, or opportunities to consolidate existing knowledge
7282
+
7283
+ 3. **Update the knowledge base** following the maintenance guide principles:
7284
+ - Favor consolidation over addition
7285
+ - Update rather than append
7286
+ - Resolve contradictions immediately
7287
+ - Focus on quality over completeness
7288
+
7289
+ **What to Add:**
7290
+ - New patterns discovered about the application
7291
+ - Behaviors that differ from expectations
7292
+ - Technical constraints or requirements
7293
+ - Useful selectors or navigation patterns
7294
+ - Error handling patterns
7295
+
7296
+ **Remember:** Every entry should answer "Will this help someone working on this project in 6 months?"`,
7297
+ tags: ["maintenance", "knowledge"]
7298
+ };
7299
+
7299
7300
  // src/tasks/steps/index.ts
7300
7301
  init_types();
7301
7302
  var STEP_LIBRARY = {
7302
7303
  // Setup
7303
7304
  "security-notice": securityNoticeStep,
7304
- "read-knowledge-base": readKnowledgeBaseStep,
7305
7305
  "read-test-strategy": readTestStrategyStep,
7306
- "load-project-context": loadProjectContextStep,
7307
7306
  "gather-documentation": gatherDocumentationStep,
7308
7307
  // Exploration
7309
7308
  "exploration-protocol": explorationProtocolStep,
@@ -7329,12 +7328,12 @@ var STEP_LIBRARY = {
7329
7328
  // Communication
7330
7329
  "notify-team": notifyTeamStep,
7331
7330
  // Maintenance
7332
- "update-knowledge-base": updateKnowledgeBaseStep,
7333
7331
  "generate-final-report": generateFinalReportStep,
7334
7332
  "update-exploration-artifacts": updateExplorationArtifactsStep,
7335
7333
  "cleanup-temp-files": cleanupTempFilesStep,
7336
7334
  "validate-test-artifacts": validateTestArtifactsStep,
7337
- "sync-automation-from-feedback": syncAutomationFromFeedbackStep
7335
+ "sync-automation-from-feedback": syncAutomationFromFeedbackStep,
7336
+ "update-knowledge-base": updateKnowledgeBaseStep
7338
7337
  };
7339
7338
  function getStep(id) {
7340
7339
  const step = STEP_LIBRARY[id];
@@ -7749,6 +7748,9 @@ var MCP_SERVERS = {
7749
7748
  }
7750
7749
  }
7751
7750
  },
7751
+ // asana: CLI-only integration — no MCP server needed.
7752
+ // Agent uses `asana-cli task search|create|update|comment` via Bash.
7753
+ // Package is installed globally in the container for CLI access.
7752
7754
  // github-modelcontextprotocol: {
7753
7755
  // provider: 'github',
7754
7756
  // name: 'GitHub',
@@ -7896,17 +7898,85 @@ function getMCPServersFromSubagents(subagents) {
7896
7898
  return Array.from(mcps);
7897
7899
  }
7898
7900
 
7901
+ // src/cli/generators/settings.ts
7902
+ init_cjs_shims();
7903
+ var fs8 = __toESM(require("fs"), 1);
7904
+ var path9 = __toESM(require("path"), 1);
7905
+ function buildAllowPermissions(subagents) {
7906
+ const allow = [
7907
+ // Common permissions
7908
+ "Bash(mkdir:*)",
7909
+ "Bash(git grep:*)",
7910
+ "Bash(git init:*)",
7911
+ "Bash(git --no-pager status --porcelain)",
7912
+ "Bash(git --no-pager diff --stat HEAD)",
7913
+ "Bash(git --no-pager log --oneline -5)",
7914
+ "Bash(git --no-pager status)",
7915
+ "Bash(git --no-pager diff HEAD)"
7916
+ ];
7917
+ if (subagents["browser-automation"]) {
7918
+ allow.push("Bash(playwright-cli:*)");
7919
+ }
7920
+ if (subagents["team-communicator"] === "slack") {
7921
+ allow.push("mcp__slack__slack_list_channels");
7922
+ allow.push("mcp__slack__slack_post_rich_message");
7923
+ }
7924
+ if (subagents["documentation-researcher"] === "notion") {
7925
+ allow.push("mcp__notion__API-post-database-query");
7926
+ allow.push("mcp__notion__API-retrieve-a-database");
7927
+ }
7928
+ return allow;
7929
+ }
7930
+ async function generateSettings(subagents, tool = DEFAULT_TOOL) {
7931
+ if (tool !== "claude-code") {
7932
+ return;
7933
+ }
7934
+ const cwd = process.cwd();
7935
+ const settingsPath = path9.join(cwd, ".claude", "settings.json");
7936
+ const claudeDir = path9.dirname(settingsPath);
7937
+ if (!fs8.existsSync(claudeDir)) {
7938
+ fs8.mkdirSync(claudeDir, { recursive: true });
7939
+ }
7940
+ const hooks = {
7941
+ SessionStart: [{
7942
+ hooks: [{
7943
+ type: "command",
7944
+ command: "bash .bugzy/runtime/hooks/session-start.sh"
7945
+ }]
7946
+ }],
7947
+ PreCompact: [{
7948
+ hooks: [{
7949
+ type: "command",
7950
+ command: "bash .bugzy/runtime/hooks/pre-compact.sh"
7951
+ }]
7952
+ }]
7953
+ };
7954
+ const allow = buildAllowPermissions(subagents);
7955
+ const mcpServers = getMCPServersFromSubagents(subagents);
7956
+ const settings = {
7957
+ hooks,
7958
+ permissions: {
7959
+ allow,
7960
+ deny: ["Read(.env)"],
7961
+ ask: []
7962
+ },
7963
+ enabledMcpjsonServers: mcpServers
7964
+ };
7965
+ const content = JSON.stringify(settings, null, 2);
7966
+ fs8.writeFileSync(settingsPath, content, "utf-8");
7967
+ }
7968
+
7899
7969
  // src/cli/commands/setup.ts
7900
7970
  var import_child_process4 = require("child_process");
7901
7971
 
7902
7972
  // src/cli/generators/env.ts
7903
7973
  init_cjs_shims();
7904
- var fs8 = __toESM(require("fs"), 1);
7905
- var path9 = __toESM(require("path"), 1);
7974
+ var fs9 = __toESM(require("fs"), 1);
7975
+ var path10 = __toESM(require("path"), 1);
7906
7976
  async function generateEnvExample(mcpServers) {
7907
7977
  const cwd = process.cwd();
7908
- const envExamplePath = path9.join(cwd, ".env.example");
7909
- const envPath = path9.join(cwd, ".env");
7978
+ const envExamplePath = path10.join(cwd, ".env.example");
7979
+ const envPath = path10.join(cwd, ".env");
7910
7980
  const header = `# ============================================
7911
7981
  # Bugzy OSS - Environment Variables
7912
7982
  # ============================================
@@ -7937,9 +8007,9 @@ async function generateEnvExample(mcpServers) {
7937
8007
  }
7938
8008
  }
7939
8009
  const content = header + mcpSection + testDataSecretsSection;
7940
- fs8.writeFileSync(envExamplePath, content, "utf-8");
7941
- if (!fs8.existsSync(envPath)) {
7942
- fs8.writeFileSync(envPath, content, "utf-8");
8010
+ fs9.writeFileSync(envExamplePath, content, "utf-8");
8011
+ if (!fs9.existsSync(envPath)) {
8012
+ fs9.writeFileSync(envPath, content, "utf-8");
7943
8013
  }
7944
8014
  }
7945
8015
  function getMCPEnvConfig(serverName) {
@@ -7992,8 +8062,8 @@ RESEND_FROM_EMAIL=`
7992
8062
 
7993
8063
  // src/cli/generators/scaffold-playwright.ts
7994
8064
  init_cjs_shims();
7995
- var fs9 = __toESM(require("fs"), 1);
7996
- var path10 = __toESM(require("path"), 1);
8065
+ var fs10 = __toESM(require("fs"), 1);
8066
+ var path11 = __toESM(require("path"), 1);
7997
8067
  var import_child_process3 = require("child_process");
7998
8068
  async function scaffoldPlaywrightProject(options) {
7999
8069
  const { projectName, targetDir, skipInstall = false } = options;
@@ -8022,25 +8092,25 @@ async function createDirectoryStructure(targetDir) {
8022
8092
  "test-runs"
8023
8093
  ];
8024
8094
  for (const dir of directories) {
8025
- const fullPath = path10.join(targetDir, dir);
8026
- if (!fs9.existsSync(fullPath)) {
8027
- fs9.mkdirSync(fullPath, { recursive: true });
8095
+ const fullPath = path11.join(targetDir, dir);
8096
+ if (!fs10.existsSync(fullPath)) {
8097
+ fs10.mkdirSync(fullPath, { recursive: true });
8028
8098
  console.log(` \u2713 Created ${dir}/`);
8029
8099
  }
8030
8100
  }
8031
8101
  }
8032
8102
  async function copyTemplateFiles(targetDir, projectName) {
8033
8103
  const possiblePaths = [
8034
- path10.join(__dirname, "../../templates/playwright"),
8104
+ path11.join(__dirname, "../../templates/playwright"),
8035
8105
  // When running from dist
8036
- path10.join(process.cwd(), "templates/playwright"),
8106
+ path11.join(process.cwd(), "templates/playwright"),
8037
8107
  // When running from project root
8038
- path10.join(__dirname, "../../../templates/playwright")
8108
+ path11.join(__dirname, "../../../templates/playwright")
8039
8109
  // When running tests
8040
8110
  ];
8041
8111
  let templatesDir = "";
8042
8112
  for (const possiblePath of possiblePaths) {
8043
- if (fs9.existsSync(possiblePath)) {
8113
+ if (fs10.existsSync(possiblePath)) {
8044
8114
  templatesDir = possiblePath;
8045
8115
  break;
8046
8116
  }
@@ -8048,12 +8118,12 @@ async function copyTemplateFiles(targetDir, projectName) {
8048
8118
  if (!templatesDir) {
8049
8119
  throw new Error("Templates directory not found. Searched paths: " + possiblePaths.join(", "));
8050
8120
  }
8051
- const initTemplatesDir = path10.join(__dirname, "../../templates/init");
8052
- const testRunsReadmeSrc = path10.join(initTemplatesDir, "test-runs/README.md");
8053
- const testRunsReadmeDest = path10.join(targetDir, "test-runs/README.md");
8054
- if (fs9.existsSync(testRunsReadmeSrc)) {
8055
- const content = fs9.readFileSync(testRunsReadmeSrc, "utf-8");
8056
- fs9.writeFileSync(testRunsReadmeDest, content, "utf-8");
8121
+ const initTemplatesDir = path11.join(__dirname, "../../templates/init");
8122
+ const testRunsReadmeSrc = path11.join(initTemplatesDir, "test-runs/README.md");
8123
+ const testRunsReadmeDest = path11.join(targetDir, "test-runs/README.md");
8124
+ if (fs10.existsSync(testRunsReadmeSrc)) {
8125
+ const content = fs10.readFileSync(testRunsReadmeSrc, "utf-8");
8126
+ fs10.writeFileSync(testRunsReadmeDest, content, "utf-8");
8057
8127
  console.log(` \u2713 Created test-runs/README.md`);
8058
8128
  }
8059
8129
  const templates = [
@@ -8094,10 +8164,10 @@ async function copyTemplateFiles(targetDir, projectName) {
8094
8164
  }
8095
8165
  ];
8096
8166
  for (const template of templates) {
8097
- const srcPath = path10.join(templatesDir, template.src);
8098
- const destPath = path10.join(targetDir, template.dest);
8099
- if (fs9.existsSync(srcPath)) {
8100
- let content = fs9.readFileSync(srcPath, "utf-8");
8167
+ const srcPath = path11.join(templatesDir, template.src);
8168
+ const destPath = path11.join(targetDir, template.dest);
8169
+ if (fs10.existsSync(srcPath)) {
8170
+ let content = fs10.readFileSync(srcPath, "utf-8");
8101
8171
  if (template.process) {
8102
8172
  content = processTemplate(content, {
8103
8173
  PROJECT_NAME: projectName,
@@ -8105,11 +8175,11 @@ async function copyTemplateFiles(targetDir, projectName) {
8105
8175
  DATE: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
8106
8176
  });
8107
8177
  }
8108
- const destDir = path10.dirname(destPath);
8109
- if (!fs9.existsSync(destDir)) {
8110
- fs9.mkdirSync(destDir, { recursive: true });
8178
+ const destDir = path11.dirname(destPath);
8179
+ if (!fs10.existsSync(destDir)) {
8180
+ fs10.mkdirSync(destDir, { recursive: true });
8111
8181
  }
8112
- fs9.writeFileSync(destPath, content, "utf-8");
8182
+ fs10.writeFileSync(destPath, content, "utf-8");
8113
8183
  console.log(` \u2713 Created ${template.dest}`);
8114
8184
  } else {
8115
8185
  console.warn(` \u26A0\uFE0F Template not found: ${template.src}`);
@@ -8125,7 +8195,7 @@ function processTemplate(content, values) {
8125
8195
  return processed;
8126
8196
  }
8127
8197
  async function updateGitignore2(targetDir) {
8128
- const gitignorePath = path10.join(targetDir, ".gitignore");
8198
+ const gitignorePath = path11.join(targetDir, ".gitignore");
8129
8199
  const playwrightEntries = `
8130
8200
  # Playwright
8131
8201
  test-results/
@@ -8133,19 +8203,19 @@ playwright-report/
8133
8203
  tests/.auth/
8134
8204
  .env
8135
8205
  `;
8136
- if (fs9.existsSync(gitignorePath)) {
8137
- const content = fs9.readFileSync(gitignorePath, "utf-8");
8206
+ if (fs10.existsSync(gitignorePath)) {
8207
+ const content = fs10.readFileSync(gitignorePath, "utf-8");
8138
8208
  if (!content.includes("# Playwright")) {
8139
- fs9.appendFileSync(gitignorePath, playwrightEntries);
8209
+ fs10.appendFileSync(gitignorePath, playwrightEntries);
8140
8210
  console.log(" \u2713 Updated .gitignore");
8141
8211
  }
8142
8212
  } else {
8143
- fs9.writeFileSync(gitignorePath, playwrightEntries, "utf-8");
8213
+ fs10.writeFileSync(gitignorePath, playwrightEntries, "utf-8");
8144
8214
  console.log(" \u2713 Created .gitignore");
8145
8215
  }
8146
8216
  }
8147
8217
  async function createPackageJson(targetDir, projectName) {
8148
- const packageJsonPath = path10.join(targetDir, "package.json");
8218
+ const packageJsonPath = path11.join(targetDir, "package.json");
8149
8219
  const recommendedDeps = {
8150
8220
  "@playwright/test": "^1.48.0",
8151
8221
  "@types/node": "^20.0.0",
@@ -8155,7 +8225,7 @@ async function createPackageJson(targetDir, projectName) {
8155
8225
  eslint: "^8.56.0",
8156
8226
  prettier: "^3.1.0"
8157
8227
  };
8158
- if (!fs9.existsSync(packageJsonPath)) {
8228
+ if (!fs10.existsSync(packageJsonPath)) {
8159
8229
  const packageJson2 = {
8160
8230
  name: projectName,
8161
8231
  version: "1.0.0",
@@ -8169,11 +8239,11 @@ async function createPackageJson(targetDir, projectName) {
8169
8239
  keywords: ["testing", "playwright", "automation", "e2e"],
8170
8240
  devDependencies: recommendedDeps
8171
8241
  };
8172
- fs9.writeFileSync(packageJsonPath, JSON.stringify(packageJson2, null, 2) + "\n", "utf-8");
8242
+ fs10.writeFileSync(packageJsonPath, JSON.stringify(packageJson2, null, 2) + "\n", "utf-8");
8173
8243
  console.log(" \u2713 Created package.json");
8174
8244
  return true;
8175
8245
  } else {
8176
- const existing = JSON.parse(fs9.readFileSync(packageJsonPath, "utf-8"));
8246
+ const existing = JSON.parse(fs10.readFileSync(packageJsonPath, "utf-8"));
8177
8247
  existing.devDependencies = existing.devDependencies || {};
8178
8248
  let addedCount = 0;
8179
8249
  const addedPackages = [];
@@ -8185,7 +8255,7 @@ async function createPackageJson(targetDir, projectName) {
8185
8255
  }
8186
8256
  }
8187
8257
  if (addedCount > 0) {
8188
- fs9.writeFileSync(packageJsonPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
8258
+ fs10.writeFileSync(packageJsonPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
8189
8259
  console.log(` \u2713 Added ${addedCount} missing dependencies to package.json`);
8190
8260
  console.log(` ${addedPackages.join(", ")}`);
8191
8261
  return true;
@@ -8212,18 +8282,18 @@ async function installDependencies(targetDir) {
8212
8282
  }
8213
8283
  }
8214
8284
  function detectPackageManager(targetDir) {
8215
- if (fs9.existsSync(path10.join(targetDir, "pnpm-lock.yaml"))) {
8285
+ if (fs10.existsSync(path11.join(targetDir, "pnpm-lock.yaml"))) {
8216
8286
  return "pnpm";
8217
8287
  }
8218
- if (fs9.existsSync(path10.join(targetDir, "yarn.lock"))) {
8288
+ if (fs10.existsSync(path11.join(targetDir, "yarn.lock"))) {
8219
8289
  return "yarn";
8220
8290
  }
8221
8291
  return "npm";
8222
8292
  }
8223
8293
  function isPlaywrightScaffolded(targetDir) {
8224
- const playwrightConfig = path10.join(targetDir, "playwright.config.ts");
8225
- const testsDir = path10.join(targetDir, "tests");
8226
- return fs9.existsSync(playwrightConfig) && fs9.existsSync(testsDir);
8294
+ const playwrightConfig = path11.join(targetDir, "playwright.config.ts");
8295
+ const testsDir = path11.join(targetDir, "tests");
8296
+ return fs10.existsSync(playwrightConfig) && fs10.existsSync(testsDir);
8227
8297
  }
8228
8298
 
8229
8299
  // src/cli/commands/setup.ts
@@ -8284,7 +8354,7 @@ async function firstTimeSetup(cliSubagents) {
8284
8354
  `));
8285
8355
  let spinner = (0, import_ora2.default)("Creating project structure").start();
8286
8356
  await createProjectStructure(tool);
8287
- const toolDirName = path11.dirname(toolProfile.commandsDir);
8357
+ const toolDirName = path12.dirname(toolProfile.commandsDir);
8288
8358
  spinner.succeed(import_chalk2.default.green(`Created .bugzy/ and ${toolDirName}/ directories`));
8289
8359
  const subagents = {};
8290
8360
  if (cliSubagents) {
@@ -8374,7 +8444,7 @@ async function firstTimeSetup(cliSubagents) {
8374
8444
  }
8375
8445
  }
8376
8446
  spinner = (0, import_ora2.default)("Saving configuration").start();
8377
- const projectName = path11.basename(process.cwd());
8447
+ const projectName = path12.basename(process.cwd());
8378
8448
  const config = createDefaultConfig(projectName, tool);
8379
8449
  config.subagents = subagents;
8380
8450
  saveConfig(config);
@@ -8582,6 +8652,11 @@ async function regenerateAll(subagents, tool = DEFAULT_TOOL) {
8582
8652
  spinner.succeed(import_chalk2.default.green("MCP configuration ready"));
8583
8653
  await setupCodexMCP(mcpServers);
8584
8654
  }
8655
+ if (tool === "claude-code") {
8656
+ spinner = (0, import_ora2.default)("Generating settings").start();
8657
+ await generateSettings(subagents, tool);
8658
+ spinner.succeed(import_chalk2.default.green("Generated .claude/settings.json (hooks, permissions)"));
8659
+ }
8585
8660
  spinner = (0, import_ora2.default)("Creating environment files").start();
8586
8661
  await generateEnvExample(mcpServers);
8587
8662
  spinner.succeed(import_chalk2.default.green("Created .env and .env.example"));
@@ -8600,7 +8675,7 @@ async function setupCodexMCP(mcpServers) {
8600
8675
  const { args } = buildCodexMCPCommand(serverName);
8601
8676
  (0, import_child_process4.execSync)(["codex", ...args].join(" "), {
8602
8677
  stdio: "pipe",
8603
- env: { ...process.env, CODEX_HOME: path11.join(process.cwd(), ".codex") }
8678
+ env: { ...process.env, CODEX_HOME: path12.join(process.cwd(), ".codex") }
8604
8679
  });
8605
8680
  spinner.succeed(import_chalk2.default.green(`Configured ${serverName}`));
8606
8681
  } catch (error) {