ace/cli/skills/kayba-pipeline/stage-1-api-analysis/SKILL.md
Fetch pre-computed insights from the Kayba API and build a structured summary. Does NOT upload traces or trigger generation — analysis is assumed to already exist. Trigger when the user says "run stage 1", "get insights", "fetch skills", "kayba analyze", or when invoked by the kayba-pipeline orchestrator. Requires the kayba CLI to be installed and KAYBA_API_KEY to be set.
npx skillsauth add kayba-ai/agentic-context-engine kayba-stage-1-api-analysisInstall 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.
Fetch pre-computed insights from the Kayba API. Traces have already been uploaded and analyzed — this stage only pulls results.
TRACES_FOLDER — passed by the orchestrator but ignored in this stage. Traces are already uploaded and analyzed on the Kayba side. Do NOT upload, validate, or read trace files.Ensure eval/ directory exists at the project root.
kayba insights list --json > eval/insights.json
If kayba is not found in PATH, search common locations (.venv/bin/kayba, project virtualenvs). If found, use the full path. If not found anywhere, report the error and stop.
If KAYBA_API_KEY is not set, report the error and stop.
Read eval/insights.json and run quality checks before building the summary:
content fields pairwise. If two insights cover substantially the same behavior (same section, overlapping evidence traces, similar corrective action), flag them as potential duplicates in the summary. Do not remove them — just annotate.evidence field references specific traces (e.g., "task_7 turn 4"). Insights with no trace-specific evidence are lower quality — flag as "low-evidence" in the summary.status: "accepted" and helpful > 0 have been human-validated. Insights with status: "new" and helpful: 0, harmful: 0 are unvalidated — note this distinction in the summary.Log the quality gate result: "Insight quality: {total} insights, {accepted} accepted, {new_unvalidated} unvalidated, {duplicates} potential duplicate pairs, {low_evidence} low-evidence"
Extract a structured summary of each insight:
section field as the title)Write the structured summary to eval/stage1_insights_summary.md using this format:
# Kayba Insights Summary
Generated from: Kayba API (pre-computed analysis)
Total insights: N
Quality: {accepted} accepted, {unvalidated} unvalidated, {duplicate_pairs} potential duplicate pairs, {low_evidence} low-evidence
## Insight: [ID] — [section title]
**Status:** [status] [quality flags if any, e.g., "[potential duplicate with ID]", "[low-evidence]", "[unvalidated]"]
**Confidence:** [score if available]
**Evidence:**
- [citation 1 — trace reference, error string, or behavioral pattern]
- [citation 2]
**Justification:** [reflector's reasoning for why this is a real pattern]
**Helpful/Harmful:** [counts if available]
---
[repeat for each insight]
kayba is not found in PATH or common locations, report the error and stopKAYBA_API_KEY is not set, report the error and stopkayba insights list fails (network error, auth error), report the error and stopeval/insights.json — raw API responseeval/stage1_insights_summary.md — structured summary with quality annotations for downstream stagesdevelopment
# 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 |
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.