Notebook
Project trail system. Initialize, save, recover, migrate, and manage project notes.
When NOT to use this skill
- No active project context (no git repo, no project root) — say so, don't create a floating notebook
- User wants to summarize or extract knowledge from content — use instead
- Notes already exist and user just wants to read them — read directly with Read tool, skip the skill
Quick Reference
Proactive save rule: Save after every significant decision, failure, or constraint discovered — without being asked. Every ~20 tool calls without a save is too long. If you would say "I should remember this," write it now.
| Command | Action |
|---|
| Init (new project) or status (existing) |
| Write a note immediately — never prompts, just writes |
/notebook save resolved: <desc>
| Save a note and resolve the matching lesson |
| Read index + lessons + flagged notes, summarize state |
| Convert messy notes into notebook format |
/notebook — Init & Status
If notebook/ doesn't exist (new project):
- Locate project root — walk up from cwd looking for: , , , / / /
- If no project root found: tell the user "No project root detected — create a project first."
- Create:
notebook/
├── _index.md
└── lessons.md
- Initialize :
markdown
# Notes Index
Project trail — read this first on context recovery.
- Initialize :
markdown
# Lessons
What not to do. Read this every session.
- Add to (process notes are AI working memory, not public docs)
- Confirm:
Notebook initialized at {project_root}/notebook/
notebook/ added to .gitignore — remove to track in git.
- Retroactive save — scan the current conversation for any decisions, failures, constraints, or learnings that have already occurred. Save each one as a note immediately. If the notebook is being initialized mid-session, there is almost certainly unsaved context. Do not wait to be asked.
If notebook/ already exists (status):
- Read
- Read
- Report: number of notes, number of lessons, last note date, count of ⚑-flagged notes
- Show the last 5 index entries
/notebook save — Write a Note
Never prompt. Never ask questions. Just write.
Step 1: Locate Project Root
Walk up from cwd:
→
→
→
/
/
/
No root found → "No project root detected. Run
from within a project first."
Step 2: Ensure Infrastructure
If
doesn't exist, create it with
and
silently.
markdown
# Notes Index
Project trail — read this first on context recovery.
markdown
# Lessons
What not to do. Read this every session.
Add
to
if not already present.
Step 3: Next Note Number
Read
, find highest note number, increment. Start at
if empty.
Step 4: Infer Content
Priority order:
- Explicit argument —
/notebook save constraint: RLS can't do cross-schema joins
- Conversation context — if bare , synthesize from recent exchanges
- Both — user hint + contextual expansion
Step 5: Classify Type
Infer from content. Never ask.
| Type | Signal |
|---|
| Chose between options, committed to approach |
| Non-obvious gotcha, unexpected behavior |
| Hard limitation (library, API, platform) |
| Changing direction from previous approach |
| Research findings, benchmarks, comparisons |
| Tried something, didn't work — and why |
| A previous lesson/constraint no longer applies |
Step 6: Write the Note
File:
notebook/NNNN-type-short-title.md
Quick format (default):
markdown
# NNNN: Short Descriptive Title
**Type:** type | **Date:** YYYY-MM-DD
Content. 1-5 lines. Be specific — library names, error messages, version numbers.
What happened, what it means going forward.
Full format (major architectural decisions only):
markdown
# NNNN: Short Descriptive Title
**Type:** decision | **Date:** YYYY-MM-DD
**Status:** accepted
## Context
What prompted this? (1-3 sentences)
## Decision
What we decided. Be specific.
## Rationale
Why this over alternatives.
## Alternatives Considered
- **Alternative A:** Rejected because X
## Consequences
What this means going forward.
Threshold: meaningful alternatives considered AND hard to reverse → full format. Everything else → quick.
Step 7: Update Index
Append a
rich one-line summary to
:
- NNNN type: Detailed one-liner useful standalone
⚑ flag for critical constraints, breaking discoveries, architectural decisions:
- NNNN ⚑ constraint: Critical thing every session must know
Step 8: Update Lessons (conditional)
For types , , : append a distilled one-liner to
.
Format — pure signal, no metadata:
- Concise lesson. What not to do and why, or what to do instead.
The full note has context and details. The lesson is the takeaway — one line a model can scan in a second.
For type : write the note as usual, then find the matching lesson in
and strike it:
- ~~Prisma doesn't work with edge runtime~~ → Resolved in 0047
How to match: use the content of the
argument to find the most relevant lesson line. Match on key terms (library names, error descriptions, the constraint being resolved). If no clear match is found, write the note but warn:
Note saved but no matching lesson found to resolve.
Strikethrough preserves history — a model sees what used to be a problem and knows to skip it. The note reference lets anyone find the resolution details.
Step 9: Update PROJECT_STATE.md (conditional)
Only if the note materially changes project state (blocking constraint, architecture change, pivot). If no
exists, skip.
Output
Single line confirmation:
Saved: notebook/NNNN-type-short-title.md
Nothing else.
/notebook recover
- Read full
- Read full
- Open all ⚑-flagged notes
- Open the last 3 notes
- Read if it exists
- Summarize: what the project is, key decisions, active constraints, known pitfalls, current state
- Ask: "What's changed since this was last updated?"
/notebook migrate
Convert existing messy notes into notebook format. One-time onboarding for projects with pre-existing notes.
- Scan the target folder (cwd or specified path) for markdown and text files
- Read each file
- Classify each: decision, learning, constraint, failure, investigation, or pivot
- Write each as a properly numbered notebook note in
- Build from scratch with rich one-line summaries
- Extract lessons from anything that looks like a failure, constraint, or learning → populate
- Leave originals untouched. User deletes them when satisfied.
If
already has notes, continue numbering from the highest existing. Migrate never overwrites existing notes.
After migration, report: how many files found, how many converted, how many lessons extracted. Show the generated index.
Resolving Lessons
To mark a lesson as resolved use:
/notebook save resolved: <exact phrase or lesson number>
Matching rules:
- Prefer exact phrase match from lessons.md
- If ambiguous or no match found, list the open lessons and ask the user to confirm which one
- Never silently skip — always confirm what was resolved
Mark resolved lessons with strikethrough in
:
markdown
~~Lesson text here~~ *(resolved: [date or brief reason])*
Archiving: When
exceeds 50 resolved (struck-through) entries, move all resolved lessons to
lessons-archive-YYYY-MM.md
and remove them from the active file. Keep only open lessons in the active file.
Stale Lesson Detection
When reading
during context recovery, check if any lessons are outdated — library upgrades, removed constraints, resolved workarounds. Flag to the user: "Lesson [X] may be stale — [reason]. Want me to resolve it?"
Context Recovery Priority
On any new session or
, read in this order:
- — what is this project, what happened
- — what not to do
- ⚑-flagged notes — critical details the index can't capture
- Last 3 notes — recent context
- — current snapshot (if exists)
Rules
- Never prompt on /notebook save. Infer everything from context and arguments.
- Quick format by default. Full format is rare — major architectural decisions only.
- Rich index entries. The index alone should be sufficient for context recovery.
- Be specific. Library names, error messages, versions > vague descriptions.
- Failures are gold. "Tried X, failed because Y" prevents loops. Always save these.
- One note per save. Don't batch multiple insights.
- ⚑ sparingly. Only for things every future session must read.
- Notes are append-only. New moment = new note. Update existing only to mark superseded.
- Lessons are distilled. One line, pure signal. If you need context, open the note.