Skip to content

feat(skills): add skills-lock.json workflow, remove Makefile installer - #175

Merged
shunkakinoki merged 5 commits into
mainfrom
claude/skills-remove-makefile-sync-0d9617
Aug 2, 2026
Merged

feat(skills): add skills-lock.json workflow, remove Makefile installer#175
shunkakinoki merged 5 commits into
mainfrom
claude/skills-remove-makefile-sync-0d9617

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Aug 2, 2026

Copy link
Copy Markdown
Owner

What

Implements the lock-file approach from vercel-labs/skills#549 for external skills, replacing the old SKILLS.txt reconciler with a committed lock file.

  • SKILLS.txt stays the canonical declaration (repo + comma-separated selection; no selection = all)
  • skills-lock.json (new, committed) is generated from SKILLS.txt via make skills-lock: installed skills carry resolved metadata (sourceUrl, skillPath, skillFolderHash) from the global CLI lock; not-yet-installed skills get minimal source entries
  • make skills-install restores from the lock, npm-ci style: skips skills already in ~/.agents/skills (no reinstalls, no network), groups the rest by source, runs bun x skills add <source> --global --yes --skill ..., non-zero exit on failure; make skills-refresh forces a reinstall
  • All logic lives in Makefile shell recipes (jq-based, matching existing conventions like mcp-sync) — no standalone scripts
  • Replaced Makefile targets: skills-install (old 140-line SKILLS.txt reconciler with manifest/state dirs), skills-clean, skills-managed-clean, skills-install-repo; make sync still calls skills-install. skills-sync/ruler-skills-copy (local repo skills) are untouched
  • Fixed stale SKILLS.txt entries against upstream: renames (google gke-costgke-cost-analysis/-optimization, mattpocock to-prd/to-issuesto-spec/to-tickets, better-auth create-auth-skillcreate-auth), deletions (PaulRBerg biome-js/code-simplify/md-docs, awesome-copilot my-issues/my-pull-requests), dead repo (better-context/skills), and vercel-sandbox (needs --full-depth)
  • New rules/skills-management.md documents the workflow; skills@^1.5.20 pinned as devDependency (1.5.21 blocked by the 7-day minimum-release-age; also fixes bun x skills resolving a stale cached v0.1.0)

Why

The CLI's experimental_install only supports project scope; this repo installs skills globally, so the Makefile scripts the global equivalent of the proposed skills install -g. The lock replaces manifest/state-dir bookkeeping with a single committed artifact that works on fresh machines and CI. Once upstream ships skills install -g, the recipes can be swapped for it.

Reviewer notes

  • The lock has 555 skills, all installed and verified: make skills-lock output is stable (regenerating produces no diff) and make skills-install is an instant no-op when converged
  • Lock entries track each source's default branch — the upstream CLI does not record commit SHAs yet (documented in README)
  • Install success is judged by the skill landing on disk because the CLI exits non-zero on adapter quirks (e.g. "PromptScript does not support global skill installation") even when installs succeed; under --force the exit code is used since directories pre-exist
  • Verified end-to-end: removed a skill via the CLI and restored it from the lock (symlinks intact); minimal entries install correctly and resolve on re-lock
  • .ruler/mcp.json diff is biome formatting only

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added managed skill installation and lockfile generation workflows.
    • Added a committed skill registry to restore required skills on new machines and CI.
    • Added commands for installing skills, regenerating the lockfile, and managing skill entries.
    • Added documentation covering skill setup, updates, and restoration.
  • Chores

    • Removed legacy skill management commands and streamlined synchronization.
    • Reformatted MCP server arguments without changing behavior.

Walkthrough

The PR replaces Makefile-based skill installation with Bun scripts and a committed skills-lock.json. It adds lockfile generation, grouped installation, sync integration, and management documentation. It also reformats the GitHub MCP argument array without changing behavior.

Changes

Skills management workflow

Layer / File(s) Summary
Skill lockfile generation
package.json, scripts/skills-lock.ts, skills-lock.json
Bun commands generate a sorted version 3 lockfile from SKILLS.txt, installed metadata, and fallback source entries.
Locked skill installation
scripts/skills-install.ts
The installer restores missing skills by grouping entries by source and ref. It reports failures and supports --force.
Sync workflow and management documentation
Makefile, README.md, rules/skills-management.md
The sync target invokes bun run skills:install. Legacy skill targets are removed. Documentation describes lockfile and installation commands.

