new-project
できること
このスキルは、最初からOlakaiにつながった新しいAIエージェントのプロジェクトの作成を案内します。公開前から分析とガバナンスを整えたい開発者向けです。
使う場面
- ✓新しいAIエージェントを始め、初日から監視を入れたいとき。
- ✓Olakai SDKとCLIの導きのあるセットアップが欲しいとき。
- ✓エージェントの性能を示すKPIを定める必要があるとき。
スキルのリンク
https://github.com/andrewyng/context-hub/blob/main/content/olakai/skills/new-project/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Olakaiの監視を備えた新しいAIエージェントのプロジェクトを始め、そのKPIを定義してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはプロジェクトを設定し、Olakai SDKを追加し、エージェントのためのキーを作成し、KPIを定義して、結果をテストします。スキルの手順に、決まった順序で従います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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:
SDK customData → CustomDataConfig (Schema) → Context Variable → KPI Formula → kpiData
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
// 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,
よくある質問
始める前にCLIが必要ですか?
はい。このスキルは、Olakai CLIがインストールされ、ログインしていることを前提にします。
このスキルでのKPIとは何ですか?
処理された件数、成功率、再試行率など、エージェントの性能を示すビジネスの指標です。
同じKPIを別のエージェントに再利用できますか?
いいえ。KPIは1つのエージェントに属するので、新しいエージェントごとに独自のセットが必要です。
詳細
作者による元の説明
Build a new AI agent with Olakai monitoring from scratch — project setup, SDK integration, KPI configuration, and end-to-end validation
repo: andrewyng/context-hub
人気
- GitHubのスター
- 14k
- ランキング
- #11274
- ライセンス
- MIT
- 更新日
- 2026/5/31
コメント
- …
このリポジトリの他のスキル
get-api-docs
14kエージェントが、古い記憶に頼る代わりに、コードを書く前にサードパーティのAPIやライブラリの最新のドキュメントを取得できるよう支援します。
bloc-cubit
14kFlutterアプリでBlocまたはCubitを使って状態を管理する方法を、どちらを選ぶかとテストの安全な初期値を含めて、エージェントに教えます。
riverpod
14kFlutterアプリでRiverpodを使って状態を管理する方法を、プロバイダー、非同期データ、テストを含めて、各場合に妥当な初期値とともに、エージェントに教えます。
document-extraction
14kエージェントが、LandingAIのADEサービスを使って、PDF、画像、表計算を読み、きれいなテキストに変え、請求書の合計などの項目を取り出せるよう支援します。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。