arkaos 2.0.0 → 2.0.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 +100 -74
- package/VERSION +1 -1
- package/bin/arkaos +1 -1
- package/core/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/validator.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/advisor_db.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/display.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/matcher.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/persistence.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/profiler.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/prompts.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/governance/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/governance/__pycache__/constitution.cpython-313.pyc +0 -0
- package/core/registry/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/registry/__pycache__/generator.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/base.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/claude_code.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/codex_cli.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/cursor.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/gemini_cli.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/registry.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/subagent.cpython-313.pyc +0 -0
- package/core/specs/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/specs/__pycache__/manager.cpython-313.pyc +0 -0
- package/core/specs/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/registry.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/cache.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
- package/core/tasks/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/tasks/__pycache__/manager.cpython-313.pyc +0 -0
- package/core/tasks/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/schema.cpython-313.pyc +0 -0
- package/departments/dev/skills/agent-design/SKILL.md +4 -0
- package/departments/dev/skills/agent-design/references/architecture-patterns.md +223 -0
- package/departments/dev/skills/ai-security/SKILL.md +4 -0
- package/departments/dev/skills/ai-security/references/prompt-injection-catalog.md +230 -0
- package/departments/dev/skills/ci-cd-pipeline/SKILL.md +4 -0
- package/departments/dev/skills/ci-cd-pipeline/references/github-actions-patterns.md +202 -0
- package/departments/dev/skills/db-schema/SKILL.md +4 -0
- package/departments/dev/skills/db-schema/references/indexing-strategy.md +197 -0
- package/departments/dev/skills/dependency-audit/SKILL.md +4 -0
- package/departments/dev/skills/dependency-audit/references/license-matrix.md +191 -0
- package/departments/dev/skills/incident/SKILL.md +4 -0
- package/departments/dev/skills/incident/references/severity-playbook.md +221 -0
- package/departments/dev/skills/observability/SKILL.md +4 -0
- package/departments/dev/skills/observability/references/slo-design.md +200 -0
- package/departments/dev/skills/rag-architect/SKILL.md +5 -0
- package/departments/dev/skills/rag-architect/references/chunking-strategies.md +129 -0
- package/departments/dev/skills/rag-architect/references/evaluation-guide.md +158 -0
- package/departments/dev/skills/red-team/SKILL.md +4 -0
- package/departments/dev/skills/red-team/references/mitre-attack-web.md +165 -0
- package/departments/dev/skills/security-audit/SKILL.md +4 -0
- package/departments/dev/skills/security-audit/references/owasp-2025-deep.md +409 -0
- package/departments/dev/skills/security-compliance/SKILL.md +117 -0
- package/departments/finance/skills/ciso-advisor/SKILL.md +4 -0
- package/departments/finance/skills/ciso-advisor/references/compliance-roadmap.md +172 -0
- package/departments/marketing/skills/programmatic-seo/SKILL.md +4 -0
- package/departments/marketing/skills/programmatic-seo/references/template-playbooks.md +289 -0
- package/departments/ops/skills/gdpr-compliance/SKILL.md +104 -0
- package/departments/ops/skills/iso27001/SKILL.md +113 -0
- package/departments/ops/skills/quality-management/SKILL.md +118 -0
- package/departments/ops/skills/risk-management/SKILL.md +120 -0
- package/departments/ops/skills/soc2-compliance/SKILL.md +120 -0
- package/departments/strategy/skills/cto-advisor/SKILL.md +4 -0
- package/departments/strategy/skills/cto-advisor/references/build-vs-buy-framework.md +190 -0
- package/installer/cli.js +13 -2
- package/installer/index.js +1 -2
- package/installer/migrate.js +123 -0
- package/installer/update.js +28 -15
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/core/agents/__pycache__/registry_gen.cpython-313.pyc +0 -0
package/README.md
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
# ArkaOS
|
|
2
2
|
|
|
3
|
-
**The Operating System for AI Agent Teams.**
|
|
3
|
+
**The Operating System for AI Agent Teams.** 62 agents across 17 departments, 250+ skills backed by 116 enterprise frameworks, 8 Python CLI tools. One install.
|
|
4
4
|
|
|
5
5
|
```
|
|
6
6
|
npx arkaos install
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
[](https://github.com/andreagroferreira/arka-os/actions) [](https://www.npmjs.com/package/arkaos) [](LICENSE)
|
|
10
|
+
|
|
9
11
|
## What ArkaOS Does
|
|
10
12
|
|
|
11
|
-
ArkaOS orchestrates AI agents that cover every business function. Not just code. Marketing, brand, finance, strategy, sales, operations, product management, e-commerce, communities, content, and more.
|
|
13
|
+
ArkaOS orchestrates AI agents that cover every business function. Not just code. Marketing, brand, finance, strategy, sales, operations, compliance, product management, e-commerce, communities, content, and more.
|
|
12
14
|
|
|
13
|
-
Each agent has a defined role, personality, expertise, and authority level. They work in squads, follow
|
|
15
|
+
Each agent has a defined role, personality, expertise, and authority level. They work in squads, follow YAML workflows, and every output passes through a mandatory Quality Gate.
|
|
14
16
|
|
|
15
17
|
```
|
|
16
18
|
You: "validate my saas idea for a scheduling tool"
|
|
19
|
+
|
|
17
20
|
ArkaOS: → Routes to SaaS department
|
|
18
21
|
→ Tiago (SaaS Strategist) leads validation workflow
|
|
19
|
-
→ Market sizing, competitor analysis, business model, pricing
|
|
22
|
+
→ Market sizing, competitor analysis, business model, pricing
|
|
20
23
|
→ Financial viability check by Leonor (Financial Analyst)
|
|
21
24
|
→ Quality Gate: Marta, Eduardo, Francisca review
|
|
22
25
|
→ Delivers: validated report with go/no-go recommendation
|
|
@@ -25,108 +28,127 @@ ArkaOS: → Routes to SaaS department
|
|
|
25
28
|
## Install
|
|
26
29
|
|
|
27
30
|
```bash
|
|
28
|
-
#
|
|
29
|
-
npx arkaos install
|
|
30
|
-
|
|
31
|
-
# Or specify the runtime
|
|
31
|
+
npx arkaos install # auto-detects runtime
|
|
32
32
|
npx arkaos install --runtime claude-code
|
|
33
33
|
npx arkaos install --runtime codex
|
|
34
34
|
npx arkaos install --runtime gemini
|
|
35
35
|
npx arkaos install --runtime cursor
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Requires
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
38
|
+
Requires Node.js 18+ and Python 3.11+.
|
|
39
|
+
|
|
40
|
+
**Upgrading from v1?** Run `npx arkaos migrate`
|
|
41
|
+
|
|
42
|
+
## 17 Departments, 62 Agents
|
|
43
|
+
|
|
44
|
+
| Department | Prefix | Agents | Skills | What It Does |
|
|
45
|
+
|-----------|--------|--------|--------|-------------|
|
|
46
|
+
| Development | `/dev` | 9 | 41 | Features, APIs, architecture, security, CI/CD, RAG, agents |
|
|
47
|
+
| Marketing | `/mkt` | 4 | 14 | SEO, paid ads, email, growth loops, programmatic SEO |
|
|
48
|
+
| Brand & Design | `/brand` | 4 | 12 | Brand identity, UX/UI, design systems, naming |
|
|
49
|
+
| Finance | `/fin` | 3 | 8 | DCF valuation, unit economics, CISO advisory |
|
|
50
|
+
| Strategy | `/strat` | 3 | 9 | Five Forces, Blue Ocean, BMC, CTO/board advisory |
|
|
51
|
+
| E-Commerce | `/ecom` | 4 | 12 | Store optimization, CRO, RFM, pricing |
|
|
52
|
+
| Knowledge | `/kb` | 3 | 12 | Research, Zettelkasten, personas, Obsidian |
|
|
53
|
+
| Operations | `/ops` | 2 | 15 | Automation, SOPs, GDPR, ISO 27001, SOC 2, risk |
|
|
54
|
+
| Project Mgmt | `/pm` | 3 | 13 | Scrum, Shape Up, discovery, agile PO |
|
|
55
|
+
| SaaS | `/saas` | 3 | 15 | Validation, metrics, PLG, scaffolding |
|
|
56
|
+
| Landing Pages | `/landing` | 4 | 15 | Sales copy, funnels, offers, page generation |
|
|
57
|
+
| Content | `/content` | 4 | 14 | Viral design, hooks, scripts, repurposing |
|
|
58
|
+
| Communities | `/community` | 2 | 14 | Groups, membership, gamification |
|
|
59
|
+
| Sales | `/sales` | 2 | 10 | Pipeline, SPIN selling, negotiation |
|
|
60
|
+
| Leadership | `/lead` | 2 | 10 | Team health, OKRs, culture, hiring |
|
|
61
|
+
| Organization | `/org` | 1 | 10 | Org design, team topologies |
|
|
62
|
+
| **Quality Gate** | (auto) | 3 | — | Mandatory on every workflow. Veto power. |
|
|
61
63
|
|
|
62
64
|
## How It Works
|
|
63
65
|
|
|
64
66
|
**Just describe what you need.** ArkaOS routes it to the right squad.
|
|
65
67
|
|
|
66
68
|
```
|
|
67
|
-
"add user authentication"
|
|
68
|
-
"create a brand for my app"
|
|
69
|
-
"plan our Q3 budget"
|
|
70
|
-
"design a sales funnel"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
69
|
+
"add user authentication" → /dev feature
|
|
70
|
+
"create a brand for my app" → /brand identity
|
|
71
|
+
"plan our Q3 budget" → /fin budget
|
|
72
|
+
"design a sales funnel" → /landing funnel
|
|
73
|
+
"are we GDPR compliant?" → /ops gdpr-compliance
|
|
74
|
+
"score these headlines" → python scripts/tools/headline_scorer.py
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
Or use explicit commands: `/dev feature "user auth"`, `/saas validate "scheduling tool"
|
|
77
|
+
Or use explicit commands: `/dev feature "user auth"`, `/saas validate "scheduling tool"`
|
|
78
|
+
|
|
79
|
+
## Python CLI Tools
|
|
80
|
+
|
|
81
|
+
8 stdlib-only tools for quantitative analysis. No dependencies.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
python scripts/tools/headline_scorer.py "10x Your Revenue" --json
|
|
85
|
+
python scripts/tools/seo_checker.py page.html --json
|
|
86
|
+
python scripts/tools/rice_prioritizer.py features.json --json
|
|
87
|
+
python scripts/tools/dcf_calculator.py --revenue 1000000 --growth 20 --json
|
|
88
|
+
python scripts/tools/tech_debt_analyzer.py src/ --json
|
|
89
|
+
python scripts/tools/saas_metrics.py --new-mrr 50000 --json
|
|
90
|
+
python scripts/tools/brand_voice_analyzer.py content.txt --json
|
|
91
|
+
python scripts/tools/okr_cascade.py growth --json
|
|
92
|
+
```
|
|
76
93
|
|
|
77
94
|
## Agent DNA
|
|
78
95
|
|
|
79
|
-
Every agent has a
|
|
96
|
+
Every agent has a behavioral profile from 4 frameworks:
|
|
80
97
|
|
|
81
|
-
- **DISC** — How they communicate
|
|
98
|
+
- **DISC** — How they communicate
|
|
82
99
|
- **Enneagram** — What motivates them (9 types with wings)
|
|
83
|
-
- **Big Five** — Personality traits
|
|
84
|
-
- **MBTI** — How they process information
|
|
85
|
-
|
|
86
|
-
This creates agents with consistent, realistic personalities that communicate differently based on their role and the situation.
|
|
100
|
+
- **Big Five** — Personality traits (0-100 scale)
|
|
101
|
+
- **MBTI** — How they process information
|
|
87
102
|
|
|
88
103
|
## Quality Gate
|
|
89
104
|
|
|
90
|
-
Nothing reaches you without
|
|
105
|
+
Nothing reaches you without all three reviewers:
|
|
106
|
+
|
|
107
|
+
- **Marta** (CQO) — orchestrates and issues final verdict
|
|
108
|
+
- **Eduardo** — text quality: spelling, grammar, tone, AI patterns
|
|
109
|
+
- **Francisca** — technical quality: code, tests, UX, security
|
|
91
110
|
|
|
92
|
-
|
|
93
|
-
- **Eduardo** reviews all text: spelling, grammar, tone, AI patterns
|
|
94
|
-
- **Francisca** reviews all technical output: code quality, tests, UX, security
|
|
111
|
+
APPROVED or REJECTED. No exceptions.
|
|
95
112
|
|
|
96
|
-
|
|
113
|
+
## The Conclave
|
|
114
|
+
|
|
115
|
+
Personal AI advisory board with 20 real-world advisor personas (Munger, Dalio, Bezos, Naval, Jobs, Sinek, etc.). Matched to your behavioral DNA via 17-question profiling.
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
/arka conclave # Start profiling
|
|
119
|
+
/arka conclave ask # Ask all advisors
|
|
120
|
+
/arka conclave debate # Advisors debate a topic
|
|
121
|
+
```
|
|
97
122
|
|
|
98
123
|
## Enterprise Frameworks
|
|
99
124
|
|
|
100
|
-
ArkaOS agents
|
|
125
|
+
ArkaOS agents apply validated frameworks, not generic prompts:
|
|
101
126
|
|
|
102
127
|
| Area | Frameworks |
|
|
103
128
|
|------|-----------|
|
|
104
|
-
| Development | Clean Code, SOLID, DDD, TDD, DORA
|
|
129
|
+
| Development | Clean Code, SOLID, DDD, TDD, DORA, OWASP, MITRE ATT&CK |
|
|
105
130
|
| Branding | Primal Branding, StoryBrand, 12 Archetypes, Positioning |
|
|
106
131
|
| Strategy | Porter's Five Forces, Blue Ocean, BMC, Wardley Maps, 7 Powers |
|
|
107
|
-
| Finance | DCF Valuation, Unit Economics, COSO ERM,
|
|
132
|
+
| Finance | DCF Valuation, Unit Economics, COSO ERM, ALE Risk Quantification |
|
|
108
133
|
| Marketing | AARRR, Growth Loops, Schwartz 5 Levels, PLG, STEPPS |
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
| PM | Scrum, Kanban, Shape Up, Continuous Discovery, Monte Carlo |
|
|
134
|
+
| Compliance | GDPR, ISO 27001, SOC 2, ISO 31000, ISO 9001 |
|
|
135
|
+
| PM | Scrum, Kanban, Shape Up, Continuous Discovery, RICE |
|
|
112
136
|
|
|
113
137
|
## Multi-Runtime
|
|
114
138
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
|
118
|
-
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
| Gemini CLI | Supported | Subagents, MCP, 1M context |
|
|
122
|
-
| Cursor | Supported | Agent mode, MCP |
|
|
139
|
+
| Runtime | Status |
|
|
140
|
+
|---------|--------|
|
|
141
|
+
| Claude Code | Primary — hooks, subagents, MCP, 1M context |
|
|
142
|
+
| Codex CLI | Supported — subagents, sandboxed execution |
|
|
143
|
+
| Gemini CLI | Supported — subagents, MCP, 1M context |
|
|
144
|
+
| Cursor | Supported — agent mode, MCP |
|
|
123
145
|
|
|
124
146
|
## Architecture
|
|
125
147
|
|
|
126
148
|
```
|
|
127
149
|
User Input
|
|
128
150
|
↓
|
|
129
|
-
Synapse (8-layer context injection
|
|
151
|
+
Synapse (8-layer context injection)
|
|
130
152
|
↓
|
|
131
153
|
Orchestrator (/do → department routing)
|
|
132
154
|
↓
|
|
@@ -134,21 +156,25 @@ Squad (YAML workflow with phases and gates)
|
|
|
134
156
|
↓
|
|
135
157
|
Quality Gate (Marta + Eduardo + Francisca)
|
|
136
158
|
↓
|
|
137
|
-
|
|
159
|
+
Output (Obsidian vault + structured deliverables)
|
|
138
160
|
```
|
|
139
161
|
|
|
140
|
-
Built with: Python core engine, Node.js installer, Bash hooks, YAML workflows.
|
|
162
|
+
Built with: Python core engine, Node.js installer, Bash hooks, YAML workflows, 1688 tests.
|
|
141
163
|
|
|
142
|
-
##
|
|
164
|
+
## Commands
|
|
143
165
|
|
|
144
|
-
|
|
166
|
+
```bash
|
|
167
|
+
npx arkaos install # Install
|
|
168
|
+
npx arkaos update # Update to latest
|
|
169
|
+
npx arkaos migrate # Migrate from v1
|
|
170
|
+
npx arkaos doctor # Health check
|
|
171
|
+
npx arkaos uninstall # Remove
|
|
172
|
+
```
|
|
145
173
|
|
|
146
|
-
|
|
174
|
+
## Contributing
|
|
147
175
|
|
|
148
|
-
|
|
176
|
+
See [CONTRIBUTING.md](.github/CONTRIBUTING.md). PRs welcome — all changes require review.
|
|
149
177
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
---
|
|
178
|
+
## License
|
|
153
179
|
|
|
154
|
-
|
|
180
|
+
MIT — [WizardingCode](https://wizardingcode.com)
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.1
|
package/bin/arkaos
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -125,3 +125,7 @@ Surface these issues WITHOUT being asked:
|
|
|
125
125
|
- Latency budget: <Xms per stage>
|
|
126
126
|
- Cost ceiling: <$ per task>
|
|
127
127
|
```
|
|
128
|
+
|
|
129
|
+
## References
|
|
130
|
+
|
|
131
|
+
- [architecture-patterns.md](references/architecture-patterns.md) — 5 multi-agent patterns with decision matrix, anti-patterns, and scaling characteristics
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Multi-Agent Architecture Patterns — Deep Reference
|
|
2
|
+
|
|
3
|
+
> 5 patterns with decision criteria, anti-patterns, scaling characteristics, and failure modes.
|
|
4
|
+
|
|
5
|
+
## Pattern Decision Matrix
|
|
6
|
+
|
|
7
|
+
| Criterion | Single | Supervisor | Swarm | Hierarchical | Pipeline |
|
|
8
|
+
|-----------|--------|-----------|-------|-------------|----------|
|
|
9
|
+
| Task complexity | Low | Medium | High (emergent) | High (structured) | Medium (sequential) |
|
|
10
|
+
| Agents needed | 1 | 2-10 | 5-50+ | 10-100+ | 3-10 |
|
|
11
|
+
| Coordination overhead | None | Low | High | Medium | Low |
|
|
12
|
+
| Fault tolerance | None | Supervisor is SPOF | High | Medium | Low (chain breaks) |
|
|
13
|
+
| Debuggability | Easy | Medium | Hard | Medium | Easy |
|
|
14
|
+
| Latency | Lowest | Medium | Variable | Higher | Sum of stages |
|
|
15
|
+
|
|
16
|
+
## Pattern 1: Single Agent
|
|
17
|
+
|
|
18
|
+
**Structure:** One agent handles all tasks end-to-end.
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
User --> [Agent] --> Result
|
|
22
|
+
|
|
|
23
|
+
[Tool 1] [Tool 2] [Tool 3]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**When to use:**
|
|
27
|
+
- Task scope is narrow and well-defined
|
|
28
|
+
- Fewer than 5 tools needed
|
|
29
|
+
- No parallelism benefit
|
|
30
|
+
- Latency is critical
|
|
31
|
+
|
|
32
|
+
**Real-world examples:** Code review bot, customer FAQ responder, log summarizer.
|
|
33
|
+
|
|
34
|
+
**Anti-patterns:**
|
|
35
|
+
- Agent has 10+ tools (cognitive overload, poor tool selection)
|
|
36
|
+
- Agent handles both planning and execution (conflated responsibilities)
|
|
37
|
+
- Agent needs expertise in multiple unrelated domains
|
|
38
|
+
|
|
39
|
+
**Scaling limit:** Degrades when context window fills or tool count exceeds 5-7.
|
|
40
|
+
|
|
41
|
+
**Failure modes:**
|
|
42
|
+
|
|
43
|
+
| Failure | Symptom | Mitigation |
|
|
44
|
+
|---------|---------|------------|
|
|
45
|
+
| Context overflow | Truncated reasoning, lost instructions | Summarize intermediate results |
|
|
46
|
+
| Tool selection errors | Wrong tool called | Reduce tool count, improve descriptions |
|
|
47
|
+
| Single point of failure | Total task failure | Retry with backoff |
|
|
48
|
+
|
|
49
|
+
## Pattern 2: Supervisor (Hub-and-Spoke)
|
|
50
|
+
|
|
51
|
+
**Structure:** One coordinator delegates to specialized workers.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
User --> [Supervisor]
|
|
55
|
+
|
|
|
56
|
+
+-------+-------+
|
|
57
|
+
| | |
|
|
58
|
+
[Worker] [Worker] [Worker]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**When to use:**
|
|
62
|
+
- Tasks decompose into independent subtasks
|
|
63
|
+
- Need centralized quality control
|
|
64
|
+
- Workers have distinct specializations
|
|
65
|
+
- 2-10 workers
|
|
66
|
+
|
|
67
|
+
**Real-world examples:** ArkaOS department leads, customer support routing, document processing with specialists (OCR agent, NLP agent, validation agent).
|
|
68
|
+
|
|
69
|
+
**Anti-patterns:**
|
|
70
|
+
- Supervisor does work instead of delegating (bottleneck)
|
|
71
|
+
- Workers communicate directly bypassing supervisor (untracked state)
|
|
72
|
+
- Single supervisor for 20+ workers (coordination overload)
|
|
73
|
+
|
|
74
|
+
**Scaling:** Linear with worker count until supervisor becomes bottleneck (~10-15 workers). Fix with hierarchical pattern.
|
|
75
|
+
|
|
76
|
+
**Failure modes:**
|
|
77
|
+
|
|
78
|
+
| Failure | Symptom | Mitigation |
|
|
79
|
+
|---------|---------|------------|
|
|
80
|
+
| Supervisor bottleneck | High latency, queued tasks | Add worker-level autonomy |
|
|
81
|
+
| Bad task decomposition | Workers receive incomplete context | Structured handoff schema |
|
|
82
|
+
| Worker failure | Subtask missing from result | Retry policy, fallback workers |
|
|
83
|
+
|
|
84
|
+
## Pattern 3: Swarm (Peer-to-Peer)
|
|
85
|
+
|
|
86
|
+
**Structure:** Agents communicate directly, no central coordinator.
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
[Agent A] <---> [Agent B]
|
|
90
|
+
^ ^
|
|
91
|
+
| |
|
|
92
|
+
v v
|
|
93
|
+
[Agent C] <---> [Agent D]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**When to use:**
|
|
97
|
+
- Problems require emergent solutions
|
|
98
|
+
- No single agent can plan the full solution
|
|
99
|
+
- High parallelism needed
|
|
100
|
+
- Fault tolerance is critical (no SPOF)
|
|
101
|
+
|
|
102
|
+
**Real-world examples:** Distributed code review (each agent reviews different aspects), brainstorming systems, adversarial debate architectures.
|
|
103
|
+
|
|
104
|
+
**Anti-patterns:**
|
|
105
|
+
- No termination condition (infinite loops)
|
|
106
|
+
- No shared state schema (agents talk past each other)
|
|
107
|
+
- All agents have identical capabilities (no specialization benefit)
|
|
108
|
+
- No conflict resolution mechanism (contradictory outputs)
|
|
109
|
+
|
|
110
|
+
**Scaling:** Scales well horizontally but communication complexity grows O(n^2). Use topic-based pub/sub to reduce.
|
|
111
|
+
|
|
112
|
+
**Failure modes:**
|
|
113
|
+
|
|
114
|
+
| Failure | Symptom | Mitigation |
|
|
115
|
+
|---------|---------|------------|
|
|
116
|
+
| Infinite loops | Never-ending agent conversations | Max iteration count, convergence check |
|
|
117
|
+
| State divergence | Agents working on stale information | Shared state with version vectors |
|
|
118
|
+
| Deadlock | Agents waiting on each other | Timeout-based resolution |
|
|
119
|
+
| Emergent chaos | Unpredictable outputs | Guardrails on each agent, output validation |
|
|
120
|
+
|
|
121
|
+
## Pattern 4: Hierarchical (Tree)
|
|
122
|
+
|
|
123
|
+
**Structure:** Multiple levels of supervisors forming an organizational tree.
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
[Executive]
|
|
127
|
+
/ \
|
|
128
|
+
[Manager A] [Manager B]
|
|
129
|
+
/ \ / \
|
|
130
|
+
[W1] [W2] [W3] [W4]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**When to use:**
|
|
134
|
+
- Large-scale systems with 10+ agents
|
|
135
|
+
- Natural organizational decomposition (departments, teams)
|
|
136
|
+
- Different abstraction levels needed (strategy vs execution)
|
|
137
|
+
- Need both autonomy and oversight
|
|
138
|
+
|
|
139
|
+
**Real-world examples:** ArkaOS full system (CTO > Leads > Specialists), enterprise workflow automation, large codebase refactoring.
|
|
140
|
+
|
|
141
|
+
**Anti-patterns:**
|
|
142
|
+
- Too many hierarchy levels (>3 for most systems, latency compounds)
|
|
143
|
+
- Managers that just pass messages (no value-add at each level)
|
|
144
|
+
- No skip-level communication for urgent issues
|
|
145
|
+
- Rigid hierarchy when tasks cross organizational boundaries
|
|
146
|
+
|
|
147
|
+
**Scaling:** Best for large systems. Add branches, not depth. Keep depth at 2-3 levels maximum.
|
|
148
|
+
|
|
149
|
+
**Failure modes:**
|
|
150
|
+
|
|
151
|
+
| Failure | Symptom | Mitigation |
|
|
152
|
+
|---------|---------|------------|
|
|
153
|
+
| Communication overhead | Slow responses, garbled context | Structured handoff contracts |
|
|
154
|
+
| Middle management bloat | Layers that add latency without value | Audit each level's contribution |
|
|
155
|
+
| Cross-branch coordination | Tasks that need agents from different branches | Ad-hoc squads, matrix overlay |
|
|
156
|
+
| Cascade failure | Manager failure kills entire branch | Fallback managers, worker autonomy |
|
|
157
|
+
|
|
158
|
+
## Pattern 5: Pipeline (Sequential Chain)
|
|
159
|
+
|
|
160
|
+
**Structure:** Agents process data in a fixed sequence.
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
[Input] --> [Stage 1] --> [Stage 2] --> [Stage 3] --> [Output]
|
|
164
|
+
Extract Transform Validate
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**When to use:**
|
|
168
|
+
- Processing has a natural sequential order
|
|
169
|
+
- Each stage has a clear input/output contract
|
|
170
|
+
- Stages are independently testable
|
|
171
|
+
- Data transformation workflows
|
|
172
|
+
|
|
173
|
+
**Real-world examples:** RAG pipeline (chunk > embed > retrieve > rerank > generate), CI/CD pipeline, content moderation (detect > classify > action).
|
|
174
|
+
|
|
175
|
+
**Anti-patterns:**
|
|
176
|
+
- Stage needs output from a non-adjacent stage (breaks linearity)
|
|
177
|
+
- Stages are tightly coupled (can not test independently)
|
|
178
|
+
- No error handling between stages (silent failures propagate)
|
|
179
|
+
- Pipeline too long (>7 stages, latency compounds)
|
|
180
|
+
|
|
181
|
+
**Scaling:** Scale individual stages independently. Bottleneck is the slowest stage. Use queues between stages for buffering.
|
|
182
|
+
|
|
183
|
+
**Failure modes:**
|
|
184
|
+
|
|
185
|
+
| Failure | Symptom | Mitigation |
|
|
186
|
+
|---------|---------|------------|
|
|
187
|
+
| Stage failure | Pipeline halts | Dead letter queue, skip with default |
|
|
188
|
+
| Bottleneck stage | Throughput limited by slowest stage | Scale that stage, add parallelism |
|
|
189
|
+
| Schema mismatch | Stage receives unexpected input format | Strict contracts, validation between stages |
|
|
190
|
+
| Error propagation | Bad output from stage N corrupts N+1 | Validation gates between stages |
|
|
191
|
+
|
|
192
|
+
## Pattern Selection Checklist
|
|
193
|
+
|
|
194
|
+
Use this checklist to narrow down the right pattern:
|
|
195
|
+
|
|
196
|
+
- [ ] How many distinct agent roles are needed? (1 = Single, 2-10 = Supervisor, 10+ = Hierarchical)
|
|
197
|
+
- [ ] Is the workflow sequential or parallel? (Sequential = Pipeline, Parallel = Supervisor/Swarm)
|
|
198
|
+
- [ ] Is there a natural coordinator? (Yes = Supervisor, No = Swarm)
|
|
199
|
+
- [ ] How important is fault tolerance? (Critical = Swarm, Standard = Supervisor)
|
|
200
|
+
- [ ] What is the latency budget? (Tight = Single/Pipeline, Flexible = Hierarchical)
|
|
201
|
+
- [ ] How debuggable must the system be? (High = Pipeline/Single, Medium = Supervisor)
|
|
202
|
+
|
|
203
|
+
## Hybrid Patterns
|
|
204
|
+
|
|
205
|
+
Most production systems combine patterns:
|
|
206
|
+
|
|
207
|
+
| Hybrid | Structure | Example |
|
|
208
|
+
|--------|-----------|---------|
|
|
209
|
+
| **Supervisor + Pipeline** | Supervisor delegates to pipelines | ArkaOS workflow phases |
|
|
210
|
+
| **Hierarchical + Swarm** | Tree structure with peer collaboration at leaf level | Department leads + specialist brainstorming |
|
|
211
|
+
| **Pipeline + Supervisor** | Pipeline stages contain supervisor-worker teams | ETL where transform stage has multiple workers |
|
|
212
|
+
|
|
213
|
+
## Token Handoff Cost
|
|
214
|
+
|
|
215
|
+
| Pattern | Tokens per Handoff | Handoffs per Task | Total Overhead |
|
|
216
|
+
|---------|-------------------|-------------------|----------------|
|
|
217
|
+
| Single | 0 | 0 | 0 |
|
|
218
|
+
| Supervisor | 200-500 | 2-5 | 400-2500 |
|
|
219
|
+
| Pipeline | 300-800 | N stages | 300N-800N |
|
|
220
|
+
| Hierarchical | 200-500 | 2-3 per level | 400-1500 per level |
|
|
221
|
+
| Swarm | 100-300 | Unpredictable | High variance |
|
|
222
|
+
|
|
223
|
+
Rule of thumb: If total handoff overhead exceeds 30% of useful work tokens, simplify the architecture.
|
|
@@ -110,3 +110,7 @@ Surface these issues WITHOUT being asked:
|
|
|
110
110
|
| Priority | Action | Effort | Risk Reduced |
|
|
111
111
|
|----------|--------|--------|-------------|
|
|
112
112
|
```
|
|
113
|
+
|
|
114
|
+
## References
|
|
115
|
+
|
|
116
|
+
- [prompt-injection-catalog.md](references/prompt-injection-catalog.md) — Direct and indirect injection attacks, jailbreaks, data exfiltration via tools, detection patterns, and mitigation strategies
|