From d0dd2ec936d60c2a4621c63f5b2fa1d938e48cf2 Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Sat, 21 Nov 2026 19:01:01 +0100 Subject: [PATCH] docs: explain subfolder skill syntax --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea4737c..1fb86b0 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,32 @@ Both files take one entry per line. Empty lines and everything after a `#` are i The skill folder is named after the last part of the URL, without `.git`: `https://git.bjphoster.com/skills/ship` is installed as `skills/ship`. HTTPS and SSH URLs both work (`git@host:org/name.git`). -Versions are compared with `sort -V`, and only tags that start with a digit (optionally after a `v`) count. With `>` or `>=`, if no tag matches yet the skill is left where it is and a warning is printed. To go back from a pinned version to following the branch, just remove the operator and the version. +Versions are compared with `sort -V`, and only tags that start with a digit (optionally after a `v`) count. With `>` or `>=`, if no tag matches yet the skill is left where it is and a warning is printed. `=` also accepts a branch name (`=main`): the skill then follows that branch. To go back from a pinned version to following the branch, just remove the operator and the version. + +#### Skills inside a bigger repository + +Some repositories hold several skills in subfolders. List the ones you want between braces, separated by commas, right after the URL: + +``` +https://github.com/t3dotgg/tstack{/skills/council,/skills/sol-loop} +``` + +This installs two skills, `council` and `sol-loop`, the same as taking only the folders `https://github.com/t3dotgg/tstack/tree/main/skills/council` and `https://github.com/t3dotgg/tstack/tree/main/skills/sol-loop`. Each skill is named after the last part of its folder, and only the content of that folder ends up in `/skills/`, not the rest of the repository. + +The version goes after the braces and applies to every folder on that line: + +| Line | Meaning | +|---|---| +| `https://github.com/t3dotgg/tstack{/skills/council}` | `council` from the latest commit of the default branch | +| `https://github.com/t3dotgg/tstack{/skills/council,/skills/sol-loop}=1.2.0` | Both from tag `1.2.0` | +| `https://github.com/t3dotgg/tstack{/skills/council}>=1.2.0` | `council` from the newest tag from `1.2.0` up | +| `https://github.com/t3dotgg/tstack{/skills/council}=dev` | `council` following the `dev` branch | + +To use different versions for different folders of the same repository, put them on separate lines. The leading and trailing `/` in the folder are optional, and folders containing `..` are refused. + +How it works: the repository is kept as a git mirror in `~/.cache/skills-autoupdate` (fetched once per run, however many skills and harnesses use it), and each folder is extracted from there into the skill folder. Since that folder is a plain copy and not a git checkout, the script writes a small `.skills-autoupdate` file next to the skill with the source URL, the folder, the commit and a checksum of the files. On the next run it uses that file to know which version is installed and whether you changed anything: if a file was edited, added or removed, the skill is skipped with a warning, exactly like a git checkout with local changes. Delete the skill folder to get a fresh copy. + +Every skill name must be unique across the whole file: if two lines would install a skill with the same name, the second one is skipped with a warning. ### `~/.config/harnesses` @@ -144,7 +169,7 @@ Cron has no terminal, so git cannot ask for a password: the script disables ever ## What it will and will not do -It only writes inside `/skills/` for the skills you listed, plus the lock file. It does not remove skills you delete from the list, does not touch skills it did not clone, never resets or discards local changes, and never pushes. +It only writes inside `/skills/` for the skills you listed, plus the lock file and the mirrors in `~/.cache/skills-autoupdate`. It does not remove skills you delete from the list, does not touch skills it did not install, never resets or discards local changes, and never pushes. ## Requirements