get-api-docs
Use this skill to get documentation for third-party APIs, SDKs or libraries before writing code that uses them to ensure you have the latest, most accurate…
Build a new AI agent with Olakai monitoring from scratch — project setup, SDK integration, KPI configuration, and end-to-end validation
$ npx -y skills add andrewyng/context-hub --skill new-project --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/new-projectContext preview
The summary Claude sees to decide when to auto-load this skill.
Build a new AI agent with Olakai monitoring from scratch — project setup, SDK integration, KPI configuration, and end-to-end validation
name: new-project description: "Build a new AI agent with Olakai monitoring from scratch — project setup, SDK integration, KPI configuration, and end-to-end validation" metadata: revision: 1 updated-on: "2026-03-10" source: maintainer tags: "olakai,new-project,agent,monitoring,kpi,governance"
This skill guides you through creating a new AI agent that is fully integrated with Olakai for analytics, KPI tracking, and governance.
Before starting, ensure: 1. Olakai CLI installed: `npm install -g olakai-cli` 2. CLI authenticated: `olakai login` 3. API key for SDK (generated per-agent via CLI — see Step 2.2)
Olakai's core value is **tracking business-specific KPIs for your AI agents**. Without KPIs, you're tracking events without gaining actionable insights.
**What you can measure with KPIs:**
**Without KPIs configured:**
> **Every agent should have 2-4 KPIs that answer: "How do I know this agent is performing well?"**
> **KPIs created here belong to this specific agent only.** If you later create additional agents, each one needs its own KPI definitions — KPIs cannot be shared or reused across agents.
Before diving into implementation, understand how data flows through Olakai:
SDK customData → CustomDataConfig (Schema) → Context Variable → KPI Formula → kpiData
1. **customData** (SDK): Raw JSON you send with each event 2. **CustomDataConfig** (Platform): Schema defining which fields are processed 3. **Context Variables**: CustomDataConfig fields become available for formulas 4. **KPI Formula**: Expression that computes a value (e.g., `SuccessRate * 100`) 5. **kpiData** (Response): Computed KPI values returned with each event
| Rule | Consequence | |------|-------------| | Only CustomDataConfig fields become variables | Unregistered customData fields are NOT usable in KPIs | | Formula evaluation is case-insensitive | `stepCount`, `STEPCOUNT`, `StepCount` all work in formulas | | NUMBER configs need numeric values | Don't send `"5"` (string), send `5` (number) | | KPIs are unique per agent | Each KPI belongs to exactly one agent — create separately for each |
| Variable | Type | Description | |----------|------|-------------| | `Prompt` | string | The prompt text sent to the LLM | | `Response` | string | The LLM response text | | `Documents count` | number | Number of attached documents | | `PII detected` | boolean | Whether PII was detected | | `PHI detected` | boolean | Whether PHI was detected | | `CODE detected` | boolean | Whether code was detected | | `SECRET detected` | boolean | Whether secrets were detected |
**Agentic AI** (Multi-step autonomous workflows):
**Assistive AI** (Interactive chatbots/copilots):
**Design your KPIs BEFORE writing any SDK code.** This ensures only meaningful data is sent and tracked.
What do stakeholders need to know about this agent?
| Business Question | Field Name | Type | KPI Formula | Aggregation | |-------------------|------------|------|-------------|-------------| | Throughput | ItemsProcessed | NUMBER | `ItemsProcessed` | SUM | | Reliability | SuccessRate | NUMBER | `SuccessRate * 100` | AVERAGE | | Error count | SuccessRate | NUMBER | `IF(SuccessRate < 1, 1, 0)` | SUM | | Correlation | ExecutionId | STRING | (for filtering only) | - |
// ONLY include fields you'll register as CustomDataConfigs
customData: {
// Business KPIs
ItemsProcessed: number, // Count of items handled
SuccessRate: number, // 0-1 success ratio
// Performance KPIs
StepCount: number, // Number of workflow steps
// Identification (for filtering, not KPIs)
ExecutionId: string, // Correlation ID
}> **IMPORTANT**: Only include fields you will register as CustomDataConfigs. Unregistered fields are stored but **cannot be used in KPIs**.
The Olakai platform automatically tracks these — do NOT duplicate them:
| Already Tracked | Where | Don't Send As customData | |-----------------|-------|--------------------------| | Session ID | Main payload | `sessionId` | | Agent ID | API key association | `agentId` | | User email | `userEmail` parameter | `email`, `userEmail` | | Timestamp | Event metadata | `timestamp`, `createdAt` | | Request time | `requestTime` parameter | `duration`, `latency` | | Token count | `tokens` parameter | `tokenCount` | | Model | Auto-detected | `model`, `modelName` | | Provider | Client config | `provider` |
**customData is ONLY for:** 1. **KPI variables** — Fields you'll use in formula calculations 2. **Tagging/filtering** — Fields you'll filter by in queries
> **Every agent MUST belong to a workflow*
Coding agents hallucinate APIs and forget what they learn in a session. Context Hub gives them curated, versioned docs, plus the ability to get smarter with every task.
Repo: andrewyng/context-hub
Use this skill to get documentation for third-party APIs, SDKs or libraries before writing code that uses them to ensure you have the latest, most accurate…
Use when working with Flutter Bloc/Cubit state management. Covers when to choose Bloc vs Cubit, how to use bloc and flutter_bloc together, lifecycle, testing,…
Use when working with Flutter Riverpod state management. Covers providers, consumers, refs, containers, overrides, async state, code generation, testing, and…
Use this skill for intelligent document processing and content extraction using LandingAI's Agentic Document Extraction (ADE). Trigger when users need to (1)…
Use this skill for building end-to-end document processing workflows and pipelines using LandingAI ADE. Trigger when users need to: (1) Process batches of…
Add Olakai monitoring to existing AI code — wrap your LLM client, configure custom KPIs, and validate the integration end-to-end