MCP configuration formatting

Layer / File(s) Summary
Multiline MCP arguments
.ruler/mcp.json
The GitHub MCP argument array is reformatted without changing its values.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Poem

A rabbit found skills in a lockfile neat,
Bun gathered them by source and beat.
Old Makefile chores hopped away,
Sync now runs a clearer way.
MCP args line up with care.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the lock-file workflow and removal of the legacy Makefile installer, matching the main changes.
Description check ✅ Passed The description directly covers the lock-file workflow, installer replacement, scripts, documentation, and dependency changes.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/skills-remove-makefile-sync-0d9617

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rules/skills-management.md`:
- Around line 3-12: Update the CLI reference in the skills-management
documentation to link to the skills CLI repository, matching the repository-root
link used by README.md instead of issue 549. Add the text language identifier to
the fenced SKILLS.txt example while preserving its contents.

In `@scripts/skills-lock.ts`:
- Around line 19-27: Update the global lock loading flow before the
installed-skills iteration: check the lock path, handle missing files and JSON
parse failures, and validate that globalLock.version and globalLock.skills are
present before calling Object.entries. On any invalid or absent lock, exit with
a clear message directing the user to initialize the CLI lock instead of
allowing an unhandled exception.

In `@skills-lock.json`:
- Around line 1-20: Update each skill entry in skills-lock.json with a resolved
commit SHA in its ref field, and ensure scripts/skills-install.ts uses that ref
when installing sources so locked skills are reproducible rather than following
the default branch; if head tracking is intentional instead, document that
policy explicitly in the lock format or installation flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3104be0e-54a7-44ba-8d8e-4b3bd3e2194f

📥 Commits

Reviewing files that changed from the base of the PR and between d7e2f2a and 302e6e2.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • .ruler/mcp.json
  • Makefile
  • README.md
  • package.json
  • rules/skills-management.md
  • scripts/skills-install.ts
  • scripts/skills-lock.ts
  • skills-lock.json

Comment thread rules/skills-management.md
Comment thread scripts/skills-lock.ts Outdated
Comment thread skills-lock.json
Comment on lines +1 to +20
{
"version": 3,
"skills": {
"add-adapter": {
"source": "vercel/chat",
"sourceType": "github",
"sourceUrl": "https://github.com/vercel/chat.git"
},
"agent-browser": {
"source": "inference-sh/skills",
"sourceType": "github",
"sourceUrl": "https://github.com/inference-sh/skills.git"
},
"agent-ci": {
"source": "redwoodjs/agent-ci",
"sourceType": "github",
"sourceUrl": "https://github.com/redwoodjs/agent-ci.git",
"skillPath": "skills/agent-ci/SKILL.md",
"skillFolderHash": "74743678978f58979faaae7fc71c24a7e9a245b9"
},

@coderabbitai coderabbitai Bot Aug 2, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🌐 Web query:

vercel-labs skills CLI add pin ref commit lockfile

💡 Result:

The Skills CLI (by vercel-labs/skills) manages reusable instruction sets for AI coding agents [1][2]. While standard usage involves installing skills via npx skills add <source> [3][4], the system includes lockfile mechanisms to track versions and ensure deterministic installations [5][6]. Key concepts regarding pinning, commits, and lockfiles include: Pinning via Refs You can pin skills to specific versions by appending a reference (ref) to the source string [7]. The CLI supports using branches, tags, or commit SHAs as suffixes [7]: npx skills add owner/repo@v1.0.0 # Pin to a tag [7] npx skills add owner/repo@abc1234 # Pin to a commit SHA [7] npx skills add owner/repo@main # Pin to a branch [7] Lockfile System The CLI maintains state tracking via lockfiles [6]. When a skill is added to a project (non-globally), the CLI automatically updates a local lockfile (skills-lock.json), which records metadata about the installed skill, including the source, the reference (tag, branch, or SHA), and the commit SHA [5][7][6]. Lockfile Features and Commands Recent enhancements to the CLI have introduced more robust lockfile management [5]: - Lockfile Verification: The skills verify command allows you to check if installed files match the hashes recorded in your lockfile [5]. - CI Integrity: The skills ci command (and the --frozen-lockfile flag) can be used to ensure that installations are consistent with the existing lockfile, failing if discrepancies are found [5]. - Commit SHA Tracking: The system captures and stores the HEAD commit SHA at the time of installation, providing traceability for the exact version of the skill code in use [5][7]. For project-level installs, these lockfiles are intended to be committed to version control, ensuring the entire team uses the exact same versions of the skills [7][3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'files matching skills-lock/skills-install/skills-management/rules:\n'
git ls-files | rg '(^skills-lock\.json$|scripts/skills-lock\.(ts|js|tsx|jsx)$|scripts/skills-install\.ts|rules/skills-management\.md)$' || true

printf '\nlock top entries ref/source/hash pattern:\n'
if [ -f skills-lock.json ]; then
  wc -l skills-lock.json
  python3 - <<'PY'
import json
p='skills-lock.json'
data=json.load(open(p))
skills=data.get('skills',{})
for name, cfg in skills.items():
    print(name, {
        'source': cfg.get('source'),
        'ref': cfg.get('ref'),
        'skillPath': cfg.get('skillPath'),
        'skillFolderHash': cfg.get('skillFolderHash'),
        'hasAllHashes': 'skillFolderHash' in cfg and 'skillGitHash' in cfg
    })
print('count ref present:', sum(1 for cfg in skills.values() if 'ref' in cfg))
print('count skillFolderHash present:', sum(1 for cfg in skills.values() if 'skillFolderHash' in cfg))
print('count skillGitHash present:', sum(1 for cfg in skills.values() if 'skillGitHash' in cfg))
PY
fi

for f in scripts/skills-install.ts scripts/skills-lock.ts rules/skills-management.md; do
  if [ -f "$f" ]; then
    printf '\n=== %s (%d lines) ===\n' "$f" "$(wc -l < "$f")"
    sed -n '1,220p' "$f"
  fi
done

Repository: shunkakinoki/dotagents

Length of output: 50378


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for f in scripts/skills-install.ts scripts/skills-lock.ts rules/skills-management.md; do
  printf '\n=== %s (%d lines) ===\n' "$f" "$(wc -l < "$f")"
  sed -n '1,240p' "$f"
done

printf '\nref/frozen/verify hash references:\n'
rg -n "ref|frozen|hash|skillFolderHash|skillGitHash|verify" packages scripts rules skills-lock.json || true

Repository: shunkakinoki/dotagents

Length of output: 14087


Pin skill sources before installing.

skills-lock.json has no per-skill ref, and scripts/skills-install.ts only appends #<ref> when it is present. This installs missing skills from the repository’s current default branch, so reproducing the same commit at a later date can install different skill content. Record the resolved commit SHA as ref, or document that this lock tracks upstream heads.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills-lock.json` around lines 1 - 20, Update each skill entry in
skills-lock.json with a resolved commit SHA in its ref field, and ensure
scripts/skills-install.ts uses that ref when installing sources so locked skills
are reproducible rather than following the default branch; if head tracking is
intentional instead, document that policy explicitly in the lock format or
installation flow.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Not adopting SHA pinning for now: the upstream CLI's own lock does not record commit SHAs (it's an open request in vercel-labs/skills#549), and skills-lock.json mirrors the CLI-resolved metadata so skills update keeps working. Will revisit once upstream records SHAs in its lock.

