vibes-plug 1.0.0 → 2.5.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.
- package/.github/workflows/publish.yml +20 -0
- package/AGENTS.md +66 -0
- package/BLUEPRINT.md +152 -60
- package/CHANGELOG.md +50 -0
- package/README.md +346 -194
- package/package.json +25 -25
- package/plugin.json +1 -1
- package/skills/ai-cost-token-optimizer/SKILL.md +52 -0
- package/skills/ai-llm-integration-expert/SKILL.md +180 -162
- package/skills/api-design-expert/SKILL.md +314 -310
- package/skills/app-analyzer-optimizer/SKILL.md +193 -189
- package/skills/apple-ecosystem-expert/SKILL.md +142 -0
- package/skills/async-queue-temporal-expert/SKILL.md +54 -0
- package/skills/authentication-identity-expert/SKILL.md +251 -20
- package/skills/auto-doc-updater/SKILL.md +214 -204
- package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
- package/skills/autonomous-red-teamer/SKILL.md +59 -0
- package/skills/autonomous-swarm-director/SKILL.md +69 -0
- package/skills/autonomous-tdd-debugger/SKILL.md +65 -0
- package/skills/bootstrap-to-modern/SKILL.md +90 -86
- package/skills/brainstorming/SKILL.md +373 -353
- package/skills/browser-automation-expert/SKILL.md +46 -0
- package/skills/ci-cd-devops-architect/SKILL.md +72 -45
- package/skills/cloud-hosting-expert/SKILL.md +244 -244
- package/skills/coderabbit/SKILL.md +192 -192
- package/skills/cron-scheduler-expert/SKILL.md +298 -0
- package/skills/data-telemetry-expert/SKILL.md +213 -213
- package/skills/database-orm-expert/SKILL.md +294 -294
- package/skills/dependency-upgrade-migrator/SKILL.md +295 -0
- package/skills/design-system-architect/SKILL.md +27 -10
- package/skills/doku-mcp-server/SKILL.md +251 -0
- package/skills/doku-payment-gateway/SKILL.md +227 -0
- package/skills/e2e-testing-expert/SKILL.md +315 -315
- package/skills/edge-serverless-db-expert/SKILL.md +43 -0
- package/skills/email-notification-expert/SKILL.md +362 -0
- package/skills/error-resilience-expert/SKILL.md +480 -0
- package/skills/event-driven-architect/SKILL.md +81 -81
- package/skills/feature-flag-analytics-expert/SKILL.md +46 -0
- package/skills/file-upload-media-expert/SKILL.md +431 -0
- package/skills/form-validation-expert/SKILL.md +401 -0
- package/skills/fullstack-expert/SKILL.md +202 -202
- package/skills/fullstack-expert/references/api_design_guide.md +466 -466
- package/skills/fullstack-expert/references/multi_language_backend.md +528 -528
- package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -253
- package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -326
- package/skills/gemini-agent-booster/SKILL.md +135 -135
- package/skills/global-a11y-i18n-expert/SKILL.md +81 -81
- package/skills/glsl-shader-expert/SKILL.md +101 -0
- package/skills/go-programming-expert/SKILL.md +295 -295
- package/skills/graphql-apollo-expert/SKILL.md +108 -0
- package/skills/hig/SKILL.md +188 -188
- package/skills/hyper-context-synthesizer/SKILL.md +55 -0
- package/skills/js-backend-expert/SKILL.md +34 -9
- package/skills/legacy-code-translator/SKILL.md +65 -0
- package/skills/llm-cost-arbitrage-router/SKILL.md +59 -0
- package/skills/logging-error-tracking-expert/SKILL.md +338 -0
- package/skills/mcp-client-orchestrator/SKILL.md +70 -0
- package/skills/mcp-server-architect/SKILL.md +194 -194
- package/skills/micro-frontend-architect/SKILL.md +106 -0
- package/skills/mobile-expo-expert/SKILL.md +186 -186
- package/skills/mobile-push-notification-expert/SKILL.md +51 -0
- package/skills/monday-design-aesthetic/SKILL.md +67 -67
- package/skills/monorepo-architect/SKILL.md +227 -227
- package/skills/mpa-orchestrator/SKILL.md +101 -101
- package/skills/multi-agent-orchestration/SKILL.md +234 -234
- package/skills/multiple-entry-points/SKILL.md +55 -55
- package/skills/mvc-expert/SKILL.md +231 -231
- package/skills/payment-gateway-expert/SKILL.md +45 -45
- package/skills/performance-web-vitals/SKILL.md +332 -332
- package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
- package/skills/prd-architect/SKILL.md +201 -191
- package/skills/proactive-background-watcher/SKILL.md +62 -0
- package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
- package/skills/production-ready-hardener/SKILL.md +173 -186
- package/skills/production-ready-hardener/references/production_checklist.md +161 -161
- package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +881 -875
- package/skills/project-context-mapper/SKILL.md +79 -0
- package/skills/python-programming-expert/SKILL.md +263 -132
- package/skills/rate-limit-abuse-prevention/SKILL.md +371 -0
- package/skills/realtime-collaboration-expert/SKILL.md +45 -45
- package/skills/rust-programming-expert/SKILL.md +235 -235
- package/skills/saas-billing/SKILL.md +377 -377
- package/skills/saas-multi-tenant/SKILL.md +251 -237
- package/skills/saas-mvp-launcher/SKILL.md +10 -0
- package/skills/saas-transformer/SKILL.md +187 -144
- package/skills/saas-transformer/references/billing_integration_guide.md +401 -401
- package/skills/saas-transformer/references/feature_gating_patterns.md +137 -137
- package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -121
- package/skills/saas-transformer/scripts/saas_transformation_scanner.py +39 -29
- package/skills/scalability-clean-code/SKILL.md +229 -229
- package/skills/self-evolving-memory-graph/SKILL.md +75 -0
- package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
- package/skills/senior-frontend/SKILL.md +161 -161
- package/skills/senior-fullstack/SKILL.md +167 -167
- package/skills/seo/SKILL.md +235 -225
- package/skills/seo-geo/SKILL.md +188 -188
- package/skills/session-context-loader/SKILL.md +77 -0
- package/skills/session-handoff-resume/SKILL.md +158 -158
- package/skills/skill_baru/SKILL.md +172 -147
- package/skills/spa-orchestrator/SKILL.md +288 -288
- package/skills/state-management-expert/SKILL.md +272 -272
- package/skills/supabase-security-expert/SKILL.md +243 -243
- package/skills/tailwind-expert/SKILL.md +188 -188
- package/skills/tanstack-query-expert/SKILL.md +199 -199
- package/skills/token-saver/SKILL.md +119 -111
- package/skills/typescript-expert/SKILL.md +324 -279
- package/skills/ui-components-expert/SKILL.md +263 -46
- package/skills/ui-ux-pro-max/SKILL.md +202 -201
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
- package/skills/ui_ux_expert/SKILL.md +17 -6
- package/skills/vector-db-rag-expert/SKILL.md +52 -0
- package/skills/vibe-code-gardener/SKILL.md +181 -173
- package/skills/visual-qa-vision-agent/SKILL.md +65 -0
- package/skills/vue-frontend-expert/SKILL.md +126 -0
- package/skills/web-3d-graphics-expert/SKILL.md +131 -0
- package/skills/web-game-engine-expert/SKILL.md +96 -0
- package/skills/web-scraper/SKILL.md +207 -205
- package/skills/website-design-cloner/SKILL.md +174 -0
- package/skills/webxr-ar-vr-expert/SKILL.md +117 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +206 -180
- package/skills/zero-trust-secret-vault/SKILL.md +40 -0
- package/vibes-swarm-demo.gif +0 -0
|
@@ -1,234 +1,234 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: multi-agent-orchestration
|
|
3
|
-
description: "Expert guide for designing and orchestrating multi-agent systems, agent swarms, graph-based workflows (LangGraph, CrewAI, AutoGen), shared state memory, and human-in-the-loop guardrails in English and Indonesian."
|
|
4
|
-
author: "Roedy Rustam"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Multi-Agent Orchestration Expert (2026 Edition)
|
|
8
|
-
|
|
9
|
-
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<a name="english"></a>
|
|
14
|
-
## English
|
|
15
|
-
|
|
16
|
-
### Description
|
|
17
|
-
Expert guide for designing, building, and deploying production-grade multi-agent AI systems. Covers agent orchestration frameworks (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai, CrewAI, AutoGen), shared state and memory management, tool execution, human-in-the-loop (HITL) guardrails, and observability for agentic workflows.
|
|
18
|
-
|
|
19
|
-
**Swarm Synergy:** This skill acts as a powerful 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**.
|
|
20
|
-
|
|
21
|
-
### Trigger Conditions
|
|
22
|
-
- Building autonomous AI agents that execute multi-step tasks.
|
|
23
|
-
- Designing systems where multiple specialized AI agents collaborate.
|
|
24
|
-
- Implementing graph-based agent workflows with LangGraph or similar frameworks.
|
|
25
|
-
- Integrating human-in-the-loop checkpoints for high-stakes decisions.
|
|
26
|
-
- Building AI pipelines with tool-calling, RAG retrieval, code execution, or browser control.
|
|
27
|
-
- Evaluating and selecting agent frameworks (LangGraph vs OpenAI Agents SDK vs Google ADK).
|
|
28
|
-
|
|
29
|
-
### Agent Framework Comparison (2026)
|
|
30
|
-
|
|
31
|
-
| Framework | Language | Best For | Key Differentiator |
|
|
32
|
-
|---|---|---|---|
|
|
33
|
-
| **LangGraph** | Python / TypeScript | Complex stateful workflows | Graph-based, any LLM, full control |
|
|
34
|
-
| **OpenAI Agents SDK** | Python | GPT-5 native agents | Built-in handoffs, tracing, guardrails |
|
|
35
|
-
| **Google ADK** | Python | Gemini-powered agents | Multi-agent, Vertex AI, streaming |
|
|
36
|
-
| **Mastra.ai** | TypeScript | TS-first agent apps | Built-in memory, evals, RAG, MCP |
|
|
37
|
-
| **CrewAI** | Python | Team-of-agents tasks | Role-based agents, easy to start |
|
|
38
|
-
| **AutoGen** | Python | Research & LLM evaluation | Conversation-driven agents |
|
|
39
|
-
|
|
40
|
-
### Core Architecture Principles
|
|
41
|
-
|
|
42
|
-
#### 1. Agent Roles & Specialization
|
|
43
|
-
Design agents with single responsibilities — avoid "do-everything" agents:
|
|
44
|
-
- **Orchestrator Agent**: Routes tasks, decomposes goals, delegates to specialists.
|
|
45
|
-
- **Specialist Agents**: Domain-specific (research agent, code agent, data analyst, writer).
|
|
46
|
-
- **Tool Agents**: Wrap external capabilities (browser agent, SQL agent, file agent).
|
|
47
|
-
- **Critic/Validator Agent**: Reviews output of other agents before finalizing.
|
|
48
|
-
|
|
49
|
-
#### 2. LangGraph — Stateful Graph Workflows
|
|
50
|
-
LangGraph models agent workflows as directed graphs with persistent state — ideal for complex, multi-step tasks with branching logic and HITL:
|
|
51
|
-
```python
|
|
52
|
-
from langgraph.graph import StateGraph, END
|
|
53
|
-
from langgraph.checkpoint.memory import MemorySaver
|
|
54
|
-
from typing import TypedDict, Annotated
|
|
55
|
-
import operator
|
|
56
|
-
|
|
57
|
-
class AgentState(TypedDict):
|
|
58
|
-
messages: Annotated[list, operator.add]
|
|
59
|
-
task: str
|
|
60
|
-
result: str
|
|
61
|
-
|
|
62
|
-
def research_node(state: AgentState):
|
|
63
|
-
# Call research agent
|
|
64
|
-
return {"messages": [research_agent.invoke(state["task"])]}
|
|
65
|
-
|
|
66
|
-
def write_node(state: AgentState):
|
|
67
|
-
# Call writing agent with research result
|
|
68
|
-
return {"result": writing_agent.invoke(state["messages"])}
|
|
69
|
-
|
|
70
|
-
def should_revise(state: AgentState) -> str:
|
|
71
|
-
# Conditional routing
|
|
72
|
-
return "revise" if needs_revision(state["result"]) else "end"
|
|
73
|
-
|
|
74
|
-
builder = StateGraph(AgentState)
|
|
75
|
-
builder.add_node("research", research_node)
|
|
76
|
-
builder.add_node("write", write_node)
|
|
77
|
-
builder.add_conditional_edges("write", should_revise, {"revise": "research", "end": END})
|
|
78
|
-
|
|
79
|
-
# Persist state for HITL
|
|
80
|
-
memory = MemorySaver()
|
|
81
|
-
graph = builder.compile(checkpointer=memory, interrupt_before=["write"])
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
#### 3. OpenAI Agents SDK — Handoffs & Guardrails
|
|
85
|
-
Use the OpenAI Agents SDK for native GPT-5 agent workflows with built-in tracing:
|
|
86
|
-
```python
|
|
87
|
-
from agents import Agent, Runner, handoff, input_guardrail, GuardrailFunctionOutput
|
|
88
|
-
|
|
89
|
-
# Define specialist agents
|
|
90
|
-
researcher = Agent(
|
|
91
|
-
name="Researcher",
|
|
92
|
-
instructions="Search and retrieve relevant information.",
|
|
93
|
-
tools=[web_search, document_retrieval],
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
writer = Agent(
|
|
97
|
-
name="Writer",
|
|
98
|
-
instructions="Write high-quality content based on research.",
|
|
99
|
-
handoffs=[handoff(researcher, tool_name_override="get_research")],
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
# Input guardrail to prevent harmful requests
|
|
103
|
-
@input_guardrail
|
|
104
|
-
async def content_filter(ctx, agent, input) -> GuardrailFunctionOutput:
|
|
105
|
-
if contains_harmful_content(input):
|
|
106
|
-
return GuardrailFunctionOutput(output_info="Blocked", tripwire_triggered=True)
|
|
107
|
-
return GuardrailFunctionOutput(output_info="OK", tripwire_triggered=False)
|
|
108
|
-
|
|
109
|
-
# Run with tracing
|
|
110
|
-
result = await Runner.run(writer, "Write an article about...", guardrails=[content_filter])
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
#### 4. Google ADK — Gemini Multi-Agent
|
|
114
|
-
Google Agent Development Kit (ADK) for building Gemini-powered agents with Vertex AI integration:
|
|
115
|
-
```python
|
|
116
|
-
from google.adk.agents import Agent
|
|
117
|
-
from google.adk.tools import google_search, code_execution
|
|
118
|
-
|
|
119
|
-
root_agent = Agent(
|
|
120
|
-
model="gemini-2.5-pro",
|
|
121
|
-
name="orchestrator",
|
|
122
|
-
instruction="Coordinate research and analysis tasks.",
|
|
123
|
-
sub_agents=[research_agent, analysis_agent],
|
|
124
|
-
tools=[google_search, code_execution],
|
|
125
|
-
)
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
#### 5. Mastra.ai — TypeScript-First Agents
|
|
129
|
-
For TypeScript teams, Mastra provides the most complete agentic framework:
|
|
130
|
-
```typescript
|
|
131
|
-
import { Agent, MastraMemory } from '@mastra/core';
|
|
132
|
-
import { createTool } from '@mastra/core/tools';
|
|
133
|
-
|
|
134
|
-
const webSearchTool = createTool({
|
|
135
|
-
id: 'web-search',
|
|
136
|
-
description: 'Search the web for current information',
|
|
137
|
-
inputSchema: z.object({ query: z.string() }),
|
|
138
|
-
execute: async ({ context: { query } }) => searchWeb(query),
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
const researchAgent = new Agent({
|
|
142
|
-
name: 'researcher',
|
|
143
|
-
instructions: 'Find and summarize information accurately.',
|
|
144
|
-
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
|
|
145
|
-
tools: { webSearch: webSearchTool },
|
|
146
|
-
memory: new MastraMemory({ storage: supabaseStorage }),
|
|
147
|
-
});
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
#### 6. Human-in-the-Loop (HITL) Guardrails
|
|
151
|
-
Mandatory for high-stakes agent actions (financial transactions, email sending, code deployment):
|
|
152
|
-
- **Interrupt Checkpoints**: Pause graph execution before irreversible actions.
|
|
153
|
-
- **Approval Flows**: Send pending action to a UI for human review before continuing.
|
|
154
|
-
- **Confidence Thresholds**: Auto-approve if confidence > 90%, escalate if < 70%.
|
|
155
|
-
|
|
156
|
-
#### 7. Agent Memory Architecture
|
|
157
|
-
- **Working Memory (In-context)**: Recent messages and task state in the prompt window.
|
|
158
|
-
- **Episodic Memory**: Summarized past sessions stored as embeddings (Mem0, MemGPT).
|
|
159
|
-
- **Semantic Memory**: Domain knowledge in a vector store (pgvector, Qdrant).
|
|
160
|
-
- **Procedural Memory**: Learned tool-use patterns stored as structured data.
|
|
161
|
-
|
|
162
|
-
#### 8. Observability & Evaluation
|
|
163
|
-
- **LangSmith**: Native tracing for LangGraph, LangChain agents.
|
|
164
|
-
- **OpenAI Tracing**: Built-in in OpenAI Agents SDK — view agent runs, handoffs, tool calls.
|
|
165
|
-
- **Mastra Evals**: Built-in evaluation framework for Mastra agents.
|
|
166
|
-
- **Custom Metrics**: Track task completion rate, tool call accuracy, latency, and cost per run.
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
<a name="bahasa-indonesia"></a>
|
|
171
|
-
## Bahasa Indonesia
|
|
172
|
-
|
|
173
|
-
### Deskripsi
|
|
174
|
-
Panduan ahli untuk merancang, membangun, dan men-deploy sistem multi-agen AI tingkat produksi. Mencakup framework orkestrasi agen (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), manajemen state dan memori bersama, eksekusi tool, guardrail human-in-the-loop (HITL), dan observabilitas untuk alur kerja agentik.
|
|
175
|
-
|
|
176
|
-
**Sinergi Swarm:** Skill ini bertindak sebagai orkestrator yang sangat *powerful* jika dikombinasikan dengan `mcp-server-architect` (untuk integrasi eksternal tool) dan `ai-llm-integration-expert` (untuk penyiapan foundation model). Bersama-sama, ketiganya membentuk **AI Engineering Swarm** yang komprehensif dari ujung ke ujung.
|
|
177
|
-
|
|
178
|
-
### Kondisi Pemicu
|
|
179
|
-
- Membangun agen AI otonom yang mengeksekusi tugas multi-langkah.
|
|
180
|
-
- Merancang sistem di mana beberapa agen AI khusus berkolaborasi.
|
|
181
|
-
- Mengimplementasikan alur kerja agen berbasis graph dengan LangGraph atau framework serupa.
|
|
182
|
-
- Mengintegrasikan checkpoint human-in-the-loop untuk keputusan berisiko tinggi.
|
|
183
|
-
- Membangun pipeline AI dengan tool-calling, RAG, eksekusi kode, atau kontrol browser.
|
|
184
|
-
- Mengevaluasi dan memilih framework agen yang tepat.
|
|
185
|
-
|
|
186
|
-
### Perbandingan Framework Agen (2026)
|
|
187
|
-
|
|
188
|
-
| Framework | Bahasa | Terbaik Untuk | Diferensiasi Kunci |
|
|
189
|
-
|---|---|---|---|
|
|
190
|
-
| **LangGraph** | Python / TS | Alur kerja stateful kompleks | Berbasis graph, LLM apa saja, kontrol penuh |
|
|
191
|
-
| **OpenAI Agents SDK** | Python | Agen GPT-5 native | Handoffs, tracing, guardrails bawaan |
|
|
192
|
-
| **Google ADK** | Python | Agen berbasis Gemini | Multi-agen, Vertex AI, streaming |
|
|
193
|
-
| **Mastra.ai** | TypeScript | Aplikasi agen TS-first | Memori, evaluasi, RAG, MCP bawaan |
|
|
194
|
-
| **CrewAI** | Python | Tugas tim-agen | Agen berbasis peran, mudah dimulai |
|
|
195
|
-
| **AutoGen** | Python | Riset & evaluasi LLM | Agen berbasis percakapan |
|
|
196
|
-
|
|
197
|
-
### Prinsip Arsitektur Inti
|
|
198
|
-
|
|
199
|
-
#### 1. Peran & Spesialisasi Agen
|
|
200
|
-
Rancang agen dengan tanggung jawab tunggal:
|
|
201
|
-
- **Orchestrator Agent**: Mendelegasikan tugas ke agen spesialis.
|
|
202
|
-
- **Specialist Agents**: Domain-spesifik (agen riset, kode, analis data, penulis).
|
|
203
|
-
- **Tool Agents**: Membungkus kemampuan eksternal (browser, SQL, file).
|
|
204
|
-
- **Critic/Validator Agent**: Meninjau output agen lain sebelum difinalisasi.
|
|
205
|
-
|
|
206
|
-
#### 2. LangGraph — Alur Kerja Graf Stateful
|
|
207
|
-
LangGraph memodelkan alur kerja agen sebagai graf terarah dengan state persisten — ideal untuk tugas kompleks dengan logika percabangan dan HITL. State disimpan di checkpointer (MemorySaver atau PostgreSQL) untuk resume antar sesi.
|
|
208
|
-
|
|
209
|
-
#### 3. OpenAI Agents SDK — Handoffs & Guardrails
|
|
210
|
-
SDK native untuk agen GPT-5 dengan handoffs agen-ke-agen, tracing bawaan, dan guardrails untuk mencegah output berbahaya.
|
|
211
|
-
|
|
212
|
-
#### 4. Google ADK — Agen Gemini Multi-Agent
|
|
213
|
-
ADK untuk membangun agen Gemini dengan integrasi Vertex AI, sub-agents, dan tool seperti Google Search dan eksekusi kode.
|
|
214
|
-
|
|
215
|
-
#### 5. Mastra.ai — Agen TypeScript-First
|
|
216
|
-
Framework paling lengkap untuk tim TypeScript: memori bawaan, evaluasi, RAG, dan dukungan MCP native.
|
|
217
|
-
|
|
218
|
-
#### 6. Human-in-the-Loop (HITL) Guardrails
|
|
219
|
-
Wajib untuk aksi agen berisiko tinggi (transaksi keuangan, pengiriman email, deployment kode):
|
|
220
|
-
- **Interrupt Checkpoints**: Jeda eksekusi graf sebelum aksi tidak dapat dibalik.
|
|
221
|
-
- **Approval Flows**: Kirim aksi yang menunggu ke UI untuk ditinjau manusia.
|
|
222
|
-
- **Confidence Thresholds**: Auto-approve jika keyakinan > 90%, eskalasi jika < 70%.
|
|
223
|
-
|
|
224
|
-
#### 7. Arsitektur Memori Agen
|
|
225
|
-
- **Working Memory**: Riwayat percakapan recent dalam context window.
|
|
226
|
-
- **Episodic Memory**: Sesi masa lalu yang diringkas sebagai embedding (Mem0).
|
|
227
|
-
- **Semantic Memory**: Pengetahuan domain dalam vector store (pgvector, Qdrant).
|
|
228
|
-
- **Procedural Memory**: Pola penggunaan tool yang dipelajari sebagai data terstruktur.
|
|
229
|
-
|
|
230
|
-
#### 8. Observabilitas & Evaluasi
|
|
231
|
-
- **LangSmith**: Tracing native untuk LangGraph.
|
|
232
|
-
- **OpenAI Tracing**: Bawaan di OpenAI Agents SDK — lihat run, handoff, tool call.
|
|
233
|
-
- **Mastra Evals**: Framework evaluasi bawaan untuk agen Mastra.
|
|
234
|
-
- **Metrik Kustom**: Lacak tingkat penyelesaian tugas, akurasi tool call, latensi, dan biaya per run.
|
|
1
|
+
---
|
|
2
|
+
name: multi-agent-orchestration
|
|
3
|
+
description: "Expert guide for designing and orchestrating multi-agent systems, agent swarms, graph-based workflows (LangGraph, CrewAI, AutoGen), shared state memory, and human-in-the-loop guardrails in English and Indonesian."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Multi-Agent Orchestration Expert (2026 Edition)
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Expert guide for designing, building, and deploying production-grade multi-agent AI systems. Covers agent orchestration frameworks (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai, CrewAI, AutoGen), shared state and memory management, tool execution, human-in-the-loop (HITL) guardrails, and observability for agentic workflows.
|
|
18
|
+
|
|
19
|
+
**Swarm Synergy:** This skill acts as a powerful 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**.
|
|
20
|
+
|
|
21
|
+
### Trigger Conditions
|
|
22
|
+
- Building autonomous AI agents that execute multi-step tasks.
|
|
23
|
+
- Designing systems where multiple specialized AI agents collaborate.
|
|
24
|
+
- Implementing graph-based agent workflows with LangGraph or similar frameworks.
|
|
25
|
+
- Integrating human-in-the-loop checkpoints for high-stakes decisions.
|
|
26
|
+
- Building AI pipelines with tool-calling, RAG retrieval, code execution, or browser control.
|
|
27
|
+
- Evaluating and selecting agent frameworks (LangGraph vs OpenAI Agents SDK vs Google ADK).
|
|
28
|
+
|
|
29
|
+
### Agent Framework Comparison (2026)
|
|
30
|
+
|
|
31
|
+
| Framework | Language | Best For | Key Differentiator |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| **LangGraph** | Python / TypeScript | Complex stateful workflows | Graph-based, any LLM, full control |
|
|
34
|
+
| **OpenAI Agents SDK** | Python | GPT-5 native agents | Built-in handoffs, tracing, guardrails |
|
|
35
|
+
| **Google ADK** | Python | Gemini-powered agents | Multi-agent, Vertex AI, streaming |
|
|
36
|
+
| **Mastra.ai** | TypeScript | TS-first agent apps | Built-in memory, evals, RAG, MCP |
|
|
37
|
+
| **CrewAI** | Python | Team-of-agents tasks | Role-based agents, easy to start |
|
|
38
|
+
| **AutoGen** | Python | Research & LLM evaluation | Conversation-driven agents |
|
|
39
|
+
|
|
40
|
+
### Core Architecture Principles
|
|
41
|
+
|
|
42
|
+
#### 1. Agent Roles & Specialization
|
|
43
|
+
Design agents with single responsibilities — avoid "do-everything" agents:
|
|
44
|
+
- **Orchestrator Agent**: Routes tasks, decomposes goals, delegates to specialists.
|
|
45
|
+
- **Specialist Agents**: Domain-specific (research agent, code agent, data analyst, writer).
|
|
46
|
+
- **Tool Agents**: Wrap external capabilities (browser agent, SQL agent, file agent).
|
|
47
|
+
- **Critic/Validator Agent**: Reviews output of other agents before finalizing.
|
|
48
|
+
|
|
49
|
+
#### 2. LangGraph — Stateful Graph Workflows
|
|
50
|
+
LangGraph models agent workflows as directed graphs with persistent state — ideal for complex, multi-step tasks with branching logic and HITL:
|
|
51
|
+
```python
|
|
52
|
+
from langgraph.graph import StateGraph, END
|
|
53
|
+
from langgraph.checkpoint.memory import MemorySaver
|
|
54
|
+
from typing import TypedDict, Annotated
|
|
55
|
+
import operator
|
|
56
|
+
|
|
57
|
+
class AgentState(TypedDict):
|
|
58
|
+
messages: Annotated[list, operator.add]
|
|
59
|
+
task: str
|
|
60
|
+
result: str
|
|
61
|
+
|
|
62
|
+
def research_node(state: AgentState):
|
|
63
|
+
# Call research agent
|
|
64
|
+
return {"messages": [research_agent.invoke(state["task"])]}
|
|
65
|
+
|
|
66
|
+
def write_node(state: AgentState):
|
|
67
|
+
# Call writing agent with research result
|
|
68
|
+
return {"result": writing_agent.invoke(state["messages"])}
|
|
69
|
+
|
|
70
|
+
def should_revise(state: AgentState) -> str:
|
|
71
|
+
# Conditional routing
|
|
72
|
+
return "revise" if needs_revision(state["result"]) else "end"
|
|
73
|
+
|
|
74
|
+
builder = StateGraph(AgentState)
|
|
75
|
+
builder.add_node("research", research_node)
|
|
76
|
+
builder.add_node("write", write_node)
|
|
77
|
+
builder.add_conditional_edges("write", should_revise, {"revise": "research", "end": END})
|
|
78
|
+
|
|
79
|
+
# Persist state for HITL
|
|
80
|
+
memory = MemorySaver()
|
|
81
|
+
graph = builder.compile(checkpointer=memory, interrupt_before=["write"])
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### 3. OpenAI Agents SDK — Handoffs & Guardrails
|
|
85
|
+
Use the OpenAI Agents SDK for native GPT-5 agent workflows with built-in tracing:
|
|
86
|
+
```python
|
|
87
|
+
from agents import Agent, Runner, handoff, input_guardrail, GuardrailFunctionOutput
|
|
88
|
+
|
|
89
|
+
# Define specialist agents
|
|
90
|
+
researcher = Agent(
|
|
91
|
+
name="Researcher",
|
|
92
|
+
instructions="Search and retrieve relevant information.",
|
|
93
|
+
tools=[web_search, document_retrieval],
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
writer = Agent(
|
|
97
|
+
name="Writer",
|
|
98
|
+
instructions="Write high-quality content based on research.",
|
|
99
|
+
handoffs=[handoff(researcher, tool_name_override="get_research")],
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
# Input guardrail to prevent harmful requests
|
|
103
|
+
@input_guardrail
|
|
104
|
+
async def content_filter(ctx, agent, input) -> GuardrailFunctionOutput:
|
|
105
|
+
if contains_harmful_content(input):
|
|
106
|
+
return GuardrailFunctionOutput(output_info="Blocked", tripwire_triggered=True)
|
|
107
|
+
return GuardrailFunctionOutput(output_info="OK", tripwire_triggered=False)
|
|
108
|
+
|
|
109
|
+
# Run with tracing
|
|
110
|
+
result = await Runner.run(writer, "Write an article about...", guardrails=[content_filter])
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### 4. Google ADK — Gemini Multi-Agent
|
|
114
|
+
Google Agent Development Kit (ADK) for building Gemini-powered agents with Vertex AI integration:
|
|
115
|
+
```python
|
|
116
|
+
from google.adk.agents import Agent
|
|
117
|
+
from google.adk.tools import google_search, code_execution
|
|
118
|
+
|
|
119
|
+
root_agent = Agent(
|
|
120
|
+
model="gemini-2.5-pro",
|
|
121
|
+
name="orchestrator",
|
|
122
|
+
instruction="Coordinate research and analysis tasks.",
|
|
123
|
+
sub_agents=[research_agent, analysis_agent],
|
|
124
|
+
tools=[google_search, code_execution],
|
|
125
|
+
)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### 5. Mastra.ai — TypeScript-First Agents
|
|
129
|
+
For TypeScript teams, Mastra provides the most complete agentic framework:
|
|
130
|
+
```typescript
|
|
131
|
+
import { Agent, MastraMemory } from '@mastra/core';
|
|
132
|
+
import { createTool } from '@mastra/core/tools';
|
|
133
|
+
|
|
134
|
+
const webSearchTool = createTool({
|
|
135
|
+
id: 'web-search',
|
|
136
|
+
description: 'Search the web for current information',
|
|
137
|
+
inputSchema: z.object({ query: z.string() }),
|
|
138
|
+
execute: async ({ context: { query } }) => searchWeb(query),
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const researchAgent = new Agent({
|
|
142
|
+
name: 'researcher',
|
|
143
|
+
instructions: 'Find and summarize information accurately.',
|
|
144
|
+
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
|
|
145
|
+
tools: { webSearch: webSearchTool },
|
|
146
|
+
memory: new MastraMemory({ storage: supabaseStorage }),
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### 6. Human-in-the-Loop (HITL) Guardrails
|
|
151
|
+
Mandatory for high-stakes agent actions (financial transactions, email sending, code deployment):
|
|
152
|
+
- **Interrupt Checkpoints**: Pause graph execution before irreversible actions.
|
|
153
|
+
- **Approval Flows**: Send pending action to a UI for human review before continuing.
|
|
154
|
+
- **Confidence Thresholds**: Auto-approve if confidence > 90%, escalate if < 70%.
|
|
155
|
+
|
|
156
|
+
#### 7. Agent Memory Architecture
|
|
157
|
+
- **Working Memory (In-context)**: Recent messages and task state in the prompt window.
|
|
158
|
+
- **Episodic Memory**: Summarized past sessions stored as embeddings (Mem0, MemGPT).
|
|
159
|
+
- **Semantic Memory**: Domain knowledge in a vector store (pgvector, Qdrant).
|
|
160
|
+
- **Procedural Memory**: Learned tool-use patterns stored as structured data.
|
|
161
|
+
|
|
162
|
+
#### 8. Observability & Evaluation
|
|
163
|
+
- **LangSmith**: Native tracing for LangGraph, LangChain agents.
|
|
164
|
+
- **OpenAI Tracing**: Built-in in OpenAI Agents SDK — view agent runs, handoffs, tool calls.
|
|
165
|
+
- **Mastra Evals**: Built-in evaluation framework for Mastra agents.
|
|
166
|
+
- **Custom Metrics**: Track task completion rate, tool call accuracy, latency, and cost per run.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
<a name="bahasa-indonesia"></a>
|
|
171
|
+
## Bahasa Indonesia
|
|
172
|
+
|
|
173
|
+
### Deskripsi
|
|
174
|
+
Panduan ahli untuk merancang, membangun, dan men-deploy sistem multi-agen AI tingkat produksi. Mencakup framework orkestrasi agen (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai), manajemen state dan memori bersama, eksekusi tool, guardrail human-in-the-loop (HITL), dan observabilitas untuk alur kerja agentik.
|
|
175
|
+
|
|
176
|
+
**Sinergi Swarm:** Skill ini bertindak sebagai orkestrator yang sangat *powerful* jika dikombinasikan dengan `mcp-server-architect` (untuk integrasi eksternal tool) dan `ai-llm-integration-expert` (untuk penyiapan foundation model). Bersama-sama, ketiganya membentuk **AI Engineering Swarm** yang komprehensif dari ujung ke ujung.
|
|
177
|
+
|
|
178
|
+
### Kondisi Pemicu
|
|
179
|
+
- Membangun agen AI otonom yang mengeksekusi tugas multi-langkah.
|
|
180
|
+
- Merancang sistem di mana beberapa agen AI khusus berkolaborasi.
|
|
181
|
+
- Mengimplementasikan alur kerja agen berbasis graph dengan LangGraph atau framework serupa.
|
|
182
|
+
- Mengintegrasikan checkpoint human-in-the-loop untuk keputusan berisiko tinggi.
|
|
183
|
+
- Membangun pipeline AI dengan tool-calling, RAG, eksekusi kode, atau kontrol browser.
|
|
184
|
+
- Mengevaluasi dan memilih framework agen yang tepat.
|
|
185
|
+
|
|
186
|
+
### Perbandingan Framework Agen (2026)
|
|
187
|
+
|
|
188
|
+
| Framework | Bahasa | Terbaik Untuk | Diferensiasi Kunci |
|
|
189
|
+
|---|---|---|---|
|
|
190
|
+
| **LangGraph** | Python / TS | Alur kerja stateful kompleks | Berbasis graph, LLM apa saja, kontrol penuh |
|
|
191
|
+
| **OpenAI Agents SDK** | Python | Agen GPT-5 native | Handoffs, tracing, guardrails bawaan |
|
|
192
|
+
| **Google ADK** | Python | Agen berbasis Gemini | Multi-agen, Vertex AI, streaming |
|
|
193
|
+
| **Mastra.ai** | TypeScript | Aplikasi agen TS-first | Memori, evaluasi, RAG, MCP bawaan |
|
|
194
|
+
| **CrewAI** | Python | Tugas tim-agen | Agen berbasis peran, mudah dimulai |
|
|
195
|
+
| **AutoGen** | Python | Riset & evaluasi LLM | Agen berbasis percakapan |
|
|
196
|
+
|
|
197
|
+
### Prinsip Arsitektur Inti
|
|
198
|
+
|
|
199
|
+
#### 1. Peran & Spesialisasi Agen
|
|
200
|
+
Rancang agen dengan tanggung jawab tunggal:
|
|
201
|
+
- **Orchestrator Agent**: Mendelegasikan tugas ke agen spesialis.
|
|
202
|
+
- **Specialist Agents**: Domain-spesifik (agen riset, kode, analis data, penulis).
|
|
203
|
+
- **Tool Agents**: Membungkus kemampuan eksternal (browser, SQL, file).
|
|
204
|
+
- **Critic/Validator Agent**: Meninjau output agen lain sebelum difinalisasi.
|
|
205
|
+
|
|
206
|
+
#### 2. LangGraph — Alur Kerja Graf Stateful
|
|
207
|
+
LangGraph memodelkan alur kerja agen sebagai graf terarah dengan state persisten — ideal untuk tugas kompleks dengan logika percabangan dan HITL. State disimpan di checkpointer (MemorySaver atau PostgreSQL) untuk resume antar sesi.
|
|
208
|
+
|
|
209
|
+
#### 3. OpenAI Agents SDK — Handoffs & Guardrails
|
|
210
|
+
SDK native untuk agen GPT-5 dengan handoffs agen-ke-agen, tracing bawaan, dan guardrails untuk mencegah output berbahaya.
|
|
211
|
+
|
|
212
|
+
#### 4. Google ADK — Agen Gemini Multi-Agent
|
|
213
|
+
ADK untuk membangun agen Gemini dengan integrasi Vertex AI, sub-agents, dan tool seperti Google Search dan eksekusi kode.
|
|
214
|
+
|
|
215
|
+
#### 5. Mastra.ai — Agen TypeScript-First
|
|
216
|
+
Framework paling lengkap untuk tim TypeScript: memori bawaan, evaluasi, RAG, dan dukungan MCP native.
|
|
217
|
+
|
|
218
|
+
#### 6. Human-in-the-Loop (HITL) Guardrails
|
|
219
|
+
Wajib untuk aksi agen berisiko tinggi (transaksi keuangan, pengiriman email, deployment kode):
|
|
220
|
+
- **Interrupt Checkpoints**: Jeda eksekusi graf sebelum aksi tidak dapat dibalik.
|
|
221
|
+
- **Approval Flows**: Kirim aksi yang menunggu ke UI untuk ditinjau manusia.
|
|
222
|
+
- **Confidence Thresholds**: Auto-approve jika keyakinan > 90%, eskalasi jika < 70%.
|
|
223
|
+
|
|
224
|
+
#### 7. Arsitektur Memori Agen
|
|
225
|
+
- **Working Memory**: Riwayat percakapan recent dalam context window.
|
|
226
|
+
- **Episodic Memory**: Sesi masa lalu yang diringkas sebagai embedding (Mem0).
|
|
227
|
+
- **Semantic Memory**: Pengetahuan domain dalam vector store (pgvector, Qdrant).
|
|
228
|
+
- **Procedural Memory**: Pola penggunaan tool yang dipelajari sebagai data terstruktur.
|
|
229
|
+
|
|
230
|
+
#### 8. Observabilitas & Evaluasi
|
|
231
|
+
- **LangSmith**: Tracing native untuk LangGraph.
|
|
232
|
+
- **OpenAI Tracing**: Bawaan di OpenAI Agents SDK — lihat run, handoff, tool call.
|
|
233
|
+
- **Mastra Evals**: Framework evaluasi bawaan untuk agen Mastra.
|
|
234
|
+
- **Metrik Kustom**: Lacak tingkat penyelesaian tugas, akurasi tool call, latensi, dan biaya per run.
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: multiple-entry-points
|
|
3
|
-
description: "Expert guide for designing and implementing Multiple Entry Points architecture in web applications / Panduan ahli untuk merancang dan mengimplementasikan arsitektur Multiple Entry Points pada aplikasi web."
|
|
4
|
-
author: "Antigravity"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Multiple Entry Points Architecture
|
|
8
|
-
|
|
9
|
-
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<a name="english"></a>
|
|
14
|
-
## English
|
|
15
|
-
|
|
16
|
-
### Description
|
|
17
|
-
This skill outlines the architectural pattern of using Multiple Entry Points in a web application. Instead of forcing all traffic through a single Front Controller (like a monolithic `index.php`), the application separates traffic logically into distinct entry files such as `index.php` (public), `admin.php`, and `api.php`. This provides stronger isolation, optimized loading, and stricter security boundaries.
|
|
18
|
-
|
|
19
|
-
### Core Principles of Multiple Entry Points
|
|
20
|
-
1. **Logical Separation**: Isolate different application domains into their own entry files. For example: `public/index.php` for user-facing pages, `public/admin.php` for back-office operations, and `public/api.php` for stateless API routes.
|
|
21
|
-
2. **Dedicated Bootstrapping**: Each entry point can bootstrap only the necessary dependencies, configurations, and middlewares it requires. For example, `api.php` does not need to initialize HTML template engines or stateful session cookies, while `admin.php` can enforce strict authentication middleware immediately upon execution.
|
|
22
|
-
3. **Security Boundaries**: By physically separating entry points, you can apply distinct server-level security rules (via `.htaccess`, Nginx configurations, or WAF). For example, you can restrict access to `admin.php` to specific internal IP addresses or enforce mutual TLS.
|
|
23
|
-
4. **Frontend Asset Bundling (Vite / Webpack)**: In a modern frontend context (especially for MPAs), define multiple entry points in the bundler configuration. This generates separate, optimized JavaScript and CSS bundles for the public site versus the complex admin dashboard, drastically reducing overall payload sizes for general users.
|
|
24
|
-
|
|
25
|
-
### Orchestration with Other Skills
|
|
26
|
-
- **With `mpa-orchestrator`**: In a Multi-Page Application, multiple entry points allow you to split heavy dashboard assets from fast-loading public marketing pages, enhancing both SEO and performance.
|
|
27
|
-
- **With `mvc-expert`**: Each entry point acts as a distinct Front Controller, initiating its own lightweight Router instance configured specifically for that domain's controllers (e.g., an AdminRouter vs an ApiRouter).
|
|
28
|
-
- **With `saas-multi-tenant`**: You can design a `tenant.php` entry point that strictly mandates a valid `tenant_id` resolution before bootstrapping the app, while a `landing.php` entry point handles anonymous public traffic safely.
|
|
29
|
-
|
|
30
|
-
### Trigger Conditions
|
|
31
|
-
- Active when building or refactoring applications that require strict separation between public, admin, and API traffic.
|
|
32
|
-
- Active when optimizing frontend bundler configurations (like Vite) for Multi-Page Applications.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
<a name="bahasa-indonesia"></a>
|
|
37
|
-
## Bahasa Indonesia
|
|
38
|
-
|
|
39
|
-
### Deskripsi
|
|
40
|
-
Skill ini menguraikan pola arsitektur menggunakan *Multiple Entry Points* dalam aplikasi web. Alih-alih memaksa semua lalu lintas (traffic) melalui satu Front Controller tunggal (seperti `index.php` monolitik), aplikasi memisahkan lalu lintas secara logis ke dalam file entri yang berbeda seperti `index.php` (publik), `admin.php`, dan `api.php`. Pola ini memberikan isolasi yang lebih kuat, pemuatan (loading) yang dioptimalkan, dan batas keamanan yang lebih ketat.
|
|
41
|
-
|
|
42
|
-
### Prinsip Inti Multiple Entry Points
|
|
43
|
-
1. **Pemisahan Logis**: Isolasi domain aplikasi yang berbeda ke dalam file entrinya masing-masing. Contoh: `public/index.php` untuk pengguna umum, `public/admin.php` untuk operasional *back-office*, dan `public/api.php` untuk rute API yang *stateless*.
|
|
44
|
-
2. **Bootstrapping Terdedikasi**: Setiap titik masuk (entry point) hanya memuat dependensi, konfigurasi, dan middleware yang benar-benar diperlukannya. Contohnya, `api.php` tidak perlu menginisialisasi *template engine* HTML atau *session cookies*, sementara `admin.php` dapat langsung memberlakukan middleware autentikasi secara ketat sejak awal file dieksekusi.
|
|
45
|
-
3. **Batas Keamanan (Security Boundaries)**: Dengan memisahkan titik masuk secara fisik, Anda dapat menerapkan aturan keamanan tingkat server yang berbeda (melalui `.htaccess`, konfigurasi Nginx, atau WAF). Misalnya, membatasi akses ke `admin.php` hanya untuk alamat IP internal tertentu.
|
|
46
|
-
4. **Bundling Aset Frontend (Vite / Webpack)**: Dalam konteks frontend modern (khususnya untuk MPA), tentukan beberapa *entry points* pada konfigurasi *bundler*. Ini akan menghasilkan bundel JavaScript dan CSS yang terpisah dan optimal antara situs publik dan dashboard admin, sehingga secara drastis mengurangi ukuran *payload* bagi pengguna umum.
|
|
47
|
-
|
|
48
|
-
### Orkestrasi dengan Skill Lain
|
|
49
|
-
- **Dengan `mpa-orchestrator`**: Dalam aplikasi MPA, penggunaan beberapa *entry point* memungkinkan Anda memisahkan aset dashboard yang berat dari halaman *marketing* publik yang butuh kecepatan muat tinggi, sehingga meningkatkan SEO dan performa sekaligus.
|
|
50
|
-
- **Dengan `mvc-expert`**: Setiap *entry point* bertindak sebagai Front Controller yang terpisah, menginisiasi instans Router yang ringan dan dikonfigurasi khusus untuk controller di domain tersebut (misalnya AdminRouter vs ApiRouter).
|
|
51
|
-
- **Dengan `saas-multi-tenant`**: Anda dapat memiliki *entry point* `tenant.php` yang secara ketat mewajibkan resolusi `tenant_id` yang valid sebelum memuat aplikasi, sementara *entry point* `landing.php` melayani lalu lintas publik anonim dengan aman.
|
|
52
|
-
|
|
53
|
-
### Kondisi Pemicu
|
|
54
|
-
- Aktif saat membangun atau melakukan refaktor aplikasi yang membutuhkan pemisahan ketat antara lalu lintas publik, admin, dan API.
|
|
55
|
-
- Aktif saat mengoptimalkan konfigurasi *bundler* frontend (seperti Vite) untuk proyek Multi-Page Application.
|
|
1
|
+
---
|
|
2
|
+
name: multiple-entry-points
|
|
3
|
+
description: "Expert guide for designing and implementing Multiple Entry Points architecture in web applications / Panduan ahli untuk merancang dan mengimplementasikan arsitektur Multiple Entry Points pada aplikasi web."
|
|
4
|
+
author: "Antigravity"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Multiple Entry Points Architecture
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
This skill outlines the architectural pattern of using Multiple Entry Points in a web application. Instead of forcing all traffic through a single Front Controller (like a monolithic `index.php`), the application separates traffic logically into distinct entry files such as `index.php` (public), `admin.php`, and `api.php`. This provides stronger isolation, optimized loading, and stricter security boundaries.
|
|
18
|
+
|
|
19
|
+
### Core Principles of Multiple Entry Points
|
|
20
|
+
1. **Logical Separation**: Isolate different application domains into their own entry files. For example: `public/index.php` for user-facing pages, `public/admin.php` for back-office operations, and `public/api.php` for stateless API routes.
|
|
21
|
+
2. **Dedicated Bootstrapping**: Each entry point can bootstrap only the necessary dependencies, configurations, and middlewares it requires. For example, `api.php` does not need to initialize HTML template engines or stateful session cookies, while `admin.php` can enforce strict authentication middleware immediately upon execution.
|
|
22
|
+
3. **Security Boundaries**: By physically separating entry points, you can apply distinct server-level security rules (via `.htaccess`, Nginx configurations, or WAF). For example, you can restrict access to `admin.php` to specific internal IP addresses or enforce mutual TLS.
|
|
23
|
+
4. **Frontend Asset Bundling (Vite / Webpack)**: In a modern frontend context (especially for MPAs), define multiple entry points in the bundler configuration. This generates separate, optimized JavaScript and CSS bundles for the public site versus the complex admin dashboard, drastically reducing overall payload sizes for general users.
|
|
24
|
+
|
|
25
|
+
### Orchestration with Other Skills
|
|
26
|
+
- **With `mpa-orchestrator`**: In a Multi-Page Application, multiple entry points allow you to split heavy dashboard assets from fast-loading public marketing pages, enhancing both SEO and performance.
|
|
27
|
+
- **With `mvc-expert`**: Each entry point acts as a distinct Front Controller, initiating its own lightweight Router instance configured specifically for that domain's controllers (e.g., an AdminRouter vs an ApiRouter).
|
|
28
|
+
- **With `saas-multi-tenant`**: You can design a `tenant.php` entry point that strictly mandates a valid `tenant_id` resolution before bootstrapping the app, while a `landing.php` entry point handles anonymous public traffic safely.
|
|
29
|
+
|
|
30
|
+
### Trigger Conditions
|
|
31
|
+
- Active when building or refactoring applications that require strict separation between public, admin, and API traffic.
|
|
32
|
+
- Active when optimizing frontend bundler configurations (like Vite) for Multi-Page Applications.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
<a name="bahasa-indonesia"></a>
|
|
37
|
+
## Bahasa Indonesia
|
|
38
|
+
|
|
39
|
+
### Deskripsi
|
|
40
|
+
Skill ini menguraikan pola arsitektur menggunakan *Multiple Entry Points* dalam aplikasi web. Alih-alih memaksa semua lalu lintas (traffic) melalui satu Front Controller tunggal (seperti `index.php` monolitik), aplikasi memisahkan lalu lintas secara logis ke dalam file entri yang berbeda seperti `index.php` (publik), `admin.php`, dan `api.php`. Pola ini memberikan isolasi yang lebih kuat, pemuatan (loading) yang dioptimalkan, dan batas keamanan yang lebih ketat.
|
|
41
|
+
|
|
42
|
+
### Prinsip Inti Multiple Entry Points
|
|
43
|
+
1. **Pemisahan Logis**: Isolasi domain aplikasi yang berbeda ke dalam file entrinya masing-masing. Contoh: `public/index.php` untuk pengguna umum, `public/admin.php` untuk operasional *back-office*, dan `public/api.php` untuk rute API yang *stateless*.
|
|
44
|
+
2. **Bootstrapping Terdedikasi**: Setiap titik masuk (entry point) hanya memuat dependensi, konfigurasi, dan middleware yang benar-benar diperlukannya. Contohnya, `api.php` tidak perlu menginisialisasi *template engine* HTML atau *session cookies*, sementara `admin.php` dapat langsung memberlakukan middleware autentikasi secara ketat sejak awal file dieksekusi.
|
|
45
|
+
3. **Batas Keamanan (Security Boundaries)**: Dengan memisahkan titik masuk secara fisik, Anda dapat menerapkan aturan keamanan tingkat server yang berbeda (melalui `.htaccess`, konfigurasi Nginx, atau WAF). Misalnya, membatasi akses ke `admin.php` hanya untuk alamat IP internal tertentu.
|
|
46
|
+
4. **Bundling Aset Frontend (Vite / Webpack)**: Dalam konteks frontend modern (khususnya untuk MPA), tentukan beberapa *entry points* pada konfigurasi *bundler*. Ini akan menghasilkan bundel JavaScript dan CSS yang terpisah dan optimal antara situs publik dan dashboard admin, sehingga secara drastis mengurangi ukuran *payload* bagi pengguna umum.
|
|
47
|
+
|
|
48
|
+
### Orkestrasi dengan Skill Lain
|
|
49
|
+
- **Dengan `mpa-orchestrator`**: Dalam aplikasi MPA, penggunaan beberapa *entry point* memungkinkan Anda memisahkan aset dashboard yang berat dari halaman *marketing* publik yang butuh kecepatan muat tinggi, sehingga meningkatkan SEO dan performa sekaligus.
|
|
50
|
+
- **Dengan `mvc-expert`**: Setiap *entry point* bertindak sebagai Front Controller yang terpisah, menginisiasi instans Router yang ringan dan dikonfigurasi khusus untuk controller di domain tersebut (misalnya AdminRouter vs ApiRouter).
|
|
51
|
+
- **Dengan `saas-multi-tenant`**: Anda dapat memiliki *entry point* `tenant.php` yang secara ketat mewajibkan resolusi `tenant_id` yang valid sebelum memuat aplikasi, sementara *entry point* `landing.php` melayani lalu lintas publik anonim dengan aman.
|
|
52
|
+
|
|
53
|
+
### Kondisi Pemicu
|
|
54
|
+
- Aktif saat membangun atau melakukan refaktor aplikasi yang membutuhkan pemisahan ketat antara lalu lintas publik, admin, dan API.
|
|
55
|
+
- Aktif saat mengoptimalkan konfigurasi *bundler* frontend (seperti Vite) untuk proyek Multi-Page Application.
|