Atomic 提交
- 作者仓库星标 0
- 作者仓库 skills-registry
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 7 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
- REPORT - Success summary
Zero warnings policy: Any warning fails the workflow and triggers rollback.
Usage
# Full workflow
/atomic-commit
# With custom message
/atomic-commit --message "feat(auth): add OAuth2 flow"
# Dry run (validate only)
/atomic-commit --dry-run
# Skip CI verification (emergency)
/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 → REPORT → [Success]
↓ ↓ ↓ ↓ ↓ ↓
[Fail] Rollback Rollback Rollback Rollback Rollback
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 |
| 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 |
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
ghCLI installed and authenticated- Working on feature branch (not main/master)
./scripts/quality_gate.shexists
Configuration
Environment variables:
ATOMIC_COMMIT_TIMEOUT=1800 # Check wait timeout
ATOMIC_COMMIT_BASE_BRANCH=main # Target branch for PR
ATOMIC_COMMIT_NO_ROLLBACK=0 # Set 1 to disable rollback
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_COMMITcommit- Phase 2: COMMITpush- Phases 3-4: PRE_PUSH & PUSHcreate-pr- Phase 5: PR_CREATEverify- 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
See Also
.opencode/commands/commit.md- Basic commit guidelines.github/PULL_REQUEST_TEMPLATE.md- PR templatereferences/IMPLEMENTATION.md- Technical details
Test change
<!-- tomevault:4.0:skill_md:2026-05-22 -->Source: d-oit/do-knowledge-studio — distributed by TomeVault.
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 读取环境变量
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Orchestrates complete code submission as state machine with 7 phases: PRECOMMIT - Validation (quality gate, secrets scan) COMMIT - Atomic commit creation (conventional format)
Usage
Argument · Description · Default --message, -m · Commit message (auto-detect if omitted) · auto --dry-run · Validate only, no commits/pushes · false
State Machine
Phase · Check · Failure Action PRECOMMIT · Quality gate zero warnings · Abort PRECOMMIT · No secrets in diff · Abort
On failure, automatically: Close PR (if created) Remove remote commit (best effort)
# 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 7 phases:
1. PRE_COMMIT - Validation (quality gate, secrets scan)
2. COMMIT - Atomic commit creation (conventional format)
3. PRE_PUSH - Remote sync check
4. PUSH - Upload to origin
5. PR_CREATE - Open pull request
6. VERIFY - Wait for CI checks
7. REPORT - Success summary
**Zero warnings policy**: Any warning fails the workflow and triggers rollback.
## Usage
```bash
# Full workflow
/atomic-commit
# With custom message
/atomic-commit --message "feat(auth): add OAuth2 flow"
# Dry run (validate only)
/atomic-commit --dry-run
# Skip CI verification (emergency)
/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 → REPORT → [Success]
↓ ↓ ↓ ↓ ↓ ↓
[Fail] Rollback Rollback Rollback Rollback Rollback
```
## 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 |
| COMMIT | Valid conventional format | Rollback |
| PRE_PUSH | Remote accessible | Rollback |
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Overview → Usage → Arguments → State Machine → Quality Gates → Rollback Actions
要点 -> zero warnings · Zero warnings policy · Types · Atomic workflow: validate → commit → push → PR → verify. · Orchestrates complete code submission as state machine with 7 phases: 1. · Zero warnings policy: Any warning fails the workflow and triggers rollback. · On failure, automatically: 1. · Command succeeds only when: 1.
文件/命令 -> --message, -m · --dry-run · --skip-ci · --timeout · --base-branch · ./scripts/qualitygate.sh · validate · commit
内容 SHA-256 -> ae4d62d291a3
原文结构
适用与边界
原文中的明确线索
--message, -m、--dry-run、--skip-ci、--timeout、--base-branch、./scripts/qualitygate.sh、validate、commit