Prompt structure improvements for reliable AI skill execution

A developer on r/openclaw shared specific prompt engineering techniques that transformed their market analysis skill from requiring constant monitoring to running reliably end-to-end.
Key prompt modifications
The developer spent weeks struggling with a skill that would either stop prematurely or invent unnecessary steps. Two structural changes made the difference:
- Explicit separation of returns vs. actions: The skill previously generated analysis text and stopped, mistaking intermediate artifacts for final outputs. The fix involved clearly distinguishing what the skill should return versus what it should do in the prompt structure.
- Defined failure conditions: Instead of allowing the skill to improvise around missing data (which caused it to "spiral"), the developer added explicit instructions like:
'if data source X is unavailable, return {status: blocked, reason: X} and stop'
Current limitations and open question
The skill still occasionally misreads state from prior runs, but it's now stable enough that the developer no longer needs to watch it. They're asking the community for patterns to handle partial failures gracefully without the skill going off-script.
📖 Read the full source: r/openclaw
👀 See Also

OpenClaw v2026.3.13 adds per-agent cacheRetention config for OpenAI token cost savings
OpenClaw v2026.3.13 adds per-agent cacheRetention configuration that enables OpenAI's 24-hour prompt cache retention, potentially cutting input token costs by up to 90% for agents with heartbeat cycles longer than 10 minutes.

Claude Code token audit reveals hidden costs from default tool loading
A developer analyzed 926 Claude Code sessions and found 45,000 tokens loaded at session start, with 20,000 tokens coming from system tool schema definitions. Enabling the ENABLE_TOOL_SEARCH setting reduced starting context from 45k to 20k tokens, saving 14,000 tokens per turn.

OpenClaw Discord proxy fix for REST API timeout issues
A user reports fixing OpenClaw Discord connection issues where WebSocket connects but REST API calls fail with "fetch failed UND_ERR_CONNECT_TIMEOUT" errors. The solution involves creating a proxy-preload.cjs file and setting global undici proxy settings.

Hijacking OpenClaw's Sleep Cycle Poetry to Track Operational Blind Spots
A user overrides OpenClaw's 3 AM sleep cycle prompt, repurposing the poetic diary into a queryable database that tracks infrastructure trajectory and blind spots.