Agent Skillskdlbs/kandev › push

push

GitHub

将已验证提交的分支推送到远程仓库。支持自动检查提交状态、任务检查结果及分支安全性,并可通过--fixup参数衔接PR修复流程,确保推送操作的安全与规范。

.agents/skills/push/SKILL.md kdlbs/kandev

Trigger Scenarios

需要推送已验证的Git分支到远程 执行完代码修改和测试后需要发布变更 在PR工作流中完成修复后重新推送

Install

npx skills add kdlbs/kandev --skill push -g -y
More Options

Non-standard path

npx skills add https://github.com/kdlbs/kandev/tree/main/.agents/skills/push -g -y

Use without installing

npx skills use kdlbs/kandev@push

指定 Agent (Claude Code)

npx skills add kdlbs/kandev --skill push -a claude-code -g -y

安装 repo 全部 skill

npx skills add kdlbs/kandev --all -g -y

预览 repo 内 skill

npx skills add kdlbs/kandev --list

SKILL.md

Frontmatter
{
    "name": "push",
    "description": "Push a committed branch whose task-defined checks passed. With --fixup, continue with CI and review handling in the primary conversation."
}

Push

Planner Entry

Push the verified commit directly in the primary conversation. With --fixup, continue with /pr-fixup in that same conversation; do not delegate polling or delivery.

Available skills

  • /commit — Creates the artifact after task-defined checks pass.
  • /pr-fixup — Wait for CI checks and CodeRabbit, Greptile, Claude, OpenCode, and cubic review feedback, fix any failures or valid comments, and push again.

Options

  • --fixup — after pushing, begin /pr-fixup in the same conversation.

Note: This skill normally uses git push. It uses gh pr view before a no-upstream fallback so a checked-out fork PR is not accidentally pushed to its base repository.

Your task

Push the already committed branch to its remote.

Steps

Create a todo/task for each step below and mark them as completed as you go.

  1. Uncommitted changes: If there are dirty or staged changes, stop: a new commit and the affected task checks are required first.

  2. Task-check evidence: Require the task-defined unit, integration, and E2E checks affected by this commit to pass. If the checkout or commit changed afterward, rerun only the affected task checks.

  3. Safety check: Verify the current branch is NOT main or master. If it is, stop and ask the user — direct pushes to the default branch should go through a PR.

  4. Push the current branch:

    git push
    

    If the branch has no upstream, first look up the current branch's PR. Treat an unavailable or ambiguous lookup as a stop condition; only a confirmed absence of a PR permits the ordinary origin fallback. For a confirmed PR, require its headRefName to match the checked-out local branch, then inspect its delivery target:

    gh pr view --json isCrossRepository,headRepositoryOwner,headRepository,headRefName,headRefOid,maintainerCanModify
    

    For a cross-repository PR, the PR head owner can push its own fork directly. When acting as a base-repository maintainer on somebody else's fork, maintainerCanModify must be true; do not treat that field as a universal fork-owner gate. Push the exact current commit to the reported head owner, repository, and ref. Before using the HTTPS URL, configure Git to use the authenticated gh credential helper:

    gh auth setup-git
    git push "https://github.com/<head-owner>/<head-repository>.git" "HEAD:refs/heads/<head-ref>"
    

    If that push fails with git repository does not match any credential lease scope, do not put a token in command arguments or logs. Retry after gh auth setup-git; if HTTPS still rejects the contributor-fork push, use the SSH fallback below or report the authentication/scope blocker. Never embed the token in a remote URL, command argument, log, or persisted credential. Re-fetch the PR and require its headRefOid to equal local HEAD afterward. If HTTPS still rejects a contributor-fork push and SSH authentication is available, verify the exact target with git ls-remote git@github.com:<head-owner>/<head-repository>.git, then retry the same exact ref over SSH (using the exact remote-OID lease if history was rewritten). Re-fetch and verify the PR head OID again. Do not substitute a local fork remote or an inferred repository. Do not use a conveniently named local fork/contributor remote: linked worktrees share remote configuration, so it can refer to another task. Re-fetch the PR and require headRefOid to equal local HEAD.

    Only for a non-PR or same-repository PR, use git push -u origin HEAD rather than transcribing the branch name. Then verify git rev-parse HEAD equals git rev-parse '@{upstream}', and report the branch from git branch --show-current. If the branch was rebased or history was rewritten, first confirm the current branch is not main or master, then use the exact remote-OID lease git push --force-with-lease=refs/heads/<branch>:<captured-remote-sha>. Use generic --force-with-lease only when no remote OID was captured; never use an unconditional force push. If the branch modifies .github/workflows/* and GitHub rejects the push with a message like refusing to allow an OAuth App to create or update workflow ... without workflow scope, treat it as push authentication/scope, not a code or branch-protection failure. Retry with an SSH remote when available, for example git push git@github.com:<owner>/<repo>.git <branch>, or tell the user the token needs workflow scope.

  5. Report the pushed commit hash and branch.

  6. If --fixup: Continue with /pr-fixup in this conversation.

Version History

  • 1578843 Current 2026-08-16 08:48

    移除对独立verify技能的强制依赖,改为要求任务定义的单元、集成和E2E检查通过;增强跨仓库PR推送的安全检查和认证处理逻辑。

  • b4239d8 2026-07-24 17:32

Same Skill Collection

.agents/skills/acp-debug/SKILL.md
.agents/skills/add-integration/SKILL.md
.agents/skills/clean-branches/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/commit/SKILL.md
.agents/skills/context-engineering/SKILL.md
.agents/skills/create-kandev-plugin/SKILL.md
.agents/skills/debug/SKILL.md
.agents/skills/docs-maintainer/SKILL.md
.agents/skills/e2e/SKILL.md
.agents/skills/fix/SKILL.md
.agents/skills/harness-improvement/SKILL.md
.agents/skills/interview-me/SKILL.md
.agents/skills/plan/SKILL.md
.agents/skills/planner-orchestration/SKILL.md
.agents/skills/playwright-cli/SKILL.md
.agents/skills/pr-fixup/SKILL.md
.agents/skills/pr/SKILL.md
.agents/skills/product-demo-seeding/SKILL.md
.agents/skills/product-video-capture/SKILL.md
.agents/skills/qa/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/runtime-feature-flags/SKILL.md
.agents/skills/simplify/SKILL.md
.agents/skills/spec-driven-development/SKILL.md
.agents/skills/spec/SKILL.md
.agents/skills/tdd/SKILL.md
.agents/skills/using-agent-skills/SKILL.md
.agents/skills/verify/SKILL.md
.agents/skills/mobile-parity/SKILL.md
.agents/skills/record/SKILL.md

Metadata

Files
0
Version
1578843
Hash
f08aeb8c
Indexed
2026-07-24 17:32

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 23:38
浙ICP备14020137号-1 $mapa de visitantes$