PR and Commit Conventions in OpenClaw
This document captures observations about OpenClaw's git workflow, PR templates, and pre-commit hooks based on analysis of the repository. These conventions ensure PRs are reviewable, secure, and properly documented.
Commit Format: Conventional Commits
OpenClaw uses Conventional Commits with scopes.
Format
Common Types
fix- Bug fixesfeat- New featuresrefactor- Code refactoring (no behavior change)docs- Documentation changestest- Test additions or fixeschore- Build, CI, or tooling changesperf- Performance improvementssecurity- Security fixes
Common Scopes
Based on git history analysis:
- Platform integrations:
android,ios,macos,telegram,slack,discord - Core systems:
gateway,agents,config,skills,sandbox,memory - UI:
ui,control-ui - Infrastructure:
ci,cd,build,deps - Security:
security,auth,secrets
Examples
PR Template Requirements
The PR template is in .github/pull_request_template.md and requires specific sections.
Required Sections
1. Summary (2-5 bullets)
Explain:
- Problem: What issue this PR addresses
- Why: Why this change is needed
- What changed: High-level description of changes
- Scope boundary: What's in scope vs out of scope
Example:
2. Change Type (checkboxes)
3. Scope (checkboxes)
4. Security Impact (REQUIRED)
Critical section - Must be completed for every PR.
5. Repro + Verification
6. Evidence
7. Human Verification (REQUIRED)
Critical section - Explain what you personally verified.
8. Compatibility/Migration
9. Failure Recovery
Pre-Commit Hooks
Pre-commit hooks are configured in .pre-commit-config.yaml and installed via prek install.
Installation
Note: OpenClaw uses prek (not standard pre-commit).
Hook Pipeline
The hooks run in this order:
1. Basic Checks
- Trailing whitespace removal
- End-of-file fixer
- Merge conflict detection
2. Secret Detection
detect-secretswith baseline (.secrets.baseline)- Prevents accidental API key, token, or password commits
3. Shell Linting
shellcheckfor shell scripts- Enforces shell script best practices
4. GitHub Actions Linting
actionlintfor workflow syntaxzizmorfor security issues in Actions
5. Python Checks (for skills)
rufffor linting and formattingpytestfor Python skills tests
6. Dependency Audit
pnpm auditfor production dependencies- Fails on high-severity vulnerabilities
7. TypeScript Linting and Formatting
oxlint(NOT ESLint)oxfmt(NOT Prettier)
8. Swift Checks (for macOS/iOS)
swiftlintfor Swift lintingswiftformatfor Swift formatting
Bypassing Hooks (NOT RECOMMENDED)
Warning: Only bypass hooks if you have a specific reason and understand the risks.
Changelog Conventions
Changelog updates are in CHANGELOG.md at the repository root.
Format
Guidelines
- User-facing only - Don't include internal refactors unless they affect users
- Credit contributors - Use
(thanks @username)for external contributions - Group by type - "Changes" for features, "Fixes" for bug fixes
- Use conventional commit format - Same format as commit messages
Example
Git Workflow Summary
Why This Matters
Following these conventions ensures:
- Reviewability - PRs contain all necessary context for reviewers
- Security - Pre-commit hooks catch secrets and security issues
- Consistency - Conventional commits make history searchable
- Documentation - Changelog accurately reflects user-facing changes
- CI reliability - Pre-commit hooks catch issues before CI runs
Cross-References
- Code Style Conventions: Oxlint and Oxfmt rules enforced by pre-commit hooks
- Testing Patterns: Test requirements for PRs
- Build Failures Troubleshooting (planned): Solutions for CI failures