melhorias na ia

This commit is contained in:
Luiz Silva 2026-07-01 13:47:39 -03:00
parent 62170f1e38
commit 993252c49b
46 changed files with 4428 additions and 101 deletions

View file

@ -1,18 +1,13 @@
#!/usr/bin/env sh
# comando sh ../.agent/verificar-linhas.sh [diretorio] || exit 1
# comando sh ../.agent/verificar-linhas.sh || exit 1
LIMITE=250
ALVO="${1:-.}"
if [ ! -d "$ALVO" ]; then
printf "❌ Erro: Diretório alvo '%s' não encontrado.\n" "$ALVO"
exit 1
fi
RAIZ=$(cd "$(dirname "$0")/.." && pwd)
RESULTADO=$(
find "$ALVO" \
find "$RAIZ" \
-type d \( \
-name node_modules -o \
-name .git -o \
@ -29,7 +24,8 @@ RESULTADO=$(
-print | while IFS= read -r arquivo; do
linhas=$(wc -l < "$arquivo" | tr -d ' ')
if [ "$linhas" -gt "$LIMITE" ]; then
printf "%5s linhas -> %s\n" "$linhas" "$arquivo"
relativo="${arquivo#$RAIZ/}"
printf "%5s linhas -> %s\n" "$linhas" "$relativo"
fi
done
)
@ -38,7 +34,7 @@ if [ -n "$RESULTADO" ]; then
echo "$RESULTADO"
VIOLACOES=$(printf '%s\n' "$RESULTADO" | wc -l | tr -d ' ')
printf "\n❌ %s arquivo(s) violam o limite de %s linhas.\n" "$VIOLACOES" "$LIMITE"
printf "\n Resolva usando @ag-refatorar\n\n"
printf "\n Resolva usando o arquivo: .agent/workflows/otimizar-codigos.global.md\n"
exit 1
fi