# Rebuild Dist For Pr

> Rebuilds the dist folder for a GitHub PR (typically dependabot PRs). Use when asked to rebuild dist for a PR, update dist for dependabot, or prepare a PR for merge by rebuilding. Use when this capability is needed.

- Skill: `tomevault-io/rebuild-dist-for-pr` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/rebuild-dist-for-pr`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/rebuild-dist-for-pr/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/rebuild-dist-for-pr

---


# Rebuild Dist for PR

Automates the process of checking out a PR branch, rebuilding the dist folder, and preparing a commit.

## Workflow

**Required input**: PR number (e.g., `42`)

### Step 1: Fetch and checkout the PR branch

```bash
gh pr checkout <PR_NUMBER>
```

### Step 2: Install dependencies

```bash
npm install
```

### Step 3: Build and package

```bash
npm run build && npm run package
```

### Step 4: Check if dist changed

```bash
git status --porcelain dist/
```

If no output, dist is unchanged—inform the user and stop.

### Step 5: Stage dist changes

```bash
git add dist/
```

### Step 6: Show staged changes and pause

Show the user what will be committed:

```bash
git diff --cached --stat
```

**STOP HERE** and ask the user for confirmation before pushing.

### Step 7: Commit and push (after user confirms)

```bash
git commit -m "rebuild dist"
git push
```

## Error handling

- If `gh pr checkout` fails, verify the PR number and that `gh` is authenticated
- If `npm install` fails, check for lockfile issues
- If build fails, show the error output to the user

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/princespaghetti) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

