Skip to content

fix: personal squad init via npx discovers ~/.config/squad/ (#576)#580

Merged
bradygaster merged 3 commits intodevfrom
squad/576-personal-squad-init-npx
Mar 24, 2026
Merged

fix: personal squad init via npx discovers ~/.config/squad/ (#576)#580
bradygaster merged 3 commits intodevfrom
squad/576-personal-squad-init-npx

Conversation

@bradygaster
Copy link
Copy Markdown
Owner

Fix: Personal squad init via npx discovers ~/.config/squad/ (#576)

Closes #576

Root Cause

init --global created .squad/ in the global config dir but never created the personal-squad/ subdirectory that resolvePersonalSquadDir() depends on. This meant subsequent repo-level inits couldn't discover the personal squad.

Changes

SDK (squad-sdk)

  • Added ensurePersonalSquadDir() to resolution.ts — idempotent function that creates personal-squad/agents/ and config.json if missing
  • Exported from SDK index

CLI (squad-cli)

  • init.ts: Added isGlobal option to RunInitOptions; global init now calls ensurePersonalSquadDir(); repo-level init detects and reports existing personal squad
  • personal.ts: Refactored personalInit() to use ensurePersonalSquadDir() instead of inline directory creation
  • cli-entry.ts: Passes isGlobal: hasGlobal to runInit()

Tests

  • 35 new tests in test/personal-squad-init.test.ts covering platform path resolution, kill-switch behavior, init structure, repo-level discovery, edge cases
  • 3 new tests in test/resolution.test.ts for ensurePersonalSquadDir()

Verification

  • Build clean, 4942+ tests passing
  • Template sync verified
  • All new tests passing (61 tests, 86ms)

Working as EECOM (Systems) and FIDO (QA)

Copilot AI added 3 commits March 23, 2026 23:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When running `init --global` (e.g. via npx), the personal-squad/
directory was never created, so subsequent `init` in a repo could
not discover the user's personal agents.

Changes:
- SDK: add ensurePersonalSquadDir() — idempotent helper that creates
  personal-squad/agents/ and config.json if missing.
- CLI init --global: suppress workflows (no CI needed in global dir)
  and call ensurePersonalSquadDir() after scaffolding.
- CLI repo-level init: detect existing personal squad and inform user.
- personal.ts: reuse ensurePersonalSquadDir() instead of inline logic.
- Tests: 3 new tests for ensurePersonalSquadDir().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster force-pushed the squad/576-personal-squad-init-npx branch from 9ac7360 to a609176 Compare March 24, 2026 06:58
@bradygaster bradygaster merged commit dcf9fd4 into dev Mar 24, 2026
2 checks passed
@bradygaster bradygaster deleted the squad/576-personal-squad-init-npx branch March 24, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: init --global using npx for personal squad doesn't work

2 participants