andrewyng/context-hub/new-project
Claude Code and agent skill by andrewyng/context-hub
- community
Checking that the SKILL.md file is still in the repository.
Build a new AI agent with Olakai monitoring from scratch — project setup, SDK integration, KPI configuration, and end-to-end validation
Install
npx vskill@latest install andrewyng/context-hub/new-projectSKILL.md
The same SKILL.md was published earlier as andrewyng/context-hub/new-project.
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:
- Olakai CLI installed:
npm install -g olakai-cli - CLI authenticated:
olakai login - 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:
How It Works
- customData (SDK): Raw JSON you send with each event
- CustomDataConfig (Platform): Schema defining which fields are processed
- Context Variables: CustomDataConfig fields become available for formulas
- KPI Formula: Expression that computes a value (e.g.,
SuccessRate * 100) - kpiData (Response): Computed KPI values returned with each event
Critical Rules
| 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 |
Built-in Context Variables (Always Available)
| 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 |
Step 1: Design the Agent Architecture
1.1 Determine Agent Type
Agentic AI (Multi-step autonomous workflows):
- Research agents, document processors, data pipelines
- Track as SINGLE events aggregating all internal LLM calls
- Focus on workflow-level KPIs (total tokens, total time, success/failure)
Assistive AI (Interactive chatbots/copilots):
- Customer support agents, coding assistants, Q&A systems
- Track EACH interaction as separate events
- Focus on conversation-level KPIs (per-message tokens, response quality)
1.2 Design Your KPI Schema (CRITICAL)
Design your KPIs BEFORE writing any SDK code. This ensures only meaningful data is sent and tracked.
Step A: Identify Business Questions
What do stakeholders need to know about this agent?
- "How many items does it process per run?"
- "What's the success/failure rate?"
- "How efficient is each execution?"
Step B: Map Questions to Data Fields
| 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) | - |
Step C: Plan Your customData Structure
IMPORTANT: Only include fields you will register as CustomDataConfigs. Unregistered fields are stored but cannot be used in KPIs.
What NOT to Include in customData
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:
- KPI variables — Fields you'll use in formula calculations
- Tagging/filtering — Fields you'll filter by in queries
Step 2: Configure Olakai Platform
2.1 Create a Workflow (Required)
Every agent MUST belong to a workflow, even if it's the only agent in that workflow.
2.2 Create the Agent in Olakai
Agent-Workflow Hierarchy:
2.3 Create Custom Data Configurations (BEFORE Writing SDK Code)
This step MUST be completed before Step 3 (SDK Integration). Only fields registered here can be used in KPI formulas.
ONLY create configs for data you'll use in KPIs or for filtering. Don't create configs for data already tracked automatically.
2.4 Create KPI Definitions
Quick Start with Templates
Instead of writing formulas from scratch, use predefined classifier templates:
Custom Formula KPIs
Step 3: Implement SDK Integration
3.1 TypeScript Implementation
Install dependencies:
Initialize and track:
Agentic workflow with manual event tracking:
`taskExecutionId` — Cross-Agent Task Correlation. Generate ONEtaskExecutionIdper task and share it across all agents in a multi-agent workflow. This links events from different agents into a single logical task for analytics.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcontent/olakai/skills/new-project/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andrewyng/context-hub/new-project)