32 lines
865 B
Python
32 lines
865 B
Python
# .agent/tools/validate_plan.py
|
|
import sys
|
|
import os
|
|
|
|
REQUIRED_SECTIONS = [
|
|
"# [Descrição do Objetivo]",
|
|
"## Análise de Risco",
|
|
"## Mudanças Propostas",
|
|
"## Plano de Verificação"
|
|
]
|
|
|
|
def validate(file_path):
|
|
if not os.path.exists(file_path):
|
|
return "❌ Erro: implementation_plan.md não encontrado."
|
|
|
|
with open(file_path, 'r', encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
missing = []
|
|
for section in REQUIRED_SECTIONS:
|
|
if section not in content:
|
|
missing.append(section)
|
|
|
|
if missing:
|
|
return f"❌ REJEITADO. Faltam as seções obrigatórias: {', '.join(missing)}"
|
|
|
|
return "✅ APROVADO. O plano segue a estrutura correta."
|
|
|
|
if __name__ == "__main__":
|
|
target = "implementation_plan.md" # Padrão
|
|
if len(sys.argv) > 1: target = sys.argv[1]
|
|
print(validate(target)) |