Skip to content

squad init --global creates files in wrong location (.squad/ instead of personal-squad/) #53

@diberry

Description

@diberry

Problem

squad init --global creates the squad structure in the wrong location. Agents, casting, and skills end up at ~/.config/squad/.squad/ instead of ~/.config/squad/personal-squad/.

Expected behavior

Personal squad files should be at:

  • ~/.config/squad/personal-squad/agents/
  • ~/.config/squad/personal-squad/casting/
  • ~/.config/squad/personal-squad/skills/

Actual behavior

Files end up at:

  • ~/.config/squad/.squad/agents/ (WRONG - agents here)
  • ~/.config/squad/personal-squad/agents/ (empty)
  • ~/.config/squad/personal-squad/config.json (only file)

Root cause

In cli-entry.ts:274-275, dest is set to resolveGlobalSquadPath() which returns ~/.config/squad/ (the parent). The full init then creates .squad/ inside that parent. The personal-squad/ subdirectory is created separately by ensurePersonalSquadDir() but is nearly empty.

Fix: dest should point to the personal-squad/ subdirectory when --global is set, OR the init flow needs to use personal-squad/ as the teamRoot.

Files involved

File Lines Issue
packages/squad-cli/src/cli-entry.ts 274-275 dest points to parent, not personal-squad/
packages/squad-cli/src/cli/core/init.ts 156-310 Creates .squad/ at wrong level, then empty personal-squad/
packages/squad-sdk/src/resolution.ts 301-324 resolveGlobalSquadPath() returns parent

Impact

  • Personal agents are not discoverable by the ambient discovery system
  • Ghost Protocol routing fails because agents aren't where resolvePersonalSquadDir() looks
  • Users who run squad init --global get a broken personal squad that doesn't work with project squads

Classification

Product bug (not docs). The docs correctly describe the intended structure but the code creates files in the wrong location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions