opencode-swarm 2.2.1 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/agents/sme/api.d.ts +2 -0
- package/dist/agents/sme/database.d.ts +2 -0
- package/dist/agents/sme/devops.d.ts +2 -0
- package/dist/agents/sme/web.d.ts +2 -0
- package/dist/config/constants.d.ts +3 -3
- package/dist/index.js +143 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ User Request
|
|
|
96
96
|
|-------|:----:|:-----:|------|
|
|
97
97
|
| Architect | ✅ | ✅ | Orchestrator - can fall back if delegation fails |
|
|
98
98
|
| Explorer | ✅ | ❌ | Discovery - scans, summarizes, identifies domains |
|
|
99
|
-
| SMEs (×
|
|
99
|
+
| SMEs (×15) | ✅ | ❌ | Advisory - domain expertise, never implements |
|
|
100
100
|
| Coder | ✅ | ✅ | Implementation - writes production code |
|
|
101
101
|
| Security Reviewer | ✅ | ❌ | Audit - vulnerability assessment |
|
|
102
102
|
| Auditor | ✅ | ❌ | Audit - correctness verification |
|
|
@@ -222,6 +222,10 @@ Place in `~/.config/opencode/opencode-swarm/`:
|
|
|
222
222
|
| `sme_azure` | Azure services, Entra ID, ARM/Bicep |
|
|
223
223
|
| `sme_active_directory` | AD, LDAP, Group Policy, Kerberos |
|
|
224
224
|
| `sme_ui_ux` | UI/UX design, accessibility, interaction patterns |
|
|
225
|
+
| `sme_web` | Flutter, React, Vue, Angular, JS/TS, HTML/CSS |
|
|
226
|
+
| `sme_database` | SQL Server, PostgreSQL, MySQL, MongoDB, Redis |
|
|
227
|
+
| `sme_devops` | Docker, Kubernetes, CI/CD, Terraform, GitHub Actions |
|
|
228
|
+
| `sme_api` | REST, GraphQL, OAuth, JWT, webhooks |
|
|
225
229
|
|
|
226
230
|
### Implementation
|
|
227
231
|
| Agent | Description |
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const SME_AGENTS: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux"];
|
|
1
|
+
export declare const SME_AGENTS: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api"];
|
|
2
2
|
export declare const QA_AGENTS: readonly ["security_reviewer", "auditor"];
|
|
3
3
|
export declare const PIPELINE_AGENTS: readonly ["explorer", "coder", "test_engineer"];
|
|
4
4
|
export declare const ORCHESTRATOR_NAME: "architect";
|
|
5
|
-
export declare const ALL_SUBAGENT_NAMES: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
|
|
6
|
-
export declare const ALL_AGENT_NAMES: readonly ["architect", "sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
|
|
5
|
+
export declare const ALL_SUBAGENT_NAMES: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
|
|
6
|
+
export declare const ALL_AGENT_NAMES: readonly ["architect", "sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
|
|
7
7
|
export type SMEAgentName = (typeof SME_AGENTS)[number];
|
|
8
8
|
export type QAAgentName = (typeof QA_AGENTS)[number];
|
|
9
9
|
export type PipelineAgentName = (typeof PIPELINE_AGENTS)[number];
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,11 @@ var SME_AGENTS = [
|
|
|
22
22
|
"sme_vmware",
|
|
23
23
|
"sme_azure",
|
|
24
24
|
"sme_active_directory",
|
|
25
|
-
"sme_ui_ux"
|
|
25
|
+
"sme_ui_ux",
|
|
26
|
+
"sme_web",
|
|
27
|
+
"sme_database",
|
|
28
|
+
"sme_devops",
|
|
29
|
+
"sme_api"
|
|
26
30
|
];
|
|
27
31
|
var QA_AGENTS = ["security_reviewer", "auditor"];
|
|
28
32
|
var PIPELINE_AGENTS = ["explorer", "coder", "test_engineer"];
|
|
@@ -13846,6 +13850,13 @@ var ARCHITECT_PROMPT = `You are Architect - an AI coding orchestrator that coord
|
|
|
13846
13850
|
|
|
13847
13851
|
**Role**: Analyze requests, delegate discovery to Explorer, consult domain SMEs, delegate implementation, and manage QA review.
|
|
13848
13852
|
|
|
13853
|
+
**CRITICAL RULE: SERIAL EXECUTION ONLY**
|
|
13854
|
+
You MUST call agents ONE AT A TIME. After each delegation:
|
|
13855
|
+
1. Send to ONE agent
|
|
13856
|
+
2. STOP and wait for response
|
|
13857
|
+
3. Only then proceed to next agent
|
|
13858
|
+
NEVER delegate to multiple agents in the same message. This is mandatory.
|
|
13859
|
+
|
|
13849
13860
|
**Agents**:
|
|
13850
13861
|
|
|
13851
13862
|
@explorer - Fast codebase discovery and summarization (ALWAYS FIRST for code tasks)
|
|
@@ -13860,6 +13871,10 @@ var ARCHITECT_PROMPT = `You are Architect - an AI coding orchestrator that coord
|
|
|
13860
13871
|
@sme_azure - Azure cloud services, Entra ID, ARM/Bicep
|
|
13861
13872
|
@sme_active_directory - Active Directory, LDAP, Group Policy, Kerberos
|
|
13862
13873
|
@sme_ui_ux - UI/UX design, interaction patterns, accessibility
|
|
13874
|
+
@sme_web - Web/frontend (Flutter, React, Vue, Angular, JS/TS, HTML/CSS)
|
|
13875
|
+
@sme_database - Databases (SQL Server, PostgreSQL, MySQL, MongoDB, Redis)
|
|
13876
|
+
@sme_devops - DevOps, CI/CD, Docker, Kubernetes, Terraform, GitHub Actions
|
|
13877
|
+
@sme_api - API design, REST, GraphQL, OAuth, JWT, webhooks
|
|
13863
13878
|
|
|
13864
13879
|
@coder - Implementation specialist, writes production code
|
|
13865
13880
|
@security_reviewer - Security audit, vulnerability assessment
|
|
@@ -13870,47 +13885,51 @@ var ARCHITECT_PROMPT = `You are Architect - an AI coding orchestrator that coord
|
|
|
13870
13885
|
|
|
13871
13886
|
## 1. Parse Request (you do this briefly)
|
|
13872
13887
|
Understand what the user wants. Determine task type:
|
|
13873
|
-
- Code review/analysis \u2192 Explorer
|
|
13874
|
-
- New implementation \u2192 Explorer
|
|
13875
|
-
- Bug fix \u2192 Explorer
|
|
13876
|
-
- Question about codebase \u2192 Explorer
|
|
13888
|
+
- Code review/analysis \u2192 Explorer \u2192 SMEs (serial) \u2192 Collate
|
|
13889
|
+
- New implementation \u2192 Explorer \u2192 SMEs (serial) \u2192 Coder \u2192 QA (serial) \u2192 Test
|
|
13890
|
+
- Bug fix \u2192 Explorer \u2192 SMEs (serial) \u2192 Coder \u2192 QA (serial)
|
|
13891
|
+
- Question about codebase \u2192 Explorer \u2192 answer
|
|
13877
13892
|
|
|
13878
|
-
## 2. Explorer FIRST (
|
|
13893
|
+
## 2. Explorer FIRST (one delegation, wait for response)
|
|
13879
13894
|
"Delegating to @explorer for codebase analysis..."
|
|
13880
|
-
@explorer
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
-
|
|
13895
|
+
STOP HERE. Wait for @explorer response before proceeding.
|
|
13896
|
+
|
|
13897
|
+
## 3. SME Consultation (ONE AT A TIME, wait between each)
|
|
13898
|
+
From @explorer's "Relevant Domains" list:
|
|
13899
|
+
- Delegate to first SME, WAIT for response
|
|
13900
|
+
- Then delegate to second SME, WAIT for response
|
|
13901
|
+
- Then delegate to third SME (if needed), WAIT for response
|
|
13902
|
+
- Usually 1-3 SMEs total, NEVER call them in parallel
|
|
13903
|
+
|
|
13904
|
+
Example of CORRECT serial SME calls:
|
|
13905
|
+
Turn 1: "Consulting @sme_powershell..." \u2192 wait
|
|
13906
|
+
Turn 2: (after response) "Consulting @sme_security..." \u2192 wait
|
|
13907
|
+
Turn 3: (after response) "Consulting @sme_windows..." \u2192 wait
|
|
13885
13908
|
|
|
13886
|
-
|
|
13887
|
-
|
|
13888
|
-
- Usually 1-3 SMEs, not all 11
|
|
13889
|
-
- Serial execution (one at a time)
|
|
13890
|
-
- SMEs review the files flagged by @explorer
|
|
13909
|
+
Example of WRONG parallel calls (NEVER DO THIS):
|
|
13910
|
+
"Consulting @sme_powershell, @sme_security, and @sme_windows..." \u2190 WRONG
|
|
13891
13911
|
|
|
13892
13912
|
## 4. Collate (you do this)
|
|
13893
|
-
|
|
13913
|
+
After ALL SME responses received, synthesize into:
|
|
13894
13914
|
- For reviews: final findings report
|
|
13895
13915
|
- For implementation: unified specification for @coder
|
|
13896
13916
|
|
|
13897
|
-
## 5. Code (
|
|
13898
|
-
Send specification to @coder with file paths from @explorer.
|
|
13917
|
+
## 5. Code (one delegation to @coder, wait for response)
|
|
13899
13918
|
|
|
13900
|
-
## 6. QA Review (
|
|
13901
|
-
@security_reviewer first, then @auditor.
|
|
13919
|
+
## 6. QA Review (serial: @security_reviewer first, wait, then @auditor)
|
|
13902
13920
|
|
|
13903
13921
|
## 7. Triage (you do this)
|
|
13904
13922
|
APPROVED \u2192 @test_engineer | REVISION_NEEDED \u2192 @coder | BLOCKED \u2192 explain
|
|
13905
13923
|
|
|
13906
|
-
## 8. Test (
|
|
13924
|
+
## 8. Test (one delegation to @test_engineer)
|
|
13907
13925
|
|
|
13908
13926
|
**DELEGATION RULES**:
|
|
13909
|
-
-
|
|
13910
|
-
-
|
|
13911
|
-
-
|
|
13927
|
+
- ONE agent per turn. Wait for response. Then next agent.
|
|
13928
|
+
- @explorer is ALWAYS first for code tasks
|
|
13929
|
+
- SMEs are called serially based on @explorer's domain detection
|
|
13930
|
+
- QA agents are called serially: security_reviewer \u2192 auditor
|
|
13912
13931
|
- Brief notices: "Delegating to @explorer..." not lengthy explanations
|
|
13913
|
-
- If an agent fails
|
|
13932
|
+
- If an agent fails, you can handle it yourself
|
|
13914
13933
|
|
|
13915
13934
|
**COMMUNICATION**:
|
|
13916
13935
|
- Be direct, no preamble or flattery
|
|
@@ -14353,6 +14372,30 @@ var activeDirectorySMEConfig = {
|
|
|
14353
14372
|
- Group Policy preferences vs policies`
|
|
14354
14373
|
};
|
|
14355
14374
|
|
|
14375
|
+
// src/agents/sme/api.ts
|
|
14376
|
+
var apiSMEConfig = {
|
|
14377
|
+
domain: "api",
|
|
14378
|
+
description: "API design, REST, GraphQL, authentication, and backend integration patterns",
|
|
14379
|
+
guidance: `For API tasks, provide:
|
|
14380
|
+
- **REST**: Resource naming, HTTP methods (GET/POST/PUT/PATCH/DELETE), status codes, HATEOAS, versioning strategies
|
|
14381
|
+
- **GraphQL**: Schema design, resolvers, mutations, subscriptions, N+1 prevention, Apollo/Relay patterns
|
|
14382
|
+
- **gRPC**: Protocol buffer definitions, streaming types, service implementation
|
|
14383
|
+
- **WebSockets**: Connection lifecycle, Socket.io, SignalR, heartbeat patterns
|
|
14384
|
+
- **OpenAPI/Swagger**: Specification authoring, code generation, documentation hosting
|
|
14385
|
+
- **OAuth 2.0**: Authorization code flow, client credentials, PKCE for public clients, token refresh
|
|
14386
|
+
- **OpenID Connect**: ID tokens, userinfo endpoint, discovery document
|
|
14387
|
+
- **JWT**: Token structure, signing algorithms, claims design, refresh token rotation
|
|
14388
|
+
- API key management and rate limiting
|
|
14389
|
+
- RBAC/ABAC authorization patterns
|
|
14390
|
+
- Pagination strategies (cursor, offset, keyset)
|
|
14391
|
+
- Error response formats (RFC 7807 Problem Details)
|
|
14392
|
+
- Request validation and sanitization
|
|
14393
|
+
- CORS configuration
|
|
14394
|
+
- API gateway patterns (Kong, AWS API Gateway, Azure APIM)
|
|
14395
|
+
- Webhook design (signatures, retry logic, idempotency keys)
|
|
14396
|
+
- Common gotchas (token expiration, CORS preflight, rate limit handling)`
|
|
14397
|
+
};
|
|
14398
|
+
|
|
14356
14399
|
// src/agents/sme/azure.ts
|
|
14357
14400
|
var azureSMEConfig = {
|
|
14358
14401
|
domain: "azure",
|
|
@@ -14376,6 +14419,49 @@ var azureSMEConfig = {
|
|
|
14376
14419
|
- Azure Government differences if applicable`
|
|
14377
14420
|
};
|
|
14378
14421
|
|
|
14422
|
+
// src/agents/sme/database.ts
|
|
14423
|
+
var databaseSMEConfig = {
|
|
14424
|
+
domain: "database",
|
|
14425
|
+
description: "Database design, SQL, and data management (SQL Server, PostgreSQL, MySQL, MongoDB, Redis)",
|
|
14426
|
+
guidance: `For database tasks, provide:
|
|
14427
|
+
- **SQL Server**: T-SQL syntax, stored procedures, CTEs, window functions, SSMS usage, Always On availability
|
|
14428
|
+
- **PostgreSQL**: PL/pgSQL, extensions (pgvector, PostGIS), JSONB operations, full-text search, partitioning
|
|
14429
|
+
- **MySQL/MariaDB**: InnoDB specifics, replication setup, MySQL Workbench, character set handling
|
|
14430
|
+
- **SQLite**: Embedded usage, WAL mode, mobile/desktop considerations, size limits
|
|
14431
|
+
- **MongoDB**: Document modeling, aggregation pipeline, indexing strategies, Atlas features
|
|
14432
|
+
- **Redis**: Data structures (strings, hashes, lists, sets, sorted sets), caching patterns, pub/sub, Lua scripting
|
|
14433
|
+
- Database design principles (normalization, denormalization tradeoffs)
|
|
14434
|
+
- Index design and query optimization (execution plans, covering indexes)
|
|
14435
|
+
- Transaction isolation levels and locking behavior
|
|
14436
|
+
- Connection pooling and management
|
|
14437
|
+
- Migration strategies and schema versioning
|
|
14438
|
+
- ORM patterns (Entity Framework, SQLAlchemy, Prisma, TypeORM)
|
|
14439
|
+
- N+1 query prevention
|
|
14440
|
+
- Backup and recovery strategies
|
|
14441
|
+
- Common gotchas (NULL handling, implicit conversions, timezone issues)`
|
|
14442
|
+
};
|
|
14443
|
+
|
|
14444
|
+
// src/agents/sme/devops.ts
|
|
14445
|
+
var devopsSMEConfig = {
|
|
14446
|
+
domain: "devops",
|
|
14447
|
+
description: "DevOps, CI/CD, containers, and infrastructure-as-code (Docker, Kubernetes, GitHub Actions, Terraform)",
|
|
14448
|
+
guidance: `For DevOps tasks, provide:
|
|
14449
|
+
- **Docker**: Dockerfile best practices, multi-stage builds, compose files, networking modes, volume mounts, registry usage
|
|
14450
|
+
- **Kubernetes**: Deployment/Service/Ingress manifests, ConfigMaps, Secrets, Helm charts, kubectl commands, resource limits
|
|
14451
|
+
- **GitHub Actions**: Workflow syntax, job dependencies, matrix builds, secrets management, reusable workflows, artifact handling
|
|
14452
|
+
- **Azure DevOps**: Pipeline YAML, stages/jobs/steps, variable groups, service connections, artifact feeds
|
|
14453
|
+
- **GitLab CI**: .gitlab-ci.yml structure, runners, environments, Auto DevOps
|
|
14454
|
+
- **Terraform**: HCL syntax, provider configuration, state management, modules, workspaces, import existing resources
|
|
14455
|
+
- **Ansible**: Playbook structure, roles, inventory management, vault encryption, idempotency
|
|
14456
|
+
- Container image optimization (layer caching, minimal base images, security scanning)
|
|
14457
|
+
- CI/CD pipeline design (build, test, deploy stages)
|
|
14458
|
+
- Branch strategies (GitFlow, trunk-based development)
|
|
14459
|
+
- Secrets management (HashiCorp Vault, Azure Key Vault, AWS Secrets Manager)
|
|
14460
|
+
- Infrastructure patterns (immutable infrastructure, blue-green, canary)
|
|
14461
|
+
- Monitoring and observability setup (Prometheus, Grafana, ELK)
|
|
14462
|
+
- Common gotchas (state drift, secret exposure, resource cleanup)`
|
|
14463
|
+
};
|
|
14464
|
+
|
|
14379
14465
|
// src/agents/sme/linux.ts
|
|
14380
14466
|
var linuxSMEConfig = {
|
|
14381
14467
|
domain: "linux",
|
|
@@ -14546,6 +14632,27 @@ var vmwareSMEConfig = {
|
|
|
14546
14632
|
- Performance metrics and monitoring (Get-Stat)`
|
|
14547
14633
|
};
|
|
14548
14634
|
|
|
14635
|
+
// src/agents/sme/web.ts
|
|
14636
|
+
var webSMEConfig = {
|
|
14637
|
+
domain: "web",
|
|
14638
|
+
description: "Web and frontend development (Flutter, React, Vue, Angular, JavaScript/TypeScript, HTML/CSS)",
|
|
14639
|
+
guidance: `For web/frontend tasks, provide:
|
|
14640
|
+
- **Flutter**: Dart syntax, widget composition, state management (Provider, Riverpod, Bloc), platform channels, pub.dev packages, hot reload workflow
|
|
14641
|
+
- **React**: Hooks (useState, useEffect, useMemo), context, Redux/Zustand, Next.js App Router, server components, React Native considerations
|
|
14642
|
+
- **Vue**: Composition API, Pinia stores, Nuxt 3, Vue Router, reactive refs
|
|
14643
|
+
- **Angular**: Components, services, dependency injection, RxJS patterns, NgRx, Angular CLI commands
|
|
14644
|
+
- **Svelte**: Runes ($state, $derived), SvelteKit routing, stores
|
|
14645
|
+
- **JavaScript/TypeScript**: ES modules, async/await, type narrowing, bundler config (Vite, webpack, esbuild)
|
|
14646
|
+
- **HTML/CSS**: Semantic markup, Flexbox/Grid layouts, CSS custom properties, Tailwind utility classes, SCSS
|
|
14647
|
+
- **Browser APIs**: DOM manipulation, Fetch API, Web Storage, Service Workers, WebSockets
|
|
14648
|
+
- Framework selection guidance based on project requirements
|
|
14649
|
+
- Component architecture and reusability patterns
|
|
14650
|
+
- State management strategies (local vs global)
|
|
14651
|
+
- Build optimization and code splitting
|
|
14652
|
+
- Responsive design and accessibility (WCAG)
|
|
14653
|
+
- Common gotchas (hydration mismatches, bundle size, memory leaks)`
|
|
14654
|
+
};
|
|
14655
|
+
|
|
14549
14656
|
// src/agents/sme/windows.ts
|
|
14550
14657
|
var windowsSMEConfig = {
|
|
14551
14658
|
domain: "windows",
|
|
@@ -14576,7 +14683,11 @@ var SME_CONFIGS = {
|
|
|
14576
14683
|
vmware: vmwareSMEConfig,
|
|
14577
14684
|
azure: azureSMEConfig,
|
|
14578
14685
|
active_directory: activeDirectorySMEConfig,
|
|
14579
|
-
ui_ux: uiUxSMEConfig
|
|
14686
|
+
ui_ux: uiUxSMEConfig,
|
|
14687
|
+
web: webSMEConfig,
|
|
14688
|
+
database: databaseSMEConfig,
|
|
14689
|
+
devops: devopsSMEConfig,
|
|
14690
|
+
api: apiSMEConfig
|
|
14580
14691
|
};
|
|
14581
14692
|
var AGENT_TO_DOMAIN = {
|
|
14582
14693
|
sme_windows: "windows",
|
|
@@ -14589,7 +14700,11 @@ var AGENT_TO_DOMAIN = {
|
|
|
14589
14700
|
sme_vmware: "vmware",
|
|
14590
14701
|
sme_azure: "azure",
|
|
14591
14702
|
sme_active_directory: "active_directory",
|
|
14592
|
-
sme_ui_ux: "ui_ux"
|
|
14703
|
+
sme_ui_ux: "ui_ux",
|
|
14704
|
+
sme_web: "web",
|
|
14705
|
+
sme_database: "database",
|
|
14706
|
+
sme_devops: "devops",
|
|
14707
|
+
sme_api: "api"
|
|
14593
14708
|
};
|
|
14594
14709
|
function createAllSMEAgents(getModel, loadPrompt) {
|
|
14595
14710
|
return Object.entries(AGENT_TO_DOMAIN).map(([agentName, domain2]) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|