aprimoração de ia
This commit is contained in:
parent
1177e31e56
commit
4a9f5f70ff
109 changed files with 8835 additions and 55 deletions
|
|
@ -1,75 +0,0 @@
|
|||
---
|
||||
type: rule
|
||||
name: proibido-commit-ia
|
||||
description: A IA nunca pode executar git commit, git push ou qualquer operação que altere o histórico do repositório
|
||||
scope: global
|
||||
trigger: always_on
|
||||
updatedAt: "2026-06-19"
|
||||
---
|
||||
|
||||
# Regra: Proibido Commit pela IA
|
||||
|
||||
## Contexto
|
||||
|
||||
O controle de versão é responsabilidade exclusiva do usuário humano. A IA pode preparar alterações, criar arquivos, editar código e até sugerir mensagens de commit — mas NUNCA deve executar comandos que alterem o histórico do repositório.
|
||||
|
||||
## Regra
|
||||
|
||||
A IA **NUNCA** deve executar os seguintes comandos (nem variações deles):
|
||||
|
||||
- `git commit`
|
||||
- `git push`
|
||||
- `git merge`
|
||||
- `git rebase`
|
||||
- `git tag`
|
||||
- `git reset`
|
||||
- `git revert`
|
||||
- `git cherry-pick`
|
||||
- `git stash drop`
|
||||
- `git branch -d` / `git branch -D`
|
||||
|
||||
### Comandos permitidos (somente leitura e staging)
|
||||
|
||||
- `git status` ✅
|
||||
- `git diff` ✅
|
||||
- `git log` ✅
|
||||
- `git add` ✅ (preparar alterações para o usuário revisar)
|
||||
- `git stash` / `git stash pop` ✅ (preservar trabalho temporário)
|
||||
- `git branch` (listar) ✅
|
||||
- `git ls-files` ✅
|
||||
- `git show` ✅
|
||||
|
||||
## Exemplos
|
||||
|
||||
❌ **Errado** — commitar automaticamente:
|
||||
```sh
|
||||
git add -A && git commit -m "fix: corrigir bug"
|
||||
```
|
||||
|
||||
❌ **Errado** — push automático:
|
||||
```sh
|
||||
git push origin main
|
||||
```
|
||||
|
||||
✅ **Correto** — preparar e informar:
|
||||
```sh
|
||||
git add -A
|
||||
git status
|
||||
# Informar ao usuário: "Alterações staged. Revise e faça o commit quando estiver pronto."
|
||||
```
|
||||
|
||||
✅ **Correto** — sugerir mensagem de commit:
|
||||
```
|
||||
Sugestão de commit:
|
||||
git commit -m "feat: adicionar validação de schema no endpoint /usuarios"
|
||||
```
|
||||
|
||||
## Impacto
|
||||
|
||||
- **Segurança:** o usuário mantém controle total sobre o que entra no histórico
|
||||
- **Revisão:** toda alteração pode ser inspecionada antes de ser commitada
|
||||
- **Reversibilidade:** evita commits acidentais que poluem o histórico
|
||||
|
||||
## Referências
|
||||
|
||||
- Princípio de autonomia controlada: a IA executa, o humano decide
|
||||
Loading…
Add table
Add a link
Reference in a new issue