mach6-push
Commit changes, push to remote, and post a progress comment on the associated PR or issue. Stages files by name (never git add -A), matches existing commit style, auto-detects PR from branch. Usage: mach6-push [optional commit message]
- License 许可
- MIT
- 所属仓库
- aebrer/dreb
- 最近更新
- 2026-11-13
- Stars
- ★ 34
- Forks
- 11
01 前言 Front Matter
- name
- mach6-push
- description
- Commit changes, push to remote, and post a progress comment on the associated PR or issue. Stages files by name (never git add -A), matches existing commit style, auto-detects PR from branch. Usage: mach6-push [optional commit message]
- argument-hint
- [commit message]
03 SKILL.md 正文
mach6-push — Commit, Push, Progress Comment
User input: $ARGUMENTS
Global Rules
- GitHub as shared memory — Progress is posted as PR/issue comments so any future session can pick up context.
- HTML markers — Use
<!-- mach6-progress -->as the first line of progress comment bodies. - No
#Nin comment bodies — Use "finding 3", "item 3", "stage 2" etc. instead. - Safe git — Never use
git add -Aorgit add .. Stage files by name. Never stage secrets (.env, credentials, tokens, keys). - Task tracking — Use the
tasks_updatetool to show progress. - Non-interactive
gh— SetGH_PAGER=catandGH_EDITOR=catbefore allghcommands to prevent interactive prompts from hanging the agent. Use--body-fileinstead of inline--bodyfor allgh pr comment,gh pr create, andgh issue createcalls to avoid shell interpretation of backticks. Write each body to a unique per-invocation temp file viamktemp(e.g.GH_BODY="$(mktemp /tmp/gh-comment.$$.XXXXXXXX)") — never a fixed path like/tmp/gh-comment.md, which concurrent mach6 sessions on the same machine would clobber, cross-posting one session's body to another's PR/issue. - Stop after durable progress — The commit, push, and GitHub progress comment are the accountability and recovery boundary. Do not invoke
mach6-reviewor continue into a formal review cycle. Only the user may start formal review; offer it withsuggest_nextand stop.
Step 1: Set up task tracking
tasks_update([
{ id: "stage", title: "Stage changes", status: "in_progress" },
{ id: "commit", title: "Commit", status: "pending" },
{ id: "push", title: "Push to remote", status: "pending" },
{ id: "comment", title: "Post progress comment", status: "pending" }
])
Step 2: Stage changes
Run git status and git diff to understand the current state.
- If you have context from this session about which files were modified, stage those by name.
- If files are already staged and look correct, proceed.
- If unclear (fresh session, no context), review all changes and ask the user what to stage.
- Never use
git add -Aorgit add . - Never stage secrets (.env, credentials, tokens, keys)
Update task: stage → completed, commit → in_progress.
Step 3: Commit
Check recent commit style:
git log --oneline -10
Generate a commit message that:
- Follows the repository's existing style
- Summarizes the nature of the changes
- Uses the user's override message if provided
git commit -m "<message>"
Update task: commit → completed, push → in_progress.
Step 4: Push
git push
If no upstream is set, use git push -u origin <branch>.
Update task: push → completed, comment → in_progress.
Step 5: Post progress comment
Detect the associated PR or issue:
- Session context first: If an earlier mach6 command in this session targeted a specific PR or issue, use that.
- PR detection: Try
gh pr view --json number,urlon current branch. If a PR exists, comment on it. - Branch name fallback: Check branch name for issue number pattern (e.g.,
feature/issue-55-*). If found, comment on that issue. - Skip gracefully: If neither works, skip commenting and inform the user.
If session context points to an issue but a PR also exists on the current branch, prefer the PR.
Post a progress comment:
GH_BODY="$(mktemp /tmp/gh-comment.$$.XXXXXXXX)"
cat > "$GH_BODY" << 'MACH6_EOF'
<!-- mach6-progress -->
## Progress Update
<summary of changes in this batch>
**Commit:** \`<hash>\`
---
*Progress tracked by mach6*
MACH6_EOF
gh pr comment <number> --body-file "$GH_BODY"
Update task: comment → completed.
Report: what was committed, where pushed, and where the comment was posted (with link). The work is now durably saved and available for accountable review.
Stop here. Do not invoke mach6-review, launch formal review agents, or begin a review-fix-review loop. Only the user may start formal review.
Use suggest_next for exactly one context-appropriate command, then end the turn:
- If on a feature branch with a PR:
/skill:mach6-review <pr-number> - If on a feature branch without a PR:
/skill:mach6-plan <issue-number>to create one - If on the default branch: an issue-oriented next step
04 同仓库更多 Skills
search
Semantic codebase search — use for exploring code, finding implementations, and answering questions about any project. Searches using natural language queries, identifier names, or file paths. Returns ranked results using embedding-based similarity, BM25 keyword matching, symbol matching, import graph analysis, and git recency. Best for exploring a large code or text corpus when you don't know the exact keywords; use grep when you know the exact text.
valid-skill
A valid skill for testing purposes.
unknown-field
A skill with an unknown frontmatter field.
substitution-test
A skill for testing content substitution.
nested-child
Nested skill should be ignored.
root-skill-preferred
Root skill should win.