publish-local-skill-to-repo
Publish a local skill folder to a target git repository that contains `skills/`. Use when you need to import a local skill into `skills/`, commit the change, and push it to a remote branch.
Publish Local Skill To Repo
Overview
Publish a local skill directory into a target repository under
skills/<skill-name>. This workflow validates source files, copies the skill
folder, commits the change, and pushes the current branch.
Required input
Prepare a local source skill directory that contains at least:
SKILL.md- Optional folders such as
agents/,scripts/,references/, andassets/
Publish workflow
Use the bundled script for deterministic publish steps.
- Validate your source skill folder and publish plan.
- Copy source files into the target repository's
skills/directory. - Stage, commit, and push changes to
origin/<current-branch>.
Run this command:
python3 scripts/publish_local_skill.py --source-skill-dir <path-to-local-skill>
Common options
Use these flags when needed:
--target-skill-name <name>: Override destination skill name.--commit-message "<message>": Override default commit message.--remote <name>: Override push remote name (defaultorigin).--no-push: Commit locally without pushing.--dry-run: Validate and print plan without writing files.--repo-root <path>: Explicitly set target repository root.
Safety rules
Follow these constraints during publish:
- Keep skill names in lowercase hyphen format.
- Never publish from a source path that equals destination path.
- Keep source skill content complete before publish to avoid partial updates.
- Ensure target repository has both
.gitandskills/. - Use
--dry-runbefore first publish from a new source location.