This document describes the correct workflow for creating and updating notes to avoid incomplete documents, broken links, and overwritten metadata.
Use this note for the overall create/update workflow. Use MCP Note Editing Guide for the mechanics of MCP patch, batch, put, reorder and table_op edits.
Before writing any content for a new topic area, sketch the parent/child split. The natural instinct is to put everything in one note first and split it later. This is the megadoc trap — splitting a finished megadoc is harder than writing focused notes from the start, and the split rarely happens cleanly after the fact.
Ask: what are the distinct questions a reader might want to answer? Each answer is a note. A note that answers three different questions should be three notes. This matters for LLMs too: a focused 20-block note loaded on demand costs far less context window than a 100-block megadoc loaded because one fact in it was needed.
Correct order: create children first, then update the parent.
When you need to create multiple related notes:
1. Create all child notes first with complete content.
2. Read the parent page to preserve existing content, links, and metadata.
3. Update the parent page to add links to the children.
4. Verify all links resolve correctly.
• Avoids uploading incomplete parent documents with empty sections.
• Child notes exist before being referenced.
• Clear sequential workflow - no partial states.
• Easier to verify completeness before linking.
CLI / raw HTTP: create or edit a complete JSON file, then load/PUT the whole document. Use ~/tmp/ for scratch files.
MCP: use put for complete child notes and deliberate structural rewrites; use patch or batch for targeted block edits after reading with include_block_ids: true. See MCP Note Editing Guide.
Suppose you want to document a new feature with three aspects: design, implementation, and testing.
Step 1: create child notes with full content.
# CLI example: create ~/tmp/design.json with complete content
notes load -d project/feature-design ~/tmp/design.json
# MCP equivalent: put(key="project/feature-design", value=<complete JSONHTL document>)
Step 2: read the parent to preserve existing content.
notes read project
# MCP equivalent: get(key="project", include_block_ids=true)
Step 3: update the parent with links to children.
# CLI: edit ~/tmp/project-updated.json, preserving metadata and existing links
notes load -d project ~/tmp/project-updated.json
# MCP: use put for a structural rewrite, or batch/patch for a small targeted addition
Do not:
• Upload a parent with links to children that do not exist yet.
• Upload a parent with placeholder sections like "TODO: add content".
• Upload a parent, then realise you need children, then update again as part of the same planned structure.
While JSONHTL permits links to non-existent documents, uploading a parent with hanging links creates confusion:
• Readers see broken links and think content is missing.
• It is harder to track what is complete vs incomplete.
• It creates an intermediate incomplete state.
When modifying an existing note:
1. Read the current version.
2. Preserve all existing links to children.
3. Preserve metadata: title, version, created, tags, and any domain-specific fields.
4. Increment version and set updated to today's date.
5. Use the safest write path for the edit size: targeted MCP patch/batch for simple block changes; whole-document put/load for structural rewrites.
6. Read back the note and verify the changed section, metadata, and links.
Creating linked notes:
1. Create all children with complete content.
2. Read parent.
3. Update parent to link children.
4. Verify links resolve.
Updating existing note:
1. Read current version.
2. Preserve metadata and links.
3. Increment version, add updated date.
4. Write through the safest path for the edit.
5. Read back and verify.
See also: Avoiding Orphaned Notes and MCP Note Editing Guide.
Always use ~/tmp/ (i.e. $HOME/tmp/) for scratch files, not /tmp/. This avoids permission issues on multi-user systems and keeps scratch files in a predictable personal location. Create the directory if needed: mkdir -p ~/tmp.