2.1 KiB
2.1 KiB
name, description, version, user-invocable
| name | description | version | user-invocable |
|---|---|---|---|
| git-publish-workflow | Automates branching, conventional commits, testing, and PR creation for uncommitted or staged work. | 1.1.0 | true |
Git Publish & PR Workflow
Objective
To provide a hands-off, end-to-end automation for moving local changes into a formal Pull Request, ensuring code quality through automated and manual verification steps.
Execution Protocol
Phase 1: Scope Determination
Before execution, check the git index to determine the work boundary:
- Case A (Partial): If staged changes exist, operate ONLY on staged changes.
- Case B (Full): If no changes are staged, operate on ALL modified/untracked files.
Phase 2: The "Safe-Commit" Sequence
- Branching: Generate a
kebab-casebranch name (e.g.,feat-auth-logicorfix-header-css). - Naming: Use Conventional Commits for the message (e.g.,
feat(ui): add logout button). - Verification:
- Identify the project type (e.g., Rust/Cargo, Python/Poetry, Node/NPM).
- Run the primary
test,lint, orbuildcommand. - Abort Policy: If verification fails, stop the sequence and report the error. Do not push.
Phase 3: Remote Integration
- Push: Upload the branch to
origin. - PR Creation: Open a Pull Request targeting the default branch (usually
mainormaster). - Documentation: Populate the PR description with:
- Summary: A high-level overview of "Why" and "What."
- Manual Verification Checklist: Provide a Markdown list (
- [ ]) of 3-5 tactical steps for a human to verify the change in a live environment.
Constraints & Rules
- Atomic Commits: If multiple distinct features are found in the scope, suggest splitting the work instead of one giant commit.
- No Force Push: Never use
--forceunless explicitly requested in the follow-up prompt. - Clean State: Ensure the workflow ends with the user on the new branch, not the original branch.
Trigger Scenarios
- User says: "Ship this."
- User says: "Make a PR for my current changes."
- Invoked via
/git-publish-workflow.