# Pr Harden

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-agentjido-jido-skills-pr-harden`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [agentjido](https://agentstack.voostack.com/s/agentjido)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [agentjido](https://github.com/agentjido)
- **Source:** https://github.com/agentjido/jido-skills/tree/main/source/skills/pr-harden
- **Website:** https://agentskills.io

## Install

```sh
agentstack add skill-agentjido-jido-skills-pr-harden
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# PR Harden

## Purpose

Turn a `needs_work` pull request into a merge-ready PR by editing the PR branch
directly.

## When To Use

Use this skill only when:

- The user explicitly asks to harden, fix, repair, or finish a PR
- The PR is labeled `needs_work`
- The user explicitly asks you to address blocking review findings

Use `pr-review` instead for read-only PR review.

## Requirements

- `git`
- `gh` CLI with permission to push to the PR branch
- Clean local worktree before checking out the PR
- Clear target PR URL or number

## Workflow

### 1. Start from a clean base

Run:

```bash
git status --short --branch
git fetch --prune origin
```

Stop if the worktree is dirty unless the dirty files are known to be yours and
part of this hardening task.

### 2. Inspect before editing

Fetch PR metadata, checks, labels, reviews, comments, and changed files:

```bash
gh pr view  --json title,body,labels,reviewDecision,mergeable,statusCheckRollup,headRefName,baseRefName
gh pr checks 
gh pr diff  --name-only
```

Identify blocking issues first:

- Correctness bugs
- Missing regression tests
- Failing CI
- Merge conflicts
- Unresolved blocking review comments

### 3. Check out the writable PR branch

Use:

```bash
gh pr checkout 
```

Confirm the checkout is writable before editing. If the PR comes from a fork
and is not writable, stop and report the limitation.

### 4. Fix blockers only

Keep changes scoped to the PR goal. For each blocking issue:

- Fix the behavior
- Add or strengthen focused regression tests
- Preserve unrelated user changes
- Avoid broad refactors unless required to make the fix safe

### 5. Validate

Run the focused tests that prove each fix. Then run repo-standard validation.
If no alias is documented, run at least:

```bash
mix test
mix compile --warnings-as-errors
```

If GitHub CI was failing, make sure local validation covers the failing area
before pushing.

### 6. Push and relabel

Commit with a conventional commit message and push to the PR branch only.
Never push to `main`.

After push, update labels:

```bash
gh pr edit  --add-label needs_work --remove-label ready_to_merge
gh pr edit  --add-label ready_to_merge --remove-label needs_work
```

Apply `ready_to_merge` only when all blockers are resolved, focused validation
passes, required CI is green, and the PR is merge-clean. If CI is pending after
the push, keep or apply `needs_work` and report that the PR should be relabeled
after CI passes.

## Output Expectations

Report:

- Blocking issues fixed
- Tests added or strengthened
- Validation commands run
- Commit and push status
- Final label state
- Remaining blockers, if any

## Guardrails

- Do not merge the PR.
- Do not rewrite unrelated PR history unless the user explicitly asks.
- Do not push to `main`.
- Do not mark `ready_to_merge` with known failing CI, unresolved blockers, or
  conflicts.
- Do not expand scope beyond blockers needed for merge readiness.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [agentjido](https://github.com/agentjido)
- **Source:** [agentjido/jido-skills](https://github.com/agentjido/jido-skills)
- **License:** Apache-2.0
- **Homepage:** https://agentskills.io

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-agentjido-jido-skills-pr-harden
- Seller: https://agentstack.voostack.com/s/agentjido
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
