agentleFS
shoot16625shoot16625/note-cli/skills/draft/SKILL.md

draft

Skill2 starsChanged 9 days agoMITView on GitHub

Save, update or read note.com drafts from Markdown (images, eyecatch, gallery photos, embeds, attachments).

  • Pipes a download into a shell

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use onboard, status and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    onboard

    Onboard a service to sentry-options. Use when integrating a new service, creating schemas, or setting up the multi-repo sentry-options workflow.

    Also in 3 projects that use this

  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • VercelSkill

    setup

    Set up Vercel CLI and project configuration. Use when the user says "set up Vercel", "configure Vercel", "link to Vercel", or "vercel init".

    Also in 4 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If note-cli is on PATH, use it.

    line 14
  2. Very specific:

    If bun is missing, ask the user to install it (curl -fsSL https://bun.sh/install | bash).

    line 17
  3. Very specific:

    Check login with note-cli auth status.

    line 27
  4. Distinctive:

    Write or edit the Markdown file with the user.

    line 60
  5. Very specific:

    Run with --dry-run once: it checks that every referenced image exists and is supported.

    line 61
  6. Very specific:

    Run draft create (or draft update with the key returned before — keep it so later edits update the same draft instead of creating …

    line 62

“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

note-cli:draft

Save articles to note.com as drafts through the unofficial API wrapper note-cli. Drafts are private. To make an article public (or schedule it, set a price or hashtags), continue with the note-cli:publish skill.

Running note-cli

This skill ships with the CLI. This file lives at <plugin root>/skills/<skill>/SKILL.md; the CLI is a dependency-free bundle at <plugin root>/dist/note-cli.js (requires Bun).

  • If note-cli is on PATH, use it.
  • Otherwise, if <plugin root>/dist/note-cli.js exists, run bun <plugin root>/dist/note-cli.js ... with the absolute path.
  • Otherwise (the skill was installed on its own, e.g. with npx skills add), ask the user before installing the CLI globally with bun add -g github:shoot16625/note-cli, then use note-cli.
  • If bun is missing, ask the user to install it (curl -fsSL https://bun.sh/install | bash). Below, note-cli means whichever of these works.

Output is JSON on stdout. Errors are JSON on stderr ({"error": {"code", "message"}}) with exit code 1 (2 for usage errors). Codes: NOT_LOGGED_IN, AUTH_ERROR, FORBIDDEN (note refused, with its reason in message), NOT_FOUND, RATE_LIMITED, API_ERROR, USAGE.

Login (only for commands that need it)

note-cli auth status tells you whether a session exists. To log in, run note-cli auth login yourself with a command timeout of at least 300 seconds. It opens a Chrome/Edge/Chromium window on the note.com login page and waits for the user to finish logging in there. Tell the user to log in in that window. Never ask for their password. If no browser is found, pass --browser <path>, or have the user copy the Cookie request header (or just the _note_session_v5 value) from DevTools and pipe it to note-cli auth import.

Before you start

  1. Check login with note-cli auth status; log in as described above if loggedIn is false.
  2. Prepare the article as a Markdown file. Title comes from frontmatter title: or the first # Heading (removed from the body), or --title.

Commands

note-cli draft create article.md --dry-run   # preview converted HTML, images + warnings, no network
note-cli draft create article.md [--eyecatch cover.png] [--no-embed]   # -> {id, key, editUrl, images, embeds, eyecatch, warnings}
note-cli draft update <key|url> article.md [--eyecatch cover.png]  # overwrite title + body of an existing draft (use the key: embeds need it)
note-cli draft get <key|url>                 # read a draft back as text (--html for raw, --max-chars N, default 20000)
note-cli draft list --status draft           # your drafts (page 1; --page N)
note-cli draft delete <id|key> --yes         # drafts only (published: `note-cli delete`); ask the user before running
note-cli photo search 富士山 [--public-domain] [--limit N] [--page N]   # みんなのフォトギャラリー: free cover photos (login)

Markdown → note conversion

  • #/## → large heading, ### → small heading, ####+ → bold line (note has two heading levels).
  • Single newlines are kept as line breaks; blank lines separate paragraphs.
  • Lists, quotes, code blocks, bold/italic/strike, links, horizontal rules work.
  • Local images (![alt](img/a.png "caption"), path relative to the Markdown file) are uploaded and embedded as image blocks; the optional title becomes the caption. PNG/JPEG/GIF/WebP, ≤ 10 MB. Put each image on its own line.
  • Image URLs are not uploaded (they become links, with a warning). To embed one, download it and reference the local file.
  • Embeds: a URL alone on its own line (a bare URL, not [text](url)) becomes an embed, like pasting it into the editor: YouTube/Vimeo/niconico players, X posts and profiles, note articles as cards, GitHub, Spotify, Speaker Deck, Google Maps/Slides/Forms, Bluesky, Threads and more; any other page becomes a link card. --no-embed keeps them as plain links. If note cannot fetch a URL, it stays a link and warnings says so.
  • Attachments: a link to a local file alone on its own line ([資料](files/guide.pdf)) uploads the file as a download attachment (≤ 100 MB). Relative to the Markdown file.
  • Obsidian syntax: ![[image.png]] / ![[image.png|alt]] are images, [[Page|label]] becomes its text, ==highlight== becomes bold.
  • Tables become code blocks, with a warning.
  • Eyecatch (cover image): --eyecatch <file> or frontmatter eyecatch: cover.png. note only accepts a 1280:670 aspect ratio (e.g. 1280x670); --dry-run warns about other sizes. If note rejects it, the draft is still saved, eyecatch.set is false, and warnings explains why. Fix the image and rerun draft update with --eyecatch.
  • Gallery eyecatch (the editor's 記事にあう画像を選ぶ): when the user has no cover image, run note-cli photo search <keywords from the article> and choose by keywords and sourceNote.title (download a few thumbnailUrls to look at them if you can view images). --public-domain searches museum artworks instead. Pass the chosen photo's eyecatch value (stock:<id>:<url>) to --eyecatch or frontmatter eyecatch:. It is center-cropped to 1280x670 and note shows the credit under the cover automatically. Tell the user which photo you picked and whose it is.
  • A line containing only <!-- paywall --> marks where the paid part of a paid article starts (it shows as the paywall line in the editor).
  • Hashtags, price and magazines are set when publishing (note-cli publish, see note-cli:publish).

Workflow

  1. Write or edit the Markdown file with the user.
  2. Run with --dry-run once: it checks that every referenced image exists and is supported. Relay any warnings.
  3. Run draft create (or draft update with the key returned before — keep it so later edits update the same draft instead of creating duplicates).
  4. Give the user the editUrl. If they want it public, follow note-cli:publish.

On AUTH_ERROR the session has expired: log in again as described above. An API_ERROR with email_activation means the account has not verified its email address yet.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.