buildcrew 1.5.1 → 1.5.2

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 (2) hide show
  1. package/bin/setup.js +24 -2
  2. package/package.json +1 -1
package/bin/setup.js CHANGED
@@ -150,12 +150,25 @@ async function detectProject() {
150
150
  async function runInit(force) {
151
151
  log(`\n ${BOLD}buildcrew init${RESET} v${VERSION}\n`);
152
152
 
153
- if ((await exists(join(HARNESS_DIR, "project.md"))) && !force) {
153
+ const harnessExists = await exists(join(HARNESS_DIR, "project.md"));
154
+
155
+ if (harnessExists && !force) {
154
156
  log(` ${YELLOW}Harness already exists at .claude/harness/${RESET}`);
155
157
  log(` ${DIM}Use ${BOLD}--force${RESET}${DIM} to regenerate. Or just edit the files directly.${RESET}\n`);
156
158
  return;
157
159
  }
158
160
 
161
+ // Backup existing harness before overwriting
162
+ if (harnessExists && force) {
163
+ const backupDir = join(process.cwd(), ".claude", "harness-backup");
164
+ await mkdir(backupDir, { recursive: true });
165
+ const harnessFiles = (await readdir(HARNESS_DIR)).filter(f => f.endsWith(".md"));
166
+ for (const file of harnessFiles) {
167
+ await copyFile(join(HARNESS_DIR, file), join(backupDir, file));
168
+ }
169
+ log(` ${CYAN}Backed up ${harnessFiles.length} harness files → .claude/harness-backup/${RESET}\n`);
170
+ }
171
+
159
172
  log(` ${DIM}Scanning project...${RESET}\n`);
160
173
  const d = await detectProject();
161
174
 
@@ -329,11 +342,20 @@ async function runAdd(type, force) {
329
342
  }
330
343
 
331
344
  const target = join(HARNESS_DIR, `${type}.md`);
332
- if ((await exists(target)) && !force) {
345
+ const targetExists = await exists(target);
346
+ if (targetExists && !force) {
333
347
  log(`\n ${YELLOW}${type}.md already exists.${RESET} Use ${BOLD}--force${RESET} to overwrite.\n`);
334
348
  return;
335
349
  }
336
350
 
351
+ // Backup before overwriting
352
+ if (targetExists && force) {
353
+ const backupDir = join(process.cwd(), ".claude", "harness-backup");
354
+ await mkdir(backupDir, { recursive: true });
355
+ await copyFile(target, join(backupDir, `${type}.md`));
356
+ log(`\n ${CYAN}Backed up ${type}.md → .claude/harness-backup/${RESET}`);
357
+ }
358
+
337
359
  await mkdir(HARNESS_DIR, { recursive: true });
338
360
  await copyFile(join(TEMPLATES_SRC, template.file), target);
339
361
  log(`\n ${GREEN} + ${RESET} .claude/harness/${type}.md`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildcrew",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "11 AI agents for Claude Code — auto-orchestrated dev team with 9 operating modes",
5
5
  "homepage": "https://buildcrew-landing.vercel.app",
6
6
  "author": "z1nun",