$npx -y skills add Aperivue/medsci-skills --skill publish-skillConvert 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.
| 1 | # Skill: publish-skill |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | ## Communication Rules |
| 6 | |
| 7 | - Communicate with the user in their preferred language |
| 8 | - Use English for technical terms (PII, MIT, CC BY, GPL, YAML frontmatter) |
| 9 | - Present audit findings in structured tables |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | ## Phase 0: Init and Identify Source |
| 14 | |
| 15 | ### Required Inputs |
| 16 | |
| 17 | Collect from the user: |
| 18 | |
| 19 | 1. **Source skill path**: directory containing the personal skill (e.g., `~/.claude/skills/my-skill/` or `~/.agents/skills/my-skill/`) |
| 20 | 2. **Target package path**: directory of the distributable package (e.g., `~/workspace/<your-package>/`) |
| 21 | 3. **Target license**: license of the package (default: MIT) |
| 22 | |
| 23 | ### Actions |
| 24 | |
| 25 | 1. Read `SKILL.md` from the source skill directory |
| 26 | 2. Inventory all files recursively (`ls -R`) |
| 27 | 3. Classify skill type: |
| 28 | - **Standalone**: self-contained skill with no agent delegation |
| 29 | - **Orchestrator**: delegates to sub-agents (NOT suitable for distribution without refactoring) |
| 30 | - **Wrapper**: thin wrapper around another tool/API |
| 31 | 4. Present inventory table to the user: |
| 32 | |
| 33 | ``` |
| 34 | | File | Lines | Type | Notes | |
| 35 | |------|-------|------|-------| |
| 36 | ``` |
| 37 | |
| 38 | **Gate**: User confirms source skill and target package before proceeding. |
| 39 | |
| 40 | --- |
| 41 | |
| 42 | ## Phase 0.5: Skill-Worthiness Gate |
| 43 | |
| 44 | Before spending effort on PII scrubbing and generalization, confirm the workflow is |
| 45 | worth distributing *as a skill* at all. A skill earns its place by encoding a reusable |
| 46 | decision heuristic, a hard-won constraint, or a verification step — not a snippet anyone |
| 47 | could reconstruct in five minutes. Apply all three gates; **any "no" (or "yes" on the |
| 48 | inverse) stops publication** in favor of documentation or a memory note instead. |
| 49 | |
| 50 | | Gate | Question | Pass condition | |
| 51 | |------|----------|----------------| |
| 52 | | **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** | |
| 53 | | **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** | |
| 54 | | **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** | |
| 55 | |
| 56 | Favor skills that encode reviewer-anticipation, reporting-guideline constraints, |
| 57 | verification gates, and decision trees over thin wrappers or one-off snippets. This is |
| 58 | the publish-time analogue of the "reusable pattern vs one-off hack" distinction: a |
| 59 | workflow that fails the gate is better captured as a doc or a memory note than shipped as |
| 60 | a skill that dilutes the catalog. |
| 61 | |
| 62 | **Gate**: If any of the three fails, recommend documentation/memory instead and stop. If |
| 63 | the value is real but the skill delegates to private agents, route through Phase 1's |
| 64 | orchestrator finding (refactor to standalone first). Only a clear three-way pass proceeds. |
| 65 | |
| 66 | --- |
| 67 | |
| 68 | ## Phase 1: Originality Check |
| 69 | |
| 70 | Verify the skill is original work suitable for open-source distribution. |
| 71 | |
| 72 | ### Checks |
| 73 | |
| 74 | 1. **External source**: Is this skill adapted from another package or author? Check for attribution headers, license blocks, or "based on" comments. |
| 75 | 2. **Third-party content**: Do any files in `references/` come from external sources (published guidelines, textbooks, standards bodies)? |
| 76 | 3. **Competitive sensitivity**: Does the skill reveal proprietary business logic or competitive advantage that should remain private? |
| 77 | |
| 78 | ### Decision Matrix |
| 79 | |
| 80 | | Finding | Action | |
| 81 | |---------|--------| |
| 82 | | Fully original | Proceed to Phase 2 | |
| 83 | | Adapted with compatible license | Add attribution header, proceed | |
| 84 | | Contains non-compatible third-party content | Flag for removal or URL manifest conversion | |
| 85 | | Orchestrator with private agent references | STOP -- requires refactoring to standalone first | |
| 86 | | Competitive/proprietary logic | STOP -- not suitable for open-source | |
| 87 | |
| 88 | --- |
| 89 | |
| 90 | ## Phase 2: PII De-identification Audit |
| 91 | |
| 92 | **Zero tolerance**: the skill must have exactly 0 PII matches before proceeding. |
| 93 | |
| 94 | ### Pre-scan Setup |
| 95 | |
| 96 | Before running, ask the user for everything that should also count as a PII hit but is unique to them: |
| 97 | - Their name(s) in all languages and romanizations (a placeholder shape: `<First Last>|<native-script |