| name | atomic-commit |
| description | Atomic git workflow - validates, commits, pushes, creates PR, and verifies CI with zero-warnings policy. Orchestrates complete code submission as state machine with rollback on failure. |
Atomic Commit Skill
Atomic workflow: validate → commit → push → PR → verify. All changes committed as single unit with zero warnings policy.
Overview
Orchestrates complete code submission as state machine with 8 phases:
- PRE_COMMIT - Validation (quality gate, secrets scan)
- COMMIT - Atomic commit creation (conventional format)
- PRE_PUSH - Remote sync check
- PUSH - Upload to origin
- PR_CREATE - Open pull request
- VERIFY - Wait for CI checks
- REVIEW - Code review (invoke code-review-assistant skill)
- REPORT - Success summary
Zero warnings policy: Any warning fails the workflow and triggers rollback.
Usage
/atomic-commit
/atomic-commit --message "feat(auth): add OAuth2 flow"
/atomic-commit --dry-run
/atomic-commit --skip-ci
Arguments
| Argument | Description | Default |
|---|
--message, -m | Commit message (auto-detect if omitted) | auto |
--dry-run | Validate only, no commits/pushes | false |
--skip-ci | Skip CI verification | false |
--timeout | CI wait timeout in seconds | 1800 |
--base-branch | Target branch for PR | main |
State Machine
[Start] → PRE_COMMIT → COMMIT → PRE_PUSH → PUSH → PR_CREATE → VERIFY → REVIEW → REPORT → [Success]
↓ ↓ ↓ ↓ ↓ ↓ ↓
[Fail] Rollback Rollback Rollback Rollback Rollback Fix
Quality Gates
| Phase | Check | Failure Action |
|---|
| PRE_COMMIT | Quality gate zero warnings | Abort |
| PRE_COMMIT | No secrets in diff | Abort |
| PRE_COMMIT | Not on protected branch | Abort |
| PRE_COMMIT | Dependency changes verified (./scripts/verify-deps.sh) | Abort |
| COMMIT | Valid conventional format | Rollback |
| PRE_PUSH | Remote accessible | Rollback |
| PUSH | SHA verification | Rollback |
| PR_CREATE | gh CLI authenticated | Rollback |
| VERIFY | All CI checks green | Rollback |
| VERIFY | Zero warnings in checks | Rollback |
| VERIFY | Vercel deployment succeeds | Rollback |
| REVIEW | Code review completed (code-review-assistant skill) | Fix & re-review |
| REVIEW | All P1/P2 findings addressed | Fix & re-review |
Rollback Actions
On failure, automatically:
- Close PR (if created)
- Remove remote commit (best effort)
- Reset local commit
- Unstage changes
Error Codes
| Code | Meaning |
|---|
| 0 | Success |
| 2 | Quality gate failed |
| 3 | Commit failed |
| 4 | Push failed |
| 5 | PR creation failed |
| 6 | Checks failed/warnings found |
| 7 | Timeout |
| 8 | Rollback failed |
Prerequisites
gh CLI installed and authenticated
- Working on feature branch (not main/master)
./scripts/quality_gate.sh exists
Configuration
Environment variables:
ATOMIC_COMMIT_TIMEOUT=1800
ATOMIC_COMMIT_BASE_BRANCH=main
ATOMIC_COMMIT_NO_ROLLBACK=0
Commit Format
type(scope): Brief description (50 chars max)
- Why (not what) - user perspective
- Reference issues: Fixes #123
Types: feat, fix, docs, style, refactor, perf, test, ci, chore
Implementation
This skill uses sub-agents for each phase:
validate - Phase 1: PRE_COMMIT
commit - Phase 2: COMMIT
push - Phases 3-4: PRE_PUSH & PUSH
create-pr - Phase 5: PR_CREATE
verify - Phase 6: VERIFY
Success Criteria
Command succeeds only when:
- ✓ All local validation passes (zero warnings)
- ✓ Commit created with valid SHA
- ✓ Pushed to remote successfully
- ✓ PR created with valid URL
- ✓ All GitHub Actions pass
- ✓ Zero warnings in all checks
- ✓ Code review completed with all findings addressed
See Also
.opencode/commands/commit.md - Basic commit guidelines
.github/PULL_REQUEST_TEMPLATE.md - PR template
references/IMPLEMENTATION.md - Technical details
Test change