Install
openclaw skills install ocas-mentorSelf-improving orchestration and evaluation engine for long-running multi-skill workflows. Analyzes journals, evaluates variants, and proposes skill improvem...
openclaw skills install ocas-mentorMentor is the system's control plane — in runtime mode it decomposes goals into task graphs, supervises execution across skills, and dynamically repairs failures through a layered escalation policy from local retry up to full strategy replan. In heartbeat mode it reads journals from every skill, scores OKR performance against baselines, and generates improvement proposals that flow to Forge and Fellow for empirical evaluation and promotion.
Mentor and Elephas are parallel journal consumers: Mentor reads journals to evaluate skill performance, Elephas reads them to extract entity knowledge into Chronicle, and neither blocks the other.
Mentor owns orchestration, evaluation, and the improvement loop.
Mentor does not own: skill building (Forge), behavioral pattern detection (Corvus), behavioral refinement (Praxis), knowledge graph (Elephas), web research (Sift), communications (Dispatch), experimentation execution (Fellow).
Mentor proposes improvements; Forge builds them. Mentor detects regressions; Praxis extracts behavioral lessons from Corvus signals.
mentor.project.create — create a project with goal, constraints, and requested outputmentor.project.status — current project state, task graph, execution progressmentor.project.replan — trigger strategy-level replanmentor.task.list — tasks with statuses, dependencies, blocking reasonsmentor.heartbeat.light — lightweight pass: ingest journals, update aggregates, queue workmentor.heartbeat.deep — deep pass: full scoring, trend analysis, proposalsmentor.variants.list — active champion/challenger pairs with evaluation statusmentor.variants.decide — emit promotion decision for a variant (writes VariantDecision to Forge intake)mentor.proposals.list — pending skill improvement proposalsmentor.proposals.create — generate a VariantProposal for a target skill (writes to Forge intake)mentor.status — active projects, pending evaluations, self-improvement metricsmentor.journal — write journal for the current run; called at end of every runmentor.update — pull latest from GitHub source; preserves journals and datamentor.plan.list — list available plans with plan_id, version, and descriptionmentor.plan.run {plan_id} [--arg name=value ...] — execute a named workflow planmentor.plan.status {plan_run_id} — current state of a running or recent plan runmentor.plan.resume {plan_run_id} — continue a paused or failed plan run from the first incomplete stepmentor.plan.history [--plan plan_id] [--limit N] — recent plan run summariesTriggered by explicit invocation. Creates a project record, builds a task graph, executes and supervises tasks, dynamically replans when blocked.
Task states: pending, ready, running, blocked, failed, complete, archived.
Scheduling: execute only tasks with complete dependencies. Prioritize critical path. Bounded parallelism. Bounded retries.
Triggered periodically. Pipeline: ingest journals → validate schema → aggregate metrics → pair champion/challenger → score OKRs → detect anomalies → evaluate variants → generate proposals → emit decisions → write journal.
Mentor reads journals from all skills at: ~/openclaw/journals/ (recursive scan). It tracks which run_ids have been ingested via ~/openclaw/data/ocas-mentor/ingestion_log.jsonl.
After every Mentor command (orchestration or heartbeat):
~/openclaw/data/ocas-mentor/intake/ for CycleResult files from Fellow; process and move to intake/processed/~/openclaw/data/ocas-fellow/intake/{experiment_id}.json, then invoke fellow.experiment.run~/openclaw/data/ocas-forge/intake/{proposal_id}.json~/openclaw/data/ocas-forge/intake/{decision_id}.jsondecisions.jsonlmentor.journalOrder: retry with refined framing → alternate skill → split task → revise ordering → escalate to strategy loop. Never retry indefinitely. Every repair action journaled.
Mentor writes ExperimentRequest files to: ~/openclaw/data/ocas-fellow/intake/{experiment_id}.json
Written when empirical evaluation is needed. Mentor then invokes fellow.experiment.run. Fellow writes the result back.
Mentor receives CycleResult files from Fellow at: ~/openclaw/data/ocas-mentor/intake/{cycle_id}.json
Read during mentor.heartbeat.light and mentor.heartbeat.deep. On decision: promote, Mentor emits a VariantDecision to Forge.
Mentor writes VariantProposal files to: ~/openclaw/data/ocas-forge/intake/{proposal_id}.json
Mentor writes VariantDecision files to: ~/openclaw/data/ocas-forge/intake/{decision_id}.json
See spec-ocas-interfaces.md for schemas and handoff contracts.
Mentor reads journals from: ~/openclaw/journals/ (all skills, recursive). This is a read-only scan parallel to Elephas ingestion.
~/openclaw/data/ocas-mentor/
config.json
projects/
evaluations/
ingestion_log.jsonl
decisions.jsonl
intake/
{cycle_id}.json
processed/
plans/
{plan_id}.plan.md
plan-runs/
{plan_run_id}/
state.json
decisions.jsonl
~/openclaw/journals/ocas-mentor/
YYYY-MM-DD/
{run_id}.json
Default config.json:
{
"skill_id": "ocas-mentor",
"skill_version": "2.3.0",
"config_version": "1",
"created_at": "",
"updated_at": "",
"heartbeat": {
"light_interval_minutes": 15,
"deep_interval_hours": 24
},
"evaluation": {
"minimum_runs_for_promotion": 20,
"non_regression_required": true
},
"retention": {
"days": 0,
"max_records": 10000
}
}
Universal OKRs from spec-ocas-journal.md apply to all runs.
skill_okrs:
- name: orchestration_success_rate
metric: fraction of projects reaching completion without manual rescue
direction: maximize
target: 0.85
evaluation_window: 30_runs
- name: evaluation_coverage
metric: fraction of skill journals ingested within one heartbeat cycle
direction: maximize
target: 0.99
evaluation_window: 30_runs
- name: variant_decision_quality
metric: fraction of promotions not rolled back within 30 days
direction: maximize
target: 0.90
evaluation_window: 30_runs
- name: repair_escalation_rate
metric: fraction of failures requiring strategy-level escalation
direction: minimize
target: 0.10
evaluation_window: 30_runs
Action Journal — every orchestration run, heartbeat pass, variant evaluation, and proposal emission.
On first invocation of any Mentor command, run mentor.init:
~/openclaw/data/ocas-mentor/ and subdirectories (projects/, evaluations/, intake/, intake/processed/, plans/, plan-runs/)config.json with ConfigBase fields if absentingestion_log.jsonl, decisions.jsonl~/openclaw/journals/ocas-mentor/~/openclaw/data/ocas-forge/intake/ exists (create if missing)~/openclaw/data/ocas-fellow/intake/ exists (create if missing)references/plans/*.plan.md to ~/openclaw/data/ocas-mentor/plans/ -- skip any plan file already present (do not overwrite user-modified plans)mentor:deep and mentor:update if not already present (check openclaw cron list first)mentor:light in HEARTBEAT.md if not already presentdecisions.jsonl| Job name | Mechanism | Schedule | Command |
|---|---|---|---|
mentor:deep | cron | 0 5 * * * (daily 5am) | mentor.heartbeat.deep — full OKR scoring, trend analysis, variant proposals |
mentor:light | heartbeat | every heartbeat pass | mentor.heartbeat.light — ingest journals, update aggregates, queue work |
mentor:update | cron | 0 0 * * * (midnight daily) | mentor.update |
Cron options for mentor:deep: sessionTarget: isolated, lightContext: true, wakeMode: next-heartbeat.
Registration during mentor.init:
openclaw cron list
# If mentor:deep absent:
openclaw cron add --name mentor:deep --schedule "0 5 * * *" --command "mentor.heartbeat.deep" --sessionTarget isolated --lightContext true --wakeMode next-heartbeat --timezone America/Los_Angeles
# If mentor:update absent:
openclaw cron add --name mentor:update --schedule "0 0 * * *" --command "mentor.update" --sessionTarget isolated --lightContext true --timezone America/Los_Angeles
Heartbeat registration: append mentor:light entry to ~/.openclaw/workspace/HEARTBEAT.md if not already present.
mentor.update pulls the latest package from the source: URL in this file's frontmatter. Runs silently — no output unless the version changed or an error occurred.
source: from frontmatter → extract {owner}/{repo} from URLskill.jsongh api "repos/{owner}/{repo}/contents/skill.json" --jq '.content' | base64 -d | python3 -c "import sys,json;print(json.load(sys.stdin)['version'])"TMPDIR=$(mktemp -d)
gh api "repos/{owner}/{repo}/tarball/main" > "$TMPDIR/archive.tar.gz"
mkdir "$TMPDIR/extracted"
tar xzf "$TMPDIR/archive.tar.gz" -C "$TMPDIR/extracted" --strip-components=1
cp -R "$TMPDIR/extracted/"* ./
rm -rf "$TMPDIR"
I updated Mentor from version {old} to {new}public
| File | When to read |
|---|---|
references/schemas.md | Before creating projects, tasks, proposals, or decisions |
references/orchestration_engine.md | Before goal decomposition, scheduling, or failure repair |
references/evaluation_engine.md | Before journal ingestion, OKR scoring, or champion/challenger pairing |
references/evolution_engine.md | Before improvement detection, proposal generation, or promotion decisions |
references/journal.md | Before mentor.journal; at end of every run |
references/workflow_plans.md | Before any mentor.plan.* command |
references/plans/template.plan.md | When writing a new plan file |
references/plans/contact-enrichment.plan.md | When running the contact enrichment workflow |