git-workflow
Scannednpx machina-cli add skill 0xlayerghost/solidity-agent-kit/git-workflow --openclawGit Collaboration Standards
Language Rule
- Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.
Commit Rules
Use Conventional Commits format: <type>: <short description>
| Type | When to use |
|---|---|
feat: | New feature or contract |
fix: | Bug fix |
refactor: | Code restructure without behavior change |
test: | Add or update tests |
docs: | Documentation changes |
chore: | Build config, dependency updates, toolchain |
security: | Security fix or hardening |
Commit Workflow
- Run
git diffto review all changes before staging - Stage specific files — avoid
git add .to prevent committing.envor artifacts - Write concise commit message describing the why, not the what
- Never add
Co-Authored-Bylines — commit messages should only contain the description - Only commit — never
git pushunless explicitly requested - Never push directly to main/master — always use feature branches
Branch Naming
| Pattern | Example |
|---|---|
feat/<name> | feat/staking-pool |
fix/<name> | fix/reentrancy-guard |
refactor/<name> | refactor/token-structure |
PR Requirements
Every PR must include:
| Section | Content |
|---|---|
| Change description | What was changed and why |
| Test results | forge test output (all pass) |
| Gas impact | forge test --gas-report diff for changed functions |
| Deployment impact | Does this affect deployed contracts? Migration needed? |
| Review focus | Specific areas that need careful review |
Code Review Rules
| Scenario | Requirement |
|---|---|
| Standard changes | Minimum 1 maintainer approval |
| Security-related changes | Minimum 2 maintainer approvals |
| AI-generated code | Must pass manual review + forge test before merge |
| Contract upgrades | Requires full team review + upgrade simulation on fork |
AI Assistance Rules
- AI-generated code must pass
forge testbefore committing - Always review AI output for: correct import paths, proper access control, gas implications
- Include relevant file paths and test cases in AI prompts for better results
- Run
forge fmtafter AI generates code to ensure consistent formatting
Source
git clone https://github.com/0xlayerghost/solidity-agent-kit/blob/main/skills/git-workflow/SKILL.mdView on GitHub Overview
Defines collaboration standards for git commits, PRs, and code reviews. It enforces Conventional Commits, PR templates, review requirements, and AI-assisted development rules to ensure traceable changes and reliable reviews. Triggers cover any task involving git commit, git push, PR creation, or code review.
How This Skill Works
Commits follow Conventional Commits (<type>: <short description>) with types feat, fix, refactor, test, docs, chore, security. Before staging, run git diff, stage files selectively, and write a why-focused message; never push to main and always use feature branches. PRs require a change description, test results, gas impact, deployment impact, and a clear review focus; AI-generated code must pass forge test and be formatted with forge fmt.
When to Use It
- Starting a new feature on a dedicated feature branch and preparing a concise, why-focused commit history.
- Fixing a bug in a contract or utility where changes must be clearly categorized (feat, fix, or refactor).
- Applying security hardening or vulnerability patches with proper review and test documentation.
- Preparing a PR that includes a change description, test results, gas impact, deployment impact, and review focus.
- Integrating AI-generated code or tests, ensuring it passes forge test and is reviewed for imports, access control, and gas implications.
Quick Start
- Step 1: Run git diff to review all changes before staging
- Step 2: Stage specific files (git add path/to/file) and avoid git add . to prevent env artifacts
- Step 3: Commit with a why-focused Conventional Commit message, then push only if explicitly requested
Best Practices
- Always format commits using Conventional Commits: <type>: <short description>.
- Before staging, run git diff to review changes and stage only the necessary files.
- Write the commit message to explain why the change was made, not just what changed.
- Never push directly to main/master; use feature branches and PRs.
- After AI-generated code, run forge fmt and forge test; include file paths in prompts and prompts for tests.
Example Use Cases
- feat: add staking-pool feature on feature/staking-pool and include basic tests
- fix: resolve reentrancy issue in vault contract with updated access checks
- refactor: reorganize token-structure module for clearer ownership and tests
- docs: update PR checklist template and AI guidelines in CONTRIBUTING.md
- security: patch hardening for gas-optimized access control and input validation