一键导入
commit-and-push
Build, test, group changes logically, commit with Conventional Commits format, and push
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build, test, group changes logically, commit with Conventional Commits format, and push
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze build errors and categorize them by type for planning fixes
Analyze .Codex configuration for gaps, improvements, and needed updates
Build, test, group changes logically, commit with Conventional Commits format, and push
Create a GitHub issue for a modernization task with proper template
Run tests and verify code coverage meets 80% minimum requirement
Analyze .claude configuration for gaps, improvements, and needed updates
| name | commit-and-push |
| description | Build, test, group changes logically, commit with Conventional Commits format, and push |
| user-invocable | true |
| argument-hint |
Automates the complete commit workflow: verification → grouping → commit → push.
/commit-and-push
Check git status
Build verification
dotnet build ECMABasic.sln --configuration Release
Test verification
dotnet test ECMABasic.sln --configuration Release
Coverage check
dotnet test --collect:"XPlat Code Coverage"
Analyzes changed files and groups them logically by:
src/**/*.cssrc/**/*Test*.cs, **/Tests/***.csproj, *.json, *.yml*.md, docs/***.sh, *.bat.claude/**ECMABasic.Application/**ECMABasic55/**ECMABasic.Test/**❌ Don't mix:
✅ Group together:
For each logical group, I'll:
Determine commit type
Generate commit message
Present for approval
Commit 1 of 3:
feat(parser): add MID$ function support
Implements the MID$ string function per ECMA-55 specification.
Supports both 2-argument (MID$(str, start)) and 3-argument
(MID$(str, start, length)) forms.
Closes #47
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Files:
- src/ECMABasic.Application/FunctionFactory.cs
- test/ECMABasic.Test/FunctionTests.cs
[A]pprove [E]dit [S]kip [Q]uit?
Execute approved commits
git add <files>
git commit -m "message"
After all commits are approved:
Verify remote
git remote -v
Push to origin
git push origin <branch-name>
Confirm success
Changed files:
src/ECMABasic.Application/CharacterReader.cssrc/ECMABasic.Application/Interpreter.cstest/ECMABasic.Test/InterpreterTests.csGrouping:
Group 1: Core nullable fixes
- CharacterReader.cs
- Interpreter.cs
Commit: fix(core): resolve nullable reference warnings
Issue: #1
Group 2: Test updates
- InterpreterTests.cs
Commit: test: update tests for nullable changes
Related: #1
Changed files:
src/ECMABasic.Application/Parser.cs (new feature)src/ECMABasic55/Program.cs (bug fix)README.md (documentation).claude/rules/modernization.md (config)Grouping:
Group 1: New feature
- Parser.cs
Commit: feat(parser): add WHILE-WEND loop support
Group 2: Bug fix
- Program.cs
Commit: fix(repl): handle empty input gracefully
Group 3: Documentation
- README.md
Commit: docs: update README with WHILE-WEND info
Group 4: Configuration
- .claude/rules/modernization.md
Commit: chore: add WHILE-WEND pattern to rules
User: /commit-and-push
Me: 🔍 Analyzing changes...
Found 12 changed files
✅ Build successful (0 warnings)
✅ All tests passed (87/87)
✅ Coverage: 82.3% (meets 80% requirement)
📦 Grouped into 3 logical commits:
─────────────────────────────────────────
Commit 1 of 3: Core Changes
─────────────────────────────────────────
fix(core): resolve nullable reference warnings
Fixed CS8625 and CS8603 errors in CharacterReader and
Interpreter classes by adding proper nullable annotations
and null checks.
Closes #1
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Files (8):
- src/ECMABasic.Application/CharacterReader.cs
- src/ECMABasic.Application/Interpreter.cs
- [... 6 more]
[A]pprove [E]dit message [S]kip [Q]uit? _
User: A
Me: ✅ Committed: fix(core): resolve nullable reference warnings
SHA: abc1234
─────────────────────────────────────────
Commit 2 of 3: Test Updates
─────────────────────────────────────────
test: add coverage for nullable edge cases
Added tests to verify proper null handling in CharacterReader
and Interpreter after nullable reference type fixes.
Related to #1
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Files (3):
- test/ECMABasic.Test/CharacterReaderTests.cs
- test/ECMABasic.Test/InterpreterTests.cs
- test/ECMABasic.Test/Resources/null-test.BAS
[A]pprove [E]dit message [S]kip [Q]uit? _
User: A
Me: ✅ Committed: test: add coverage for nullable edge cases
SHA: def5678
─────────────────────────────────────────
Commit 3 of 3: Documentation
─────────────────────────────────────────
docs: update MODERNIZATION_PLAN with progress
Marked Issue #1 (nullable fixes) as completed.
Updated coverage metrics to reflect current 82.3%.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Files (1):
- docs/MODERNIZATION_PLAN.md
[A]pprove [E]dit message [S]kip [Q]uit? _
User: A
Me: ✅ Committed: docs: update MODERNIZATION_PLAN with progress
SHA: ghi9012
📤 Ready to push 3 commits
Push to origin/feature/1-fix-nullable-warnings? [Y/n] _
User: Y
Me: 🚀 Pushing...
✅ Pushed successfully!
Summary:
- 3 commits pushed
- 12 files changed
- Branch: feature/1-fix-nullable-warnings
- Remote: origin
❌ Build failed with 5 errors
Cannot commit until build succeeds.
Fix errors and run /commit-and-push again.
❌ 3 tests failed
Cannot commit until all tests pass.
Failed tests:
- InterpreterTests.Parse_NullInput_ThrowsException
- CharacterReaderTests.Read_EmptyStream_ReturnsNull
- ForStatementTests.Execute_NegativeStep_Works
Fix tests and run /commit-and-push again.
⚠️ Coverage: 78.5% (below 80% minimum)
Cannot commit - coverage requirement not met.
Need 1.5% more coverage (approximately 15-20 more lines tested).
Run /verify-coverage for detailed report.
ℹ️ No changes to commit
Working directory is clean.
❌ Merge conflicts detected in:
- src/ECMABasic.Application/Interpreter.cs
Resolve conflicts manually:
1. git status
2. Edit conflicted files
3. git add <resolved-files>
4. Run /commit-and-push again
# Skip approval prompts, commit all groups automatically
/commit-and-push --auto
Warning: Only use when:
# Show what would be committed without actually committing
/commit-and-push --dry-run
# Force all changes into a single commit (not recommended)
/commit-and-push --single
✅ Build verification - Won't commit if build fails
✅ Test verification - Won't commit if tests fail
✅ Coverage check - Won't commit if coverage < 80%
✅ Approval prompts - Review each commit before creation
✅ Push confirmation - Explicit approval before pushing
✅ Rollback support - Can undo commits before push
✅ Use /commit-and-push when:
❌ Don't use when:
/verify-coverage - Check coverage before committing/audit-build - See if any warnings existgit status, git add, git commit, git pushConfigured via .claude/rules/git-conventions.md:
git push, never git push --forcegit reset to undoReview changes first
git status
git diff
Run /commit-and-push when ready
Review each commit before approving
Verify push was successful
Create PR if on feature branch