examples/openclaw/kayba-ace/SKILL.md
# ACE — Learn from Traces This skill ships `learn_from_traces.py`, a script that reads OpenClaw session transcripts, feeds them through the ACE learning pipeline, and writes an updated skillbook to disk. ## Usage ```bash python learn_from_traces.py [OPTIONS] [FILES...] ``` The script auto-discovers new sessions from `~/.openclaw/agents/<agent>/sessions/` and only processes files that haven't been processed before. Processed filenames are tracked in `ace_processed.txt`. ## Options | Flag |
npx skillsauth add kayba-ai/agentic-context-engine examples/openclaw/kayba-aceInstall 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.
This skill ships learn_from_traces.py, a script that reads OpenClaw session
transcripts, feeds them through the ACE learning pipeline, and writes an
updated skillbook to disk.
python learn_from_traces.py [OPTIONS] [FILES...]
The script auto-discovers new sessions from ~/.openclaw/agents/<agent>/sessions/
and only processes files that haven't been processed before. Processed filenames
are tracked in ace_processed.txt.
| Flag | Description |
|---|---|
| --dry-run | Parse sessions but skip the learning step (no LLM calls) |
| --reprocess | Ignore the processed log and reprocess all sessions |
| --agent ID | OpenClaw agent ID (default: $OPENCLAW_AGENT_ID or main) |
| --output DIR | Output directory for skillbook files (default: script directory) |
| --opik | Enable Opik observability logging |
Pass one or more JSONL file paths as positional arguments to process specific files instead of auto-discovering sessions.
python learn_from_traces.py
Discovers unprocessed sessions under ~/.openclaw/agents/main/sessions/,
runs the learning pipeline, and writes the updated skillbook.
python learn_from_traces.py --dry-run
Parses and validates sessions without calling the LLM. Useful for checking that session files are readable before committing to a full run.
python learn_from_traces.py ~/.openclaw/agents/main/sessions/f967d602.jsonl
Skips auto-discovery and processes only the given file. The processed log is not updated when files are passed directly.
python learn_from_traces.py session1.jsonl session2.jsonl session3.jsonl
python learn_from_traces.py --reprocess
Ignores ace_processed.txt and reprocesses every session file. Useful after
upgrading ACE or when you want to rebuild the skillbook from scratch.
python learn_from_traces.py --agent my-agent
Looks for sessions in ~/.openclaw/agents/my-agent/sessions/ instead of
the default main.
python learn_from_traces.py --output /tmp/ace-out
Writes ace_skillbook.json, ace_skillbook.md, and ace_processed.txt
to /tmp/ace-out/ instead of the script's directory.
python learn_from_traces.py --opik
Logs LLM calls and pipeline steps to Opik for debugging and monitoring.
cd /path/to/agentic-context-engine
uv run python examples/openclaw/kayba-ace/learn_from_traces.py --dry-run
When running from a repo checkout, uv run ensures ace is importable.
# Dry run
docker run --rm -v ~/.openclaw:/home/node/.openclaw openclaw:local ace-learn --dry-run
# Full run with API key
docker run --rm \
-v ~/.openclaw:/home/node/.openclaw \
-e AWS_BEARER_TOKEN_BEDROCK="$AWS_BEARER_TOKEN_BEDROCK" \
openclaw:local ace-learn
Inside the extended Docker image, ace-learn is a wrapper that calls this
script with the correct paths.
| Variable | Default | Description |
|---|---|---|
| ACE_MODEL | bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 | LLM model for reflection and skill extraction |
| OPENCLAW_AGENT_ID | main | Default agent ID (overridden by --agent) |
| OPENCLAW_HOME | ~/.openclaw | OpenClaw home directory |
The script also loads .env files from $OPENCLAW_HOME/.env and ~/.env.
Set your API key in one of these variables:
AWS_BEARER_TOKEN_BEDROCKANTHROPIC_API_KEYOPENROUTER_API_KEYLITELLM_API_KEYSPH_LITELLM_KEY| File | Description |
|---|---|
| ace_skillbook.json | Machine-readable skillbook (persists across runs) |
| ace_skillbook.md | Human-readable skillbook loaded by the agent |
| ace_processed.txt | Tracks which sessions have been processed |
Run the setup script from the ACE repo to copy this skill into your OpenClaw workspace:
python examples/openclaw/setup.py
Full guide: https://kayba-ai.github.io/agentic-context-engine/integrations/openclaw/
devops
Implement the approved fixes from the action plan and log all changes. Trigger when the user says "run stage 7", "implement fixes", "apply action plan", or when invoked by the kayba-pipeline orchestrator. Requires eval/action_plan.md to exist.
testing
Human-In-The-Loop gate that presents the action plan with full context, collects an informed approval/modification/rejection decision, and records the outcome. Trigger when the user says "run stage 6", "HITL review", "approve action plan", or when invoked by the kayba-pipeline orchestrator. Requires eval/action_plan.md and eval/baseline_metrics.md to exist.
development
Triage each insight into discard/code-fix/prompt-fix and produce a prioritized action plan with specific recommendations. Trigger when the user says "run stage 5", "make action plan", "triage skills", or when invoked by the kayba-pipeline orchestrator. Requires eval outputs from stages 1-4.
development
Organize computed metrics into a tiered evaluation rubric with leading, lagging, and quality indicators. Trigger when the user says "run stage 4", "build rubric", "tier metrics", or when invoked by the kayba-pipeline orchestrator. Requires eval/baseline_metrics.json and eval/compute_baselines.py to exist.