You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
squad init: agent invisible when CWD is inside a parent git repo #374
When running squad init in a directory that is a subdirectory of a parent git repository, the Squad agent (.github/agents/squad.agent.md) is created at the CWD but is invisible to copilot --agent squad.
Root cause: Copilot resolves .github/agents/ relative to git rev-parse --show-toplevel (the git root), not relative to CWD. If CWD is inside a parent git repo, the git root points to the parent directory — where the agent file doesn't exist.
Reproduction:
Accidentally run git init in a parent directory (e.g., C:\src\)
mkdir child && cd child
squad init
copilot --agent squad → No such agent: squad
The agent file exists at child/.github/agents/squad.agent.md but copilot looks at parent/.github/agents/ — wrong path.
Fix
Added detectParentGitRepo() to packages/squad-cli/src/cli/core/init.ts:
Compares CWD to git rev-parse --show-toplevel
If they differ, warns the user and auto-runs git init to create a proper repo boundary
Gracefully handles no-git environments (catch block, no crash)
Fixed in commit a9eee03 on dev branch. \detectParentGitRepo()\ added to \packages/squad-cli/src/cli/core/init.ts\ — detects parent git repos during \squad init\ and auto-runs \git init\ to create a proper repo boundary.
Activity
bradygaster commentedon Mar 13, 2026
Fixed in commit a9eee03 on dev branch. \detectParentGitRepo()\ added to \packages/squad-cli/src/cli/core/init.ts\ — detects parent git repos during \squad init\ and auto-runs \git init\ to create a proper repo boundary.
feat: a11y fixes and test coverage (github#382)