Skip to content

Instantly share code, notes, and snippets.

@rvanbaalen
Created January 28, 2026 18:03
Show Gist options
  • Select an option

  • Save rvanbaalen/56a6886a3f6fed5016aab97c848c49ff to your computer and use it in GitHub Desktop.

Select an option

Save rvanbaalen/56a6886a3f6fed5016aab97c848c49ff to your computer and use it in GitHub Desktop.
publish-skill skill for Claude Code

Publish Skill for Claude Code

Automatically offers to publish new Claude Code skills as documented GitHub Gists, making them installable via the Claude Skills Installer.

What It Does

  1. Auto-triggers when you ask Claude to create a new skill
  2. Gathers skill requirements and drafts the SKILL.md with proper frontmatter
  3. Asks if you want to publish as a GitHub Gist
  4. Creates a documented gist with README.md and SKILL.md
  5. Saves the skill locally to ~/.claude/skills/
  6. When editing existing skills, checks if they're published and offers to update the gist

Auto-Invocation

Claude will automatically use this skill when you:

  • Ask to create a new skill or command
  • Say things like "create a skill for...", "make a skill that..."
  • Ask to edit or modify an existing skill

Installation

Using Claude Skills Installer (Recommended)

Install the Claude Skills Installer first, then run:

/claude-skills

Select the publish-skill from the list.

Manual Installation

  1. Create the skill directory:

    mkdir -p ~/.claude/skills/publish-skill
  2. Download the skill file:

    curl -o ~/.claude/skills/publish-skill/SKILL.md https://gist.githubusercontent.com/rvanbaalen/56a6886a3f6fed5016aab97c848c49ff/raw/SKILL.md
  3. Restart Claude Code to load the new skill.

Key Features

  • Auto-triggers on skill creation requests
  • Proper documentation with README template following best practices
  • GitHub Gist integration using the gh CLI
  • Local + remote saves skills both locally and as a gist
  • Edit detection checks for published gists when editing skills and offers to sync
  • Skills Installer compatible for easy sharing and installation

License

MIT License - Created by rvanbaalen

name description
publish-skill
Auto-invoke this skill when the user asks to create a new Claude Code skill. Instead of just creating the skill file locally, offer to publish it as a documented GitHub Gist that can be installed via the Claude Skills Installer.

You are helping the user create, edit, and optionally publish Claude Code skills as GitHub Gists.

When to Trigger

Auto-invoke this skill when the user:

  • Asks to create a new skill
  • Wants to make a new Claude Code command
  • Requests a custom slash command
  • Says things like "create a skill for...", "make a skill that...", "I need a skill to..."
  • Asks to edit or modify an existing skill

Procedure

1. Gather Skill Requirements

Ask the user about the skill they want to create:

  • What should the skill do?
  • When should it trigger? (auto-invoke vs manual /command)
  • What name should it have?

If the user has already provided this information in their request, skip to the next step.

2. Draft the Skill

Create the SKILL.md content with proper YAML frontmatter:

---
name: <skill-name>
description: <clear description of what the skill does and when to use it>
---

Follow these guidelines:

  • Keep the description concise but informative (used by Claude to decide when to invoke)
  • Use disable-model-invocation: true only if the skill has side effects (deploys, commits, etc.)
  • Add user-invocable: false only if it should be Claude-only (not in / menu)
  • Include clear step-by-step instructions in the body

3. Ask About Publishing

Use AskUserQuestion to ask:

"Would you like to publish this skill as a GitHub Gist? This makes it:
- Documented with a proper README
- Installable via the Claude Skills Installer
- Shareable with others"

Options:

  1. Publish as Gist - Create a public gist with README and SKILL.md
  2. Save locally only - Just save to ~/.claude/skills/

4a. If Publishing as Gist

Create two files for the gist:

README.md template:

# <Skill Name> Skill for Claude Code

<Brief one-line description>

## What It Does

<Numbered list of 3-5 key capabilities>

## Auto-Invocation

<Describe when Claude will automatically use this skill, OR state "This skill is manually invoked with `/<skill-name>`">

## Installation

### Using Claude Skills Installer (Recommended)

Install the [Claude Skills Installer](https://gist.github.com/rvanbaalen/2e4c2840d06de810f771a4514f97c6da) first, then run:

```bash
claude-skills install <gist-id>

Manual Installation

  1. Create the skill directory:

    mkdir -p ~/.claude/skills/<skill-name>
  2. Download the skill file:

    curl -o ~/.claude/skills/<skill-name>/SKILL.md <raw-gist-url>
  3. Restart Claude Code to load the new skill.

Key Features

<Bullet list of 3-5 highlights>

License

MIT License - Created by


**SKILL.md:** The skill content you drafted in step 2.

### 5. Create the Gist

Use the `gh` CLI to create the gist:

```bash
# Create a temporary directory for the gist files
TEMP_DIR=$(mktemp -d)
# Write README.md
cat > "$TEMP_DIR/README.md" << 'EOF'
<readme content>
EOF
# Write SKILL.md
cat > "$TEMP_DIR/SKILL.md" << 'EOF'
<skill content>
EOF
# Create the public gist
gh gist create "$TEMP_DIR/README.md" "$TEMP_DIR/SKILL.md" --public --desc "<skill-name> skill for Claude Code"
# Clean up
rm -rf "$TEMP_DIR"

6. Also Save Locally

After creating the gist (or if user chose local only), save to the local skills folder:

mkdir -p ~/.claude/skills/<skill-name>

Then write the SKILL.md file to ~/.claude/skills/<skill-name>/SKILL.md.

7. Provide Summary

Output:

  • Link to the created gist (if published)
  • Confirmation of local installation path
  • How to invoke the skill (/<skill-name> or auto-invocation explanation)
  • Remind user to restart Claude Code or start a new session to load the skill

Editing Existing Skills

When the user asks to edit or modify an existing skill:

1. Check if Skill is Published

After making changes to a skill, check if it has an associated gist:

# Search for gists with the skill name
gh gist list --limit 100 | grep "<skill-name>"

Or search more specifically:

gh api gists --jq '.[] | select(.description | contains("<skill-name> skill")) | {id: .id, description: .description, url: .html_url}'

2. If Published, Offer to Update

If a matching gist is found, ask the user:

"This skill appears to be published as a gist. Would you like to update the gist with your changes?"

3. Update the Gist

Use gh gist edit to update the existing gist:

# Create temp files with updated content
TEMP_DIR=$(mktemp -d)
cat > "$TEMP_DIR/SKILL.md" << 'EOF'
<updated skill content>
EOF

# If README needs updating too
cat > "$TEMP_DIR/README.md" << 'EOF'
<updated readme content>
EOF

# Update the gist
gh gist edit <gist-id> "$TEMP_DIR/SKILL.md" "$TEMP_DIR/README.md"

# Clean up
rm -rf "$TEMP_DIR"

Alternatively, for single file updates:

gh gist edit <gist-id> -f SKILL.md ~/.claude/skills/<skill-name>/SKILL.md

4. Confirm Update

After updating, provide:

  • Link to the updated gist
  • Summary of changes made
  • Remind that users with the skill installed can update via the Claude Skills Installer

Important Guidelines

  • Always validate the skill name: lowercase, numbers, and hyphens only (max 64 characters)
  • Ensure the description is meaningful - Claude uses it to decide when to auto-invoke
  • For gists, always create both README.md and SKILL.md files
  • Use gh gist create with --public flag for shareable skills
  • Use gh gist edit to update existing gists
  • The gist description should follow the pattern: " skill for Claude Code"
  • When editing skills, always check for existing gists to keep them in sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment