# New Project

Build a new AI agent with Olakai monitoring from scratch, project setup, SDK...

- Repository: https://github.com/andrewyng/context-hub (13986 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-05-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add andrewyng/context-hub --skill new-project -g -a claude-code -y`
Codex: `npx skills add andrewyng/context-hub --skill new-project -g -a codex -y`
Cursor: `npx skills add andrewyng/context-hub --skill new-project -g -a cursor -y`
Gemini CLI: `npx skills add andrewyng/context-hub --skill new-project -g -a gemini-cli -y`

## Description

Build a new AI agent with Olakai monitoring from scratch, project setup, SDK integration, KPI configuration, and end-to-end validation

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Build a New AI Agent Project with Olakai

This skill guides you through creating a new AI agent that is fully integrated with Olakai for analytics, KPI tracking, and governance.

## Prerequisites

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)

## Why Custom KPIs Are Essential

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:**
- Business outcomes (items processed, success rates, revenue impact)
- Operational data (step counts, retry rates, execution time)
- Quality indicators (error rates, user satisfaction signals)

**Without KPIs configured:**
- No dashboard KPIs beyond basic token counts
- No aggregated performance views
- No alerting thresholds
- No ROI calculations

> **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.

## Understanding the customData to KPI Pipeline

Before diving into implementation, understand how data flows through Olakai:

```
SDK customData → CustomDataConfig (Schema) → Context Variable → KPI Formula → kpiData
```

### How It Works

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

### Critical Rules

The rest: https://github.com/andrewyng/context-hub/blob/HEAD/content/olakai/skills/new-project/SKILL.md
