Publish Agent Skills
Publish repository-hosted Agent Skills through the GitHub CLI's preview gh skill publish workflow.
Authorization boundary
- Treat explicit skill invocation as workflow selection, not by itself as permission to mutate GitHub.
- Publish only when the human explicitly asks to publish Agent Skills and provides or approves the version tag.
- Resolve ambiguity about the repository, skill directory, included skills, or version before publishing.
- Never delete or replace an existing release, move a tag, or republish an existing version unless the human separately requests that exact action.
- Remember that
gh skill is in preview. Read gh skill publish --help at execution time and stop if its current behavior conflicts with this workflow.
Inputs
Establish these values before any publishing command:
- Repository or directory: default to the current repository root; pass a directory argument only when the human intends a narrower supported location.
- Skills: enumerate every
SKILL.md that gh skill publish will discover and state which skills will be included.
- Tag: require a human-provided or human-approved SemVer-style tag such as
v1.2.0.
Workflow
1. Inspect the repository
- Run
gh auth status, gh --version, and gh skill publish --help.
- Identify the repository with
gh repo view and inspect git status --short --branch, HEAD, remotes, and upstream state.
- Require a clean worktree and confirm
HEAD is pushed to the intended remote branch.
- Discover skills using the locations supported by the current command, including
skills/*/SKILL.md, skills/{scope}/*/SKILL.md, root-level */SKILL.md, and plugins/{scope}/skills/*/SKILL.md.
- Check remote tags and releases. Stop if the approved tag or its release already exists.
2. Validate without publishing
Run the official dry run against the intended directory:
gh skill publish "$skill_directory" --dry-run
- Omit the directory argument when publishing from the current repository root.
- Require the dry run to pass before publishing. It validates skill naming, directory/name agreement, required frontmatter, and supported
allowed-tools shape.
- If validation reports install metadata that can be stripped, use
--fix only after checking the affected paths. Review every resulting diff, commit the correction, push it, and rerun --dry-run.
- Fix other validation errors directly, validate the affected skills, commit and push the corrections, then rerun the dry run.
- Never continue to publishing with validation errors or uncommitted fixes.
3. Publish the approved version once
Use the approved tag for deterministic, non-interactive publishing:
gh skill publish "$skill_directory" --tag "$release_tag"
- Omit the directory argument when publishing from the current repository root.
- Expect the command to validate again, add the
agent-skills repository topic, and create a GitHub Release with generated notes.
- Run the command once. If it fails or the result is ambiguous, inspect remote tags, releases, and repository topics before considering a retry.
4. Verify and report
- Read the created release with
gh release view <tag> and verify the remote tag points to the pushed commit.
- Confirm the repository has the
agent-skills topic.
- Use
gh skill preview <owner/repo> <skill-name> to confirm each published skill is discoverable when the command supports it.
- Return the release URL, version, target commit, and published skill names.
Stop conditions
Stop without publishing when authentication or write access is missing, the worktree is dirty, the target is not pushed, the requested tag/release already exists, the dry run fails, fixes remain uncommitted, or the current preview command's behavior cannot be verified. Report the blocker and preserve existing remote state.
1---2name: publish-agent-skills3description: Validate and publish Agent Skills from a GitHub repository using gh skill publish. Use only when a human explicitly invokes $publish-agent-skills and asks to publish one or more skills.4license: MIT5---67# Publish Agent Skills89Publish repository-hosted Agent Skills through the GitHub CLI's preview `gh skill publish` workflow.1011## Authorization boundary1213- Treat explicit skill invocation as workflow selection, not by itself as permission to mutate GitHub.14- Publish only when the human explicitly asks to publish Agent Skills and provides or approves the version tag.15- Resolve ambiguity about the repository, skill directory, included skills, or version before publishing.16- Never delete or replace an existing release, move a tag, or republish an existing version unless the human separately requests that exact action.17- Remember that `gh skill` is in preview. Read `gh skill publish --help` at execution time and stop if its current behavior conflicts with this workflow.1819## Inputs2021Establish these values before any publishing command:2223- Repository or directory: default to the current repository root; pass a directory argument only when the human intends a narrower supported location.24- Skills: enumerate every `SKILL.md` that `gh skill publish` will discover and state which skills will be included.25- Tag: require a human-provided or human-approved SemVer-style tag such as `v1.2.0`.2627## Workflow2829### 1. Inspect the repository30311. Run `gh auth status`, `gh --version`, and `gh skill publish --help`.322. Identify the repository with `gh repo view` and inspect `git status --short --branch`, `HEAD`, remotes, and upstream state.333. Require a clean worktree and confirm `HEAD` is pushed to the intended remote branch.344. Discover skills using the locations supported by the current command, including `skills/*/SKILL.md`, `skills/{scope}/*/SKILL.md`, root-level `*/SKILL.md`, and `plugins/{scope}/skills/*/SKILL.md`.355. Check remote tags and releases. Stop if the approved tag or its release already exists.3637### 2. Validate without publishing3839Run the official dry run against the intended directory:4041```bash42gh skill publish "$skill_directory" --dry-run43```4445- Omit the directory argument when publishing from the current repository root.46- Require the dry run to pass before publishing. It validates skill naming, directory/name agreement, required frontmatter, and supported `allowed-tools` shape.47- If validation reports install metadata that can be stripped, use `--fix` only after checking the affected paths. Review every resulting diff, commit the correction, push it, and rerun `--dry-run`.48- Fix other validation errors directly, validate the affected skills, commit and push the corrections, then rerun the dry run.49- Never continue to publishing with validation errors or uncommitted fixes.5051### 3. Publish the approved version once5253Use the approved tag for deterministic, non-interactive publishing:5455```bash56gh skill publish "$skill_directory" --tag "$release_tag"57```5859- Omit the directory argument when publishing from the current repository root.60- Expect the command to validate again, add the `agent-skills` repository topic, and create a GitHub Release with generated notes.61- Run the command once. If it fails or the result is ambiguous, inspect remote tags, releases, and repository topics before considering a retry.6263### 4. Verify and report64651. Read the created release with `gh release view <tag>` and verify the remote tag points to the pushed commit.662. Confirm the repository has the `agent-skills` topic.673. Use `gh skill preview <owner/repo> <skill-name>` to confirm each published skill is discoverable when the command supports it.684. Return the release URL, version, target commit, and published skill names.6970## Stop conditions7172Stop without publishing when authentication or write access is missing, the worktree is dirty, the target is not pushed, the requested tag/release already exists, the dry run fails, fixes remain uncommitted, or the current preview command's behavior cannot be verified. Report the blocker and preserve existing remote state.