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: ai-llm-integration-expert
|
|
3
|
-
|
|
3
|
+
version: "2.8.0"
|
|
4
|
+
description: "Expert guide for integrating Large Language Models (LLMs), Model Context Protocol (MCP v1.x), hybrid reasoning models, RAG architecture, vector databases, and AI agents / Panduan ahli untuk integrasi LLM, Model Context Protocol (MCP), model hybrid reasoning, arsitektur RAG, vector database, dan agen AI."
|
|
4
5
|
author: "Roedy Rustam"
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -14,91 +15,101 @@ author: "Roedy Rustam"
|
|
|
14
15
|
## English
|
|
15
16
|
|
|
16
17
|
### Description
|
|
17
|
-
Production-grade guidelines for integrating AI, Model Context Protocol (MCP), and Large Language Models (LLMs) into modern
|
|
18
|
+
Production-grade guidelines for integrating AI, Model Context Protocol (MCP), hybrid reasoning models, and Large Language Models (LLMs) into modern software architectures. Covers hybrid reasoning token streaming, Streamable HTTP MCP transports, agentic memory architectures, native context caching, RAG pipelines, and multi-model orchestration.
|
|
18
19
|
|
|
19
20
|
### Trigger Conditions
|
|
20
|
-
- Integrating frontier models:
|
|
21
|
-
- Implementing
|
|
22
|
-
- Building AI chatbots, copilots, or
|
|
23
|
-
-
|
|
24
|
-
- Implementing RAG with vector databases (Supabase
|
|
25
|
-
-
|
|
26
|
-
-
|
|
21
|
+
- Integrating frontier reasoning models: Anthropic Claude 3.7 Sonnet (Hybrid/Extended Thinking), Google Gemini 3.8 Flash / 3.1 Pro (Thinking Mode), OpenAI o1 / o3 / o3-mini / GPT-4.5 / GPT-4o, DeepSeek-R1 / V3, or open-source weights (Llama 4, Qwen 2.5/3 Coder).
|
|
22
|
+
- Implementing Model Context Protocol (MCP) server or client integrations with Streamable HTTP transport or MCP Sampling.
|
|
23
|
+
- Building AI chatbots, copilots, or autonomous AI agent workflows (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai, Vercel AI SDK 5.x/6.x).
|
|
24
|
+
- Managing streaming reasoning tokens (`<think>` chunks) separately from final output in user interfaces.
|
|
25
|
+
- Implementing hybrid RAG with vector databases (Supabase pgvector HNSW, Qdrant, Pinecone) and cross-encoder rerankers.
|
|
26
|
+
- Building agentic memory systems (short-term, long-term semantic, episodic) using Mem0 or vector stores.
|
|
27
|
+
- Implementing cost optimization with provider-native Context Caching (Gemini `cachedContent`, Anthropic ephemeral prompt cache, OpenAI prefix cache).
|
|
27
28
|
|
|
28
29
|
### Model Capability Matrix (2026)
|
|
29
30
|
|
|
30
|
-
| Provider | Model | Context |
|
|
31
|
-
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
| DeepSeek | V3
|
|
31
|
+
| Provider | Model | Context | Reasoning Type | Primary Strength |
|
|
32
|
+
|---|---|---|---|---|
|
|
33
|
+
| Anthropic | Claude 3.7 Sonnet | 200K | Hybrid Thinking (Standard + Extended) | Code generation, complex reasoning, Computer Use |
|
|
34
|
+
| Anthropic | Claude 3.5 / 4 Opus | 200K | Deep Deliberation | Deep architectural synthesis, policy analysis |
|
|
35
|
+
| Google | Gemini 3.8 Flash | 1M–2M | Flash Thinking (Configurable Budget) | Ultra-low latency, multimodal live, high-frequency loops |
|
|
36
|
+
| Google | Gemini 3.1 / 3.5 Pro | 2M | Extended Reasoning | Needle-in-a-haystack, long-context repos, deep research |
|
|
37
|
+
| OpenAI | o3 / o3-mini | 200K | Native Test-Time Reasoning | Math, competitive coding, formal logic verification |
|
|
38
|
+
| OpenAI | GPT-4.5 / GPT-4o | 128K | Direct Instruction & Fast Tooling | Low-latency voice, structured JSON, tool-calling |
|
|
39
|
+
| DeepSeek | DeepSeek-R1 | 128K | Open Reasoning (Distill & MoE) | State-of-the-art open weights reasoning, math, coding |
|
|
40
|
+
| DeepSeek | DeepSeek-V3 | 128K | General Multimodal / Text | High throughput, extremely cost-efficient coding |
|
|
41
|
+
| Qwen | Qwen 2.5 / 3 Coder | 128K | Open Source Code Specialist | Self-hosted coding agent, local copilot integration |
|
|
40
42
|
|
|
41
43
|
### Core Architecture Guidelines
|
|
42
44
|
|
|
43
|
-
#### 1.
|
|
44
|
-
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
#### 1. Hybrid Reasoning & Streaming Token Handling
|
|
46
|
+
Modern frontier models emit internal thinking/reasoning tokens during test-time compute:
|
|
47
|
+
- **Thinking Token Separation**: Separate internal `<think>` or reasoning chunks from conversational output. Stream reasoning into collapsible UI accordion blocks while presenting clean output to the user.
|
|
48
|
+
- **Vercel AI SDK 5.x/6.x Integration**:
|
|
49
|
+
```typescript
|
|
50
|
+
import { streamText } from 'ai';
|
|
51
|
+
import { anthropic } from '@ai-sdk/anthropic';
|
|
52
|
+
|
|
53
|
+
const result = streamText({
|
|
54
|
+
model: anthropic('claude-3-7-sonnet-20250219'),
|
|
55
|
+
providerOptions: {
|
|
56
|
+
anthropic: {
|
|
57
|
+
thinking: { type: 'enabled', budgetTokens: 4096 },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
prompt: 'Refactor this distributed consensus engine...',
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Access reasoning stream alongside main text
|
|
64
|
+
for await (const part of result.fullStream) {
|
|
65
|
+
if (part.type === 'reasoning') {
|
|
66
|
+
process.stdout.write(`[Thinking]: ${part.textDelta}`);
|
|
67
|
+
} else if (part.type === 'text-delta') {
|
|
68
|
+
process.stdout.write(part.textDelta);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### 2. Model Context Protocol (MCP) — Streamable HTTP & Sampling
|
|
74
|
+
Standardize all agent-tool and agent-host communications using MCP specifications:
|
|
75
|
+
- **Streamable HTTP Transport**: Modern cloud deployments use Streamable HTTP (bidirectional JSON-RPC streaming over HTTP POST/SSE hybrid) instead of fragile stdio connections.
|
|
76
|
+
- **MCP Sampling**: Allow MCP servers to request LLM completions back from the host client, enabling nested agentic tools without distributing API keys to tool servers.
|
|
77
|
+
- **Authorization & Security**: Enforce OAuth 2.1 scoped bearer tokens on remote MCP endpoints. Validate all incoming tool inputs using strict Zod schemas.
|
|
60
78
|
|
|
61
79
|
#### 3. Agentic Memory Architecture
|
|
62
|
-
Production AI agents require
|
|
63
|
-
- **
|
|
64
|
-
- **Long-
|
|
65
|
-
- **Episodic
|
|
66
|
-
- **
|
|
67
|
-
|
|
68
|
-
#### 4. Advanced RAG
|
|
69
|
-
Build
|
|
70
|
-
1. **Ingestion**: Chunk
|
|
71
|
-
2. **
|
|
72
|
-
3. **
|
|
73
|
-
4. **Reranking**:
|
|
74
|
-
5. **
|
|
75
|
-
|
|
76
|
-
#### 5.
|
|
77
|
-
|
|
78
|
-
- **Anthropic**:
|
|
79
|
-
- **OpenAI**:
|
|
80
|
-
- **Google**:
|
|
81
|
-
|
|
82
|
-
#### 6.
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
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.
|
|
80
|
+
Production AI agents require multi-layered memory:
|
|
81
|
+
- **In-Context Working Memory**: Pass recent turn messages within the prompt window.
|
|
82
|
+
- **Long-Term Semantic Memory**: Embed user preferences and facts using pgvector (HNSW index) or Qdrant; perform cosine similarity searches.
|
|
83
|
+
- **Episodic Memory (Mem0 / MemGPT)**: Automatically synthesize session checkpoints and index past user decisions for human-like recall.
|
|
84
|
+
- **Knowledge Graph Memory**: Maintain structured entity-relationship triples (using Graph DB or relational junction tables) for multi-hop relationship retrieval.
|
|
85
|
+
|
|
86
|
+
#### 4. Advanced RAG & Late Chunking Pipeline
|
|
87
|
+
Build high-precision RAG pipelines:
|
|
88
|
+
1. **Document Ingestion**: Chunk semantically (500–1000 tokens) with 10% overlap, or apply *Late Chunking* (chunking after full document contextual embedding).
|
|
89
|
+
2. **Embeddings**: Utilize `text-embedding-3-large`, `gemini-embedding-004`, or local `bge-large-en-v1.5`.
|
|
90
|
+
3. **Hybrid Search**: Combine dense vector cosine similarity with sparse BM25 / PostgreSQL `tsvector` queries.
|
|
91
|
+
4. **Cross-Encoder Reranking**: Reorder top-K candidates using Cohere Rerank 3 or FlashRank before feeding into the prompt.
|
|
92
|
+
5. **Context Window vs RAG Decision**: If document sets fit comfortably under 200k tokens and are queried repeatedly, prefer **Native Context Caching** over RAG chunking to eliminate retrieval boundary errors.
|
|
93
|
+
|
|
94
|
+
#### 5. Native Context Caching (Cost & Latency Optimization)
|
|
95
|
+
Leverage provider-native context caching for large, repeated context (>32k tokens):
|
|
96
|
+
- **Anthropic**: Use ephemeral prompt caching with `cache_control: { type: "ephemeral" }` on system prompts and tools.
|
|
97
|
+
- **OpenAI**: Take advantage of automatic prefix caching for matching prompt prefixes >1024 tokens.
|
|
98
|
+
- **Google Gemini**: Explicitly create and reuse cached content via `cachedContent` API for huge repositories, reducing costs up to 90%.
|
|
99
|
+
|
|
100
|
+
#### 6. Structured Output & Guardrails
|
|
101
|
+
- Utilize native Structured Outputs (`response_format: { type: "json_schema" }`) guaranteed by model token-level grammar masks.
|
|
102
|
+
- Use Zod schemas to define tool parameters and final structured entities.
|
|
103
|
+
- Implement rate limiting, circuit breakers, and semantic caching (Redis / Upstash vector cache) to prevent runaway recursive tool loops.
|
|
104
|
+
|
|
105
|
+
## Orchestration & Integration
|
|
106
|
+
- **`mcp-server-architect`**: Delegate custom MCP server implementation, schema definitions, and transport adapters.
|
|
107
|
+
- **`multi-agent-orchestration`**: Delegate complex multi-agent state graphs, swarm workflows, and supervisor patterns.
|
|
108
|
+
- **`gemini-agent-booster`**: Delegate Gemini 3.x long-context optimization, Multimodal Live API, and thinking budget controls.
|
|
109
|
+
- **`ai-prompt-engineering-expert`**: Delegate advanced prompt design, few-shot calibration, and system prompt evals.
|
|
110
|
+
- **`ai-cost-token-optimizer`**: Delegate API cost optimization, model routing, and token budget management.
|
|
111
|
+
- **`vector-db-rag-expert`**: Delegate pgvector HNSW indexing and hybrid retrieval fine-tuning.
|
|
112
|
+
- **`zero-to-prod-orchestrator`**: Executes this skill during Phase 4 architecture and implementation.
|
|
102
113
|
|
|
103
114
|
---
|
|
104
115
|
|
|
@@ -106,57 +117,71 @@ Modern agents can control browsers and operating systems:
|
|
|
106
117
|
## Bahasa Indonesia
|
|
107
118
|
|
|
108
119
|
### Deskripsi
|
|
109
|
-
Panduan tingkat produksi untuk mengintegrasikan AI, Model Context Protocol (MCP), dan LLM ke dalam
|
|
120
|
+
Panduan tingkat produksi untuk mengintegrasikan AI, Model Context Protocol (MCP), model hybrid reasoning, dan Large Language Models (LLM) ke dalam arsitektur perangkat lunak modern. Mencakup penanganan streaming token penalaran, transport MCP Streamable HTTP, arsitektur memori agentik, context caching native, pipeline RAG, dan orkestrasi multi-model.
|
|
110
121
|
|
|
111
122
|
### Kondisi Pemicu
|
|
112
|
-
- Mengintegrasikan model frontier:
|
|
113
|
-
- Mengimplementasikan server
|
|
114
|
-
- Membangun chatbot AI, copilot, atau
|
|
115
|
-
-
|
|
116
|
-
- Mengimplementasikan RAG dengan
|
|
117
|
-
-
|
|
123
|
+
- Mengintegrasikan model frontier reasoning: Anthropic Claude 3.7 Sonnet (Hybrid/Extended Thinking), Google Gemini 3.8 Flash / 3.1 Pro (Thinking Mode), OpenAI o1 / o3 / o3-mini / GPT-4.5 / GPT-4o, DeepSeek-R1 / V3, atau bobot open-source (Llama 4, Qwen 2.5/3 Coder).
|
|
124
|
+
- Mengimplementasikan server atau klien Model Context Protocol (MCP) dengan transport Streamable HTTP atau MCP Sampling.
|
|
125
|
+
- Membangun chatbot AI, copilot, atau workflow agen otonom (LangGraph, OpenAI Agents SDK, Google ADK, Mastra.ai, Vercel AI SDK 5.x/6.x).
|
|
126
|
+
- Mengelola streaming token penalaran (`<think>`) secara terpisah dari output akhir pada tampilan antarmuka pengguna.
|
|
127
|
+
- Mengimplementasikan RAG hibrida dengan database vektor (Supabase pgvector HNSW, Qdrant, Pinecone) dan reranker cross-encoder.
|
|
128
|
+
- Membangun sistem memori agentik (jangka pendek, semantik jangka panjang, episodik) menggunakan Mem0 atau vector store.
|
|
129
|
+
- Menerapkan optimasi biaya dengan Context Caching native provider (Gemini `cachedContent`, Anthropic ephemeral prompt cache, OpenAI prefix cache).
|
|
130
|
+
|
|
131
|
+
### Matriks Kapabilitas Model (2026)
|
|
132
|
+
|
|
133
|
+
| Provider | Model | Konteks | Tipe Penalaran | Keunggulan Utama |
|
|
134
|
+
|---|---|---|---|---|
|
|
135
|
+
| Anthropic | Claude 3.7 Sonnet | 200K | Hybrid Thinking (Standar + Diperpanjang) | Generasi kode, penalaran kompleks, Computer Use |
|
|
136
|
+
| Anthropic | Claude 3.5 / 4 Opus | 200K | Deliberasi Mendalam | Sintesis arsitektur mendalam, analisis kebijakan |
|
|
137
|
+
| Google | Gemini 3.8 Flash | 1M–2M | Flash Thinking (Budget Terkonfigurasi) | Latensi ultra-rendah, multimodal live, loop cepat |
|
|
138
|
+
| Google | Gemini 3.1 / 3.5 Pro | 2M | Extended Reasoning | Needle-in-a-haystack, repo konteks panjang, riset |
|
|
139
|
+
| OpenAI | o3 / o3-mini | 200K | Test-Time Reasoning Native | Matematika, competitive coding, verifikasi logika |
|
|
140
|
+
| OpenAI | GPT-4.5 / GPT-4o | 128K | Instruksi Langsung & Tooling Cepat | Suara latensi rendah, JSON terstruktur, tool calling |
|
|
141
|
+
| DeepSeek | DeepSeek-R1 | 128K | Open Reasoning (Distill & MoE) | Penalaran open weights terdepan, matematika, koding |
|
|
142
|
+
| DeepSeek | DeepSeek-V3 | 128K | Teks & Multimodal Umum | Throughput tinggi, sangat hemat biaya untuk coding |
|
|
143
|
+
| Qwen | Qwen 2.5 / 3 Coder | 128K | Spesialis Kode Open Source | Agen coding mandiri / self-hosted, copilot lokal |
|
|
118
144
|
|
|
119
145
|
### Panduan Arsitektur Inti
|
|
120
146
|
|
|
121
|
-
#### 1.
|
|
122
|
-
|
|
147
|
+
#### 1. Hybrid Reasoning & Penanganan Token Streaming
|
|
148
|
+
Model frontier modern menghasilkan token pemikiran (*thinking tokens*) selama proses penalaran:
|
|
149
|
+
- **Pemisahan Token Pemikiran**: Pisahkan blok `<think>` dari output teks akhir. Alirkan proses pemikiran ke dalam accordion UI yang dapat dibuka/tutup, sementara output utama disajikan dengan bersih kepada user.
|
|
150
|
+
- **Integrasi Vercel AI SDK 5.x/6.x**: Gunakan event listener `reasoning` pada stream untuk menangkap proses pemikiran model secara terpisah dari `text-delta`.
|
|
123
151
|
|
|
124
|
-
#### 2.
|
|
125
|
-
|
|
126
|
-
- **
|
|
127
|
-
- **
|
|
128
|
-
- **
|
|
129
|
-
- **Vercel AI SDK 5.x**: Streaming UI + agen dengan dukungan multi-provider dan RSC.
|
|
152
|
+
#### 2. Model Context Protocol (MCP) — Streamable HTTP & Sampling
|
|
153
|
+
Standarisasi seluruh komunikasi agen-ke-tool dan agen-ke-host menggunakan spesifikasi MCP:
|
|
154
|
+
- **Streamable HTTP Transport**: Standar cloud modern yang mendukung streaming dua arah JSON-RPC via HTTP POST/SSE hybrid tanpa ketergantungan koneksi stdio lokal.
|
|
155
|
+
- **MCP Sampling**: Memberikan izin kepada server MCP untuk meminta inferensi LLM kembali ke klien host, memungkinkan alat agentik modular tanpa membagikan API key sensitif.
|
|
156
|
+
- **Keamanan & Otorisasi**: Wajibkan bearer token berbasis OAuth 2.1 pada endpoint MCP publik dan validasi skema input dengan Zod.
|
|
130
157
|
|
|
131
158
|
#### 3. Arsitektur Memori Agentik
|
|
132
|
-
- **
|
|
133
|
-
- **Jangka Panjang
|
|
134
|
-
- **Episodik
|
|
135
|
-
- **
|
|
136
|
-
|
|
137
|
-
#### 4. Pipeline RAG Lanjutan
|
|
138
|
-
1.
|
|
139
|
-
2. Embedding
|
|
140
|
-
3.
|
|
141
|
-
4. Reranking
|
|
142
|
-
5.
|
|
143
|
-
|
|
144
|
-
#### 5.
|
|
145
|
-
|
|
146
|
-
- **
|
|
147
|
-
- **
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
- Terapkan semantic caching dengan Redis + vektor.
|
|
162
|
-
- Gunakan Batch API (OpenAI / Anthropic) untuk workload async volume tinggi dengan biaya 50% lebih hemat.
|
|
159
|
+
- **Memori Kerja In-Context**: Teruskan histori interaksi terbaru di jendela konteks.
|
|
160
|
+
- **Memori Semantik Jangka Panjang**: Simpan fakta dan preferensi pengguna di pgvector (indeks HNSW) atau Qdrant dengan pencarian kesamaan kosinus.
|
|
161
|
+
- **Memori Episodik (Mem0 / MemGPT)**: Sintesiskan ringkasan sesi secara berkala agar agen memiliki daya ingat historis jangka panjang.
|
|
162
|
+
- **Memori Graph Pengetahuan**: Hubungkan entitas relasional dalam basis data graf untuk kueri multi-langkah (*multi-hop reasoning*).
|
|
163
|
+
|
|
164
|
+
#### 4. Pipeline RAG Lanjutan & Late Chunking
|
|
165
|
+
1. **Ingesti Dokumen**: Bagi dokumen secara semantik (500–1000 token, 10% overlap) atau gunakan metode *Late Chunking*.
|
|
166
|
+
2. **Embedding**: Gunakan `text-embedding-3-large` atau `gemini-embedding-004`.
|
|
167
|
+
3. **Pencarian Hibrida**: Kombinasikan dense vector cosine similarity dengan sparse keyword BM25 / PostgreSQL full-text search.
|
|
168
|
+
4. **Cross-Encoder Reranking**: Susun ulang kandidat terbaik menggunakan Cohere Rerank 3 atau FlashRank sebelum diteruskan ke system prompt.
|
|
169
|
+
5. **Keputusan Cache vs RAG**: Jika dokumen stabil dan berada di bawah 200k token, utamakan **Context Caching Native** daripada RAG chunking untuk menghindari hilangnya konteks di perbatasan potongan teks.
|
|
170
|
+
|
|
171
|
+
#### 5. Context Caching Native (Optimasi Biaya & Latensi)
|
|
172
|
+
- **Anthropic**: Terapkan prompt caching ephemeral dengan `cache_control: { type: "ephemeral" }`.
|
|
173
|
+
- **OpenAI**: Manfaatkan prefix caching otomatis untuk teks berulang >1024 token.
|
|
174
|
+
- **Google Gemini**: Buat objek cache eksplisit via API `cachedContent` untuk repositori kode besar guna menghemat hingga 90% biaya input token.
|
|
175
|
+
|
|
176
|
+
#### 6. Output Terstruktur & Guardrails
|
|
177
|
+
- Manfaatkan mode Structured Outputs native model dengan skema Zod untuk menjamin integritas JSON.
|
|
178
|
+
- Terapkan rate limiting, circuit breaker, dan semantic caching (Redis / Upstash) untuk mencegah pemanggilan tool secara rekursif tak berujung.
|
|
179
|
+
|
|
180
|
+
## Integrasi Orkestrasi
|
|
181
|
+
- **`mcp-server-architect`**: Delegasikan pembuatan server MCP kustom, definisi skema, dan transport adapter.
|
|
182
|
+
- **`multi-agent-orchestration`**: Delegasikan alur kerja graph multi-agen, topologi swarm, dan pattern supervisor.
|
|
183
|
+
- **`gemini-agent-booster`**: Delegasikan optimasi long-context Gemini 3.x, Multimodal Live API, dan kontrol thinking budget.
|
|
184
|
+
- **`ai-prompt-engineering-expert`**: Delegasikan desain prompt lanjutan, kalibrasi few-shot, dan evaluasi prompt.
|
|
185
|
+
- **`ai-cost-token-optimizer`**: Delegasikan optimasi biaya API, routing model cerdas, dan token budget.
|
|
186
|
+
- **`vector-db-rag-expert`**: Delegasikan tuning indeks HNSW pgvector dan pencarian hibrida.
|
|
187
|
+
- **`zero-to-prod-orchestrator`**: Mengeksekusi skill ini pada Fase 4 perancangan arsitektur dan implementasi.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-media-generation-expert
|
|
3
|
+
description: "Expert guide for AI image generation (Flux, DALL-E, Stable Diffusion), video generation (Sora, Runway), voice synthesis (ElevenLabs TTS), and speech recognition (Whisper STT) integration / Panduan ahli integrasi AI generasi gambar, video, suara (TTS), dan pengenalan suara (STT)."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI Media Generation Expert (2026 Edition)
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Orchestration & Integration
|
|
17
|
+
- **`ai-llm-integration-expert`**: Core LLM patterns and model selection.
|
|
18
|
+
- **`file-upload-media-expert`**: Storage, CDN, and media pipeline for generated assets.
|
|
19
|
+
- **`sse-websocket-streaming-expert`**: Real-time streaming for progressive image/audio generation.
|
|
20
|
+
- **`async-queue-temporal-expert`**: Background job processing for long-running generation tasks.
|
|
21
|
+
- **`zero-trust-secret-vault`**: Secure API key management for Replicate, OpenAI, ElevenLabs.
|
|
22
|
+
|
|
23
|
+
### Description
|
|
24
|
+
Production-grade guide for integrating AI-powered media generation into web and mobile applications. Covers image generation (Flux 1.1 Pro, SDXL, DALL-E 3), video generation (Sora, Runway Gen-3), text-to-speech (ElevenLabs v3, OpenAI TTS), speech-to-text (Whisper large-v3, Deepgram Nova-3), and voice cloning. Includes async processing patterns, cost optimization, and content safety filtering.
|
|
25
|
+
|
|
26
|
+
### Trigger Conditions
|
|
27
|
+
- Integrating AI image generation (Flux, DALL-E, Stable Diffusion, Midjourney API).
|
|
28
|
+
- Building text-to-speech or speech-to-text features.
|
|
29
|
+
- Implementing voice cloning or AI avatar generation.
|
|
30
|
+
- Adding AI video generation or editing capabilities.
|
|
31
|
+
- Building media processing pipelines with AI models.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### Core Architecture
|
|
36
|
+
|
|
37
|
+
#### 1. Image Generation
|
|
38
|
+
|
|
39
|
+
**Provider Selection Matrix:**
|
|
40
|
+
|
|
41
|
+
| Provider | Model | Speed | Quality | Cost | Best For |
|
|
42
|
+
|----------|-------|-------|---------|------|----------|
|
|
43
|
+
| Replicate | Flux 1.1 Pro | ~3s | ★★★★★ | $0.04/img | Photorealism, text rendering |
|
|
44
|
+
| Replicate | Flux Schnell | ~1s | ★★★★ | $0.003/img | High-volume, previews |
|
|
45
|
+
| OpenAI | DALL-E 3 | ~5s | ★★★★ | $0.04/img | Creative, prompt following |
|
|
46
|
+
| Stability | SDXL Turbo | ~2s | ★★★★ | $0.002/img | Self-hosted, customization |
|
|
47
|
+
|
|
48
|
+
**Recommendation:** Use **Flux 1.1 Pro** via Replicate for production quality. Use **Flux Schnell** for previews/drafts.
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// Image generation with Replicate (Flux)
|
|
52
|
+
import Replicate from 'replicate';
|
|
53
|
+
|
|
54
|
+
const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN });
|
|
55
|
+
|
|
56
|
+
async function generateImage(prompt: string, options?: {
|
|
57
|
+
width?: number;
|
|
58
|
+
height?: number;
|
|
59
|
+
model?: 'flux-1.1-pro' | 'flux-schnell';
|
|
60
|
+
}) {
|
|
61
|
+
const model = options?.model ?? 'flux-1.1-pro';
|
|
62
|
+
const output = await replicate.run(
|
|
63
|
+
`black-forest-labs/${model}`,
|
|
64
|
+
{
|
|
65
|
+
input: {
|
|
66
|
+
prompt,
|
|
67
|
+
width: options?.width ?? 1024,
|
|
68
|
+
height: options?.height ?? 1024,
|
|
69
|
+
num_inference_steps: model === 'flux-schnell' ? 4 : 28,
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
return output; // URL to generated image
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### 2. Text-to-Speech (TTS)
|
|
78
|
+
|
|
79
|
+
**Provider Selection:**
|
|
80
|
+
|
|
81
|
+
| Provider | Model | Latency | Expressiveness | Cost |
|
|
82
|
+
|----------|-------|---------|----------------|------|
|
|
83
|
+
| ElevenLabs | eleven_v3 | ~500ms | ★★★★★ | $0.30/1K chars |
|
|
84
|
+
| ElevenLabs | eleven_flash_v2_5 | ~200ms | ★★★★ | $0.15/1K chars |
|
|
85
|
+
| OpenAI | tts-1-hd | ~300ms | ★★★ | $0.030/1K chars |
|
|
86
|
+
|
|
87
|
+
**Recommendation:** Use **ElevenLabs eleven_v3** for expressive content. Use **eleven_flash_v2_5** for real-time chatbots.
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
// ElevenLabs TTS streaming
|
|
91
|
+
async function textToSpeech(text: string, voiceId: string): Promise<ReadableStream> {
|
|
92
|
+
const response = await fetch(
|
|
93
|
+
`https://api.elevenlabs.io/v1/text-to-speech/${voiceId}/stream`,
|
|
94
|
+
{
|
|
95
|
+
method: 'POST',
|
|
96
|
+
headers: {
|
|
97
|
+
'xi-api-key': process.env.ELEVENLABS_API_KEY!,
|
|
98
|
+
'Content-Type': 'application/json',
|
|
99
|
+
},
|
|
100
|
+
body: JSON.stringify({
|
|
101
|
+
text,
|
|
102
|
+
model_id: 'eleven_v3',
|
|
103
|
+
voice_settings: { stability: 0.5, similarity_boost: 0.75 },
|
|
104
|
+
}),
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
return response.body!; // Stream audio chunks
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### 3. Speech-to-Text (STT)
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
// OpenAI Whisper transcription
|
|
115
|
+
import OpenAI from 'openai';
|
|
116
|
+
|
|
117
|
+
const openai = new OpenAI();
|
|
118
|
+
|
|
119
|
+
async function transcribeAudio(audioFile: File) {
|
|
120
|
+
const transcription = await openai.audio.transcriptions.create({
|
|
121
|
+
file: audioFile,
|
|
122
|
+
model: 'whisper-1',
|
|
123
|
+
response_format: 'verbose_json',
|
|
124
|
+
timestamp_granularities: ['word', 'segment'],
|
|
125
|
+
});
|
|
126
|
+
return transcription;
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### 4. Video Generation
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
// Replicate video generation (async with webhook)
|
|
134
|
+
async function generateVideo(prompt: string) {
|
|
135
|
+
const prediction = await replicate.predictions.create({
|
|
136
|
+
model: 'minimax/video-01',
|
|
137
|
+
input: { prompt, duration: 5 },
|
|
138
|
+
webhook: `${process.env.APP_URL}/api/webhooks/replicate`,
|
|
139
|
+
webhook_events_filter: ['completed'],
|
|
140
|
+
});
|
|
141
|
+
return prediction.id; // Poll or wait for webhook
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### 5. Production Patterns
|
|
146
|
+
|
|
147
|
+
- **Async Processing:** Always use background jobs (BullMQ, Inngest) for generation tasks >2s.
|
|
148
|
+
- **Webhook Architecture:** Use webhooks for Replicate predictions instead of polling.
|
|
149
|
+
- **Content Safety:** Implement NSFW filtering (OpenAI Moderation API, Replicate safety checker).
|
|
150
|
+
- **Cost Control:** Set per-user daily limits. Cache identical prompts. Use cheaper models for drafts.
|
|
151
|
+
- **Storage Pipeline:** Generate → upload to S3/R2 → serve via CDN → store URL in DB.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
<a name="bahasa-indonesia"></a>
|
|
156
|
+
## Bahasa Indonesia
|
|
157
|
+
|
|
158
|
+
### Integrasi Orkestrasi
|
|
159
|
+
- **`ai-llm-integration-expert`**: Pola LLM inti dan pemilihan model.
|
|
160
|
+
- **`file-upload-media-expert`**: Penyimpanan, CDN, dan pipeline media untuk aset yang dihasilkan.
|
|
161
|
+
- **`sse-websocket-streaming-expert`**: Streaming real-time untuk generasi gambar/audio progresif.
|
|
162
|
+
- **`async-queue-temporal-expert`**: Pemrosesan job latar belakang untuk tugas generasi yang lama.
|
|
163
|
+
|
|
164
|
+
### Deskripsi
|
|
165
|
+
Panduan tingkat produksi untuk mengintegrasikan generasi media berbasis AI ke dalam aplikasi web dan mobile. Mencakup generasi gambar (Flux 1.1 Pro, SDXL, DALL-E 3), generasi video (Sora, Runway Gen-3), text-to-speech (ElevenLabs v3, OpenAI TTS), speech-to-text (Whisper large-v3, Deepgram Nova-3), dan kloning suara.
|
|
166
|
+
|
|
167
|
+
### Kondisi Pemicu
|
|
168
|
+
- Mengintegrasikan generasi gambar AI (Flux, DALL-E, Stable Diffusion).
|
|
169
|
+
- Membangun fitur text-to-speech atau speech-to-text.
|
|
170
|
+
- Mengimplementasikan kloning suara atau generasi avatar AI.
|
|
171
|
+
- Menambahkan kemampuan generasi atau editing video AI.
|
|
172
|
+
- Membangun pipeline pemrosesan media dengan model AI.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-prompt-engineering-expert
|
|
3
|
+
description: "Expert guide for systematic Prompt Engineering, Chain-of-Thought, few-shot prompting, structured output (JSON mode), prompt versioning, and LLM evaluation / Panduan ahli rekayasa prompt dan evaluasi LLM."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI Prompt Engineering Expert
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
A specialized guide focused purely on the *craft* of interacting with Large Language Models (LLMs). While `ai-llm-integration-expert` covers the architecture (RAG, Vector DBs, APIs), this skill covers how to write, version, evaluate, and defend prompts. It focuses on maximizing accuracy and reliability from foundation models (Claude, GPT-4, Llama 3, Gemini).
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- When writing complex system prompts for autonomous AI agents.
|
|
21
|
+
- When an LLM is hallucinating or returning poorly formatted data.
|
|
22
|
+
- When the user asks about "Chain-of-Thought", "few-shot", or "JSON mode".
|
|
23
|
+
- When building a prompt testing and evaluation pipeline (e.g., using LangSmith or Braintrust).
|
|
24
|
+
- When defending an application against Prompt Injection attacks.
|
|
25
|
+
|
|
26
|
+
### Core Architectural Guidelines
|
|
27
|
+
|
|
28
|
+
#### 1. Structured Output (JSON Mode & Tool Calling)
|
|
29
|
+
Never rely on prompt instructions alone to get JSON. Always use the model's native Tool Calling/Function Calling capabilities or Structured Output mode (e.g., passing a JSON Schema).
|
|
30
|
+
- **Zod**: Use Zod to define your desired schema in TypeScript, then convert it to JSON Schema for the LLM. Parse the response back through Zod to guarantee type safety.
|
|
31
|
+
|
|
32
|
+
#### 2. Advanced Prompting Techniques
|
|
33
|
+
- **Chain-of-Thought (CoT)**: Force the model to think before it acts. Provide a `<thinking>` tag for the model to use before it outputs the final answer.
|
|
34
|
+
- **Few-Shot Prompting**: Provide 2-3 highly varied examples of the input-output pairs you expect.
|
|
35
|
+
- **Clear Boundaries**: Use XML tags to separate instructions from user input to prevent confusion (e.g., `<user_input>`, `<system_rules>`).
|
|
36
|
+
|
|
37
|
+
#### 3. Defense Against Prompt Injection
|
|
38
|
+
- Never trust user input. If you are building a tool that summarizes user-provided text, wrap the text tightly in delimiters and instruct the model to ignore any instructions within those delimiters.
|
|
39
|
+
- Keep system prompts isolated from the user's direct chat window.
|
|
40
|
+
|
|
41
|
+
#### 4. Prompt Versioning & Evaluation
|
|
42
|
+
- Prompts are code. Do not hardcode massive prompts directly in your application logic. Store them in version control (or a Prompt CMS like LangSmith).
|
|
43
|
+
- Build automated evaluation suites using LLM-as-a-Judge to score whether a change in the prompt improved or degraded performance on a golden dataset.
|
|
44
|
+
|
|
45
|
+
## Orchestration & Integration
|
|
46
|
+
- Enhances `ai-llm-integration-expert` with high-quality, reliable prompt designs.
|
|
47
|
+
- Crucial for `gemini-agent-booster` when creating multi-agent swarms with distinct system personalities.
|
|
48
|
+
- Pairs with `autonomous-red-teamer` to penetration test prompts against injection attacks.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
<a name="bahasa-indonesia"></a>
|
|
53
|
+
## Bahasa Indonesia
|
|
54
|
+
|
|
55
|
+
### Deskripsi
|
|
56
|
+
Panduan khusus yang berfokus murni pada *seni dan sains* berinteraksi dengan Large Language Models (LLMs). Berbeda dengan `ai-llm-integration-expert` yang fokus pada infrastruktur (RAG, API), skill ini membahas cara menulis, memberikan versi, mengevaluasi, dan melindungi prompt untuk memaksimalkan akurasi model dasar.
|
|
57
|
+
|
|
58
|
+
### Kondisi Pemicu
|
|
59
|
+
- Saat menyusun system prompt yang kompleks untuk agen AI otonom.
|
|
60
|
+
- Saat LLM berhalusinasi atau mengembalikan data dengan format yang salah.
|
|
61
|
+
- Saat Anda perlu menjamin output berformat JSON yang ketat.
|
|
62
|
+
- Saat melindungi aplikasi dari serangan *Prompt Injection*.
|
|
63
|
+
|
|
64
|
+
### Panduan Arsitektur Inti
|
|
65
|
+
|
|
66
|
+
#### 1. Output Terstruktur (Structured Output)
|
|
67
|
+
Jangan hanya menyuruh model "berikan output JSON" di dalam teks prompt. Gunakan fitur *Tool Calling* / *Function Calling* bawaan model, atau berikan JSON Schema yang ketat. Gunakan Zod (di TypeScript) atau Pydantic (di Python) untuk memvalidasi output tersebut.
|
|
68
|
+
|
|
69
|
+
#### 2. Teknik Prompting Lanjutan
|
|
70
|
+
- **Chain-of-Thought (CoT)**: Selalu instruksikan model untuk "berpikir" terlebih dahulu sebelum memberikan jawaban akhir. Minta model untuk menuliskan alur logikanya di dalam tag `<thinking>`.
|
|
71
|
+
- **Few-Shot**: Berikan 2-3 contoh input dan output (contoh positif maupun negatif) agar model memahami pola yang Anda inginkan.
|
|
72
|
+
- **Pembatasan (Delimiters)**: Gunakan tag XML (`<aturan>`, `<data_pengguna>`) untuk memisahkan instruksi dari data mentah.
|
|
73
|
+
|
|
74
|
+
#### 3. Pertahanan Terhadap Prompt Injection
|
|
75
|
+
- Jika aplikasi Anda memproses teks dari pengguna eksternal (misal: ringkasan email), selalu bungkus teks tersebut dengan tag XML dan beri peringatan eksplisit pada model untuk mengabaikan instruksi apa pun yang berada di dalam tag tersebut.
|
|
76
|
+
|
|
77
|
+
#### 4. Versioning & Evaluasi
|
|
78
|
+
- Prompt adalah kode sumber (source code). Simpan dalam *version control* atau *Prompt Management System*.
|
|
79
|
+
- Buat pipeline evaluasi (LLM-as-a-Judge) untuk mengukur secara kuantitatif apakah perubahan prompt Anda meningkatkan atau menurunkan kualitas hasil.
|
|
80
|
+
|
|
81
|
+
## Integrasi Orkestrasi
|
|
82
|
+
- Melengkapi `ai-llm-integration-expert` dengan desain prompt berkualitas tinggi.
|
|
83
|
+
- Sangat penting bagi `gemini-agent-booster` saat mengonfigurasi kepribadian agen yang berbeda-beda.
|
|
84
|
+
- Bekerja sama dengan `autonomous-red-teamer` untuk menguji ketahanan prompt dari serangan.
|