Add threads skills install to install the skill into agent skill dirs - #6
Merged
Conversation
There was no built-in way to install the skill — only `npx skills add` via a registry, and the skill wasn't even bundled in the pip package. Add a self-contained installer. - Bundle skills/threads into the wheel (hatchling force-include → threads_cli/_skills/threads); editable installs fall back to the repo's skills/ dir. _skill_bundle_dir() resolves either. - `threads skills install`: copy the skill (SKILL.md + references; dev-only evals/state excluded) into an agent skill dir. Detects the common dirs (~/.claude/skills, ~/.codex/skills, ~/.agents/skills, ...) and, with no --target, prompts interactively or asks for --target non-interactively. --target <dir> or --target all for explicit selection. Idempotent. - `threads skills list` (detected dirs + install state) and `skills path`. - Docs (README, cheatsheet, AGENTS) and eval 8 updated to the new command. 76 tests passing; ruff clean; build OK; skill confirmed present in the wheel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The evals had only human-readable expected_output. Add the schema's expectations[] — 2-4 verifiable assertions per eval — so the skill can be graded/benchmarked automatically (with vs. without skill). Focus on the load-bearing behaviors: the publish gate is never bypassed, the API's real limits (no feed, no demographics, no reach metric) are respected, and onboarding uses the current commands. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eview) Codex flagged two [high] issues with copytree(dirs_exist_ok=True) writing into a live agent skill directory: - stale/hostile files from an older install persisted after reinstall (merge didn't remove files no longer in the bundle); - a destination symlink could be followed, turning reinstall into an arbitrary-file-overwrite primitive. Install is now replace-not-merge: stage a fresh copy in a temp dir on the same filesystem, unlink an existing symlink/file (never write through it) or rmtree a real dir, then os.replace() atomically. Also fixed --target all with no detected dirs (errors) and single-dir non-interactive (installs without prompting instead of erroring). Tests: stale-file removal, destination-symlink not followed (outside file untouched), empty --target all, single-dir non-interactive. 80 passing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fioenix
added a commit
that referenced
this pull request
Jun 30, 2026
Follow-up to #6. Users know their agent CLI ("claude", "codex") but not the skill-directory path, so --target now takes the agent name and derives the dir. - --target accepts an agent name (claude/codex/agents/opencode/copilot/pi), 'all', or a directory path (escape hatch). Unknown names error with the list. - No --target auto-detects: single detected agent installs; several prompt (showing name + dir) or ask for --target non-interactively. - `skills list` reports agent names. Install safety (replace-not-merge, symlink-safe) unchanged. Docs/--help/eval 8 updated. 82 tests; ruff clean; build OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Answers "how do I install the skill for my CLI agents?" — there was no built-in way (only
npx skills addvia a registry), and the skill wasn't bundled in the package.What
hatchling force-include→threads_cli/_skills/threads). Editable installs fall back to the repo'sskills/dir;_skill_bundle_dir()resolves either. Confirmed present in the built wheel.threads skills install— copy the skill (SKILL.md + references; dev-onlyevals/,state/,.envexcluded) into an agent skill dir. With no--targetit detects the common dirs (~/.claude/skills,~/.codex/skills,~/.agents/skills,~/.opencode/skills,~/.copilot/skills,~/.pi/skills) and prompts interactively, or asks for--targetnon-interactively.--target <dir>or--target all. Idempotent (overwrites).threads skills list(detected dirs + install state) andthreads skills path.npx skills addkept as a registry-based alternative.Verification
skills path/listresolve the repo bundle;install --target <tmp>copies SKILL.md + references and excludes evals; wheel contains the bundle.🤖 Generated with Claude Code