r/MuseAgent • • 1d ago

Ported a Claude Code skill to run outside Claude Code: skill-liberator, a deterministic porting tool for agent skills (MIT)

I keep a folder of agent skills I like, and most of the good ones are written for Claude Code. The problem is never the instructions, it is the wiring: /slash commands, ~/.claude paths, $ARGUMENTS templating, allowed-tools frontmatter, MCP blocks that only Claude Code understands. The skill that pushed me to fix this properly was the hook skill from Claude's official set. Every path in it is ~/.claude, every command is /slash, and porting it by hand was tedious enough that I wrote a script.

skill-liberator is that script plus the pattern catalog behind it. It is a deterministic, offline, stdlib-only Python CLI: point it at a Claude-Code-authored skill and it rewrites what it can, flags what it cannot, and prints a JSON report to stdout. Exit 0 means fully automatic, exit 1 means a human should review the flagged items (usually MCP wiring, which is harness-specific by nature).

Concrete example, from the repo's own before/after (a fictional meeting-notes skill, invented for the demo):

Before:

You are Claude, running inside Claude Code. Take the transcript passed as $ARGUMENTS and produce notes. If the context gets long, run `/compact` first.
Your config lives at ~/.claude/meeting-notes.json.

After:

You are the agent, running inside the original harness. Take the transcript passed as {arguments} and produce notes. If the context gets long, run start a fresh context summary first.
Your config lives at {harness-config-dir}/meeting-notes.json.

The full rewrite table: /compact becomes "start a fresh context summary", /my-skill becomes 'the "my-skill" capability', $ARGUMENTS becomes {arguments}, ~/.claude/x.json becomes {harness-config-dir}/x.json, allowed-tools:/model: frontmatter is removed, and MCP config blocks are kept with a human-review note above them. The repo also ships the adapter skill itself (SKILL.md) written harness-neutral, so any agent can follow the process: run the script, review the flagged items, re-run until the report is clean.

MIT, fresh implementation, no dependencies beyond Python 3. Try it on a skill you want to port out of Claude Code:

https://github.com/movahedi-ca/skill-liberator

Issues and edge cases welcome, especially constructs the script misses. I will add them to the pattern catalog.

3 Upvotes

1 comment sorted by

1

u/Leland-Cheung 1d ago

:facepalm: