bonzai-burn 1.0.10 → 1.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonzai-burn",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Git branch-based cleanup tool with bburn, baccept, and brevert commands",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,4 +1,16 @@
1
1
  {
2
+ "isClaude": false,
3
+ "isCursor": true,
2
4
  "headlessClaude": true,
3
- "autoBurn": false
5
+ "autoBurn": false,
6
+ "lineLimit": {
7
+ "enabled": true,
8
+ "limit": 70,
9
+ "prompt": "Split any file with over {{ linelimit }} lines into smaller files."
10
+ },
11
+ "folderLimit": {
12
+ "enabled": true,
13
+ "limit": 10,
14
+ "prompt": "Split any folder with over {{ folderlimit }} items into smaller, compartmentalized folders."
15
+ }
4
16
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  Define your cleanup requirements below. bburn will follow these instructions.
4
4
 
5
- ## Requirements:
5
+ ## Custom Requirements:
6
6
  - Remove unused imports and variables
7
- - Split any folder with over 10 items into smaller, compartmentalized folders.
8
7
  - Remove all console log statements
9
- - Split any folder with over 100 lines into smaller files
8
+ - Split any file with over {{ linelimit }} lines into smaller files
9
+ - Split any folder with over {{ folderlimit }} items into smaller, compartmentalized folders
package/src/baccept.js CHANGED
File without changes
package/src/bburn.js CHANGED
@@ -73,8 +73,29 @@ function loadConfig(configPath) {
73
73
  }
74
74
  }
75
75
 
76
- function loadSpecs(specsPath) {
77
- const content = fs.readFileSync(specsPath, 'utf-8');
76
+ function loadSpecs(specsPath, config) {
77
+ let content = fs.readFileSync(specsPath, 'utf-8');
78
+
79
+ // Process lineLimit if enabled
80
+ if (config.lineLimit?.enabled) {
81
+ content = content.replace(/\{\{\s*linelimit\s*\}\}/gi, config.lineLimit.limit);
82
+ } else {
83
+ // Remove lines containing {{ linelimit }} if disabled
84
+ content = content.split('\n')
85
+ .filter(line => !/\{\{\s*linelimit\s*\}\}/i.test(line))
86
+ .join('\n');
87
+ }
88
+
89
+ // Process folderLimit if enabled
90
+ if (config.folderLimit?.enabled) {
91
+ content = content.replace(/\{\{\s*folderlimit\s*\}\}/gi, config.folderLimit.limit);
92
+ } else {
93
+ // Remove lines containing {{ folderlimit }} if disabled
94
+ content = content.split('\n')
95
+ .filter(line => !/\{\{\s*folderlimit\s*\}\}/i.test(line))
96
+ .join('\n');
97
+ }
98
+
78
99
  return `You are a code cleanup assistant. Follow these specifications:\n\n${content}`;
79
100
  }
80
101
 
@@ -104,6 +125,7 @@ function executeClaude(requirements, config) {
104
125
  console.log('🖥️ Running in interactive mode...\n');
105
126
  return new Promise((resolve, reject) => {
106
127
  const args = [
128
+ '-p', requirements,
107
129
  '--allowedTools', 'Read,Write,Edit,Bash',
108
130
  '--permission-mode', 'dontAsk'
109
131
  ];
@@ -236,8 +258,8 @@ async function burn() {
236
258
 
237
259
  // Ensure bonzai directory and specs file exist
238
260
  const { specsPath, configPath } = ensureBonzaiDir();
239
- const specs = loadSpecs(specsPath);
240
261
  const config = loadConfig(configPath);
262
+ const specs = loadSpecs(specsPath, config);
241
263
 
242
264
  // Check if Claude CLI exists and execute
243
265
  console.log('🔍 Checking for Claude Code CLI...');