Skip to content

istib/drafts-skills

Repository files navigation

Drafts Skills

Sync your local agent skills into the Drafts macOS and iOS app.

Drafts is a notes and automation app for Mac and iPhone/iPad. This repo adds a Drafts action workflow on top of it: you can type a skill or free-form prompt, apply it to the current selection or whole note, and replace the note content with the model output. If you want more background on the action model and scripting APIs, the Drafts scripting reference is the best companion.

This repo contains:

  • A Raycast command, Sync Drafts Skills, to trigger sync without leaving Raycast
  • A local sync script that reads SKILL.md files from your local skills folder
  • Drafts templates and runtime scripts written into Drafts' iCloud folders
  • A mobile-friendly Drafts HTML picker with skill filtering and free-form prompt fallback

The picker template itself is part of the repo at templates/agent-skills/skill-picker.html. Your private skill names and instructions are still generated locally and are not committed.

What It Does

  • Reads every SKILL.md under your local skills folder
  • Builds a small Drafts picker index for fast loading on mobile
  • Writes per-skill instruction files for on-demand loading when a skill is chosen
  • Updates Drafts iCloud Templates and Scripts folders
  • Generates one-time bootstrap script steps in a local output folder

Sync

  1. Put your skills in ~/.agent/skills, with one SKILL.md per folder. The sync also falls back to ~/.agents/skills for compatibility with older setups.
  2. Install dependencies:
npm install
  1. Run the sync:
npm run sync:drafts

Or run the Raycast command Sync Drafts Skills if you have this extension installed locally in Raycast.

Generated files are written locally to:

~/Library/Application Support/drafts-skills/drafts-generated

That folder contains:

  • INSTALL_DRAFTS_ACTION.md
  • drafts-agent-skill-step1.js
  • drafts-agent-skill-step3.js
  • a local copy of the synced Drafts template/runtime files

Only the generated skill data is local-only. The reusable picker template source is committed in this repo.

Drafts Action Setup

After syncing, open:

~/Library/Application Support/drafts-skills/drafts-generated/INSTALL_DRAFTS_ACTION.md

Then create the Drafts action once:

  1. Add a Script step and paste drafts-agent-skill-step1.js.
  2. Add an HTML Preview step with: [[template|agent-skills/skill-picker.html]]
  3. Add a second Script step and paste drafts-agent-skill-step3.js.

After that one-time setup, re-running npm run sync:drafts updates the synced Drafts runtime automatically.

Sharing

This repo is safe to share publicly because it only contains the generic sync logic and committed picker template.

Do not commit:

  • ~/Library/Application Support/drafts-skills/drafts-generated
  • your ~/.agent/skills or ~/.agents/skills directory
  • Drafts' synced skills-index.json or per-skill .txt instruction files if they contain private prompts

Development

npm install
npm run build

About

Sync local agent skills into a Drafts picker and runtime scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors