---
name: execute-next-plan
description: Execute a next-plan file produced by a high-level planner, using minimal safe code changes and writing a Codex run report.
---

# Execute Next Plan

Use this skill when the user has a planner output file, usually `.ai/next-plan.md`, and wants Codex to implement it.

## Preferred command

Use the unified entrypoint when available:

```bash
bash plugins/github-planning-bridge/scripts/gpb.sh run [.ai/next-plan.md]
```

Direct script usage remains supported (this initializes the run report stub for Codex to fill):

```bash
bash plugins/github-planning-bridge/scripts/start-next-plan-run.sh [.ai/next-plan.md]
```

## Procedure

1. Read `.ai/next-plan.md` unless the user provides another file.
2. Extract:
   - goal;
   - scope;
   - non-goals;
   - acceptance criteria;
   - relevant files;
   - risks;
   - requested tests.
3. Read `AGENTS.md` and obey project guidance.
4. Inspect the relevant code before editing.
5. Make the smallest safe change.
6. Run targeted tests first, then broader checks if appropriate.
7. Do not silently expand scope.
8. Write a run report under `.ai/runs/`.

## Run report format

```md
# Codex Run Report

## Task

## Plan interpreted by Codex

## Files changed

## Implementation summary

## Tests run

## Test results

## Risks / limitations

## Follow-up suggestions

## Suggested PR body
```

## Rules

- If the plan is ambiguous, choose the smallest reasonable interpretation and state the assumption in the run report.
- If required context is missing, inspect the repo before asking the user.
- If tests cannot run, record the command attempted and failure reason.
- Do not create a broad architecture rewrite unless explicitly requested.
