Get the FREE Ultimate OpenClaw Setup Guide →

git-workflow

Scanned
npx machina-cli add skill 0xlayerghost/solidity-agent-kit/git-workflow --openclaw
Files (1)
SKILL.md
2.6 KB

Git 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>

TypeWhen 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

  1. Run git diff to review all changes before staging
  2. Stage specific files — avoid git add . to prevent committing .env or artifacts
  3. Write concise commit message describing the why, not the what
  4. Never add Co-Authored-By lines — commit messages should only contain the description
  5. Only commit — never git push unless explicitly requested
  6. Never push directly to main/master — always use feature branches

Branch Naming

PatternExample
feat/<name>feat/staking-pool
fix/<name>fix/reentrancy-guard
refactor/<name>refactor/token-structure

PR Requirements

Every PR must include:

SectionContent
Change descriptionWhat was changed and why
Test resultsforge test output (all pass)
Gas impactforge test --gas-report diff for changed functions
Deployment impactDoes this affect deployed contracts? Migration needed?
Review focusSpecific areas that need careful review

Code Review Rules

ScenarioRequirement
Standard changesMinimum 1 maintainer approval
Security-related changesMinimum 2 maintainer approvals
AI-generated codeMust pass manual review + forge test before merge
Contract upgradesRequires full team review + upgrade simulation on fork

AI Assistance Rules

  • AI-generated code must pass forge test before 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 fmt after 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

  1. Step 1: Run git diff to review all changes before staging
  2. Step 2: Stage specific files (git add path/to/file) and avoid git add . to prevent env artifacts
  3. 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

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers