From de8dab44f5e8b0e9226de82c858734b76f503769 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 19 Nov 2026 10:05:08 +0000 Subject: [PATCH] README: ten tools, SKILLD_HOME, real git and HTTP behaviour List all ten MCP tools with their arguments; document the library path order (SKILLD_HOME, SKILLLIB, XDG_DATA_HOME); skill_clone does not commit; the repository is created on first write; --http always binds every address; CGI URLs and tests; link to git.kropa.tech. --- README.md | 95 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b56e1d9..7502960 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,12 @@ MCP server for the skill library, written in C99/POSIX. -Eight tools over the standard MCP surface: list, search, read, write and -inspect `SKILL.md` files under `$SKILLS_DIR`. Built on `libmcp` (header-only). +Ten tools over the standard MCP surface: search, load, create, update, clone, +list and delete `SKILL.md` files in the skill library, plus history, diff and +sync through git. Built on `libmcp` (header-only). `skilld-http` is a CGI web +UI on top of it. + +Code: https://git.kropa.tech/hiddenbox/skilld ```sh make @@ -13,40 +17,68 @@ make test The binary speaks MCP over stdio, so it is registered as an MCP server, not started by hand. +## Tools + +| tool | arguments | what it does | +|---|---|---| +| `skill_search` | `query`, `limit` | ranked search by describing the job | +| `skill_load` | `name` | one skill in full | +| `skill_create` | `name`, `description`, `body`, `tags` | write a new skill | +| `skill_update` | `name`, `description`, `body`, `append` | replace the trigger line or body, or append a section | +| `skill_clone` | `name`, `new_name` | copy a skill with its references and scripts | +| `skill_list` | (none) | every skill: name, description, tags | +| `skill_history` | `name`, `limit` | commits for one skill or the whole library | +| `skill_diff` | `name` | what is changed but not committed | +| `skill_sync` | `push` | `pull --rebase` from the remote; `push: true` sends instead | +| `skill_delete` | `name` | remove the skill's directory | + +## Where the library lives + +``` +$SKILLD_HOME if set +$SKILLLIB old name, still accepted +$XDG_DATA_HOME/skilld otherwise +~/.local/share/skilld if XDG_DATA_HOME is unset +``` + +Each skill is a directory `/` with a `SKILL.md` (YAML frontmatter and a +markdown body) and whatever references, scripts or templates belong to it. +skilld prints at start which library it uses and in which git mode. ## Git is the substrate -Every write through skilld is committed: `skill_create`, `skill_update`, -`skill_clone` and `skill_delete` end with a commit under the skill's own message -(`skilld: update `). A skill written by one agent and corrected by another -keeps both, and `git log` answers who changed what and when. +`skill_create`, `skill_update` and `skill_delete` end with a commit under the +skill's own message (`skilld: create `, `skilld: update `, +`skilld: delete `), authored as `skilld `. A skill written +by one agent and corrected by another keeps both, and `git log` answers who +changed what and when. A commit takes everything that is changed in the +skill's directory (for a delete: in the library), including edits made by hand. +`skill_clone` copies the files but does not commit; the clone is committed with +its first update, or shows up in `skill_diff`. + +The library becomes a repository on the first write if git is installed; an +existing repository, also a parent one, is left as it is. skilld never pushes +on its own. To share the library, give it a remote and use `skill_sync`: ```sh -git -C "$SKILLLIB" init -git -C "$SKILLLIB" remote add origin +git -C "$SKILLD_HOME" remote add origin ``` -Four tools come with it: - -| tool | what it does | -|---|---| -| `skill_history` | commits for one skill or the whole library | -| `skill_diff` | what was changed outside skilld and is not committed yet | -| `skill_sync` | `pull --rebase` from the remote; `push: true` sends instead | -| (automatic) | a write whose working tree is dirty commits the change with it | - -Is the library *not* a repository, nothing breaks: the tools say so instead of -pretending, and skilld prints at start which mode it is in. Version control that -silently does nothing is worse than none. +Without git nothing breaks: the git tools say the library is not a repository +instead of pretending, and the start message says changes are not versioned. +Version control that silently does nothing is worse than none. ## HTTP ```sh skilld # MCP over stdin/stdout skilld --http 8790 # same tools over Streamable HTTP -skilld --http :8790 # ... on every address ``` +`--http` takes `8790`, `:8790` or `0.0.0.0:8790`; only the port is used, and +the server listens on every IPv4 address. There is no authentication, so keep +the port off untrusted networks. + The HTTP server lives in libmcp (`mcp_serve_http`), so tasksd and skilld share one implementation instead of two copies. @@ -67,7 +99,9 @@ checkout elsewhere: `make LIBDIR=../libmcp`. `skilld-http` is a C99 CGI program: HTML 4.01, no JavaScript, no auth. It reads and writes only through skilld's MCP server (`SKILLD_URL`, default `http://127.0.0.1:8790/mcp`), so edits from the browser are committed by skilld the same -way an agent's edits are. +way an agent's edits are. skilld therefore has to run with `--http`. + +Addresses are relative to the CGI, e.g. `/cgi-bin/skilld-http/search?q=…`: | Address | Effect | |---|---| @@ -77,24 +111,35 @@ way an agent's edits are. | `/s//edit` | description, body, append | | `/s//clone` | clone to a new name | | `/s//delete` | POST only | -| `/new` | create a skill | -| `/history?name=…` | git history | +| `/new` | create a skill (name, description, tags, body) | +| `/history?name=…` | git history; without `name` the whole library | | `/diff` | uncommitted changes | -| `/sync` | pull/push buttons | +| `/sync` | pull/push buttons (POST to `/sync/pull`, `/sync/push`) | ```sh make # skilld and skilld-http sudo make install # /usr/local/bin/skilld, /usr/local/lib/cgi-bin/skilld-http ``` +`PREFIX`, `CGIDIR` and `DESTDIR` change the install paths. + With busybox httpd: ```sh +skilld --http 8790 & install -d /srv/www/cgi-bin install -m 0755 skilld-http /srv/www/cgi-bin/ SKILLD_URL=http://127.0.0.1:8790/mcp \ busybox httpd -f -p 0.0.0.0:8798 -h /srv/www ``` +The UI is then at `http://:8798/cgi-bin/skilld-http/`. + `vendor/cgi/cgi.h` is the shared CGI helper (one copy each in wikid, memoryd, skilld and tasksd). + +## Tests + +`make test` runs the MCP surface test (`tests/run.sh`), the git test +(`tests/git.py`) and the CGI test (`tests/test-http.sh`), each against a +temporary library. They need `python3`; the CGI test also needs `curl`.