Update dendron module notes for changed Python files. Checks staged files first, then falls back to modified (unstaged) files. Appends dated sections and stages updated notes. Run before /update-tasks-weekly and /commit.
Update dendron module notes for Python files that have changed. Module notes are staged when done. Use /update-tasks-weekly separately to update the weekly note.
(edit python) -> /update-py-notes -> /update-tasks-weekly -> /commit
This skill accepts optional file path arguments. Behavior depends on whether arguments are provided:
/update-py-notes swanki/config.py): update only the specified files. Uses git diff HEAD -- <file> to get the diff (covers both staged and unstaged changes). If a file has no diff against HEAD (e.g., new untracked file), read the full file content instead..py files (see Step 1 for the staged-then-modified fallback).If no files are found (no args, nothing staged, nothing modified), inform the user and stop.
git diff --cached --name-only -- '*.py' to get staged .py files.git diff --name-only -- '*.py' to get unstaged modified .py files.Report which tier was used (staged vs. modified) so the user knows.
If the resulting list is empty after both tiers, inform the user and stop. Do not proceed to later steps.
For each target .py file, derive the dendron note path by converting path separators to dots and dropping .py:
| Python file | Dendron note |
|---|---|
swanki/config.py | notes/swanki.config.md |
swanki/processing/pdf_processor.py | notes/swanki.processing.pdf_processor.md |
Rules:
.py file can be synced -- package modules, scripts, tests, etc..py: swanki/processing/pdf_processor.py > swanki.processing.pdf_processornotes/<dendron_path>.mddendron-cli note write (see Step 2b).For each target file whose dendron note does not exist, create it:
dendron-cli note write --fname "<dendron_path>"
For example, swanki/processing/new_module.py with no note:
dendron-cli note write --fname "swanki.processing.new_module"
This creates notes/swanki.processing.new_module.md with proper dendron frontmatter. The note is then treated as an existing note in Step 3 (it will get a dated section appended).
Important: dendron-cli creates notes that end with ---\n and no trailing blank line. When editing these newly created notes, match on the unique created: timestamp line + --- rather than trying to match --- followed by a blank line.
Track which notes were newly created for the summary in Step 5.
For each module note that exists:
git diff HEAD -- <python_file> (covers staged + unstaged). If this returns empty (new untracked file), read the full file content instead.git diff --cached -- <python_file>git diff -- <python_file>## YYYY.MM.DD).## YYYY.MM.DD - Brief Title
One-paragraph summary describing what changed and why.
### Subsection (optional)
- Bullet points with specifics
- Code snippets in fenced blocks where helpful
Writing guidelines (intentional stance -- "why the change, for what"):
Run git add <note_path> for each module note that was modified in Step 3.
After all steps, print a summary:
Source: staged files (or: modified files -- nothing was staged)
Created notes:
- swanki.processing.new_module (new)
Updated module notes:
- swanki.config (updated existing 2026.02.11 section)
- swanki.processing.new_module (added new 2026.02.11 section)
All module notes staged. Run /update-tasks-weekly to update the weekly note.
dendron-cli note write -- never with the Write tool (which would lack proper frontmatter).--- block at the top of notes)./update-py-notes -- auto-discover: staged files first, then modified files/update-py-notes swanki/config.py -- update a specific module/update-py-notes swanki/processing/pdf_processor.py swanki/processing/image_processor.py -- update multiple files