Skip to content

chore: switch ICP skills from pinned to autosync - #1469

Merged
marc0olo merged 5 commits into
masterfrom
chore/switch-skills-to-autosync
Aug 6, 2026
Merged

chore: switch ICP skills from pinned to autosync#1469
marc0olo merged 5 commits into
masterfrom
chore/switch-skills-to-autosync

Conversation

@marc0olo

@marc0olo marc0olo commented Aug 6, 2026

Copy link
Copy Markdown
Member

Switches the repo's ICP-skills setup from pinned (skills-lock.json + npx skills update) to autosync (a SessionStart hook that mirrors the latest skills each session). Uses the mechanism from dfinity/icskills#251, hardened by #257.

Why

The goal is to never commit anything when a skill changes. Pinned mode fails that — every refresh rewrites skills-lock.json, which has to be committed. Autosync commits the hook + script once; skills then refresh with zero commits, always current.

  • Robust mechanism: the sync is a differential, hash-keyed mirror — it re-downloads only changed skills, prunes removed ones, swaps each changed skill's dir atomically (so intra-skill file renames don't orphan), and degrades gracefully if offline or jq is missing.
  • Matches repo philosophy: everything here aligns examples with the fast-moving platform; always-latest skills fit better than a manually-refreshed pin.
  • No reproducibility loss that matters: skills guide agents authoring examples; they are not build inputs (CI runs in containers and never reads them).

What changed

  • Add .claude/sync-ic-skills.sh (fetched verbatim from the published autosync skill) + .claude/settings.json with a SessionStart hook — both committed so the whole team gets auto-updating skills.
  • .gitignore: ignore .claude/skills/ (the managed cache) and .claude/settings.local.json (personal); drop the old .agents/skills line.
  • Remove skills-lock.json.
  • AGENTS.md: managed block → autosync state; added an on-demand fallback note so non–Claude Code agents (Cursor, Copilot, Codex) still know how to fetch skills, since the hook is Claude Code-only.

Tradeoffs (called out for review)

  • Claude Code-only hook — mitigated by the documented on-demand fallback for other agents.
  • A committed SessionStart hook runs a network-fetching script. Anyone opening the repo root in Claude Code gets a one-time trust prompt for .claude/sync-ic-skills.sh. It's from the official skills.internetcomputer.org and only writes to .claude/skills/. Acceptable given the audience is the DX team (repo isn't taking external contributions), but flagging it explicitly.

Verified locally: hook runs, 26 skills synced into .claude/skills/, re-run is a silent no-op, no leftover staging dirs.

🤖 Generated with Claude Code

Pinned mode required committing skills-lock.json every time a skill
changed. Autosync (dfinity/icskills#251, hardened by #257) keeps skills
current with zero commits: a SessionStart hook runs a differential,
hash-keyed mirror into .claude/skills/ each session, downloading only
changed skills and pruning removed ones.

- Add .claude/sync-ic-skills.sh (fetched verbatim from the published
  autosync skill) and a .claude/settings.json SessionStart hook — both
  committed so the whole team gets auto-updating skills.
- .gitignore: skills now live in .claude/skills/ (ignored — a managed
  cache); ignore .claude/settings.local.json; drop the .agents/skills line.
- Remove committed skills-lock.json (pinned artifact, no longer used).
- AGENTS.md: managed block → autosync state; add an on-demand fallback
  note for non–Claude Code agents (the hook is Claude Code-only).

Skills aren't build inputs (CI runs in containers and never touches them),
so losing pinned reproducibility has no CI impact; always-latest matches
the repo's stay-current philosophy.
@marc0olo
marc0olo requested a review from a team as a code owner August 6, 2026 09:21
…guide

Add a human-readable note on how skills are wired in this repo (autosync
SessionStart hook, nothing to commit on change, Claude Code-only with an
on-demand fallback for other agents) and point to the developer-docs
AI coding agents guide for general background.
Explain, for developers cloning the repo, that it works with AI coding
agents via ICP skills and uses autosync (a Claude Code SessionStart hook) —
so the first-session trust prompt is expected. Keep the detail in AGENTS.md
(single source of truth) and link there + the AI coding agents guide.
skills.internetcomputer.org is where the skills live and are explored;
the docs guide is the how-agents-use-them reference. Link both distinctly
instead of hiding the registry behind the guide URL.
autosync is itself an ICP skill that sets up the sync mechanism; link the
term to its page (skills.internetcomputer.org/skills/autosync-ic-skills)
in both the README and the AGENTS.md setup note. Managed block untouched.
@marc0olo

marc0olo commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@raymondk I will merge this now. once the committed autosync script starts to become an issue when drifting away I will think about this topic again.

@marc0olo
marc0olo merged commit 89ca0c3 into master Aug 6, 2026
5 checks passed
@marc0olo
marc0olo deleted the chore/switch-skills-to-autosync branch August 6, 2026 15:53
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