Skip to content

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

agent-skills

skills.sh

Agent skills by Cardin Lee.

Install

# 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-screenshot

Preview without installing:

npx skills add cardin/agent-skills --list

Skills

craft-to-agents

Import 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 -y

Once 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-rules

The 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 -v

read-craft

Fetch 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 -y
python3 <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 -v

wsl-screenshot

Capture 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.exe reachable 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 directory

It 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

  1. scripts/capture.sh locates itself, converts that path with wslpath -w, and calls powershell.exe on scripts/screenshot.ps1.
  2. screenshot.ps1 captures the virtual desktop (all monitors) or a single display with .NET CopyFromScreen, opting into DPI awareness, and writes a PNG to Windows temp.
  3. capture.sh converts the result back with wslpath -u and prints the WSL path.

Notes

  • Reading /mnt/c/... may need an external_directory permission entry in opencode.jsonc. If access is denied, either add the permission or use -o to 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-screenshot vs screenshot).

Repository layout

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

License

MIT © Cardin Lee

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages