1k-git-workflow
OneKey Git Usage Guidelines
Branch Management
- Main branch:
x- This is the primary development branch - Workflow:
x→ create feature branch → develop → PR back tox - Do not use
onekey,master, ormainas the base branch - always usex - NEVER work directly on the
xbranch → ALWAYS create feature branches
Branch Naming
- Feature branches:
feat/descriptionorfeature/description - Bug fixes:
fix/description - Refactoring:
refactor/description
Commit Message Format
Use Conventional Commits format:
feat:- New featuresfix:- Bug fixesrefactor:- Code refactoringperf:/optimize:- Performance improvementschore:- Build, version, or non-code changesdocs:- Documentation only
Format: type: short description
- Use lowercase
- Keep first line under 72 characters
- Include issue number if applicable:
fix: resolve login bug OK-12345
IMPORTANT - Claude Code commits:
- Do NOT include "Generated with Claude Code" link
- Do NOT include "Co-Authored-By: Claude" signature
- Commit message should be indistinguishable from human-written commits
PR Naming Convention
Follow the same format as commit messages:
feat: add dark mode supportfix: resolve authentication timeout issuerefactor: simplify payment processing logic
Common Git Commands
Creating a Feature Branch
git checkout x
git pull origin x
git checkout -b feat/my-new-feature
Committing Changes
Option 1: Use /commit command (Recommended)
/commit
The /commit command automatically runs pre-commit checks (yarn lint:staged and yarn tsc:staged) and creates a well-formatted commit message.
Option 2: Manual commit with pre-checks
# Stage your changes
git add .
# Run pre-commit checks (MANDATORY)
yarn lint:staged
yarn tsc:staged
# If checks pass, commit
git commit -m "feat: add user profile page"
IMPORTANT:
- NEVER commit code that fails linting or TypeScript compilation
- Pre-commit checks are mandatory as specified in CLAUDE.md
- The
/commitcommand handles this automatically
Pushing and Creating PR
git push -u origin feat/my-new-feature
# Then create PR via GitHub UI or gh CLI
Rebasing on Latest x
git fetch origin
git rebase origin/x
More from onekeyhq/app-monorepo
react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
109implementing-figma-designs
Implements Figma designs 1:1 using OneKey component library (还原设计稿).
771k-coding-patterns
Coding patterns and best practices — React components, promise handling, and TypeScript conventions.
691k-date-formatting
Date and time formatting — use OneKey dateUtils (formatDate/formatTime) instead of native JS date methods.
681k-code-quality
Code quality standards — lint (eslint/oxlint), type check (tsc), pre-commit hooks, and comment conventions. All comments must be in English.
671k-i18n
Internationalization — translations (ETranslations, useIntl, formatMessage) and locale management. NEVER modify auto-generated translation files.
67