Turn user goals into self-improving automated pursuit loops.
text
User states goal
↓
1. INTAKE: Record goal + determine strategy
2. SCHEDULE: Create cron job for periodic check-ins
3. EXECUTE: Each cron run evaluates, acts, logs, adapts
4. CLOSE: Goal achieved or abandoned → clean up
5. REPORT: Surface progress to user periodically
When a user states a goal, immediately:
a) Run the goal engine to create a record:
text
python3 scripts/goal_engine.py create "<goal statement>" --channel "<channel-id>"
b) Determine the initial strategy. Consider:
references/goal-lifecycle.md for pattern guidance)c) Write the strategy to the goal:
text
python3 scripts/goal_engine.py adapt "<goal-id>" --strategy "<strategy description>"
Generate and create a cron job for the periodic check-in loop:
text
python3 scripts/goal_engine.py cron "<goal-id>"
This prints JSON. Use the output to create an OpenClaw cron job (cron tool → add action).
Default cadence: every 1 hour (3,600,000 ms). Adjust based on goal type — see references/goal-lifecycle.md.
The cron job's payload includes: goal statement, current strategy, and step-by-step instructions for the check-in agent turn.
Each cron-run agent turn should:
Evaluate — What's the current state? Has anything changed since the last check?
Take action — Do one concrete thing that moves toward the goal. Use whatever tools/skills make sense.
Log — Write what you did and the outcome: text
python3 scripts/goal_engine.py log-action "<goal-id>" --action "<what you did>" --result "<outcome>"
Adapt — If the current approach isn't working, change strategy: text
python3 scripts/goal_engine.py adapt "<goal-id>" --strategy "<new approach>"
Report — Tell the user what happened. Concise. Include metric movement if measurable.
Close check — If the goal is achieved, close it: text
python3 scripts/goal_engine.py close "<goal-id>" --status completed
Then disable or remove the cron job.
If after 3 check-ins there's no measurable progress:
references/goal-lifecycle.md for adaptation heuristicsCheck-ins report to the channel where the goal was stated. Key reporting patterns:
scripts/goal_engine.py manages the goal registry ( goals_registry.json).
CommandUsagecreatecreate "<statement>" --channel "<id>"planplan "<statement>" --depth L0-L4 [--strategy <type>] — create with planning depthlistlist [--status active|paused|completed|abandoned]statusstatus <goal-id> — full JSON dumpupdateupdate <goal-id> --key <path> --value <json>log-actionlog-action <goal-id> --action "<text>" --result "<text>"adaptadapt <goal-id> --strategy "<new strategy>"advanceadvance <goal-id> --milestone "<desc>"closeclose <goal-id> --status completed|abandonedset-metricsset-metrics <goal-id> --json '{"key": "value"}'set-session-stateset-session-state <goal-id> --objective "..." --blocker "..." --next "..."set-risk-rulesset-risk-rules <goal-id> --json '{"max_position_size": 100}'log-outcomelog-outcome <goal-id> --action "..." --result "..." --lessons "..."learnlearn <goal-id> --lesson "..."reportreport [--status active|paused|completed|abandoned] [--stalled]croncron <goal-id> — print cron job JSON
This skill combines the best patterns from three OpenClaw skills:
From Self-Improving Proactive Agent:
From Plan:
From Auto-Trading Strategy:
Each cron check-in automatically includes:
Read references/goal-lifecycle.md for detailed guidance on:
Read references/planning-depth.md for:
When a goal is completed or abandoned:
python3 scripts/goal_engine.py close "<goal-id>" --status completed~/self-improving/ project notes for Kalshi/Alpaca)