agentleFS
bryanus1bryanus1/agent-skills/skills/github/gh-cli/SKILL.md

gh-cli

Skill0 starsChanged 12 days agoMITView on GitHub

Automatización de flujos de GitHub con gh CLI y scripts: Pull Requests con Conventional Commits, emojis y labels verificados, diagnóstico de GitHub Actions, issues y releases con notas generadas. Úsala al crear o revisar PRs, depurar workflows fallidos o publicar releases.

  • Deletes or force-pushes
  • Commits and pushes

31 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-browser, web-design-guidelines and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    agent-browser

    Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

    Also in 5 projects that use this

  • VercelSkill

    web-design-guidelines

    Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

    Also in 5 projects that use this

  • MicrosoftSkill

    git-commit

    Stage user-selected paths, confirm the exact staged set, and create one local Conventional Commit, or generate a commit message for staged changes without committing. Use when you want a guarded commit or a ready-to-paste message.

    Also in 3 projects that use this

  • AnthropicSkill

    pdf

    Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

    Also in 6 projects that use this

  • OpenAISkill

    using-git-worktrees

    Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback

    Also in 3 projects that use this

  • GoogleSkill

    setup-matt-pocock-skills

    Configure this repo for the engineering skills — set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 0

    Distinctive

    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:

    No aplica a repositorios de GitLab: usa la skill glab-cli.

    line 33

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “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

🐙 GitHub CLI (gh) Workflow & Automation

🎯 Propósito

Guiar al asistente en la gestión de repositorios de GitHub con gh CLI y scripts auxiliares. Estandariza la creación de Pull Requests (Conventional Commits, emoji por tipo, scope solo con issue, labels que ya existen en el repo), el diagnóstico de GitHub Actions fallidos, el trabajo con issues y la publicación de releases con notas generadas por GitHub.

⚡ Cuándo Activar esta Skill

  • Al trabajar en repositorios alojados en GitHub (github.com o GitHub Enterprise).
  • Al crear, revisar, aprobar o fusionar Pull Requests (gh pr o scripts/create_pr.sh).
  • Al diagnosticar workflows o checks fallidos de GitHub Actions (gh run, gh pr checks o scripts/diagnose_run.sh).
  • Al crear, listar o comentar issues, o al publicar releases y tags.
  • No aplica a repositorios de GitLab: usa la skill glab-cli.

📋 Flujo de Trabajo Paso a Paso

flowchart TD
    A["Verificar Entorno\n(scripts/check_env.sh)"] --> B{"Tarea Requerida"}
    B -->|"Crear Pull Request"| C["scripts/create_pr.sh --dry-run\n→ confirmar → sin --dry-run"]
    B -->|"Depurar Actions"| D["scripts/diagnose_run.sh\n(gh run view --log-failed)"]
    B -->|"Issues"| E["gh issue list/view/create/comment"]
    B -->|"Releases"| F["scripts/release_helper.sh\n(gh release create --generate-notes)"]
  1. Paso 1: Verificación de Estado y Autenticación:
    bash <skill-dir>/scripts/check_env.sh
    Si falla la autenticación, pide al usuario que ejecute gh auth login; nunca pidas ni escribas tokens.
  2. Paso 2: Creación Estandarizada de Pull Requests:
    • Previsualiza siempre primero y muestra al usuario título, labels y rama base:
      # Issue detectado de la rama (feat/42-login-form) o explícito:
      bash <skill-dir>/scripts/create_pr.sh --issue 42 --domain auth --dry-run
      
      # Sin issue (título sin scope: <type>: <emoji> <desc>):
      bash <skill-dir>/scripts/create_pr.sh --dry-run
    • Tras la confirmación, repite el comando sin --dry-run. Añade --push solo si la rama no está publicada y el usuario lo aprueba; --draft si el trabajo no está listo.
    • Alternativa manual: gh pr create --title "<título>" --body "<cuerpo>" --base main.
  3. Paso 3: Revisión y Fusión de PRs:
    gh pr view <n> --comments        # contexto y conversación
    gh pr diff <n>                   # cambios
    gh pr checks <n>                 # estado de CI
    gh pr review <n> --approve       # o --request-changes --body "..."
    gh pr merge <n> --squash --delete-branch   # solo con aprobación explícita del usuario
  4. Paso 4: Diagnóstico de GitHub Actions:
    # Último run fallido de la rama actual, solo logs de pasos fallidos:
    bash <skill-dir>/scripts/diagnose_run.sh
    
    # Checks de un PR y logs de un job concreto:
    bash <skill-dir>/scripts/diagnose_run.sh --pr 57 --job lint --lines 50
    Lee el log, identifica la causa y corrige el código. Reintenta (gh run rerun <id> --failed) solo si el fallo es transitorio (red, runner caído).
  5. Paso 5: Issues y Releases:
    gh issue list --assignee @me --state open
    gh issue view 42 --comments
    bash <skill-dir>/scripts/release_helper.sh draft-notes
    bash <skill-dir>/scripts/release_helper.sh create v1.4.0 --dry-run

