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.
Files changed (123) hide show
  1. package/.github/workflows/publish.yml +20 -0
  2. package/AGENTS.md +66 -0
  3. package/BLUEPRINT.md +152 -60
  4. package/CHANGELOG.md +50 -0
  5. package/README.md +346 -194
  6. package/package.json +25 -25
  7. package/plugin.json +1 -1
  8. package/skills/ai-cost-token-optimizer/SKILL.md +52 -0
  9. package/skills/ai-llm-integration-expert/SKILL.md +180 -162
  10. package/skills/api-design-expert/SKILL.md +314 -310
  11. package/skills/app-analyzer-optimizer/SKILL.md +193 -189
  12. package/skills/apple-ecosystem-expert/SKILL.md +142 -0
  13. package/skills/async-queue-temporal-expert/SKILL.md +54 -0
  14. package/skills/authentication-identity-expert/SKILL.md +251 -20
  15. package/skills/auto-doc-updater/SKILL.md +214 -204
  16. package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
  17. package/skills/autonomous-red-teamer/SKILL.md +59 -0
  18. package/skills/autonomous-swarm-director/SKILL.md +69 -0
  19. package/skills/autonomous-tdd-debugger/SKILL.md +65 -0
  20. package/skills/bootstrap-to-modern/SKILL.md +90 -86
  21. package/skills/brainstorming/SKILL.md +373 -353
  22. package/skills/browser-automation-expert/SKILL.md +46 -0
  23. package/skills/ci-cd-devops-architect/SKILL.md +72 -45
  24. package/skills/cloud-hosting-expert/SKILL.md +244 -244
  25. package/skills/coderabbit/SKILL.md +192 -192
  26. package/skills/cron-scheduler-expert/SKILL.md +298 -0
  27. package/skills/data-telemetry-expert/SKILL.md +213 -213
  28. package/skills/database-orm-expert/SKILL.md +294 -294
  29. package/skills/dependency-upgrade-migrator/SKILL.md +295 -0
  30. package/skills/design-system-architect/SKILL.md +27 -10
  31. package/skills/doku-mcp-server/SKILL.md +251 -0
  32. package/skills/doku-payment-gateway/SKILL.md +227 -0
  33. package/skills/e2e-testing-expert/SKILL.md +315 -315
  34. package/skills/edge-serverless-db-expert/SKILL.md +43 -0
  35. package/skills/email-notification-expert/SKILL.md +362 -0
  36. package/skills/error-resilience-expert/SKILL.md +480 -0
  37. package/skills/event-driven-architect/SKILL.md +81 -81
  38. package/skills/feature-flag-analytics-expert/SKILL.md +46 -0
  39. package/skills/file-upload-media-expert/SKILL.md +431 -0
  40. package/skills/form-validation-expert/SKILL.md +401 -0
  41. package/skills/fullstack-expert/SKILL.md +202 -202
  42. package/skills/fullstack-expert/references/api_design_guide.md +466 -466
  43. package/skills/fullstack-expert/references/multi_language_backend.md +528 -528
  44. package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -253
  45. package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -326
  46. package/skills/gemini-agent-booster/SKILL.md +135 -135
  47. package/skills/global-a11y-i18n-expert/SKILL.md +81 -81
  48. package/skills/glsl-shader-expert/SKILL.md +101 -0
  49. package/skills/go-programming-expert/SKILL.md +295 -295
  50. package/skills/graphql-apollo-expert/SKILL.md +108 -0
  51. package/skills/hig/SKILL.md +188 -188
  52. package/skills/hyper-context-synthesizer/SKILL.md +55 -0
  53. package/skills/js-backend-expert/SKILL.md +34 -9
  54. package/skills/legacy-code-translator/SKILL.md +65 -0
  55. package/skills/llm-cost-arbitrage-router/SKILL.md +59 -0
  56. package/skills/logging-error-tracking-expert/SKILL.md +338 -0
  57. package/skills/mcp-client-orchestrator/SKILL.md +70 -0
  58. package/skills/mcp-server-architect/SKILL.md +194 -194
  59. package/skills/micro-frontend-architect/SKILL.md +106 -0
  60. package/skills/mobile-expo-expert/SKILL.md +186 -186
  61. package/skills/mobile-push-notification-expert/SKILL.md +51 -0
  62. package/skills/monday-design-aesthetic/SKILL.md +67 -67
  63. package/skills/monorepo-architect/SKILL.md +227 -227
  64. package/skills/mpa-orchestrator/SKILL.md +101 -101
  65. package/skills/multi-agent-orchestration/SKILL.md +234 -234
  66. package/skills/multiple-entry-points/SKILL.md +55 -55
  67. package/skills/mvc-expert/SKILL.md +231 -231
  68. package/skills/payment-gateway-expert/SKILL.md +45 -45
  69. package/skills/performance-web-vitals/SKILL.md +332 -332
  70. package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
  71. package/skills/prd-architect/SKILL.md +201 -191
  72. package/skills/proactive-background-watcher/SKILL.md +62 -0
  73. package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
  74. package/skills/production-ready-hardener/SKILL.md +173 -186
  75. package/skills/production-ready-hardener/references/production_checklist.md +161 -161
  76. package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +881 -875
  77. package/skills/project-context-mapper/SKILL.md +79 -0
  78. package/skills/python-programming-expert/SKILL.md +263 -132
  79. package/skills/rate-limit-abuse-prevention/SKILL.md +371 -0
  80. package/skills/realtime-collaboration-expert/SKILL.md +45 -45
  81. package/skills/rust-programming-expert/SKILL.md +235 -235
  82. package/skills/saas-billing/SKILL.md +377 -377
  83. package/skills/saas-multi-tenant/SKILL.md +251 -237
  84. package/skills/saas-mvp-launcher/SKILL.md +10 -0
  85. package/skills/saas-transformer/SKILL.md +187 -144
  86. package/skills/saas-transformer/references/billing_integration_guide.md +401 -401
  87. package/skills/saas-transformer/references/feature_gating_patterns.md +137 -137
  88. package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -121
  89. package/skills/saas-transformer/scripts/saas_transformation_scanner.py +39 -29
  90. package/skills/scalability-clean-code/SKILL.md +229 -229
  91. package/skills/self-evolving-memory-graph/SKILL.md +75 -0
  92. package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
  93. package/skills/senior-frontend/SKILL.md +161 -161
  94. package/skills/senior-fullstack/SKILL.md +167 -167
  95. package/skills/seo/SKILL.md +235 -225
  96. package/skills/seo-geo/SKILL.md +188 -188
  97. package/skills/session-context-loader/SKILL.md +77 -0
  98. package/skills/session-handoff-resume/SKILL.md +158 -158
  99. package/skills/skill_baru/SKILL.md +172 -147
  100. package/skills/spa-orchestrator/SKILL.md +288 -288
  101. package/skills/state-management-expert/SKILL.md +272 -272
  102. package/skills/supabase-security-expert/SKILL.md +243 -243
  103. package/skills/tailwind-expert/SKILL.md +188 -188
  104. package/skills/tanstack-query-expert/SKILL.md +199 -199
  105. package/skills/token-saver/SKILL.md +119 -111
  106. package/skills/typescript-expert/SKILL.md +324 -279
  107. package/skills/ui-components-expert/SKILL.md +263 -46
  108. package/skills/ui-ux-pro-max/SKILL.md +202 -201
  109. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  110. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  111. package/skills/ui_ux_expert/SKILL.md +17 -6
  112. package/skills/vector-db-rag-expert/SKILL.md +52 -0
  113. package/skills/vibe-code-gardener/SKILL.md +181 -173
  114. package/skills/visual-qa-vision-agent/SKILL.md +65 -0
  115. package/skills/vue-frontend-expert/SKILL.md +126 -0
  116. package/skills/web-3d-graphics-expert/SKILL.md +131 -0
  117. package/skills/web-game-engine-expert/SKILL.md +96 -0
  118. package/skills/web-scraper/SKILL.md +207 -205
  119. package/skills/website-design-cloner/SKILL.md +174 -0
  120. package/skills/webxr-ar-vr-expert/SKILL.md +117 -0
  121. package/skills/zero-to-prod-orchestrator/SKILL.md +206 -180
  122. package/skills/zero-trust-secret-vault/SKILL.md +40 -0
  123. package/vibes-swarm-demo.gif +0 -0
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
- {
2
- "name": "vibes-plug",
3
- "version": "1.0.0",
4
- "description": "Customization plugin for Antigravity containing 65+ specialized *skills* updated for the modern 2026 tech stack (React 19, Tailwind v4, Bun, Hono, Supabase Auth v3). Designed to support software development, UI/UX design, SEO optimization, and SaaS business strategies",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/roedyrustam/vibes-plug.git"
12
- },
13
- "keywords": [
14
- "gemini",
15
- "plugins",
16
- "gemini",
17
- "skills"
18
- ],
19
- "author": "Roedy Rustam",
20
- "license": "ISC",
21
- "bugs": {
22
- "url": "https://github.com/roedyrustam/vibes-plug/issues"
23
- },
24
- "homepage": "https://github.com/roedyrustam/vibes-plug#readme"
25
- }
1
+ {
2
+ "name": "vibes-plug",
3
+ "version": "2.5.0",
4
+ "description": "Customization plugin for Antigravity containing 103+ specialized *skills* updated for the modern 2026 tech stack (React 19, Tailwind v4, Bun, Hono, Supabase Auth v3). Designed to support software development, UI/UX design, SEO optimization, and SaaS business strategies",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/roedyrustam/vibes-plug.git"
12
+ },
13
+ "keywords": [
14
+ "gemini",
15
+ "plugins",
16
+ "gemini",
17
+ "skills"
18
+ ],
19
+ "author": "Roedy Rustam",
20
+ "license": "ISC",
21
+ "bugs": {
22
+ "url": "https://github.com/roedyrustam/vibes-plug/issues"
23
+ },
24
+ "homepage": "https://github.com/roedyrustam/vibes-plug#readme"
25
+ }
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibes-plug",
3
- "version": "1.6.0",
3
+ "version": "2.5.0",
4
4
  "description": "Plugin kustomisasi untuk Antigravity.",
