skillgram 1.2.0__py3-none-any.whl

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,329 @@
1
+ Metadata-Version: 2.4
2
+ Name: skillgram
3
+ Version: 1.2.0
4
+ Summary: Skill management for AI agents: one SKILL.md library (a skill hub and registry) linked into Claude Code, Codex, Cursor, Hermes, Reasonix and any harness that reads skills. No copies, no drift.
5
+ Author: Xhuk
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Xhuk/skillgram
8
+ Project-URL: Issues, https://github.com/Xhuk/skillgram/issues
9
+ Keywords: skill-management,agent-skills,ai-agents,skill-registry,skill-library,skill-hub,admin-skills,llm-tools,mcp,skills,agents,claude-code,claude-skills,codex,hermes,cursor,gemini-cli,reasonix,opencode,symlink,junctions
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development
16
+ Classifier: Topic :: Utilities
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Dynamic: license-file
21
+
22
+ <p align="center"><img src="docs/logo.png" alt="skillgram" width="120"></p>
23
+
24
+ <p align="center">
25
+ <a href="https://github.com/Xhuk/skillgram/actions/workflows/ci.yml"><img src="https://github.com/Xhuk/skillgram/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
26
+ <a href="https://github.com/Xhuk/skillgram/releases/latest"><img src="https://img.shields.io/github/v/release/Xhuk/skillgram?color=b5523a" alt="Release"></a>
27
+ <a href="https://xhuk.github.io/skillgram/"><img src="https://img.shields.io/badge/site-xhuk.github.io%2Fskillgram-b5523a" alt="Site"></a>
28
+ <img src="https://img.shields.io/badge/python-3.9%2B-3776ab" alt="Python 3.9+">
29
+ <img src="https://img.shields.io/badge/deps-none-success" alt="No dependencies">
30
+ </p>
31
+
32
+ <h1 align="center">skillgram</h1>
33
+
34
+ <p align="center"><strong>Skill management for AI agents:</strong> one skill library, linked into every coding agent.<br>
35
+ No copies, no drift, no "which folder does this harness read?".</p>
36
+
37
+ skillgram is a **skill hub** — a registry of `SKILL.md` files that actually lives in one place
38
+ on disk — plus the admin layer that keeps every agent pointing at it. Claude Code, Codex,
39
+ Cursor, Hermes, Reasonix, Gemini CLI, OpenCode, Kiro, Qwen Code, Aider, Copilot and anything
40
+ else that reads skills all see the same library.
41
+
42
+ ```
43
+ ~/.agents/skills/<category>/<skill>/SKILL.md the hub (the only real copy)
44
+ ~/.claude/skills/<skill> -> junction to the hub (symlink off Windows)
45
+ ~/.codex/skills/<skill> -> junction to the hub
46
+ %APPDATA%/Reasonix/skills/<skill> -> junction to the hub
47
+ ```
48
+
49
+ **No work skills are bundled** — it is the plumbing, not the content. The only skill in this
50
+ repo is [`skills/skillgram-report`](skills/skillgram-report/SKILL.md), which teaches an agent
51
+ how to report a bug or a gap.
52
+
53
+ ### What this is, in other words
54
+
55
+ If you were looking for a way to **manage skills for AI agents** — an **admin layer** over the
56
+ skills your coding agents load, a **skill registry / skill library / skill manager**, or a way
57
+ to share one set of `SKILL.md` files between Claude Code, Codex, Cursor and the rest without
58
+ copying anything — this is that tool. Per-project scope, an MCP server so the agent can ask the
59
+ hub, links instead of copies, and no LLM in the loop unless you ask for one.
60
+
61
+ It is **not** a prompt manager, a memory store, or an embeddings index. Those are different
62
+ things and there are good tools for them (Engram, for one, is credited below).
63
+
64
+ ## Why
65
+
66
+ Linking by hand once is easy; keeping fifty agents in sync is not. Agents re-create their own
67
+ copies, rename folders, and a new hub skill never shows up by itself. skillgram turns that
68
+ into one idempotent command — and with `watch`, into no command at all.
69
+
70
+ ## Install
71
+
72
+ The whole machine in one idempotent command, plus a copy-paste brief you can hand to a fresh
73
+ agent session: **[INSTALL.md](INSTALL.md)**.
74
+
75
+ ```bash
76
+ python skillgram.py install --dry-run # what it would do, nothing written
77
+ python skillgram.py install # harness -> hub -> MCP (delegated) -> propagate
78
+ ```
79
+
80
+ From source — this is not on PyPI yet, so `pip install skillgram` would fail:
81
+
82
+ ```bash
83
+ git clone https://github.com/Xhuk/skillgram
84
+ cd skillgram
85
+ python skillgram.py --help
86
+ # or install it as a command: pip install .
87
+ ```
88
+
89
+ Stdlib only (Python 3.9+), no dependencies. Junctions on Windows, symlinks on macOS/Linux.
90
+ CI runs the suite on Linux for Python 3.9, 3.11 and 3.13.
91
+
92
+ ## Quick start
93
+
94
+ ```bash
95
+ skillgram doctor # what harnesses and native skills exist here (read-only)
96
+ skillgram sync # make the disk match the hub: links only, idempotent
97
+ skillgram status # drift, right now
98
+ skillgram install --dry-run # the whole machine: hub + MCP + project scope
99
+ ```
100
+
101
+ ## How it works
102
+
103
+ ### Links, never copies
104
+
105
+ `sync` only adds links. It never copies, moves, adopts or deletes a skill an agent already
106
+ has: a native skill with the same name as a hub skill is skipped and reported as a collision,
107
+ never overwritten. `doctor` tells you how many native skills each harness has before you touch
108
+ anything.
109
+
110
+ For harnesses that scan a single level, each agent also gets one link per category
111
+ (`skills/<category>` → `hub/<category>`), so the hub stays browsable.
112
+
113
+ `precedence` is the cooperative alternative: it declares the hub **first** in each harness'
114
+ own config (`skills.paths` for Reasonix, `skills.external_dirs` for Hermes) with a
115
+ `*.skillgram-bak-<timestamp>` backup next to the file. Delete skillgram and every harness keeps
116
+ exactly what it had.
117
+
118
+ The hard-mount model — one junction for the whole `skills/` directory — is deliberately *not*
119
+ the default: a `rimraf skills` or a harness uninstall would wipe the library of every agent.
120
+
121
+ ### Project scope (engram-style)
122
+
123
+ The hub is the library; a project is what an agent actually needs while working in it.
124
+
125
+ ```bash
126
+ skillgram init my-api # <project>/.agents/config.json
127
+ skillgram use archify ad3 --project . # link + manifest entry, idempotent
128
+ skillgram mount --apply # materialize that set where each harness looks
129
+ skillgram project-status # healthy / stale / broken / missing links
130
+ ```
131
+
132
+ ```
133
+ <project>/.agents/config.json {"project_name": "my-api"}
134
+ <project>/.agents/skills/<name> link to the hub
135
+ <project>/.agents/skills.json manifest: category, source, hash, promoted_at, last_used
136
+ ```
137
+
138
+ Resolution order, same as engram: `--project` → `SKILLGRAM_PROJECT` → nearest
139
+ `.agents/config.json` up to the git root → cwd. If it cannot resolve, it says so; it never
140
+ guesses. `mount` writes the project's set into every harness layout that reads project-level
141
+ skills (`.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`,
142
+ `.gemini/skills`, `.github/skills`, `.hermes/skills`, `.kiro`, `.qwen`, `.aider`,
143
+ `.opencode`), and `--prune-global` goes strict: the harness homes stop seeing the hub at all
144
+ (only links that resolve into the hub are removed; native skills stay).
145
+
146
+ `project-status` also flags a skill that lives both in the hub **and** as a real copy inside
147
+ the project.
148
+
149
+ ### The MCP server: let the agent ask
150
+
151
+ ```bash
152
+ skillgram mcp # stdio server, 5 tools
153
+ skillgram mcp --read-only # the agent can query, not use/propose
154
+ ```
155
+
156
+ `skillgram_search`, `skillgram_missing`, `skillgram_use`, `skillgram_status`,
157
+ `skillgram_propose`. `missing` answering `{"found": false}` is the contract that says *do not
158
+ invent a skill, tell the user*. `install` registers this server through each harness' own CLI
159
+ and reads the config back afterwards — an exit code is not proof.
160
+
161
+ ### The LLM, only where it earns its place
162
+
163
+ A connected OpenAI-compatible model is used in exactly three places, always proposing a JSON
164
+ plan that skillgram validates and you approve: `bootstrap` (choose a project's initial set from
165
+ the repo's signals), `propose` (draft a skill that does not exist) and `port` (translate a skill
166
+ wired to another agent into `agents/<harness>.md`). Every decision is stamped `by: llm:<model>`
167
+ in the manifest and logged to `~/.agents/skillgram-llm.log`. `--no-llm` and `SKILLGRAM_LLM=off`
168
+ turn it off.
169
+
170
+ ```
171
+ SKILLGRAM_LLM_BASE_URL default https://api.deepseek.com/v1
172
+ SKILLGRAM_LLM_MODEL default deepseek-flash
173
+ SKILLGRAM_LLM_API_KEY or DEEPSEEK_API_KEY / OPENAI_API_KEY
174
+ ```
175
+
176
+ A project with a scope needs no LLM at all: that is *régime*, where skillgram only serves the
177
+ set and answers "do we have something for this?".
178
+
179
+ ### Finding, judging and retiring skills
180
+
181
+ ```bash
182
+ skillgram index # FTS5 index of the hub
183
+ skillgram search "docker deploy vps" --limit 5
184
+ skillgram missing "quote a mortgage" # found | not found, with candidates
185
+ skillgram review --days 90 # never used / stale
186
+ skillgram review --days 30 --fail-if-stale # CI gate: exit 1 when the set is stale
187
+ skillgram pin <skill>... # never reported as stale
188
+ skillgram retire <skill> # -> <hub>/_retired/ + tombstone, never deleted
189
+ ```
190
+
191
+ `use` stamps `last_used`, `use_count` and `last_used_by`. `_retired/` keeps the content plus
192
+ `_retired.json` (who, when, why, hash) and is never treated as a category.
193
+
194
+ ### Moving a hub around
195
+
196
+ ```bash
197
+ skillgram export hub.tar.gz # every skill + hub.json of hashes
198
+ skillgram import hub.tar.gz # verifies the hashes; --apply to materialize
199
+ skillgram diff <skill> --against <path> # divergence between two copies
200
+ skillgram git init --apply # the hub as a repo (adds a .gitignore for the index)
201
+ skillgram git pull --apply # ff-only: git resolves conflicts, skillgram never guesses
202
+ ```
203
+
204
+ The hub is the asset. With git under it, "sync between machines" is git's job.
205
+
206
+ ## What it does NOT do (on purpose)
207
+
208
+ - It never copies, moves or deletes a native skill. Collisions are reported, not resolved.
209
+ - It never edits a harness config by hand: MCP registration goes through that harness' CLI.
210
+ - It never guesses which harness is asking (`SKILLGRAM_HARNESS` → `--harness` → process tree →
211
+ `unknown`, and it says so).
212
+ - It never publishes a skill nobody approved.
213
+ - It is not a memory store, a prompt library, or an embeddings index.
214
+
215
+ ## Safety
216
+
217
+ - Links only. Dead-link cleanup only touches links that resolve inside the hub — never
218
+ content, never a real directory.
219
+ - `onboard` copies and verifies the hash before reporting success; the original only moves to
220
+ `~/.agents/skillgram-quarantine/<harness>/<skill>` with `--replace-natives`, and never to the
221
+ bin.
222
+ - Nothing in your repos changes unless you run `init`, `use`, `mount` or `install --root`.
223
+ - Preview anything: `install --dry-run`, `sync --dry-run`, `onboard --json --plan plan.json`.
224
+
225
+ ## Report a bug or a gap
226
+
227
+ Two different things, two different channels — mixing them is how a roadmap turns into noise.
228
+ A **gap** (the hub has nothing for a capability) is a *request*: `skillgram_missing` answers
229
+ `found:false`, the agent offers `propose`, and the query is recorded in the demand log
230
+ (`skillgram demand` ranks what nobody could answer). A **bug** (skillgram itself failed) is one
231
+ JSON line with `ok:false` and a non-zero exit — never dressed up as a skill.
232
+
233
+ The repo ships both forms in `.github/ISSUE_TEMPLATE/` (`bug_report.yml`, `skill_request.yml`)
234
+ and the skill that walks an agent through them:
235
+ [`skills/skillgram-report`](skills/skillgram-report/SKILL.md).
236
+
237
+ ## Commands
238
+
239
+ | Command | What it does |
240
+ |---|---|
241
+ | `doctor` | harnesses, native skills, collisions, dead/missing links. Read-only. |
242
+ | `status` / `sync` | drift now / apply the desired state. `--verify`, `--dry-run`. |
243
+ | `install` / `propagate` | the whole machine / the repo sweep, with a ledger. |
244
+ | `onboard` / `adopt` | consolidate what harnesses already have (LLM optional) / cooperative adoption. |
245
+ | `init` / `use` / `unuse` / `mount` / `project-status` | the project scope. |
246
+ | `index` / `search` / `missing` / `demand` | find, or learn what is missing. |
247
+ | `review` / `pin` / `retire` | lifecycle. |
248
+ | `export` / `import` / `diff` / `git` | move a hub around. |
249
+ | `mcp` | stdio MCP server (`--read-only`). |
250
+ | `lint` | quality gate: frontmatter, name, description, size. |
251
+ | `watch` / `daemon` / `install-autostart` | keep it in sync by itself. |
252
+
253
+ `skillgram --help` lists all of them (33); `skillgram <command> --help` is the contract for
254
+ one. Every command prints **exactly one JSON line** on stdout (`--json` for the human ones too).
255
+ Exit code `0` healthy, `1` drift/error, `2` bad invocation.
256
+
257
+ ```json
258
+ {"ok":true,"op":"status","version":"1.2.0","hub":"C:\\Users\\me\\.agents\\skills","skills":842,"categories":18,"nested":12,"agents":50,"drift":0,"watching":false,"missing":0,"mispointed":0,"dead":0,"skipped":2}
259
+ ```
260
+
261
+ ## Known gaps (documented, not implemented)
262
+
263
+ Compared with Engram (Gentleman-Programming), which is a service with a full lifecycle, these
264
+ remain open by decision. When one closes, the line goes away.
265
+
266
+ 1. **No cross-machine sync.** `export`/`import` is manual; there is no transport and no
267
+ conflict resolution between two hubs. (`git` under the hub is the workaround.)
268
+ 2. **No merge of divergent skills.** Same name + different content fails; the merge is a human
269
+ (or LLM) decision, then `diff` tells you exactly what differs.
270
+ 3. **No real usage telemetry.** `use_count` counts explicit promotions and MCP `use` calls;
271
+ skillgram does not observe which skills an agent actually reads.
272
+ 4. **Lexical search only.** FTS5 has no embeddings, so cross-language synonyms miss (measured:
273
+ `"cotizar credito hipotecario"` → one weak hit).
274
+ 5. **No permissions/profiles.** No agent/admin split: anyone with a shell can publish or
275
+ retire. `mcp --read-only` removes the write tools from a session, but it is a per-server
276
+ switch, not a role.
277
+ 6. **No taste gate.** `lint` checks shape and is a hard gate in `propose`, but nothing judges
278
+ whether a skill is *useful*: no eval, no grading, no dry run of the skill itself.
279
+ 7. **No scheduled review.** `review` is manual; put `review --fail-if-stale` in your cron/CI.
280
+ 8. **MCP is tools-only.** No `resources`, no `prompts`, no sampling.
281
+
282
+ ## Language
283
+
284
+ Everything user-facing is **English**: CLI output, error messages and every JSON key
285
+ (`promoted`, `already_present`, `missing_links`, `native`, `collisions`, `signals`,
286
+ `selection`, ...). That is the API other tools read. Internal code comments and docstrings are
287
+ still partly Spanish; translating them is tracked as cleanup, not as behaviour.
288
+
289
+ ## Prior art and credits
290
+
291
+ skillgram is original code (MIT, stdlib only), but the ideas are not mine and pretending
292
+ otherwise would be dishonest. These shaped it — if one of them is what you actually need, use
293
+ it directly:
294
+
295
+ - **Engram** — the project-scope resolution order (`--project` → env → nearest
296
+ `.agents/config.json` up to the git root → cwd), the "one store, a per-project view" model,
297
+ and the CLI-plus-MCP split this repo copied the shape of.
298
+ - **Agent Skills / `SKILL.md`** (Claude Code, then everyone else) — the `SKILL.md` + YAML
299
+ frontmatter format and the `.claude/skills` convention every other harness imitated.
300
+ skillgram does not invent a format: it links yours.
301
+ - **Codex, Cursor, Gemini CLI, Kiro, Qwen Code, Aider, OpenCode, Copilot** — their
302
+ project-level `skills/` layouts are the reason `mount` knows eleven of them.
303
+ - **ECC** — a 291-skill pack that lives next to this hub, and the reason every feature here is
304
+ tested against "does this still hold at ~850 skills?".
305
+ - **Unix**, in the only sense that matters: one directory is the truth, every agent a client.
306
+
307
+ No code was copied from any of them. Where a behaviour was learned from another tool, the
308
+ section that documents it says so. If your project belongs in this list, open an issue — credit
309
+ is cheap, respect is not.
310
+
311
+ ## Where the detail lives
312
+
313
+ | You want | Read |
314
+ |---|---|
315
+ | to install on a machine, or hand it to an agent | [INSTALL.md](INSTALL.md) |
316
+ | what changed, version by version | [CHANGELOG.md](CHANGELOG.md) |
317
+ | the install flow as a diagram | [docs/diagrams/skillgram-install.html](docs/diagrams/skillgram-install.html) |
318
+ | the rules this repo holds itself to | [AGENTS.md](AGENTS.md) |
319
+ | how to report something | [skills/skillgram-report](skills/skillgram-report/SKILL.md) |
320
+
321
+ ## Tests
322
+
323
+ ```bash
324
+ python -m unittest discover -s tests -v
325
+ ```
326
+
327
+ ## License
328
+
329
+ MIT.
@@ -0,0 +1,7 @@
1
+ skillgram.py,sha256=bi9iYWwQDVhnX4fqv2h_6LSlYPhzOh3qI0WNjw_aQSw,167071
2
+ skillgram-1.2.0.dist-info/licenses/LICENSE,sha256=RXL8NGYsgEU_e5wFalPJnLjTI7s6ZxaAtPwZckppQJY,1061
3
+ skillgram-1.2.0.dist-info/METADATA,sha256=52yS31bxnpYDujhLurevxVcpXJJ-uHT8Y6lpcm2HHig,16422
4
+ skillgram-1.2.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
5
+ skillgram-1.2.0.dist-info/entry_points.txt,sha256=Q40_-g6ZNteaNDnVspWtk3ay9LMBiUKn5NhqcqxYyBw,45
6
+ skillgram-1.2.0.dist-info/top_level.txt,sha256=xAI1zk_5W-UY34nqE8uVryX-SGvG_ZU1Ih4RLrakSDA,10
7
+ skillgram-1.2.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ skillgram = skillgram:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Xhuk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ skillgram