pr-analyze-failure

pr-analyze-failure is a command for coding agents from matteocervelli/llms. It costs 10 tokens per session (1,005 once invoked), scanned C, original, MIT.

A command for investigating pull requests whose automated checks have failed. It examines CI results and suggests or applies common fixes for builds, tests, formatting, types, and security checks.

In plain words
What is it for?
Use it to inspect pull-request status, check out the branch, rerun failing tests, rebuild the project, fix lint and formatting issues, and investigate dependency or security failures.
Why use it?
It helps connect a failed pull request to the specific check that broke and gives developers a repeatable way to reproduce the problem locally.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/matteocervelli/llms/pr-analyze-failure
Clone the repo
git clone --depth 1 https://github.com/matteocervelli/llms

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr-analyze-failure

README.md
[![agentmods](https://agentmods.dev/badge/commands/matteocervelli/llms/pr-analyze-failure.svg)](https://agentmods.dev/commands/matteocervelli/llms/pr-analyze-failure)
Your own site
<a href="https://agentmods.dev/commands/matteocervelli/llms/pr-analyze-failure"><img src="https://agentmods.dev/badge/commands/matteocervelli/llms/pr-analyze-failure.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,005 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.01005
Opus 5 $0.00005 $0.00502
Sonnet 5 $0.00002 $0.00201
Haiku 4.5 $0.00001 $0.00101

Measured 4d ago against content hash 9dfb697b7804, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

pr-analyze-failure scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

!rm -rf node_modules package-lock.json || rm -rf __pycache__ .pytest_cache
.archive/claude-v1/commands/pr-analyze-failure.md · 179 lines

How it starts

The opening of the file, as written. The whole thing — 179 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix PR Failures: $ARGUMENTS

Analysis Phase

# Get PR details and CI status
!gh pr view $ARGUMENTS --json title,body,state,statusCheckRollup
!gh pr checks $ARGUMENTS --watch

Analyze CI/CD failures:

  • Build failures: Compilation errors, dependency issues
  • Test failures: Unit, integration, security test failures
  • Linting/Format: Code quality violations
  • Security scans: Vulnerability alerts, dependency issues
  • Performance: Load testing, coverage threshold failures

Quick Fix Strategy

# Checkout the PR branch
!gh pr checkout $ARGUMENTS

Common Fix Patterns

Build/Dependency Issues:

# Clean install and rebuild
!rm -rf node_modules package-lock.json || rm -rf __pycache__ .pytest_cache
!npm ci || pip install -r requirements.txt
!npm run build || python -m build

Test Failures:

# Run specific failing tests locally
!npm run test -- --verbose || pytest -v --tb=short
!npm run test:integration || pytest tests/integration/

Code Quality Issues:

# Auto-fix linting and formatting
!npm run lint -- --fix || black . && isort . && flake8 .
!npm run format || prettier --write .
!npm run typecheck || mypy .

Security Issues:

# Fix dependency vulnerabilities
!npm audit fix || safety check && pip-audit --fix
!npx audit-ci --moderate || bandit -r src/

Implementation Phase

Based on CI failure type, implement targeted fixes:

1. Test Failures

  • Unit Tests: Fix broken logic, update mocks, handle edge cases
  • Integration Tests: Update API contracts, fix database setup
  • Security Tests: Address input validation, auth issues

2. Performance Issues

  • Coverage: Add missing test cases to reach threshold
  • Performance: Optimize slow queries, reduce response times
  • Memory: Fix memory leaks, optimize resource usage

3. Quality Issues

  • TypeScript: Fix type errors, add missing types
  • Linting: Address code style violations
  • Documentation: Update JSDoc, README, API docs

Read the full file on GitHub · 179 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 179 lines · 10 tokens per session scan C 9dfb697b7804

Subscribe to this mod's changes

pr-analyze-failure is a command published in the GitHub repository matteocervelli/llms (25 stars, last pushed 3mo ago), licensed MIT. It adds 10 tokens to every session and 1,005 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.