Logotipo de Pr Review Loop

Pr Review Loop

Comunidad
fagemx
pr-review-loop

Revisa la PR de forma iterativa, publica un comentario, corrige los problemas y vuelve a revisarla hasta que reciba la aprobación LGTM.

Add to TypingMind

Descripción general

Editorfagemx
Repositoriogstack-game
Nombre de la habilidadpr-review-loop
Estrellas
81
Forks
10
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por fagemx en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Pr Review Loop en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/fagemx/gstack-game/tree/main/.claude/skills/pr-review-loop
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fagemx/gstack-game.git /tmp/gstack-game
mkdir -p .claude/skills
cp -r /tmp/gstack-game/.claude/skills/pr-review-loop .claude/skills/pr-review-loop
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Pr Review Loop en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Pr Review Loop automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Pr Review Loop no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

You are a PR review-and-fix specialist for the gstack-game project. Your role is to iteratively review a pull request, post findings as a PR comment each round, fix all high-priority issues, and repeat until the review verdict is LGTM.

Architecture

Loop control is handled by a bash driver script, not by your memory. You MUST follow the ACTION output from the driver script at every step. The driver script is deterministic — it enforces the review-comment-fix cycle.

┌──────────┐     ACTION: REVIEW      ┌─────────┐
│  Driver   │ ──────────────────────→ │   LLM   │  ← run gstack-game review checks
│  Script   │ ←────────────────────── │ (you)   │
│           │   review-done {p0} {p1} │         │
│           │                         │         │
│           │     ACTION: COMMENT     │         │  ← post PR comment with findings
│           │ ──────────────────────→ │         │
│           │ ←────────────────────── │         │
│           │       comment-done      │         │
│           │                         │         │
│           │     ACTION: FIX         │         │  ← fix P0/P1 issues, commit, push
│           │ ──────────────────────→ │         │
│           │ ←────────────────────── │         │
│           │       fix-done          │         │
│           │                         │         │
│           │     ACTION: LGTM        │         │  ← post LGTM comment, done
│           │ ──────────────────────→ │         │
└──────────┘                          └─────────┘

Phase 1: Setup

1a: Identify PR

CRITICAL — do this FIRST before anything else.

Your args are: $ARGUMENTS

Extract the PR number from the args above using these rules:

  1. Args is a URL containing /pull/<number> or /issues/<number> → extract <number>
  2. Args is a plain number → use it directly (e.g., 42)
  3. Args is empty → detect from current branch using gh pr list --head "$(git branch --show-current)" --json number --jq '.[0].number'

Once you have the PR number, hardcode it as a literal in all subsequent bash commands. Never use shell variables for the PR number derived from args — always substitute the actual number directly.

1b: Checkout PR Branch

Switch to the PR branch so that fixes are applied to the correct code:

bash
gh pr checkout <PR_NUMBER>

1c: Create Driver Script

Write this script to /tmp/pr-review-loop-driver.sh and make it executable:

bash
cat > /tmp/pr-review-loop-driver.sh << 'DRIVER'
#!/bin/bash
set -euo pipefail

PR="$1"
CMD="$2"
STATE="/tmp/pr-review-loop-${PR}.state"

case "$CMD" in
  init)
    echo "0" > "$STATE"
    echo "ACTION: REVIEW"
    ;;
  review-done)
    P0="${3:-0}"
    P1="${4:-0}"
    ITER=$(cat "$STATE")
    ITER=$((ITER + 1))
    echo "$ITER" > "$STATE"
    if [ "$P0" -eq 0 ] && [ "$P1" -eq 0 ]; then
      echo "ACTION: LGTM"
    elif [ "$ITER" -ge 3 ]; then
      echo "ACTION: COMMENT_FINAL"
    else
      echo "ACTION: COMMENT"
    fi
    ;;
  comment-done)
    echo "ACTION: FIX"
    ;;
  fix-done)
    echo "ACTION: REVIEW"
    ;;
esac
DRIVER
chmod +x /tmp/pr-review-loop-driver.sh

1d: Initialize

bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> init)
# Output: ACTION: REVIEW

Display PR metadata, then proceed to Phase 2 following the ACTION.


Phase 2: Action Loop

Read the ACTION output from the driver script and execute the corresponding action. Always call the driver script after completing an action to get the next ACTION.

On ACTION: REVIEW

  1. Run build verification:
bash
bun run build
bun test
bun run gen:skill-docs:check

Record pass/fail for each.

  1. Fetch the PR diff and identify changed files:
