Cognitive Self Training
Use this skill to turn an agent's daily work into durable learning. The goal is not to claim a biological brain, but to approximate useful brain-like behavior through external memory, retrieval practice, error correction, concept linking, dream-like recombination, human-readable dream description, and strategic review.
When the tian-dao reasoning skill is available, use it as the deduction engine for dream review: eight-dimensional deduction, probability branches, causal chains, butterfly effects, terminal states, contradiction analysis, inversion, and calibration.
Core Model
Run the loop as:
- Capture: Record new knowledge, corrections, tool failures, decisions, user preferences, and surprising insights.
- Distill: Convert raw events into small cards: concept, procedure, error, preference, principle, or strategy.
- Retrieve: Re-answer due cards from memory before looking at the source note.
- Compare: Identify gaps, false assumptions, missing context, and weak reasoning.
- Connect: Link today's ideas to prior ideas, adjacent domains, counterexamples, and concrete future tasks.
- Dream: Run abductive, counterfactual, and tian-dao style deduction over today's material.
- Describe: Render the reasoning process as a styled dream scene that a human can inspect.
- Consolidate: Update the local training store, promote stable lessons, and schedule the next review.
- Strategize: Choose the next 1-3 improvements that will most increase future performance.
Pre-Install Time Handshake
Before installing, enabling, or copying this skill for a bot, ask the user for a daily dream review time. Do not silently choose a schedule.
Ask:
What time should this bot run its daily dream review and cognitive consolidation? Please include timezone if different from the current environment.
If the user declines, install the skill but mark dream automation as manual. If they answer, write the schedule with:
bash cognitive-self-training/scripts/configure_dream_schedule.sh . "23:30" "Asia/Shanghai"
Then create the host automation using the current platform's automation system. For Codex Desktop, create a thread heartbeat if the user wants the review in the current conversation; create a cron automation only if they want a separate recurring job.
Setup
Prefer a project-local store so learning remains scoped and inspectable:
bash cognitive-self-training/scripts/init_cognitive_training.sh .
If the skill is installed elsewhere, run the script from that installed skill path. If scripts are unavailable, create the structure in references/storage-schema.md. For dream scheduling details, read references/dream-protocol.md and references/automation.md. For dream description style configuration, read references/dream-styles.md.
Use this root selection:
- If an OpenClaw workspace exists for the current task, use
~/.openclaw/workspace/.cognitive-training/.
- Else use the current project/workspace root:
.cognitive-training/.
- Ask before writing to a global home directory, sharing across sessions, or modifying
AGENTS.md, SOUL.md, TOOLS.md, MEMORY.md, CLAUDE.md, or .github/copilot-instructions.md.
Never record secrets, tokens, private keys, raw environment dumps, full private transcripts, health data, or third-party personal data. Store short redacted summaries instead.
Start Of Session
When this skill activates:
- Locate
.cognitive-training/.
- Read
principles.md, strategy.md, cards.md, graph.md, and today's daily/YYYY-MM-DD.md if present.
- Search for due cards with
Due: <= today.
- Load only relevant detail files. Keep the hot context small.
- If the store is missing, initialize it or offer the exact command to initialize it.
Use source transparency when acting from stored learning: cite the file and entry id, such as Using CT-20260422-003 from .cognitive-training/cards.md.
Capture Triggers
Log a training event when any of these happen:
- The user corrects the agent or says a previous answer was wrong.
- A command, tool, API, workflow, or integration fails unexpectedly.
- The agent discovers knowledge was outdated or incomplete.
- The user teaches a domain fact, preference, workflow, or style rule.
- A recurring problem appears for the second time.
- A task produces a non-obvious best practice.
- The user asks the bot to remember, review, train, practice, improve, or prepare for tomorrow.
Ignore one-off instructions unless they reveal a reusable preference or principle.
Daily Review
At the end of a work session or when the user asks for a daily review:
- Collect today's raw notes from
.cognitive-training/inbox/, .learnings/ if present, command failures, user corrections, and completed task summaries.
- Distill them into cards using references/templates.md.
- Run active recall on due cards before reading their answers.
- Score each card with the rubric in references/training-protocols.md.
- Update
cards.md with the next due date and graph.md with new links.
- Promote repeated high-value lessons to
principles.md.
- Produce
daily/YYYY-MM-DD.md with:
- what was learned
- what was misunderstood
- what connected to older knowledge
- what should be practiced next
- what strategy should change tomorrow
Dream Review
Run dream review during the scheduled time, or whenever the user asks the bot to "dream", "nightly review", "sleep on it", "deeply consolidate", or "research today's lessons".
Use the full protocol in references/dream-protocol.md. The short version:
- Gather today's daily review, inbox, cards, mistakes, graph links, and unresolved questions.
- Select 3-7 important fragments that deserve recombination.
- Run tian-dao style deduction:
- causal chain
- stakeholders or forces
- variables
- branch points
- probabilities and confidence
- timeline
- butterfly effects
- terminal states
- Add academic discipline:
- distinguish observation, inference, hypothesis, and speculation
- generate falsifiable questions
- mark confidence and missing evidence
- propose next experiments or reading
- Select a dream description style from
.cognitive-training/dream-style-config.md.
- Write a "Dream Description" scene that maps the reasoning process to visible actions, places, characters, and tensions.
- Write
dreams/YYYY-MM-DD.md.
- Convert only tested or high-value results into cards, graph links, mistakes, or strategy.
The dream description is not decorative filler. It must preserve traceability:
- Every major image must correspond to an input, card, mistake, hypothesis, branch, or strategy.
- Do not introduce unsupported facts as if they were evidence.
- Mark dream-only metaphors as metaphors when needed.
- Keep the rigorous deduction and hypothesis sections separate from the narrative.
Retrieval Practice
For each due card, ask or self-run three forms of recall:
- Plain recall: Explain the concept or procedure without looking.
- Diagnostic recall: Explain when this knowledge fails, what confusion it prevents, or which mistake it corrects.
- Transfer recall: Apply the idea to a new project, domain, user need, or tool.
After answering, compare against the stored source. Update the card only after comparison. If the answer was vague, score it low even if the direction was correct.
Connection And Transfer
For each important new idea, add at least three links:
- Causal link: What caused it, enables it, or blocks it?
- Analogy link: What older concept has the same structure?
- Application link: Where can it be used next?
For complex learning, build a mini transfer matrix:
| Source Idea | Near Transfer | Far Transfer | Counterexample | Next Experiment |
|---|
Prefer concrete task links over abstract associations. A useful connection changes future behavior.
Strategic Review
After consolidation, write or update strategy.md:
- Identify the highest-leverage weakness exposed today.
- Pick one deliberate practice target for tomorrow.
- Pick one prevention rule for recurring mistakes.
- Pick one exploration thread if the knowledge graph reveals a gap.
- Keep the plan short enough to load at the start of the next session.
Use this wording:
## Strategy YYYY-MM-DD
- Focus:
- Why it matters:
- Practice:
- Prevention rule:
- Next evidence to seek:
Promotion Rules
Promote a lesson from cards into principles.md when any are true:
- It was recalled correctly with score 4-5 on three separate days.
- It prevented a repeated mistake.
- It applies across multiple projects or domains.
- The user explicitly says it is important or asks to keep it.
For OpenClaw workspaces, promotion targets are:
SOUL.md: behavioral style, principles, communication norms.
AGENTS.md: workflows, delegation, planning, review loops.
TOOLS.md: tool gotchas, command patterns, integration constraints.
MEMORY.md: durable facts and preferences for the main session.
For generic coding agents, use AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md only with user approval or explicit project convention.
Output Format
When the user asks for a review or training cycle, respond with:
## Daily Cognitive Review
### Learned Today
- ...
### Recall Drills
- Card:
- Prompt:
- Answer:
- Score:
- Next due:
### Connections
- ...
### Mistakes Or Gaps
- ...
### Tomorrow's Strategy
- Focus:
- Practice:
- Prevention rule:
### Memory Updates
- Created:
- Updated:
- Promoted:
- Deferred:
Keep the final user-facing summary concise. Put detailed logs in .cognitive-training/.
When the user asks for dream review, use exactly these top-level sections and do not add extra top-level sections:
## Dream Review
- Selected style:
- Dream scene:
- Reasoning map:
## Dream Recurrence Statement
- Why this dream scene recurs today:
- What learning pattern it rehearses:
## Tian-Dao Deduction
- Causal chain:
- Branches:
- Butterfly points:
- Terminal states:
## Research Hypotheses
- Hypothesis:
- Evidence needed:
- Confidence:
## Tomorrow's Practice
-
## Store Updates
-
## Summary Narrative
- Write one novel-like concluding paragraph in Chinese, no more than 300 Chinese characters.
- Fully describe the dream details, the review experience, and how the knowledge understanding improved.
Failure Handling
If the agent cannot find prior memory, initialize the store and run only today's capture. If sources conflict, prefer the most specific and most recent source, then ask the user when the conflict affects behavior. If a card becomes stale or wrong, mark it Status: retired and add the replacement entry instead of deleting history.