{"_id":"@cubocompany/squad-foundry","_rev":"4-5d120e3c48026f14fa6e67b2fbbb979c","name":"@cubocompany/squad-foundry","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@cubocompany/squad-foundry","version":"0.1.0","keywords":["agents","multi-agent","orchestration","squad","ai","automation","workflow","claude-code","opencode","cursor","codex","ai-native"],"license":"MIT","_id":"@cubocompany/squad-foundry@0.1.0","maintainers":[{"name":"luizgustavosaraiva","email":"lg.saraiva@outlook.com"}],"homepage":"https://github.com/your-org/squad-foundry#readme","bugs":{"url":"https://github.com/your-org/squad-foundry/issues"},"bin":{"squad-foundry":"dist/orchestrator/cli/index.js"},"dist":{"shasum":"e583bc245c81ab3bed840788391f422957f01a49","tarball":"https://registry.npmjs.org/@cubocompany/squad-foundry/-/squad-foundry-0.1.0.tgz","fileCount":309,"integrity":"sha512-90OKvDKOxhQf0bGHaiZze1ATMALWPlO8aNfCw01lxVgGm1n9jhbPltwwEHwQKXS6q4QJ4kzVxVAP4Ell040L5Q==","signatures":[{"sig":"MEYCIQDwUIwaLqL8iksbaBuxyrgrGVV8mSbPlbPmeqZGLHwW0QIhALthqlatKlrH5JMUt7m4bgQOd3hTX0+H/a/fkI392lu3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":785698},"main":"./dist/orchestrator/index.js","type":"module","types":"./dist/orchestrator/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/orchestrator/index.d.ts","import":"./dist/orchestrator/index.js"},"./adapters/host/ide":{"types":"./dist/orchestrator/adapters/host/ide.adapter.d.ts","import":"./dist/orchestrator/adapters/host/ide.adapter.js"},"./adapters/host/local":{"types":"./dist/orchestrator/adapters/host/local.adapter.d.ts","import":"./dist/orchestrator/adapters/host/local.adapter.js"},"./adapters/host/openai":{"types":"./dist/orchestrator/adapters/host/openai.adapter.d.ts","import":"./dist/orchestrator/adapters/host/openai.adapter.js"},"./adapters/host/opencode":{"types":"./dist/orchestrator/adapters/host/opencode.adapter.d.ts","import":"./dist/orchestrator/adapters/host/opencode.adapter.js"},"./adapters/host/anthropic":{"types":"./dist/orchestrator/adapters/host/anthropic.adapter.d.ts","import":"./dist/orchestrator/adapters/host/anthropic.adapter.js"},"./adapters/host/claude-code":{"types":"./dist/orchestrator/adapters/host/claude-code.adapter.d.ts","import":"./dist/orchestrator/adapters/host/claude-code.adapter.js"}},"gitHead":"d77652269a2680778fe2aee196ff1b95677c83bb","scripts":{"cli":"node dist/orchestrator/cli/index.js","dev":"tsc --watch","test":"vitest run","build":"tsc","dev:cli":"tsx orchestrator/cli/index.ts","test:unit":"vitest run tests/unit","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test","test:integration":"vitest run tests/integration"},"_npmUser":{"name":"luizgustavosaraiva","email":"lg.saraiva@outlook.com"},"repository":{"url":"git+https://github.com/your-org/squad-foundry.git","type":"git"},"_npmVersion":"10.9.2","description":"Local extensible multi-agent squad orchestration platform — model-agnostic, host-agnostic, domain-agnostic","directories":{},"_nodeVersion":"22.17.0","dependencies":{"zod":"^3.23.8","glob":"^11.0.0","commander":"^12.1.0","@anthropic-ai/sdk":"^0.82.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^2.0.0","typescript":"^5.5.0","@types/node":"^22.0.0","@vitest/coverage-v8":"^2.0.0","@modelcontextprotocol/sdk":"^1.29.0"},"_npmOperationalInternal":{"tmp":"tmp/squad-foundry_0.1.0_1775129193371_0.7812718509296903","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cubocompany/squad-foundry","version":"0.1.1","keywords":["agents","multi-agent","orchestration","squad","ai","automation","workflow","claude-code","opencode","cursor","codex","ai-native"],"license":"MIT","_id":"@cubocompany/squad-foundry@0.1.1","maintainers":[{"name":"luizgustavosaraiva","email":"lg.saraiva@outlook.com"}],"homepage":"https://github.com/cubocompany/squad-foundry#readme","bugs":{"url":"https://github.com/cubocompany/squad-foundry/issues"},"bin":{"squad-foundry":"dist/orchestrator/cli/index.js"},"dist":{"shasum":"988e3f27d21270a8b0b09c8e3d77bf5c8bf8d635","tarball":"https://registry.npmjs.org/@cubocompany/squad-foundry/-/squad-foundry-0.1.1.tgz","fileCount":309,"integrity":"sha512-cYwz36LxcSt5/BAWwmRWTgQ6Dpr2Wl4ND+lHgBaZ7e36N16MC2ji0M0Fmyn8GN8jZwBAfwpizY0hgJr5f7naZw==","signatures":[{"sig":"MEUCIFHkyhoGWiZ4n/kERggJYZw1iFWDSL2cfoNgy31XML4rAiEAkfxh1yn7tu//1PYW9zzs5gXomhACxTdstR26BKxJG70=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":785701},"main":"./dist/orchestrator/index.js","type":"module","types":"./dist/orchestrator/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/orchestrator/index.d.ts","import":"./dist/orchestrator/index.js"},"./adapters/host/ide":{"types":"./dist/orchestrator/adapters/host/ide.adapter.d.ts","import":"./dist/orchestrator/adapters/host/ide.adapter.js"},"./adapters/host/local":{"types":"./dist/orchestrator/adapters/host/local.adapter.d.ts","import":"./dist/orchestrator/adapters/host/local.adapter.js"},"./adapters/host/openai":{"types":"./dist/orchestrator/adapters/host/openai.adapter.d.ts","import":"./dist/orchestrator/adapters/host/openai.adapter.js"},"./adapters/host/opencode":{"types":"./dist/orchestrator/adapters/host/opencode.adapter.d.ts","import":"./dist/orchestrator/adapters/host/opencode.adapter.js"},"./adapters/host/anthropic":{"types":"./dist/orchestrator/adapters/host/anthropic.adapter.d.ts","import":"./dist/orchestrator/adapters/host/anthropic.adapter.js"},"./adapters/host/claude-code":{"types":"./dist/orchestrator/adapters/host/claude-code.adapter.d.ts","import":"./dist/orchestrator/adapters/host/claude-code.adapter.js"}},"gitHead":"914ba8aad4296953a0fa9e0b5846f546926aff9a","scripts":{"cli":"node dist/orchestrator/cli/index.js","dev":"tsc --watch","test":"vitest run","build":"tsc","dev:cli":"tsx orchestrator/cli/index.ts","test:unit":"vitest run tests/unit","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test","test:integration":"vitest run tests/integration"},"_npmUser":{"name":"luizgustavosaraiva","email":"lg.saraiva@outlook.com"},"repository":{"url":"git+https://github.com/cubocompany/squad-foundry.git","type":"git"},"_npmVersion":"10.9.2","description":"Local extensible multi-agent squad orchestration platform — model-agnostic, host-agnostic, domain-agnostic","directories":{},"_nodeVersion":"22.17.0","dependencies":{"zod":"^3.23.8","glob":"^11.0.0","commander":"^12.1.0","@anthropic-ai/sdk":"^0.82.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^2.0.0","typescript":"^5.5.0","@types/node":"^22.0.0","@vitest/coverage-v8":"^2.0.0","@modelcontextprotocol/sdk":"^1.29.0"},"_npmOperationalInternal":{"tmp":"tmp/squad-foundry_0.1.1_1775129385655_0.4888401958623496","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-02T11:26:33.242Z","modified":"2026-04-02T11:37:47.810Z","0.1.0":"2026-04-02T11:26:33.586Z","0.1.1":"2026-04-02T11:29:45.832Z"},"bugs":{"url":"https://github.com/cubocompany/squad-foundry/issues"},"license":"MIT","homepage":"https://github.com/cubocompany/squad-foundry#readme","keywords":["agents","multi-agent","orchestration","squad","ai","automation","workflow","claude-code","opencode","cursor","codex","ai-native"],"repository":{"url":"git+https://github.com/cubocompany/squad-foundry.git","type":"git"},"description":"Local extensible multi-agent squad orchestration platform — model-agnostic, host-agnostic, domain-agnostic","maintainers":[{"email":"lg.saraiva@outlook.com","name":"luizgustavosaraiva"}],"readme":"# Squad Foundry\n\n**Local extensible multi-agent squad orchestration platform.**\n\nModel-agnostic. Host-agnostic. Tool-agnostic. Domain-agnostic.\n\n---\n\n## What is Squad Foundry?\n\nSquad Foundry lets you design and run **collaborative multi-agent squads** for any domain:\n\n- Software development (spec → code → review → test → PR → deploy)\n- Instagram content (strategy → copy → review → approval → publish → analytics)\n- Documentation, research, marketing, operations — anything task-and-handoff-oriented\n\nSquads are **portable JSON configurations**. The same squad runs in Claude Code, OpenCode, Cursor, Codex, Zed, or any compatible host — just swap the adapter.\n\n---\n\n## Quickstart\n\n### Instalar como pacote npm\n\n```bash\nnpm install squad-foundry\n```\n\n### Usar no Claude Code / OpenCode / Cursor / Codex / Zed\n\nVocê não precisa de API key — a IDE já é o modelo. O `IDEHostAdapter` recebe um callback que a IDE executa:\n\n```typescript\nimport {\n  IDEHostAdapter,\n  createSquadRuntime,\n  createSquadBuilder,\n} from 'squad-foundry'\n\n// O callback que você fornece É o modelo — a IDE executa isso\nconst runtime = createSquadRuntime({\n  hostAdapter: new IDEHostAdapter(async (prompt) => {\n    // Aqui você integra com o modelo que já está rodando na sua IDE.\n    // Em Claude Code: use o agente atual para responder o prompt.\n    // Em OpenCode: use opencode.complete(prompt)\n    // Em Cursor: use cursor.chat(prompt)\n    return yourIDEModel.complete(prompt)\n  }),\n})\n\n// Carregar um squad e executar um job\nimport squadJson from './squads/examples/software-development/config/squad.json' assert { type: 'json' }\nconst job = await runtime.startJob(squadJson, 'Implement dark mode', 'Add toggle to settings page')\nawait runtime.runAll(squadJson, job)\n```\n\n### CLI (uso local)\n\n```bash\n# Instalar globalmente\nnpm install -g squad-foundry\n\n# Inicializar config host-native\nsquad-foundry init\n\n# Criar um novo squad (entrevista guiada via host ativo)\nsquad-foundry create\n\n# Editar um squad existente\nsquad-foundry edit software-development\n\n# Executar um job\nsquad-foundry run software-development --objective \"Implement dark mode\"\n\n# Ver status\nsquad-foundry status software-development <job-id>\n\n# Listar squads\nsquad-foundry list\n\n# Ver host resolvido e preferencia persistida\nsquad-foundry hosts\n```\n\n### Desenvolvimento local\n\n```bash\n# Clonar e instalar\nnpm install\n\n# Compilar\nnpm run build\n\n# Testes\nnpm test\n```\n\n---\n\n## Architecture\n\n```\nSquad Foundry\n├── Core Layer          orchestrator/core/\n│   ├── types.ts        All portable type definitions\n│   ├── state-machine.ts Explicit state transitions\n│   └── guardrails.ts   Policy enforcement engine\n│\n├── Adapter Layer       orchestrator/adapters/\n│   ├── host/           IHostAdapter + stubs (Anthropic, OpenAI, Local)\n│   ├── model/          IModelAdapter\n│   ├── tools/          IToolAdapter\n│   ├── vcs/            IVCSAdapter + GitHub stub\n│   ├── publishing/     ISocialMediaAdapter + Instagram stub\n│   ├── deploy/         IDeployAdapter + Vercel stub\n│   └── context/        IContextAdapter + filesystem adapter\n│\n├── Context Layer       orchestrator/context/\n│   ├── context-loader.ts Discovers and loads PROJECT.md, TASKS.md, docs/**\n│   └── context-index.ts  In-memory search index\n│\n├── Artifact Store      orchestrator/artifacts/\n│   └── artifact-store.ts Persists all job state, handoffs, outputs\n│\n├── Squad Runtime       orchestrator/runtime/\n│   ├── squad-runtime.ts  Main execution engine\n│   ├── job-manager.ts    Job lifecycle\n│   ├── agent-dispatcher.ts Step → Agent routing\n│   ├── handoff-manager.ts Agent handoff records\n│   └── approval-gate.ts  Human-in-the-loop mechanism\n│\n├── Squad Builder       orchestrator/builder/\n│   ├── squad-builder.ts  Interview orchestrator\n│   ├── interview-questions.ts Question bank\n│   ├── domain-classifier.ts  Domain detection\n│   └── squad-generator.ts    File generation\n│\n├── CLI                 orchestrator/cli/index.ts\n│\n├── Squad Examples      squads/examples/\n│   ├── software-development/\n│   └── instagram-content/\n│\n├── Templates           templates/\n└── Docs                docs/\n```\n\n---\n\n## Key Concepts\n\n### Squad\nA portable, reusable configuration defining: agents, workflow, policies, guardrails, expected artifacts. Stored as `squads/<squad_id>/config/squad.json`.\n\n### Job\nA runtime instance of a squad. Has a unique ID, state machine status, history, artifacts, and approvals. Stored under `artifacts/<squad_id>/<job_id>/`.\n\n### Agent\nA portable definition of an AI agent: role, instructions, allowed tools, handoff rules. Not tied to any specific model or host.\n\n### Workflow\nOrdered steps with dependencies, loops, approval gates, and guardrails. Fully declarative — no hardcoded logic.\n\n### Guardrail\nA programmatically enforced policy constraint. Examples: \"no deploy without human approval\", \"no publish without compliance review\".\n\n### Adapter\nAn implementation of a well-defined interface (host, model, VCS, publish, deploy). Swap adapters to change the execution environment without touching core logic.\n\n---\n\n## Squad Examples\n\n| Squad | Domain | Agents |\n|-------|--------|--------|\n| `software-development` | software-development | Product, Code, Reviewer, Test, Commit, PR, Deploy |\n| `instagram-content` | social-media | Strategy, Research, Copy, Creative Review, Brand, Approval, Publisher, Analytics |\n\n---\n\n## Adapter Status\n\n| Adapter | Tipo | Status | Quando usar |\n|---------|------|--------|-------------|\n| `ClaudeCodeHostAdapter` | host | **real** | Bridge CLI nativa do Claude Code (sem API key) |\n| `OpenCodeHostAdapter` | host | **real** | Bridge CLI nativa do OpenCode (sem API key) |\n| `IDEHostAdapter` | host | **real** | Claude Code, OpenCode, Cursor, Codex, Zed — **a IDE é o modelo** |\n| `LocalHostAdapter` | host | stub | Ollama, LM Studio, llama.cpp local |\n| `AnthropicHostAdapter` | host | stub | API Anthropic direta (`ANTHROPIC_API_KEY`) |\n| `OpenAIHostAdapter` | host | stub | API OpenAI direta (`OPENAI_API_KEY`) |\n| `GitHubVCSAdapter` | vcs | stub | `GITHUB_TOKEN` + `GITHUB_REPO` |\n| `InstagramAdapter` | publishing | stub | `INSTAGRAM_ACCESS_TOKEN` |\n| `VercelDeployAdapter` | deploy | stub | `VERCEL_TOKEN` |\n| `FilesystemContextAdapter` | context | **real** | Lê arquivos locais automaticamente |\n\n> **Nota sobre IDEs AI-nativas:** Claude Code, OpenCode, Cursor, Codex e similares **já são o modelo**. Use `IDEHostAdapter` com um callback que delega para o mecanismo nativo da IDE. Nenhum API key adicional é necessário nesses ambientes.\n\n---\n\n## Context Files\n\nSquad Foundry automatically reads:\n\n| File | Priority | Purpose |\n|------|----------|---------|\n| `PROJECT.md` | 1 (highest) | Project overview, conventions |\n| `TASKS.md` | 2 | Current task state |\n| `AGENTS.md` | 3 | Agent conventions |\n| `README.md` | 4 | General project info |\n| `docs/**` | 5 | Documentation |\n| `specs/**` | 6 | Specifications |\n| `playbooks/**` | 7 | Playbooks |\n| `policies/**` | 8 | Policies |\n\n---\n\n## Human-in-the-Loop\n\nApprovals are always explicit. The system never auto-approves publishing or deployment.\n\nConfigure required approvals in the squad's `POLICIES.md` and `config/squad.json`.\n\n---\n\n## Host-native Resolution\n\nHost resolution is CLI-first and explicit:\n\n- Detector scores strong/medium/weak host signals.\n- Resolver uses detected host when valid, then persisted host when still valid.\n- If unresolved, interactive CLI asks for host selection.\n- Runtime writes host provenance at `artifacts/<squad>/<job>/reports/runtime-metadata.json`.\n- `status` prints `resolvedHost`, `confidence`, `reasons`, `activeModel`, and `fallbackPath`.\n\n---\n\n## Creating a New Squad\n\n```bash\n# Interactive interview\nnode dist/cli/index.js build\n\n# Or programmatically\nimport { createSquadBuilder } from './orchestrator/builder/squad-builder.js'\nconst builder = createSquadBuilder()\nconst result = await builder.build(answers)\n```\n\nSee [`docs/squads/how-to-create.md`](docs/squads/how-to-create.md) for full guide.\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}