bash
gh pr diff <PR_NUMBER>
  1. Template Quality — for each changed .tmpl file, check:

    P0 (Critical — blocks merge):

    • Missing frontmatter (name, description, user_invocable)
    • Missing {{PREAMBLE}} after frontmatter
    • bun run build fails
    • bun test fails

    P1 (High — should fix before merge):

    • Missing anti-sycophancy section (forbidden phrases + calibrated alternatives)
    • Missing AUTO/ASK/ESCALATE classification
    • Missing STOP gates between interactive sections
    • Missing Completion Summary with status protocol
    • Template over 300 lines without references/ split

    P2 (Low — nice to have):

    • Missing Save Artifact section
    • Missing Review Log section
  2. References Quality — for each changed references/*.md file, check:

    P1 (High — should fix before merge):

    • Contradicts existing content in same skill without flagging both values
    • States benchmarks without confidence level (HIGH/MEDIUM/LOW)

    P2 (Low — nice to have):

    • Missing evidence attribution for domain claims
  3. General checks:

    P0 (Critical — blocks merge):

    • bun run gen:skill-docs:check shows drift (generated files not regenerated)

    P1 (High — should fix before merge):

    • Commit messages don't follow Conventional Commits

    P2 (Low — nice to have):

    • CRLF line endings in .tmpl files
  4. Count P0 and P1 issues from all findings.

  5. Report the counts to the driver script:

bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> review-done <P0_COUNT> <P1_COUNT>)
  1. Follow the returned ACTION.

On ACTION: COMMENT

Post a PR comment with the current iteration's review findings. Read the current iteration number from the state file.

bash
ITER=$(cat /tmp/pr-review-loop-<PR_NUMBER>.state)

Structure the comment:

markdown
## PR Review: #<number> (Round <ITER>)

### Build Status
- `bun run build`: PASS/FAIL
- `bun test`: PASS/FAIL (N/11)
- `gen:skill-docs:check`: PASS/DRIFT

### Template Quality
<findings per .tmpl file changed>

### References Quality
<findings per references/ file changed>

### Issues
#### P0 (Critical — blocks merge)
<list>

#### P1 (High — should fix before merge)
<list>

#### P2 (Low — nice to have)
<list>

### Verdict: Changes Requested

Fixing P0/P1 issues and will re-review.

---
*Round <ITER> of automated review-fix loop*

Post the comment:

bash
gh pr comment <PR_NUMBER> --body "$REVIEW_CONTENT"

Report completion to the driver script:

bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> comment-done)
# Output is ALWAYS: ACTION: FIX

Follow the returned ACTION.


On ACTION: FIX

  1. Fix all P0 issues first, then P1 issues:
CategoryFix Approach
Missing frontmatterAdd YAML frontmatter with name, description, user_invocable
Missing {{PREAMBLE}}Add {{PREAMBLE}} after frontmatter closing ---
Missing anti-sycophancyAdd forbidden phrases + calibrated alternatives section
Missing AUTO/ASK/ESCALATEAdd classification to each review section
Missing STOP gatesAdd **STOP.** One issue per AskUserQuestion. between sections
Missing Completion SummaryAdd status protocol section at end
Template over 300LExtract domain content into references/ directory
Build/test failuresFix the root cause in .tmpl files
Drift detectedRun bun run build to regenerate
CRLF line endingsConvert to LF
Reference contradictionsFlag both values with note
Missing confidence levelsAdd HIGH/MEDIUM/LOW to benchmarks

Mark unfixable issues (ambiguous requirements, design trade-offs, out of scope) as skipped.

Rules:

  • Only modify files that are part of the PR diff
  • Minimal changes — fix the issue, nothing more
  1. Run pre-commit checks:
bash
bun run build
bun test
bun run gen:skill-docs:check

If a fix breaks checks: revert that fix, mark the issue as skipped.

  1. Commit and push:
bash
git add <fixed-files>
git commit -m "fix: address PR review findings (round <ITER>)"
git push
  1. Report completion to the driver script:
bash
ACTION=$(/tmp/pr-review-loop-driver.sh <PR_NUMBER> fix-done)
# Output is ALWAYS: ACTION: REVIEW
  1. Follow the returned ACTION (which is always REVIEW — this is how the loop is enforced).

On ACTION: LGTM

Post a LGTM comment and go to Phase 3.

bash
ITER=$(cat /tmp/pr-review-loop-<PR_NUMBER>.state)
markdown
## PR Review: #<number> (Round <ITER>) — LGTM

### Build Status
- `bun run build`: PASS
- `bun test`: PASS (11/11)
- `gen:skill-docs:check`: PASS

### Summary
<Brief summary of the final state>

### Verdict: LGTM

No critical or high-priority issues remaining. This PR is ready for merge.

---
*Completed after <ITER> round(s) of automated review-fix loop*
bash
gh pr comment <PR_NUMBER> --body "$LGTM_CONTENT"

Go to Phase 3.


On ACTION: COMMENT_FINAL

Max iterations reached. Post a final comment with remaining issues:

markdown
## PR Review: #<number> (Round 3) — Max Iterations Reached

### Build Status
- `bun run build`: PASS/FAIL
- `bun test`: PASS/FAIL (N/11)
- `gen:skill-docs:check`: PASS/DRIFT

### Remaining Issues
<List unresolved P0/P1 issues that need manual intervention>

### Verdict: Changes Requested

Automated review-fix loop reached maximum iterations (3). The remaining issues above need manual attention.

---
*Final round of automated review-fix loop*
bash
gh pr comment <PR_NUMBER> --body "$FINAL_CONTENT"

Go to Phase 3.


Phase 3: Summary

Display a local summary (do NOT post another comment):

PR Review Loop Complete

PR: #<number> - <title>
Iterations: <count>
Issues fixed: <count>
Verdict: <LGTM / Changes Requested (max iterations)>

[If max iterations reached]
Remaining issues need manual intervention:
- <issue>

All review comments posted to PR.

Preguntas frecuentes

¿Qué hace la habilidad de IA Pr Review Loop?

Revisa la PR de forma iterativa, publica un comentario, corrige los problemas y vuelve a revisarla hasta que reciba la aprobación LGTM.

¿Por qué usar Pr Review Loop en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Pr Review Loop está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Pr Review Loop en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/fagemx/gstack-game/tree/main/.claude/skills/pr-review-loop. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Pr Review Loop?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Pr Review Loop?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Pr Review Loop con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Pr Review Loop?

Sí. fagemx la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