$npx -y skills add alexanderop/walkthrough --skill publish-skillCreates a new GitHub repository for a Claude Code skill with proper README and directory structure. Use when you want to package and publish a skill so others can install it. Triggers on "publish skill", "publish this skill", "create skill repo", "package skill", "share this skil
| 1 | # Publish Skill |
| 2 | |
| 3 | Package a Claude Code skill into a new GitHub repository with a polished README and proper directory structure — ready for others to install with `npx skills add`. |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | ### Step 1: Gather skill information |
| 8 | |
| 9 | Collect everything needed to create the repo. The user may provide this upfront or you may need to ask. |
| 10 | |
| 11 | **Required information:** |
| 12 | - **Skill name** — kebab-case repo name (e.g., `walkthrough`, `code-reviewer`) |
| 13 | - **Skill source** — either a path to an existing skill directory or the skill content to package |
| 14 | - **One-line description** — what the skill does in one sentence |
| 15 | - **Detailed description** — 3-5 bullet points of what the skill produces or does |
| 16 | - **Usage examples** — 2-4 example prompts that trigger the skill |
| 17 | - **GitHub visibility** — public (default) or private |
| 18 | |
| 19 | If the user points to an existing skill directory (e.g., `.claude/skills/my-skill/`), read the `skill.md` to extract the description, usage triggers, and other metadata automatically. Only ask for what's missing. |
| 20 | |
| 21 | If the user describes a skill concept without existing files, ask them to clarify the above before proceeding. |
| 22 | |
| 23 | ### Step 2: Create the repository structure |
| 24 | |
| 25 | Create a new directory at `/Users/alexanderopalic/Projects/mySkills/{skill-name}/` with this structure: |
| 26 | |
| 27 | ``` |
| 28 | {skill-name}/ |
| 29 | README.md |
| 30 | skills/ |
| 31 | {skill-name}/ |
| 32 | skill.md |
| 33 | references/ # only if the skill has reference files |
| 34 | *.md |
| 35 | examples/ # only if examples are provided |
| 36 | ``` |
| 37 | |
| 38 | **Copy skill files:** |
| 39 | - If the source is an existing skill directory, copy all files from it into `skills/{skill-name}/` |
| 40 | - If the source is provided inline, create the `skill.md` and any reference files |
| 41 | |
| 42 | ### Step 3: Generate the README |
| 43 | |
| 44 | Create a `README.md` following this template. Adapt section content based on the actual skill — do not include sections that don't apply. |
| 45 | |
| 46 | ```markdown |
| 47 | # {Skill Name} |
| 48 | |
| 49 | {One-line description of what the skill does.} |
| 50 | |
| 51 | ## What it does |
| 52 | |
| 53 | {Describe what the skill produces or does:} |
| 54 | |
| 55 | - **{Feature 1}** — description |
| 56 | - **{Feature 2}** — description |
| 57 | - **{Feature 3}** — description |
| 58 | |
| 59 | ## Usage |
| 60 | |
| 61 | Trigger the skill with prompts like: |
| 62 | |
| 63 | \`\`\` |
| 64 | {example prompt 1} |
| 65 | {example prompt 2} |
| 66 | {example prompt 3} |
| 67 | \`\`\` |
| 68 | |
| 69 | {Brief description of what happens when triggered — the workflow steps.} |
| 70 | |
| 71 | ## Installation |
| 72 | |
| 73 | ### Quick install |
| 74 | |
| 75 | \`\`\`bash |
| 76 | npx skills add https://github.com/alexanderop/{skill-name} --skill {skill-name} |
| 77 | \`\`\` |
| 78 | |
| 79 | ### Manual install |
| 80 | |
| 81 | Copy the `skills/{skill-name}/` directory into your project's `.claude/skills/` folder: |
| 82 | |
| 83 | \`\`\` |
| 84 | your-project/ |
| 85 | .claude/ |
| 86 | skills/ |
| 87 | {skill-name}/ |
| 88 | skill.md |
| 89 | \`\`\` |
| 90 | |
| 91 | ## Structure |
| 92 | |
| 93 | \`\`\` |
| 94 | skills/{skill-name}/ |
| 95 | skill.md # Main skill definition |
| 96 | references/ # Reference files (if any) |
| 97 | \`\`\` |
| 98 | |
| 99 | {Brief description of what each key file does.} |
| 100 | ``` |
| 101 | |
| 102 | **README guidelines:** |
| 103 | - Keep it scannable — someone should understand what the skill does in 30 seconds |
| 104 | - Use the same tone as the walkthrough README (direct, practical, no fluff) |
| 105 | - Add an image/screenshot section if the user provides one |
| 106 | |
| 107 | ### Step 4: Initialize git and publish |
| 108 | |
| 109 | Run these commands sequentially: |
| 110 | |
| 111 | ```bash |
| 112 | cd /Users/alexanderopalic/Projects/mySkills/{skill-name} |
| 113 | git init |
| 114 | git add -A |
| 115 | git commit -m "Initial commit: {skill-name} skill" |
| 116 | gh repo create alexanderop/{skill-name} --public --source=. --push --description "{one-line description}" |
| 117 | ``` |
| 118 | |
| 119 | If the user requested private visibility, use `--private` instead of `--public`. |
| 120 | |
| 121 | ### Step 5: Report back |
| 122 | |
| 123 | Tell the user: |
| 124 | - The repo URL: `https://github.com/alexanderop/{skill-name}` |
| 125 | - The install command: `npx skills add https://github.com/alexanderop/{skill-name} --skill {skill-name}` |
| 126 | - Remind them to add a screenshot/image to the README if they haven't already |
| 127 | |
| 128 | ## Quality Checklist |
| 129 | |
| 130 | Before finishing, verify: |
| 131 | - [ ] `skill.md` has proper frontmatter (name, description, allowed-tools, metadata) |
| 132 | - [ ] README is complete and follows the template |
| 133 | - [ ] Install command in README is correct |
| 134 | - [ ] Directory structure matches the convention |
| 135 | - [ ] Git repo is initialized and pushed to GitHub |
| 136 | - [ ] All files from the source skill are included |
| 137 | - [ ] No secrets or local paths leaked into the repo |