Push main

From obot-platform/discobot · View interactive version

Push main is an AI agent skill from the GitHub repository obot-platform/discobot. Push the current content to obot-platform/discobot main, watch GitHub Actions with gh run watch, fix CI failures, and repeat until main CI passes.

How to use this skill

Skill file

Push Main and Drive CI Green

Push the current repository content to the canonical obot-platform/discobot

main branch, then watch GitHub Actions with gh run watch --exit-status.

If CI fails, diagnose, fix, commit, push, and watch again. Continue until the

latest pushed main commit has passing CI.

Treat invoking /push-main as authorization to perform the normal end-to-end

push-and-fix loop on obot-platform/discobot without pausing for routine

confirmation. Keep the user informed with concise progress updates, but do not

stop on the happy path.

Core Rules

git remote -v.

gh run watch <run-id> --exit-status.

run IDs, then gh run watch --exit-status to block until completion.

after the first run starts.

relevant GitHub Actions runs completed successfully.

gh run view --log-failed; fix the issue locally; run the smallest relevant

local validation; commit; push; and restart CI verification for the new

HEAD.

ambiguous CI failures, a risky or broad remediation, secrets, a non-fast-

forward push, or an action that would rewrite published history.

Procedure

1. Confirm repository and authentication

  1. Run git status --short --branch.
  2. Run git remote -v and select the remote whose URL points to

obot-platform/discobot.

  1. Run gh auth status.
  2. Fetch the canonical refs:
  1. Verify the current branch and upstream state:

2. Commit the current content when needed

  1. If the working tree or index is dirty, inspect all changes:
  1. Organize changes into the smallest sensible set of conventional commits.

unrelated temporary artifacts.

  1. If the requested scope is clear, commit without asking. If changes are

ambiguous or include suspicious files, ask the user before committing.

  1. If there are no local changes, push the current HEAD.

3. Push to upstream main

  1. Rebase/merge only if it can be done safely and without rewriting published

history. Ask before any non-trivial conflict resolution.

  1. Push the local HEAD to canonical main:
  1. Fetch again and verify:
  1. Do not continue until local HEAD matches <remote>/main.

4. Watch CI for the pushed commit

  1. Resolve the pushed SHA:
  1. Discover workflow runs for that SHA:
  1. For each relevant run:

gh run view <run-id> --log-failed.

  1. After each watched run completes, run gh run list --commit <sha> again.
  2. Treat CI as passing only when every relevant run for the pushed SHA has

conclusion success.

  1. If no run appears immediately after pushing, wait briefly and re-list a small

number of times only to discover the run ID. As soon as a run ID exists,

switch to gh run watch --exit-status.

5. Fix failures and repeat

When any CI run fails:

  1. Identify the failing job/step from gh run view and failed logs.
  2. Read the relevant code before editing.
  3. Make the smallest scoped fix.
  4. Run the smallest meaningful local validation first, for example:
  1. Commit the fix with a conventional commit message.
  2. Push again with git push <remote> HEAD:main.
  3. Restart CI verification from step 4 for the new HEAD.

Expected Commands

Use commands along these lines:

git status --short --branch
git remote -v
gh auth status
git fetch <remote> main
git fetch <remote> --tags
git rev-parse HEAD
git rev-parse <remote>/main
git diff
git diff --cached
git add <paths>
git commit -m '<subject>' -m '<body>'
git push <remote> HEAD:main
gh run list --commit <sha>
gh run watch <run-id> --exit-status
gh run view <run-id>
gh run view <run-id> --log-failed

Completion Criteria

The skill is complete only when:

HEAD,

End with a concise summary that includes:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.