{"skill":{"slug":"todolist-md-clawdbot-copy","displayName":"Todolist Md Clawdbot Copy","summary":"Read, summarize, propose edits, and write back changes to Markdown todo files using line-stable bot markers without altering task identity or completing tasks.","description":"---\nname: todolist-md-clawdbot\ndescription: Operate on todolist-md Markdown todo files. Read + summarize tasks, propose edits, and write outcomes back into Markdown using only <!-- bot: ... --> markers (line-stable write-back).\n---\n\n# todolist-md-clawdbot\n\nOperate on **todolist-md**: a Markdown-first todo viewer/editor. The app does not contain an AI; the bot reads/writes Markdown.\n\n## Operating rules (must follow)\n\n1) Markdown is the system of record.\n- It’s fine to discuss in chat, but final answers/decisions must be written into Markdown.\n\n2) Use only bot markers of this form.\n- `<!-- bot: ... -->`\n- Do not introduce other syntaxes (no `Question[id=...]`, no custom metadata blocks).\n\n3) Preserve task identity.\n- todolist-md derives task IDs from Markdown line positions.\n- Some storage backends also have a stable identity key (e.g. Drive `fileId`, local `path`, S3 `bucket+key`).\n- Do not “replace” a file in a way that changes its identity key unless the user explicitly accepts it.\n\n4) Keep write-back edits line-stable.\n- Avoid adding/removing lines inside an existing task item or its description blockquote.\n- Prefer single-line, in-place edits (edit text on an existing line).\n\n5) Last review stamp (Option B: top-of-file header line)\n- Goal: a single line near the top recording last bot review time.\n- Rule: **never insert a new line** once the header exists. Only update the existing header line.\n- If the header does not exist, you may insert it at the very top **only if the user explicitly opted into Option B**.\n- Canonical format:\n  - `<!-- bot: last_review --> 2026-02-04T15:39Z root=<rootFolderId> model=<model>`\n\n6) Never complete tasks without explicit user confirmation.\n\n## Markdown conventions (what todolist-md expects)\n\n- Tasks use GFM checkboxes: `- [ ]` and `- [x]`\n- Optional tags: `#tag`\n- Optional due date: `due:YYYY-MM-DD`\n- Optional description: a blockquote directly under the task\n\n## Storage Q/A (first run)\nAsk once, then persist the answers (in memory/config) for future runs.\n\n- Q: `storageKind`?\n  - A: `google-drive` | `local-folder` | `s3` | `other`\n- Q: What is the stable identity key for files?\n  - Drive: `fileId`\n  - Local: `path`\n  - S3: `bucket+key`\n- Q: Where is the root?\n  - Drive: `rootFolderId`\n  - Local: root directory path\n  - S3: `bucket` + optional prefix\n\n## Chrome app integration: enable/disable per-file\nWhen a Drive folder contains many `.md` files, not all of them should necessarily be AI-reviewed.\n\n**Recommendation (simple + app-controlled):**\n- The Chrome app should write a small per-file config key/marker so the agent can know whether a file is opted-in.\n\nTwo easy options:\n\n### Option 1: a dedicated Drive config file (preferred)\nCreate a config file in the same folder:\n- `.todolist-md.config.json`\n\nExample:\n```json\n{\n  \"ai\": {\n    \"enabled\": true,\n    \"include\": [\"*.md\"],\n    \"exclude\": [\"todoapp.md\"],\n    \"botSuggestedSectionTitle\": \"Tasks (bot-suggested)\"\n  }\n}\n```\n\nThe agent should:\n- Download `.todolist-md.config.json` when it changes.\n- Only review files that match include/exclude rules.\n\n### Option 2: an in-file marker (works without JSON)\nAdd a single line near the top of the markdown file:\n- `<!-- bot: ai_enabled --> true`\n\nThe agent should only review files containing that marker.\n\n## Review cadence + stamping (save credits)\n**Do not call an LLM unless a file changed.** Use code-first change detection.\n\n### Step 0: Detect changes (code-first)\n- For each `.md` under root, compare `modifiedTime`/`size` (or `etag` when available) against a local state file.\n- If unchanged since last scan: **skip** (no download, no LLM).\n\n### Step 1: Review only changed files\n- Only for changed files:\n  - Download the file\n  - Extract open tasks (`- [ ]`) and relevant context\n  - (Optional) call the LLM on the extracted subset, not the full document\n\n### Step 2: Write-back only if content changed\n- Before writing back, compute a hash; if no changes, do not write.\n\n### Step 3: Stamp last review (Option B)\n- For each reviewed file, update (not append) the top-of-file header line:\n  - `<!-- bot: last_review --> <ISO_UTC> root=<rootFolderId> model=<model>`\n\n### Reference script (Google Drive + gog)\nIf you use **Google Drive** as storage, gog CLI flags matter. In gog v0.9.0+:\n- list folder: `gog drive ls --parent <folderId> --json`\n- download: `gog drive download <fileId> --out <path>`\n- run gog as `ubuntu` and download to `/tmp` (because `/root` is typically `700`)\n\nIncluded helper scripts:\n- `skills/todolist-md-clawdbot/scripts/todolist_drive_folder_agent.mjs`\n  - **single script for everything** (Drive folder runner): lists all `.md` under a folder, detects changes via state file, downloads only changed files, and writes back a `<!-- bot: suggested -->` block under a dedicated section title.\n  - uses Drive API `files.update` to overwrite-update the same `fileId` (no duplicates).\n  - includes a revision gate (headRevisionId) to avoid overwriting while you edit in Chrome.\n  - Managed OAuth mode (recommended): stores its own refresh token file; first run prints an auth URL, you approve in browser, then rerun with `--authCode <CODE>`.\n  - **minimum-token design**: does not call LLM unless a file changed, and should send only extracted open tasks (not full file).\n\n- `skills/todolist-md-clawdbot/scripts/todolist_agent_entrypoint.mjs`\n  - single-file helper (useful for debugging): download by fileId + overwrite-update\n\nExample:\n```md\n- [ ] Update README for bot workflow #docs due:2026-02-05\n  > Include quick start and a worked example\n```\n\n## Bot markers (allowed)\n\n- `<!-- bot: suggested -->` for bot-suggested sections\n- `<!-- bot: question -->` for in-file Q/A\n- `<!-- bot: digest -->` for summaries/digests\n- `<!-- bot: note -->` for short audit notes (optional)\n\n## LLM handoff (prepare/apply) — minimum-token workflow\n\nWhen you want LLM help but must keep Drive as the source of truth (and keep costs low), use the **two-stage** flow:\n\n### Stage 1: prepare\nGoal: generate a compact JSON request for the OpenClaw agent runtime (LLM), without calling any LLM from the Node script.\n\nWhat happens:\n1) List folder files (cheap; no downloads)\n2) Compare each file's `modifiedTime/size` against a local state file\n3) Download only changed `.md`\n4) Extract only open tasks (`- [ ] ...`, max N lines)\n5) Write `llm_request.json`\n\nCommand example (single file):\n```bash\nnode skills/todolist-md-clawdbot/scripts/todolist_drive_folder_agent.mjs \\\n  --folderId <rootFolderId> \\\n  --onlyName vyond.md \\\n  --mode prepare \\\n  --requestOut outputs/todolist-md/vyond_llm_request.json\n```\n\n### Stage 2: apply\nGoal: take a suggestions JSON (produced by the agent runtime) and write it back **only** to a dedicated bot section.\n\nRules:\n- Update only under:\n  - `## Tasks (bot-suggested)`\n  - `<!-- bot: suggested -->`\n- Never mark tasks complete.\n- Use Drive API overwrite update by `fileId` (no duplicates).\n- Use a revision gate (`headRevisionId`) to avoid overwriting while you edit in Chrome.\n\nSuggestions JSON shape:\n```json\n{\n  \"schema\": \"todolist-md.llm_suggestions.v1\",\n  \"items\": [\n    {\n      \"fileId\": \"...\",\n      \"name\": \"vyond.md\",\n      \"suggested_markdown\": \"- [ ] ...\\n  > <!-- bot: note --> ...\"\n    }\n  ]\n}\n```\n\nCommand example:\n```bash\nnode skills/todolist-md-clawdbot/scripts/todolist_drive_folder_agent.mjs \\\n  --folderId <rootFolderId> \\\n  --mode apply \\\n  --suggestionsIn outputs/todolist-md/vyond_llm_suggestions.json\n```\n\n### Why this saves tokens\nExample: if a folder has 50 Markdown files, but only 1 changed:\n- LLM is called **only for that 1 file**.\n- The prompt includes only extracted open tasks (`- [ ] ...`), not the entire Markdown.\n\n## Write-back patterns\n\n### Bot-suggested tasks\n\nPut bot-generated tasks under a dedicated section so humans can review before adopting.\n\n```md\n## Tasks (bot-suggested)\n\n<!-- bot: suggested -->\n- [ ] Add a “Bot Log” section\n```\n\n### In-file Q/A (detail blockquote, line-stable)\n\nAsk a question using the detail blockquote line under the task:\n\n```md\n- [ ] Deploy v2.0 to production #backend\n  > <!-- bot: question --> Which CI job is failing? Options: unit / integration / e2e\n```\n\nAnswer by adding an inline answer on the same line to keep line-stable:\n\n```md\n- [ ] Deploy v2.0 to production #backend\n  > <!-- bot: question --> Which CI job is failing? Options: unit / integration / e2e Answer: integration\n```\n\nRules:\n- Prefer one active Q/A per task at a time.\n- Keep the Q/A inside the blockquote detail area.\n- Do not start multi-line threads beyond the single question and optional answer line.\n\n### Archive Q/A to Bot Log (preferred once answered)\n\nIf you want to keep tasks clean while preserving history:\n\n1) Append an entry to `## Bot Log`.\n2) Replace the original Q/A line in-place with a short placeholder:\n\n```md\n  > <!-- bot: question --> (archived to Bot Log)\n```\n\n## Bot Log (append-only)\n\nCreate (if missing):\n```md\n## Bot Log\n```\n\nAppend entries like:\n```md\n- 2026-02-01 Task: Deploy v2.0 to production\n  Q: Which CI job is failing?\n  A: integration\n```\n\n## Summaries\n\n- Summarize in chat for fast feedback.\n- Optionally write a digest into Markdown as a single comment line:\n\n```md\n<!-- bot: digest --> Top 3 next actions: 1) … 2) … 3) …\n```\n\n## Worked example (end-to-end)\n\nStart state:\n\n```md\n## Work\n\n- [ ] Deploy v2.0 to production #backend due:2026-02-05\n  > Runbook: docs/deploy.md\n\n## Tasks (bot-suggested)\n<!-- bot: suggested -->\n- [ ] (suggested) Add a “Bot Log” section\n```\n\nBot asks a clarifying question (in-file):\n\n```md\n- [ ] Deploy v2.0 to production #backend due:2026-02-05\n  > Runbook: docs/deploy.md\n  > <!-- bot: question --> Which CI job is failing? Options: unit / integration / e2e\n```\n\nUser answers by editing the same line (line-stable):\n\n```md\n  > <!-- bot: question --> Which CI job is failing? Options: unit / integration / e2e Answer: integration\n```\n\nAfter the bot consumes the answer, archive it (preferred):\n\n```md\n  > <!-- bot: question --> (archived to Bot Log)\n\n## Bot Log\n- 2026-02-04 Task: Deploy v2.0 to production | Q: Which CI job is failing? | A: integration\n```\n\n## Integration notes (minimal)\n\n- Always mark bot-written content with `<!-- bot: ... -->`.\n- Never delete/add lines inside an existing task item or description block.\n- Never mark tasks complete unless the user explicitly confirms.\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":1118,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1771095587133,"updatedAt":1779077049850},"latestVersion":{"version":"1.0.0","createdAt":1771095587133,"changelog":"Initial release of todolist-md-clawdbot.\n\n- Enables reading, summarizing, and editing Markdown todo files using stable bot comment markers (`<!-- bot: ... -->`).\n- Ensures task identities persist by only making line-stable edits.\n- Integrates with multiple storage backends (Google Drive, local folder, S3) and supports per-file enablement.\n- Only reviews files that have changed and writes back outcomes without marking tasks complete without user confirmation.\n- Provides helper scripts for Google Drive integration to automate detection and processing.\n- Introduces dedicated bot-comment sections for suggested tasks, summaries, and in-file Q&A.","license":null},"metadata":null,"owner":{"handle":"nitsujy","userId":"s177fc08nk11eebpm7487aywx18859pj","displayName":"NitsujY","image":"https://avatars.githubusercontent.com/u/2851659?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779967447689}}