vibes-plug 2.14.1 → 3.9.0

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.
Files changed (151) hide show
  1. package/.claude/rules/vibes-plug-core.md +5 -0
  2. package/.cursor/rules/vibes-plug-core.mdc +7 -2
  3. package/.cursorrules +8 -2
  4. package/AGENTS.md +23 -2
  5. package/CHANGELOG.md +114 -0
  6. package/CLAUDE.md +10 -3
  7. package/README.md +216 -611
  8. package/bin/vibes.mjs +1104 -0
  9. package/package.json +11 -3
  10. package/plugin.json +4 -3
  11. package/scripts/check-anti-slop.mjs +53 -0
  12. package/scripts/install.js +3 -1
  13. package/scripts/update_skills.js +1 -1
  14. package/scripts/update_skills.mjs +86 -0
  15. package/scripts/validate-skills.mjs +111 -0
  16. package/skills/accessibility-testing-expert/SKILL.md +117 -116
  17. package/skills/affective-computing-emotion-ai/SKILL.md +83 -0
  18. package/skills/agentic-coding-workflow-expert/SKILL.md +297 -0
  19. package/skills/agentic-memory-architect/SKILL.md +52 -0
  20. package/skills/agentic-micro-economy-architect/SKILL.md +92 -0
  21. package/skills/ai-llm-integration-expert/SKILL.md +330 -194
  22. package/skills/ai-media-generation-expert/SKILL.md +173 -172
  23. package/skills/ai-prompt-engineering-expert/SKILL.md +204 -134
  24. package/skills/ai-safety-governance-expert/SKILL.md +223 -0
  25. package/skills/angular-expert/SKILL.md +149 -148
  26. package/skills/anti-slop/SKILL.md +134 -133
  27. package/skills/api-design-expert/SKILL.md +4 -3
  28. package/skills/api-gateway-proxy-expert/SKILL.md +3 -2
  29. package/skills/app-analyzer-optimizer/SKILL.md +4 -3
  30. package/skills/apple-ecosystem-expert/SKILL.md +6 -5
  31. package/skills/astro-framework-expert/SKILL.md +201 -200
  32. package/skills/async-queue-temporal-expert/SKILL.md +218 -217
  33. package/skills/authentication-identity-expert/SKILL.md +174 -173
  34. package/skills/autonomous-red-teamer/SKILL.md +338 -203
  35. package/skills/autonomous-tdd-debugger/SKILL.md +6 -5
  36. package/skills/biome-linter-formatter-expert/SKILL.md +90 -89
  37. package/skills/blockchain-web3-expert/SKILL.md +116 -115
  38. package/skills/brainstorming/SKILL.md +392 -377
  39. package/skills/browser-automation-expert/SKILL.md +260 -222
  40. package/skills/bun-runtime-expert/SKILL.md +5 -4
  41. package/skills/chatbot-messaging-expert/SKILL.md +115 -114
  42. package/skills/ci-cd-devops-architect/SKILL.md +3 -2
  43. package/skills/cloud-hosting-expert/SKILL.md +5 -4
  44. package/skills/coderabbit/SKILL.md +5 -4
  45. package/skills/compliance-gdpr-privacy-expert/SKILL.md +3 -2
  46. package/skills/composable-mach-architect/SKILL.md +338 -0
  47. package/skills/cron-scheduler-expert/SKILL.md +5 -4
  48. package/skills/data-pipeline-etl-expert/SKILL.md +3 -2
  49. package/skills/data-telemetry-expert/SKILL.md +5 -4
  50. package/skills/data-visualization-expert/SKILL.md +155 -154
  51. package/skills/database-orm-expert/SKILL.md +166 -165
  52. package/skills/deep-research-analyst/SKILL.md +182 -136
  53. package/skills/dependency-upgrade-migrator/SKILL.md +11 -10
  54. package/skills/design-system-architect/SKILL.md +4 -3
  55. package/skills/desktop-electron-expert/SKILL.md +129 -128
  56. package/skills/documentation-site-expert/SKILL.md +60 -59
  57. package/skills/doku-mcp-server/SKILL.md +5 -4
  58. package/skills/doku-payment-gateway/SKILL.md +250 -232
  59. package/skills/domain-driven-design-expert/SKILL.md +3 -2
  60. package/skills/e2e-testing-expert/SKILL.md +5 -4
  61. package/skills/ecommerce-expert/SKILL.md +88 -87
  62. package/skills/email-notification-expert/SKILL.md +5 -4
  63. package/skills/ephemeral-generative-ui-architect/SKILL.md +88 -0
  64. package/skills/error-resilience-expert/SKILL.md +14 -13
  65. package/skills/event-driven-architect/SKILL.md +5 -4
  66. package/skills/feature-flag-analytics-expert/SKILL.md +3 -2
  67. package/skills/file-upload-media-expert/SKILL.md +5 -4
  68. package/skills/firebase-security-expert/SKILL.md +5 -4
  69. package/skills/form-validation-expert/SKILL.md +7 -6
  70. package/skills/frontier-ai-models-expert/SKILL.md +116 -0
  71. package/skills/fullstack-expert/SKILL.md +185 -184
  72. package/skills/gemini-agent-booster/SKILL.md +248 -172
  73. package/skills/geospatial-maps-expert/SKILL.md +81 -80
  74. package/skills/global-a11y-i18n-expert/SKILL.md +5 -4
  75. package/skills/glsl-shader-expert/SKILL.md +191 -190
  76. package/skills/go-programming-expert/SKILL.md +5 -4
  77. package/skills/graph-rag-knowledge-expert/SKILL.md +201 -200
  78. package/skills/graphql-apollo-expert/SKILL.md +5 -4
  79. package/skills/headless-cms-expert/SKILL.md +182 -181
  80. package/skills/hig/SKILL.md +5 -4
  81. package/skills/js-backend-expert/SKILL.md +219 -218
  82. package/skills/legacy-code-translator/SKILL.md +6 -5
  83. package/skills/llm-finops-router/SKILL.md +52 -0
  84. package/skills/local-slm-edge-ai-expert/SKILL.md +168 -167
  85. package/skills/logging-error-tracking-expert/SKILL.md +5 -4
  86. package/skills/mcp-server-architect/SKILL.md +315 -307
  87. package/skills/micro-frontend-architect/SKILL.md +5 -4
  88. package/skills/mobile-expo-expert/SKILL.md +5 -4
  89. package/skills/modern-css-native-expert/SKILL.md +190 -189
  90. package/skills/monorepo-architect/SKILL.md +5 -4
  91. package/skills/mpa-orchestrator/SKILL.md +41 -4
  92. package/skills/multi-agent-orchestration/SKILL.md +388 -254
  93. package/skills/mvc-expert/SKILL.md +5 -4
  94. package/skills/n8n-automation-expert/SKILL.md +90 -89
  95. package/skills/nextjs-app-router-expert/SKILL.md +3 -2
  96. package/skills/openapi-swagger-codegen-expert/SKILL.md +4 -3
  97. package/skills/payment-gateway-expert/SKILL.md +131 -128
  98. package/skills/pdf-document-generation-expert/SKILL.md +92 -91
  99. package/skills/performance-web-vitals/SKILL.md +5 -4
  100. package/skills/post-quantum-crypto-migrator/SKILL.md +3 -2
  101. package/skills/prd-architect/SKILL.md +183 -182
  102. package/skills/proactive-background-watcher/SKILL.md +5 -4
  103. package/skills/production-ready-hardener/SKILL.md +10 -9
  104. package/skills/pwa-offline-first-expert/SKILL.md +227 -226
  105. package/skills/pydantic-ai-expert/SKILL.md +162 -161
  106. package/skills/python-programming-expert/SKILL.md +5 -4
  107. package/skills/rate-limit-abuse-prevention/SKILL.md +5 -4
  108. package/skills/realtime-collaboration-expert/SKILL.md +3 -2
  109. package/skills/rich-text-editor-expert/SKILL.md +178 -177
  110. package/skills/rust-programming-expert/SKILL.md +5 -4
  111. package/skills/saas-architect/SKILL.md +155 -154
  112. package/skills/saas-billing/SKILL.md +394 -382
  113. package/skills/saas-multi-tenant/SKILL.md +7 -6
  114. package/skills/scalability-clean-code/SKILL.md +5 -4
  115. package/skills/search-engine-expert/SKILL.md +90 -89
  116. package/skills/self-healing-cloud-orchestrator/SKILL.md +3 -2
  117. package/skills/senior-frontend/SKILL.md +14 -9
  118. package/skills/seo/SKILL.md +4 -4
  119. package/skills/session-memory-manager/SKILL.md +129 -128
  120. package/skills/solidjs-expert/SKILL.md +81 -80
  121. package/skills/spa-orchestrator/SKILL.md +5 -4
  122. package/skills/sse-websocket-streaming-expert/SKILL.md +3 -2
  123. package/skills/state-management-expert/SKILL.md +5 -4
  124. package/skills/supabase-security-expert/SKILL.md +5 -4
  125. package/skills/svelte-sveltekit-expert/SKILL.md +92 -91
  126. package/skills/svg-animation-motion-expert/SKILL.md +3 -2
  127. package/skills/synthetic-data-finetuning-expert/SKILL.md +156 -155
  128. package/skills/tailwind-expert/SKILL.md +62 -5
  129. package/skills/tanstack-query-expert/SKILL.md +5 -4
  130. package/skills/tauri-expert/SKILL.md +5 -4
  131. package/skills/typescript-expert/SKILL.md +5 -4
  132. package/skills/ui-ux-pro-max/SKILL.md +7 -6
  133. package/skills/vector-db-rag-expert/SKILL.md +209 -208
  134. package/skills/vercel-ai-sdk-expert/SKILL.md +226 -181
  135. package/skills/voice-ai-realtime-agent/SKILL.md +243 -242
  136. package/skills/vue-frontend-expert/SKILL.md +5 -4
  137. package/skills/wasm-edge-computing-expert/SKILL.md +3 -2
  138. package/skills/web-3d-graphics-expert/SKILL.md +314 -313
  139. package/skills/web-game-engine-expert/SKILL.md +330 -329
  140. package/skills/web-scraper/SKILL.md +158 -157
  141. package/skills/website-design-cloner/SKILL.md +5 -4
  142. package/skills/webxr-ar-vr-expert/SKILL.md +163 -162
  143. package/skills/wordpress-headless-expert/SKILL.md +145 -144
  144. package/skills/zero-tech-debt-auditor/SKILL.md +115 -0
  145. package/skills/zero-to-prod-orchestrator/SKILL.md +281 -229
  146. package/skills/zero-trust-secret-vault/SKILL.md +3 -2
  147. package/BLUEPRINT.md +0 -319
  148. package/skills/bootstrap-to-modern/SKILL.md +0 -94
  149. package/skills/multiple-entry-points/SKILL.md +0 -91
  150. package/skills/secure-fuzz-testing/SKILL.md +0 -207
  151. package/skills/visual-qa-vision-agent/SKILL.md +0 -71
