Agentic Context Engine is an open-source engine that gives AI agents a persistent learning loop, helping them remember successful strategies and learn from failures across sessions. It is used to improve production agents, and also powers Kayba’s hosted service. Catalogue add-ons support workflows for operating and configuring the engine.
Borrowing it
Nothing to install: this file belongs to kayba-ai/agentic-context-engine. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/kayba-ai/agentic-context-engine/main/.claude/skills/kayba-pipeline/stage-2-domain-context/SKILL.mdgit clone --depth 1 https://github.com/kayba-ai/agentic-context-engineWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kayba-ai/agentic-context-engine/stage-2-domain-context)<a href="https://agentmods.dev/skills/kayba-ai/agentic-context-engine/stage-2-domain-context"><img src="https://agentmods.dev/badge/skills/kayba-ai/agentic-context-engine/stage-2-domain-context/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kayba-ai/agentic-context-engine/stage-2-domain-context"><img src="https://agentmods.dev/badge/skills/kayba-ai/agentic-context-engine/stage-2-domain-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Excessive Agency · line 106 Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00064 | $0.01797 |
| Opus 5 | $0.00032 | $0.00898 |
| Sonnet 5 | $0.00013 | $0.00359 |
| Haiku 4.5 | $0.00006 | $0.00180 |
Grade A, and why
kayba-stage-2-domain-context scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Stage 2: Domain Context Gathering
Understand the agent's world — what it does, what tools it has, and what "success" looks like.
Inputs
TRACES_FOLDER— path to directory containing trace JSON files
Process
0. Detect trace format
Before reading traces, identify the framework that produced them. Read 1 trace file and check:
| Signal | Framework |
|---|---|
info.agent_info.implementation, info.environment_info, simulation.messages[] with role/tool_calls/turn_idx |
tau2-bench |
runs[].steps[] with type: "tool", lc_kwargs |
LangChain / LangSmith |
events[] with event_type, span_id, parent_id |
LlamaIndex |
choices[].message.tool_calls[] at top level |
Raw OpenAI API logs |
trace.spans[] with attributes, trace_id |
OpenTelemetry / Arize / Langfuse |
Record the detected format in the output under Trace Format. All subsequent trace-reading steps use the field paths appropriate for that format.
If the format is unrecognized, note the top-level keys and structure, then proceed best-effort with field names found in the data.
1. Detect architecture
Read 2-3 traces and determine if this is a single-agent or multi-agent system:
- Single agent: one
agent_infoentry, one conversation thread, tool calls from one identity - Multi-agent / router: look for multiple
agent_infoentries, routing tool calls (e.g.,transfer_to_*,delegate_to_*), sub-conversation arrays, or distinct system prompts per agent identity
If multi-agent: document each agent separately (name, role, tools, handoff triggers) and note the routing logic. The remaining steps apply per-agent.
2. Find the system prompt
Use a fallback chain — stop at the first hit:
- Config files — grep for keys:
system_prompt,system_message,instructions,AGENT_INSTRUCTION,SYSTEM_PROMPTin YAML/JSON/TOML/Python/JS files - Source code — search for prompt template strings, f-strings, or
.format()calls that build the system message (look in agent implementation files) - Trace extraction — read 3 trace files from
{TRACES_FOLDER}:- Check
info.environment_info.policy(tau2-bench format) - Check first message with
role: "system"in the messages array - Check
raw_datafields for system-level content
- Check
- Not found — if none of the above yields a system prompt, explicitly record
SYSTEM_PROMPT_STATUS: NOT_FOUNDin the output and flag this for the orchestrator. Do not fabricate or guess.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 167 lines · 64 tokens per session scan A c4dc12cdb80c
kayba-stage-2-domain-context is a skill published in the GitHub repository kayba-ai/agentic-context-engine (2,565 stars, last pushed 11d ago), licensed Apache-2.0. It adds 64 tokens to every session and 1,797 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
titen-memory
Use the Titen MCP server to recall bounded evidence-grounded context, record verified durable signals, submit feedback, and coordinate checkpoints, leases, or handoffs. Use when work may benefit from prior project memory or when a verified outcome should be preserved for another agent; do not use it to capture raw…
open-source
Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…
writing
A writing guide for turning verified facts and calculations into finished text for a specific audience. It follows the requested language, structure, and length.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.
goai
GoAI is a Go SDK for AI applications. One unified API across 25+ LLM providers. Inspired by the Vercel AI SDK, adapted to Go idioms (generics, interfaces, channels).
mnemo-cortex
Installs and wires Mnemo Cortex (local-first persistent memory) into OpenClaw and other MCP-capable agents. Use for cross-session recall, decision history, or multi-agent shared memory.