challenge-spec
Skill0 starsChanged 27 days agoMITView on GitHub
Etapa 1b do Fluxo Smart — ataca a spec aprovada antes do /plan (critérios não verificáveis, regras ausentes, contradições com o código) via subagent spec-challenger e aplica as correções aceitas.
In this repository28 other files it gives its agents.
- ado-closeSkill
- ado-commentSkill
- ado-getSkill
- ado-refineSkill
- adrSkill
- approve-reviewSkill
- appSkill
- autoSkill
- completeSkill
- dart-clean-archSkill
- discoverySkill
- fixSkill
- flutter-clean-archSkill
- implementSkill
- jira-refineSkill
- kickoffSkill
- linear-refineSkill
- orcamentoSkill
- planSkill
- post-reviewSkill
- pr-openSkill
- pr-statusSkill
- refineSkill
- reviewSkill
- specifySkill
- statusSkill
- tasksSkill
- verifySkill
The file
Files
1. Detectar projeto
PROJECT_PATH=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
source ~/.claude/bin/get-project.sh
PROJECT_NAME=$(get-project-name)
WF_DIR="$HOME/.claude/workflow/$PROJECT_NAME"2. Pré-requisito
Leia $WF_DIR/spec.md. Se não existir, peça /specify primeiro.
Relatório: início da etapa
python3 ~/.claude/bin/wf-report.py stage-start challenge --workflow-dir "$WF_DIR" ${CLAUDE_FLOW_SESSION_ID:+--session "$CLAUDE_FLOW_SESSION_ID"} || true3. Desafiar
Spawne o subagent spec-challenger (Agent tool, subagent_type: spec-challenger) com: caminho da spec, PROJECT_PATH, e o caminho de docs/adr/INDEX.md, .claude/rules/ do repo e do mapa da org (.map/index.md no repo ou numa pasta acima) se existirem. Não resuma a spec no prompt — ele lê.
4. Apresentar e aplicar
Mostre o relatório do agente sem reescrever.
- OK → registre
"challenge": {"verdict": "ok"}nocurrent.jsone siga. - AJUSTES / BLOQUEANTE → pergunte quais itens aplicar (por id: B1, A2…). Aplique os escolhidos direto na
spec.md, incluindo os critérios reescritos. Registre"challenge": {"verdict": "<v>", "applied": [...], "rejected": [...]}.
Registre os achados (nunca interpole texto em shell): escreva com Write em $WF_DIR/.findings.json um objeto {"accepted": [...], "rejected": [...]} com {"id": "B1", "text_md": "..."} por item (listas vazias se o veredito foi OK) e rode:
python3 ~/.claude/bin/wf-report.py findings challenge --workflow-dir "$WF_DIR" --source spec-challenger --file "$WF_DIR/.findings.json" || trueRelatório: fim da etapa. Escreva com Write um resumo de 3 a 10 linhas em $WF_DIR/.stage-summary.md (nunca interpole texto em shell) e rode:
python3 ~/.claude/bin/wf-report.py stage-end challenge --workflow-dir "$WF_DIR" --summary-file "$WF_DIR/.stage-summary.md" || true5. Parada incondicional e gate spec
test -f ~/.claude/workflow/auto_mode.flag && echo "AUTO_ON" || echo "AUTO_OFF"- Veredito BLOQUEANTE (com auto on ou off): parada incondicional, fora do
gates.json. Bloqueante significa que a spec contradiz o código ou o critério central não é verificável; não é decisão automatizável. Faça umAskUserQuestioncom as opções "Aplicar os ajustes propostos (Recommended)", "Voltar ao/specify" e "Abortar", e só siga ao gate abaixo depois de resolvido. AUTO_ONe veredito OK ou AJUSTES: aplique todos os ajustes e os critérios reescritos.
Gate spec (decisão determinística; nunca leia gates.json):
python3 ~/.claude/bin/wf-report.py gate specskip: atualizestatuspara"spec_approved"nocurrent.json, informe em 1 linha e execute/plan.ask: ostage-endacima já rodou; faça umAskUserQuestion("Spec aprovada para planejar?") com as opções:- Aprovar (Recommended): atualize
statuspara"spec_approved"nocurrent.json, execute/planna mesma sessão. - Ajustar: o usuário escreve o ajuste em Other; aplique o texto e repita este mesmo gate.
- Rejeitar: rode
stage-end challenge --status blocked(mesmo--summary-file), mantenha ostatusdocurrent.jsone encerre o turno.
- Aprovar (Recommended): atualize
- A resposta do usuário vira decisão: escreva-a com Write em
$WF_DIR/.decision.mde rodepython3 ~/.claude/bin/wf-report.py decision challenge --workflow-dir "$WF_DIR" --by user --text-file "$WF_DIR/.decision.md" || true.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

