This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run dev # Development mode with esbuild watch (hot rebuild)
npm run build # Type-check (tsc --noEmit) then production bundleNo test or lint scripts are configured.
Single-file plugin (main.ts → compiled to main.js). All logic lives in AutoDonePlugin and a AutoDoneSettingTab class.
- Snapshot diffing — on
active-leaf-changeandfile-open, the plugin callstakeSnapshot()to record checkbox states (line number → checked). On everyeditor-change,handleEditorChange()diffs the current editor against the snapshot to detect newly-checked items. - Move logic —
moveItemToDone()removes the checked item (+ optional sub-items viacollectItemBlock()) and inserts it at the top of the## Donesection.findDoneHeadingLine()locates that heading; if absent, the section is appended. - Guard flag —
isProcessingprevents re-entry when the plugin itself triggers editor changes during a move. - Manual sweep —
sweepCheckedItems()command moves all currently-checked items at once.
| Field | Default | Purpose |
|---|---|---|
doneHeading |
"Done" |
Heading text for the Done section |
headingLevel |
2 |
Markdown heading level (##) |
moveSubItems |
true |
Include indented child items |
addTimestamp |
false |
Append completion date |
timestampFormat |
"YYYY-MM-DD" |
Date format string |
esbuild bundles to CommonJS (main.js), targeting ES2018, with all Obsidian/Node built-ins marked external. manifest.json controls plugin identity and min app version.