aperivue/publish-skill
> Convert a personal agent skill into a distributable, open-source-ready skill. Runs PII audit, generalization, license compatibility check, cross-platform adapter review, and packaging workflow.
npx skills add https://github.com/Aperivue/medsci-skills --skill publish-skill
Convert a personal agent skill into a clean, distributable, open-source-ready skill package. This skill walks through a 7-phase pipeline that audits for personally identifiable information, generalizes language and role assumptions, verifies license compatibility, checks cross-platform adapter needs, and prepares the final package for commit.
Collect from the user:
~/.claude/skills/my-skill/ or ~/.agents/skills/my-skill/)~/workspace/<your-package>/)SKILL.md from the source skill directoryls -R)| File | Lines | Type | Notes |
|------|-------|------|-------|
Gate: User confirms source skill and target package before proceeding.
Before spending effort on PII scrubbing and generalization, confirm the workflow is
worth distributing *as a skill* at all. A skill earns its place by encoding a reusable
decision heuristic, a hard-won constraint, or a verification step — not a snippet anyone
could reconstruct in five minutes. Apply all three gates; **any "no" (or "yes" on the
inverse) stops publication** in favor of documentation or a memory note instead.
| Gate | Question | Pass condition |
|------|----------|----------------|
| Uniqueness | Could a competent user get the same result by searching the web for ~5 minutes, or by asking a general assistant with no skill installed? | No |
| Specificity | Does it encode a workflow, decision heuristic, constraint, or convention specific to this domain or a recurring task — rather than a generic code snippet or a standard-library example? | Yes |
| Effort | Did discovering it take real debugging, study design, operational effort, or a reviewer-anticipation lesson (a pitfall, a verification step, a domain convention)? | Yes |
Favor skills that encode reviewer-anticipation, reporting-guideline constraints,
verification gates, and decision trees over thin wrappers or one-off snippets. This is
the publish-time analogue of the "reusable pattern vs one-off hack" distinction: a
workflow that fails the gate is better captured as a doc or a memory note than shipped as
a skill that dilutes the catalog.
Gate: If any of the three fails, recommend documentation/memory instead and stop. If
the value is real but the skill delegates to private agents, route through Phase 1's
orchestrator finding (refactor to standalone first). Only a clear three-way pass proceeds.
Verify the skill is original work suitable for open-source distribution.
references/ come from external sources (published guidelines, textbooks, standards bodies)?| Finding | Action |
|---------|--------|
| Fully original | Proceed to Phase 2 |
| Adapted with compatible license | Add attribution header, proceed |
| Contains non-compatible third-party content | Flag for removal or URL manifest conversion |
| Orchestrator with private agent references | STOP -- requires refactoring to standalone first |
| Competitive/proprietary logic | STOP -- not suitable for open-source |
Zero tolerance: the skill must have exactly 0 PII matches before proceeding.
Before running, ask the user for everything that should also count as a PII hit but is unique to them:
<First Last>|<native-script name>)<Institution>|<Hospital>)Combine the inputs into a single grep -E alternation pattern (pipe-separated).
Run the bundled audit script. The first argument is the skill directory; the second is the user-specific alternation pattern from Pre-scan Setup.
bash ${CLAUDE_SKILL_DIR}/scripts/audit_skill.sh <source_skill_path> \
"<First Last>|<native-script name>|<Institution>|<Hospital>"
The script runs nine categories that mirror the medsci-skills monorepo linter (scripts/validate_skills.sh):
/Users/<name>/, /home/<name>/, ~/Documents, ~/Desktop, ~/Downloads, ~/Projects)*.internal, *.local, *.corp)professor <Surname>, Prof. <Surname>, Dr. <Surname>, PGY[0-9], <한글이름> 교수님)> YYYY-MM-DD ... lines that reveal an internal review timeline)<Surname>{Year}_* pattern, e.g., <Surname>2025_<Journal>_Fig01.png; allow-list excludes generic tokens like Issue2024_, Sample2025_)10. Binary EXIF metadata (DOCX / PPTX / XLSX / PDF / PNG / JPG / TIFF — scanned via exiftool when installed; skipped silently otherwise with an install hint)
False-positive guard: text scans use grep --binary-files=without-match so byte-stream collisions inside .pyc, .png, or .docx files do not trigger findings. __pycache__/ is also explicitly skipped.
For categories the script flags, also manually verify with the Grep tool against ${CLAUDE_SKILL_DIR}/references/pii-patterns.md. Pay particular attention to:
CK-NN, MA-NN, dated cohort namesPresent all findings in a remediation table:
| # | File:Line | Category | Match | Suggested Fix |
|---|-----------|----------|-------|---------------|
Gate: User reviews all findings. Fix each one. Re-run audit. Proceed only when 0 hits confirmed.
Transform personal assumptions into universal defaults.
"in Korean" / "한국어로" / "Korean language" → "in the user's preferred language""communicate in [specific language]" → "Communicate with the user in their preferred language"triggers: field (these aid discovery)"radiology researcher" → "medical researcher" (if the skill is domain-general)"professor" / "fellow" → "researcher" or "user" (context-dependent)${CLAUDE_SKILL_DIR} for bundled reference files~/Documents/... → user-provided output directorytools: fieldanalyze-stats")?Show a unified diff of all generalization changes for user review.
Verify all bundled files are compatible with the target package license.
For each file in the skill's references/ and scripts/ directories:
Reference ${CLAUDE_SKILL_DIR}/references/license-compatibility-matrix.md for the full matrix.
Quick reference for MIT target:
| Source License | Can Bundle? | Action |
|---------------|------------|--------|
| CC0 / Public Domain | Yes | No changes needed |
| CC BY 4.0 / 3.0 | Yes | Add attribution header |
| MIT / BSD / Apache 2.0 | Yes | Include license notice |
| CC BY-NC | No | Convert to URL reference |
| CC BY-NC-ND | No | Convert to URL reference |
| CC BY-SA | No | Copyleft risk -- convert to URL reference |
| GPL v2/v3 | No | Mark as optional external dependency |
| Unknown / Proprietary | No | Assume incompatible -- remove or get permission |
For non-compatible content, convert from bundled file to a URL manifest:
## [Checklist Name]
This checklist is not bundled due to license restrictions ([License Type]).
**Official source**: [URL]
**How to use**: Download the checklist from the official source and place it in
`references/` before using this skill's reporting check feature.
Present license audit table:
| File | Source | License | Compatible? | Action |
|------|--------|---------|------------|--------|
${CLAUDE_SKILL_DIR}/... path resolves to an actual filescripts/ have appropriate shebangsRun audit_skill.sh one final time. Must return exit code 0.
Check whether the skill can run in common desktop-agent environments:
| Platform | Check |
|---|---|
| Claude Code | No hardcoded dependency on private ~/.claude paths unless documented. |
| Codex | SKILL.md is self-contained and installable under ~/.agents/skills/. |
| Cursor | A short .cursor/rules/*.mdc adapter can point to the canonical SKILL.md. |
| Windows | Commands avoid Unix-only assumptions or provide PowerShell/Python alternatives. |
| macOS/Linux | Shell examples use portable paths where possible. |
If the package is intended for a workshop or classroom, prepare direct-download
ZIPs rather than asking users to navigate GitHub manually:
https://github.com/{owner}/{repo}/releases/latest/download/{package}-classroom-windows.zip
https://github.com/{owner}/{repo}/releases/latest/download/{package}-classroom-macos.zip
Generate a table row matching the target package's README format:
| **{skill-name}** | {One-sentence description of what the skill does.} |
Instruct the user to:
cp -r <cleaned_skill> ~/.claude/skills/<skill-name>/<skill-name> or relevant trigger phrasesGate: User confirms testing is complete.
cp -r <cleaned_skill_path> <target_package>/skills/<skill-name>/
Apply the README entry drafted in Phase 5:
Present the exact commands but do NOT auto-execute push:
cd <target_package>
git add skills/<skill-name>/
git add README.md
git diff --cached # User reviews
git commit -m "Add <skill-name>: <one-line description>"
Gate: User reviews git diff --cached and explicitly approves the commit. Push is always manual.
Remind the user to:
git clone <repo> && cp -r <repo>/skills/<skill-name> ~/.claude/skills/installers/install-windows.cmdinstallers/install-macos.commandREADME_FIRST.md explains unzip -> double-click -> restart -> test promptgit push -- push is always manualTake aperivue/publish-skill from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.