Loading...
Loading...
Automated git commit and push tool with AI-generated commit messages
npx skill4agent add lingengyuan/my-skills sync_to_github--push--dry-run# Analyze changes and create commit
Skill(sync_to_github)
# Commit and push to remote
Skill(sync_to_github, args="--push")
# Preview without committing
Skill(sync_to_github, args="--dry-run")# After implementing a new feature
Skill(sync_to_github)Analyzing changes...
Files modified:
src/components/Button.tsx
src/styles/button.css
Generated commit message:
feat: add Button component with hover states
- Add reusable Button component with props interface
- Implement hover and active state animations
- Add CSS module for button styling
Commit created: abc123def# After fixing a bug
Skill(sync_to_github, args="--push")Analyzing changes...
Files modified:
src/utils/api.ts
tests/api.test.ts
Generated commit message:
fix: resolve API timeout error in data fetching
- Increase timeout from 5s to 30s for slow endpoints
- Add retry logic with exponential backoff
- Update test coverage for timeout scenarios
Commit created: 456789ghi
Pushed to origin/main# After updating documentation
Skill(sync_to_github)Analyzing changes...
Files modified:
README.md
docs/api.md
docs/examples.md
Generated commit message:
docs: update API documentation with new endpoints
- Add new authentication endpoint examples
- Clarify rate limiting behavior
- Fix broken links in API reference
Commit created: def123ghitools/git_sync.pygit status --porcelain
git diff --cached
git diffgit add .
git commit -m "<generated message>"git push<type>(<scope>): <subject>
<body>
<footer>featfixdocsstylerefactortestchoreperfError: No changes to commit
Working directory is clean. Make some changes before running sync_to_github.Error: Not a git repository
Initialize with: git initgit add .Warning: Commit created but push failed
Commit hash: abc123def
Error: <git error message>
Manual push required: git push.claude/settings.local.json{
"permissions": {
"allow": [
"Skill(sync_to_github)",
"Bash(python3:.claude/skills/sync_to_github/tools/*)",
"Bash(git:*)"
]
}
}# After note creation
Skill(note-creator, "Create API docs")
Skill(sync_to_github, args="--push")
# After code generation
# ... code changes ...
Skill(sync_to_github)tools/git_sync.py# Default commit types
COMMIT_TYPES = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "perf"]
# Message template
COMMIT_TEMPLATE = """{type}({scope}): {subject}
{body}
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
"""git checkout <branch>--dry-rungit config --global user.name "Your Name"
git config --global user.email "your.email@example.com"git remote -v