Skip to content

Instantly share code, notes, and snippets.

@mattppal
Created May 13, 2026 17:23
Show Gist options
  • Select an option

  • Save mattppal/b3c03f67c8d3d8e306879566c4ea9c19 to your computer and use it in GitHub Desktop.

Select an option

Save mattppal/b3c03f67c8d3d8e306879566c4ea9c19 to your computer and use it in GitHub Desktop.
zsh helper for publishing Codex skills
# Publish a Codex skill to a skills repository.
#
# Usage:
# skill-push # publish the skill in the current directory
# skill-push <name> # publish the installed skill named <name>
# skill-push <path> # publish the skill at <path>
#
# Optional configuration:
# export SKILLS_REPO_URL="https://github.com/YOUR_GITHUB_USERNAME/skills"
# export SKILLS_REPO="$HOME/Developer/git-repos/skills"
skills_push() {
emulate -L zsh
set -euo pipefail
local skills_repo_url="${SKILLS_REPO_URL:-https://github.com/YOUR_GITHUB_USERNAME/skills}"
local skills_repo="${SKILLS_REPO:-$HOME/Developer/git-repos/skills}"
local target
if (( $# == 0 )); then
target="the skill in the current working directory ($PWD)"
else
target="$*"
fi
local prompt
prompt=$(cat <<EOF
Publish $target to $skills_repo_url.
Use the local checkout at $skills_repo. Follow the existing repository convention:
- skills live under skills/<skill-name>/
- each skill has a SKILL.md file with YAML frontmatter
- preserve any supporting files in the skill directory
Resolve a bare skill name by checking common installed-skill locations such as ~/.agents/skills, ~/.claude/skills, and ~/.codex/skills. Copy or update only the target skill directory in $skills_repo/skills, then commit only the relevant skill files and push the skills repo. Do not include unrelated dirty or untracked files from that checkout.
EOF
)
codex "$prompt"
}
alias skill-push='skills_push'
alias skills-push='skills_push'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment