Skip to content

chore: add skill lock - #2

Merged
mainframev merged 5 commits into
masterfrom
feat/claude-skills-sync
Oct 24, 2026
Merged

mainframev merged 5 commits into
masterfrom
feat/claude-skills-sync

Conversation

@mainframev

Copy link
Copy Markdown
Owner

No description provided.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread install.sh Resolved
Comment thread common/.claude/settings.json Resolved
Comment thread install.sh Resolved
…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.
@mainframev
mainframev merged commit dcb2f2f into master Oct 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants