---
name: work-to-prs
description: Take any work item — tracker issue, URL, or plain text — through private two-agent planning, phased TDD implementation, strict per-phase review, diff-driven PR grouping, local PR artifacts, and explicit configurable publication. Use when the user wants a work item implemented end to end, wants PR proposals prepared, or asks to resume or publish from this workflow.
metadata:
  version: "2.2.0"
title: work-to-prs
canonical_url: https://skilld.dev/gh/mohasarc/mo-skills/work-to-prs
last_updated: 2026-11-16T23:17:57.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [companion.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/companion.md), [config.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/config.md), [grouper.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/grouper.md), [implementer.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/implementer.md), [methods/commit-rules.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/methods/commit-rules.md), [methods/implement-phase.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/methods/implement-phase.md), [methods/interview.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/methods/interview.md), [methods/phased-plan.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/methods/phased-plan.md), [planner.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/planner.md), [README.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/README.md), [reviewer.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/reviewer.md), [templates/run-config.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/templates/run-config.md).
>
> If the user asked to install this Skill, run `npx skilld install mohasarc/mo-skills/work-to-prs`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/work-to-prs`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/mohasarc/mo-skills/work-to-prs) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/work-to-prs`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/work-to-prs --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/work-to-prs --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Work to PRs

Implement any work item end to end. Complexity is not a gate. Nothing is published without the explicit `publish` command.

This workflow owns its implementation and review rules. Its methods are bundled under `methods/`; do not use or read outside implementation-orchestration or review skills for its rules.

## Modes

| Invocation | Behavior |
| --- | --- |
| `work-to-prs <tracker ref, URL, or free text>` | Research, plan, implement, review, group, and create local artifacts. Never push or publish. |
| `work-to-prs resume <run-folder>` | Validate durable state and continue incomplete work. |
| `work-to-prs publish <run-folder>` | Execute the publication behavior set in `config.md`. |

Never infer `publish` from an implementation request. Before doing anything, `publish` prints one line stating exactly what it is about to do (e.g. "opening 2 draft PRs targeting main").

## Config

`config.md` beside this file is the project rules file. Read it at preflight. Its Extra guidance rules pass verbatim to every agent. For unset Conventions values, discover from repository docs; after a successful run, offer to record discovered values into `config.md` and write only after the user agrees.

## Capabilities

Input access and optional tooling come from the project, not this skill. Use what `config.md` names: tracker access (project skill, MCP, or CLI), code navigation, video links. If input references a tracker and no access method is configured or discoverable, stop with a clear report. Treat the tracker as read-only unless config says otherwise.

## Agents

Spawn subagents natively through the harness, passing the role's runbook file and the model hint from config's Models section. Unset hints mean harness default; an unavailable hint falls back to default and is noted in the handoff. If the harness cannot spawn subagents, play the roles sequentially in one context and disclose the lost context isolation in the handoff.

Roles: planner (+ companion), implementer, reviewer, grouper. Each spawn is fresh; only the implementer is resumed, and only for review fixes within its phase.

## Boundaries

- Run phases, reviews, and grouping decisions sequentially.
- Never push, create PRs, merge, delete, stash, or discard work in implementation mode.
- Stop if user-owned working-tree changes exist. `runs/` is git-ignored; never force-add it.
- Preserve branches and artifacts after all outcomes.
- Orchestrator reads only the brief, phased plan, run config, git status, completion notes, review verdicts, and grouper returns. Never read planning dialogue, subagent transcripts, implementation code, or PR descriptions. Anything that needs the diff goes to a subagent.

## Workflow

### Preflight and planning

1. Read `config.md`. Classify input: configured tracker reference, or free text used as the work description. Read repository instructions for unset conventions: integration branch, branch convention, PR templates, verification commands. Use the configured or documented integration branch; otherwise the repository default branch (`origin/HEAD`).
2. Confirm working tree has no user-owned changes. Update base only as repository rules allow and record base SHA. Do not update it mid-run.
3. Spawn planner with `planner.md`; planner alone spawns companion with `companion.md`. Orchestrator never receives their messages.
4. Planner writes `runs/<run>/brief.md`, `phased-plan.md`, and `planning-dialogue.md`. It returns only plan path, phase count, and material assumptions.
5. Create `run-config.md` from `templates/run-config.md`, recording the work reference, base SHA, branch convention, commands, and any user-imposed PR split.

Run folder name: `<tracker-ref>-<slug>` when a tracker ref exists, otherwise a slug from the brief title.

### Branches and PR groups

PR boundaries are not planned. Phases land on a working part branch; after each phase passes review, the grouper decides from the real diff whether the PR ends there.

