PR

Automatically manages PR frequency based on code volume and complexity metrics.

Install

mkdir -p .claude/skills/pr-threshold && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3984" && unzip -o skill.zip -d .claude/skills/pr-threshold && rm skill.zip

Installs to .claude/skills/pr-threshold

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Track commit accumulation and trigger PR when thresholds crossed
64 chars✓ has a “when” trigger
Beginner

Key capabilities

  • Tracks lines of code and file counts
  • Calculates commit risk scores
  • Monitors scope completion percentage
  • Triggers PR creation based on thresholds

How it works

It compares current commit metrics against predefined limits to determine if a PR should be pushed for review.

Inputs & outputs

You give it
Git commit metrics
You get back
Threshold status verdict and recommendation

When to use pr-threshold

  • Monitor commit size
  • Track review complexity
  • Trigger PR creation

About this skill

PR Threshold Skill

Monitor accumulated commits and metrics to determine when a PR should be pushed for human review. Prevents PRs from becoming too large or complex for effective review.

When to Use

  • After each successful git commit
  • During Agent Mode commit-level workflow
  • Manually with "use pr-threshold skill"

Thresholds

MetricTrigger ValueRationale
Lines of Code> 300Human cognitive limit
Files Changed> 10Context switching cost
Commits> 5Review complexity
Risk ScoreHIGHNeeds careful review
Scope Completion100%Feature complete

Phase 1: Gather Metrics

1.1 Lines of Code

git diff origin/develop --stat | tail -1

Extract: insertions + deletions

1.2 Files Changed

git diff origin/develop --name-only | wc -l

1.3 Commit Count

git rev-list origin/develop..HEAD --count

1.4 Risk Score

Sum of risk from pr-review across all commits:

  • LOW = 1
  • MEDIUM = 2
  • HIGH = 3

1.5 Scope Completion

From Commit Plan:

  • Total commits planned: N
  • Commits completed: M
  • Completion: M/N * 100%

Phase 2: Evaluate Thresholds

## PR Threshold Check

| Metric | Current | Threshold | Status |
|--------|---------|-----------|--------|
| Lines of Code | [N] | 300 | OK/CROSSED |
| Files Changed | [N] | 10 | OK/CROSSED |
| Commits | [N] | 5 | OK/CROSSED |
| Risk Score | [N] | HIGH | OK/CROSSED |
| Scope Completion | [N]% | 100% | OK/CROSSED |

Phase 3: Determine Action

CONTINUE (No threshold crossed)

## Verdict: CONTINUE

No thresholds crossed. Proceeding to next commit.

### Current Accumulation:
- LOC: [N]/300
- Files: [N]/10
- Commits: [N]/5
- Scope: [N]%

### Next Commit:
[Name of next commit from plan]

TRIGGER_PR (Threshold crossed)

## Verdict: TRIGGER_PR

**Threshold crossed:** [Which metric(s)]

### Recommendation:
Push PR now for human review before continuing.

### PR Scope:
- Commits: [List of commit names]
- Total LOC: [N]
- Files: [N]
- Risk: [LOW/MEDIUM/HIGH]

### Remaining Work:
- Commits left: [N]
- Features incomplete: [List]

**Proceed to push-pr mode?** (Yes / Continue anyway)

BLOCK (Threshold crossed, no override)

If threshold crossed and user has NOT provided explicit override:

## Verdict: BLOCK

**Threshold crossed:** [Which metric(s)]

IMPLEMENTATION PAUSED - User decision required.

| Option | Action |
|--------|--------|
| A | Push PR now (recommended) |
| B | Continue anyway (override logged) |

Reply with A or B to proceed.

Do NOT continue until user responds. This is a hard stop per 00-hard-rules.mdc.

Phase 4: Handle Decision

If TRIGGER_PR

  1. Present metrics summary
  2. Recommend push-pr mode
  3. If user approves: Switch to push-pr mode
  4. If user continues: Log override, proceed

If CONTINUE

  1. Proceed to next commit in plan
  2. Update accumulated metrics

Threshold Overrides

User can override thresholds with explicit confirmation:

**Warning:** LOC threshold exceeded (350/300).

Continuing without PR may make review harder.

**Override and continue?** (Yes / Push PR now)

Log overrides for later review.

Integration

This skill is invoked by:

  • agent.mdc - After each successful commit
  • commit.mdc - After commit completes

Metrics Storage

Track across commits:

Accumulated Metrics:
- Total LOC: [running sum]
- Total Files: [unique count]
- Commit Count: [N]
- Highest Risk: [LOW/MEDIUM/HIGH]
- Started: [timestamp]

Reset after successful PR push.

Output Format

## PR Threshold Status

**Verdict:** [CONTINUE / TRIGGER_PR]

| Metric | Value | Threshold | % |
|--------|-------|-----------|---|
| LOC | [N] | 300 | [N]% |
| Files | [N] | 10 | [N]% |
| Commits | [N] | 5 | [N]% |
| Scope | [N]% | 100% | [N]% |

[Action recommendation]

Invocation

Invoked automatically after each commit, or manually with "use pr-threshold skill".

When not to use it

  • When thresholds are not defined
  • When manual override is not desired

Limitations

  • Requires user decision for hard stops
  • Thresholds are fixed values

How it compares

It enforces a quantitative gate for PR creation to prevent unmanageable review complexity.

Compared to similar skills

pr-threshold side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
pr-threshold (this skill)17moReviewBeginner
resolve-conflicts818moReviewIntermediate
claude-automation-recommender472moReviewBeginner
codex-skill125moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

resolve-conflicts

antinomyhq

Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.

81334

claude-automation-recommender

anthropics

Analyze a codebase and recommend Claude Code automations (hooks, subagents, skills, plugins, MCP servers). Use when user asks for automation recommendations, wants to optimize their Claude Code setup, mentions improving Claude Code workflows, asks how to first set up Claude Code for a project, or wants to know what Claude Code features they should use.

47140

codex-skill

feiskyer

Use when user asks to leverage codex, gpt-5, or gpt-5.1 to implement something (usually implement a plan or feature designed by Claude). Provides non-interactive automation mode for hands-off task execution without approval prompts.

12110

git-advanced-workflows

wshobson

Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.

1197

subagent-driven-development

davila7

Use when executing implementation plans with independent tasks in the current session

1493

validate-openapi-specs

epieczko

Validates and registers hook manifest files (YAML) in the Hook Registry for versioned hook management.

594

Search skills

Search the agent skills registry