skills/olakai-planning/SKILL.md
Create detailed implementation plans for Olakai monitoring that can be executed independently. AUTO-INVOKE when: Creating a plan for Olakai monitoring, writing implementation steps for AI observability, planning agent creation or SDK integration, entering plan mode for Olakai work, designing monitoring architecture. TRIGGER KEYWORDS: plan, implementation plan, steps, roadmap, architecture, design, olakai plan, monitoring plan, agent plan, planning, plan mode. DO NOT load for: Executing implementation (use olakai-new-project or olakai-integrate), troubleshooting (use olakai-troubleshoot), generating reports (use olakai-reports).
npx skillsauth add olakai-ai/olakai-skills olakai-planningInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are creating a plan for Olakai AI monitoring that will be executed by an agent WITHOUT your current context. After plan approval, context may be cleared. The executing agent will NOT have access to:
Your plan must be completely self-contained.
Every Olakai implementation plan MUST follow this structure:
# Implementation Plan: [Task Name]
## Skill Reference
| Task | Invoke Skill | Description |
|------|--------------|-------------|
| [task] | `/skill-name` | [what it does] |
## Prerequisites (Verify First)
- [ ] CLI installed: `which olakai` returns a path
- [ ] Authenticated: `olakai whoami` shows user info
- [ ] (If applicable): Agent exists: `olakai agents list --json`
---
## Step N: [Step Title]
**Invoke skill**: `/olakai-new-project` (or appropriate skill)
**Why this skill**: [Brief explanation of what guidance this skill provides]
### What to do:
[Detailed instructions that make sense without prior context]
### Commands:
```bash
[Exact commands with explanations]
[Commands to verify this step worked]
Invoke /olakai-troubleshoot with symptoms: [describe what might go wrong]
# 1. Trigger a test event
[How to run the agent once]
# 2. Fetch the event
olakai activity list --agent-id AGENT_ID --limit 1 --json
olakai activity get EVENT_ID --json | jq '{customData, kpiData}'
# 3. Verify:
# - customData contains expected fields
# - kpiData shows NUMBERS (not strings like "MyVariable")
# - kpiData shows VALUES (not null)
If validation fails: Invoke /olakai-troubleshoot
---
## Skill Reference Cheatsheet
**CRITICAL**: Include this table in your plan so the executing agent knows which skill to use for each task.
| Task | Invoke Skill | What It Provides |
|------|--------------|------------------|
| Not authenticated / CLI missing | `/olakai-get-started` | Install CLI, login, create first agent with API key |
| Build new agent from scratch | `/olakai-new-project` | Full agent setup with KPIs, CustomDataConfigs, SDK code |
| Add monitoring to existing code | `/olakai-integrate` | Wrap existing LLM calls, add customData, minimal changes |
| Something not working | `/olakai-troubleshoot` | Diagnose missing events, wrong KPIs, SDK errors |
| Generate usage reports | `/olakai-reports` | Terminal-based analytics without web UI |
| Create implementation plan | `/olakai-planning` | This skill - structure plans for context clearing |
**Every step involving Olakai work MUST specify which skill to invoke.**
---
## Context Injection Snippets
Include these in your plan steps. They will NOT be available after context clears.
### Workflow Hierarchy (Required)
**Include this in any step involving agent creation:**
IMPORTANT: Every agent MUST belong to a workflow
Even single agents need a parent workflow for:
### The customData → KPI Pipeline
**Include this explanation in any step involving KPIs or customData:**
IMPORTANT: How customData becomes KPIs
SDK customData → CustomDataConfig (Schema) → Context Variable → KPI Formula → kpiData
Key rules:
What NOT to send in customData (already tracked):
Only send: KPI variables + fields for filtering/grouping
### SDK Quick Reference - TypeScript
**Include in any step involving TypeScript SDK:**
```typescript
// Installation: npm install @olakai/sdk
import { OlakaiSDK } from "@olakai/sdk";
import OpenAI from "openai";
// Initialize (once at startup)
const olakai = new OlakaiSDK({
apiKey: process.env.OLAKAI_API_KEY!,
debug: true // Enable for troubleshooting
});
await olakai.init();
// Wrap your OpenAI client
const openai = olakai.wrap(
new OpenAI({ apiKey: process.env.OPENAI_API_KEY }),
{ provider: "openai" }
);
// Make calls with customData (fields MUST match CustomDataConfigs)
const response = await openai.chat.completions.create(
{ model: "gpt-4", messages: [...] },
{
userEmail: "[email protected]",
task: "task-name",
customData: {
fieldName: value, // Must match a CustomDataConfig
}
}
);
Include in any step involving Python SDK:
# Installation: pip install olakai-sdk
import os
from openai import OpenAI
from olakaisdk import olakai_config, instrument_openai, olakai_context
# Initialize (once at startup)
olakai_config(
os.getenv("OLAKAI_API_KEY"),
debug=True # Enable for troubleshooting
)
instrument_openai()
# Create client after instrumentation
client = OpenAI()
# Make calls with context (fields MUST match CustomDataConfigs)
with olakai_context(
userEmail="[email protected]",
task="task-name",
customData={
"fieldName": value, # Must match a CustomDataConfig
}
):
response = client.chat.completions.create(
model="gpt-4",
messages=[...]
)
Include in any step involving CLI operations:
# Authentication
olakai login # Interactive login
olakai whoami # Check current user
olakai logout # Log out
# Agents
olakai agents list [--json]
olakai agents create --name "Name" --with-api-key [--json]
olakai agents get AGENT_ID [--json]
# Activity/Events
olakai activity list [--limit N] [--agent-id ID] [--json]
olakai activity get EVENT_ID [--json]
olakai activity sessions --agent-id ID [--json] # Session decoration diagnostics
# KPIs (agent-specific: each KPI belongs to ONE agent, cannot be shared)
olakai kpis list --agent-id ID [--json]
olakai kpis create --name "Name" --formula "X" --agent-id ID
olakai kpis validate --formula "X" --agent-id ID
olakai kpis update KPI_ID --formula "X"
# CustomData (agent-scoped, like KPIs)
olakai custom-data list [--agent-id ID] [--json]
olakai custom-data create --agent-id ID --name "Name" --type NUMBER|STRING
Here's a model plan that an agent can follow after context is cleared:
# Implementation Plan: Add Monitoring to Support Chatbot
## Skill Reference
| Task | Skill | Description |
|------|-------|-------------|
| Add monitoring | `/olakai-integrate` | SDK integration, customData setup |
| Create KPIs | `/olakai-integrate` | KPI creation and formula setup |
| Troubleshoot | `/olakai-troubleshoot` | Diagnose any issues |
## Prerequisites
- [ ] CLI installed: `which olakai`
- [ ] Authenticated: `olakai whoami`
- [ ] Agent exists for this app: `olakai agents list --json`
---
## Step 1: Define Custom Data Schema
**Invoke skill**: `/olakai-integrate` (Section: "Define Your Schema First")
### What to do:
Create CustomDataConfigs for fields we'll track. These MUST exist before SDK sends data, or fields won't become KPI variables.
**IMPORTANT - The customData → KPI Pipeline:**
SDK customData → CustomDataConfig → Context Variable → KPI Formula → kpiData Only CustomDataConfig fields can be used in KPI formulas!
### Commands:
```bash
# Check existing configs for this agent (replace YOUR_AGENT_ID)
olakai custom-data list --agent-id YOUR_AGENT_ID --json
# Create required configs (run each command)
olakai custom-data create --agent-id YOUR_AGENT_ID --name "ticketCategory" --type STRING
olakai custom-data create --agent-id YOUR_AGENT_ID --name "resolutionTime" --type NUMBER
olakai custom-data create --agent-id YOUR_AGENT_ID --name "customerSatisfaction" --type NUMBER
olakai custom-data list --agent-id YOUR_AGENT_ID --json | jq '.[] | {name, type}'
# Should show all 3 fields with correct types
Invoke /olakai-troubleshoot with symptoms: "custom-data create command failing"
Invoke skill: /olakai-integrate (Section: "Create KPIs")
Create KPI formulas using CustomDataConfig field names as variables. Variable names must match CustomDataConfig names exactly (case-insensitive in formulas).
# Get your agent ID first
AGENT_ID=$(olakai agents list --json | jq -r '.[0].id')
# Create KPIs
olakai kpis create --name "Avg Resolution Time" --formula "AVG(resolutionTime)" --agent-id $AGENT_ID
olakai kpis create --name "CSAT Score" --formula "AVG(customerSatisfaction)" --agent-id $AGENT_ID
# Verify formulas are valid
olakai kpis validate --formula "AVG(resolutionTime)" --agent-id $AGENT_ID
olakai kpis list --agent-id $AGENT_ID --json
# Should show 2 KPIs with status "active" or similar
Invoke /olakai-troubleshoot with symptoms: "KPI formula validation failing" or "KPI shows null values"
Invoke skill: /olakai-integrate (Section: "SDK Integration")
Wrap the existing OpenAI client and pass customData with every LLM call. Field names MUST exactly match the CustomDataConfigs from Step 1.
import { OlakaiSDK } from "@olakai/sdk";
import OpenAI from "openai";
// Initialize once at startup
const olakai = new OlakaiSDK({ apiKey: process.env.OLAKAI_API_KEY! });
await olakai.init();
// Wrap your client
const openai = olakai.wrap(
new OpenAI({ apiKey: process.env.OPENAI_API_KEY }),
{ provider: "openai" }
);
// In your chat handler - customData fields match CustomDataConfigs:
const response = await openai.chat.completions.create(
{ model: "gpt-4", messages },
{
userEmail: user.email,
task: "support-chat",
customData: {
ticketCategory: ticket.category, // STRING
resolutionTime: elapsedSeconds, // NUMBER
customerSatisfaction: rating // NUMBER
}
}
);
Run the code once with test data, then proceed to Step 4.
Invoke skill: /olakai-troubleshoot if any issues found
# Wait 30 seconds for event to process, then fetch
AGENT_ID=$(olakai agents list --json | jq -r '.[0].id')
olakai activity list --agent-id $AGENT_ID --limit 1 --json
# Get the event ID from above output, then:
EVENT_ID="[paste from above]"
olakai activity get $EVENT_ID --json | jq '{customData, kpiData}'
{
"customData": {
"ticketCategory": "billing",
"resolutionTime": 45,
"customerSatisfaction": 4
},
"kpiData": {
"Avg Resolution Time": 45,
"CSAT Score": 4
}
}
/olakai-troubleshoot if you see:| Symptom | Problem |
|---------|---------|
| kpiData values are strings like "resolutionTime" | Formula using wrong variable |
| kpiData values are null | CustomDataConfig missing or wrong type |
| customData missing fields | SDK not sending them |
| No events appearing | SDK init issue or wrong API key |
---
## Planning Checklist
Before finalizing your plan, verify:
- [ ] **Skill Reference table** at the top with all skills needed
- [ ] **Every Olakai step** specifies which skill to invoke and why
- [ ] **Prerequisites section** includes CLI and auth checks
- [ ] **CustomDataConfigs** are created BEFORE SDK code references them
- [ ] **KPI formulas** use variable names that match CustomDataConfigs
- [ ] **SDK code snippets** are complete (imports, initialization, usage)
- [ ] **Validation commands** use `--json` flag for parseability
- [ ] **Golden Rule** validation step with expected output
- [ ] **Troubleshooting skill** referenced for handling failures
- [ ] **"If this fails"** section on each step
---
## For the Executing Agent
If you're reading this plan after context was cleared:
1. **Check the Skill Reference table** at the top of the plan
2. **Each step tells you which skill to invoke** - use `/skill-name` to load detailed guidance
3. **Run prerequisites first** - don't skip CLI/auth checks
4. **Follow the validation commands** - they confirm each step worked
5. **If something fails**, invoke `/olakai-troubleshoot` for diagnosis
The skills contain comprehensive implementation guidance. This plan provides structure and sequence; the skills provide the domain expertise.
---
## When NOT to Use This Skill
- **For executing implementation**: Use `/olakai-new-project` or `/olakai-integrate`
- **For troubleshooting**: Use `/olakai-troubleshoot`
- **For generating reports**: Use `/olakai-reports`
- **For simple tasks**: If the task is a single step, just invoke the appropriate skill directly
This skill is specifically for **structuring multi-step plans** that need to survive context clearing and be executable by an agent without prior knowledge of Olakai patterns.
development
Show your Olakai developer Coding IQ status — monitoring health, personal spend, and budget. AUTO-INVOKE when user asks about: their Olakai monitoring health, personal AI spend, budget status, Coding IQ digest, whether their workspace is monitored, how much they've spent on AI this month, whether they're approaching their budget limit, or wants a quick overview of their Olakai coding status. TRIGGER KEYWORDS: olakai status, my spend, my budget, coding iq status, am I monitored, monitoring health, personal spend, budget limit, how much have I spent, olakai digest, coding status, my olakai, workspace monitored, check my olakai. DO NOT load for: setting up monitoring (use olakai-monitor-local-coding-agent), troubleshooting events or KPIs (use olakai-troubleshoot), generating analytics reports (use olakai-reports), or creating new agents (use olakai-new-project).
tools
Set up and self-heal Olakai monitoring for the coding tool you are using — Claude Code, OpenAI Codex CLI, Cursor, Google Gemini CLI, or Antigravity CLI. Installs hooks, creates the agent record, and explains how to enrich events with KPIs. This is the skill for "monitor my coding tool itself" (not for instrumenting your own agent's source code with the SDK — that is olakai-integrate). AUTO-INVOKE when user wants to: monitor Claude Code / Codex / Cursor / Gemini CLI / Antigravity CLI sessions, monitor THIS coding tool, add observability to a local coding agent, track my own coding-assistant usage, set up olakai monitoring in this workspace, see what is being monitored on this machine, check if monitoring is working, or enable / repair hooks-based monitoring for any local coding agent. TRIGGER KEYWORDS: olakai monitor, monitor my coding tool, monitor this tool, monitor claude code, monitor codex, monitor cursor, monitor gemini cli, monitor antigravity, codex cli, cursor hooks, gemini cli, gemini-cli hooks, antigravity cli, antigravity, agy, local coding agent, local agent monitoring, olakai hooks, olakai monitor init, olakai monitor list, olakai monitor doctor, olakai monitor repair, monitor workspace, track sessions, is my monitoring working, monitoring not working, no events from claude code, claude code monitoring, codex monitoring, cursor monitoring, agents mine, where am i monitoring. DO NOT load for: instrumenting your own agent's SDK code (use olakai-integrate), creating agents from scratch with custom code (use olakai-new-project), generic SDK / KPI / event troubleshooting unrelated to a coding tool (use olakai-troubleshoot).
tools
Diagnose and repair Olakai monitoring for a local coding tool you already set up — Claude Code, OpenAI Codex CLI, or Cursor. Drives `olakai monitor list`, `olakai monitor doctor [--fix]`, and `olakai monitor repair` to self-heal hooks-based monitoring (no events, missing KPIs, broken/deleted agent, drifted config). For first-time setup use olakai-monitor-local-coding-agent instead. AUTO-INVOKE when user says: my coding-tool monitoring isn't working, no events from Claude Code / Codex / Cursor, is monitoring on / working, check my olakai monitoring, what's monitored on this machine, monitor doctor, monitor repair, monitor list, fix my monitoring, my monitored agent disappeared / 404, hooks stopped firing, re-link my monitoring key. TRIGGER KEYWORDS: olakai monitor doctor, olakai monitor repair, olakai monitor list, monitor not working, no events claude code, no events codex, no events cursor, fix monitoring, repair monitoring, agent 404, agent missing, hooks stopped firing, drift, registry, agents mine, where am i monitoring, is my monitoring working, self-heal monitoring. DO NOT load for: first-time setup of a coding tool (use olakai-monitor-local-coding-agent), instrumenting your own agent's SDK code (use olakai-integrate), generic SDK / KPI / event troubleshooting unrelated to a coding tool (use olakai-troubleshoot).
tools
Diagnose and fix issues with events, KPIs, custom data, or SDK integration. AUTO-INVOKE when user mentions: events not appearing, KPIs showing wrong values, KPIs showing strings instead of numbers, custom data missing, null KPIs, authentication errors, CLI not working, events not associated with agent, monitoring broken, SDK errors, or any Olakai-related problem. TRIGGER KEYWORDS: olakai, troubleshoot, debug, not working, events missing, KPI wrong, KPI null, KPI string, customData missing, authentication failed, CLI error, no events, events not appearing, diagnose, fix olakai, broken, SDK error, monitoring issue, API key invalid, events not tracked. DO NOT load for: initial setup (use olakai-new-project or olakai-integrate), or generating reports (use olakai-reports).