Work a task through to merged PR

Table of Contents

This page documents a runbook — a named, repeatable composition of recipes and skills for a complete multi-step procedure. Each step references a recipe or skill by id-link.

Goal

Take an existing task from BACKLOG through implementation, PR creation, review rounds, and merge — the full development lifecycle.

Preconditions

  • A task exists in the current sprint with #+type: task, State: BACKLOG.
  • The task's story is STARTED in the sprint.
  • You are on main or can create a fresh feature branch.
  • gh CLI is authenticated; SSH_AUTH_SOCK is exported (see SSH memory).

Steps

In execution order:

  1. Clock on. Run compass task start with the task's slug to switch branch, mark the task STARTED, and stamp the session journal:

    ./projects/ores.compass/compass.sh task start <task-slug>
    

    A task with no #+branch: (scaffolded via compass add task or born as a story's first real task) gets feature/<slug-kebab> derived automatically, created off fresh origin/main; --branch overrides:

    ./projects/ores.compass/compass.sh task start <task-slug> --branch <override>
    

    This covers all three cases: new task on an existing story, resuming a BACKLOG task, and restarting an already-STARTED task after a session reset. Read task_<slug>.org after clocking on: understand the * Goal, * Acceptance criteria, and * Notes. (pr create sets #+pr: later.)

  2. Sync with main. compass pr sync — fetch, rebase, report; on conflicts it stops with the conflicted files and the ways out. If you are on main, create a feature branch first: see How do I start work on a story?.
  3. Implement. Do the actual work: write code, documents, or configuration. Follow the conventions in LLM instructions for code style, documentation, and testing.
  4. Commit. Use ORE Studio commit conventions: [component] Imperative summary with a Co-Authored-By: trailer. One logical change per commit. Never amend commits on a branch under review.
  5. Open a PR. compass pr create per How do I create a PR? — it pushes, builds the body with Traceability, records the PR on the task, and stamps the journal.
  6. Monitor CI. Wait for checks to pass. If a check fails, follow How do I fix a failing CI check?.
  7. Handle review. When review comments arrive, follow How do I address PR review comments?:

    • Sync with main first (rebase).
    • Decide accept/decline per comment.
    • Apply fixes (one commit per logical fix).
    • Push, reply to every comment, resolve threads.
    • Record the review round in the task's * Review table.

    Repeat step 7 for each review round until the PR is approved.

  8. Close out — before the merge. When the final review round is done and the PR delivers this task, end the bookkeeping on the PR branch so it rides the PR — never a follow-up PR:

    ./projects/ores.compass/compass.sh task done <slug>
    

    Task and story row flip to DONE with end date. Write the task's * Result by hand, distill any * Plan into the parent story's * Decisions, commit, and push. A task spanning several PRs stays open — close it on the PR that completes it.

  9. Sync story and sprint state. If this was the final task in the story, update both files in the same commit — still before the merge, so the sync rides the PR too:

    a. In the story.org * Status table: state → DONE, set Now to Nothing., fill End date. b. In the sprint.org * Stories table: update the story row to DONE and fill the End column.

    Both files must stay in sync. A story marked DONE in story.org but STARTED or BACKLOG in sprint.org is a silent inconsistency that the sprint health review will not catch automatically.

  10. Merge. compass pr merge — the guards refuse while threads are unresolved or CI is not green; merge never touches task state (a STARTED task only draws a warning), retries GitHub's transient base-branch-modified race, and deletes the remote branch. See How do I merge a PR?.

Postconditions

  • Task is DONE with * Result filled, and the close-out commit is inside the merged PR.
  • PR is merged into main.
  • Review rounds are recorded in the task's * Review table.
  • Parent story reflects any decisions from the task's * Plan.
  • If the story is complete: story.org and sprint.org both show DONE with matching end dates.

See also

Emacs 29.1 (Org mode 9.6.6)