Agent skills by Cardin Lee.
# Install to OpenCode globally
npx skills add cardin/agent-skills --skill wsl-screenshot -g -a opencode -y
# Or pick agents interactively (Claude Code, Codex, Cursor, ...)
npx skills add cardin/agent-skills --skill wsl-screenshotPreview without installing:
npx skills add cardin/agent-skills --listImport a public Craft document into its own section of AGENTS.md, or refresh it
later using the source link recorded inside the section.
npx skills add cardin/agent-skills --skill craft-to-agents --skill read-craft -g -a opencode -yOnce installed, ask your agent: "Import this Craft document into AGENTS.md: URL" or "Refresh the Craft workflow section in AGENTS.md."
Requirements: Python 3.9+, curl, a public craft.me share link, and the
read-craft skill (it does the download; this skill does the placement).
Behavior: preserves unrelated/plugin sections, formats headings, paragraphs,
lists, bold, and inline code, excludes the IGNORE heading and everything after it,
and leaves unchanged files untouched. List items have no blank lines between them;
headings and paragraphs retain spacing. Failed imports do not replace existing content.
python3 <skill-dir>/scripts/sync.py "CRAFT_URL"
python3 <skill-dir>/scripts/sync.py "CRAFT_URL" --target ./AGENTS.md --block my-rulesThe default target is ~/.config/opencode/AGENTS.md. Existing source-linked blocks
are reused; new blocks use craft-<share-id>. For an older block without a source
link, use --block with its current name to migrate it without creating a duplicate.
Markdown is fetched by read-craft; the block edit itself is source-agnostic
(scripts/blocks.py has no Craft knowledge). Craft's share API is undocumented, so
future API changes may require an update.
Run the offline tests:
python3 -m unittest discover -s skills/craft-to-agents/tests -vFetch the Markdown of a public Craft (craft.me) share link. Transport only: it
returns the Markdown and metadata and never writes files. Use it directly to read,
quote, or summarize a Craft document, or as the download layer for another skill.
npx skills add cardin/agent-skills --skill read-craft -g -a opencode -ypython3 <skill-dir>/scripts/fetch.py "CRAFT_URL" # Markdown to stdout
python3 <skill-dir>/scripts/fetch.py "CRAFT_URL" --json # {"url","host","share_id","markdown"}
python3 <skill-dir>/scripts/fetch.py "CRAFT_URL" --raw # raw Craft share JSON--json lets a caller record the canonical source link and derive a stable block
name without re-parsing the URL. Only public https://<host>.craft.me/<share-id>
links are accepted; the IGNORE heading and everything after it are excluded. The
Craft share API is undocumented, so --raw exists to inspect it when the format
changes.
Run the offline tests:
python3 -m unittest discover -s skills/read-craft/tests -vCapture the Windows desktop from inside WSL and view the result.
The gap this fills: existing screenshot skills cover macOS, native Linux (X11), and native
Windows, but none bridge WSL → Windows. From WSL you cannot use scrot/import
(no Linux display) and you cannot call a .ps1 by its Linux path, so a naive screenshot
skill fails. This one handles the bridge for you.
Requirements
- WSL with Windows interop enabled (
powershell.exereachable from bash) - An unlocked, connected Windows desktop session (a locked session captures black)
Usage
Once installed, just ask your agent to look at your screen. Under the hood it runs:
bash <skill-dir>/scripts/capture.sh # all monitors
bash <skill-dir>/scripts/capture.sh -m 2 # one monitor
bash <skill-dir>/scripts/capture.sh -w 1600 # downscale wide captures
bash <skill-dir>/scripts/capture.sh -o DIR # custom output directoryIt prints the image's WSL path (e.g. /mnt/c/Users/you/AppData/Local/Temp/...png), which
the agent opens with its image-reading tool.
How it works
scripts/capture.shlocates itself, converts that path withwslpath -w, and callspowershell.exeonscripts/screenshot.ps1.screenshot.ps1captures the virtual desktop (all monitors) or a single display with .NETCopyFromScreen, opting into DPI awareness, and writes a PNG to Windows temp.capture.shconverts the result back withwslpath -uand prints the WSL path.
Notes
- Reading
/mnt/c/...may need anexternal_directorypermission entry inopencode.jsonc. If access is denied, either add the permission or use-oto write to a directory you can already read. - Screenshots can contain sensitive information. Capture only when the request calls for it.
Related skills
openai/skills@screenshot— broader and more polished, and the right choice on macOS, native Linux, or native Windows. It has no WSL support, which is why this skill exists. Both can be installed side by side; IDs differ (wsl-screenshotvsscreenshot).
agent-skills/
└── skills/
├── craft-to-agents/
│ ├── SKILL.md
│ ├── scripts/
│ │ ├── blocks.py
│ │ └── sync.py
│ └── tests/
│ ├── test_blocks.py
│ └── test_sync.py
├── read-craft/
│ ├── SKILL.md
│ ├── scripts/
│ │ └── fetch.py
│ └── tests/
│ └── test_fetch.py
└── wsl-screenshot/
├── SKILL.md
└── scripts/
├── capture.sh
└── screenshot.ps1
MIT © Cardin Lee