agentleFS
GustavoAlecioGustavoAlecio/claude-setup/skills/post-review/SKILL.md

post-review

Skill0 starsChanged 28 days agoMITView on GitHub

Fluxo Review etapa 3 — publica o review aprovado no PR do GitHub com comentarios inline e veredicto (approve/comment/request_changes) condicional aos achados.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use o helper pr-review.sh:

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

1. Detectar projeto e PR

PROJECT_PATH=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
source ~/.claude/bin/get-project.sh
PROJECT_NAME=$(get-project-name)
REVIEWS_DIR="$HOME/.claude/workflow/$PROJECT_NAME/reviews"

Se o usuario passou um numero, use como PR_NUM. Se nao, liste reviews aprovados:

for f in "$REVIEWS_DIR"/PR-*.md; do
  grep -l "^status: approved" "$f" 2>/dev/null
done

Pergunte qual publicar.

2. Validar review aprovado

Leia $REVIEWS_DIR/PR-${PR_NUM}.md. Confirme status: approved no frontmatter. Se nao, avise: "Este review nao foi aprovado. Execute /approve-review <PR_NUM> primeiro."

Leia $REVIEWS_DIR/PR-${PR_NUM}.comments.json. Confirme que existe e tem itens validos.

3. Decidir veredicto (condicional)

Conte severidades no comments.json:

critical=$(jq '[.[] | select(.severity=="critical")] | length' "$REVIEWS_DIR/PR-${PR_NUM}.comments.json")
major=$(jq    '[.[] | select(.severity=="major")] | length' "$REVIEWS_DIR/PR-${PR_NUM}.comments.json")
minor=$(jq    '[.[] | select(.severity=="minor")] | length' "$REVIEWS_DIR/PR-${PR_NUM}.comments.json")
nit=$(jq      '[.[] | select(.severity=="nit")] | length' "$REVIEWS_DIR/PR-${PR_NUM}.comments.json")
total=$((critical + major + minor + nit))

Regra de decisao:

  • critical >= 1 OU major >= 3 → REQUEST_CHANGES
  • major >= 1 OU minor >= 1 → COMMENT
  • total == 0 → APPROVE
  • Apenas nit → COMMENT

Mostre a contagem e o veredicto escolhido. Pergunte: "Veredicto: <verdict>. Confirma publicacao? (sim/nao)" — espere confirmacao.

4. Publicar review

Use o helper pr-review.sh:

bash ~/.claude/bin/pr-review.sh "$PR_NUM" "$REVIEWS_DIR/PR-${PR_NUM}.comments.json" "<VERDICT>" "$REVIEWS_DIR/PR-${PR_NUM}.md"

O helper:

  1. Le o comments.json
  2. Le o body do review do markdown (secao "## Resumo" + "## Veredicto sugerido" como summary)
  3. Faz gh pr view --json baseRefOid,headRefOid,number,headRepository para obter o commit SHA do head
  4. Monta payload JSON da API GitHub Reviews (event + body + comments[] com path/line/body/side)
  5. POST repos/:owner/:repo/pulls/:pr/reviews

Se algum comentario falhar (ex: linha fora do diff), o helper reporta quais nao foram publicados — voce decide se publica os restantes ou aborta.

5. Atualizar status local

Apos publicacao com sucesso, atualize o frontmatter de PR-${PR_NUM}.md:

  • status: published
  • published_at: <ISO timestamp>
  • verdict: <VERDICT>
  • review_id: <id retornado pela API>

6. Finalizar

Apresente:

  • URL do review: gh pr view <PR_NUM> --json url --jq .url
  • Veredicto publicado
  • Total de comentarios inline publicados (vs falhas)

Mensagem: "Review #<PR_NUM> publicado como <VERDICT> com N comentarios inline."

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.