Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .changeset/config.json

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/github-app-bot.md

This file was deleted.

23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,29 @@ jobs:
mkdir -p /tmp/test-init
cd /tmp/test-init
git init
node $GITHUB_WORKSPACE/dist/cli.js init --skip-infra --force <<< ""
git config user.email "smoke@test.local"
git config user.name "Smoke Test"
node $GITHUB_WORKSPACE/dist/cli.js init --yes --force

# Verify core files created by new seed-based init
# Verify core files created by seed-based init
test -f CLAUDE.md || (echo "CLAUDE.md missing" && exit 1)
test -f .claude/settings.json || (echo ".claude/settings.json missing" && exit 1)
test -f .agents/BUSINESS_BRIEF.md || (echo ".agents/BUSINESS_BRIEF.md missing" && exit 1)
test -f AGENTS.md || (echo "AGENTS.md missing" && exit 1)

# Core squads (always created)
# Core 4 squads (created by --yes)
test -f .agents/squads/company/SQUAD.md || (echo "company SQUAD.md missing" && exit 1)
test -f .agents/squads/research/SQUAD.md || (echo "research SQUAD.md missing" && exit 1)
test -f .agents/squads/intelligence/SQUAD.md || (echo "intelligence SQUAD.md missing" && exit 1)
test -f .agents/squads/product/SQUAD.md || (echo "product SQUAD.md missing" && exit 1)

# Use-case squads (full-company default in non-interactive mode)
test -f .agents/squads/engineering/SQUAD.md || (echo "engineering SQUAD.md missing" && exit 1)
test -f .agents/squads/marketing/SQUAD.md || (echo "marketing SQUAD.md missing" && exit 1)
test -f .agents/squads/operations/SQUAD.md || (echo "operations SQUAD.md missing" && exit 1)

# Skills
test -f .agents/skills/squads-cli/SKILL.md || (echo "squads-cli skill missing" && exit 1)
test -f .agents/skills/gh/SKILL.md || (echo "gh skill missing" && exit 1)
# Context cascade files
test -f .agents/config/SYSTEM.md || (echo "SYSTEM.md missing" && exit 1)
test -f .agents/memory/company/directives.md || (echo "directives.md missing" && exit 1)

# Memory state files
test -f .agents/memory/company/manager/state.md || (echo "company manager state missing" && exit 1)
test -f .agents/memory/research/researcher/state.md || (echo "research state missing" && exit 1)
test -f .agents/memory/research/lead/state.md || (echo "research lead state missing" && exit 1)
test -f .agents/memory/intelligence/intel-lead/state.md || (echo "intelligence state missing" && exit 1)

echo "✓ squads init smoke test passed"
Expand Down
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ dist/
.env.local
*.tgz

# Generated files - never commit
# Generated
coverage/
docker/.env

# Local PII patterns — never commit
.husky/.blocked-patterns
# Local-only (not shared)
scripts/
docker/
.changeset/
.husky/
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

94 changes: 94 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Agent Instructions

Guidance for AI coding agents working on this repository.

## What This Is

`squads-cli` is a CLI orchestrator for autonomous AI agent teams. It organizes agents into squads (domain-aligned teams), manages their context and memory, and dispatches them via native AI CLIs (`claude`, `gemini`, etc.).

The CLI is open source. Agents are the primary consumers — after `squads run` dispatches an agent, it calls CLI commands to read context, persist memory, and coordinate with other agents.

## Repository Structure

```
src/
├── cli.ts # All command registrations (Commander.js, lazy imports)
├── commands/ # One file per command — start here for any command change
├── lib/ # Shared logic (parsing, context, memory, git, providers)
templates/ # Files generated by `squads init`
test/ # Unit + E2E tests (vitest)
```

Key files by concern:

| Concern | File |
|---------|------|
| Squad/agent discovery | `src/lib/squad-parser.ts` |
| Context injection | `src/lib/run-context.ts` |
| Agent execution | `src/commands/run.ts` |
| Multi-agent conversation | `src/lib/conversation.ts`, `src/lib/workflow.ts` |
| Provider CLIs | `src/lib/llm-clis.ts` |
| Memory read/write | `src/lib/memory.ts` |
| Terminal output | `src/lib/terminal.ts` |
| Command registration | `src/cli.ts` |

## Build and Test

```bash
npm install
npm run build # Required before committing — must pass
npm test # 1700+ tests, all must pass
npm run lint # ESLint
```

## How to Make Changes

### Adding a command

1. Create `src/commands/<name>.ts` exporting an async function
2. Register in `src/cli.ts` with lazy import
3. Add `--json` flag for machine output
4. Add tests in `test/commands/<name>.test.ts`

### Removing a command

Use the `removedCommand()` pattern in `cli.ts` — never silently delete:
```typescript
program.command('old-name', { hidden: true })
.description('[removed]')
.action(removedCommand('old-name', 'Use: squads replacement'));
```

### Modifying squad/agent parsing

All filesystem discovery goes through `squad-parser.ts`. Never hardcode paths to `.agents/` — use `findSquadsDir()`, `findProjectRoot()`, `loadSquad()`.

## Conventions

- **TypeScript strict mode.** No `any` types.
- **Lazy imports in cli.ts.** Commands are loaded only when invoked.
- **Terminal output via `terminal.ts`.** Use `writeLine()`, `colors`, `bold` — not raw `console.log`.
- **`--json` on every command.** Agents parse CLI output programmatically.
- **No new dependencies** without explicit approval.
- **No hardcoded repos, orgs, or file paths.** Everything discovered at runtime.
- **Graceful degradation.** Missing files, unavailable APIs — handle gracefully, never crash.
- **Conventional Commits.** `feat:`, `fix:`, `docs:`, `chore:`.

## Testing

Tests use vitest. Run the full suite before submitting changes:

```bash
npm test # All tests
npx vitest run test/commands/run.test.ts # Single file
```

E2E tests in `test/e2e/` run actual CLI commands against temp directories.

## What Not to Do

- Don't add dependencies (especially heavy ones) without discussion
- Don't use `console.log` in command implementations
- Don't hardcode GitHub as the only git provider
- Don't break `--json` output formats (agents depend on them)
- Don't skip the build step — `npm run build` is the quality gate
88 changes: 0 additions & 88 deletions CHANGELOG.md

This file was deleted.

Loading
Loading