Always start by syncing with main:
git checkout main
git pull origin mainCreate feature branch using standardized naming convention:
git checkout -b feature/issue-123-add-new-feature
git checkout -b bugfix/issue-456-fix-simulator-crashBefore committing, ALWAYS run quality checks:
npm run build # Ensure code compiles
npm run typecheck # MANDATORY: Fix all TypeScript errors
npm run lint # Fix linting issues
npm run test # Ensure tests pass🚨 CRITICAL: TypeScript errors are BLOCKING:
- ZERO tolerance for TypeScript errors in commits
- The
npm run typecheckcommand must pass with no errors - Fix all
ts(XXXX)errors before committing - Do not ignore or suppress TypeScript errors without explicit approval
Make logical, atomic commits:
- Each commit should represent a single logical change
- Write short, descriptive commit summaries
- Commit frequently to your feature branch
# Always run quality checks first
npm run typecheck && npm run lint && npm run test
# Then commit your changes
git add .
git commit -m "feat: add simulator boot validation logic"
git commit -m "fix: handle null response in device list parser"🚨 CRITICAL: Always ask permission before pushing
- NEVER push without explicit user permission
- NEVER force push without explicit permission
- Pushing without permission is a fatal error resulting in termination
# Only after getting permission:
git push origin feature/your-branch-nameUse GitHub CLI tool exclusively:
gh pr create --title "feat: add simulator boot validation" --body "$(cat <<'EOF'
## Summary
Brief description of what this PR does and why.
## Background/Details
### For New Features:
- Detailed explanation of the new feature
- Context and requirements that led to this implementation
- Design decisions and approach taken
### For Bug Fixes:
- **Root Cause Analysis**: Detailed explanation of what caused the bug
- Specific conditions that trigger the issue
- Why the current code fails in these scenarios
## Solution
- How the root cause was addressed
- Technical approach and implementation details
- Key changes made to resolve the issue
## Testing
- **Reproduction Steps**: How to reproduce the original issue (for bugs)
- **Validation Method**: How you verified the fix works
- **Test Coverage**: What tests were added or modified
- **Manual Testing**: Steps taken to validate the solution
- **Edge Cases**: Additional scenarios tested
## Notes
- Any important considerations for reviewers
- Potential impacts or side effects
- Future improvements or technical debt
- Deployment considerations
EOF
)"After PR creation, add automated review trigger:
gh pr comment --body "Cursor review"Keep branch up to date with main:
git checkout main
git pull origin main
git checkout your-feature-branch
git rebase mainIf rebase creates conflicts:
- Resolve conflicts manually
git add .resolved filesgit rebase --continue- Ask permission before force pushing rebased branch
Only merge via Pull Requests:
- No direct merges to
main - Maintain linear commit history through rebasing
- Use "Squash and merge" or "Rebase and merge" as appropriate
- Delete feature branch after successful merge
Every PR must include these sections in order:
- Summary: Brief overview of changes and purpose
- Background/Details:
- New Feature: Requirements, context, design decisions
- Bug Fix: Detailed root cause analysis
- Solution: Technical approach and implementation details
- Testing: Reproduction steps, validation methods, test coverage
- Notes: Additional considerations, impacts, future work
- NEVER push to
maindirectly - NEVER push without explicit user permission
- NEVER force push without explicit permission
- NEVER commit code with TypeScript errors
- Always pull from
mainbefore creating branches - MANDATORY: Run
npm run typecheckbefore every commit - MANDATORY: Fix all TypeScript errors before committing
- Use
ghCLI tool for all PR operations - Add "Cursor review" comment after PR creation
- Maintain linear commit history via rebasing
- Ask permission before any push operation
- Use standardized branch naming conventions
feature/issue-xxx-description- New featuresbugfix/issue-xxx-description- Bug fixeshotfix/critical-issue-description- Critical production fixesdocs/update-readme- Documentation updatesrefactor/improve-error-handling- Code refactoring
Our GitHub Actions CI pipeline automatically enforces these quality checks:
npm run build- Compilation checknpm run lint- ESLint validationnpm run format:check- Prettier formatting checknpm run typecheck- TypeScript error validationnpm run test- Test suite execution
All checks must pass before PR merge is allowed.
To catch TypeScript errors before committing locally:
# Create pre-commit hook
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/sh
echo "🔍 Running pre-commit checks..."
# Run TypeScript type checking
echo "📝 Checking TypeScript..."
npm run typecheck
if [ $? -ne 0 ]; then
echo "❌ TypeScript errors found. Please fix before committing."
exit 1
fi
# Run linting
echo "🧹 Running linter..."
npm run lint
if [ $? -ne 0 ]; then
echo "❌ Linting errors found. Please fix before committing."
exit 1
fi
echo "✅ Pre-commit checks passed!"
EOF
# Make it executable
chmod +x .git/hooks/pre-commitThis hook will automatically run typecheck and lint before every commit, preventing TypeScript errors from being committed.