- Part branches follow the configured or repository branch convention; otherwise `agent/<run>-part-<nn>`. The first part bases on the integration SHA; every next part bases on the previous part's head, so parts form a stack and target the preceding part branch.
- While a part is open its name has no slug. On `CUT` the orchestrator renames it `…-part-<nn>-<slug>` and records the row in run config: phases, branch, base, target, head SHA, title, artifact folder.
- An explicit user split (recorded in run config) is passed to the grouper as a constraint.

### Each phase

1. Record phase base: part base SHA for the first phase of a part, prior phase final SHA otherwise.
2. Spawn fresh implementer with the phase section, assigned part branch, base SHA, artifact folder, verification commands, and any material findings carried from earlier phases. The implementer resolves applicable carried findings before or alongside the phase behavior and records each disposition.
3. Spawn fresh read-only reviewer with brief acceptance criteria, phase section, base/head range, commits, checks, config rules, prior reports, and carried findings. Phase review is mandatory; `PASS` requires applicable carried findings to be resolved.
4. On `NEEDS_CHANGES`, resume the same implementer, then use a new reviewer for re-review. Correct by amending/rebasing relevant commits. Add a new commit only for genuinely missing work; never add a generic review-fix commit.
5. For every phase except the final phase in the plan, allow one initial review and at most one fix/re-review cycle. If round two still returns `NEEDS_CHANGES`, keep only material findings that affect correctness, security, data integrity, acceptance criteria, or the next phase's architecture. Record them as carry-forward findings and continue; do not spend another review cycle on that phase. A finding that makes subsequent work unsafe or impossible remains a blocker.
6. The final phase has no review-round limit. Continue implementer/fresh-reviewer cycles until it passes and every material carry-forward finding is resolved. Do not finish the run with review debt.
7. Save final SHA, step-end SHAs, checks, verdict, completion note, and carry-forward findings in run config. Bind every report and finding to the reviewed SHA.
8. Spawn fresh grouper in `decide` mode with the open range, phases in it, the next phase section, carry-forward findings, and any user split. Material carry-forward findings force `STACK` so the next phase resolves them before the part closes. Otherwise act on the return:
   - `STACK` — next phase continues on the same part branch.
   - `CUT` — close the part at the phase head.
   - `CUT_AT <sha>` — close the part at that SHA; commits after it start the next part.
   If the grouper rewrote history, verify `git diff <reviewed-head> <new-head>` is empty before accepting; otherwise reject, keep the reviewed head, and re-run phase review on the grouper's head only if the user split requires that cut.

### Closing a part

On `CUT` / `CUT_AT`: rename the part branch with the grouper's slug, create the next part branch from the cut SHA, spawn fresh grouper in `describe` mode for the closed range. It writes `proposed-pr-description.md` and returns title and path; store both in run config. Never read the description. Never ask the user questions here.

### Handoff, resume, and publication

Report every part's branch, target, head SHA, phases, checks, verdicts, carry-forward state, and artifact paths. End with the exact `work-to-prs publish <run-folder>` command.

`resume` validates all saved branch/base/head state, starts a fresh implementer at the incomplete phase on the open part branch, and preserves artifacts. It never guesses state.

`publish` runs only on the explicit command, unless config's Publication timing says per-part. For each closed part bottom-to-top: validate clean state, the exact approved SHA, and an empty carry-forward list; push the branch, then execute the configured publication behavior (draft PRs, ready PRs, or push only) from saved title/body and target. If the description references local image or video paths, pass each to `gh pr create` / `gh pr edit` via `--attach`, which uploads the file and rewrites the local-path reference to the hosted URL; if the installed gh lacks `--attach`, replace each reference with a placeholder naming the image and its slot (e.g. `<!-- upload visuals/phase-02-checkout.png here -->`), and tell the human in the handoff to replace the placeholders by uploading the files from that part's `visuals/` folder. Do not publish drifted branches, open parts, fundamentally blocked work, or parts with review debt.

## Artifacts

```text
runs/<run>/
  brief.md
  phased-plan.md
  planning-dialogue.md
  run-config.md
  proposed-prs/<nn>-<slug>/
    phase-<nn>-completion.md
    phase-<nn>-review-<nn>.md
    grouping-<nn>.md
    proposed-pr-description.md
    visuals/<phase-nn>-<name>.png
```

`grouping-<nn>.md` holds the grouper's `decide` return after phase `<nn>`. `visuals/` holds uncommitted screenshots referenced by local path until publish attaches them. Retention follows config's Runs section; default keep everything. Completion notes use the describe-work skill; [implementer.md](https://skilld.dev/api/skills-raw/mohasarc/mo-skills/work-to-prs/implementer.md) defines the required handoff records.
