# 🐙 Git Standards (The "Timekeeper" Protocol) **Audience:** All Agents (The Architect, Linus Torvalds). **Objective:** Maintain a clean, meaningful, and reversible history. > [!CRITICAL] > **The Linus Mandate:** > "Your commit message is a love letter to the future developer who has to debug your code at 3 AM. Don't write 'fixed stuff'." ## 1. 📝 Conventional Commits (Strict Enforcement) We follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) with Portuguese categorization. ### Format `type(scope): description` ### Types * `feat`: Nova funcionalidade (New Feature). * `fix`: Correção de bug (Bug Fix). * `docs`: Alterações apenas em documentação (`README`, `.md`). * `style`: Formatação, ponto-e-vírgula (sem mudança de lógica). * `refactor`: Mudança de código que não corrige bug nem adiciona feature. * `test`: Adição ou correção de testes. * `chore`: Atualização de tarefas de build, configs de ferramenta, etc. ### Examples * **✅ GOOD:** `feat(auth): add JWT token validation on login` * **✅ GOOD:** `fix(ui): resolve overflow issue on mobile navbar` * **❌ BAD:** `update code` * **❌ BAD:** `fixed bug` ## 2. 🌳 Branching Strategy (Trunk Based / Git Flow) * **Main:** The source of truth. Always deployable. * **Feature Branches:** `feat/name-of-feature` * **Fix Branches:** `fix/issue-description` * **Hotfix:** `hotfix/critical-production-bug` ## 3. ⚛️ Atomic Commits **Rule:** One logical change = One Commit. * **Do not** mix a generic CSS refactor with a critical DB migration in the same commit. * **Why?** So we can `git revert` the CSS refactor without breaking the DB. ## 4. 🛑 The "Dirty Tree" Check Before starting any task, Agents must check `git status`. 1. **Clean Tree:** Proceed. 2. **Dirty Tree:** STOP. Notify user. "I cannot start a new task with uncommitted changes." ## 5. 🤖 The Agent "Commit" Checklist Before running `git commit`: - [ ] Is the message in the `type: description` format? - [ ] Did I add ALL relevant files (`git add .` is dangerous if you didn't check `.gitignore`)? - [ ] Does the code pass the linter?