5
5
  "author": "roedy rustam",
6
6
  "license": "MIT",
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: ai-cost-token-optimizer
3
+ description: "Expert guide for LLM API cost optimization, Prompt Caching, model routing (Flash/Pro/Opus), semantic caching, and token budgeting / Panduan ahli optimasi biaya API LLM, Prompt Caching, model routing, dan semantic caching."
4
+ author: vibes-plug-swarm
5
+ ---
6
+
7
+ # AI Cost & Token Optimizer
8
+
9
+ [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
+
11
+ ---
12
+
13
+ <a name="english"></a>
14
+ ## English
15
+
16
+ ### Purpose & Overview
17
+ Production-grade guidelines for FinOps in AI engineering — prompt caching (Anthropic Prompt Caching, Gemini Context Caching), dynamic model routing (routing lightweight queries to Flash/Haiku and complex reasoning to Pro/Opus), semantic caching with Redis/GPTCache, and real-time token expenditure tracking.
18
+
19
+ ### Key Capabilities
20
+ - **Prompt & Context Caching**: Storing static system prompts, long-context documents, and schemas in cache to reduce token costs by up to 90%.
21
+ - **Model Router**: Heuristic and classifier-based routing between ultra-fast Flash models and high-reasoning Pro models.
22
+ - **Semantic Caching**: Hashing query vector embeddings to serve cached responses for semantically identical user queries.
23
+
24
+ ```typescript
25
+ // Model Routing Strategy Example
26
+ export function selectOptimalModel(promptLength: number, taskType: 'classification' | 'reasoning' | 'summary') {
27
+ if (taskType === 'classification' || promptLength < 500) {
28
+ return 'gemini-3.5-flash'; // High speed, ultra low cost
29
+ }
30
+ return 'gemini-3.1-pro'; // Complex reasoning
31
+ }
32
+ ```
33
+
34
+ ---
35
+
36
+ <a name="bahasa-indonesia"></a>
37
+ ## Bahasa Indonesia
38
+
39
+ ### Deskripsi
40
+ Panduan tingkat produksi untuk FinOps dalam rekayasa AI — prompt caching (Anthropic Prompt Caching & Gemini Context Caching), routing model dinamis (mengarahkan tugas ringan ke Flash/Haiku dan tugas penalaran ke Pro/Opus), semantic caching dengan Redis, dan pelacakan anggaran token real-time.
41
+
42
+ ### Fitur Utama
43
+ - **Prompt & Context Caching**: Menyimpan prompt sistem dan dokumen konteks panjang di cache untuk menghemat hingga 90% biaya token.
44
+ - **Model Router**: Routing otomatis berdasarkan heuristik antara model ultra-cepat Flash dan model penalaran Pro.
45
+ - **Semantic Caching**: Memanfaatkan embedding vector query untuk menyajikan respon cache pada pertanyaan pengguna yang serupa secara semantik.
46
+
47
+
48
+ ## Orchestration & Integration
49
+ - Integrates with `ai-llm-integration-expert`, `token-saver`, `llm-cost-arbitrage-router`, and `zero-to-prod-orchestrator`.
50
+
51
+ ## Integrasi Orkestrasi
52
+ - Terintegrasi dengan `ai-llm-integration-expert`, `token-saver`, `llm-cost-arbitrage-router`, dan `zero-to-prod-orchestrator`.
@@ -1,162 +1,180 @@
1
- ---
2
- name: ai-llm-integration-expert
3
- description: "Expert guide for integrating Large Language Models (LLMs), Model Context Protocol (MCP), RAG architecture, vector databases, and AI agents / Panduan ahli untuk integrasi LLM, Model Context Protocol (MCP), arsitektur RAG, vector database, dan agen AI."
4
- author: "Roedy Rustam"
5
- ---
6
-
7
- # AI & LLM Integration 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
- Production-grade guidelines for integrating AI, Model Context Protocol (MCP), and Large Language Models (LLMs) into modern applications. Covers RAG pipelines, vector embeddings, real-time token streaming, agentic tool execution, memory architectures, prompt caching, and multi-model orchestration.
18
-
19
- ### Trigger Conditions
20
- - Integrating frontier models: **OpenAI GPT-4o / GPT-4.1 / GPT-5**, **Anthropic Claude 3.7 / Claude 4 Sonnet/Opus**, **Google Gemini 3.1 Pro/Flash/Ultra**, or open-source models (DeepSeek-V3/R2, Llama 4, Qwen 3).
21
- - Implementing **Model Context Protocol (MCP)** server or client integrations (MCP 1.9+).
22
- - Building AI chatbots, copilots, or **autonomous AI agent workflows** (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai, Vercel AI SDK 4.x/5.x).
23
- - Building **agentic memory** systems (short-term, long-term, episodic) using Mem0, MemGPT, or Supabase-backed memory stores.
24
- - Implementing RAG with vector databases (Supabase `pgvector` HNSW, Qdrant, Pinecone, Weaviate).
25
- - Handling real-time AI token streaming via **SSE**, **Web Streams**, or **WebSockets**.
26
- - Designing AI agents with **tool-calling**, **computer use** (browser/OS automation), or **code interpreter** capabilities.
27
-
28
- ### Model Capability Matrix (2026)
29
-
30
- | Provider | Model | Context | Strengths |
31
- |---|---|---|---|
32
- | OpenAI | GPT-4o / GPT-4.1 | 128K | Multimodal, tool-calling, speed |
33
- | OpenAI | GPT-5 | 1M+ | Reasoning, agentic tasks |
34
- | Anthropic | Claude 4 Sonnet | 200K | Coding, long documents, Computer Use |
35
- | Anthropic | Claude 4 Opus | 200K | Complex reasoning, deep analysis |
36
- | Google | Gemini 3.1 Flash | 2M | Speed, cost efficiency, multimodal |
37
- | Google | Gemini 3.1 Pro | 2M | Code, reasoning, deep research |
38
- | Meta | Llama 4 Scout/Maverick | 512K | Open-source, self-hosted |
39
- | DeepSeek | V3 / R2 | 128K | Code, math, cost-efficient |
40
-
41
- ### Core Architecture Guidelines
42
-
43
- #### 1. Model Context Protocol (MCP) Integration (v1.9+)
44
- Standardize agent-tool interactions using MCP. The 2026 standard adds **Streamable HTTP transport** alongside stdio/SSE:
45
- - **MCP Servers**: Expose tools, resources, and prompt templates over JSON-RPC 2.0.
46
- - **Streamable HTTP**: New default transport for cloud-hosted MCP servers — supports bidirectional streaming without long-polling.
47
- - **Security & Scope**: Validate all incoming parameters with Zod schemas. Enforce strict authorization boundaries before executing tool calls.
48
- - **Tool namespacing**: Use `domain/action` naming (`files/read`, `db/query`) to avoid collisions in multi-server environments.
49
-
50
- #### 2. AI Agents SDK Landscape (2026)
51
- Choose the right agentic framework based on your needs:
52
-
53
- | Framework | Best For | Key Feature |
54
- |---|---|---|
55
- | **OpenAI Agents SDK** | GPT-5 native agents | Handoffs, guardrails, tracing built-in |
56
- | **Google ADK** | Gemini-powered agents | Multi-agent, streaming, Vertex AI integration |
57
- | **LangGraph** | Complex stateful workflows | Graph-based, human-in-the-loop, any LLM |
58
- | **Mastra.ai** | TypeScript-first agents | Built-in memory, evals, RAG |
59
- | **Vercel AI SDK 5.x** | Streaming UI + agents | RSC streaming, multi-provider, tool-calling |
60
-
61
- #### 3. Agentic Memory Architecture
62
- Production AI agents require persistent memory across sessions:
63
- - **Short-term (In-context)**: Pass recent conversation turns in the prompt window.
64
- - **Long-term (Vector Store)**: Store user preferences and past interactions as embeddings in `pgvector` or Qdrant; retrieve with semantic similarity.
65
- - **Episodic (Episodic Memory)**: Use **Mem0** or **MemGPT** to give agents human-like recall — automatically summarizes and indexes past interactions.
66
- - **Structured (Knowledge Graph)**: Use a graph DB (Neo4j, Kuzu) for entity relationships and factual memory.
67
-
68
- #### 4. Advanced RAG (Retrieval-Augmented Generation) Pipeline
69
- Build a production-grade RAG pipeline with hybrid search:
70
- 1. **Ingestion**: Chunk documents (500-1000 tokens, 10% overlap, respect semantic headings).
71
- 2. **Embedding**: Use `text-embedding-3-large` (OpenAI), `gemini-embedding-004` (Google), or `nomic-embed-text` (open-source).
72
- 3. **Storage & Hybrid Search**: PostgreSQL `pgvector` (HNSW index) or Qdrant. Combine vector cosine similarity with BM25 full-text search for hybrid retrieval.
73
- 4. **Reranking**: Apply cross-encoder reranker (Cohere Rerank 3, FlashRank) on top-K results.
74
- 5. **Generation**: Inject top contextual snippets into the system prompt with source citations.
75
-
76
- #### 5. Prompt Caching (Cost Optimization)
77
- Reduce costs by 80-90% on repeated long prompts using provider-native caching:
78
- - **Anthropic**: Automatic prompt caching for prompts > 1024 tokens (marked with `cache_control: {"type": "ephemeral"}`).
79
- - **OpenAI**: Automatic prefix caching for prompts > 1024 tokens in GPT-4o and later models.
80
- - **Google**: Context caching in Gemini API via `cachedContent` for large system prompts or documents.
81
-
82
- #### 6. Streaming Responses & Vercel AI SDK 5.x
83
- - **Backend (Next.js/Bun/FastAPI)**: Pipe stream chunks via Web Streams API or SSE.
84
- - **Frontend (React)**: Use Vercel AI SDK `useChat` / `useCompletion` for zero perceived latency.
85
- - **RSC Streaming**: Use AI SDK 5.x `streamUI` to stream React components from the server — agent-rendered UI.
86
-
87
- #### 7. Computer Use & Browser Agents
88
- Modern agents can control browsers and operating systems:
89
- - **Anthropic Computer Use**: Claude 4 can take screenshots and control mouse/keyboard (ideal for browser automation).
90
- - **Browser-Use**: Open-source library for browser-controlling agents with any LLM.
91
- - **Playwright MCP Server**: Expose a full browser to AI agents via MCP tools (`navigate`, `click`, `screenshot`).
92
-
93
- #### 8. Structured Output & Tool Calling
94
- - Use native Tool/Function Calling APIs with strict JSON schemas via Zod (`zodResponseFormat`).
95
- - Prefer **structured output mode** over prompt engineering for JSON — guaranteed schema conformance.
96
- - Support reasoning models (DeepSeek-R2, Gemini 3.1 Pro Thinking, Claude 4 extended thinking) by separating internal `<think>` tokens from client-facing output.
97
-
98
- #### 9. Cost & Rate Limit Management
99
- - Monitor token consumption per session; store metrics in telemetry tables.
100
- - Implement **semantic caching** using Redis + vector similarity to skip redundant model queries.
101
- - Use **batch APIs** (OpenAI Batch, Anthropic Message Batches) for async, high-volume workloads at 50% cost reduction.
102
-
103
- ---
104
-
105
- <a name="bahasa-indonesia"></a>
106
- ## Bahasa Indonesia
107
-
108
- ### Deskripsi
109
- Panduan tingkat produksi untuk mengintegrasikan AI, Model Context Protocol (MCP), dan LLM ke dalam aplikasi modern. Mencakup pipeline RAG, streaming token real-time, eksekusi tool agen AI, arsitektur memori, prompt caching, dan orkestrasi multi-model.
110
-
111
- ### Kondisi Pemicu
112
- - Mengintegrasikan model frontier: GPT-4.1 / GPT-5, Claude 4 Sonnet/Opus, Gemini 3.1 Pro/Flash, atau model open-source (Llama 4, DeepSeek-V3/R2).
113
- - Mengimplementasikan server/klien MCP (v1.9+ dengan Streamable HTTP transport).
114
- - Membangun chatbot AI, copilot, atau alur kerja agen otonom (OpenAI Agents SDK, Google ADK, LangGraph, Mastra.ai).
115
- - Membangun sistem **memori agentik** (jangka pendek, jangka panjang, episodik) menggunakan Mem0 atau pgvector.
116
- - Mengimplementasikan RAG dengan vector database.
117
- - Merancang agen AI dengan tool-calling, Computer Use, atau code interpreter.
118
-
119
- ### Panduan Arsitektur Inti
120
-
121
- #### 1. Integrasi MCP (v1.9+)
122
- Standarisasi interaksi agen-tool menggunakan MCP. Standar 2026 menambahkan **Streamable HTTP transport** transport default baru untuk MCP server yang di-host di cloud, mendukung streaming dua arah tanpa long-polling.
123
-
124
- #### 2. Ekosistem Agents SDK (2026)
125
- - **OpenAI Agents SDK**: Handoffs, guardrails, dan tracing bawaan untuk agen berbasis GPT-5.
126
- - **Google ADK**: Multi-agen, streaming, integrasi Vertex AI untuk agen Gemini.
127
- - **LangGraph**: Alur kerja stateful berbasis graph dengan dukungan human-in-the-loop.
128
- - **Mastra.ai**: Framework TypeScript-first dengan memori, evaluasi, dan RAG bawaan.
129
- - **Vercel AI SDK 5.x**: Streaming UI + agen dengan dukungan multi-provider dan RSC.
130
-
131
- #### 3. Arsitektur Memori Agentik
132
- - **Jangka Pendek**: Riwayat percakapan recent dalam context window.
133
- - **Jangka Panjang (Vector Store)**: Preferensi dan interaksi masa lalu sebagai embedding di pgvector atau Qdrant.
134
- - **Episodik**: Gunakan Mem0 atau MemGPT untuk recall mirip manusia — otomatis merangkum dan mengindeks interaksi lalu.
135
- - **Terstruktur (Knowledge Graph)**: Gunakan graph DB (Neo4j, Kuzu) untuk relasi entitas dan memori faktual.
136
-
137
- #### 4. Pipeline RAG Lanjutan
138
- 1. Chunking dokumen (500-1000 token, 10% overlap).
139
- 2. Embedding dengan `text-embedding-3-large` atau `gemini-embedding-004`.
140
- 3. Penyimpanan & pencarian hibrida: pgvector (HNSW) + BM25.
141
- 4. Reranking dengan Cohere Rerank 3 atau FlashRank.
142
- 5. Injeksi konteks terbaik ke system prompt.
143
-
144
- #### 5. Prompt Caching (Optimasi Biaya)
145
- Kurangi biaya 80-90% dengan caching prompt panjang:
146
- - **Anthropic**: Caching otomatis untuk prompt > 1024 token.
147
- - **OpenAI**: Prefix caching otomatis di GPT-4o ke atas.
148
- - **Google**: Context caching di Gemini API via `cachedContent`.
149
-
150
- #### 6. Streaming & Vercel AI SDK 5.x
151
- Gunakan `useChat` / `useCompletion` untuk zero perceived latency di sisi klien. Gunakan `streamUI` di AI SDK 5.x untuk stream komponen React dari server (agent-rendered UI).
152
-
153
- #### 7. Computer Use & Browser Agents
154
- Claude 4 dapat mengambil screenshot dan mengontrol mouse/keyboard. Gunakan **Browser-Use** atau **Playwright MCP Server** untuk memberi agen kontrol atas browser.
155
-
156
- #### 8. Output Terstruktur & Tool Calling
157
- Gunakan mode structured output (bukan prompt engineering) untuk jaminan kesesuaian skema JSON. Gunakan Zod (`zodResponseFormat`) untuk validasi type-safe.
158
-
159
- #### 9. Manajemen Biaya
160
- - Pantau konsumsi token per sesi di tabel telemetri.
161
- - Terapkan semantic caching dengan Redis + vektor.
162
- - Gunakan Batch API (OpenAI / Anthropic) untuk workload async volume tinggi dengan biaya 50% lebih hemat.
1
+ ---
2
+ name: ai-llm-integration-expert
3
+ description: "Expert guide for integrating Large Language Models (LLMs), Model Context Protocol (MCP), RAG architecture, vector databases, and AI agents / Panduan ahli untuk integrasi LLM, Model Context Protocol (MCP), arsitektur RAG, vector database, dan agen AI."
4
+ author: vibes-plug-swarm
5
+ ---
6
+
7
+ # AI & LLM Integration 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
+ Production-grade guidelines for integrating AI, Model Context Protocol (MCP), and Large Language Models (LLMs) into modern applications. Covers RAG pipelines, vector embeddings, real-time token streaming, agentic tool execution, memory architectures, prompt caching, and multi-model orchestration.
18
+
19
+ ### Trigger Conditions
20
+ - Integrating frontier models: **OpenAI GPT-4o / GPT-4.1 / GPT-5**, **Anthropic Claude 3.7 / Claude 4 Sonnet/Opus**, **Google Gemini 3.1 Pro/Flash/Ultra**, or open-source models (DeepSeek-V3/R2, Llama 4, Qwen 3).
21
+ - Implementing **Model Context Protocol (MCP)** server or client integrations (MCP 1.9+).
22
+ - Building AI chatbots, copilots, or **autonomous AI agent workflows** (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai, Vercel AI SDK 4.x/5.x).
23
+ - Building **agentic memory** systems (short-term, long-term, episodic) using Mem0, MemGPT, or Supabase-backed memory stores.
24
+ - Implementing RAG with vector databases (Supabase `pgvector` HNSW, Qdrant, Pinecone, Weaviate).
25
+ - Handling real-time AI token streaming via **SSE**, **Web Streams**, or **WebSockets**.
26
+ - Designing AI agents with **tool-calling**, **computer use** (browser/OS automation), or **code interpreter** capabilities.
27
+
28
+ ### Model Capability Matrix (2026)
29
+
30
+ | Provider | Model | Context | Strengths |
31
+ |---|---|---|---|
32
+ | OpenAI | GPT-4o / GPT-4.1 | 128K | Multimodal, tool-calling, speed |
33
+ | OpenAI | GPT-5 | 1M+ | Reasoning, agentic tasks |
34
+ | Anthropic | Claude 4 Sonnet | 200K | Coding, long documents, Computer Use |
35
+ | Anthropic | Claude 4 Opus | 200K | Complex reasoning, deep analysis |
36
+ | Google | Gemini 3.1 Flash | 2M | Speed, cost efficiency, multimodal |
37
+ | Google | Gemini 3.1 Pro | 2M | Code, reasoning, deep research |
38
+ | Meta | Llama 4 Scout/Maverick | 512K | Open-source, self-hosted |
39
+ | DeepSeek | V3 / R2 | 128K | Code, math, cost-efficient |
40
+
41
+ ### Core Architecture Guidelines
42
+
43
+ #### 1. Model Context Protocol (MCP) Integration (v1.9+)
44
+ Standardize agent-tool interactions using MCP. The 2026 standard adds **Streamable HTTP transport** alongside stdio/SSE:
45
+ - **MCP Servers**: Expose tools, resources, and prompt templates over JSON-RPC 2.0.
46
+ - **Streamable HTTP**: New default transport for cloud-hosted MCP servers — supports bidirectional streaming without long-polling.
47
+ - **Security & Scope**: Validate all incoming parameters with Zod schemas. Enforce strict authorization boundaries before executing tool calls.
48
+ - **Tool namespacing**: Use `domain/action` naming (`files/read`, `db/query`) to avoid collisions in multi-server environments.
49
+
50
+ #### 2. AI Agents SDK Landscape (2026)
51
+ Choose the right agentic framework based on your needs:
52
+
53
+ | Framework | Best For | Key Feature |
54
+ |---|---|---|
55
+ | **OpenAI Agents SDK** | GPT-5 native agents | Handoffs, guardrails, tracing built-in |
56
+ | **Google ADK** | Gemini-powered agents | Multi-agent, streaming, Vertex AI integration |
57
+ | **LangGraph** | Complex stateful workflows | Graph-based, human-in-the-loop, any LLM |
58
+ | **Mastra.ai** | TypeScript-first agents | Built-in memory, evals, RAG |
59
+ | **Vercel AI SDK 5.x** | Streaming UI + agents | RSC streaming, multi-provider, tool-calling |
60
+
61
+ #### 3. Agentic Memory Architecture
62
+ Production AI agents require persistent memory across sessions:
63
+ - **Short-term (In-context)**: Pass recent conversation turns in the prompt window.
64
+ - **Long-term (Vector Store)**: Store user preferences and past interactions as embeddings in `pgvector` or Qdrant; retrieve with semantic similarity.
65
+ - **Episodic (Episodic Memory)**: Use **Mem0** or **MemGPT** to give agents human-like recall — automatically summarizes and indexes past interactions.
66
+ - **Structured (Knowledge Graph)**: Use a graph DB (Neo4j, Kuzu) for entity relationships and factual memory.
67
+
68
+ #### 4. Advanced RAG (Retrieval-Augmented Generation) Pipeline
69
+ Build a production-grade RAG pipeline with hybrid search:
70
+ 1. **Ingestion**: Chunk documents (500-1000 tokens, 10% overlap, respect semantic headings).
71
+ 2. **Embedding**: Use `text-embedding-3-large` (OpenAI), `gemini-embedding-004` (Google), or `nomic-embed-text` (open-source).
72
+ 3. **Storage & Hybrid Search**: PostgreSQL `pgvector` (HNSW index) or Qdrant. Combine vector cosine similarity with BM25 full-text search for hybrid retrieval.
73
+ 4. **Reranking**: Apply cross-encoder reranker (Cohere Rerank 3, FlashRank) on top-K results.
74
+ 5. **Generation**: Inject top contextual snippets into the system prompt with source citations.
75
+
76
+ #### 5. Prompt Caching (Cost Optimization)
77
+ Reduce costs by 80-90% on repeated long prompts using provider-native caching:
78
+ - **Anthropic**: Automatic prompt caching for prompts > 1024 tokens (marked with `cache_control: {"type": "ephemeral"}`).
79
+ - **OpenAI**: Automatic prefix caching for prompts > 1024 tokens in GPT-4o and later models.
80
+ - **Google**: Context caching in Gemini API via `cachedContent` for large system prompts or documents.
81
+
82
+ #### 6. Streaming Responses & Vercel AI SDK 5.x
83
+ - **Backend (Next.js/Bun/FastAPI)**: Pipe stream chunks via Web Streams API or SSE.
84
+ - **Frontend (React)**: Use Vercel AI SDK `useChat` / `useCompletion` for zero perceived latency.
85
+ - **RSC Streaming**: Use AI SDK 5.x `streamUI` to stream React components from the server — agent-rendered UI.
86
+
87
+ #### 7. Computer Use & Browser Agents
88
+ Modern agents can control browsers and operating systems:
89
+ - **Anthropic Computer Use**: Claude 4 can take screenshots and control mouse/keyboard (ideal for browser automation).
90
+ - **Browser-Use**: Open-source library for browser-controlling agents with any LLM.
91
+ - **Playwright MCP Server**: Expose a full browser to AI agents via MCP tools (`navigate`, `click`, `screenshot`).
92
+
93
+ #### 8. Structured Output & Tool Calling
94
+ - Use native Tool/Function Calling APIs with strict JSON schemas via Zod (`zodResponseFormat`).
95
+ - Prefer **structured output mode** over prompt engineering for JSON — guaranteed schema conformance.
96
+ - Support reasoning models (DeepSeek-R2, Gemini 3.1 Pro Thinking, Claude 4 extended thinking) by separating internal `<think>` tokens from client-facing output.
97
+
98
+ #### 9. Cost & Rate Limit Management
99
+ - Monitor token consumption per session; store metrics in telemetry tables.
100
+ - Implement **semantic caching** using Redis + vector similarity to skip redundant model queries.
101
+ - Use **batch APIs** (OpenAI Batch, Anthropic Message Batches) for async, high-volume workloads at 50% cost reduction.
102
+
103
+ #### 10. Skill Orchestration & Handoff
104
+ - **Upstream Orchestrator**: Executes during **Phase 4** of `zero-to-prod-orchestrator` or after AI decision lock in `brainstorming`.
105
+ - **MCP Server Architecture**: Delegate custom MCP server creation to `mcp-server-architect` and payment tools to `doku-mcp-server`.
106
+ - **Multi-Agent & Swarm Workflows**: Delegate complex agent state graphs to `multi-agent-orchestration` and Gemini long-context optimization to `gemini-agent-booster`.
107
+ - **Vector DB & Hybrid Search**: Delegate pgvector indexing and hybrid search tuning to `vector-db-rag-expert`.
108
+ - **Token Budget & FinOps**: Delegate API cost optimization and prompt caching strategies to `ai-cost-token-optimizer`.
109
+
110
+ ---
111
+
112
+ <a name="bahasa-indonesia"></a>
113
+ ## Bahasa Indonesia
114
+
115
+ ### Deskripsi
116
+ Panduan tingkat produksi untuk mengintegrasikan AI, Model Context Protocol (MCP), dan LLM ke dalam aplikasi modern. Mencakup pipeline RAG, streaming token real-time, eksekusi tool agen AI, arsitektur memori, prompt caching, dan orkestrasi multi-model.
117
+
118
+ ### Kondisi Pemicu
119
+ - Mengintegrasikan model frontier: GPT-4.1 / GPT-5, Claude 4 Sonnet/Opus, Gemini 3.1 Pro/Flash, atau model open-source (Llama 4, DeepSeek-V3/R2).
120
+ - Mengimplementasikan server/klien MCP (v1.9+ dengan Streamable HTTP transport).
121
+ - Membangun chatbot AI, copilot, atau alur kerja agen otonom (OpenAI Agents SDK, Google ADK, LangGraph, Mastra.ai).
122
+ - Membangun sistem **memori agentik** (jangka pendek, jangka panjang, episodik) menggunakan Mem0 atau pgvector.
123
+ - Mengimplementasikan RAG dengan vector database.
124
+ - Merancang agen AI dengan tool-calling, Computer Use, atau code interpreter.
125
+
126
+ ### Panduan Arsitektur Inti
127
+
128
+ #### 1. Integrasi MCP (v1.9+)
129
+ Standarisasi interaksi agen-tool menggunakan MCP. Standar 2026 menambahkan **Streamable HTTP transport** transport default baru untuk MCP server yang di-host di cloud, mendukung streaming dua arah tanpa long-polling.
130
+
131
+ #### 2. Ekosistem Agents SDK (2026)
132
+ - **OpenAI Agents SDK**: Handoffs, guardrails, dan tracing bawaan untuk agen berbasis GPT-5.
133
+ - **Google ADK**: Multi-agen, streaming, integrasi Vertex AI untuk agen Gemini.
134
+ - **LangGraph**: Alur kerja stateful berbasis graph dengan dukungan human-in-the-loop.
135
+ - **Mastra.ai**: Framework TypeScript-first dengan memori, evaluasi, dan RAG bawaan.
136
+ - **Vercel AI SDK 5.x**: Streaming UI + agen dengan dukungan multi-provider dan RSC.
137
+
138
+ #### 3. Arsitektur Memori Agentik
139
+ - **Jangka Pendek**: Riwayat percakapan recent dalam context window.
140
+ - **Jangka Panjang (Vector Store)**: Preferensi dan interaksi masa lalu sebagai embedding di pgvector atau Qdrant.
141
+ - **Episodik**: Gunakan Mem0 atau MemGPT untuk recall mirip manusia — otomatis merangkum dan mengindeks interaksi lalu.
142
+ - **Terstruktur (Knowledge Graph)**: Gunakan graph DB (Neo4j, Kuzu) untuk relasi entitas dan memori faktual.
143
+
144
+ #### 4. Pipeline RAG Lanjutan
145
+ 1. Chunking dokumen (500-1000 token, 10% overlap).
146
+ 2. Embedding dengan `text-embedding-3-large` atau `gemini-embedding-004`.
147
+ 3. Penyimpanan & pencarian hibrida: pgvector (HNSW) + BM25.
148
+ 4. Reranking dengan Cohere Rerank 3 atau FlashRank.
149
+ 5. Injeksi konteks terbaik ke system prompt.
150
+
151
+ #### 5. Prompt Caching (Optimasi Biaya)
152
+ Kurangi biaya 80-90% dengan caching prompt panjang:
153
+ - **Anthropic**: Caching otomatis untuk prompt > 1024 token.
154
+ - **OpenAI**: Prefix caching otomatis di GPT-4o ke atas.
155
+ - **Google**: Context caching di Gemini API via `cachedContent`.
156
+
157
+ #### 6. Streaming & Vercel AI SDK 5.x
158
+ Gunakan `useChat` / `useCompletion` untuk zero perceived latency di sisi klien. Gunakan `streamUI` di AI SDK 5.x untuk stream komponen React dari server (agent-rendered UI).
159
+
160
+ #### 7. Computer Use & Browser Agents
161
+ Claude 4 dapat mengambil screenshot dan mengontrol mouse/keyboard. Gunakan **Browser-Use** atau **Playwright MCP Server** untuk memberi agen kontrol atas browser.
162
+
163
+ #### 8. Output Terstruktur & Tool Calling
164
+ Gunakan mode structured output (bukan prompt engineering) untuk jaminan kesesuaian skema JSON. Gunakan Zod (`zodResponseFormat`) untuk validasi type-safe.
165
+
166
+ #### 9. Manajemen Biaya
167
+ - Pantau konsumsi token per sesi di tabel telemetri.
168
+ - Terapkan semantic caching dengan Redis + vektor.
169
+ - Gunakan Batch API (OpenAI / Anthropic) untuk workload async volume tinggi dengan biaya 50% lebih hemat.
170
+
171
+ #### 10. Orkestrasi Skill & Serah Terima
172
+ - **Orkestrator Utama**: Dieksekusi pada **Fase 4** dari `zero-to-prod-orchestrator` atau setelah finalisasi arsitektur AI di `brainstorming`.
173
+ - **Arsitektur MCP Server**: Delegasikan pembuatan MCP server ke `mcp-server-architect` dan integrasi pembayaran ke `doku-mcp-server`.
174
+ - **Multi-Agent & Swarm Workflows**: Delegasikan alur state graph kompleks ke `multi-agent-orchestration` dan optimasi long-context Gemini ke `gemini-agent-booster`.
175
+ - **Vector DB & Hybrid Search**: Delegasikan indeks pgvector dan pencarian hibrida ke `vector-db-rag-expert`.
176
+ - **Token Budget & FinOps**: Delegasikan optimasi biaya API dan caching prompt ke `ai-cost-token-optimizer`.
177
+
178
+
179
+ ## Orchestration & Integration
180
+ - Integrates with ai-cost-token-optimizer, multi-agent-orchestration, and vector-db-rag-expert.