Github tasks

From FriendlyInternet/nuxt-crouton · View interactive version

Github tasks is an AI agent skill from the GitHub repository FriendlyInternet/nuxt-crouton. Track work as GitHub issues in this monorepo — create epics + child/sub-issues, label them consistently by package/app, and tie them into the commit workflow. Use when planning a feature, breaking work into tasks, or asked to "track this in GitHub", "make issues", "set up tracking".

How to use this skill

Skill file

GitHub Task Tracking

The canonical task tracker for this repo is GitHub Issues (FriendlyInternet/nuxt-crouton). This skill defines how to create and label them consistently so every task maps to a real part of the monorepo.

Write it as a hypothesis (assumption-first — the default for every epic & issue)

Frame work as an assumption, not a task list. A task says "do X". A hypothesis says "we think if we do X, then Y will happen — and Y is what we want", so later we can look back and honestly say whether we were right. It's more human, it forces the why and the how-we'll-know up front, and it's what the daily digest surfaces. Use it for every epic and issue as much as possible; only trivial chores (a typo, a dep bump) may fall back to a plain task description.

The hypothesis has 4 parts:

  1. We think that — if we [do/change X], then [outcome Y] will happen — and Y is what we want. (the hypothesis)
  2. We'll do that by — [this, this, and that]. (the work)
  3. We'll be right if — [these things turn out to be true]. (success conditions)
  4. We'll know by — [measuring / checking these signals]. (measurement)

It's a lens over the sections below, not a new competing heading. Don't bolt a 5th section on — map the hypothesis onto what's already required:

| Hypothesis part | Lives in |

|----------|----------|

| 1–2 · the hypothesis + the work (plain) | the 👤 For humans lead (open the body with "We think that…") |

| 2 · the work (precise) | the 🤖 For agents block |