🤖 Addressed by Claude Code

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@shunkakinoki, understood. The current lock format intentionally mirrors the upstream skills CLI lockfile to preserve skills update compatibility. SHA pinning remains dependent on upstream support in vercel-labs/skills#549.

Would you like me to create a follow-up GitHub issue to track reassessment after upstream adds commit SHA support?


✏️ Learnings added
Learnt from: shunkakinoki
Repo: shunkakinoki/dotagents PR: 175
File: skills-lock.json:1-38
Timestamp: 2026-08-02T06:43:13.982Z
Learning: In the skills-management workflow, `skills-lock.json` intentionally mirrors the metadata written by the upstream `skills` CLI. The upstream CLI lockfile does not currently record resolved commit SHAs, tracked upstream in vercel-labs/skills#549. Do not recommend adding per-skill SHA `ref` fields until upstream supports them, because preserving compatibility with `skills update` is required.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 9 files

Not reviewed (too large): skills-lock.json (~2,279 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread scripts/skills-lock.ts Outdated
Comment thread scripts/skills-lock.ts Outdated
Comment thread scripts/skills-lock.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 8 files (changes from recent commits).

Not reviewed (too large): skills-lock.json (~2,461 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread scripts/skills-install.ts Outdated
Comment thread scripts/skills-lock.ts Outdated
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.

1 participant