git-publish-guard

Constrain git push actions to require explicit remote specification, defaulting to origin.

1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/muddyrain/valley-mas --skill git-publish-guard
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-publish-guard
Source: https://github.com/muddyrain/valley-mas/tree/main/.codex/skills/git-publish-guard
Command: npx skills add https://github.com/muddyrain/valley-mas --skill git-publish-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

在 Valley MAS 中约束 Git 发布动作,要求 push 时显式指定 remote,默认推送到 origin。

Core Features & Use Cases

  • 避免把分支推错远端,确保发布动作可审计、可复现。
  • 首次推送新分支时优先使用 git push --set-upstream origin <branch>,后续推送优先 git push origin <branch>。
  • 如用户明确要求推送到非 origin 的远端,需在最终说明中明确标注所使用的 remote,并在需要时遵循该要求。

Quick Start

在执行 git push 时显式指定 remote,默认使用 origin,然后记录推送的 remote 和分支信息。

Frequently Asked Questions about git-publish-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce explicit remote specification for git push to avoid pushing to the wrong upstream?▼

To enforce explicit remote specification for git push, constrain push actions to require a declared remote, defaulting to origin. This ensures your branch publication actions remain auditable and reproducible by preventing accidental pushes to incorrect upstream repositories.

What is the best way to push a new git branch and set upstream safely?▼

The best way to push a new git branch safely is using git push --set-upstream origin <branch>. This explicitly sets the remote to origin, establishing the tracking relationship while adhering to guardrail requirements for subsequent pushes.

Can I push to a non-origin remote and still maintain workflow guardrails?▼

Yes, you can push to a non-origin remote if explicitly requested. The workflow requires clearly reporting the specific remote and branch used in the final output, ensuring the action remains fully auditable despite deviating from the default origin target.

Does git-publish-guard work with yeet and github:yeet workflows for remote publishing?▼

Yes, git-publish-guard integrates with yeet and github:yeet workflows for remote publishing. It enforces explicit remote usage and origin defaults within these workflows, providing clear final reporting of the remote and branch used during the publication process.

Why does my git workflow require an explicit remote for every push action?▼

Your git workflow requires an explicit remote for every push action to ensure publication safety. By defaulting to origin and requiring explicit specification for other remotes, the guardrail prevents accidental branch pushes to incorrect upstream repositories.