agentleFS
AsiaOstrichAsiaOstrich/EngramGraph/.agents/skills/push/SKILL.md

push

Skill4 starsChanged 28 days agoMITView on GitHub

AI-assisted safety layer for git push operations with quality gates and collaboration guardrails. Use when: pushing commits, force pushing, pushing to protected branches, pushing feature branches. Not for: composing the commit — use /commit; branch and merge strategy decisions — use /git-workflow-guide. Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation.

  • Commits and pushes

49 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use get-pr-reviews, push-everything and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • saffron-healthSkill

    get-pr-reviews

    Get nicely formatted output of the last review comments on a PR. Used internally by other skills.

    Also in 3 projects that use this

  • saffron-healthSkill

    push-everything

    Stage ALL changes in the repository (not just session changes), commit, and push. Use when you need to commit all pending changes.

    Also in 3 projects that use this

  • NVIDIASkill

    generate-spec

    Produce a feature specification covering API changes, backward compatibility, cross-language impact, performance, and a file-level change plan. Use when designing a new feature, planning a significant change, or the user asks to spec something out.

    Also in 3 projects that use this

  • MicrosoftSkill

    merge

    Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.

    Also in 3 projects that use this

  • MicrosoftSkill

    spec-review

    Independent, multi-model review of a design or spec **before** any code is written, for the microsoft/winappcli repo. Activate when a contributor asks to "review this spec", "review my design", "review this design doc", "validate this approach", "should we build this", "spec review", "design review", or "feature review". Fans out parallel sub-agents — each doing its OWN research against the real codebase and ecosystem rather than trusting the spec — covering necessity & scope, approach & alternatives, feasibility vs reality, risks & unknowns, DX & user impact, and a different-model-family cross-check. Emits a decision-oriented recommendation (proceed / proceed-with-changes / reconsider) to stdout. This is the PRE-CODE companion to the pr-review skill (which reviews code already written); use spec-review at the design/spec stage, not on an implemented diff. Does NOT write code or edit the spec.

    Also in 3 projects that use this

  • Hugging FaceSkill

    update-docs

    Update documentation across the repo after API changes. Finds stale references in docs, examples, docstrings, and fixes them.

    Also in 4 projects that use this

  • +2 more from saffron-health

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 6 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When /push is invoked, Claude executes the following steps natively:

    line 34
  2. Very specific:

    Run git rev-parse --abbrev-ref HEAD to get current branch.

    line 37
  3. Distinctive:

    If protected: show warning + pending commits, require explicit user confirmation before proceeding.

    line 39
  4. Very specific:

    If --force or --force-with-lease flag detected: Run git log origin/<branch>..HEAD --oneline to find commits that will be overwritten.

    line 42
  5. Very specific:

    Run git log origin/<branch>..HEAD --oneline to find commits that will be overwritten.

    line 43
  6. Distinctive:

    Run each configured gate in sequence using Bash tool:

    line 47
  7. Distinctive:

    If any required gate fails: abort with error message.

    line 54
  8. Distinctive:

    If push fails: show git error and suggest remediation.

    line 58
  9. Very specific:

    If auto_pr=true AND repo_mode=team AND no open PR exists for this branch: Suggest running /pr-automation-assistant to create a Pull Request.

    line 74
  10. Very specific:

    Before pushing, the assistant detects whether the target branch is a protected branch (e.g., main, master, release/*, hotfix/*).

    line 83
  11. Very specific:

    When --force is detected, shows the impact before allowing execution.

    line 93
  12. Distinctive:

    After a successful push, outputs a structured receipt for audit trail purposes.

    line 118
  13. Distinctive:

    After pushing a feature branch, prompts user to create a Pull Request if none exists.

    line 140
  14. Very specific:

    After /push completes, the AI assistant should suggest:

    line 220

“Common” is measured: kept by at least 6 in 10 of the 42 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Push Assistant | 推送助手

Language: English | 繁體中文

Version: 2.0.0 Created: 2026-04-23 Applicability: Claude Code Skills


AI-assisted safety layer for git push. Detects protected branches, enforces force-push guardrails, runs pre-push quality gates, outputs a structured push receipt, and integrates with PR automation.

git push 的 AI 輔助安全層。偵測保護分支、強制 force-push 護欄、執行 pre-push 品質 gate、輸出結構化推送收據,並整合 PR 自動化。

Core Standard | 核心標準

This skill implements .standards/push-standards.ai.yaml.


Workflow | 執行工作流程

When /push is invoked, Claude executes the following steps natively:

Step 1: Detect Protected Branch

Run git rev-parse --abbrev-ref HEAD to get current branch. Compare against protected_branches list (default: main, master, release/, hotfix/). If protected: show warning + pending commits, require explicit user confirmation before proceeding.

Step 2: Detect Force Push

If --force or --force-with-lease flag detected: Run git log origin/<branch>..HEAD --oneline to find commits that will be overwritten. Show count and author list. Require user to type yes, force push to proceed.

Step 3: Run Pre-Push Quality Gates

Run each configured gate in sequence using Bash tool:

  • lint: detect and run project lint command
  • test: detect and run project test command
  • type-check (optional): TypeScript type check
  • ac-coverage (optional): acceptance criteria coverage
  • security-scan (optional): security vulnerability scan

If any required gate fails: abort with error message.

Step 4: Execute Push

Run git push <remote> <branch> [--force]. If push fails: show git error and suggest remediation.

Step 5: Emit Push Receipt

Output structured receipt to console (and optionally to ~/.uds/push-history.jsonl):

{
  "branch": "<branch>",
  "commit_sha": "<sha>",
  "gates_passed": ["lint", "test"],
  "force_push": false,
  "timestamp": "<ISO8601>",
  "target_remote": "origin"
}

Step 6: PR Integration

If auto_pr=true AND repo_mode=team AND no open PR exists for this branch: Suggest running /pr-automation-assistant to create a Pull Request.


Features | 功能說明

1. Push Target Risk Detection | 推送目標風險偵測

Before pushing, the assistant detects whether the target branch is a protected branch (e.g., main, master, release/*, hotfix/*).

推送前偵測目標分支是否為保護分支(例如 main、master、release/*、hotfix/*)。

  • Displays a warning with branch name and commit list
  • Requires explicit user confirmation before proceeding
  • Aborts push if user does not confirm

2. Force-Push Guardrails | Force-Push 護欄

When --force is detected, shows the impact before allowing execution.

偵測到 --force 時,推送前顯示影響範圍。

  • Calculates commits that will be overwritten on remote
  • Shows count and authors of overwritten commits
  • Requires user to type a confirmation string (yes, force push)
  • Records force_push: true in the push receipt

3. Pre-Push Quality Gates | Pre-Push 品質 Gate

Runs configured quality gates in sequence before pushing.

推送前依序執行已設定的品質 gate。

GateDescription說明
lintRun project lint command執行 lint 檢查
testRun project test command執行測試
type-checkTypeScript type checking (optional)TypeScript 型別檢查(選用)
ac-coverageAcceptance criteria coverage check (optional)AC 覆蓋率檢查(選用)
security-scanSecurity vulnerability scan (optional)安全掃描(選用)

4. Push Receipt | 推送收據

After a successful push, outputs a structured receipt for audit trail purposes.

推送成功後輸出結構化收據,供稽核追蹤使用。

{
  "branch": "feature/my-feature",
  "commit_sha": "a1b2c3d",
  "gates_passed": ["lint", "test"],
  "gates_skipped": false,
  "force_push": false,
  "timestamp": "2026-04-23T10:00:00Z",
  "target_remote": "origin"
}

Optionally appended to ~/.uds/push-history.jsonl for persistent audit trail.

可選擇附加到 ~/.uds/push-history.jsonl 以持久化稽核追蹤。

5. PR Automation Integration | PR 自動化整合入口

After pushing a feature branch, prompts user to create a Pull Request if none exists.

推送 feature branch 後,若尚無 PR,提示使用者建立 Pull Request。

  • Checks if an open PR exists for the branch
  • Prompts user to run pr-automation-assistant
  • Skipped in single-owner repo mode or when --no-pr flag is used

Usage | 使用方式

# Standard push (runs quality gates automatically)
/push

# Push with force (shows overwritten commits, requires confirmation)
/push --force

# Push to a specific remote branch
/push --target main

# Skip quality gates (emergency use)
/push --skip-gates

# Push without PR prompt
/push --no-pr

# Force push without PR prompt (e.g., updating a personal branch)
/push --force --no-pr

Arguments | 參數說明

ArgumentDescription說明
--forceEnable force push with guardrail checks啟用 force push,含護欄確認
--target <branch>Specify target remote branch explicitly明確指定目標遠端分支
--skip-gatesSkip pre-push quality gates (emergency only)跳過品質 gate(僅緊急情況)
--no-prSuppress PR automation prompt after push推送後不提示建立 PR

Configuration | 設定

Configure via uds.project.yaml:

push:
  repo_mode: team           # "team" | "single-owner"
  protected_branches:
    - main
    - master
    - "release/*"
    - "hotfix/*"
  push_gates:
    default:
      - lint
      - test
    optional:
      - type-check
      - ac-coverage
      - security-scan
  receipt:
    output: console          # "console" | "file" | "both"
    file_path: "~/.uds/push-history.jsonl"
  auto_pr: true              # prompt to create PR after push to non-protected branch

Options | 選項模式

Option FileModeDescription說明
options/push/team-mode.mdteamFull collaboration guardrails (default)完整協作護欄(預設)
options/push/single-owner-mode.mdsingle-ownerReduced friction for personal repos個人 repo 低摩擦模式

Next Steps Guidance | 下一步引導

After /push completes, the AI assistant should suggest:

推送完成。建議下一步 / Push complete. Suggested next steps:

  • 執行 /pr-automation-assistant 建立或更新 Pull Request ⭐ Recommended / 推薦 — 確保協作流程完整 / Ensure complete collaboration workflow
  • 執行 /checkin 確認程式碼簽入品質 — 下次提交前的品質確認 / Quality verification before next commit
  • 查看 ~/.uds/push-history.jsonl 確認推送紀錄 — 稽核追蹤 / Audit trail verification

Related Standards | 相關標準

  • Push Standards — Core push safety rules
  • Git Workflow — Branching strategy
  • Commit Message — Commit conventions
  • PR Automation — Pull Request automation

Version History | 版本歷程

VersionDateChanges
2.0.02026-04-28Restore workflow execution steps (XSPEC-097 採用層解耦); remove deprecation notice
1.0.02026-04-23Initial release — XSPEC-081 Phase 1

License | 授權

This skill is released under MIT License and CC BY 4.0.

Source: universal-dev-standards

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.