@bugzy-ai/bugzy 1.18.5 → 1.19.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.
@@ -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
@@ -2861,7 +2781,7 @@ async function startSession(prompt) {
2861
2781
 
2862
2782
  // src/cli/commands/setup.ts
2863
2783
  init_cjs_shims();
2864
- var path11 = __toESM(require("path"), 1);
2784
+ var path12 = __toESM(require("path"), 1);
2865
2785
  var import_chalk2 = __toESM(require("chalk"), 1);
2866
2786
  var import_inquirer = __toESM(require("inquirer"), 1);
2867
2787
  var import_ora2 = __toESM(require("ora"), 1);
@@ -5596,7 +5516,9 @@ async function createProjectStructure(tool = DEFAULT_TOOL) {
5596
5516
  const bugzyDirs = [
5597
5517
  ".bugzy",
5598
5518
  ".bugzy/runtime",
5599
- ".bugzy/runtime/templates"
5519
+ ".bugzy/runtime/templates",
5520
+ ".bugzy/runtime/hooks",
5521
+ ".bugzy/runtime/logs"
5600
5522
  ];
5601
5523
  for (const dir of bugzyDirs) {
5602
5524
  const dirPath = path5.join(cwd, dir);
@@ -5685,6 +5607,15 @@ async function createRuntimeFiles() {
5685
5607
  fs4.writeFileSync(subagentMemoryPath, content, "utf-8");
5686
5608
  }
5687
5609
  }
5610
+ const hookScripts = ["session-start.sh", "pre-compact.sh", "stop.sh"];
5611
+ for (const script of hookScripts) {
5612
+ const destPath = path5.join(cwd, ".bugzy/runtime/hooks", script);
5613
+ const templatePath = path5.join(templatesDir, ".bugzy/runtime/hooks", script);
5614
+ if (fs4.existsSync(templatePath)) {
5615
+ fs4.copyFileSync(templatePath, destPath);
5616
+ fs4.chmodSync(destPath, 493);
5617
+ }
5618
+ }
5688
5619
  const testExecutionStrategyPath = path5.join(cwd, "tests/docs/test-execution-strategy.md");
5689
5620
  if (!fs4.existsSync(testExecutionStrategyPath)) {
5690
5621
  const templatePath = path5.join(templatesDir, "tests/docs/test-execution-strategy.md");
@@ -5759,39 +5690,6 @@ init_tasks();
5759
5690
  // src/tasks/steps/index.ts
5760
5691
  init_cjs_shims();
5761
5692
 
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
5693
  // src/tasks/steps/setup/read-test-strategy.ts
5796
5694
  init_cjs_shims();
5797
5695
  var readTestStrategyStep = {
@@ -5814,39 +5712,6 @@ Apply the strategy guidance when determining which tests to run.
5814
5712
  tags: ["setup", "test-execution", "strategy"]
5815
5713
  };
5816
5714
 
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
5715
  // src/tasks/steps/setup/security-notice.ts
5851
5716
  init_cjs_shims();
5852
5717
  var securityNoticeStep = {
@@ -7085,41 +6950,6 @@ Notify the team about progress and results:
7085
6950
  tags: ["communication", "optional"]
7086
6951
  };
7087
6952
 
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
6953
  // src/tasks/steps/maintenance/generate-final-report.ts
7124
6954
  init_cjs_shims();
7125
6955
  var generateFinalReportStep = {
@@ -7296,14 +7126,47 @@ For each modified test case:
7296
7126
  tags: ["maintenance", "automation", "feedback"]
7297
7127
  };
7298
7128
 
7129
+ // src/tasks/steps/maintenance/update-knowledge-base.ts
7130
+ init_cjs_shims();
7131
+ var updateKnowledgeBaseStep = {
7132
+ id: "update-knowledge-base",
7133
+ title: "Update Knowledge Base",
7134
+ category: "maintenance",
7135
+ content: `## Knowledge Base Maintenance
7136
+
7137
+ After completing your work, update the knowledge base with new insights.
7138
+
7139
+ **Location:** \`.bugzy/runtime/knowledge-base.md\`
7140
+
7141
+ **Process:**
7142
+
7143
+ 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)
7144
+
7145
+ 2. **Review the current knowledge base** to check for overlaps, contradictions, or opportunities to consolidate existing knowledge
7146
+
7147
+ 3. **Update the knowledge base** following the maintenance guide principles:
7148
+ - Favor consolidation over addition
7149
+ - Update rather than append
7150
+ - Resolve contradictions immediately
7151
+ - Focus on quality over completeness
7152
+
7153
+ **What to Add:**
7154
+ - New patterns discovered about the application
7155
+ - Behaviors that differ from expectations
7156
+ - Technical constraints or requirements
7157
+ - Useful selectors or navigation patterns
7158
+ - Error handling patterns
7159
+
7160
+ **Remember:** Every entry should answer "Will this help someone working on this project in 6 months?"`,
7161
+ tags: ["maintenance", "knowledge"]
7162
+ };
7163
+
7299
7164
  // src/tasks/steps/index.ts
7300
7165
  init_types();
7301
7166
  var STEP_LIBRARY = {
7302
7167
  // Setup
7303
7168
  "security-notice": securityNoticeStep,
7304
- "read-knowledge-base": readKnowledgeBaseStep,
7305
7169
  "read-test-strategy": readTestStrategyStep,
7306
- "load-project-context": loadProjectContextStep,
7307
7170
  "gather-documentation": gatherDocumentationStep,
7308
7171
  // Exploration
7309
7172
  "exploration-protocol": explorationProtocolStep,
@@ -7329,12 +7192,12 @@ var STEP_LIBRARY = {
7329
7192
  // Communication
7330
7193
  "notify-team": notifyTeamStep,
7331
7194
  // Maintenance
7332
- "update-knowledge-base": updateKnowledgeBaseStep,
7333
7195
  "generate-final-report": generateFinalReportStep,
7334
7196
  "update-exploration-artifacts": updateExplorationArtifactsStep,
7335
7197
  "cleanup-temp-files": cleanupTempFilesStep,
7336
7198
  "validate-test-artifacts": validateTestArtifactsStep,
7337
- "sync-automation-from-feedback": syncAutomationFromFeedbackStep
7199
+ "sync-automation-from-feedback": syncAutomationFromFeedbackStep,
7200
+ "update-knowledge-base": updateKnowledgeBaseStep
7338
7201
  };
7339
7202
  function getStep(id) {
7340
7203
  const step = STEP_LIBRARY[id];
@@ -7896,17 +7759,85 @@ function getMCPServersFromSubagents(subagents) {
7896
7759
  return Array.from(mcps);
7897
7760
  }
7898
7761
 
7762
+ // src/cli/generators/settings.ts
7763
+ init_cjs_shims();
7764
+ var fs8 = __toESM(require("fs"), 1);
7765
+ var path9 = __toESM(require("path"), 1);
7766
+ function buildAllowPermissions(subagents) {
7767
+ const allow = [
7768
+ // Common permissions
7769
+ "Bash(mkdir:*)",
7770
+ "Bash(git grep:*)",
7771
+ "Bash(git init:*)",
7772
+ "Bash(git --no-pager status --porcelain)",
7773
+ "Bash(git --no-pager diff --stat HEAD)",
7774
+ "Bash(git --no-pager log --oneline -5)",
7775
+ "Bash(git --no-pager status)",
7776
+ "Bash(git --no-pager diff HEAD)"
7777
+ ];
7778
+ if (subagents["browser-automation"]) {
7779
+ allow.push("Bash(playwright-cli:*)");
7780
+ }
7781
+ if (subagents["team-communicator"] === "slack") {
7782
+ allow.push("mcp__slack__slack_list_channels");
7783
+ allow.push("mcp__slack__slack_post_rich_message");
7784
+ }
7785
+ if (subagents["documentation-researcher"] === "notion") {
7786
+ allow.push("mcp__notion__API-post-database-query");
7787
+ allow.push("mcp__notion__API-retrieve-a-database");
7788
+ }
7789
+ return allow;
7790
+ }
7791
+ async function generateSettings(subagents, tool = DEFAULT_TOOL) {
7792
+ if (tool !== "claude-code") {
7793
+ return;
7794
+ }
7795
+ const cwd = process.cwd();
7796
+ const settingsPath = path9.join(cwd, ".claude", "settings.json");
7797
+ const claudeDir = path9.dirname(settingsPath);
7798
+ if (!fs8.existsSync(claudeDir)) {
7799
+ fs8.mkdirSync(claudeDir, { recursive: true });
7800
+ }
7801
+ const hooks = {
7802
+ SessionStart: [{
7803
+ hooks: [{
7804
+ type: "command",
7805
+ command: "bash .bugzy/runtime/hooks/session-start.sh"
7806
+ }]
7807
+ }],
7808
+ PreCompact: [{
7809
+ hooks: [{
7810
+ type: "command",
7811
+ command: "bash .bugzy/runtime/hooks/pre-compact.sh"
7812
+ }]
7813
+ }]
7814
+ };
7815
+ const allow = buildAllowPermissions(subagents);
7816
+ const mcpServers = getMCPServersFromSubagents(subagents);
7817
+ const settings = {
7818
+ hooks,
7819
+ permissions: {
7820
+ allow,
7821
+ deny: ["Read(.env)"],
7822
+ ask: []
7823
+ },
7824
+ enabledMcpjsonServers: mcpServers
7825
+ };
7826
+ const content = JSON.stringify(settings, null, 2);
7827
+ fs8.writeFileSync(settingsPath, content, "utf-8");
7828
+ }
7829
+
7899
7830
  // src/cli/commands/setup.ts
7900
7831
  var import_child_process4 = require("child_process");
7901
7832
 
7902
7833
  // src/cli/generators/env.ts
7903
7834
  init_cjs_shims();
7904
- var fs8 = __toESM(require("fs"), 1);
7905
- var path9 = __toESM(require("path"), 1);
7835
+ var fs9 = __toESM(require("fs"), 1);
7836
+ var path10 = __toESM(require("path"), 1);
7906
7837
  async function generateEnvExample(mcpServers) {
7907
7838
  const cwd = process.cwd();
7908
- const envExamplePath = path9.join(cwd, ".env.example");
7909
- const envPath = path9.join(cwd, ".env");
7839
+ const envExamplePath = path10.join(cwd, ".env.example");
7840
+ const envPath = path10.join(cwd, ".env");
7910
7841
  const header = `# ============================================
7911
7842
  # Bugzy OSS - Environment Variables
7912
7843
  # ============================================
@@ -7937,9 +7868,9 @@ async function generateEnvExample(mcpServers) {
7937
7868
  }
7938
7869
  }
7939
7870
  const content = header + mcpSection + testDataSecretsSection;
7940
- fs8.writeFileSync(envExamplePath, content, "utf-8");
7941
- if (!fs8.existsSync(envPath)) {
7942
- fs8.writeFileSync(envPath, content, "utf-8");
7871
+ fs9.writeFileSync(envExamplePath, content, "utf-8");
7872
+ if (!fs9.existsSync(envPath)) {
7873
+ fs9.writeFileSync(envPath, content, "utf-8");
7943
7874
  }
7944
7875
  }
7945
7876
  function getMCPEnvConfig(serverName) {
@@ -7992,8 +7923,8 @@ RESEND_FROM_EMAIL=`
7992
7923
 
7993
7924
  // src/cli/generators/scaffold-playwright.ts
7994
7925
  init_cjs_shims();
7995
- var fs9 = __toESM(require("fs"), 1);
7996
- var path10 = __toESM(require("path"), 1);
7926
+ var fs10 = __toESM(require("fs"), 1);
7927
+ var path11 = __toESM(require("path"), 1);
7997
7928
  var import_child_process3 = require("child_process");
7998
7929
  async function scaffoldPlaywrightProject(options) {
7999
7930
  const { projectName, targetDir, skipInstall = false } = options;
@@ -8022,25 +7953,25 @@ async function createDirectoryStructure(targetDir) {
8022
7953
  "test-runs"
8023
7954
  ];
8024
7955
  for (const dir of directories) {
8025
- const fullPath = path10.join(targetDir, dir);
8026
- if (!fs9.existsSync(fullPath)) {
8027
- fs9.mkdirSync(fullPath, { recursive: true });
7956
+ const fullPath = path11.join(targetDir, dir);
7957
+ if (!fs10.existsSync(fullPath)) {
7958
+ fs10.mkdirSync(fullPath, { recursive: true });
8028
7959
  console.log(` \u2713 Created ${dir}/`);
8029
7960
  }
8030
7961
  }
8031
7962
  }
8032
7963
  async function copyTemplateFiles(targetDir, projectName) {
8033
7964
  const possiblePaths = [
8034
- path10.join(__dirname, "../../templates/playwright"),
7965
+ path11.join(__dirname, "../../templates/playwright"),
8035
7966
  // When running from dist
8036
- path10.join(process.cwd(), "templates/playwright"),
7967
+ path11.join(process.cwd(), "templates/playwright"),
8037
7968
  // When running from project root
8038
- path10.join(__dirname, "../../../templates/playwright")
7969
+ path11.join(__dirname, "../../../templates/playwright")
8039
7970
  // When running tests
8040
7971
  ];
8041
7972
  let templatesDir = "";
8042
7973
  for (const possiblePath of possiblePaths) {
8043
- if (fs9.existsSync(possiblePath)) {
7974
+ if (fs10.existsSync(possiblePath)) {
8044
7975
  templatesDir = possiblePath;
8045
7976
  break;
8046
7977
  }
@@ -8048,12 +7979,12 @@ async function copyTemplateFiles(targetDir, projectName) {
8048
7979
  if (!templatesDir) {
8049
7980
  throw new Error("Templates directory not found. Searched paths: " + possiblePaths.join(", "));
8050
7981
  }
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");
7982
+ const initTemplatesDir = path11.join(__dirname, "../../templates/init");
7983
+ const testRunsReadmeSrc = path11.join(initTemplatesDir, "test-runs/README.md");
7984
+ const testRunsReadmeDest = path11.join(targetDir, "test-runs/README.md");
7985
+ if (fs10.existsSync(testRunsReadmeSrc)) {
7986
+ const content = fs10.readFileSync(testRunsReadmeSrc, "utf-8");
7987
+ fs10.writeFileSync(testRunsReadmeDest, content, "utf-8");
8057
7988
  console.log(` \u2713 Created test-runs/README.md`);
8058
7989
  }
8059
7990
  const templates = [
@@ -8094,10 +8025,10 @@ async function copyTemplateFiles(targetDir, projectName) {
8094
8025
  }
8095
8026
  ];
8096
8027
  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");
8028
+ const srcPath = path11.join(templatesDir, template.src);
8029
+ const destPath = path11.join(targetDir, template.dest);
8030
+ if (fs10.existsSync(srcPath)) {
8031
+ let content = fs10.readFileSync(srcPath, "utf-8");
8101
8032
  if (template.process) {
8102
8033
  content = processTemplate(content, {
8103
8034
  PROJECT_NAME: projectName,
@@ -8105,11 +8036,11 @@ async function copyTemplateFiles(targetDir, projectName) {
8105
8036
  DATE: (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
8106
8037
  });
8107
8038
  }
8108
- const destDir = path10.dirname(destPath);
8109
- if (!fs9.existsSync(destDir)) {
8110
- fs9.mkdirSync(destDir, { recursive: true });
8039
+ const destDir = path11.dirname(destPath);
8040
+ if (!fs10.existsSync(destDir)) {
8041
+ fs10.mkdirSync(destDir, { recursive: true });
8111
8042
  }
8112
- fs9.writeFileSync(destPath, content, "utf-8");
8043
+ fs10.writeFileSync(destPath, content, "utf-8");
8113
8044
  console.log(` \u2713 Created ${template.dest}`);
8114
8045
  } else {
8115
8046
  console.warn(` \u26A0\uFE0F Template not found: ${template.src}`);
@@ -8125,7 +8056,7 @@ function processTemplate(content, values) {
8125
8056
  return processed;
8126
8057
  }
8127
8058
  async function updateGitignore2(targetDir) {
8128
- const gitignorePath = path10.join(targetDir, ".gitignore");
8059
+ const gitignorePath = path11.join(targetDir, ".gitignore");
8129
8060
  const playwrightEntries = `
8130
8061
  # Playwright
8131
8062
  test-results/
@@ -8133,19 +8064,19 @@ playwright-report/
8133
8064
  tests/.auth/
8134
8065
  .env
8135
8066
  `;
8136
- if (fs9.existsSync(gitignorePath)) {
8137
- const content = fs9.readFileSync(gitignorePath, "utf-8");
8067
+ if (fs10.existsSync(gitignorePath)) {
8068
+ const content = fs10.readFileSync(gitignorePath, "utf-8");
8138
8069
  if (!content.includes("# Playwright")) {
8139
- fs9.appendFileSync(gitignorePath, playwrightEntries);
8070
+ fs10.appendFileSync(gitignorePath, playwrightEntries);
8140
8071
  console.log(" \u2713 Updated .gitignore");
8141
8072
  }
8142
8073
  } else {
8143
- fs9.writeFileSync(gitignorePath, playwrightEntries, "utf-8");
8074
+ fs10.writeFileSync(gitignorePath, playwrightEntries, "utf-8");
8144
8075
  console.log(" \u2713 Created .gitignore");
8145
8076
  }
8146
8077
  }
8147
8078
  async function createPackageJson(targetDir, projectName) {
8148
- const packageJsonPath = path10.join(targetDir, "package.json");
8079
+ const packageJsonPath = path11.join(targetDir, "package.json");
8149
8080
  const recommendedDeps = {
8150
8081
  "@playwright/test": "^1.48.0",
8151
8082
  "@types/node": "^20.0.0",
@@ -8155,7 +8086,7 @@ async function createPackageJson(targetDir, projectName) {
8155
8086
  eslint: "^8.56.0",
8156
8087
  prettier: "^3.1.0"
8157
8088
  };
8158
- if (!fs9.existsSync(packageJsonPath)) {
8089
+ if (!fs10.existsSync(packageJsonPath)) {
8159
8090
  const packageJson2 = {
8160
8091
  name: projectName,
8161
8092
  version: "1.0.0",
@@ -8169,11 +8100,11 @@ async function createPackageJson(targetDir, projectName) {
8169
8100
  keywords: ["testing", "playwright", "automation", "e2e"],
8170
8101
  devDependencies: recommendedDeps
8171
8102
  };
8172
- fs9.writeFileSync(packageJsonPath, JSON.stringify(packageJson2, null, 2) + "\n", "utf-8");
8103
+ fs10.writeFileSync(packageJsonPath, JSON.stringify(packageJson2, null, 2) + "\n", "utf-8");
8173
8104
  console.log(" \u2713 Created package.json");
8174
8105
  return true;
8175
8106
  } else {
8176
- const existing = JSON.parse(fs9.readFileSync(packageJsonPath, "utf-8"));
8107
+ const existing = JSON.parse(fs10.readFileSync(packageJsonPath, "utf-8"));
8177
8108
  existing.devDependencies = existing.devDependencies || {};
8178
8109
  let addedCount = 0;
8179
8110
  const addedPackages = [];
@@ -8185,7 +8116,7 @@ async function createPackageJson(targetDir, projectName) {
8185
8116
  }
8186
8117
  }
8187
8118
  if (addedCount > 0) {
8188
- fs9.writeFileSync(packageJsonPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
8119
+ fs10.writeFileSync(packageJsonPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
8189
8120
  console.log(` \u2713 Added ${addedCount} missing dependencies to package.json`);
8190
8121
  console.log(` ${addedPackages.join(", ")}`);
8191
8122
  return true;
@@ -8212,18 +8143,18 @@ async function installDependencies(targetDir) {
8212
8143
  }
8213
8144
  }
8214
8145
  function detectPackageManager(targetDir) {
8215
- if (fs9.existsSync(path10.join(targetDir, "pnpm-lock.yaml"))) {
8146
+ if (fs10.existsSync(path11.join(targetDir, "pnpm-lock.yaml"))) {
8216
8147
  return "pnpm";
8217
8148
  }
8218
- if (fs9.existsSync(path10.join(targetDir, "yarn.lock"))) {
8149
+ if (fs10.existsSync(path11.join(targetDir, "yarn.lock"))) {
8219
8150
  return "yarn";
8220
8151
  }
8221
8152
  return "npm";
8222
8153
  }
8223
8154
  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);
8155
+ const playwrightConfig = path11.join(targetDir, "playwright.config.ts");
8156
+ const testsDir = path11.join(targetDir, "tests");
8157
+ return fs10.existsSync(playwrightConfig) && fs10.existsSync(testsDir);
8227
8158
  }
8228
8159
 
8229
8160
  // src/cli/commands/setup.ts
@@ -8284,7 +8215,7 @@ async function firstTimeSetup(cliSubagents) {
8284
8215
  `));
8285
8216
  let spinner = (0, import_ora2.default)("Creating project structure").start();
8286
8217
  await createProjectStructure(tool);
8287
- const toolDirName = path11.dirname(toolProfile.commandsDir);
8218
+ const toolDirName = path12.dirname(toolProfile.commandsDir);
8288
8219
  spinner.succeed(import_chalk2.default.green(`Created .bugzy/ and ${toolDirName}/ directories`));
8289
8220
  const subagents = {};
8290
8221
  if (cliSubagents) {
@@ -8374,7 +8305,7 @@ async function firstTimeSetup(cliSubagents) {
8374
8305
  }
8375
8306
  }
8376
8307
  spinner = (0, import_ora2.default)("Saving configuration").start();
8377
- const projectName = path11.basename(process.cwd());
8308
+ const projectName = path12.basename(process.cwd());
8378
8309
  const config = createDefaultConfig(projectName, tool);
8379
8310
  config.subagents = subagents;
8380
8311
  saveConfig(config);
@@ -8582,6 +8513,11 @@ async function regenerateAll(subagents, tool = DEFAULT_TOOL) {
8582
8513
  spinner.succeed(import_chalk2.default.green("MCP configuration ready"));
8583
8514
  await setupCodexMCP(mcpServers);
8584
8515
  }
8516
+ if (tool === "claude-code") {
8517
+ spinner = (0, import_ora2.default)("Generating settings").start();
8518
+ await generateSettings(subagents, tool);
8519
+ spinner.succeed(import_chalk2.default.green("Generated .claude/settings.json (hooks, permissions)"));
8520
+ }
8585
8521
  spinner = (0, import_ora2.default)("Creating environment files").start();
8586
8522
  await generateEnvExample(mcpServers);
8587
8523
  spinner.succeed(import_chalk2.default.green("Created .env and .env.example"));
@@ -8600,7 +8536,7 @@ async function setupCodexMCP(mcpServers) {
8600
8536
  const { args } = buildCodexMCPCommand(serverName);
8601
8537
  (0, import_child_process4.execSync)(["codex", ...args].join(" "), {
8602
8538
  stdio: "pipe",
8603
- env: { ...process.env, CODEX_HOME: path11.join(process.cwd(), ".codex") }
8539
+ env: { ...process.env, CODEX_HOME: path12.join(process.cwd(), ".codex") }
8604
8540
  });
8605
8541
  spinner.succeed(import_chalk2.default.green(`Configured ${serverName}`));
8606
8542
  } catch (error) {