Git Workflow
RNCopilot enforces a consistent git workflow with conventional commits, descriptive branch names, and automated pre-commit checks.
Commit Message Format
Every commit follows the conventional commit format:
<type>(<scope>): <subject>Types
| Type | When to Use |
|---|---|
feat | A new feature |
fix | A bug fix |
docs | Documentation changes only |
style | Formatting, whitespace (no code logic change) |
refactor | Code restructuring without changing behavior |
perf | Performance improvement |
test | Adding or updating tests |
build | Build system or dependency changes |
ci | CI/CD configuration changes |
chore | Maintenance tasks (upgrades, config tweaks) |
revert | Reverting a previous commit |
Scope
The scope describes the feature or area being changed. Common scopes:
auth, button, card, theme, i18n, api, storage, settings, navigation, deps
Examples
feat(auth): add forgot password screen
fix(button): correct disabled state color in dark mode
docs(conventions): add i18n section
test(button): add accessibility tests
refactor(api): extract error normalization to helper
chore(deps): upgrade expo-router to 5.x
perf(list): virtualize product listing scrollKeep the subject line under 72 characters. Use the imperative mood (“add”, “fix”, “update”), not past tense (“added”, “fixed”).
Branch Naming
<type>/<short-description>| Pattern | Example |
|---|---|
feat/<description> | feat/product-listing |
fix/<description> | fix/rtl-badge-layout |
chore/<description> | chore/upgrade-expo-55 |
Use lowercase and hyphens. Keep descriptions short but descriptive.
Pre-Commit Checks
The project uses Husky to run npm run validate before every commit. This runs three checks:
- TypeScript type-check —
npm run type-check - ESLint —
npm run lint - Prettier format check —
npm run format:check
All three must pass for the commit to succeed.
# Run manually before committing to catch issues early
npm run validateIf the pre-commit hook fails, fix the reported issues and try again. Do not bypass the hook with --no-verify.
Workflow Summary
- Create a branch from
mainusing the naming convention above. - Make changes, keeping commits small and focused.
- Write commit messages in the conventional format.
- Run
npm run validatebefore committing (or let Husky run it for you). - Push and open a pull request against
main.