sk
Original:🇺🇸 English
Translated
How to use the repo-scoped sk CLI to manage Claude Skills in this codebase.
2installs
Sourcelambdamechanic/skills
Added on
NPX Install
npx skill4agent add lambdamechanic/skills skTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Using the sk
CLI
skskskills.lock.json./skills~/.cache/sk/reposWhen to reach for this skill
- You need to install or upgrade a skill from the canonical skills repo ().
https://github.com/lambdamechanic/skills - You want to verify the working tree is clean (,
sk doctor --status).sk doctor --summary - You are preparing to sync edits back to the upstream skills repository ().
sk sync-back <install>
Core workflow
-
Refresh the cache (optional but fast):bash
target/debug/sk update -
Install or upgrade a skill (alias keeps folder names stable):bash
target/debug/sk install https://github.com/lambdamechanic/skills testing-patterns --alias testing target/debug/sk upgrade testing -
Audit local installs before landing work:bash
target/debug/sk doctor --status --json # detect dirty trees vs lockfile target/debug/sk doctor --summary --json # shows pending upgrades or cache drift -
Sync edits upstream after modifying a skill under:
./skills/<name>bashtarget/debug/sk sync-back <name> --message "Describe the change"Onceis configured,sk config set default_repo <repo>automatically targets that repo, usessk sync-back <name>for the skill-path, and generates<name>branches so the quickstartsk/sync/<name>/<timestamp>flag is the only required argument. Supply-m/--repoonly when you need to override the defaults.--skill-pathThis creates a temp branch in the cached repo, copies your edited skill directory, commits, and pushes. On successrunsskfor you: it auto-opens a PR, enables auto-merge when GitHub reports the branch is clean, and prints the PR URL (or a conflict warning) so you can follow up if automation gets blocked. If the GitHub CLI is missing or the repo isn’t reachable via GitHub, you’ll see a warning plus manual PR instructions and can runghyourself once available.gh pr createPR automation tips- Run once per machine to ensure the GitHub CLI is logged in;
gh auth statuswill reuse your credentials.sk - Missing prints a warning and falls back to a recursive copy before committing; install
rsyncto keep large skills fast.rsync - After the push, watch the terminal output:
- (or
Opened PR …) links to the branch that was just published.Reusing PR … - means GitHub will land it once checks pass; otherwise you’ll see
Auto-merge armed…with a link to fix conflicts manually.Auto-merge blocked… - appears when checks can’t be armed (e.g., required approvals disabled); click through and finish by hand.
Auto-merge skipped…
- When is missing or unauthenticated you’ll see “Skipping PR automation …”; install/auth and rerun
ghto finish the upload.sk sync-back - Automation currently uses GitHub’s standard strategy; if your repo enforces
--merge/--squash, turn off auto-merge in the UI and land it manually after review.--rebase - If your PR output says , run
enablePullRequestAutoMerge(or visit the repo’s Settings → General page) once to flip the toggle.gh repo edit <owner>/<repo> --enable-auto-merge
- Run
-
Publish a brand-new skill that doesn’t exist upstream yet:bash
target/debug/sk sync-back <name> \ --repo https://github.com/lambdamechanic/skills \ --skill-path <subdir> \ --message "Add <name> skill"Provide/--repoonly if you need something other than the configured defaults.--skill-pathclones that repo, branches from the default tip (or your customsk), copies your local folder, pushes, and rewrites--branchwith the exact commit SHA/digest so status checks stay clean. You will always see the temporary branch name in the CLI output, e.g.skills.lock.json, even though that branch is meant to be merged and deleted once the upstream PR lands.Pushed branch 'sk/sync/<name>/<timestamp>' …
Example: publishing sk
skbash
cd /path/to/sk-decisions
target/debug/sk sync-back sk \
--repo https://github.com/lambdamechanic/skills \
--skill-path sk \
--branch sk/add-sk-skill-doc \
--message "Add sk skill doc"What happens:
- prints both the temporary branch name and the upstream repo it pushed to, so you can follow up on GitHub immediately.
sk - The branch only needs to live long enough for you (or automation) to open a PR; the lockfile entry pins the pushed commit hash, so it’s safe to delete the branch once merged.
- gains a new entry for
skills.lock.jsonwith the push timestamp, digest, and commit ID; subsequentskruns stay green because the on-disk tree matches that digest.sk doctor --status
Guardrails
- Always run /
bd updatesobd closematches any skill changes..beads/issues.jsonl - Never edit by hand. Let
skills.lock.json,sk install, orsk upgradeupdate it; commit the lockfile alongside the skill changes.sk remove - If reports
sk doctor --status, fix the local tree before runningdirtyorsk upgradeto avoid partial syncs.sk sync-back - skips skills with local edits and prints reminders to
sk upgrade --all; treat that as a temporary state and clean them up promptly so future upgrades stay automatic.sk sync-back <name> - When creating a new skill, always specify the upstream repo/path so can register it and refresh the lockfile automatically.
sk - Use (once implemented) to block local-only sources such as
sk precommitentries.file://
Debug tips
- rebuilds missing installs or cache entries.
target/debug/sk doctor --apply - prints the absolute path of an installed skill and its cached repo clone.
target/debug/sk where <name> - Set to surface extra logging when diagnosing cache fetches or rsync failures.
SK_TRACE=1