commit-msg: commands: conventional: run: | msg=$(head -1 {1}) if [[ ! "$msg" =~ ^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\(.+\))?\!?:\ .+ ]]; then echo "Commit message must follow Conventional Commits format:" echo " (): " echo " Types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert" echo "" echo "Examples:" echo " feat(auth): add OAuth2 support" echo " fix: resolve null pointer exception" exit 1 fi pre-commit: commands: biome-check: root: "packages/browseros-agent/" glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}" run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files} stage_fixed: true file-length: root: "packages/browseros-agent/" glob: "*.{ts,tsx}" exclude: "*.{test,spec,d}.ts|*.{test,spec}.tsx|**/__tests__/**|**/tests/**|**/*.generated.*" run: | for file in {staged_files}; do if [[ -f "$file" ]]; then lines=$(wc -l < "$file" | tr -d ' ') if [[ $lines -gt 400 ]]; then echo "⚠️ Warning: $file has $lines lines (threshold: 400)" echo " Consider splitting this file if it has multiple responsibilities." fi fi done pre-push: commands: branch-name: run: | branch=$(git rev-parse --abbrev-ref HEAD) if [[ "$branch" == "main" || "$branch" == "master" ]]; then exit 0 fi if [[ ! "$branch" =~ ^(feat|fix|bugfix|hotfix|release|docs|refactor|test|chore|experiment)/[a-z0-9-]+$ ]]; then echo "⚠️ Warning: Branch name '$branch' doesn't match recommended format." echo " Use: /" echo " Types: feat, fix, bugfix, hotfix, release, docs, refactor, test, chore, experiment" echo " Example: feat/add-auth, fix/login-crash" echo "" echo " To rename your branch:" echo " git branch -m " echo " git push -u origin " fi