vibes-plug 1.0.0 → 2.11.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/.claude/rules/vibes-plug-core.md +32 -0
- package/.cursor/rules/vibes-plug-core.mdc +51 -0
- package/.cursorrules +42 -0
- package/AGENTS.md +96 -0
- package/BLUEPRINT.md +309 -125
- package/CHANGELOG.md +183 -1
- package/CLAUDE.md +70 -0
- package/LICENSE +1 -1
- package/README.md +641 -263
- package/index.js +19 -0
- package/package.json +61 -25
- package/plugin.json +24 -7
- package/scripts/generate_swarm_gif.py +295 -0
- package/scripts/install.js +201 -0
- package/skills/accessibility-testing-expert/SKILL.md +116 -0
- package/skills/ai-cost-token-optimizer/SKILL.md +82 -0
- package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
- package/skills/ai-llm-integration-expert/SKILL.md +147 -122
- package/skills/ai-media-generation-expert/SKILL.md +172 -0
- package/skills/ai-prompt-engineering-expert/SKILL.md +84 -0
- package/skills/angular-expert/SKILL.md +148 -0
- package/skills/api-design-expert/SKILL.md +316 -309
- package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
- package/skills/app-analyzer-optimizer/SKILL.md +195 -188
- package/skills/apple-ecosystem-expert/SKILL.md +145 -0
- package/skills/{asisten_ramah → asisten-ramah}/SKILL.md +7 -1
- package/skills/astro-framework-expert/SKILL.md +200 -0
- package/skills/async-queue-temporal-expert/SKILL.md +240 -0
- package/skills/authentication-identity-expert/SKILL.md +279 -45
- package/skills/auto-doc-updater/SKILL.md +219 -203
- package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
- package/skills/autonomous-red-teamer/SKILL.md +203 -0
- package/skills/autonomous-tdd-debugger/SKILL.md +71 -0
- package/skills/background-jobs-queue-expert/SKILL.md +235 -0
- package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
- package/skills/blockchain-web3-expert/SKILL.md +115 -0
- package/skills/bootstrap-to-modern/SKILL.md +93 -86
- package/skills/brainstorming/SKILL.md +381 -353
- package/skills/browser-automation-expert/SKILL.md +222 -0
- package/skills/bun-runtime-expert/SKILL.md +7 -1
- package/skills/chatbot-messaging-expert/SKILL.md +114 -0
- package/skills/ci-cd-devops-architect/SKILL.md +81 -45
- package/skills/cloud-hosting-expert/SKILL.md +249 -243
- package/skills/coderabbit/SKILL.md +197 -191
- package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
- package/skills/cron-scheduler-expert/SKILL.md +304 -0
- package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
- package/skills/data-telemetry-expert/SKILL.md +218 -212
- package/skills/data-visualization-expert/SKILL.md +154 -0
- package/skills/database-migration-versioning-expert/SKILL.md +90 -0
- package/skills/database-orm-expert/SKILL.md +303 -293
- package/skills/dependency-upgrade-migrator/SKILL.md +301 -0
- package/skills/design-system-architect/SKILL.md +278 -242
- package/skills/desktop-electron-expert/SKILL.md +128 -0
- package/skills/documentation-site-expert/SKILL.md +59 -0
- package/skills/doku-mcp-server/SKILL.md +257 -0
- package/skills/doku-payment-gateway/SKILL.md +233 -0
- package/skills/domain-driven-design-expert/SKILL.md +82 -0
- package/skills/e2e-testing-expert/SKILL.md +320 -314
- package/skills/ecommerce-expert/SKILL.md +87 -0
- package/skills/edge-serverless-db-expert/SKILL.md +99 -0
- package/skills/email-notification-expert/SKILL.md +368 -0
- package/skills/error-resilience-expert/SKILL.md +486 -0
- package/skills/event-driven-architect/SKILL.md +86 -80
- package/skills/feature-flag-analytics-expert/SKILL.md +66 -0
- package/skills/file-upload-media-expert/SKILL.md +437 -0
- package/skills/firebase-security-expert/SKILL.md +7 -1
- package/skills/form-validation-expert/SKILL.md +407 -0
- package/skills/fullstack-expert/SKILL.md +260 -201
- 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 +142 -104
- package/skills/geospatial-maps-expert/SKILL.md +80 -0
- package/skills/global-a11y-i18n-expert/SKILL.md +86 -80
- package/skills/glsl-shader-expert/SKILL.md +107 -0
- package/skills/go-programming-expert/SKILL.md +300 -294
- package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
- package/skills/graphql-apollo-expert/SKILL.md +114 -0
- package/skills/headless-cms-expert/SKILL.md +181 -0
- package/skills/hig/SKILL.md +193 -187
- package/skills/js-backend-expert/SKILL.md +218 -191
- package/skills/legacy-code-translator/SKILL.md +71 -0
- package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
- package/skills/logging-error-tracking-expert/SKILL.md +344 -0
- package/skills/mcp-client-orchestrator/SKILL.md +76 -0
- package/skills/mcp-server-architect/SKILL.md +226 -126
- package/skills/micro-frontend-architect/SKILL.md +112 -0
- package/skills/mobile-expo-expert/SKILL.md +191 -185
- package/skills/mobile-push-notification-expert/SKILL.md +71 -0
- package/skills/modern-css-native-expert/SKILL.md +189 -0
- package/skills/monday-design-aesthetic/SKILL.md +72 -66
- package/skills/monorepo-architect/SKILL.md +232 -226
- package/skills/mpa-orchestrator/SKILL.md +120 -101
- package/skills/multi-agent-orchestration/SKILL.md +173 -153
- package/skills/multiple-entry-points/SKILL.md +91 -55
- package/skills/mvc-expert/SKILL.md +237 -231
- package/skills/n8n-automation-expert/SKILL.md +89 -0
- package/skills/nextjs-app-router-expert/SKILL.md +148 -0
- package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
- package/skills/payment-gateway-expert/SKILL.md +129 -45
- package/skills/pdf-document-generation-expert/SKILL.md +91 -0
- package/skills/performance-web-vitals/SKILL.md +337 -331
- package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
- package/skills/prd-architect/SKILL.md +206 -190
- package/skills/proactive-background-watcher/SKILL.md +68 -0
- package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
- package/skills/production-ready-hardener/SKILL.md +461 -468
- 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 +85 -0
- package/skills/pwa-offline-first-expert/SKILL.md +185 -0
- package/skills/python-programming-expert/SKILL.md +407 -270
- package/skills/rate-limit-abuse-prevention/SKILL.md +377 -0
- package/skills/realtime-collaboration-expert/SKILL.md +99 -45
- package/skills/rich-text-editor-expert/SKILL.md +177 -0
- package/skills/rust-programming-expert/SKILL.md +240 -234
- package/skills/saas-billing/SKILL.md +382 -376
- package/skills/saas-multi-tenant/SKILL.md +256 -236
- package/skills/saas-mvp-launcher/SKILL.md +30 -1
- package/skills/saas-transformer/SKILL.md +499 -445
- 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 +234 -228
- package/skills/search-engine-expert/SKILL.md +89 -0
- package/skills/secure-fuzz-testing/SKILL.md +7 -1
- package/skills/self-evolving-memory-graph/SKILL.md +91 -0
- package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
- package/skills/senior-frontend/SKILL.md +85 -105
- package/skills/seo/SKILL.md +258 -224
- package/skills/session-context-loader/SKILL.md +83 -0
- package/skills/session-handoff-resume/SKILL.md +163 -157
- package/skills/{skill_baru → skill-baru}/SKILL.md +177 -146
- package/skills/solidjs-expert/SKILL.md +80 -0
- package/skills/spa-orchestrator/SKILL.md +306 -287
- package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
- package/skills/state-management-expert/SKILL.md +277 -271
- package/skills/supabase-migration/SKILL.md +47 -1
- package/skills/supabase-security-expert/SKILL.md +248 -242
- package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
- package/skills/svg-animation-motion-expert/SKILL.md +115 -0
- package/skills/tailwind-expert/SKILL.md +139 -187
- package/skills/tanstack-query-expert/SKILL.md +204 -198
- package/skills/tauri-expert/SKILL.md +7 -1
- package/skills/token-saver/SKILL.md +118 -110
- package/skills/typescript-expert/SKILL.md +329 -278
- package/skills/ui-components-expert/SKILL.md +166 -63
- package/skills/ui-ux-pro-max/SKILL.md +221 -200
- package/skills/vector-db-rag-expert/SKILL.md +208 -0
- package/skills/vibe-code-gardener/SKILL.md +180 -172
- package/skills/visual-qa-vision-agent/SKILL.md +71 -0
- package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
- package/skills/vue-frontend-expert/SKILL.md +132 -0
- package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
- package/skills/web-3d-graphics-expert/SKILL.md +137 -0
- package/skills/web-game-engine-expert/SKILL.md +102 -0
- package/skills/web-scraper/SKILL.md +98 -146
- package/skills/website-design-cloner/SKILL.md +180 -0
- package/skills/webxr-ar-vr-expert/SKILL.md +123 -0
- package/skills/wordpress-headless-expert/SKILL.md +144 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +231 -180
- package/skills/zero-trust-secret-vault/SKILL.md +88 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/CONTRIBUTING.md +0 -199
- package/SECURITY.md +0 -21
- package/banner.png +0 -0
- package/skills/senior-fullstack/SKILL.md +0 -167
- package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
- package/skills/senior-fullstack/references/development_workflows.md +0 -222
- package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
- package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
- package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
- package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
- package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
- package/skills/seo-geo/SKILL.md +0 -188
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
- package/skills/ui_ux_expert/SKILL.md +0 -114
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: multi-agent-orchestration
|
|
3
|
-
|
|
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."
|
|
4
5
|
author: "Roedy Rustam"
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -13,41 +14,69 @@ author: "Roedy Rustam"
|
|
|
13
14
|
<a name="english"></a>
|
|
14
15
|
## English
|
|
15
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
|
+
|
|
16
20
|
### Description
|
|
17
|
-
Expert guide for designing, building, and deploying production-grade multi-agent AI systems. Covers
|
|
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.
|
|
18
22
|
|
|
19
|
-
**Swarm Synergy:** This skill acts as a
|
|
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**.
|
|
20
24
|
|
|
21
25
|
### 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
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- Evaluating and selecting agent
|
|
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
|
+
```
|
|
28
65
|
|
|
29
66
|
### Agent Framework Comparison (2026)
|
|
30
67
|
|
|
31
68
|
| Framework | Language | Best For | Key Differentiator |
|
|
32
69
|
|---|---|---|---|
|
|
33
|
-
| **LangGraph** | Python / TypeScript | Complex stateful workflows | Graph-based,
|
|
34
|
-
| **OpenAI Agents SDK** | Python | GPT-5 native agents | Built-in handoffs, tracing, guardrails |
|
|
35
|
-
| **Google ADK** | Python | Gemini-powered
|
|
36
|
-
| **Mastra.ai** | TypeScript | TS-first
|
|
37
|
-
| **CrewAI** | Python |
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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:
|
|
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:
|
|
51
80
|
```python
|
|
52
81
|
from langgraph.graph import StateGraph, END
|
|
53
82
|
from langgraph.checkpoint.memory import MemorySaver
|
|
@@ -57,178 +86,169 @@ import operator
|
|
|
57
86
|
class AgentState(TypedDict):
|
|
58
87
|
messages: Annotated[list, operator.add]
|
|
59
88
|
task: str
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return
|
|
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"
|
|
73
108
|
|
|
74
109
|
builder = StateGraph(AgentState)
|
|
75
|
-
builder.add_node("
|
|
76
|
-
builder.add_node("
|
|
77
|
-
builder.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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"])
|
|
82
119
|
```
|
|
83
120
|
|
|
84
|
-
####
|
|
85
|
-
|
|
121
|
+
#### 2. OpenAI Agents SDK — Agent Handoffs & Guardrails
|
|
122
|
+
Implement native agent handoffs where specialized agents transition control cleanly:
|
|
86
123
|
```python
|
|
87
124
|
from agents import Agent, Runner, handoff, input_guardrail, GuardrailFunctionOutput
|
|
88
125
|
|
|
89
|
-
# Define specialist agents
|
|
90
126
|
researcher = Agent(
|
|
91
127
|
name="Researcher",
|
|
92
|
-
instructions="
|
|
93
|
-
tools=[web_search,
|
|
128
|
+
instructions="Research libraries, security advisories, and system specs.",
|
|
129
|
+
tools=[web_search, doc_retrieval],
|
|
94
130
|
)
|
|
95
131
|
|
|
96
|
-
|
|
97
|
-
name="
|
|
98
|
-
instructions="
|
|
99
|
-
handoffs=[handoff(researcher, tool_name_override="
|
|
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")],
|
|
100
136
|
)
|
|
101
137
|
|
|
102
|
-
# Input guardrail to prevent harmful requests
|
|
103
138
|
@input_guardrail
|
|
104
|
-
async def
|
|
105
|
-
if
|
|
106
|
-
return GuardrailFunctionOutput(output_info="Blocked", tripwire_triggered=True)
|
|
107
|
-
return GuardrailFunctionOutput(output_info="
|
|
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)
|
|
108
143
|
|
|
109
|
-
|
|
110
|
-
result = await Runner.run(writer, "Write an article about...", guardrails=[content_filter])
|
|
144
|
+
result = await Runner.run(architect, "Design high-throughput ingestion pipeline", guardrails=[safety_guardrail])
|
|
111
145
|
```
|
|
112
146
|
|
|
113
|
-
####
|
|
114
|
-
|
|
147
|
+
#### 3. Google ADK — Gemini Multi-Agent Systems
|
|
148
|
+
Orchestrate Gemini 3.x agents with streaming subagent calls and Vertex AI tooling:
|
|
115
149
|
```python
|
|
116
150
|
from google.adk.agents import Agent
|
|
117
151
|
from google.adk.tools import google_search, code_execution
|
|
118
152
|
|
|
119
|
-
|
|
120
|
-
model="gemini-
|
|
121
|
-
name="
|
|
122
|
-
instruction="Coordinate
|
|
123
|
-
sub_agents=[
|
|
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],
|
|
124
158
|
tools=[google_search, code_execution],
|
|
125
159
|
)
|
|
126
160
|
```
|
|
127
161
|
|
|
128
|
-
####
|
|
129
|
-
For
|
|
162
|
+
#### 4. Mastra.ai — TypeScript-Native Agents
|
|
163
|
+
For modern Next.js / Node.js / Bun environments:
|
|
130
164
|
```typescript
|
|
131
165
|
import { Agent, MastraMemory } from '@mastra/core';
|
|
132
166
|
import { createTool } from '@mastra/core/tools';
|
|
167
|
+
import { z } from 'zod';
|
|
133
168
|
|
|
134
|
-
const
|
|
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({
|
|
169
|
+
const researcher = new Agent({
|
|
142
170
|
name: 'researcher',
|
|
143
|
-
instructions: 'Find and summarize
|
|
144
|
-
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-
|
|
145
|
-
tools: { webSearch: webSearchTool },
|
|
171
|
+
instructions: 'Find and summarize accurate technical documentation.',
|
|
172
|
+
model: { provider: 'ANTHROPIC', name: 'claude-3-7-sonnet-20250219' },
|
|
146
173
|
memory: new MastraMemory({ storage: supabaseStorage }),
|
|
147
174
|
});
|
|
148
175
|
```
|
|
149
176
|
|
|
150
|
-
####
|
|
151
|
-
Mandatory
|
|
152
|
-
- **Interrupt Checkpoints**:
|
|
153
|
-
- **Approval
|
|
154
|
-
- **Confidence
|
|
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.
|
|
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.
|
|
161
182
|
|
|
162
|
-
####
|
|
163
|
-
- **
|
|
164
|
-
- **
|
|
165
|
-
- **
|
|
166
|
-
- **Custom Metrics**: Track task completion rate, tool call accuracy, latency, and cost per run.
|
|
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.
|
|
167
187
|
|
|
168
188
|
---
|
|
169
189
|
|
|
170
190
|
<a name="bahasa-indonesia"></a>
|
|
171
191
|
## Bahasa Indonesia
|
|
172
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
|
+
|
|
173
196
|
### Deskripsi
|
|
174
|
-
Panduan ahli untuk merancang, membangun, dan men-deploy sistem multi-agen AI tingkat produksi. Mencakup
|
|
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).
|
|
175
198
|
|
|
176
|
-
**Sinergi Swarm:** Skill ini bertindak sebagai orkestrator
|
|
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.
|
|
177
200
|
|
|
178
201
|
### Kondisi Pemicu
|
|
179
|
-
- Membangun agen AI otonom yang mengeksekusi tugas multi-langkah.
|
|
180
|
-
- Merancang sistem
|
|
181
|
-
- Mengimplementasikan alur kerja
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
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.
|
|
185
218
|
|
|
186
219
|
### Perbandingan Framework Agen (2026)
|
|
187
220
|
|
|
188
|
-
| Framework | Bahasa | Terbaik Untuk |
|
|
221
|
+
| Framework | Bahasa | Terbaik Untuk | Keunggulan Utama |
|
|
189
222
|
|---|---|---|---|
|
|
190
|
-
| **LangGraph** | Python /
|
|
191
|
-
| **OpenAI Agents SDK** | Python | Agen GPT-5
|
|
192
|
-
| **Google ADK** | Python |
|
|
193
|
-
| **Mastra.ai** | TypeScript |
|
|
194
|
-
| **CrewAI** | Python |
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
####
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
####
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
####
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
#### 6.
|
|
219
|
-
|
|
220
|
-
- **
|
|
221
|
-
- **
|
|
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.
|
|
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,55 +1,91 @@
|
|
|
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: "
|
|
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
|
-
###
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
###
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
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: "Roedy Rustam"
|
|
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
|
+
### Orchestration & Integration
|
|
17
|
+
Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `project-context-mapper` to ensure cohesive execution.
|
|
18
|
+
|
|
19
|
+
### Description
|
|
20
|
+
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.
|
|
21
|
+
|
|
22
|
+
### Core Principles of Multiple Entry Points
|
|
23
|
+
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.
|
|
24
|
+
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.
|
|
25
|
+
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.
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
### Implementation Checklist
|
|
29
|
+
- [ ] Create separate HTML entry points in the root/public directory (e.g., `index.html`, `admin.html`).
|
|
30
|
+
- [ ] Configure the frontend bundler (Vite/Webpack) to output multiple bundles.
|
|
31
|
+
- [ ] Set up server-side routing (Nginx or Node.js) to serve the correct entry HTML based on the URL path.
|
|
32
|
+
- [ ] Ensure shared components and utilities are properly tree-shaken and split into common chunks.
|
|
33
|
+
|
|
34
|
+
### Example: Vite Config for Multiple Entries
|
|
35
|
+
```javascript
|
|
36
|
+
import { defineConfig } from 'vite';
|
|
37
|
+
import { resolve } from 'path';
|
|
38
|
+
|
|
39
|
+
export default defineConfig({
|
|
40
|
+
build: {
|
|
41
|
+
rollupOptions: {
|
|
42
|
+
input: {
|
|
43
|
+
main: resolve(__dirname, 'index.html'),
|
|
44
|
+
admin: resolve(__dirname, 'admin.html'),
|
|
45
|
+
app: resolve(__dirname, 'app.html')
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Orchestration with Other Skills
|
|
53
|
+
- **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.
|
|
54
|
+
- **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).
|
|
55
|
+
- **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.
|
|
56
|
+
|
|
57
|
+
### Trigger Conditions
|
|
58
|
+
- Active when building or refactoring applications that require strict separation between public, admin, and API traffic.
|
|
59
|
+
- Active when optimizing frontend bundler configurations (like Vite) for Multi-Page Applications.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
<a name="bahasa-indonesia"></a>
|
|
64
|
+
## Bahasa Indonesia
|
|
65
|
+
|
|
66
|
+
### Integrasi Orkestrasi
|
|
67
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
68
|
+
|
|
69
|
+
### Deskripsi
|
|
70
|
+
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.
|
|
71
|
+
|
|
72
|
+
### Prinsip Inti Multiple Entry Points
|
|
73
|
+
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*.
|
|
74
|
+
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.
|
|
75
|
+
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.
|
|
76
|
+
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.
|
|
77
|
+
|
|
78
|
+
### Checklist Implementasi
|
|
79
|
+
- [ ] Buat titik entri HTML terpisah di direktori utama/publik (misal: `index.html`, `admin.html`).
|
|
80
|
+
- [ ] Konfigurasi bundler frontend (Vite/Webpack) untuk menghasilkan multiple bundle.
|
|
81
|
+
- [ ] Siapkan routing di sisi server (Nginx atau Node.js) untuk menyajikan HTML entri yang benar berdasarkan path URL.
|
|
82
|
+
- [ ] Pastikan komponen dan utilitas yang dipakai bersama dioptimalkan (tree-shaking) dan dipisah ke dalam *common chunks*.
|
|
83
|
+
|
|
84
|
+
### Orkestrasi dengan Skill Lain
|
|
85
|
+
- **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.
|
|
86
|
+
- **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).
|
|
87
|
+
- **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.
|
|
88
|
+
|
|
89
|
+
### Kondisi Pemicu
|
|
90
|
+
- Aktif saat membangun atau melakukan refaktor aplikasi yang membutuhkan pemisahan ketat antara lalu lintas publik, admin, dan API.
|
|
91
|
+
- Aktif saat mengoptimalkan konfigurasi *bundler* frontend (seperti Vite) untuk proyek Multi-Page Application.
|