Repository navigation
chore: add skill lock - #2
Merged
Merged
Conversation
Agent skills installed with `npx skills` were not reproducible: the lockfile at ~/.agents/.skill-lock.json was ignored and install.sh never reinstalled anything, so a new machine or Codespace lost every skill. Link the lockfile through dotstate and add install_agent_skills, which runs one `skills add --global --agent claude-code` per source repository for the skills missing from ~/.agents/skills. It skips in CI and rejects lockfile names that are not plain directory names.
~/.claude was unmanaged, so plugins, marketplaces, the status line and the Rose Pine theme had to be set up again on every machine. Link ~/.claude/settings.json and ~/.claude/themes through dotstate. The tracked settings hold only portable keys: the fluentui autoMode context is dropped and its permission rule now lives in that repository's local settings, since this repository is public. A test rejects autoMode, permissions, env and apiKeyHelper in the tracked file.
There was a problem hiding this comment.
🟡 Changes recommended
Automatic skill restoration can delete unmanaged Claude skill files without backup, and bootstrap handling also needs correction.
3 open issues
What changed in this PR
This PR adds a tracked agent skill inventory and restores missing skills during dotfiles installation. It also brings Claude Code settings and themes under dotstate management.
Changes:
- Restore missing skills by source repository after linking dotfiles.
- Track the skills lockfile, Claude settings, and Rosé Pine theme while ignoring runtime state.
- Update documentation and tests for restoration, linking, backups, and ignore rules.
| File | Description |
|---|---|
test.sh |
Adds skill restoration tests and extends configuration safety checks. |
README.md |
Documents automatic restoration of missing skills. |
install.sh |
Adds grouped skill installation and invokes it during setup. |
common/.claude/themes/rose-pine.json |
Adds the Rosé Pine theme. |
common/.claude/settings.json |
Adds shared Claude Code settings. |
common/.agents/.skill-lock.json |
Records the skill inventory and source metadata. |
.gitignore |
Allows tracked settings and lockfile while excluding runtime state. |
.dotstate-profiles.toml |
Links the lockfile, Claude settings, and themes. |
Review effort: Balanced
…ocks The skills CLI removes whatever sits at ~/.claude/skills/<name> before linking, so a locked skill missing from ~/.agents/skills could delete a hand-made Claude skill of the same name. Skip such skills with a warning instead, honoring CLAUDE_CONFIG_DIR like the CLI does. `jq -e` exited 4 on a lockfile with no skills, aborting install.sh under set -e. Read sources without -e and validate the shape explicitly, so an empty inventory succeeds while malformed JSON, a missing skills object or a non-string sourceUrl still fail. Also restore the executable bit on test.sh lost in e21b517.
The tracked settings run ccstatusline as the status line, but nothing in the bootstrap installed it and it has no Homebrew formula, so a fresh machine showed no status line. Install it with npm from the Brewfile's node when missing; a pinned binary avoids an npx registry lookup on every 10s refresh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.