Flomo Local API
Overview
Use this skill for fast flomo access when local desktop auth is available.
When the user wants to create or revise a memo:
- Tag reuse is required: Prefer the user's existing flomo tag system over inventing new tags. Aim for existing-tag reuse in at least 95% of memo-writing cases.
- Title required by default: For every new memo written for Zeeland, start with a concise title. Unless the user asks for no title, render the title as bold in flomo.
- Use flomo-native formatting, not Markdown syntax: flomo does not render Markdown syntax such as
**bold**, - [ ] checkboxes, or # headers. For bold titles, use the CLI's --html mode and wrap the title in <strong>...</strong>. Use plain paragraphs for the body.
This skill now supports direct text edits to existing memos through the same local auth flow, including when the user provides a flomo memo URL like https://v.flomoapp.com/mine/?memo_id=....
Preconditions
flomo.app has been logged in on this Mac before
- Local flomo storage exists under
~/Library/Containers/com.flomoapp.m/...
- The request can be handled with local auth and API access
Use This Skill When
- The user asks to search flomo memos by keyword, tag, or time range
- The user asks whether flomo memos contain images or attachments, or wants image URLs included in read/export output
- The user asks what they have been thinking about recently
- The user wants monthly markdown export or tag statistics
- The user wants to create a simple memo without Chrome UI automation
- The user wants to edit an existing text memo by slug or by flomo memo URL without opening the Web UI
- The user wants faster querying than Chrome UI automation
- The user wants a draft memo that fits their existing flomo tag taxonomy before creating it
Do Not Use This Skill When
- The user wants to delete a memo
- The user wants to operate through the live Web UI
- The local desktop login state is missing or broken and the request cannot be completed from local auth
Default Workflow
- Use
scripts/flomo_local_api.py.
- Prefer
query for direct lookup.
- Prefer
summarize for reflective prompts such as "最近在想什么".
- Prefer
export-monthly when the user wants markdown output.
- Use
--include-files on query or export-monthly when the user asks about images, attachments, screenshots, audio, or media in memos.
- Before creating or editing a memo with tags, inspect the user's existing tag taxonomy with
tags.
- Draft a short title first, then the memo body, then choose 1-4 tags by reusing existing tags that are already in the system.
- For ordinary memo creation/editing, use
--html when a bold title is needed; otherwise use plain text mode only when the user explicitly does not want formatted title output.
- Prefer
create for lightweight memo creation without attachments.
- Prefer
edit for updating the text content of an existing memo by slug or memo_id URL.
- Treat delete as out of scope unless the skill is expanded again later.
- When the user says "最近 N 条", "latest N", or "recent N", sort by
created_at newest-first before selecting the N memos, and verify the selected timestamps before editing.
- For batch tagging existing memos, default to 3 tags per memo unless the user gives a different count. Apply the count to every selected memo, including memos that already have tags. Preserve good existing tags, add or replace only enough trailing hashtag text to reach the requested count, and verify the final
tag_count for each memo.
Commands
Command Template
Set the script path from the current environment instead of a hardcoded user directory:
SKILL_ROOT="${CODEX_HOME:-$HOME/.codex}/skills/flomo-local-api"
SCRIPT="$SKILL_ROOT/scripts/flomo_local_api.py"
Query
Use for direct search by keyword, tag, date range, or recent window.
python3 "$SCRIPT" query --keyword "openclaw" --limit 10
python3 "$SCRIPT" query --tag "Proj/mf" --days 30
python3 "$SCRIPT" query --start-date 2026-03-01 --end-date 2026-03-11 --format markdown
python3 "$SCRIPT" query --limit 5 --sort newest
python3 "$SCRIPT" query --keyword "截图" --limit 5 --include-files --format json
python3 "$SCRIPT" query --days 7 --include-files --format markdown
query returns newest-first by default. Use --sort oldest only when the user explicitly asks for earliest or chronological results.
query results include both slug and the corresponding flomo memo URL so later edit steps can reuse them directly.
Use --include-files when the user asks about images or attachments. JSON output includes a files array with safe attachment metadata (id, type, name, size, url, and thumbnail_url). Markdown output renders image attachments as Markdown image links and non-image attachments as ordinary links.
Summarize
Use for "我最近在关注什么 / 最近状态如何" style requests.
python3 "$SCRIPT" summarize --days 30
python3 "$SCRIPT" summarize --days 90 --limit 80
Export Monthly
Use when the user wants a monthly markdown dump plus tag-stats.md.
python3 "$SCRIPT" export-monthly
python3 "$SCRIPT" export-monthly --output-dir ~/download/flomo-markdown-export-monthly
python3 "$SCRIPT" export-monthly --include-files --output-dir ~/download/flomo-markdown-export-monthly-with-images
Use --include-files when the exported Markdown should preserve image links. Without it, monthly exports keep the previous compact behavior and only record attachment counts as - files: N.
Tags
Use when the user wants to create or edit a memo and you need to reuse the existing tag system instead of inventing new tags.
python3 "$SCRIPT" tags --roots-only --limit 20
python3 "$SCRIPT" tags --query "agent" --limit 20 --min-total-count 2
python3 "$SCRIPT" tags --prefix "area/ai/agent" --limit 20 --format markdown --min-total-count 2
python3 "$SCRIPT" tags --query "设计" --days 365 --limit 20 --min-total-count 2
Recommended pattern for memo writing:
- Draft a concise title first, then the memo body without tags.
- Extract 2-5 likely concepts from the title and body.
- Start with one cheap scan:
tags --roots-only --limit 12.
- Then make at most 2 focused lookups, usually one concrete entity query and one abstract theme query. If the memo names a specific project, person, product, or proper noun, spend the first focused lookup on that exact entity string before abstract theme queries. Prefer
--min-total-count 2.
- If a root is obvious, prefer one
--prefix lookup inside that subtree over spraying many synonym queries.
- Reuse 1-4 existing tags, preferring mature path tags with repeated usage.
- Stop once you have 2 strong tags and at most 1-2 optional supporting tags. Do not keep searching just to exhaust every possible synonym.
- If the best hit is a singleton leaf under an unfamiliar root, widen once and prefer a broader, better-established parent or nearby mature sibling.
- If the memo clearly centers on a named project, person, or product and an existing
Proj/*, p/*, or product tag exists, include that concrete taxonomy tag before adding more generic thematic tags.
- When an exact or near-exact named-entity tag is found, treat it as required evidence, not optional flavor. Do not drop it in favor of only abstract theme tags.
- Only create a new tag when there is no close existing tag. If you do, tell the user briefly why reuse was not possible.
Search budget:
- Default budget is 3 tag lookups total:
- 1 roots-only scan
- 1 focused entity/theme lookup
- 1 optional disambiguation lookup
- Going beyond 3 lookups needs a clear reason, such as no mature match after the first pass.
- Avoid synonym fan-out like querying
prompt, eval, policy, rules, safety, design, comment one by one unless earlier results were genuinely inconclusive.
Batch Tagging
Use when the user asks to tag recent memos, add tags to multiple memos, or make every selected memo have a fixed number of tags. If the user does not specify a tag count, use exactly 3 tags per memo by default.
Workflow:
- Select the target memos first. For "最近 N 条" or "latest N", use newest-first ordering and show or internally confirm the
created_at, slug, existing tags, and a short snippet before editing.
- Inspect existing tag taxonomy with
tags. Reuse concrete Proj/*, p/*, product, or person tags when they match named entities; otherwise use mature thematic tags.
- If a memo already has tags, treat them as candidates to preserve, not as a reason to skip the memo.
- Each selected memo must end with the requested tag count, or exactly 3 parsed tags when no count is specified. Prefer preserving the strongest existing tags and adding mature supporting tags.
- When rewriting tag lines, remove only trailing hashtag-only lines, then append one final hashtag line that exactly matches the selected tags. Do not alter the memo body.
- After editing, query or fetch the selected memos again and verify each memo's parsed
tags and tag_count.
For ad-hoc batch edits, a small Python helper may import flomo_local_api.py and call fetch_memo_by_slug, plain_text_to_html, api_put, and add_derived_fields directly. Keep the helper ephemeral unless the user asks to persist it.
Create
Use when the user wants to quickly create a text memo from local auth.
Text Formatting Note: flomo does not render Markdown syntax (e.g., **bold**, # headers, lists). For Zeeland's memos, add a concise bold title by using --html and a first paragraph like <p><strong>Title</strong></p>:
- For the title: use raw HTML
<strong>...</strong> with --html, not **...**.
- For emphasis inside the body: prefer
「」 quotes or direct wording instead of extra bold.
- For lists: use simple line breaks or plain bullets like
• only when they read naturally.
- Do NOT use checkboxes or todo lists in flomo memos; flomo is for recording thoughts, not task management
- Keep paragraphs separated by blank lines for readability
# Plain-text mode is available for tests or explicit no-format requests.
python3 "$SCRIPT" create --content "测试 memo #codex/demo"
printf '第一行\n\n第二段 #codex/demo\n' | python3 "$SCRIPT" create --stdin
# For Zeeland's normal memos, prefer this HTML form so the title is actually bold in flomo.
cat <<'EOF' | python3 "$SCRIPT" create --stdin --html
<p><strong>Memo title</strong></p><p>Memo body in plain paragraphs.</p><p>#area/ai/agent/skill</p>
EOF
Edit
Use when the user wants to update the text of an existing memo and already has either the memo slug or a flomo memo URL.
Text Formatting Note: Same as create — for Zeeland's memos, preserve or add a first bold title paragraph with --html unless the user asks otherwise. Do not fake bold with Markdown syntax.
python3 "$SCRIPT" edit --slug "MTIzMDgzNzgz" --content "更新后的 memo 内容 #codex/demo"
python3 "$SCRIPT" edit --url "https://v.flomoapp.com/mine/?memo_id=MTIzMDgzNzgz" --content "更新后的 memo 内容 #codex/demo"
printf '第一行修改后\n\n第二段也更新\n' | python3 "$SCRIPT" edit --slug "MTIzMDgzNzgz" --stdin
Output Conventions
query --format json returns structured memo hits
query --format markdown returns a readable markdown list
query --include-files returns or renders attachment metadata, including image url and thumbnail_url when flomo provides them
summarize returns memo counts, top tags, and supporting memos
export-monthly writes one markdown file per month plus tag-stats.md
export-monthly --include-files renders image attachments as Markdown image links and non-image attachments as ordinary links
tags returns existing tag rows with tag, depth, parent, direct_count, total_count, and supports --min-total-count for filtering toward mature tags
create returns the created memo payload with parsed markdown and tags
edit returns the updated memo payload with parsed markdown and tags
- When
create or edit is used with --html, verify the returned content starts with <p><strong>... for titled memos, and verify the returned tags match the selected tags.
- Monthly memo files keep only
created_at metadata by default
- When producing
tag_decision.json, selected_tags must use the raw existing tag strings from inventory, without a leading #. The memo body can render them as hashtags, but the JSON list should stay normalized.
- Finalize
selected_tags first, then render exactly those same tags in the memo body as hashtags. Do not widen, shorten, or swap a parent/child variant between tag_decision.json and draft.md.
Implementation Notes
- The update path is
PUT /memo/<slug> using the same local auth token and request signing as the other commands.
- flomo memo payloads can include a
files array. Read paths may expose attachment metadata and image URLs with --include-files; write paths do not upload new attachments.
edit preserves the memo's current files and pin state so a text update does not accidentally drop attachments or pin status.
- flomo share links of the form
https://v.flomoapp.com/mine/?memo_id=... can be used directly; the skill extracts memo_id as the target slug.
tags is the default lookup tool for existing tag reuse. It is intentionally read-only and fast enough to call before most memo-writing requests.
- For live-user edits, prefer small and explicit changes unless the user clearly asks for a rewrite.
- For capability verification, use an idempotent marker string or a temporary test memo, then confirm by reading the updated payload.
Tag Reuse Policy
For memo creation and memo edits that touch hashtags, follow this policy by default:
- Reuse before inventing. The user's existing tag taxonomy is the source of truth.
- Aim for existing-tag reuse in at least 95% of memo-writing cases.
- Prefer established roots already common in the user's system, such as
self/, area/, Proj/, 产品/, p/, resources/, Book/, others/, TODO/, and SL/.
- Prefer mature tags with repeated usage (
total_count >= 2) over singleton leaves when both are plausible.
- If the memo explicitly names an existing project, person, or product, prefer attaching that concrete existing taxonomy tag as one of the selected tags.
- If an exact or near-exact existing project/person/product tag is found for the memo's named entity, include it as one of the selected tags unless the mention is clearly incidental.
- Prefer the closest existing leaf tag when a clear match exists.
- If several existing tags are plausible, prefer an existing broader parent over inventing a new leaf.
- Treat singleton leaves under weak or unfamiliar roots as weak evidence, not default choices.
- Keep tags sparse for single-memo create/edit flows. Default to 1-4 tags for a single memo unless the user asks for more. For batch tagging existing memos, default to exactly 3 tags per memo.
- Prefer fewer, better tags over exhaustive tagging. Retrieval quality matters more than semantic completeness.
- Avoid English-only ad hoc tags when the user's existing taxonomy already has a better-fitting path tag.
- If no close existing tag is found, you may introduce at most one new tag, and you should mention that choice explicitly.
- In structured outputs such as
tag_decision.json, never prepend # to the stored tag names. Use self/反思, not #self/反思.
draft.md hashtags must exactly correspond to selected_tags after adding #. If you chose Proj/rudder/想法, the draft should contain #Proj/rudder/想法, not #Proj/rudder.
Examples:
- Bad:
#AI/claude-code #prompt-engineering when the user's taxonomy already contains nearby tags under area/ai/agent/*, 产品/*, or 编程/*.
- Better: inspect
tags --query "agent" --min-total-count 2, tags --query "coding" --min-total-count 2, tags --query "prompt" --min-total-count 2, or tags --query "产品" --min-total-count 2 first, then reuse the closest mature existing tags.
Safety Rules
- Only use
create when the user explicitly asks for a new memo
- Only use
edit when the user explicitly asks to modify an existing memo
query --include-files and export-monthly --include-files are read/export features only; do not imply that this skill can upload, delete, OCR, or rewrite attachment files
edit preserves the memo's current files and pin state; it is for text updates, not attachment management
- Do not invent new tags casually; check existing tags first with
tags
- Do not delete flomo memos from this skill
- Do not persist extra raw dumps unless the user explicitly asks
- Treat summaries as patterns from memo evidence, not diagnoses
- Never use Markdown syntax (bold, headers, lists, checkboxes) in memo content — flomo renders it as plain text. The only default bold formatting for Zeeland's memo title should be raw HTML
<strong> sent through --html.
- Never create task lists or checkboxes in flomo memos; flomo is for capturing thoughts and reflections, not task management
Validation Cases
Case: Create a normal research memo
Input:
User asks to write a flomo memo about a paper or idea.
Expected behavior:
Draft a concise title, inspect existing tags, create the memo with --html, render the first paragraph as <p><strong>Title</strong></p>, put body paragraphs after it, append the selected existing hashtags, and verify the returned content and tags.
Must not:
Use **Title**, Markdown headers, checkboxes, or omit the title.
Case: Edit an existing memo after style feedback
Input:
User asks to optimize or humanize a memo that lacks a title.
Expected behavior:
Fetch or use the known memo slug, rewrite the memo with a concise bold title via --html, preserve appropriate existing tags, and verify the returned memo payload.
Must not:
Only rewrite prose while leaving the memo untitled, or replace mature existing tags with newly invented tags.
Case: Read memo images
Input:
User asks whether the API can read images in flomo memos or asks to inspect memos with screenshots.
Expected behavior:
Use query --include-files or a direct read helper to check the raw memo files array, report whether image attachments are present, and mention that available fields include image url and thumbnail_url when flomo provides them.
Must not:
Answer from the text-only snippet field, claim images are unavailable because default query output omits them, or attempt to edit/upload attachments.
Case: Export monthly notes with image links
Input:
User asks to export flomo notes to Markdown and preserve images.
Expected behavior:
Run export-monthly --include-files --output-dir <target>, then verify at least one exported monthly file contains Markdown image links for image attachments when matching memos have files.
Must not:
Only write - files: N counts when the user explicitly asked to preserve images, or download/persist extra raw files unless the user asked for local attachment downloads.
Resources
scripts/
scripts/flomo_local_api.py: CLI for flomo query, summarize, export, lightweight create, and text edit
1---2name: flomo-local-api3description: Query, summarize, export, create, and edit a user's flomo memos through local desktop auth and the flomo API, without Chrome UI automation. Use for fast memo lookup, tag filtering, markdown export, attachment/image metadata reads, lightweight memo creation, or direct text edits to existing memos.4---56# Flomo Local API78## Overview910Use this skill for fast flomo access when local desktop auth is available.1112When the user wants to create or revise a memo:131. **Tag reuse is required**: Prefer the user's existing flomo tag system over inventing new tags. Aim for existing-tag reuse in at least 95% of memo-writing cases.142. **Title required by default**: For every new memo written for Zeeland, start with a concise title. Unless the user asks for no title, render the title as bold in flomo.153. **Use flomo-native formatting, not Markdown syntax**: flomo does not render Markdown syntax such as `**bold**`, `- [ ]` checkboxes, or `# headers`. For bold titles, use the CLI's `--html` mode and wrap the title in `<strong>...</strong>`. Use plain paragraphs for the body.1617This skill now supports direct text edits to existing memos through the same local auth flow, including when the user provides a flomo memo URL like `https://v.flomoapp.com/mine/?memo_id=...`.1819## Preconditions2021- `flomo.app` has been logged in on this Mac before22- Local flomo storage exists under `~/Library/Containers/com.flomoapp.m/...`23- The request can be handled with local auth and API access2425## Use This Skill When2627- The user asks to search flomo memos by keyword, tag, or time range28- The user asks whether flomo memos contain images or attachments, or wants image URLs included in read/export output29- The user asks what they have been thinking about recently30- The user wants monthly markdown export or tag statistics31- The user wants to create a simple memo without Chrome UI automation32- The user wants to edit an existing text memo by slug or by flomo memo URL without opening the Web UI33- The user wants faster querying than Chrome UI automation34- The user wants a draft memo that fits their existing flomo tag taxonomy before creating it3536## Do Not Use This Skill When3738- The user wants to delete a memo39- The user wants to operate through the live Web UI40- The local desktop login state is missing or broken and the request cannot be completed from local auth4142## Default Workflow43441. Use `scripts/flomo_local_api.py`.452. Prefer `query` for direct lookup.463. Prefer `summarize` for reflective prompts such as "最近在想什么".474. Prefer `export-monthly` when the user wants markdown output.485. Use `--include-files` on `query` or `export-monthly` when the user asks about images, attachments, screenshots, audio, or media in memos.496. Before creating or editing a memo with tags, inspect the user's existing tag taxonomy with `tags`.507. Draft a short title first, then the memo body, then choose 1-4 tags by reusing existing tags that are already in the system.518. For ordinary memo creation/editing, use `--html` when a bold title is needed; otherwise use plain text mode only when the user explicitly does not want formatted title output.529. Prefer `create` for lightweight memo creation without attachments.5310. Prefer `edit` for updating the text content of an existing memo by slug or `memo_id` URL.5411. Treat delete as out of scope unless the skill is expanded again later.5512. When the user says "最近 N 条", "latest N", or "recent N", sort by `created_at` newest-first before selecting the N memos, and verify the selected timestamps before editing.5613. For batch tagging existing memos, default to 3 tags per memo unless the user gives a different count. Apply the count to every selected memo, including memos that already have tags. Preserve good existing tags, add or replace only enough trailing hashtag text to reach the requested count, and verify the final `tag_count` for each memo.5758## Commands5960### Command Template6162Set the script path from the current environment instead of a hardcoded user directory:6364```bash65SKILL_ROOT="${CODEX_HOME:-$HOME/.codex}/skills/flomo-local-api"66SCRIPT="$SKILL_ROOT/scripts/flomo_local_api.py"67```6869### Query7071Use for direct search by keyword, tag, date range, or recent window.7273```bash74python3 "$SCRIPT" query --keyword "openclaw" --limit 1075python3 "$SCRIPT" query --tag "Proj/mf" --days 3076python3 "$SCRIPT" query --start-date 2026-03-01 --end-date 2026-03-11 --format markdown77python3 "$SCRIPT" query --limit 5 --sort newest78python3 "$SCRIPT" query --keyword "截图" --limit 5 --include-files --format json79python3 "$SCRIPT" query --days 7 --include-files --format markdown80```8182`query` returns newest-first by default. Use `--sort oldest` only when the user explicitly asks for earliest or chronological results.8384`query` results include both `slug` and the corresponding flomo memo URL so later edit steps can reuse them directly.8586Use `--include-files` when the user asks about images or attachments. JSON output includes a `files` array with safe attachment metadata (`id`, `type`, `name`, `size`, `url`, and `thumbnail_url`). Markdown output renders image attachments as Markdown image links and non-image attachments as ordinary links.8788### Summarize8990Use for "我最近在关注什么 / 最近状态如何" style requests.9192```bash93python3 "$SCRIPT" summarize --days 3094python3 "$SCRIPT" summarize --days 90 --limit 8095```9697### Export Monthly9899Use when the user wants a monthly markdown dump plus `tag-stats.md`.100101```bash102python3 "$SCRIPT" export-monthly103python3 "$SCRIPT" export-monthly --output-dir ~/download/flomo-markdown-export-monthly104python3 "$SCRIPT" export-monthly --include-files --output-dir ~/download/flomo-markdown-export-monthly-with-images105```106107Use `--include-files` when the exported Markdown should preserve image links. Without it, monthly exports keep the previous compact behavior and only record attachment counts as `- files: N`.108109### Tags110111Use when the user wants to create or edit a memo and you need to reuse the existing tag system instead of inventing new tags.112113```bash114python3 "$SCRIPT" tags --roots-only --limit 20115python3 "$SCRIPT" tags --query "agent" --limit 20 --min-total-count 2116python3 "$SCRIPT" tags --prefix "area/ai/agent" --limit 20 --format markdown --min-total-count 2117python3 "$SCRIPT" tags --query "设计" --days 365 --limit 20 --min-total-count 2118```119120Recommended pattern for memo writing:1211221. Draft a concise title first, then the memo body without tags.1232. Extract 2-5 likely concepts from the title and body.1243. Start with one cheap scan: `tags --roots-only --limit 12`.1254. Then make at most 2 focused lookups, usually one concrete entity query and one abstract theme query. If the memo names a specific project, person, product, or proper noun, spend the first focused lookup on that exact entity string before abstract theme queries. Prefer `--min-total-count 2`.1265. If a root is obvious, prefer one `--prefix` lookup inside that subtree over spraying many synonym queries.1276. Reuse 1-4 existing tags, preferring mature path tags with repeated usage.1287. Stop once you have 2 strong tags and at most 1-2 optional supporting tags. Do not keep searching just to exhaust every possible synonym.1298. If the best hit is a singleton leaf under an unfamiliar root, widen once and prefer a broader, better-established parent or nearby mature sibling.1309. If the memo clearly centers on a named project, person, or product and an existing `Proj/*`, `p/*`, or product tag exists, include that concrete taxonomy tag before adding more generic thematic tags.13110. When an exact or near-exact named-entity tag is found, treat it as required evidence, not optional flavor. Do not drop it in favor of only abstract theme tags.13211. Only create a new tag when there is no close existing tag. If you do, tell the user briefly why reuse was not possible.133134Search budget:135136- Default budget is 3 tag lookups total:137 - 1 roots-only scan138 - 1 focused entity/theme lookup139 - 1 optional disambiguation lookup140- Going beyond 3 lookups needs a clear reason, such as no mature match after the first pass.141- Avoid synonym fan-out like querying `prompt`, `eval`, `policy`, `rules`, `safety`, `design`, `comment` one by one unless earlier results were genuinely inconclusive.142143### Batch Tagging144145Use when the user asks to tag recent memos, add tags to multiple memos, or make every selected memo have a fixed number of tags. If the user does not specify a tag count, use exactly 3 tags per memo by default.146147Workflow:1481491. Select the target memos first. For "最近 N 条" or "latest N", use newest-first ordering and show or internally confirm the `created_at`, `slug`, existing `tags`, and a short snippet before editing.1502. Inspect existing tag taxonomy with `tags`. Reuse concrete `Proj/*`, `p/*`, product, or person tags when they match named entities; otherwise use mature thematic tags.1513. If a memo already has tags, treat them as candidates to preserve, not as a reason to skip the memo.1524. Each selected memo must end with the requested tag count, or exactly 3 parsed tags when no count is specified. Prefer preserving the strongest existing tags and adding mature supporting tags.1535. When rewriting tag lines, remove only trailing hashtag-only lines, then append one final hashtag line that exactly matches the selected tags. Do not alter the memo body.1546. After editing, query or fetch the selected memos again and verify each memo's parsed `tags` and `tag_count`.155156For ad-hoc batch edits, a small Python helper may import `flomo_local_api.py` and call `fetch_memo_by_slug`, `plain_text_to_html`, `api_put`, and `add_derived_fields` directly. Keep the helper ephemeral unless the user asks to persist it.157158### Create159160Use when the user wants to quickly create a text memo from local auth.161162**Text Formatting Note**: flomo does not render Markdown syntax (e.g., `**bold**`, `# headers`, lists). For Zeeland's memos, add a concise bold title by using `--html` and a first paragraph like `<p><strong>Title</strong></p>`:163- For the title: use raw HTML `<strong>...</strong>` with `--html`, not `**...**`.164- For emphasis inside the body: prefer `「」` quotes or direct wording instead of extra bold.165- For lists: use simple line breaks or plain bullets like `•` only when they read naturally.166- Do NOT use checkboxes or todo lists in flomo memos; flomo is for recording thoughts, not task management167- Keep paragraphs separated by blank lines for readability168169```bash170# Plain-text mode is available for tests or explicit no-format requests.171python3 "$SCRIPT" create --content "测试 memo #codex/demo"172printf '第一行\n\n第二段 #codex/demo\n' | python3 "$SCRIPT" create --stdin173# For Zeeland's normal memos, prefer this HTML form so the title is actually bold in flomo.174cat <<'EOF' | python3 "$SCRIPT" create --stdin --html175<p><strong>Memo title</strong></p><p>Memo body in plain paragraphs.</p><p>#area/ai/agent/skill</p>176EOF177```178179### Edit180181Use when the user wants to update the text of an existing memo and already has either the memo `slug` or a flomo memo URL.182183**Text Formatting Note**: Same as `create` — for Zeeland's memos, preserve or add a first bold title paragraph with `--html` unless the user asks otherwise. Do not fake bold with Markdown syntax.184185```bash186python3 "$SCRIPT" edit --slug "MTIzMDgzNzgz" --content "更新后的 memo 内容 #codex/demo"187python3 "$SCRIPT" edit --url "https://v.flomoapp.com/mine/?memo_id=MTIzMDgzNzgz" --content "更新后的 memo 内容 #codex/demo"188printf '第一行修改后\n\n第二段也更新\n' | python3 "$SCRIPT" edit --slug "MTIzMDgzNzgz" --stdin189```190191## Output Conventions192193- `query --format json` returns structured memo hits194- `query --format markdown` returns a readable markdown list195- `query --include-files` returns or renders attachment metadata, including image `url` and `thumbnail_url` when flomo provides them196- `summarize` returns memo counts, top tags, and supporting memos197- `export-monthly` writes one markdown file per month plus `tag-stats.md`198- `export-monthly --include-files` renders image attachments as Markdown image links and non-image attachments as ordinary links199- `tags` returns existing tag rows with `tag`, `depth`, `parent`, `direct_count`, `total_count`, and supports `--min-total-count` for filtering toward mature tags200- `create` returns the created memo payload with parsed markdown and tags201- `edit` returns the updated memo payload with parsed markdown and tags202- When `create` or `edit` is used with `--html`, verify the returned `content` starts with `<p><strong>...` for titled memos, and verify the returned `tags` match the selected tags.203- Monthly memo files keep only `created_at` metadata by default204- When producing `tag_decision.json`, `selected_tags` must use the raw existing tag strings from inventory, without a leading `#`. The memo body can render them as hashtags, but the JSON list should stay normalized.205- Finalize `selected_tags` first, then render exactly those same tags in the memo body as hashtags. Do not widen, shorten, or swap a parent/child variant between `tag_decision.json` and `draft.md`.206207## Implementation Notes208209- The update path is `PUT /memo/<slug>` using the same local auth token and request signing as the other commands.210- flomo memo payloads can include a `files` array. Read paths may expose attachment metadata and image URLs with `--include-files`; write paths do not upload new attachments.211- `edit` preserves the memo's current `files` and `pin` state so a text update does not accidentally drop attachments or pin status.212- flomo share links of the form `https://v.flomoapp.com/mine/?memo_id=...` can be used directly; the skill extracts `memo_id` as the target slug.213- `tags` is the default lookup tool for existing tag reuse. It is intentionally read-only and fast enough to call before most memo-writing requests.214- For live-user edits, prefer small and explicit changes unless the user clearly asks for a rewrite.215- For capability verification, use an idempotent marker string or a temporary test memo, then confirm by reading the updated payload.216217## Tag Reuse Policy218219For memo creation and memo edits that touch hashtags, follow this policy by default:220221- Reuse before inventing. The user's existing tag taxonomy is the source of truth.222- Aim for existing-tag reuse in at least 95% of memo-writing cases.223- Prefer established roots already common in the user's system, such as `self/`, `area/`, `Proj/`, `产品/`, `p/`, `resources/`, `Book/`, `others/`, `TODO/`, and `SL/`.224- Prefer mature tags with repeated usage (`total_count >= 2`) over singleton leaves when both are plausible.225- If the memo explicitly names an existing project, person, or product, prefer attaching that concrete existing taxonomy tag as one of the selected tags.226- If an exact or near-exact existing project/person/product tag is found for the memo's named entity, include it as one of the selected tags unless the mention is clearly incidental.227- Prefer the closest existing leaf tag when a clear match exists.228- If several existing tags are plausible, prefer an existing broader parent over inventing a new leaf.229- Treat singleton leaves under weak or unfamiliar roots as weak evidence, not default choices.230- Keep tags sparse for single-memo create/edit flows. Default to 1-4 tags for a single memo unless the user asks for more. For batch tagging existing memos, default to exactly 3 tags per memo.231- Prefer fewer, better tags over exhaustive tagging. Retrieval quality matters more than semantic completeness.232- Avoid English-only ad hoc tags when the user's existing taxonomy already has a better-fitting path tag.233- If no close existing tag is found, you may introduce at most one new tag, and you should mention that choice explicitly.234- In structured outputs such as `tag_decision.json`, never prepend `#` to the stored tag names. Use `self/反思`, not `#self/反思`.235- `draft.md` hashtags must exactly correspond to `selected_tags` after adding `#`. If you chose `Proj/rudder/想法`, the draft should contain `#Proj/rudder/想法`, not `#Proj/rudder`.236237Examples:238239- Bad: `#AI/claude-code #prompt-engineering` when the user's taxonomy already contains nearby tags under `area/ai/agent/*`, `产品/*`, or `编程/*`.240- Better: inspect `tags --query "agent" --min-total-count 2`, `tags --query "coding" --min-total-count 2`, `tags --query "prompt" --min-total-count 2`, or `tags --query "产品" --min-total-count 2` first, then reuse the closest mature existing tags.241242## Safety Rules243244- Only use `create` when the user explicitly asks for a new memo245- Only use `edit` when the user explicitly asks to modify an existing memo246- `query --include-files` and `export-monthly --include-files` are read/export features only; do not imply that this skill can upload, delete, OCR, or rewrite attachment files247- `edit` preserves the memo's current `files` and `pin` state; it is for text updates, not attachment management248- Do not invent new tags casually; check existing tags first with `tags`249- Do not delete flomo memos from this skill250- Do not persist extra raw dumps unless the user explicitly asks251- Treat summaries as patterns from memo evidence, not diagnoses252- **Never use Markdown syntax** (bold, headers, lists, checkboxes) in memo content — flomo renders it as plain text. The only default bold formatting for Zeeland's memo title should be raw HTML `<strong>` sent through `--html`.253- **Never create task lists or checkboxes** in flomo memos; flomo is for capturing thoughts and reflections, not task management254255## Validation Cases256257### Case: Create a normal research memo258259Input:260User asks to write a flomo memo about a paper or idea.261262Expected behavior:263Draft a concise title, inspect existing tags, create the memo with `--html`, render the first paragraph as `<p><strong>Title</strong></p>`, put body paragraphs after it, append the selected existing hashtags, and verify the returned `content` and `tags`.264265Must not:266Use `**Title**`, Markdown headers, checkboxes, or omit the title.267268### Case: Edit an existing memo after style feedback269270Input:271User asks to optimize or humanize a memo that lacks a title.272273Expected behavior:274Fetch or use the known memo slug, rewrite the memo with a concise bold title via `--html`, preserve appropriate existing tags, and verify the returned memo payload.275276Must not:277Only rewrite prose while leaving the memo untitled, or replace mature existing tags with newly invented tags.278279### Case: Read memo images280281Input:282User asks whether the API can read images in flomo memos or asks to inspect memos with screenshots.283284Expected behavior:285Use `query --include-files` or a direct read helper to check the raw memo `files` array, report whether image attachments are present, and mention that available fields include image `url` and `thumbnail_url` when flomo provides them.286287Must not:288Answer from the text-only `snippet` field, claim images are unavailable because default `query` output omits them, or attempt to edit/upload attachments.289290### Case: Export monthly notes with image links291292Input:293User asks to export flomo notes to Markdown and preserve images.294295Expected behavior:296Run `export-monthly --include-files --output-dir <target>`, then verify at least one exported monthly file contains Markdown image links for image attachments when matching memos have files.297298Must not:299Only write `- files: N` counts when the user explicitly asked to preserve images, or download/persist extra raw files unless the user asked for local attachment downloads.300301## Resources302303### scripts/304305- `scripts/flomo_local_api.py`: CLI for flomo query, summarize, export, lightweight create, and text edit