Skip to content

feat(cli): add squad doctor diagnostic command#182

Closed
KalebCole wants to merge 1 commit intobradygaster:mainfrom
KalebCole:feat/doctor-command
Closed

feat(cli): add squad doctor diagnostic command#182
KalebCole wants to merge 1 commit intobradygaster:mainfrom
KalebCole:feat/doctor-command

Conversation

@KalebCole
Copy link
Copy Markdown

What

Adds a \squad doctor\ subcommand that runs 9 diagnostic checks to help users troubleshoot setup issues — especially when /agent\ doesn't show Squad in Copilot CLI.

Also fixes #175 — the \copilot\ subcommand was hardcoded to .ai-team/team.md\ instead of using \detectSquadDir().

Why

When users install Squad and type /agent\ in Copilot CLI, there's zero diagnostic tooling if Squad doesn't appear. Common causes (wrong directory, missing agent file, team not initialized, gh not authed) are invisible. This command surfaces them with actionable fix hints.

Checks

# Check Pass Fail
1 Git repository ✗ + \git init\
2 Node.js ≥ 22 ✓ version ✗ + \
vm install 22\
3 Agent file ✓ + version ✗ + \
px github:bradygaster/squad\
4 Squad state dir ✓ .squad/ ⚠ legacy .ai-team/
5 Team initialized ✓ + member count ✗ + init instructions
6 decisions.md ⚠ will be created
7 gh CLI ✓ + version ✗ + install command
8 gh auth ✓ + username ✗ + \gh auth login\
9 Copilot CLI ✓ + version ✗ + install command

Example Output

\
$ npx github:bradygaster/squad doctor

Squad Doctor — checking your setup

✓ Git repository
✓ Node.js v22.18.0
✓ Agent file found (v0.5.4)
✓ Squad state: .squad/
✓ Team initialized (5 sections)
✓ Shared brain ready (decisions.md)
✓ gh CLI (v2.80.0)
✓ Authenticated as @KalebCole
✓ Copilot CLI (GitHub Copilot CLI 0.0.421)

9 passed
\\

Details

  • Exit code 1 on failures (scriptable: \squad doctor && echo ready)
  • Platform-aware fix hints (winget on Windows, brew on Mac)
  • Follows existing code style (GREEN ✓, RED ✗, YELLOW ⚠, DIM hints)
  • \gh auth status\ captures stderr via \2>&1\ for older gh versions
  • Summary line uses yellow for warnings-only, red for failures, green for all-pass
  • Closes squad copilot subcommand hardcoded to .ai-team/ path #175: copilot subcommand now uses \detectSquadDir()\ + shows deprecation warning for legacy dirs

Testing

Tested on Windows (PowerShell) with Squad v0.5.4:

  • ✅ All checks pass in initialized repo
  • ✅ Failures show correct hints in non-Squad directory
  • ✅ Exit code 1 on failures, 0 on pass
  • ✅ Legacy .ai-team/ shows yellow warning
  • ✅ Help text includes doctor command

Add 'squad doctor' subcommand that runs 9 diagnostic checks (git repo, node version, agent file, squad dir, team init, decisions.md, gh CLI, gh auth, copilot CLI) with colored pass/fail/warn output and actionable fix hints.

Fix copilot subcommand to use detectSquadDir() instead of hardcoded .ai-team/ path.

Closes bradygaster#175

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@KalebCole
Copy link
Copy Markdown
Author

i did not actually test this lol. let me verify first. main concern is that i'm not seeing the squad agent in the /agents command of copilot cli

@KalebCole
Copy link
Copy Markdown
Author

found the reason why - it was just a scoping issue
image

bradygaster added a commit that referenced this pull request Mar 4, 2026
…tes (#185, #188, #191, #192, #195, #196, #199, #201, #203, #206, #207)

Documentation Epic #182 — complete:

Docs Content (McManus):
- Architecture overview: SDK ↔ CLI ↔ SquadUI system design
- Migration guide: Beta → v1 with 10-step checklist
- Global CLI install guide: npm, npx, GitHub native
- VS Code integration guide: client compatibility, extension patterns
- SDK API reference: 574 lines, all 30+ exports documented

Docs Site Engine (Keaton):
- Static site generator: node docs/build.js → docs/dist/
- GitHub Pages ready, responsive design, sidebar nav
- Index landing page linking all guides

Mechanical Updates (Fenster):
- .ai-team/ → .squad/ across 25 doc files (#191)
- CLI invocation references verified current (#192)
- Beta repo URLs updated to squad-pr (#195)

Docs Tests (Hockney):
- 17 docs validation tests: headings, code blocks, links, build
- Fixed link checker for parent-dir refs, Windows rmSync

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster added a commit that referenced this pull request Mar 4, 2026
feat: Wave 3 — Documentation Epic complete (#182)
@bradygaster
Copy link
Copy Markdown
Owner

Thank you for this thorough work, @KalebCole. The squad doctor command design you proposed—with 9 diagnostic checks, emoji output, platform-aware fix hints, and proper exit codes—was excellent and influenced how we've built the same feature.

Both items in this PR are now implemented in the v1 TypeScript replatform:

  1. squad doctor command (referenced in Docs: Create missing .squad/templates/human-members.md template #312): Shipped in v0.8.18+. Performs 9 automated setup checks including .squad/ directory validation, config/team.md structure, routing.md presence, agents directory, and more. Uses emoji output and provides diagnostic-only exit behavior.

  2. Issue squad copilot subcommand hardcoded to .ai-team/ path #175 fix (copilot subcommand path bug): Resolved as part of the full CLI rewrite. The new TypeScript implementation at packages/squad-cli/src/cli/commands/copilot.ts properly uses detectSquadDir() and no longer hardcodes .ai-team/. The entire codebase migrated from .ai-team/.squad/ as the standard directory structure.

The public squad repo had code duplication and technical debt from multiple rounds of pattern experimentation. We consolidated the best implementations into this private repo, which is now the canonical source. This PR would have been the right fix for the old codebase, but it's superseded by the newer architecture.

We appreciate you taking the time to report and fix these—it helped validate the design approach we took for v1.

@bradygaster
Copy link
Copy Markdown
Owner

Closing in favor of the v1 TypeScript replatform implementation. The squad doctor and copilot path fixes are now shipped.

@bradygaster bradygaster closed this Mar 4, 2026
bradygaster added a commit that referenced this pull request Mar 4, 2026
Session: 20260304T194304Z-community-pr-triage

Changes:
- Logged Keaton's PR #131 review and closure
- Logged Kobayashi's issue #175 and PR #182 closure
- Created session log for community triage
- No decision inbox files to merge

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
Copy link
Copy Markdown
Owner

[This is actually me this time, but i prefer their explanation!]

We'd been working in another repo to test out a lot of features. Your PR came in during that, so we just used it as inspiration and built in in. Thank you so much for the ideas - no more 2nd repo now, so, keep them coming here!

@KalebCole
Copy link
Copy Markdown
Author

This tool is awesome. I just had someone demo their use of this and I'm looking forward to moving from my single threaded ways of 15 different pwsh tabs with copilot cli on all of them

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.

squad copilot subcommand hardcoded to .ai-team/ path

2 participants