Package the skill as a Claude Code plugin for directory submission - #9
Merged
Conversation
Adds .claude-plugin/plugin.json so the repo can be submitted to Anthropic's
public plugin directory, which needs a manifest to read a name, version,
description and licence from.
SKILL.md moves to skills/translate-site/SKILL.md. This was forced rather than
cosmetic: the plugin reference states a single-skill plugin may keep SKILL.md at
the plugin root, but on Claude Code 2.1.126 such a skill is never discovered.
Three variants were tried — manifest present, manifest absent, and
"skills": "./" — and none loaded a skill. The conventional skills/<name>/
layout loads correctly and namespaces as conveythis-translator:translate-site.
The plugin is named conveythis-translator rather than claude-translator so the
public listing is not led by an Anthropic trademark. The repo and the npm
package keep their existing names.
Also fixes two things in the skill that were wrong for any install:
- The Pipeline block ran node scripts/extract.mjs, but the installer scaffolds
into scripts/i18n/ (its --dir default). Every command in that block would
have failed with Cannot find module for anyone following the skill instead of
the README.
- Setup hardcoded ~/.claude/skills/claude-translator/bin/, a path that does not
exist for a plugin install. It now leads with npx and falls back to
"${CLAUDE_PLUGIN_ROOT}"/bin/claude-translator.mjs.
Verified: claude plugin validate passes clean; a uniquely renamed copy of the
skill is discovered through --plugin-dir, so an identically named skill already
in ~/.claude/skills could not be mistaken for it; the documented setup line
scaffolds scripts/i18n/, i18n.config.json and the .gitignore entries into a
throwaway project, confirming ${CLAUDE_PLUGIN_ROOT} resolves; npm run check and
all 39 tests pass; npm pack ships the manifest and the skill.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Prepares the repo for submission to Anthropic's public plugin directory, and fixes two instructions in the skill that were wrong for every install path.
What changed
Added
.claude-plugin/plugin.json. The directory needs a manifest to read a name, version, description and licence from. The plugin is namedconveythis-translator, notclaude-translator, so the public listing is not led by an Anthropic trademark. The repo and the npm package keep their existing names.Moved
SKILL.mdtoskills/translate-site/SKILL.md. This was forced, not cosmetic. The plugin reference states a single-skill plugin may keepSKILL.mdat the plugin root, but on Claude Code 2.1.126 that skill is never discovered. Three variants were tested — manifest present, manifest absent, and"skills": "./"— and all three loaded no skill at all. The conventionalskills/<name>/SKILL.mdlayout loads correctly.Anyone who cloned this repo into
~/.claude/skills/claude-translator/keeps working: a directory there carrying a.claude-plugin/plugin.jsonis loaded as a plugin automatically.Bugs fixed along the way
node scripts/extract.mjs, butclaude-translator initscaffolds intoscripts/i18n/(its--dirdefault), as the README has always shown correctly. Every command in that block would have failed withCannot find modulefor anyone following the skill rather than the README.~/.claude/skills/claude-translator/bin/…— a path that does not exist for a plugin install. It now leads withnpx claude-translator initand falls back to"${CLAUDE_PLUGIN_ROOT}"/bin/claude-translator.mjs.Verification
claude plugin validate .— passes with no errors and no warnings. Worth noting this CLI version rejects bothdisplayNameand"skills": ["."], which the current reference documents; neither is used here.claude --plugin-dirusing a uniquely renamed copy of the skill, so the identically named skill already installed in~/.claude/skills/could not be mistaken for it. Loads asconveythis-translator:<skill>.CLAUDE_PLUGIN_ROOTset, scaffoldsscripts/i18n/with all nine scripts,i18n.config.jsonand the.gitignoreentries into a throwaway project. This is what proves the path fixes are right.npm run checkandnpm test(39 tests) pass unchanged;npm packships.claude-plugin/plugin.jsonandskills/translate-site/SKILL.md.No API key was used and no provider was called — only
translate.mjsspends money, and nothing here runs it.🤖 Generated with Claude Code