| 3–4 · we'll be right if / we'll know by | the 🧪 How to test section (retitle it ## 🧪 We'll be right if / We'll know by when it reads more naturally as the hypothesis's check) |

A good epic body therefore opens with a ## Hypothesis block, then the 👤/🤖 sections expand it, then the check closes it. See epic #359 and #357 / issues #358, #360, #361 for worked examples.

An epic body must carry a ## 🧪 How to test section of 2–3 phone steps — it becomes the owner's test card (#2519). scripts/epic-scaffold.mjs and the require-issue-dedup hook refuse an epic without one.

Writing for two audiences (REQUIRED — applies to issues, PRs, and commits)

Everything that lands in GitHub is written for two readers, in this order:

👤 For humans (first — and it must be genuinely easy to read)

Lead with this. Plain language a busy person skims in seconds: what changed, why it matters, what to expect — impact over mechanics. Short sentences, no unexplained jargon, no raw file paths unless they're the point. Use a diagram only when it makes the change easier to understand (a flow, a before/after, an architecture or state change). Mermaid renders in issue/PR bodies — use it there. Never add a diagram for decoration; if it doesn't earn its space, leave it out.

🤖 For agents

A precise, structured block an AI can act on without guessing: scope, exact files/paths and symbols, behaviour changes, acceptance criteria, follow-ups, links to issues/docs.

Use explicit headings (## 👤 For humans / ## 🤖 For agents) so both are obvious. Scale to the change — a one-line human summary is fine for something small — but always include both.

Record what you *didn't* do (Considered & rejected)

A "why not" is as load-bearing as a "why" — it's the evidence the chosen path beat something, with reasons that may later expire. Whenever a decision had genuine alternatives, write them down, so future-us (and agents doing archaeology) stop re-litigating settled questions and understand the shape of a decision, not just its outcome.

Worked example (from epic #392):

Considered & rejected — E2E perf

- Bump Playwright workers → ❌ the harness shares one dev server + SQLite per job; parallel workers race on mutated state → flaky.

- Shared "build packages once" prebuild job → ❌ serialises a parallel matrix; saves CI minutes, not wall-clock.

- Cache the built packages → ❌ a stale cache makes the regression smoke pass falsely — defeating its purpose.

The epic's Decisions log (capture the call *when it's made*)

Considered & rejected catches the alternatives you weighed when you write the issue. But the decisions that leak worst are the ones made halfway through the work — "team-scope at the query layer", "layout composition is deterministic, not LLM", "fake the payment in the POC". At authoring time they don't exist yet, so no up-front section can catch them; by close they're lost to chat.

So every epic carries a running ## 🧭 Decisions log — in the epic body, or a maintained pinned comment on the epic — that you append to the moment a real design call is made, mid-work, while the reasoning is fresh. It's the same reflex as updating a POC's HANDOFF.md / spec.json at a sign-off (the spec skill), pointed at the epic: one concept, two homes.

The format — newest at the bottom, one line per decision:

[YYYY-MM-DD] Decision → why → (Rejected: X — why not)

Append-only — reversals are kept, never edited away. This is the one deliberate difference from the POC spec.json, which supersedes (newest wins, prune the stale entry — "this is how it behaves now"). A decision log does the opposite: when a decision is later reversed, append a new line recording the reversal and the rule learned — don't touch the original. The reversal is the lesson, exactly as AGENTS.md demands ("negative results are first-class data — record the reversal and extract the rule, don't delete it"). A ledger that erases its own reversals is the re-litigation trap wearing a fresh coat.

Keep it a habit, not a gate. Like the hypothesis framing, this is a strongly-modeled convention with a worked example — not a required section and not hook-enforced. Decision capture dies the instant it's a box you tick to unblock a merge (you get "N/A" and "see chat"). Trivial epics opt out.

Worked example (a running log on an epic):

## 🧭 Decisions

- [2026-06-14] Team-scope at the query layer (drizzle where team_id), not per-route middleware → one choke-point you can't forget to add on a new endpoint → (Rejected: per-route guard — trivially omitted on the next route added; Rejected: DB row-level security — D1/SQLite has none).

- [2026-06-20] POC default layout is deterministic (layout-compose.ts rules), not LLM-generated → reproducible, reviewable, no token cost on every boot → (Rejected: LLM "place the blocks" — non-deterministic and slow, can't diff two runs).

- [2026-06-28] Reversed the 06-14 call for the reporting endpoints only: they team-scope in middleware after all → their cross-collection joins made per-query scoping duplicative and error-prone → rule learned: query-layer scoping for single-collection reads, middleware for joins.

How to test (REQUIRED on every closeable issue/PR — written for a human)

Every issue that changes observable behaviour, and every PR, MUST carry a ## 🧪 How to test section written for someone who knows the app concept but not the code. It is not "run the unit tests" — it is where a person clicks and what they should see. Treat it as the acceptance check: if a non-developer can't follow it to confirm the change, it's not done.

Write it as:

Plain steps (#3301) — write each step like instructions to a friend holding your phone:

  1. One action + what you should see — the action on one line, → <what you should see> on the next.
  2. Start from the preview URL — name the link, and any login or data the step needs.
  3. Only needs what the preview has — if the step needs data, the change seeds it, or the step says exactly how to make it in the app (e.g. "tap ⬆ and upload two songs").
  4. No repo jargon — no file names, script names, CLI commands or internal terms, unless explained in ≤3 plain words.
  5. No owner homework off the phone — no scripts, Mac or terminal. If something truly can't be tested on the preview, say so in one line instead of writing a step for it.

Keep it tight and skimmable. A mermaid flow is welcome when the steps branch or the state change is the point — never for decoration.

Epic acceptance rollup (the epic is the verification unit)

Sub-issues are the work unit; the epic is the verification unit. When all of an epic's sub-issues have merged (the feature has "landed in the app"), post a single ## 🧪 Verify the whole thing comment on the epic before closing it — so the owner does one QA pass instead of hunting across sub-issues:

Close the epic only after that pass passes (or the owner confirms). This turns "a bunch of merged PRs" into a single "now go click these and confirm it all works" checklist for a non-technical owner. If a sub-issue couldn't be auto-verified (e.g. needs a device), say so explicitly in the rollup rather than implying it's confirmed.

Human-action tasks: assign them, and close them when answered (REQUIRED)

Not every task ends in a PR. When something needs the owner to act — a visual sign-off, a decision, an approval, a manual run/deploy — capture it as a discrete issue assigned to them, never as a bare comment buried on another issue. The owner's "assigned to me" filter is their entire to-do list; an action that lives only in a comment is invisible to it. Trackers/epics stay unassigned — only actionable tasks carry an assignee, so "assigned" always means "you, now".

These tasks are resolved by a comment/confirmation, not a merge, so they need their own closing path — and it's the agent's job, not the owner's:

So an issue closes by either path — Closes #NN on a merged PR, or a confirmed human-action task the agent closes on the spot — and both then walk up the tree:

Closing a child? Always check the parent (REQUIRED — do it the moment the PR merges *or the task is answered*)

A merged PR auto-closes the issues in its Closes #NN lines — but a parent epic has no Closes line of its own, so it never auto-closes, and a fully-delivered epic left open is the most common stale-tracking bug.

⚠️ An epic-integration PR uses Refs #NN, never Closes #NN (#1690). That "an epic has

no Closes line" is an assumption this whole flow rests on, not something GitHub enforces —

and epic #1652 broke it: its integration PR wrote Closes #1652, so merging closed the epic

instantly, skipping the /close-epic gate (step 4) and landing the postmortem after the

close it was meant to precede. Write Refs #NN on the epic→main PR and close via

/close-epic. Sub-issue PRs keep Closes #NN — the resume merge-on-approval step

identifies the gate PR by exactly that string (#1663), so don't "fix" those too. CI warns on

a closing keyword aimed at an epic-labelled issue (warn-closes-blocked.yml). So the instant you close an issue — or a PR merges that auto-closes one — walk up the tree, unprompted. Don't wait to be asked and don't defer it to a later task: closing the leaf is not "done" until you've checked the branch above it. Closing the epic travels with the merge that closes its last child — same logical step, not a follow-up someone has to remember.

  1. Resolve the parent: mcp__github__issue_read (method: get) → parent_issue_url, or read the epic's get_sub_issues.
  2. If the issue has a parent, check whether all of the parent's children are now closed (get_sub_issues → every child's state).
  3. If they are, the epic is ready to close — but the epic is the verification unit, so never silently close it. Post the ## 🧪 Verify the whole thing rollup (above) as a comment on the epic, then explicitly ask the owner to close it (e.g. "All N sub-issues are merged — close the epic?") and close it as completed only on their confirmation (or after the end-to-end pass passes). If a sub-issue couldn't be auto-verified (needs a device, a manual check), say so in the rollup rather than implying it's confirmed.
  4. Postmortem before closing (verify = does it work?; postmortem = how did it go?). After the verify rollup and before the epic is closed, run the postmortem skill on the epic — it posts a retro (what went well / what was hard, evidence-backed / 1–3 improvement proposals) and offers to mint accepted, not-already-tracked proposals as workflow issues, and ends with a 🔭 Next handoff — the next epic to start + a paste-ready next-session prompt — so closing one epic opens the next (#615). This is how the loop tightens over time (epic #403). Skip only for a trivial epic. Once the postmortem is posted, the epic is on main and its test card is ok'd (or it has none), it closes by itself (#3012); /close-epic (on-comment.yml, #856) is the fallback, and on an epic without a postmortem it starts one and closes when it posts (#3425).
  5. Recurse: a parent can itself be a child of a grander epic — keep walking up until you hit one with open siblings or no parent.

Don't stop at the issue you were asked about; closing the leaf without checking the branch above it leaves the epic falsely "in progress".

Recurring/standing chores are standalone, never epic sub-issues. A ticket that's re-armed on a cadence and intentionally never permanently closed (e.g. the quarterly dependency sweep) must not be a sub-issue of a deliverable epic. A future-dated child that legitimately never closes silently defeats the "are all children closed?" check above, so a fully-delivered epic is pinned open forever and never reaches its verify + postmortem close-out — the most common stale-tracking bug, just slower to spot (the #233 → #244 case: the epic sat done-but-open for days behind the next quarterly sweep). File the recurring chore standalone (it may link the originating epic for context, not parent to it), and when it re-arms, open the next occurrence standalone too. (#422)

Titles are human-first too. Issue/PR titles read like plain English that anyone grasps at a glance ("Run the whole app on a Raspberry Pi and print directly"), not jargon ("node-server preset + in-process TCP drainer"). Keep the technical specifics in the 🤖 body, never the title. The rule (#4353): at most 140 characters, plain words about what the owner will notice, and no area prefix — no velo:, crouton-pages: or fix(…): in front, because the component label already shows the area (a colon later in the sentence is fine). Good: "A disabled button looks disabled: grey, not the button's colour", "Run the whole app on a Raspberry Pi and print directly". Bad: "velo: the bookings cancel route returns 404", "fix(crouton-sales): …". The checker is scripts/lib/title-rule.mjs; the ticket review feeds its findings to the reviewer, which suggests a better title, and a go ticket is renamed before its worker starts.

Core rules

  1. Every issue maps to a package or an app — never "root". If it feels like root-level work (CI, deploy, ops), label it with the app it serves (e.g. CI that builds fanfare → app:fanfare). Harness / method work that serves the whole monorepo rather than one app — .claude/**, AGENTS.md, skill/agent/hook changes — maps to meta:agents (see rule 3). There is deliberately no root label.
  2. Exactly one type:* label per issue — except an epic, which carries epic instead of a type.
  3. Component label = where the source actually changes (mirrors the commit-scope convention):
  1. Use meta labels where they apply: epic, spike, needs-triage.
  2. Link issues & PRs when talking to the user. Any time you mention an issue/PR in a chat reply, render it as a clickable link to the full URL ([#303](https://github.com/FriendlyInternet/nuxt-crouton/issues/303), [#376](https://github.com/FriendlyInternet/nuxt-crouton/pull/376)) so the owner can open it in one click. This is a chat-reply convention only — commit messages keep bare (#NN), and PR bodies use Closes #NN (not a URL) so GitHub auto-closes the issue on merge.

Pipeline fixes close on evidence, not on merge (`workflow` issues, #2657)

A fix to the pipeline itself can merge green and still not work. So its PR uses Refs #NN (never Closes #NN), and the issue body carries one line: Evidence-needed: <text a real run will annotate> (e.g. Evidence-needed: pi mcp: not blocked). verify-fix-evidence.yml runs after each worker run, looks for that text in the run's annotations (scripts/fix-evidence.mjs), and on a match comments the run link and closes the issue. No match → silent; the issue stays open. Only runs created after the PR merged count. Add a Verified-by-run: line by hand if you close one manually.

Design handoff (epics that change a visual surface)

If the design lives in a canvas the pipeline can't open, don't re-describe it in prose. Export one PNG per board/state and run node scripts/design-handoff.mjs <epic> <png…> --post — it copies them to writeups/design/<epic>/ (with a README.md naming each file) and upserts a "🎨 Design" section with inline images into the epic body. Commit and push those files (until they reach the branch in --branch, the images don't load). Pipeline workers are told to read them before building; ui-proposal shows them next to the preview.

Naming the screen to shoot (`review-surface` marker)

A ticket that changes something you LOOK at ends with one marker: <!-- review-surface: <app> <path> [name:<x>] [wait:<ms>] [click:<selector>] -->, e.g. <!-- review-surface: kassa /admin/{team}/crouton/salesCategories --> ({team} becomes the app's review team: reviewTeam in its deploy.config.json, else the seeded test1). The PR body inherits it (#2433) and, once the PR's preview Worker deploys, preview-screenshot.yml screenshots that page and posts pr<N>-<app>-<name>.png on the PR (scripts/capture-review-surfaces.mjs, #2173; the body is read from the GitHub API, #3957). Without a marker the page is guessed from the changed files (a package page only on apps that use that package). With a marker only the named apps are shot (a named app with no preview turns the check red); without one, only apps whose own folder the PR changes and that have a preview, else every previewed app (#4535). a PR that changes a screen and names no page gets no shot and the check goes red; only a PR that changes no screen (or says <!-- review-surface-none -->) gets the start page. A named or guessed page that redirects elsewhere (e.g. to login) is rejected — name the page that shows the change. Pages under /auth/… are photographed signed in first; only if that page sends you elsewhere is it tried once signed out (a sign-in page). A sign-in form shown as a pop-up on the home page counts for a sign-in page, never for one that needs you signed in, like consent (#4235, #4248).

No screen to check? Write <!-- review-surface-none: <reason> --> (#4252). Only the form with a reason beats a page guessed from the changed files; the check then shoots the start page and names the pictures no-screen-…. The marker without a reason only counts when no page can be guessed. The worker writes the reason itself from the plan's 👁 What to look at: none — <reason> line.

A PR opened by hand that touches only packages/** gets no preview Worker unless its body also carries <!-- deploy-preview: full-watch --> (the pipeline adds it automatically to held UI PRs; scripts/deploy-detect.mjs, #2140) — without a preview there is nothing to screenshot. Adding it to an open PR's body needs a new pull_request event (push, or close + reopen) before a preview builds.

Structure

How to create them (tools)

Issues, sub-issues, and labels are managed through the GitHub MCP tools:

Scan without overflowing the context. A broad list_issues / search_issues (e.g. labels: ["epic"], or a keyword search with no in:title) can return a 90k–140k-char blob that overflows the tool result and has to be sliced out-of-band — pure wasted turns. For any repo-wide scan (the dedup and epic walk-up steps are where this bites): pass minimal_output: true, keep perPage small (5–10), and prefer in:title filters over broad body matches. Only widen when a narrow query genuinely misses.

Labels must already exist before you can apply them — applying an unknown label errors. New labels are added via labels-as-code (below), not by the API.

Projects v2 boards can't be created or managed via these tools (UI-only). Tell the user to create the board in the web/iOS app; if they enable the project's "Auto-add" workflow, issues you create land on the board automatically.

Pipeline-ready epic (one command)

An epic the agent pipeline can run needs: the hidden <!-- pipeline: epic=N depth=1 epic_branch=… --> block on each child, Blocked-by: #NN ordering, a pkg:* label (or a Packages-approved: line) so packages-guard accepts the worker's PR, and the epic/<N>-<slug> branch created before the first worker. Don't hand-build these — write a JSON plan { title, body, labels, packagesApproved?, children: [{ title, body, labels, blockedBy: [siblingIdx] }] } and run:

node scripts/epic-scaffold.mjs --dry-run plan.json   # print the tree, create nothing
node scripts/epic-scaffold.mjs plan.json             # epic + branch + children + sub-issue links

A ticket that must run while a same-package ticket is open — because that one is waiting on it (e.g. a fix for its failing PR) — carries a line Unblocks: #NN in its body. Traffic control then lets it proceed past #NN (it comments "proceeding before #NN"); adding the line to an already-parked ticket releases it at once (the edited trigger in on-issue-close.yml). Only declare it when it is true.

The epic body must carry a Dedup-checked: line (the script refuses otherwise). Running the script already starts the work: every child with no Blocked-by gets work-this immediately, and the wave scheduler releases the rest as their blockers close. Do NOT label the epic delegate-pi afterwards — that runs the decomposer on an epic that already has children and dispatches the unblocked ones a second time. Use --dry-run to look before anything starts. It reuses apply-decompose-plan.mjs; tests: scripts/epic-scaffold.test.mjs.

Labels-as-code

The label taxonomy lives in .github/labels.yml and mirrors the workspace: pkg:* for every packages/*, app:* for every apps/*, worker:* for workers/*, plus type:* and meta labels. It's synced non-destructively by .github/workflows/labels.yml (skip_delete) on changes to main or via workflow_dispatch.

To add or change a label: edit .github/labels.yml, commit, and let the workflow sync it on merge to main. When a new package or app is added, add its pkg:/app: label here too.

Fit into the task workflow

GitHub issues slot into the repo's task-execution flow (see CLAUDE.md):

  1. Check for existing work FIRST, then pick / open an issue — the issue is the unit of work. Because sessions are ephemeral and a teammate (or a past you) may already have opened the epic/tasks, always search before creating. This is no longer a soft step: run the issue-dedup skill (it searches open and recently-closed work by epic label + keywords, surfaces matches, and forces a reuse / replace / new decision), and the require-issue-dedup PreToolUse hook blocks any issue_write create whose body lacks a Dedup-checked: attestation line. If a matching epic or task already exists, continue that one (assign yourself, set status:in-progress) instead of opening a duplicate. Only when nothing matches do you open a new epic + sub-issues for a multi-step initiative. (Then, when you pick up an issue, the sibling issue-sanity-check skill is your pessimistic go/no-go — see CLAUDE.md step 1.)
  2. Mark in progress — do this the moment you START, not after. Apply the status:in-progress label (swap to status:blocked when waiting; remove the status label on close). The label is the signal that moves the board: .github/workflows/project-status.yml listens for the status:in-progress/status:blocked label and writes the Project's Status field (→ In progress / Blocked) via a PAT, since these MCP tools can't write Projects v2 fields directly (list_issue_fields is empty). PR opened → In review and merged/closed → Done are handled by the same workflow + the Project's built-in workflows. Prerequisite: the PROJECTS_TOKEN repo secret must be set — without it the workflow is a green no-op and nothing moves, so the label is the only signal and the board won't reflect it.
  3. Branch + do the work — work on a feature branch; follow CLAUDE.md patterns; run pnpm typecheck.
  4. Commit — use the /commit skill, referencing the issue in the body (e.g. (#NN)).
  5. Open a PR — early is fine. Put Closes #NN in the body so the issue auto-closes on merge. Let CI run and fix failures (the PR can be watched/autofixed).
  6. Merge preserving commits (merge/rebase — don't squash by default; squash only a noisy wip/oops history, per AGENTS.md § Commits → Merge policy) → the issue closes automatically and the branch is deleted. Don't push feature work straight to main.
  7. Walk up the epic tree (REQUIRED — part of the merge, not an afterthought). The moment the merge auto-closes the leaf issue, run the parent check in "Closing a child? Always check the parent" above. If that merge closed the epic's last open child, post the ## 🧪 Verify the whole thing rollup on the epic, run the postmortem skill (retro + improvement proposals — see step 4 there), and ask the owner to close it (close on confirmation). A merge is not "done" until the parent epic is either closed or explicitly handed off for the verify + postmortem pass. When watching/auto-merging a PR, do this walk-up as soon as the merge lands.

Work lands via PRs, not direct pushes to main. Issues are the source of truth for what to do; docs/PROGRESS_TRACKER.md (if used) becomes an optional phase-level rollup, not the per-task tracker.

Quick reference

| Want | Label(s) |

|------|----------|

| New feature in a package | type:feat pkg:<name> |

| Feature touching a package + app schema/config | type:feat pkg:<name> app:<name> |

| App/deployment/ops/CI work | type:chore/type:docs app:<name> |

| Cross-cutting initiative | epic pkg:<name> (+ app:<name>) |

| Harness / skill / agent / method change (.claude/**, AGENTS.md) | type:docs/type:chore meta:agents (+ epic if an epic) |

| Time-boxed proof-of-concept | spike type:feat <component> |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.