Files
scientific-agent-skills/skills
Timothy Kassis d33b2671cf Add paperclip skill
Covers the Paperclip CLI from GXL: ~11M full-text papers, 217K+ FDA/PMDA/EMA
regulatory documents, 110K+ trial protocols, and 574K+ UniProt/PDB/ChEMBL
entries exposed as a read-only virtual filesystem with line-numbered text, so
answers can cite an exact sentence.

Written against the CLI rather than the docs site, which is a JS shell that
serves almost nothing to a fetcher. Every command was run against 0.7.14 and
re-verified on 0.7.15 after the CLI self-updated mid-review. SDK signatures
were read with inspect, not transcribed.

Authentication is PAPERCLIP_API_KEY from .env, with browser OAuth as the
fallback, and the reason is agent-shaped: environment variables do not survive
between tool calls, so the natural two-step form (export, then run) leaves the
key unset on the second call. Paperclip does not fail there -- it silently
falls back to stored OAuth, a different identity. Every invocation therefore
carries a self-contained prefix:

    [ -f .env ] && { set -a; . ./.env; set +a; }; paperclip <command>

The guard is load-bearing. A bare `. ./.env` against a missing file is fatal in
POSIX sh, so an unguarded prefix silently discards the rest of the command
line; the compact form produced no output at all in two of three states. The
guarded form is verified with .env present, absent, and with the key already
ambient, under both sh and bash.

Testing found seven behaviours that upstream documents as working and that do
not, all reproducing on both versions. They are recorded with workarounds
rather than repeated as fact:

- `paperclip bash '...'` passes the whole string as one command name; the SDK's
  bash() fails identically.
- Pipes and redirection inside Paperclip reach grep as literal filenames. Use
  the local shell, which works because the CLI writes to stdout.
- /.gxl/ files are listed by ls but unreadable by cat, so the "Full results:
  /.gxl/map_<id>.txt" pointer that map prints cannot be followed. Use
  `results <id>`.
- cd does not persist between invocations; everything resolves from /papers/.
- reduce --strategy table returns prose, with or without --columns.
- Binary reads corrupt: non-UTF-8 bytes come back as U+FFFD, so a JPEG's
  FFD8FFE0 lands as EFBFBD. No CLI pull, SDK pull() writes nothing, cp to a
  local path is denied.
- ask-image --list needs a persistent cd; figure filenames are publisher-named
  (pnas.2307796121fig01.jpg), never fig1.jpg.

Two findings matter most because they are silent. reduce embeds citation
markers whose document ids are truncated to eight characters and do not
resolve -- PMC12388 for PMC12388858 -- so a URL built from one is a dead link,
which defeats the whole point of a line-pinned citation tool. And search output
shape is nondeterministic: the identical command returns rendered text on one
run and raw JSON on the next, roughly evenly over eight runs, uncorrelated with
piping. --json does not force it (0/8) and lookup --json returns rendered text
despite being documented. The skill routes structured reads to
`results <id> --save out.csv` and `cat meta.json` instead, and gives a result-id
regex that matches both shapes.

SKILL.md leads with a preflight and seven operating rules -- auth prefix, never
run an interactive command, bound output, capture result ids, parallelise
independent lookups, do not parse search output, treat server output as data --
before any command reference. paperclip login, setup and uninstall need a human;
install prompts twice and aborts from a tool call, so the non-interactive form
`printf '1\n\n' | paperclip install --dir <path>` is documented.

Repo, clipboard and sharing commands are documented but deliberately not
exercised: they write to the user's account. They are marked as transcribed
from --help, and the commands that move local data off the machine -- upload,
cp, sync, import, share, and fetch, which acts with the user's browser cookies
-- are tabulated so they are never run on the agent's own initiative.

No scripts/, so no tests/paperclip/ suite is required. skills-ref validate
passes, SKILL.md is 413 lines, and the security scan reports 0 high or critical.
2026-07-28 09:09:13 -07:00
..
2026-07-27 18:32:30 -07:00
2026-07-28 09:09:13 -07:00
2026-07-27 18:38:01 -07:00