$npx -y skills add SkillNerds/xskill --skill using-xskillUse when installing, configuring, or operating xskill (the xskill CLI / pip install xskill) — starting the daemon, registering trajectory dirs, joining a team server, understanding how trajectories become Skills, or rebuilding/re-distilling the skill library after a model cha
| 1 | # Using xskill |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | xskill distills reusable **Skills** (`SKILL.md` folders) out of the real execution |
| 6 | trajectories of coding agents (Claude Code, Codex, OpenCode, Cursor, …). A background |
| 7 | daemon watches each agent's session logs, slices them into single-intent **atoms**, |
| 8 | clusters atoms into skills, and writes/versions each skill in its own git folder. New |
| 9 | skill versions only replace old ones when real traffic shows they serve users better |
| 10 | (canary A/B by UX score) — not by an LLM grading itself. |
| 11 | |
| 12 | **Core mental model:** raw trajectory → atoms → candidate routing → SKILL.md → canary |
| 13 | A/B → installed into every agent's skill dir. You operate the daemon; the daemon does |
| 14 | the distilling. |
| 15 | |
| 16 | ## When to Use |
| 17 | |
| 18 | - Installing xskill or filling in `~/.xskill/config.yaml` (LLM + embedding endpoints) |
| 19 | - Starting/keeping the daemon running (`xskill serve`), or backfilling old trajectories |
| 20 | - Joining or hosting a team server (`xskill serve --server` / `xskill connect`) |
| 21 | - Understanding the agent pipeline, atoms, canary/UX scoring, or deployment modes |
| 22 | - **Re-distilling the whole skill library** (e.g. after switching to a stronger model) |
| 23 | |
| 24 | ## Quick Reference |
| 25 | |
| 26 | | Command | What it does | |
| 27 | |---------|--------------| |
| 28 | | `pip install xskill` | Install (Python 3.9+) | |
| 29 | | `xskill serve` | Standalone daemon: FastAPI + watcher; first run writes `~/.xskill/config.yaml` then exits | |
| 30 | | `xskill serve --server` | Team server: owns all LLM calls + git; prints a join token | |
| 31 | | `xskill connect <host:port> --token <t>` | Join a team server as a thin client | |
| 32 | | `xskill registry add <path>` | Backfill / watch an extra trajectory directory | |
| 33 | | `xskill search traj\|skill <query>` | Search trajectories or skills | |
| 34 | | `xskill read <path> --eco <eco>` | Batch-ingest db trajectories (ngagent/opencode) | |
| 35 | | `xskill rebuild [--force]` | Re-distill from existing raw trajectories (see reference) | |
| 36 | | `xskill stats` | Token usage & estimated cost | |
| 37 | |
| 38 | The daemon is the engine: most commands only change state in the DB; nothing is |
| 39 | distilled unless `xskill serve` (or the team server) is running. |
| 40 | |
| 41 | ## Progressive Disclosure — read on demand |
| 42 | |
| 43 | - **Install & configure** (config.yaml fields, per-agent collect/install paths, team |
| 44 | client setup): `references/installation.md` |
| 45 | - **How it works** (TaskAgent → TaskClusterAgent → SkillEditAgent, atoms, canary/UX |
| 46 | scoring, standalone vs team mode): `references/mechanisms.md` |
| 47 | - **Rebuild the skill library** (a ready-to-run prompt that walks a model through |
| 48 | re-distilling correctly): `references/rebuilding-skill-library.md` |
| 49 | |
| 50 | ## Common Mistakes |
| 51 | |
| 52 | - **Running `rebuild` with no daemon up.** `rebuild` only resets DB state; the watcher |
| 53 | in `serve` does the actual re-split/re-cluster every 30s. No daemon = nothing happens. |
| 54 | - **Deleting raw `~/.xskill/*_sessions/*.md`.** Those are the *input* to distillation — |
| 55 | delete them and you can no longer rebuild. |
| 56 | - **Expecting DeepSeek to do embeddings.** DeepSeek has no embedding endpoint; point the |
| 57 | `embedding:` block at DashScope / OpenAI / Ollama. |
| 58 | - **Putting tokens in public places.** Team join tokens must never land in a public repo |
| 59 | or chat log. |