@@ -1,254 +1,388 @@
1
- ---
2
- name: multi-agent-orchestration
3
- version: "2.8.0"
4
- description: "Expert guide for designing and orchestrating multi-agent systems, agent swarms, 2026 Anthropic agentic design patterns, graph-based workflows (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), shared state memory, and human-in-the-loop guardrails in English and Indonesian."
5
- author: "Roedy Rustam"
6
- ---
7
-
8
- # Multi-Agent Orchestration Expert (2026 Edition)
9
-
10
- [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
11
-
12
- ---
13
-
14
- <a name="english"></a>
15
- ## English
16
-
17
- ### Orchestration & Integration
18
- Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, `ai-llm-integration-expert`, `mcp-server-architect`, and `project-context-mapper` to ensure cohesive execution.
19
-
20
- ### Description
21
- Expert guide for designing, building, and deploying production-grade multi-agent AI systems. Covers core agentic design patterns (Prompt Chaining, Routing, Parallelization, Orchestrator-Workers, Evaluator-Optimizer), stateful graph engines (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), shared episodic/semantic memory, tool execution sandboxes, and human-in-the-loop (HITL) guardrails.
22
-
23
- **Swarm Synergy:** This skill acts as a master orchestrator when combined with `mcp-server-architect` (for external tool integration) and `ai-llm-integration-expert` (for foundation model setup). Together, they form a complete, end-to-end **AI Engineering Swarm**.
24
-
25
- ### Trigger Conditions
26
- - Building autonomous AI agents that execute complex, multi-step tasks across several domains.
27
- - Designing systems where multiple specialized AI agents collaborate, deliberate, and cross-validate.
28
- - Implementing stateful, graph-based agent workflows with LangGraph, OpenAI Agents SDK, or Google ADK.
29
- - Implementing Anthropic agentic design patterns: Evaluator-Optimizer loops, Orchestrator-Workers, or Routing.
30
- - Integrating human-in-the-loop (HITL) pause checkpoints for high-risk actions (code execution, database migrations, financial transactions).
31
- - Evaluating and selecting agent architectures across Python, TypeScript, and multi-platform swarms.
32
-
33
- ### Anthropic 2026 Core Agentic Design Patterns
34
-
35
- Production systems should favor explicit **Workflows** over unbounded autonomous loops where predictability and reliability are required:
36
-
37
- ```
38
- 1. PROMPT CHAINING
39
- [Input] ---> [LLM Step 1] ---> [Gate/Validator] ---> [LLM Step 2] ---> [Output]
40
-
41
- 2. ROUTING
42
- [Input] ---> [Classifier/Router] ──┬──> [Specialist Agent A]
43
- ├──> [Specialist Agent B]
44
- └──> [Specialist Agent C]
45
-
46
- 3. PARALLELIZATION (Sectioning & Voting)
47
- [Input] ──┬──> [Task 1 (Subagent)] ──┐
48
- ├──> [Task 2 (Subagent)] ──┼──> [Aggregator / Synthesizer]
49
- └──> [Task 3 (Subagent)] ──┘
50
-
51
- 4. ORCHESTRATOR-WORKERS (Dynamic Decomposition)
52
- [Input] ---> [Orchestrator] ──┬──> [Worker 1 (Focused Context)] ──┐
53
- ├──> [Worker 2 (Focused Context)] ──┼──> [Orchestrator Synthesis]
54
- └──> [Worker 3 (Focused Context)] ──┘
55
-
56
- 5. EVALUATOR-OPTIMIZER LOOP (Zero-Tolerance Quality Gate)
57
- [Input] ---> [Generator Agent] <─────┐ (Feedback Loop)
58
- │ │
59
- ▼ │
60
- [Evaluator / Auditor] ────┘ (Reject / Needs Revision)
61
- │
62
- ▼ (Approved)
63
- [Output]
64
- ```
65
-
66
- ### Agent Framework Comparison (2026)
67
-
68
- | Framework | Language | Best For | Key Differentiator |
69
- |---|---|---|---|
70
- | **LangGraph (v0.3+)** | Python / TypeScript | Complex stateful workflows & graphs | Graph-based, persistent checkpointers, time-travel debugging |
71
- | **OpenAI Agents SDK** | Python | GPT-5 / o-series native agents | Built-in agent handoffs, tracing, and tripwire guardrails |
72
- | **Google ADK** | Python | Gemini-powered swarms | Native Vertex AI, multi-agent streaming, search grounding |
73
- | **Mastra.ai** | TypeScript | TS-first web apps & microservices | Built-in memory, evals, RAG, and native MCP support |
74
- | **CrewAI** | Python | Role-playing business teams | Fast initial prototyping for business analyst teams |
75
-
76
- ### Core Implementation Guidelines
77
-
78
- #### 1. LangGraph — Persistent State & HITL Checkpoints
79
- LangGraph models agent workflows as directed acyclic or cyclic graphs with persistent state:
80
- ```python
81
- from langgraph.graph import StateGraph, END
82
- from langgraph.checkpoint.memory import MemorySaver
83
- from typing import TypedDict, Annotated
84
- import operator
85
-
86
- class AgentState(TypedDict):
87
- messages: Annotated[list, operator.add]
88
- task: str
89
- code_artifact: str
90
- audit_feedback: str
91
- approved: bool
92
-
93
- def generator_node(state: AgentState):
94
- # Generates or refactors code based on previous feedback
95
- code = coder_agent.invoke(state["task"], feedback=state.get("audit_feedback"))
96
- return {"code_artifact": code}
97
-
98
- def evaluator_node(state: AgentState):
99
- # Runs automated linter/tests & security review
100
- audit = auditor_agent.invoke(state["code_artifact"])
101
- return {
102
- "audit_feedback": audit.critique,
103
- "approved": audit.is_passing
104
- }
105
-
106
- def route_next(state: AgentState) -> str:
107
- return END if state["approved"] else "generator"
108
-
109
- builder = StateGraph(AgentState)
110
- builder.add_node("generator", generator_node)
111
- builder.add_node("evaluator", evaluator_node)
112
- builder.set_entry_point("generator")
113
- builder.add_edge("generator", "evaluator")
114
- builder.add_conditional_edges("evaluator", route_next, {"generator": "generator", END: END})
115
-
116
- # Persist state with checkpointer for HITL interruption before destructive actions
117
- checkpointer = MemorySaver()
118
- graph = builder.compile(checkpointer=checkpointer, interrupt_before=["generator"])
119
- ```
120
-
121
- #### 2. OpenAI Agents SDK — Agent Handoffs & Guardrails
122
- Implement native agent handoffs where specialized agents transition control cleanly:
123
- ```python
124
- from agents import Agent, Runner, handoff, input_guardrail, GuardrailFunctionOutput
125
-
126
- researcher = Agent(
127
- name="Researcher",
128
- instructions="Research libraries, security advisories, and system specs.",
129
- tools=[web_search, doc_retrieval],
130
- )
131
-
132
- architect = Agent(
133
- name="Architect",
134
- instructions="Synthesize technical architecture and delegate research when needed.",
135
- handoffs=[handoff(researcher, tool_name_override="delegate_research")],
136
- )
137
-
138
- @input_guardrail
139
- async def safety_guardrail(ctx, agent, input_data) -> GuardrailFunctionOutput:
140
- if contains_destructive_commands(input_data):
141
- return GuardrailFunctionOutput(output_info="Blocked destructive payload", tripwire_triggered=True)
142
- return GuardrailFunctionOutput(output_info="Safe", tripwire_triggered=False)
143
-
144
- result = await Runner.run(architect, "Design high-throughput ingestion pipeline", guardrails=[safety_guardrail])
145
- ```
146
-
147
- #### 3. Google ADK — Gemini Multi-Agent Systems
148
- Orchestrate Gemini 3.x agents with streaming subagent calls and Vertex AI tooling:
149
- ```python
150
- from google.adk.agents import Agent
151
- from google.adk.tools import google_search, code_execution
152
-
153
- director = Agent(
154
- model="gemini-3.1-pro",
155
- name="director",
156
- instruction="Coordinate domain specialists and synthesize final deliverables.",
157
- sub_agents=[frontend_agent, backend_agent, security_agent],
158
- tools=[google_search, code_execution],
159
- )
160
- ```
161
-
162
- #### 4. Mastra.ai — TypeScript-Native Agents
163
- For modern Next.js / Node.js / Bun environments:
164
- ```typescript
165
- import { Agent, MastraMemory } from '@mastra/core';
166
- import { createTool } from '@mastra/core/tools';
167
- import { z } from 'zod';
168
-
169
- const researcher = new Agent({
170
- name: 'researcher',
171
- instructions: 'Find and summarize accurate technical documentation.',
172
- model: { provider: 'ANTHROPIC', name: 'claude-3-7-sonnet-20250219' },
173
- memory: new MastraMemory({ storage: supabaseStorage }),
174
- });
175
- ```
176
-
177
- #### 5. Human-in-the-Loop (HITL) Guardrails
178
- Mandatory safeguards before executing irreversible operations:
179
- - **Interrupt Checkpoints**: Halt workflow execution before executing code, migrating databases, or modifying production records.
180
- - **Approval Dashboards**: Surface diff previews and proposed shell commands to the user or admin before proceeding.
181
- - **Confidence Gates**: Auto-proceed only when model confidence score is >= 0.90; trigger human escalation otherwise.
182
-
183
- #### 6. Swarm Circuit Breakers & Fallback Protocols
184
- - **Retry Caps**: Maximum 2 automated retries per subagent.
185
- - **Fallback Escalation**: If a specialist agent stalls or loops, the Swarm Director gracefully fallbacks to `fullstack-expert` or requests human guidance.
186
- - **Checkpoint Persistence**: Always persist intermediate progress to `PROGRESS.md` or `BLUEPRINT.md` so sessions can resume without losing context.
187
-
188
- ---
189
-
190
- <a name="bahasa-indonesia"></a>
191
- ## Bahasa Indonesia
192
-
193
- ### Integrasi Orkestrasi
194
- Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, `ai-llm-integration-expert`, `mcp-server-architect`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
195
-
196
- ### Deskripsi
197
- Panduan ahli untuk merancang, membangun, dan men-deploy sistem multi-agen AI tingkat produksi. Mencakup pola desain agentik inti (Prompt Chaining, Routing, Parallelization, Orchestrator-Workers, Evaluator-Optimizer), engine graph stateful (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), memori bersama episodik/semantik, sandbox eksekusi tool, dan guardrail human-in-the-loop (HITL).
198
-
199
- **Sinergi Swarm:** Skill ini bertindak sebagai orkestrator utama jika dipadukan dengan `mcp-server-architect` (untuk integrasi tool eksternal) dan `ai-llm-integration-expert` (untuk konfigurasi foundation model). Bersama-sama, ketiganya membentuk **AI Engineering Swarm** yang tangguh dari awal hingga rilis produksi.
200
-
201
- ### Kondisi Pemicu
202
- - Membangun agen AI otonom yang mengeksekusi tugas kompleks multi-langkah lintas domain.
203
- - Merancang sistem kolaborasi, deliberasi, dan validasi silang antar beberapa agen AI spesialis.
204
- - Mengimplementasikan alur kerja graph stateful dengan LangGraph, OpenAI Agents SDK, atau Google ADK.
205
- - Menerapkan 5 pola desain agentik standar: Prompt Chaining, Routing, Parallelization, Orchestrator-Workers, atau Evaluator-Optimizer.
206
- - Mengintegrasikan pos henti human-in-the-loop (HITL) untuk tindakan berisiko tinggi (eksekusi kode, migrasi database, transaksi keuangan).
207
- - Memilih dan mengevaluasi arsitektur agen di ekosistem Python, TypeScript, atau multi-platform.
208
-
209
- ### 5 Pola Desain Agentik Inti (Standar Anthropic 2026)
210
-
211
- Untuk sistem produksi yang handal, utamakan arsitektur **Workflows** terstruktur daripada loop otonom tanpa batas:
212
-
213
- 1. **Prompt Chaining**: Memecah tugas menjadi langkah-langkah sekuensial dengan validasi output di setiap transisi.
214
- 2. **Routing**: Mengklasifikasikan input pengguna dan mengarahkannya ke model atau sub-agen yang memiliki spesialisasi yang tepat.
215
- 3. **Parallelization (Sectioning & Voting)**: Menjalankan beberapa sub-agen secara simultan untuk tugas independen atau menjalankan ensemble untuk konsensus voting.
216
- 4. **Orchestrator-Workers**: Agen orkestrator pusat memecah masalah dinamis, mendelegasikannya ke pekerja dengan konteks terfokus, lalu merangkum hasil akhirnya.
217
- 5. **Evaluator-Optimizer Loop**: Agen pembuat (*generator*) menghasilkan solusi sementara agen penilai (*evaluator*) memberikan audit dan umpan balik hingga standar kualitas terpenuhi.
218
-
219
- ### Perbandingan Framework Agen (2026)
220
-
221
- | Framework | Bahasa | Terbaik Untuk | Keunggulan Utama |
222
- |---|---|---|---|
223
- | **LangGraph (v0.3+)** | Python / TypeScript | Alur kerja graf stateful kompleks | Berbasis graf, checkpointer persisten, time-travel debugging |
224
- | **OpenAI Agents SDK** | Python | Agen native GPT-5 / o-series | Handoff antar agen bawaan, tracing, dan guardrail otomatis |
225
- | **Google ADK** | Python | Swarm agen bertenaga Gemini | Integrasi Vertex AI native, streaming multi-agen, search grounding |
226
- | **Mastra.ai** | TypeScript | Web apps & microservice TS-first | Memori bawaan, evaluasi otomatis, RAG, dan dukungan MCP native |
227
- | **CrewAI** | Python | Tim simulasi peran | Cepat untuk membuat prototipe kolaborasi tim bisnis |
228
-
229
- ### Panduan Implementasi Inti
230
-
231
- #### 1. LangGraph — State Persisten & Checkpoint HITL
232
- Memodelkan alur agen sebagai graf terarah dengan state bersama dan penyimpanan checkpoint:
233
- - Simpan state di database (PostgreSQL / MemorySaver) agar alur kerja dapat dijeda dan dilanjutkan kapan saja.
234
- - Terapkan `interrupt_before` sebelum node yang menjalankan perintah destruktif untuk meminta persetujuan manusia (*Human-in-the-loop*).
235
-
236
- #### 2. OpenAI Agents SDK — Handoffs & Guardrails
237
- Terapkan transisi kendali yang mulus antar agen dengan fungsi `handoff` bawaan serta pasang filter `guardrail` pada input dan output untuk mencegah eksekusi instruksi berbahaya.
238
-
239
- #### 3. Google ADK — Multi-Agent Gemini
240
- Bangun hierarki agen dengan model Gemini 3.x, di mana root agent mengoordinasikan sub-agents untuk riset, eksekusi kode, dan pembuatan dokumen.
241
-
242
- #### 4. Mastra.ai — Solusi TypeScript Penuh
243
- Gunakan Mastra untuk ekosistem Next.js dan Node.js: sediakan memori persisten ke Supabase/PostgreSQL, integrasikan tool MCP secara langsung, dan manfaatkan framework evaluasi bawaan.
244
-
245
- #### 5. Guardrails Human-in-the-Loop (HITL)
246
- Pengamanan wajib sebelum melakukan tindakan yang tidak dapat dibatalkan:
247
- - **Pos Henti Interupsi**: Hentikan eksekusi sebelum menjalankan skrip shell berbahaya, migrasi skema tabel, atau memodifikasi data produksi.
248
- - **Tinjauan Pratinjau**: Tampilkan ringkasan perbedaan (*diff*) kepada pengguna sebelum modifikasi dieksekusi.
249
- - **Ambang Keyakinan**: Otomatis lanjutkan hanya jika skor keyakinan model >= 0.90; eskalasikan ke manusia jika berada di bawah ambang batas.
250
-
251
- #### 6. Circuit Breakers & Protokol Pemulihan Swarm
252
- - **Batas Percobaan Ulang**: Maksimal 2 kali perbaikan otomatis per sub-agen.
253
- - **Eskalasi Fallback**: Jika agen spesialis mengalami kendala konteks atau gagal berulang kali, Swarm Director segera mengalihkan tugas ke `fullstack-expert` atau meminta masukan pengguna.
254
- - **Persistensi Kemajuan**: Simpan selalu checkpoint di `PROGRESS.md` atau `BLUEPRINT.md` agar alur kerja dapat dilanjutkan secara efisien tanpa token berlebih.
1
+ ---
2
+ name: multi-agent-orchestration
3
+ description: "Expert guide for designing and orchestrating multi-agent systems, agent swarms, 2026 Anthropic agentic design patterns, graph-based workflows (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), shared state memory, and human-in-the-loop guardrails in English and Indonesian."
4
+ author: "Roedy Rustam"
5
+ version: "3.0.0"
6
+ ---
7
+
8
+ # Multi-Agent Orchestration Expert (2026 Edition)
9
+
10
+ [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
11
+
12
+ ---
13
+
14
+ <a name="english"></a>
15
+ ## English
16
+
17
+ ### Orchestration & Integration
18
+ Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, `ai-llm-integration-expert`, `mcp-server-architect`, and `session-memory-manager` to ensure cohesive execution.
19
+
20
+ ### Description
21
+ Expert guide for designing, building, and deploying production-grade multi-agent AI systems. Covers core agentic design patterns (Prompt Chaining, Routing, Parallelization, Orchestrator-Workers, Evaluator-Optimizer), stateful graph engines (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), shared episodic/semantic memory, tool execution sandboxes, and human-in-the-loop (HITL) guardrails.
22
+
23
+ **Swarm Synergy:** This skill acts as a master orchestrator when combined with `mcp-server-architect` (for external tool integration) and `ai-llm-integration-expert` (for foundation model setup). Together, they form a complete, end-to-end **AI Engineering Swarm**.
24
+
25
+ ### Trigger Conditions
26
+ - Building autonomous AI agents that execute complex, multi-step tasks across several domains.
27
+ - Designing systems where multiple specialized AI agents collaborate, deliberate, and cross-validate.
28
+ - Implementing stateful, graph-based agent workflows with LangGraph, OpenAI Agents SDK, or Google ADK.
29
+ - Implementing Anthropic agentic design patterns: Evaluator-Optimizer loops, Orchestrator-Workers, or Routing.
30
+ - Integrating human-in-the-loop (HITL) pause checkpoints for high-risk actions (code execution, database migrations, financial transactions).
31
+ - Evaluating and selecting agent architectures across Python, TypeScript, and multi-platform swarms.
32
+
33
+ ### Anthropic 2026 Core Agentic Design Patterns
34
+
35
+ Production systems should favor explicit **Workflows** over unbounded autonomous loops where predictability and reliability are required:
36
+
37
+ ```
38
+ 1. PROMPT CHAINING
39
+ [Input] ---> [LLM Step 1] ---> [Gate/Validator] ---> [LLM Step 2] ---> [Output]
40
+
41
+ 2. ROUTING
42
+ [Input] ---> [Classifier/Router] ──┬──> [Specialist Agent A]
43
+ ├──> [Specialist Agent B]
44
+ └──> [Specialist Agent C]
45
+
46
+ 3. PARALLELIZATION (Sectioning & Voting)
47
+ [Input] ──┬──> [Task 1 (Subagent)] ──┐
48
+ ├──> [Task 2 (Subagent)] ──┼──> [Aggregator / Synthesizer]
49
+ └──> [Task 3 (Subagent)] ──┘
50
+
51
+ 4. ORCHESTRATOR-WORKERS (Dynamic Decomposition)
52
+ [Input] ---> [Orchestrator] ──┬──> [Worker 1 (Focused Context)] ──┐
53
+ ├──> [Worker 2 (Focused Context)] ──┼──> [Orchestrator Synthesis]
54
+ └──> [Worker 3 (Focused Context)] ──┘
55
+
56
+ 5. EVALUATOR-OPTIMIZER LOOP (Zero-Tolerance Quality Gate)
57
+ [Input] ---> [Generator Agent] <─────┐ (Feedback Loop)
58
+ │ │
59
+ ▼ │
60
+ [Evaluator / Auditor] ────┘ (Reject / Needs Revision)
61
+ │
62
+ ▼ (Approved)
63
+ [Output]
64
+ ```
65
+
66
+ ### Bridging Internal Swarm Patterns
67
+ vibes-plug's internal Swarm Director patterns (from `AGENTS.md`) map directly to these external frameworks:
68
+ - **Fan-Out / Fan-In topology**: Mapped via LangGraph parallel node execution + reducer functions, or Google ADK sub-agent arrays.
69
+ - **Pipeline Saga topology**: Mapped via OpenAI Agents SDK sequential handoffs or Mastra.ai sequential chains.
70
+ - **Critic-Validator Loop topology**: Mapped via LangGraph conditional edges routing back to generator nodes.
71
+
72
+ ### Agent Framework Comparison (2026)
73
+
74
+ | Framework | Language | Best For | Key Differentiator |
75
+ |---|---|---|---|
76
+ | **LangGraph (v0.3+)** | Python / TypeScript | Complex stateful workflows & graphs | Graph-based, persistent checkpointers, time-travel debugging |
77
+ | **OpenAI Agents SDK** | Python | GPT-4.5 / o4-series native agents | Built-in agent handoffs, tracing, and tripwire guardrails |
78
+ | **Google ADK** | Python | Gemini-powered swarms | Native Vertex AI, multi-agent streaming, search grounding |
79
+ | **Mastra.ai** | TypeScript | TS-first web apps & microservices | Built-in memory, evals, RAG, and native MCP support |
80
+ | **CrewAI** | Python | Role-playing business teams | Fast initial prototyping for business analyst teams |
81
+
82
+ ### Core Implementation Guidelines
83
+
84
+ #### 1. LangGraph — Persistent State & HITL Checkpoints
85
+ LangGraph models agent workflows as directed acyclic or cyclic graphs with persistent state:
86
+ ```python
87
+ from langgraph.graph import StateGraph, END
88
+ from langgraph.checkpoint.memory import MemorySaver
89
+ from typing import TypedDict, Annotated
90
+ import operator
91
+
92
+ class AgentState(TypedDict):
93
+ messages: Annotated[list, operator.add]
94
+ task: str
95
+ code_artifact: str
96
+ audit_feedback: str
97
+ approved: bool
98
+
99
+ def generator_node(state: AgentState):
100
+ # Generates or refactors code based on previous feedback
101
+ code = coder_agent.invoke(state["task"], feedback=state.get("audit_feedback"))
102
+ return {"code_artifact": code}
103
+
104
+ def evaluator_node(state: AgentState):
105
+ # Runs automated linter/tests & security review
106
+ audit = auditor_agent.invoke(state["code_artifact"])
107
+ return {
108
+ "audit_feedback": audit.critique,
109
+ "approved": audit.is_passing
110
+ }
111
+
112
+ def route_next(state: AgentState) -> str:
113
+ return END if state["approved"] else "generator"
114
+
115
+ builder = StateGraph(AgentState)
116
+ builder.add_node("generator", generator_node)
117
+ builder.add_node("evaluator", evaluator_node)
118
+ builder.set_entry_point("generator")
119
+ builder.add_edge("generator", "evaluator")
120
+ builder.add_conditional_edges("evaluator", route_next, {"generator": "generator", END: END})
121
+
122
+ # Persist state with checkpointer for HITL interruption before destructive actions
123
+ checkpointer = MemorySaver()
124
+ graph = builder.compile(checkpointer=checkpointer, interrupt_before=["generator"])
125
+ ```
126
+
127
+ **TypeScript LangGraph Implementation:**
128
+ ```typescript
129
+ import { StateGraph, MemorySaver, END } from "@langchain/langgraph";
130
+
131
+ const graphState = {
132
+ messages: { value: (x, y) => x.concat(y), default: () => [] },
133
+ approved: { value: (x, y) => y, default: () => false }
134
+ };
135
+
136
+ const builder = new StateGraph({ channels: graphState })
137
+ .addNode("generator", async (state) => ({ messages: [await coder.invoke(state)] }))
138
+ .addNode("evaluator", async (state) => {
139
+ const res = await auditor.invoke(state);
140
+ return { messages: [res.critique], approved: res.isPassing };
141
+ })
142
+ .addEdge("__start__", "generator")
143
+ .addEdge("generator", "evaluator")
144
+ .addConditionalEdges("evaluator", (state) => state.approved ? END : "generator");
145
+
146
+ const checkpointer = new MemorySaver();
147
+ const graph = builder.compile({ checkpointer, interruptBefore: ["generator"] });
148
+ ```
149
+
150
+ #### 2. OpenAI Agents SDK — Agent Handoffs & Guardrails
151
+ Implement native agent handoffs where specialized agents transition control cleanly:
152
+ ```python
153
+ from agents import Agent, Runner, handoff, input_guardrail, GuardrailFunctionOutput
154
+
155
+ researcher = Agent(
156
+ name="Researcher",
157
+ instructions="Research libraries, security advisories, and system specs.",
158
+ tools=[web_search, doc_retrieval],
159
+ )
160
+
161
+ architect = Agent(
162
+ name="Architect",
163
+ instructions="Synthesize technical architecture and delegate research when needed.",
164
+ handoffs=[handoff(researcher, tool_name_override="delegate_research")],
165
+ )
166
+
167
+ @input_guardrail
168
+ async def safety_guardrail(ctx, agent, input_data) -> GuardrailFunctionOutput:
169
+ if contains_destructive_commands(input_data):
170
+ return GuardrailFunctionOutput(output_info="Blocked destructive payload", tripwire_triggered=True)
171
+ return GuardrailFunctionOutput(output_info="Safe", tripwire_triggered=False)
172
+
173
+ result = await Runner.run(architect, "Design high-throughput ingestion pipeline", guardrails=[safety_guardrail])
174
+ ```
175
+
176
+ #### 3. Google ADK — Gemini Multi-Agent Systems
177
+ Orchestrate Gemini 3.x agents with streaming subagent calls and Vertex AI tooling:
178
+ ```python
179
+ from google.adk.agents import Agent
180
+ from google.adk.tools import google_search, code_execution
181
+
182
+ director = Agent(
183
+ model="gemini-3.1-pro",
184
+ name="director",
185
+ instruction="Coordinate domain specialists and synthesize final deliverables.",
186
+ sub_agents=[frontend_agent, backend_agent, security_agent],
187
+ tools=[google_search, code_execution],
188
+ )
189
+ ```
190
+
191
+ #### 4. Mastra.ai — TypeScript-Native Agents
192
+ For modern Next.js / Node.js / Bun environments:
193
+ ```typescript
194
+ import { Agent, MastraMemory } from '@mastra/core';
195
+ import { createTool } from '@mastra/core/tools';
196
+ import { z } from 'zod';
197
+
198
+ const researcher = new Agent({
199
+ name: 'researcher',
200
+ instructions: 'Find and summarize accurate technical documentation.',
201
+ model: { provider: 'ANTHROPIC', name: 'claude-3-7-sonnet-20250219' },
202
+ memory: new MastraMemory({ storage: supabaseStorage }),
203
+ });
204
+ ```
205
+
206
+ #### 5. Human-in-the-Loop (HITL) Guardrails
207
+ Mandatory safeguards before executing irreversible operations:
208
+ - **Interrupt Checkpoints**: Halt workflow execution before executing code, migrating databases, or modifying production records.
209
+ - **Approval Dashboards**: Surface diff previews and proposed shell commands to the user or admin before proceeding.
210
+ - **Confidence Gates**: Auto-proceed only when model confidence score is >= 0.90; trigger human escalation otherwise.
211
+
212
+ #### 6. Swarm Circuit Breakers & Fallback Protocols
213
+ - **Retry Caps**: Maximum 2 automated retries per subagent.
214
+ - **Fallback Escalation**: If a specialist agent stalls or loops, the Swarm Director gracefully fallbacks to `fullstack-expert` or requests human guidance.
215
+ - **Checkpoint Persistence**: Always persist intermediate progress to `PROGRESS.md` or `BLUEPRINT.md` so sessions can resume without losing context.
216
+
217
+ #### 7. Narrative Simulation Swarms (Fable Paradigm)
218
+ Multi-agent autonomous story world simulation architecture where agents act as characters.
219
+ - **Character-Agent Personality Encoding:** Uses Big Five personality model + emotional valence vectors (joy, anger, fear, surprise, sadness, disgust).
220
+ - **Inter-Agent Dialogue Protocols:** Constrained by narrative coherence.
221
+ - **World-State Consensus Protocol:** Distributed shared memory with conflict resolution to maintain a consistent simulated reality.
222
+ - **Autonomous Episodic Generation:** Agents create story episodes dynamically without human prompting.
223
+ - **Director Agent Pattern:** A meta-agent that monitors the swarm and ensures narrative arc consistency.
224
+
225
+ ```typescript
226
+ import { StateGraph, END } from "@langchain/langgraph";
227
+ import { BaseMessage, SystemMessage } from "@langchain/core/messages";
228
+
229
+ interface WorldState {
230
+ messages: BaseMessage[];
231
+ events: string[];
232
+ }
233
+
234
+ const romeoAgent = async (state: WorldState) => {
235
+ // Encoded with High Openness, High Neuroticism, emotional vectors
236
+ const response = await llm.invoke([
237
+ new SystemMessage("You are Romeo. You are feeling [Joy: 0.8, Sadness: 0.2]. Respond to the world state."),
238
+ ...state.messages
239
+ ]);
240
+ return { messages: [response] };
241
+ };
242
+
243
+ const directorAgent = async (state: WorldState) => {
244
+ // Ensures narrative arc consistency
245
+ const evaluation = await evaluatorLLM.invoke(state.messages);
246
+ return { events: [evaluation.content] };
247
+ };
248
+ ```
249
+
250
+ #### 8. Computer-Using Agent (CUA) Orchestration
251
+ - **CUA Agent Delegation:** Swarm director delegates specific UI tasks to CUA worker agents.
252
+ - **Screen-Sharing Observation:** Orchestrator agent observes CUA's visual stream to verify progress.
253
+ - **Recovery Protocols:** Handles CUA failures like stuck UI states or navigation errors via visual feedback loops.
254
+ - **Parallel CUA Execution:** Multiple CUA workers operate different browser tabs/windows simultaneously.
255
+
256
+ ```typescript
257
+ import { CUARunner, CUAWorker } from "cua-orchestration-sdk";
258
+
259
+ const orchestrator = new CUARunner();
260
+ const worker1 = new CUAWorker({ id: "tab-1", objective: "Scrape pricing page" });
261
+ const worker2 = new CUAWorker({ id: "tab-2", objective: "Monitor system health" });
262
+
263
+ orchestrator.registerWorkers([worker1, worker2]);
264
+ orchestrator.on("worker_stuck", async (worker, screenshot) => {
265
+ await orchestrator.recoverWorker(worker, screenshot);
266
+ });
267
+ await orchestrator.executeParallel();
268
+ ```
269
+
270
+ #### 9. Continuous Perception Swarms
271
+ - **Always-on Monitoring:** 24/7 perception loops capturing multimodal input.
272
+ - **Live Video/Audio Triage Agents:** (Intake → Classify → Route) pipelines processing continuous streams.
273
+ - **Spatial Awareness Distribution:** Sharing spatial context across the agent swarm.
274
+ - **Event-Driven Wakeup Protocols:** Agents remain dormant until a relevant stimulus is detected.
275
+ - **Gemini Multimodal Live API Integration:** Native hooks for continuous audio/video perception.
276
+
277
+ ```typescript
278
+ import { MultimodalLiveClient } from "gemini-live-sdk";
279
+ import { TriageSwarm } from "./swarm";
280
+
281
+ const client = new MultimodalLiveClient({ apiKey: process.env.GEMINI_API_KEY });
282
+ const swarm = new TriageSwarm();
283
+
284
+ client.on("video_frame", async (frame) => {
285
+ const classification = await swarm.intake(frame);
286
+ if (classification.isCritical) {
287
+ swarm.wakeupSpecialists(classification.type);
288
+ await swarm.route(frame, classification.type);
289
+ }
290
+ });
291
+ client.connect();
292
+ ```
293
+
294
+ #### 10. Massive Parallel Swarms (Agentic MoE) for Next-Gen LLMs
295
+ For next-gen models like **Gemini 4 Pro**:
296
+ - **Batched Tool Invocation**: Transition from sequential step-by-step orchestrators to massive batched function calling.
297
+ - **Monolithic Context Flow**: Pass the entire massive context (codebase snapshot) directly via KV-Cache rather than using chunked RAG retrieval per agent, allowing subagents to natively attend to the exact same shared memory state instantly.
298
+
299
+ ---
300
+
301
+ <a name="bahasa-indonesia"></a>
302
+ ## Bahasa Indonesia
303
+
304
+ ### Integrasi Orkestrasi
305
+ Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, `ai-llm-integration-expert`, `mcp-server-architect`, dan `session-memory-manager` untuk memastikan eksekusi yang kohesif.
306
+
307
+ ### Deskripsi
308
+ Panduan ahli untuk merancang, membangun, dan men-deploy sistem multi-agen AI tingkat produksi. Mencakup pola desain agentik inti (Prompt Chaining, Routing, Parallelization, Orchestrator-Workers, Evaluator-Optimizer), engine graph stateful (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), memori bersama episodik/semantik, sandbox eksekusi tool, dan guardrail human-in-the-loop (HITL).
309
+
310
+ **Sinergi Swarm:** Skill ini bertindak sebagai orkestrator utama jika dipadukan dengan `mcp-server-architect` (untuk integrasi tool eksternal) dan `ai-llm-integration-expert` (untuk konfigurasi foundation model). Bersama-sama, ketiganya membentuk **AI Engineering Swarm** yang tangguh dari awal hingga rilis produksi.
311
+
312
+ ### Kondisi Pemicu
313
+ - Membangun agen AI otonom yang mengeksekusi tugas kompleks multi-langkah lintas domain.
314
+ - Merancang sistem kolaborasi, deliberasi, dan validasi silang antar beberapa agen AI spesialis.
315
+ - Mengimplementasikan alur kerja graph stateful dengan LangGraph, OpenAI Agents SDK, atau Google ADK.
316
+ - Menerapkan 5 pola desain agentik standar: Prompt Chaining, Routing, Parallelization, Orchestrator-Workers, atau Evaluator-Optimizer.
317
+ - Mengintegrasikan pos henti human-in-the-loop (HITL) untuk tindakan berisiko tinggi (eksekusi kode, migrasi database, transaksi keuangan).
318
+ - Memilih dan mengevaluasi arsitektur agen di ekosistem Python, TypeScript, atau multi-platform.
319
+
320
+ ### 5 Pola Desain Agentik Inti (Standar Anthropic 2026)
321
+
322
+ Untuk sistem produksi yang handal, utamakan arsitektur **Workflows** terstruktur daripada loop otonom tanpa batas:
323
+
324
+ 1. **Prompt Chaining**: Memecah tugas menjadi langkah-langkah sekuensial dengan validasi output di setiap transisi.
325
+ 2. **Routing**: Mengklasifikasikan input pengguna dan mengarahkannya ke model atau sub-agen yang memiliki spesialisasi yang tepat.
326
+ 3. **Parallelization (Sectioning & Voting)**: Menjalankan beberapa sub-agen secara simultan untuk tugas independen atau menjalankan ensemble untuk konsensus voting.
327
+ 4. **Orchestrator-Workers**: Agen orkestrator pusat memecah masalah dinamis, mendelegasikannya ke pekerja dengan konteks terfokus, lalu merangkum hasil akhirnya.
328
+ 5. **Evaluator-Optimizer Loop**: Agen pembuat (*generator*) menghasilkan solusi sementara agen penilai (*evaluator*) memberikan audit dan umpan balik hingga standar kualitas terpenuhi.
329
+
330
+ ### Perbandingan Framework Agen (2026)
331
+
332
+ | Framework | Bahasa | Terbaik Untuk | Keunggulan Utama |
333
+ |---|---|---|---|
334
+ | **LangGraph (v0.3+)** | Python / TypeScript | Alur kerja graf stateful kompleks | Berbasis graf, checkpointer persisten, time-travel debugging |
335
+ | **OpenAI Agents SDK** | Python | Agen native GPT-4.5 / o4-series | Handoff antar agen bawaan, tracing, dan guardrail otomatis |
336
+ | **Google ADK** | Python | Swarm agen bertenaga Gemini | Integrasi Vertex AI native, streaming multi-agen, search grounding |
337
+ | **Mastra.ai** | TypeScript | Web apps & microservice TS-first | Memori bawaan, evaluasi otomatis, RAG, dan dukungan MCP native |
338
+ | **CrewAI** | Python | Tim simulasi peran | Cepat untuk membuat prototipe kolaborasi tim bisnis |
339
+
340
+ ### Panduan Implementasi Inti
341
+
342
+ #### 1. LangGraph — State Persisten & Checkpoint HITL
343
+ Memodelkan alur agen sebagai graf terarah dengan state bersama dan penyimpanan checkpoint:
344
+ - Simpan state di database (PostgreSQL / MemorySaver) agar alur kerja dapat dijeda dan dilanjutkan kapan saja.
345
+ - Terapkan `interrupt_before` sebelum node yang menjalankan perintah destruktif untuk meminta persetujuan manusia (*Human-in-the-loop*).
346
+
347
+ #### 2. OpenAI Agents SDK — Handoffs & Guardrails
348
+ Terapkan transisi kendali yang mulus antar agen dengan fungsi `handoff` bawaan serta pasang filter `guardrail` pada input dan output untuk mencegah eksekusi instruksi berbahaya.
349
+
350
+ #### 3. Google ADK — Multi-Agent Gemini
351
+ Bangun hierarki agen dengan model Gemini 3.x, di mana root agent mengoordinasikan sub-agents untuk riset, eksekusi kode, dan pembuatan dokumen.
352
+
353
+ #### 4. Mastra.ai — Solusi TypeScript Penuh
354
+ Gunakan Mastra untuk ekosistem Next.js dan Node.js: sediakan memori persisten ke Supabase/PostgreSQL, integrasikan tool MCP secara langsung, dan manfaatkan framework evaluasi bawaan.
355
+
356
+ #### 5. Guardrails Human-in-the-Loop (HITL)
357
+ Pengamanan wajib sebelum melakukan tindakan yang tidak dapat dibatalkan:
358
+ - **Pos Henti Interupsi**: Hentikan eksekusi sebelum menjalankan skrip shell berbahaya, migrasi skema tabel, atau memodifikasi data produksi.
359
+ - **Tinjauan Pratinjau**: Tampilkan ringkasan perbedaan (*diff*) kepada pengguna sebelum modifikasi dieksekusi.
360
+ - **Ambang Keyakinan**: Otomatis lanjutkan hanya jika skor keyakinan model >= 0.90; eskalasikan ke manusia jika berada di bawah ambang batas.
361
+
362
+ #### 6. Circuit Breakers & Protokol Pemulihan Swarm
363
+ - **Batas Percobaan Ulang**: Maksimal 2 kali perbaikan otomatis per sub-agen.
364
+ - **Eskalasi Fallback**: Jika agen spesialis mengalami kendala konteks atau gagal berulang kali, Swarm Director segera mengalihkan tugas ke `fullstack-expert` atau meminta masukan pengguna.
365
+ - **Persistensi Kemajuan**: Simpan selalu checkpoint di `PROGRESS.md` atau `BLUEPRINT.md` agar alur kerja dapat dilanjutkan secara efisien tanpa token berlebih.
366
+
367
+ #### 7. Swarm Simulasi Naratif (Paradigma Fable)
368
+ Arsitektur simulasi dunia cerita otonom multi-agen di mana agen bertindak sebagai karakter.
369
+ - **Pengkodean Kepribadian Karakter-Agen:** Menggunakan model kepribadian Big Five + vektor valensi emosional.
370
+ - **Protokol Dialog Antar-Agen:** Dibatasi oleh koherensi naratif.
371
+ - **Protokol Konsensus Status Dunia:** Memori bersama terdistribusi dengan penyelesaian konflik.
372
+ - **Pola Agen Sutradara (Director):** Meta-agen yang memastikan konsistensi alur cerita.
373
+
374
+ #### 8. Orkestrasi Computer-Using Agent (CUA)
375
+ - **Delegasi Agen CUA:** Sutradara mendelegasikan tugas UI ke agen pekerja CUA.
376
+ - **Observasi Berbagi Layar:** Orkestrator memantau aliran visual CUA.
377
+ - **Protokol Pemulihan:** Menangani kegagalan CUA (UI macet) melalui loop umpan balik visual.
378
+ - **Eksekusi CUA Paralel:** Berbagai agen mengoperasikan tab browser berbeda secara bersamaan.
379
+
380
+ #### 9. Swarm Persepsi Berkelanjutan
381
+ - **Pemantauan Selalu Aktif:** Loop persepsi 24/7 yang menangkap input multimodal (video/audio).
382
+ - **Agen Triase Langsung:** Pipeline (Intake → Klasifikasi → Rute).
383
+ - **Protokol Bangun Berbasis Peristiwa (Event-Driven):** Agen tidur hingga mendeteksi stimulus yang relevan.
384
+ - **Integrasi API Live Multimodal Gemini:** Hook bawaan untuk pemrosesan persepsi berkelanjutan.
385
+ #### 10. Swarm Paralel Masif (Agentic MoE) untuk LLM Next-Gen
386
+ Untuk model generasi berikutnya seperti **Gemini 4 Pro**:
387
+ - **Pemanggilan Tool Massal (Batching)**: Beralih dari orkestrator sekuensial (bertahap) ke pemanggilan fungsi massal secara serentak.
388
+ - **Aliran Konteks Monolitik**: Kirimkan seluruh konteks masif (snapshot codebase) secara langsung melalui KV-Cache, hindari RAG terfragmentasi per agen. Ini memungkinkan sub-agen menganalisis *state* memori yang sama secara instan.