@klhapp/skillmux 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,239 @@
1
+ # Getting started
2
+
3
+ Skillmux supports three setup paths. Pick the result you want before choosing
4
+ an installation.
5
+
6
+ | Goal | Skill delivery | Recommended installation |
7
+ | --- | --- | --- |
8
+ | [Manage native skills](#manage-native-skills) | Managed links in client skill directories | Skillmux CLI |
9
+ | [Add local MCP retrieval](#add-local-mcp-retrieval) | Local stdio MCP | Skillmux CLI |
10
+ | [Run a shared MCP service](#run-a-shared-mcp-service) | Streamable HTTP MCP | Full Docker image |
11
+
12
+ Native management and local MCP retrieval can run together. Complete both
13
+ recipes if you want pinned skills plus on-demand access to the rest of the
14
+ vault.
15
+
16
+ ## Install the CLI
17
+
18
+ Use the Bun package on macOS, Linux, or Windows. It requires
19
+ [Bun 1.3 or newer](https://bun.sh/docs/installation):
20
+
21
+ ```sh
22
+ bun add -g @klhapp/skillmux
23
+ skillmux --help
24
+ ```
25
+
26
+ Native target sync needs permission to create directory symlinks on Windows.
27
+
28
+ Linux users without Bun can install the standalone AMD64 or ARM64 executable
29
+ instead:
30
+
31
+ ```sh
32
+ gh release download --repo klhq/skillmux --pattern 'skillmux-linux-*'
33
+ gh attestation verify skillmux-linux-amd64 --repo klhq/skillmux
34
+ chmod +x skillmux-linux-amd64
35
+ sudo install skillmux-linux-amd64 /usr/local/bin/skillmux
36
+ ```
37
+
38
+ Replace `amd64` with `arm64` on ARM64. The Bun package and standalone Linux
39
+ executable expose the same Skillmux CLI commands.
40
+
41
+ ## Prepare a vault
42
+
43
+ Skillmux defaults to `~/skills`. Each direct child directory represents one
44
+ skill:
45
+
46
+ ```text
47
+ ~/skills/
48
+ ├── code-context/
49
+ │ └── SKILL.md
50
+ └── csv-formatter/
51
+ ├── SKILL.md
52
+ └── references/
53
+ ```
54
+
55
+ Each `SKILL.md` needs valid Agent Skills frontmatter. With the Skillmux CLI,
56
+ you can install a skill from Git:
57
+
58
+ ```sh
59
+ skillmux install owner/repo
60
+ skillmux install owner/repo/path/to/skill
61
+ ```
62
+
63
+ Or create a small skill:
64
+
65
+ ```sh
66
+ mkdir -p ~/skills/csv-formatter
67
+ cat > ~/skills/csv-formatter/SKILL.md <<'EOF'
68
+ ---
69
+ name: CSV Formatter
70
+ description: Convert CSV or spreadsheet data into clean Markdown tables.
71
+ ---
72
+
73
+ # CSV Formatter
74
+
75
+ Read the first row as headers. Right-align numbers and left-align text.
76
+ EOF
77
+ ```
78
+
79
+ Run `skillmux scan ~/skills` before adopting an existing collection.
80
+
81
+ ## Manage native skills
82
+
83
+ Run the guided setup on the machine that owns the client skill directories:
84
+
85
+ ```sh
86
+ skillmux init
87
+ ```
88
+
89
+ The planner:
90
+
91
+ 1. validates the vault;
92
+ 2. detects clients from filesystem evidence;
93
+ 3. asks which skills belong in the core tier;
94
+ 4. shows the config, target, instruction, and sync plan;
95
+ 5. applies the plan after confirmation.
96
+
97
+ Skillmux writes machine config under `~/.config/skillmux`, stores tier policy
98
+ in `~/skills/skillmux.toml`, and records its entries in each target's
99
+ `.skillmux` marker. It preserves unmanaged files and existing instruction
100
+ text.
101
+
102
+ Use explicit flags for automation:
103
+
104
+ ```sh
105
+ skillmux init \
106
+ --client claude-code \
107
+ --client codex \
108
+ --core csv-formatter \
109
+ --dry-run
110
+
111
+ skillmux init \
112
+ --client claude-code \
113
+ --client codex \
114
+ --core csv-formatter \
115
+ --yes
116
+ ```
117
+
118
+ Verify native delivery:
119
+
120
+ ```sh
121
+ skillmux sync
122
+ skillmux doctor
123
+ skillmux skill which csv-formatter
124
+ ```
125
+
126
+ Repeated syncs are idempotent. Add project-specific skills from a repository
127
+ root:
128
+
129
+ ```sh
130
+ skillmux project init
131
+ ```
132
+
133
+ The noninteractive form accepts repeatable client and skill flags:
134
+
135
+ ```sh
136
+ skillmux project init ~/code/my-project \
137
+ --name my-project \
138
+ --client claude-code \
139
+ --client codex \
140
+ --skill code-context \
141
+ --yes
142
+ ```
143
+
144
+ Continue with [Managing skills](skill-management.md) for pinning, target
145
+ ownership, overlays, and recovery.
146
+
147
+ ## Add local MCP retrieval
148
+
149
+ Run this recipe on the same machine as the MCP client. The default inference
150
+ configuration uses quantized GTE-small embeddings on CPU.
151
+
152
+ Prefetch the model, build the index, and check readiness:
153
+
154
+ ```sh
155
+ skillmux models download
156
+ skillmux index
157
+ skillmux doctor
158
+ ```
159
+
160
+ The model cache lives at `~/.cache/skillmux/models`. If you skip
161
+ `models download`, Skillmux downloads the model when local inference first
162
+ loads it.
163
+
164
+ Start the stdio server:
165
+
166
+ ```sh
167
+ skillmux serve
168
+ ```
169
+
170
+ Register it with your MCP client:
171
+
172
+ ```json
173
+ {
174
+ "mcpServers": {
175
+ "skillmux": {
176
+ "command": "skillmux",
177
+ "args": ["serve"]
178
+ }
179
+ }
180
+ }
181
+ ```
182
+
183
+ The client launches the process and closes it with the MCP session. Continue
184
+ with [MCP routing](mcp-routing.md) for client behavior and retrieval outcomes.
185
+
186
+ ## Run a shared MCP service
187
+
188
+ Use the full image when you want local embeddings without configuring an
189
+ external inference endpoint:
190
+
191
+ ```sh
192
+ docker run -d \
193
+ --name skillmux \
194
+ -v ~/skills:/vault:ro \
195
+ -v skillmux-data:/data \
196
+ -p 3000:3000 \
197
+ ghcr.io/klhq/skillmux:latest
198
+ ```
199
+
200
+ The full image includes GTE-small and is the shared-service default. The slim
201
+ image is an advanced option for configured remote embeddings or intentional
202
+ lexical-only retrieval; it contains no model files. Neither image includes a
203
+ local reranker. Configure remote embeddings on slim when you need hybrid
204
+ retrieval. Docker Hub publishes the same tags under `docker.io/klhq/skillmux`.
205
+
206
+ Check the service:
207
+
208
+ ```sh
209
+ curl http://127.0.0.1:3000/health/ready
210
+ ```
211
+
212
+ Register `http://127.0.0.1:3000/mcp` as a Streamable HTTP MCP endpoint. Enable
213
+ authentication before exposing the service beyond a trusted host. Continue
214
+ with [Deployment](deployment.md) for remote inference, network policy,
215
+ monitoring, and backups.
216
+
217
+ Manage the mounted vault on the host. A retrieval-only container should mount
218
+ it read-only.
219
+
220
+ ## Combine native pins with shared retrieval
221
+
222
+ Use this topology when users need native core or project pins and also one
223
+ shared MCP endpoint. Keep one Git-backed vault as the source of truth:
224
+
225
+ - each machine that owns client skill directories keeps its own checkout and
226
+ runs the Skillmux CLI for `init`, pinning, and `sync`;
227
+ - the shared server mounts its own checkout and serves routed retrieval over
228
+ HTTP;
229
+ - MCP-only clients connect to the shared server and do not need the CLI.
230
+
231
+ Skillmux does not pull, push, replicate, or make those checkouts fresh. Git
232
+ and your deployment process own vault replication and freshness.
233
+
234
+ ## Next steps
235
+
236
+ - [Concepts](concepts.md) explains delivery, deployment, and inference terms.
237
+ - [Configuration](configuration.md) documents local and remote inference.
238
+ - [Troubleshooting](troubleshooting.md) lists common `doctor`, model, and
239
+ transport failures.
@@ -0,0 +1,172 @@
1
+ # MCP routing
2
+
3
+ Skillmux exposes one vault through two Model Context Protocol tools. Choose a
4
+ transport based on where the process runs:
5
+
6
+ | Topology | Transport | Typical package |
7
+ | --- | --- | --- |
8
+ | Skillmux beside one client | stdio | Skillmux CLI |
9
+ | Shared Skillmux service | Streamable HTTP | Full Docker image by default; slim for remote or lexical retrieval |
10
+
11
+ Both transports expose the same `resolve_skill` and `fetch_skill` contract.
12
+ Local native pinning is optional and can run beside stdio MCP.
13
+
14
+ ## Register a stdio server
15
+
16
+ Start the server:
17
+
18
+ ```sh
19
+ skillmux index
20
+ skillmux doctor
21
+ skillmux serve
22
+ ```
23
+
24
+ Register the command in your MCP client:
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "skillmux": {
30
+ "command": "skillmux",
31
+ "args": ["serve"]
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ The default transport is stdio. The process exits when the client closes its
38
+ input stream or sends a termination signal.
39
+
40
+ ## Connect to a shared HTTP service
41
+
42
+ Start a Streamable HTTP server:
43
+
44
+ ```sh
45
+ skillmux serve --transport http --port 3000
46
+ ```
47
+
48
+ Clients send MCP requests to:
49
+
50
+ ```text
51
+ http://127.0.0.1:3000/mcp
52
+ ```
53
+
54
+ The default host accepts loopback connections only. Configure authentication
55
+ and network exposure before serving other machines. See
56
+ [Deployment](deployment.md#expose-http-safely).
57
+
58
+ ## Tool contract
59
+
60
+ ### `resolve_skill`
61
+
62
+ Input:
63
+
64
+ ```json
65
+ {
66
+ "query": "convert this spreadsheet to a Markdown table"
67
+ }
68
+ ```
69
+
70
+ Skillmux returns one outcome:
71
+
72
+ - `matched`: `structuredContent` contains match metadata and the text content
73
+ contains the `SKILL.md` body once;
74
+ - `ambiguous`: `structuredContent` contains up to `candidate_limit` candidates;
75
+ - `no_match`: the agent continues with its normal workflow.
76
+
77
+ ### `fetch_skill`
78
+
79
+ Input:
80
+
81
+ ```json
82
+ {
83
+ "skill_id": "csv-formatter"
84
+ }
85
+ ```
86
+
87
+ The response contains the current `SKILL.md` body as text content.
88
+ `structuredContent` contains the skill ID, title, content SHA-256, and
89
+ supporting-file paths. Fetch does not depend on an earlier resolve call.
90
+
91
+ The complete wire contract lives in [schema.json](schema.json).
92
+
93
+ ## Recommended agent behavior
94
+
95
+ Give the calling client these rules:
96
+
97
+ 1. Call `resolve_skill` when a task may benefit from a specialized workflow.
98
+ 2. Follow the delivered skill on `matched`.
99
+ 3. On `ambiguous`, choose the best candidate and call `fetch_skill`.
100
+ 4. On `no_match`, continue without loading a skill.
101
+
102
+ Do not treat the first ambiguous candidate as an automatic match. Skillmux
103
+ uses ambiguity to keep the final choice with the calling model when it lacks
104
+ enough confidence.
105
+
106
+ ## Retrieval pipeline
107
+
108
+ Skillmux builds candidates in stages:
109
+
110
+ 1. SQLite FTS5 ranks lexical matches with BM25.
111
+ 2. Local or remote embeddings rank semantic similarity.
112
+ 3. Reciprocal-rank fusion combines both lists.
113
+ 4. An optional reranker scores the fused candidates.
114
+ 5. Calibrated thresholds select `matched`, `ambiguous`, or `no_match`.
115
+
116
+ The default local inference configuration uses FTS5 and quantized
117
+ `Xenova/gte-small` embeddings. Skillmux CLI installations cache the
118
+ downloaded model under `~/.cache/skillmux/models`; the full Docker image
119
+ includes it. The slim image starts with lexical retrieval and can call an
120
+ OpenAI-compatible embedding endpoint.
121
+
122
+ Remote inference also supports `jina-v1` or `bifrost-v1` reranker adapters.
123
+
124
+ Without a reranker, Skillmux returns a shortlist and does not auto-match.
125
+ Without calibrated thresholds, a configured reranker orders the shortlist but
126
+ still does not auto-match.
127
+
128
+ Read [Configuration](configuration.md#local-inference) for local and remote
129
+ inference settings. Read [Policy calibration](calibration.md) before enabling
130
+ automatic matches.
131
+
132
+ ## Fallback and readiness
133
+
134
+ Skillmux advertises the capability it can support:
135
+
136
+ - embedding failure falls back to lexical retrieval;
137
+ - reranker failure preserves the hybrid shortlist;
138
+ - vault or index failure marks the server unready.
139
+
140
+ Check the active mode:
141
+
142
+ ```sh
143
+ skillmux doctor
144
+ curl http://127.0.0.1:3000/health/ready
145
+ ```
146
+
147
+ A ready server reports `lexical`, `hybrid`, or `reranked` along with skill and
148
+ index status.
149
+
150
+ ## Content integrity
151
+
152
+ The index stores metadata and retrieval state. Delivery reads the file from
153
+ disk, computes its SHA-256, and returns those current bytes. If indexed
154
+ metadata has gone stale, Skillmux refreshes it before delivery.
155
+
156
+ Supporting files remain in the vault. `fetch_skill` lists their relative paths
157
+ so the calling workflow can locate them through its configured filesystem
158
+ access.
159
+
160
+ ## Audit data
161
+
162
+ Each resolve request records:
163
+
164
+ - timestamp and query;
165
+ - retrieval capability and outcome;
166
+ - candidates with scores;
167
+ - selected skill ID, when present;
168
+ - latency.
169
+
170
+ Skillmux stores audit rows in the SQLite database under `state_dir`. Use
171
+ `skillmux report` to summarize activity. Treat raw queries as private user
172
+ data when backing up or sharing the database.
package/docs/releasing.md CHANGED
@@ -39,9 +39,10 @@ The release workflow publishes:
39
39
  - `skillmux-linux-arm64`
40
40
  - GitHub build provenance attestations when the repository is public
41
41
  - Full image to GHCR and Docker Hub: `:<version>`, `:<major>.<minor>`,
42
- and `:latest`
42
+ and `:latest`; this variant includes GTE-small
43
43
  - Slim image to GHCR and Docker Hub: `:<version>-slim`,
44
- `:<major>.<minor>-slim`, and `:latest-slim`
44
+ `:<major>.<minor>-slim`, and `:latest-slim`; this variant contains no model
45
+ files and uses remote embeddings or lexical fallback
45
46
  - Multi-architecture `linux/amd64` and `linux/arm64` images with SBOM and
46
47
  provenance
47
48
 
@@ -86,7 +87,7 @@ Verify the container with a read-only vault mount:
86
87
 
87
88
  ```bash
88
89
  docker run --rm \
89
- -v ~/.agents/skills:/vault:ro \
90
+ -v ~/skills:/vault:ro \
90
91
  -p 3000:3000 \
91
92
  ghcr.io/klhq/skillmux:latest
92
93
 
@@ -0,0 +1,209 @@
1
+ # Managing skills
2
+
3
+ Skillmux keeps skill content in a canonical vault and materializes selected
4
+ skills into client directories. This guide covers the commands that change or
5
+ inspect that state.
6
+
7
+ Run these commands on the machine that owns the vault and client directories.
8
+ For a retrieval-only Docker service, manage the mounted vault on the host and
9
+ keep the container mount read-only.
10
+
11
+ ## Install from Git
12
+
13
+ `skillmux install` accepts a GitHub shorthand or a full Git URL:
14
+
15
+ ```sh
16
+ skillmux install owner/repo
17
+ skillmux install owner/repo/path/to/skill
18
+ skillmux install https://git.example.com/team/skill.git
19
+ ```
20
+
21
+ The repository root must contain `SKILL.md`. If a repository contains several
22
+ skill directories, add the path for the one you want.
23
+
24
+ Skillmux clones into a temporary directory, validates the selected skill,
25
+ scans its text files, and copies it to `vault_path`. Existing skill IDs require
26
+ `--force`.
27
+
28
+ Preview the destination without copying:
29
+
30
+ ```sh
31
+ skillmux install owner/repo --dry-run
32
+ ```
33
+
34
+ Set a scan gate when you want findings to block installation:
35
+
36
+ ```sh
37
+ skillmux install owner/repo --fail-on high
38
+ ```
39
+
40
+ The scanner detects suspicious prompt-injection patterns, secrets, and risky
41
+ instructions. Findings remain advisory unless you pass `--fail-on`.
42
+
43
+ ## Scan a vault or candidate
44
+
45
+ ```sh
46
+ skillmux scan
47
+ skillmux scan ~/skills/candidate
48
+ skillmux scan --format json
49
+ skillmux scan --fail-on medium
50
+ ```
51
+
52
+ With no path, `scan` checks the configured vault. `--json` wraps the result in
53
+ the standard CLI automation envelope, while `--format json` selects the
54
+ scanner's raw JSON rendering.
55
+
56
+ ## Plan client delivery
57
+
58
+ Use product names for common clients:
59
+
60
+ ```sh
61
+ skillmux init --client claude-code --client codex --dry-run
62
+ ```
63
+
64
+ Use a direct target when you need a known path:
65
+
66
+ ```sh
67
+ skillmux init --target agent-skills --yes
68
+ skillmux init --target custom --dir /srv/my-agent/skills --yes
69
+ ```
70
+
71
+ Skillmux refuses to adopt a target that points to the whole vault because sync
72
+ would reduce its visible skills. Review that migration first:
73
+
74
+ ```sh
75
+ skillmux init --client claude-code --migrate-full-vault \
76
+ --core csv-formatter --dry-run
77
+ skillmux init --client claude-code --migrate-full-vault \
78
+ --core csv-formatter --yes
79
+ ```
80
+
81
+ ## Manage core pins
82
+
83
+ Core skills go to each configured target:
84
+
85
+ ```sh
86
+ skillmux core pin csv-formatter --yes
87
+ skillmux core pin code-context systematic-debugging --yes
88
+ skillmux core unpin csv-formatter --yes
89
+ ```
90
+
91
+ One command can change several skill IDs. Skillmux validates the complete
92
+ change before writing, so a conflict prevents the whole operation. Core stays
93
+ capped at 25 skills.
94
+
95
+ Run `skillmux sync` after a direct pin or unpin command.
96
+
97
+ ## Manage project groups
98
+
99
+ Create a group with the guided command:
100
+
101
+ ```sh
102
+ skillmux project init
103
+ ```
104
+
105
+ Maintain it with explicit commands:
106
+
107
+ ```sh
108
+ skillmux project list
109
+ skillmux project show my-project
110
+ skillmux project add-path my-project ~/code/my-project --yes
111
+ skillmux project pin my-project code-context --yes
112
+ skillmux project attach my-project --client claude-code --client codex --yes
113
+ skillmux project unpin my-project code-context --yes
114
+ skillmux project detach my-project --target codex --yes
115
+ skillmux project remove-path my-project ~/code/my-project --yes
116
+ ```
117
+
118
+ Create the group with `project init` or `project add-path` before pinning.
119
+ Project setup syncs by default. Direct maintenance commands update the
120
+ manifest but leave materialization to the next `skillmux sync`.
121
+
122
+ ## Synchronize targets
123
+
124
+ ```sh
125
+ skillmux sync --dry-run
126
+ skillmux sync
127
+ ```
128
+
129
+ Sync compares the manifest with entries recorded in each target's `.skillmux`
130
+ marker. It creates missing symlinks and removes stale managed links.
131
+
132
+ Install a vault Git hook when merges can change `skillmux.toml`:
133
+
134
+ ```sh
135
+ skillmux sync --install-hook
136
+ ```
137
+
138
+ The hook lives in the canonical vault and runs `skillmux sync` after a merge.
139
+
140
+ ## Inspect active state
141
+
142
+ Find which vault root serves a skill:
143
+
144
+ ```sh
145
+ skillmux skill which code-context
146
+ ```
147
+
148
+ If a local overlay shadows the canonical copy, the output lists both paths.
149
+
150
+ Inspect configuration and readiness:
151
+
152
+ ```sh
153
+ skillmux config show
154
+ skillmux config diff
155
+ skillmux config status
156
+ skillmux doctor
157
+ ```
158
+
159
+ ## Use routing data to tune tiers
160
+
161
+ `resolve_skill` writes an audit row for each request. Summarize recent usage:
162
+
163
+ ```sh
164
+ skillmux report --since 7d
165
+ skillmux report --server http://host:3000 --since 7d
166
+ ```
167
+
168
+ Repeatedly matched skills may belong in core or a project group. Repeated
169
+ `no_match` queries point to missing skills or weak skill descriptions.
170
+
171
+ `--since` accepts windows such as `1h`, `7d`, and `1m`, plus absolute dates and
172
+ timestamps.
173
+
174
+ ## Target ownership and recovery
175
+
176
+ `skillmux target remove <name> --yes` removes the manifest record and preserves
177
+ the target directory, marker, and files. Cleanup stays under your control.
178
+
179
+ Restore a managed target to one symlink that exposes the full vault:
180
+
181
+ ```sh
182
+ skillmux sync --restore-monolith
183
+ ```
184
+
185
+ This operation removes the target marker and per-skill links. It refuses to
186
+ run when unmanaged content makes the replacement unsafe. Re-adopt the target
187
+ with `skillmux init` before running managed sync again.
188
+
189
+ Do not delete `.skillmux` markers by hand. The marker gives sync the ownership
190
+ record it needs to preserve unrelated content.
191
+
192
+ ## Local overlays
193
+
194
+ Configure machine-specific override roots:
195
+
196
+ ```toml
197
+ vault_path = "~/skills"
198
+ local_vault_paths = ["~/skills-local"]
199
+ ```
200
+
201
+ Then record the relationship:
202
+
203
+ ```sh
204
+ skillmux local-vault init ~/skills-local --yes
205
+ skillmux skill which my-skill
206
+ ```
207
+
208
+ Read [Configuration](configuration.md#local-vault-overlays) for precedence,
209
+ pinning restrictions, and watcher behavior.