🛠️ Scripts y Herramientas Auxiliares

Rutas: <skill-dir> es el directorio que contiene este SKILL.md (p. ej. .claude/skills/<name>/ o .agents/skills/<name>/). Ejecuta los scripts desde la raíz del proyecto del usuario, no desde <skill-dir>.

  • scripts/check_env.sh: Valida git, gh, la sesión activa y el repositorio de GitHub detrás de origin.
  • scripts/create_pr.sh: Crea el PR con:
    • Título con issue: <type>(#<issue-id>): <emoji> <description>; sin issue: <type>: <emoji> <description>.
    • Label de tipo con los labels por defecto de GitHub (enhancement, bug, documentation) y domain: <nombre> opcional.
    • Dominios permitidos: si existe .gh-domains en la raíz del repo (uno por línea), --domain debe estar en esa lista.
    • Verificación previa de que todos los labels existen, de que no hay ya un PR abierto para la rama y de que la rama tiene upstream.
    • Cuerpo con Closes #<id>, resumen de commits y la plantilla .github/pull_request_template.md si existe.
  • scripts/diagnose_run.sh: Último run fallido de la rama o PR y logs de los pasos fallidos, filtrables por job.
  • scripts/release_helper.sh: list, view, draft-notes y create <tag> con validación SemVer y notas generadas por GitHub.

⚠️ Reglas Críticas

  1. Regla de Título y Scope del PR:
    • Con issue: <type>(#<issue-id>): <emoji> <description> (ej. feat(#42): ✨ login form).
    • Sin issue: <type>: <emoji> <description> (ej. chore: 🔧 upgrade dependencies).
    • NUNCA usar carpetas, paquetes ni apps como scope (feat(web): ... está PROHIBIDO).
  2. Labels existentes, nunca inventados:
    • Usa solo labels que ya existen en el repositorio (gh label list). No ejecutes gh label create sin permiso explícito del usuario.
    • Los dominios válidos son los de .gh-domains; nunca inventes uno.
  3. Acciones con efectos externos requieren confirmación:
    • Crear o fusionar PRs, aprobar, cerrar issues, publicar releases, relanzar workflows o hacer push: muestra primero lo que se hará (--dry-run) y espera confirmación.
    • PROHIBIDO git push --force hacia ramas compartidas, gh pr merge --admin para saltarse protecciones y gh repo delete.
  4. No interactividad: Pasa siempre --title/--body (o --fill) y flags explícitos; nunca dejes gh esperando un prompt.
  5. Credenciales: Nunca imprimas, pidas ni guardes tokens (GH_TOKEN, gh auth token). La autenticación la hace el usuario con gh auth login.
  6. Salida estructurada: Para leer datos usa --json <campos> --jq <filtro> en lugar de parsear texto formateado.

📚 Referencias Adicionales

  • Estándares de GitHub: títulos, emojis, labels y cuerpo del PR
  • CheatSheet de comandos gh
  • GitHub Actions y resolución de problemas
  • Ejemplos de flujos de trabajo

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.