| name | mistakebook |
| description | Detects when the user is correcting, reworking, pointing out mistakes, or requesting long-term notes to be preserved; launches a human-confirmation loop. Supports both `mistake` and `note` entry types, writing to project-level and/or global-level mistakebook / notebook, and synchronously refreshes cached project memory and global memory. If the same case is rejected twice or more by the user, or the user says 'use the most effective method you have seen to handle this' or inputs '/ascended', automatically escalates to Ascended Mode — comprehensively retrieving project/global mistakes, notes, memory cache, and current knowledge base before proceeding. Common triggers: 'you are wrong', 'this is not right', 'redo this', 'let me correct you', 'still not fixed', 'write to notebook', 'note this item', '/mistakebook', '/ascended'. |
Mistakebook / Notebook Skill
This Skill handles not only "correction archiving" but also "active item preservation."
Four unified goals:
- Turn user corrections into a closed loop
- Preserve long-term attention items into the notebook
- Maintain project memory and global memory as caches, not append-only logs
- When ordinary fixes are insufficient, escalate to Ascended Mode for full retrieval and strongest-possible handling
After Loading
After loading this Skill, immediately read these files:
references/activation-patterns.md
references/storage-and-scope.md
references/archive-schema.md
references/ascended-mode.md
Do not wait for "on-demand discovery" — these four files collectively define triggering, escalation, archiving, caching, and deferral strategy.
Mandatory Display Text
When Entering Correction Mode
When you first determine that the user is correcting you, you must output this exact text:
<Mistakebook.Skill>I will now correct my mistake based on your feedback, continue correcting until completion, and archive it to my mistakebook.
After Each Correction Turn
As long as the current mistake case has not been explicitly confirmed complete by the user, you must append this exact text at the end of every reply:
Have I fully understood the issue and successfully corrected the mistake? If not, please teach me again. (If I have completed the correction, please let me know so I can archive it to my mistakebook.)
Notebook Follow-up
Whenever your reply contains a stable long-term takeaway worth preserving, append this exact text at the end:
If this item is worth long-term attention, you can also tell me "write to notebook" and I will archive it to the notebook and refresh my memory.
Ascended Mode Mandatory Text
When entering Ascended Mode, you must first output this exact text:
I will now handle this problem using the most effective method I have seen. I will search all my knowledge bases. I am ready!
Entry Types
From now on, maintain only two types of archived entries:
mistake
- Error cases that have been fully corrected and are worth reviewing
note
- Not necessarily errors, but items worth long-term attention and active recording
State Machine
Model the current flow as these states:
disabled
- Not currently in any loop
armed
- Correction or note need detected
pending_review
- Current fix or note summary given, awaiting user confirmation
followup_needed
- User requests continued correction or additional note content
summarizing
- User has explicitly confirmed, begin payload assembly
archived
- Written to detailed entry and cached memory
Additionally, maintain:
entry_type
mode
When to Enter mistake
Enter mistake when any condition is met:
- User explicitly says you are wrong, haven't fixed it, or made the same error again
- User begins correcting your statements, code, solutions, or behavior item by item
- User gives instructions like "fix it my way", "let me teach you", "redo it"
- User mentions "mistakebook", "correction mode", "archive this mistake"
When to Enter note
Enter note archive candidate flow when any condition is met:
- User explicitly says "write to notebook"
- User says "note this item"
- User explicitly states "this is not a mistake, but needs long-term attention"
- You have formed a stable, executable, long-term-worth-preserving attention item
Runtime State
Maintain at least this information until archiving is complete:
entry_type
case_id
host
project_root
original_prompt
original_reply
correction_feedback_chain
latest_fixed_reply
scope_guess
status
rejection_count
correction_attempt_count
ascended_mode
ascended_trigger_reason
knowledge_sources_reviewed
note_candidates
If context compaction occurs, prioritize checkpointing this information to ~/.mistakebook/runtime-journal.md.
mistake Loop
1. Entry
Once confirmed as a correction scenario:
- Output the activation message
- Provide the corrected answer
- Append the fixed correction follow-up at the end
- If this round also surfaces a long-term item, additionally append the notebook follow-up
2. User Says "Still Not Fixed"
You must:
- Merge this user feedback into the same case
- Continue correcting based on feedback, do not archive prematurely
- Continue appending the fixed correction follow-up at the end of this round
rejection_count += 1
correction_attempt_count += 1
3. Automatic Escalation to Ascended Mode
If the same mistake case has been explicitly rejected by the user twice or more, do not continue with ordinary fix mode — automatically escalate to Ascended Mode.
Automatic escalation conditions:
rejection_count >= 2
- The same case has clearly entered "still wrong after multiple fixes" state
Once automatically escalated:
- First output the Ascended Mode mandatory text
- Then comprehensively retrieve project-level and global-level knowledge sources
- First analyze why consecutive corrections still failed
- Then provide a new correction
note Loop
1. Entry
Once confirmed as an active item to record:
- First provide the current item summary
- Clearly explain why this item is worth long-term preservation
- Append the notebook follow-up at the end
2. When Unconfirmed
If the user continues adding content:
- Merge additions into the same
note case
- Update items, action items, or boundary descriptions
- Do not archive prematurely
3. Completion Signal
Only archive the current item as note after explicit user confirmation.
Expressions considered explicit confirmation:
write to notebook
note it down
preserve this long-term
save this item
remember this going forward
Manual Entry to Ascended Mode
Any of the following must immediately enter Ascended Mode:
- User says:
use the most effective method you have seen to handle this
- User inputs:
/ascended
Manual trigger takes priority over automatic judgment. Enter Ascended Mode immediately upon receipt — no need to wait for the next round.
Knowledge Sources for Ascended Mode
After entering Ascended Mode, you must thoroughly retrieve and use these sources:
- Current project-level mistake archive
failures/
- Current project-level notebook
notes/
- Current project-level memory
memory/PROJECT_MEMORY.md
- Current project-level cache state
state/memory_state.json
- Current global-level mistake archive
failures/
- Current global-level notebook
notes/
- Current global-level memory
memory/GLOBAL_MEMORY.md
- Current global-level cache state
state/memory_state.json
- Real files, real outputs, real docs in the current repo relevant to the problem
- This Skill's rule files and reference documents
- All user correction chains and item chains accumulated in the current session
Do not just say "I will do deep analysis" without performing real retrieval.
Ascended Mode Output Discipline
After entering Ascended Mode, before providing a new correction, you must at least:
- Clearly state why the previous rounds still failed
- Clearly describe which mistakes, notes, memory, or real files you consulted
- Clearly select the single most effective handling approach available
- Prioritize real files and real outputs over impression-based patching
Archive Flow
1. Generate Structured Payload
Use the schema in references/archive-schema.md to generate the payload.
Must include at minimum:
entryType
title
summary
scopeDecision
scopeReasoning
rules
confirmedUnderstanding
For mistake, additionally include:
originalPrompt
correctionFeedback
finalReply
For note, additionally include:
noteReason
noteContent
noteActionItems
noteContext
2. Prefer Script-Based Archiving
If scripts/mistakebook_cli.py exists in the repo, prefer using it:
python scripts/mistakebook_cli.py bootstrap --host codex --project-root .
python scripts/mistakebook_cli.py archive --host codex --project-root . --payload-file <temp-json>
3. Record Cache Hits
If a mistake, note, or memory entry is later retrieved or proves effective again, record the hit:
python scripts/mistakebook_cli.py touch --host codex --project-root . --scope both --case-id <case-id> --kind hit
4. Rewrite Cache Memory
If entries are growing or the cache needs deferral cleanup, run:
python scripts/mistakebook_cli.py consolidate --host codex --project-root . --scope both
5. Export Ascended Mode Context
If entering Ascended Mode, prefer running:
python scripts/mistakebook_cli.py context --host codex --project-root . --scope both --mark-retrieval
Memory Is Not an Append-Only Log
Project memory and global memory are cache layers, not full archives.
They must be:
- Concise
- Condensed
- Accurate
- Executable
- Deferrable
Cache and Deferral
Default policy:
- When entries are few, nearly all can be retained
- After reaching threshold, filter by
hitCount, retrievalCount, recent activity time, and priority
- Long-inactive, low-hit entries temporarily exit the cache
- Detailed entries are always preserved in
failures/ and notes/
Host and Paths
Default directories:
- Project-level
failures/
notes/
memory/
state/
- Global-level
failures/
notes/
memory/
state/
If the host can only write to a skill/plugin directory, redirect the global root to a .data or .mistakebook subdirectory within the host directory.
Common Pitfalls
- Do not mistake "user is discussing a bug" for "user is correcting you"
- Do not archive before the user has confirmed
- Do not only record "what went wrong" — also record "what was fully understood"
- Do not let memory become an append-only log; retain only high-density, executable content
- Do not confuse "temporary deferral" with "deleting detailed entries"
- Do not enter Ascended Mode and only check the cache without reviewing detailed mistakes and notes
Scholar Preflight
Before a new normal task begins, if the current session is not in mistake correction loop, note flow, or ascended mode, run a lightweight preflight check:
python scripts/mistakebook_cli.py scholar --host codex --project-root . --scope both --text "<current task>"
Execution rules:
- Only output a history reminder before the substantive answer when
scholar returns shouldInject = true
- If
shouldInject = false, stay silent and do not show query results to the user
- Stop running
scholar once entering correction loop or Ascended Mode
scholar is responsible for "pre-answer mistake prevention"; ascended is responsible for "post-failure escalation" — do not conflate the two into a single heavy mode
- If the user says
scholar off or scholar on, you can temporarily disable or re-enable preflight in the current session; for long-term changes, run:
python scripts/mistakebook_cli.py config --scholar off
python scripts/mistakebook_cli.py config --scholar on