[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75XG0JKQSFAA47Y194RF4V6":3,"skill-same:01M75XG0JKQSFAA47Y194RF4V6":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":29,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M75XG0JKQSFAA47Y194RF4V6","working-with-prs",null,"Use when opening, gating, reviewing or merging a pull request, writing its body, making a branch testable, handling agent review findings, or sequencing several branches at once.","loupe-ac\u002Floupe","loupe-ac","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F345019842?v=4","01M75XDH3V7GZDHB5M0J04BFTP","Loupe","01M75XDH4EWXVAMQEHFV5TWBMF",2,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworking-with-prs\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: working-with-prs\ndescription: \"Use when opening, gating, reviewing or merging a pull request, writing its body, making a branch testable, handling agent review findings, or sequencing several branches at once.\"\n---\n\n# Working with pull requests\n\nEvery change reaches `main` through a pull request. `main` is protected, so no\npath skips this.\n\n## The branch name\n\nName a card branch `card-\u003Cnumber>-\u003Cslug>`. The slug is two to four lowercase words from the card title.\n\n## The gate, before you open anything\n\n1. `just cs` applies the formatter and rector fixes. Commit anything it\n   changed. It works from a worktree.\n2. Run `just phpstan`, `just arkitect` and `just gamache`. These check the\n   whole project. Then run `just prepush \u003Cbase>`, which fails on a stale\n   `openapi\u002F` file or a changed plugin without a greater version.\n3. Run PHPUnit on the tests for what changed: `just phpunit tests\u002F\u003Cpath>` or\n   `just phpunit --filter \u003Cname>`.\n4. Run `just js-test` when JavaScript changed, and `just cli-test` when `cli\u002F`\n   or `hooks\u002F` changed.\n5. Push. Run no Codex review. A separate review worker reviews the pull\n   request after the push (see \"The agent review\"). CI's required checks are\n   the full gate. Read them on the pull request, and fix every failure,\n   including ones that pre-date your change.\n\nA `PreToolUse` hook, `.agents\u002Fhooks\u002Fno-full-ci.sh`, refuses `just ci` and a\nfull PHPUnit run for an agent. The `audit` workflow runs `just audit` on `main` and each day, so the local\nlist leaves it out. A worker learns of a failed required check from the board, and the\n`checks-failed` fix round covers every required check.\n\ne2e is not in the local gate. Do not run the full suite locally before you open\nthe pull request. \"Running the suite locally is debugging, not gating\" lists\nthe e2e checks.\n\n### The agent review\n\nOpen every pull request as a draft: `gh pr create --draft`. A review worker\nreads the whole change at the head commit. That worker is never the worker that\nwrote the code. Loupe posts the result as the check `Loupe \u002F Agent review`,\nwith each finding beside its line. `docs\u002Fusing\u002Fworkflows.md` \"Agent review\"\ndescribes the flow.\n\n- A failed review asks for a fix at once. The fix round reads the findings of\n  the head commit from `card_get`, in `agentReview`.\n- When the review passes and CI is green, Loupe marks the pull request ready,\n  and the owner then sees it. The card moves to In review. Never run\n  `gh pr ready` yourself, and do not wait for the review of the owner to\n  un-draft it.\n- A draft that stays a draft after a passed review and green checks is a fault\n  of the setup. The usual cause is a workflow with no agent review rules, as\n  Lifecycle has, or a bridge with no `review` work entry. Say so in the body.\n- Ready does not mean merged. `main` still needs the check `Loupe \u002F Approval`,\n  and you never approve your own work.\n- Review the diff against `origin\u002F\u003Cbase>`, never `main`. The local `main` of a\n  worktree is often stale, so a review against it reports findings for\n  already-merged code.\n- A reviewer inside an implementation run still runs, such as the per-task\n  reviewer of the build notes. Those reviews are part of the build.\n\n### The Design System artifact rebuild\n\nAfter the gate checks, run `bin\u002Fagents\u002Fdesign-system-changed origin\u002F\u003Cbase>`. The\nscript prints the changed design system paths. It prints nothing when none\nchanged.\n\nWhen it prints a path, try the rebuild with the `loupe-design-rebuild` skill. Do\nnot skip this step. When the rebuild cannot write, as in a headless worker with\nno `Artifact` tool, write the line `Design system rebuild: pending` in the pull\nrequest body. Then follow `references\u002Fdesign-system-rebuild.md`, which raises\none non-blocking to-do for the owner and never a duplicate.\n\n## A check is a fault until you have seen it fail\n\nA check that comes back clean is a fault in the check, until it has failed on a\nknown-bad input.\n\nA check that comes back one short is a fault in the check, until you prove\notherwise. Nobody tests this direction, because a check that reports a problem\nlooks self-justifying.\n\nA tool reports what it did. It does not report what it found. Doing nothing\nsuccessfully and finding nothing wrong produce the same output. So break the\ncheck on purpose, and watch it go red. Then restore it and trust the green.\n\nConfirm that the break landed before you read the result, for example with\n`git diff --quiet`. A break with wrong escaping leaves the file unchanged, and\nthe green then reads as \"the rule is fine\". A falsifier that does nothing is the\nsame fault one level up, and it is the more convincing of the two.\n\n| Signal | What it cannot distinguish |\n|---|---|\n| `phpstan` exit 0 | a clean tree from a rule that never loaded |\n| a test that pins behaviour | the behaviour existing from the test not asserting it |\n| `just cs` reporting success | a fixer that ran from a rule that silently no-opped |\n| a conflict report naming one file | the other files being unchanged from being reverted |\n| `pass=10` on a pull request | a current head from a head that has since moved |\n\nA good falsifier is small. A file that calls a constructor with no arguments\nproves that an arity rule runs. Adding the forbidden filter to a listener proves\nthat the test which forbids it goes red.\n\nGrep is where the second direction bites. A pattern that cannot match one form\nof the line reports one short, while every line is present. Read the region. Do\nnot grep for what you expect to find.\n\nA conflict resolution needs the same proof. Before you accept a resolution of a\nshared prose file, or of a stacked branch after its parent squashed, read\n`references\u002Fconflicts.md`. Its `comm` checks prove that no entry and no test\ndisappeared.\n\n### Ask what reads what you write\n\nInert code looks wired up when its input is present. A changelog fold proposed\nfor `docker\u002Fprod\u002Frelease.sh` reads as plausible, because `COPY . .` puts\n`docs\u002FCHANGELOG.md` into the production image. Nothing reads it there.\n`grep -rn CHANGELOG src\u002F templates\u002F config\u002F public\u002F` returns nothing, and the\ncontainer filesystem is discarded on each deploy. The fold would have run,\nreported success and changed nothing.\n\nFor any step that writes something, name what reads it. Require a grep that\nfinds the reader. An input that exists is not evidence that anything consumes\nthe output.\n\n## Documentation-only branches run `just cs` and push\n\nSkip the local checks. Say so in the PR body, so the record shows that the gate\nwas reduced deliberately and not forgotten. CI still runs every check, e2e\nincluded, because Markdown is not inert here. Prettier covers some of it, the\ngamache checks read `docs\u002F`, and a docs commit can break a build that greps\nthem. The agent review still reads the pull request.\n\nThe test is the diff, not the intent. Every changed file must end in `.md`.\nCheck it, and do not assume:\n\n```bash\ngit diff --name-only origin\u002Fmain...HEAD | grep -v '\\.md$'\n```\n\nAny output at all means that the full gate applies. A branch that also touches\n`.env`, a Twig template, a fixture, `composer.json` or a `justfile` recipe is\nnot documentation-only, however small the change looks.\n\nThe reduced gate does not extend to Markdown that a script *executes*. A `.md`\nfile that a script parses for commands is code with a `.md` suffix, so gate it\nfully. A `SKILL.md` sits at the edge. An agent reads it and no script parses it,\nso the reduced gate applies. Note that call on the gate line.\n\nThe reason is proportion. A gate that can never fail teaches a reader to stop\ntrusting gate results.\n\n## Keep the body brief\n\nThe owner reads every body. Write it so that he can read it in under a minute.\nPut the full reasoning in the commit messages, because the squash keeps them in\n`git log`.\n\nAim for about 100 words on a small change, and stay under 250 on a large one.\nUse short bullets. Do not use paragraphs.\n\nWrite only these, and leave out any line that has nothing to say:\n\n- Preview links, at the top. Every pull request has them.\n- The URL of the board card the branch works, when a card exists.\n- One or two sentences on what changed and why.\n- The rejected alternative, in one sentence, when there was a real one.\n- What you verified, one line per check.\n- What you could not verify.\n- A decision the owner must make.\n- A deploy need, a breaking change, or a merge order.\n- One gate line, such as \"Gate: cs, phpstan, arkitect, gamache and\n  `tests\u002FModule\u002FBoard` green.\" Name a reduced gate on that line.\n\nLeave these out:\n\n- A heading for every item. `## Preview` is the only heading a body needs.\n- Any line that says something does not apply: \"nothing to click\", \"no deploy\n  need\", \"no changelog fragment\", \"the gate was not reduced\".\n- The diff restated in prose, a code block of the change, or a table per file.\n- A narrative of how you got there. That goes in the commit message.\n\nA reviewer asks for detail when he needs it. Answer in a comment. Do not grow\nthe body.\n\n## Make the branch testable, not just reviewable\n\nA reviewer who has to build state by hand usually will not.\n\nPut the preview links at the very top of the body, under a `## Preview`\nheading. They go before the decision, the summary and everything else. They are\nthe first thing the owner looks for, so nothing goes above them. A demo section\ntwo thirds of the way down, next to the gate results, makes the reviewer hunt.\n\"Try it\", \"Click it\" and \"Verification\" are typical names for such a section.\nLead with the links, then explain the change.\n\nGive each link a one-line label that says what state it shows. When a change has several states, seed one document per\nstate and link each. A reviewer who can see all of them side by side reviews\nwhat the code does. Otherwise the reviewer sees only the one case you seeded.\n\nPoint at the running instance, and sign the reader in. Every worktree serves its\nown branch at `https:\u002F\u002F\u003Cslug>.loupe.dev.localhost`. Do not put a bare page URL\nin the body. It lands the reader on the login page, and the reader must sign in\nby hand. Mint a signed link instead, from inside the worktree:\n\n```bash\n( cd .worktrees\u002F\u003Cname> && bin\u002Fworktrees\u002Fcompose-exec.sh \\\n    bin\u002Fconsole app:dev:preview-login-link --path=\u002Fprojects )\n```\n\nThe link signs the reader in and lands them on the page you named, so the body\nneeds no credentials at all. Use `--email=admin@loupe.test` for an admin page.\nThe link does not expire, so it still works when the reviewer reads the body\ndays later. The signature covers the whole URL, host included. A link therefore\nworks against that worktree only, and the host resolves on your own machine.\nThe route is `#[When('dev')]`, so it does not exist in production.\n\nOpen the link yourself before you write it down. Seed and prove every link\nbefore the push, not after it. A branch that cannot show its marker is not\npushed as ready.\n\n### Prove each preview link shows its state\n\nA headless session cannot look at a page, so it proves each link with `curl`.\nDo this before you write the body. Pick a marker that the diff adds to the\npage: a translated label, a data attribute or a CSS class. A marker that the\npage showed before the branch proves nothing.\n\n```bash\nlink=$( ( cd .worktrees\u002F\u003Cname> && bin\u002Fworktrees\u002Fcompose-exec.sh \\\n    bin\u002Fconsole app:dev:preview-login-link --path=\u002Fprojects ) | tail -1 )\njar=$(mktemp) page=$(mktemp)\n\u002Fusr\u002Fbin\u002Fcurl -sSL -c \"$jar\" -b \"$jar\" -o \"$page\" \\\n    -w '%{http_code} %{url_effective}\\n' \"$link\"\ngrep -c 'Your projects' \"$page\"\n```\n\nThe link signs the reader in, sets a session cookie and redirects. Without the\ncookie jar, the redirect lands on `\u002Flogin`. The macOS `\u002Fusr\u002Fbin\u002Fcurl` trusts the\nlocal certificate authority through the keychain, so it needs no `-k`.\n\nRead two results. The effective URL must end in the `--path` you minted, or the\nsign-in failed. The count must be 1 or more, or the state is not seeded. For a\nsigned link, fetch the bare page URL once without the link, and confirm that\nthe count is 0.\n\nA page that shows records needs a second proof. The marker must show only when\nthe page holds its data. A page title, a heading, a panel id or a chart\ncontainer fails, because the page renders them with no data too. In\n`pr:loupe-ac\u002Floupe#1381`, the Metrics marker `data-metrics-title` counted 1 on a\nproject with 0 runs, so every chart was empty. Pick a marker that the template\nprints once for each record, such as a row id or a `data-series` attribute.\nThe module seeder that writes the data also writes an empty twin of the record\nwith a fixed id. Mint a link to that path, and fetch it with the same cookie jar:\n\n```bash\ntwin=$( ( cd .worktrees\u002F\u003Cname> && bin\u002Fworktrees\u002Fcompose-exec.sh \\\n    bin\u002Fconsole app:dev:preview-login-link --path=\u002Fprojects\u002F\u003Ctwin id>\u002Fanalytics\u002Fmetrics ) | tail -1 )\n\u002Fusr\u002Fbin\u002Fcurl -sSL -c \"$jar\" -b \"$jar\" -o \"$page\" \\\n    -w '%{http_code} %{url_effective}\\n' \"$twin\"\ngrep -c 'data-series' \"$page\"\n```\n\nThe count on the twin page must be 0. The bare URL fetch proves the sign-in,\nand the twin fetch proves the data. End the line with the empty path:\n\n```markdown\n- [Metrics, three runs](https:\u002F\u002Fcard-42.loupe.dev.localhost\u002Fdev\u002Fpreview-login?…), marker `data-series`, empty `\u002Fprojects\u002F\u003Ctwin id>\u002Fanalytics\u002Fmetrics`\n```\n\nA state that shows no records, such as a form or a dialog, ends with `no data`.\n\nWrite one Markdown list item per link in the Preview section. Name the marker\nthat you found:\n\n```markdown\n- [Board, empty Next column](https:\u002F\u002Fcard-42.loupe.dev.localhost\u002Fdev\u002Fpreview-login?…), marker `lp-empty-state`, no data\n```\n\nA page that only a signed-out visitor sees, such as the landing page at `\u002F`,\ntakes a plain link. A signed link signs the reader in, and the page then\nredirects. Prove the plain link with the same `curl`, with no cookie jar, and\nend the line with `. Signed out.`. The plain link is the bare page URL, so skip\nthe zero-count fetch. The effective URL must end in the path, and the count\nmust be 1 or more. The marker must not be on `main`:\n\n```markdown\n- [Landing page](https:\u002F\u002Fcard-42.loupe.dev.localhost\u002F), marker `rel=\"help\"`. Signed out.\n```\n\nA link to a file, an artifact or a CI run\ntakes the same shape with no marker. So does the card line:\n`- [Card 42: \u003Ctitle>](\u003Ccard URL>)`.\n\nA branch that changes a page and cannot show its marker is not ready.\n\"The tests cover it\", \"the seed holds no X\" and \"it shows after a bridge\nreports data\" do not replace a seeded state.\n\nEvery pull request has a Preview section. When a branch changes no page, link\nwhat the reviewer reads instead. That is each changed file rendered on GitHub,\na published artifact, or the CI run that shows the change working. Pin a GitHub\nlink to the pushed commit SHA, and not to the branch name. The link then shows\nthe code under review after the branch moves.\n\nPut the card URL on its own line under the Preview section, when a card exists.\n`loupe-board` says how to build that URL and how to add the pull request to the\ncard.\n\nEvery such URL must be clickable. That means one whole absolute URL in plain\ntext. A body with several pages to point at tends to give a bare host followed\nby paths in backticks. That renders as unclickable code spans, and the reviewer\nhas to assemble each URL by hand. That friction is enough to lose the click\nthat the seeding was for. So follow these rules:\n\n- Put no backticks around a URL.\n- Write no relative paths under a host that you give once.\n- Leave no `\u003Cslug>` or other placeholder for the reader to substitute.\n- Write the full `https:\u002F\u002F\u003Cslug>.loupe.dev.localhost\u002Fprojects\u002F…\u002Freview` per\n  destination, even when that repeats the host five times.\n- Paste one into a browser before you open the pull request.\n\nLeave the `## Preview` section in the body. The squash message is the commit\nmessages of the branch, and the merge sends no body, so the links never reach\n`git log`. A signed `*.dev.localhost` link points at a worktree that is torn\ndown within hours. Name the commit that the preview was built from, so a later\nreader knows which code the links showed. Never write \"this branch's head\". The\nphrase is true of every branch at every moment, so no reader can check it. The\nmerge stage copies the links of an epic child to the epic pull request after the\nmerge.\n\nThe same rule covers a branch with no worktree of its own. Link the page on\nwhatever instance does serve it. Do not describe the route and leave the reader\nto construct it.\n\nA branch that adds no route can still produce reviewable output, such as HTML\nfrom a renderer, a generated report or a file. Publish the output as an\nartifact and link it. Say which questions it answers and which it defers.\n\nSeed the data the change needs. `bin\u002Fconsole app:dev:seed` fills the database\nwith the demo dataset of the module seeders, which covers most pages. A diff\nfeature is untestable without a document that carries several versions. When\nthe dataset lacks the state, extend the module seeder in the branch. Give each\nrecord that a link names a fixed id. Write the exact shape the bug had, not\nmerely a happy path. A page behind a flag adds the flag to\n`DevFeatureFlagSeeder`. A link to an account page names a demo account, never\nthe dev or the admin account. Tell the reviewer which link to open and what to\nlook for.\n\n## Reviewing work you did not write\n\nA green gate is not evidence that the change is correct. One wave had six green\nbranches, and a review found a real defect in every one. The gate proves that\nthe suite passes. It does not prove that the change is right.\n\nSo read the diff yourself, especially the part that the author called routine.\nAn agent can report a decision that it made on your behalf. Check whether that\ndecision is orthogonal to the open questions it claims not to touch. One wave\nbranch added a unique index and called it unrelated to a design decision that\nit foreclosed.\n\nSend findings back to whoever wrote the code, not to a fresh agent. The author\nstill has the context. The second-order questions, such as \"does anything else\nin this file have the same shape?\", catch the bug the reviewer did not spot.\nAsk for a reproduction of the failure against the pre-fix code. You then know\nthat the new test discriminates and does not pass vacuously.\n\n## Running the suite locally is debugging, not gating\n\nThe eight `e2e-*` legs are the gate: `e2e-chromium`, `e2e-chromium-2` to\n`e2e-chromium-6`, `e2e-rest` and `e2e-global-flags`. They run the same\n`just e2e` against a disposable stack, with both `E2E_BASE_URL` and\n`MAILPIT_URL` set correctly. See `.github\u002Fworkflows\u002Fci.yml`.\n\nThe six chromium legs split that project per test. `rest` runs admin and the\ndestructive chain, and `global-flags` runs alone. Each leg is on its own runner\nwith its own stack. Read the red leg for the failure. `maxFailures: 1` is per\nprocess, so a red run can report one failure in each leg.\n\nEach leg is a required check only after the owner adds it to the main ruleset.\nOn `main`, the `lint` job fails and names each leg that the ruleset does not\nrequire.\n\nLocally the suite is slower, destructive, and fails for reasons unrelated to the\ndiff. So push, then read the checks, and fix every failure they report. Run one\nnamed spec locally while you change or debug it, with\n`just e2e tests\u002F\u003Carea>\u002F\u003Cspec>.spec.ts`. The `.agents\u002Fhooks\u002Fno-full-e2e.sh` hook\nrefuses a full run.\n\nA run with `E2E_BASE_URL` set by hand to a sibling worktree wipes the dev data\nof that worktree and skips the automatic repair. Run\n`bin\u002Fworktrees\u002Fworktree-bootstrap.sh \u003Cworktree-name>` after it, and read\n`project-e2e` `references\u002Fsibling-worktree-run.md` before it.\n\n## Merging\n\nThe `main` ruleset sets `strict_required_status_checks_policy` to `true`, so\nGitHub refuses a merge from a branch that is behind `main`. The sync below is a\nhard block, not a caution. Every merge to `main` puts every other open branch\nbehind, so a queue of N branches costs N sync-and-gate cycles. Two sessions\ncannot interleave their merges, so one session holds the queue at a time.\n\nBefore you hand-merge a pull request, or while you hold the queue, read\n`references\u002Fmerging.md`. It holds the detail of item 5, item 7 on a \"not\nmergeable\" error after a push, and item 8 on how to count the checks of the\nhead you merge. A green reading of an old head merges untested code.\n\n1. The final gate of a branch happens on the branch fully merged with current\n   main. A branch cut before a sibling merged has not really been gated. Its\n   e2e run never exercised the specs of the sibling against its code.\n2. Merge immediately after the gate goes green. Any merge to `main` between the\n   last sync of a branch and its own merge invalidates its PR through\n   conflicts, or invalidates its gate.\n3. After every merge, run `just cs` on main and commit the drift. A merge of two\n   individually clean branches produces fixer drift. Otherwise that drift lands\n   on whichever branch syncs next. The changelog needs nothing from you, because\n   the image build folds the fragments itself.\n4. Tear down the worktree of a merged branch only after `gh pr merge` is\n   confirmed. Never do it in the same command chain. Confirm the merge by reading\n   the result, not by having issued the command. A merge can fail for a reason\n   that is not a conflict, such as mergeability still computing or a check that\n   flipped. A tree destroyed first turns a retry into a rebuild from origin.\n   Nothing is lost while the branch is still on origin, so verify that before\n   anything else.\n5. A conflict-free merge is not a correct merge. A class rename on one branch\n   and a *new* file on another that uses the old name merge with no conflict.\n   So does a required argument against a new file that constructs the old\n   shape. Push the merged result and read CI before you trust such a merge.\n6. A resolution that takes one side can silently revert the fix of the other\n   side. Before you accept a resolution, re-verify the *behaviour* that both\n   branches were protecting. The absence of markers is not enough. The sharpest\n   form is rename\u002Frename. There neither side is correct, and the answer is the\n   content of the newer branch at the path of the other branch.\n\n## The changelog entry rides the pull request it describes\n\nEvery pull request that changes something a reader can act on carries its own\nchangelog fragment, in its own branch, at `changelog.d\u002F\u003Cnumber>.md`. Write it as\nyou write the change. Do not open a second pull request for it. Never edit\n`docs\u002FCHANGELOG.md` itself. `changelog.d\u002FREADME.md` holds the format, the six\ntags, the exemptions and how the fragments reach a reader.\n\nNothing checks that a branch carries a fragment at all. `just lint` runs\n`php bin\u002Fchangelog.php --check`, which reads format only. So the rule above is\nyours to keep. A rule that checks it belongs in a pull request on\nhttps:\u002F\u002Fgithub.com\u002Fubermuda\u002Fgamache.\n\nRe-read your own entry when review changes what the branch does. The entry\nrides the branch, so a feature cut in review leaves a line that describes work\nthat never shipped. It is your own diff, which is the one you stop reading.\n\nA pull request about changelog discipline that changes a skill file earns a\nfragment, and it carries that fragment itself.\n\nThe subject of the squash commit ends with `(#209)`. So\n`git log --first-parent --grep='(#209)$'` recovers the commit from the number,\nand `gh pr view 209 --json mergeCommit` gives the SHA directly. Keep the `$` on\nthat grep. `--grep` reads the whole commit message, and a body that cites\nanother pull request in the same form matches as well. `--grep='(#371)'`\nreturns five commits with the real one last.\n\nEntries written before this rule carry a SHA. Leave them alone. An older entry\nkeeps the position that its SHA gives it in `git log --first-parent`. To match\nits 7-character SHA, derive it with `git rev-parse --short=7`, never with\n`git log --format=%h`. `%h` honours `core.abbrev`, which is unset here, so git\nreturns 8 characters today. A grep built on `%h` reports zero hits on every\ncommit. A row of zeros is a fault in the check before it is a hole in the file.\n\n## What the ruleset actually requires\n\n`main` allows `--squash` only. A plain `gh pr merge` fails with\n`GraphQL: Merge commits are not allowed on this repository`. Use\n`gh pr merge \u003Cn> --squash`.\n\nDo not diagnose a rejected merge with `gh repo view`. It reports repository\n*settings*. These say that all three merge methods are allowed, while the\nruleset forbids two. The ruleset is the authority:\n\n```bash\nid=$(gh api repos\u002Floupe-ac\u002Floupe\u002Frulesets -q '.[]|select(.name==\"main\")|.id')\ngh api repos\u002Floupe-ac\u002Floupe\u002Frulesets\u002F$id -q '.rules[]|select(.type==\"pull_request\")|.parameters'\n```\n\nThat prints `required_approving_review_count` 0, so GitHub needs no approving\nreview. Read the required checks from the same ruleset, named `main`:\n\n```bash\ngh api repos\u002Floupe-ac\u002Floupe\u002Frulesets\u002F$id \\\n  -q '.rules[]|select(.type==\"required_status_checks\")|.parameters.required_status_checks[].context'\n```\n\nOn 2026-10-31 it printed 18 contexts. One of them is `Loupe \u002F Approval`, the\ncheck that Loupe posts as its GitHub App. `docs\u002Fusing\u002Fworkflows.md` \"Approval\nof a pull request\" says when Loupe posts it. Run the command, and do not trust\nthat count. Nothing in the repository fails when it goes stale.\n\nNo ruleset covers `epic\u002F*`. A pull request into `epic\u002F\u003Cn>` gets the required\nchecks of `main` by name, and `--required` fails there. Never force-push an\nepic branch. `references\u002Fepics.md` holds the commands that check an epic child.\n\nAn approval in chat is not an approval. Check `Loupe \u002F Approval` on the head\nbefore you conclude that something else blocks a merge:\n\n```bash\ngh pr checks \u003Cn> --json name,bucket -q '.[]|select(.name==\"Loupe \u002F Approval\")'\ngh pr view \u003Cn> --json mergeStateStatus\n```\n\nA job that runs in CI but is not in that list cannot block anything. To add one\nis a repository setting, so a branch cannot do it. If you add a CI job, say in\nthe PR body that requiring it is still owed. Otherwise the job is decoration.\n\nNever approve your own work on GitHub.\n\nMerging does not stay with a human. A PR with *all required checks green*,\n`Loupe \u002F Approval` included, is good to merge. Merge it without asking, when no\nworkflow rule will merge it. A PR linked to a card belongs to the `merge-ready`\nrule, so leave it to that rule. Hand-merge only a PR that no rule reaches. The\napproval already carried the decision, and a wait for a second confirmation\nparks finished work in a queue. Follow the merge protocol above when you\nhand-merge one. Sync with current main, let the checks re-run on the synced\nhead, merge, then run `just cs` on main.\n\nNever merge something unapproved. Never merge past a failing or pending check.\nNever use `--admin` to bypass either.\n\n## Keep working, and stack when you are waiting\n\nDo not stop because a pull request is unmerged. Stack on it and carry on.\nStacking is the recommendation of the owner, and a wait for an approval is not a\nblock. Branch off the pull request your work needs, and build the next piece.\n\nGenuinely blocked means that there is nothing you can do. Examples are a\ndecision only the owner can make, a credential you do not have, or a service\nthat is down. An unapproved pull request is none of those. Neither is a queue.\n\nThis overrides the caution that a session may carry from a bad wave of stacked\nbranches. Every failure in that wave was a merge that git could not see. A\n`CONFLICTING` pull request also never ran CI, because `pull_request` does not\nfire without a merge commit. So the discipline is merge-protocol item 5, not\nabstinence. Push the merged result and read CI. Do not trust a clean\n`git merge`. Check that the stack is not `CONFLICTING` before you believe a\ngreen check.\n\nSay in the body which pull request the branch stacks on, and why. The reviewer\nneeds it, and so does whoever holds the merge queue. A stack has an order, and\napprovals that arrive out of sequence do not respect it.\n\n### Open a stacked pull request against its parent's branch\n\nA stacked pull request targets the branch of the pull request it stacks on.\nNever target `main` from it. Against `main`, GitHub shows the commits of the\nparent as part of the child.\n\n```bash\ngh pr create --base \u003Cparent-branch> --title \"\u003Ctitle>\" --body-file \u003Cfile>\ngh pr edit \u003Cn> --base \u003Cparent-branch>   # fix one opened against main\n```\n\n- Write `Stacks on #\u003Cparent>. Merge #\u003Cparent> first.` near the top of the body.\n- CI runs on every pull request, whatever its base. A pull request stacked on a\n  branch other than `main` has no required checks, so `--required` fails there.\n  Read `gh pr checks \u003Cn>` without `--required`, and count every check. The merge\n  stage checks an epic child by name against the required checks of `main`.\n- Never merge the child while it targets the branch of its parent. That merge\n  lands on the parent branch with no required check, and never reaches `main`.\n  An epic child that targets `epic\u002F\u003Cn>` is the exception, as \"A child of an epic\n  targets the epic branch\" says.\n\nWhen the parent squash-merges, the child still targets the branch of the\nparent. This repository keeps a merged branch (`delete_branch_on_merge` is\n`false`), so GitHub does not retarget the child. Do it yourself:\n\n```bash\ngh pr edit \u003Cn> --base main\ngit fetch origin && git merge origin\u002Fmain\n```\n\nMerge `main` in. Never rebase a branch that holds merge commits. Expect\nconflicts in files that the child only extends, because the squash gave `main`\nthe same content under a commit that shares no history with the child. Prove\nthe resolution with `references\u002Fconflicts.md`.\n\n### A child of an epic targets the epic branch\n\nWhen an epic has an `epic\u002F\u003Cn>` branch, each child cuts its branch from\n`origin\u002Fepic\u002F\u003Cn>`. Its pull request targets `epic\u002F\u003Cn>`, never `main` and never\nthe branch of a sibling. An epic whose breakdown ran before the epic branch\nexisted has no `epic\u002F\u003Cn>`, and its children target `main`.\n\nThe merge stage merges the child into `epic\u002F\u003Cn>` with no approval, and it\ncarries the preview links of the child to the epic pull request.\n`references\u002Fepics.md` holds how the child merges, what the epic pull request\nneeds, and how the epic preview refreshes.\n\nSo write each Preview line of a child with a signed link, or a plain link for a\nsigned-out page. Add its marker in backticks. The database of the child goes at\nteardown, and the epic preview runs `app:dev:seed` only. So write the state of\neach link in a module seeder of the branch. The seed of the epic preview then\nholds it once the child merges. A link whose record the seed lacks reads \"not\nproved\" on the epic pull request.\n\n## Running several branches at once\n\nGive each branch its own worktree, and keep the branches off the files of each\nother. Two shared files used to collide on every branch, and neither does now.\nOpen work lives on the board, not in the branch. A changelog entry lives in\n`changelog.d\u002F\u003Cnumber>.md`, not at one append point in `docs\u002FCHANGELOG.md`.\n\nSequence by blast radius. A branch that changes shared infrastructure, such as\ncompose files, environment resolution or CI wiring, should merge last. Its merge\ninvalidates the environment that its siblings are still gated in. Say so in its\nbody.\n\nLand signature changes early. A branch that makes an argument required grows\nmore dangerous with every sibling merged ahead of it. Each merge can bring a new\nfile that constructs the old shape (see merge protocol item 5).\n\nBatch by file overlap, not by theme. Two agents that edit the same module\nconflict, however unrelated their tasks sound.\n","# Working with pull requests\n\nEvery change reaches `main` through a pull request. `main` is protected, so no\npath skips this.\n\n## The branch name\n\nName a card branch `card-\u003Cnumber>-\u003Cslug>`. The slug is two to four lowercase words from the card title.\n\n## The gate, before you open anything\n\n1. `just cs` applies the formatter and rector fixes. Commit anything it\n   changed. It works from a worktree.\n2. Run `just phpstan`, `just arkitect` and `just gamache`. These check the\n   whole project. Then run `just prepush \u003Cbase>`, which fails on a stale\n   `openapi\u002F` file or a changed plugin without a greater version.\n3. Run PHPUnit on the tests for what changed: `just phpunit tests\u002F\u003Cpath>` or\n   `just phpunit --filter \u003Cname>`.\n4. Run `just js-test` when JavaScript changed, and `just cli-test` when `cli\u002F`\n   or `hooks\u002F` changed.\n5. Push. Run no Codex review. A separate review worker reviews the pull\n   request after the push (see \"The agent review\"). CI's required checks are\n   the full gate. Read them on the pull request, and fix every failure,\n   including ones that pre-date your change.\n\nA `PreToolUse` hook, `.agents\u002Fhooks\u002Fno-full-ci.sh`, refuses `just ci` and a\nfull PHPUnit run for an agent. The `audit` workflow runs `just audit` on `main` and each day, so the local\nlist leaves it out. A worker learns of a failed required check from the board, and the\n`checks-failed` fix round covers every required check.\n\ne2e is not in the local gate. Do not run the full suite locally before you open\nthe pull request. \"Running the suite locally is debugging, not gating\" lists\nthe e2e checks.\n\n### The agent review\n\nOpen every pull request as a draft: `gh pr create --draft`. A review worker\nreads the whole change at the head commit. That worker is never the worker that\nwrote the code. Loupe posts the result as the check `Loupe \u002F Agent review`,\nwith each finding beside its line. `docs\u002Fusing\u002Fworkflows.md` \"Agent review\"\ndescribes the flow.\n\n- A failed review asks for a fix at once. The fix round reads the findings of\n  the head commit from `card_get`, in `agentReview`.\n- When the review passes and CI is green, Loupe marks the pull request ready,\n  and the owner then sees it. The card moves to In review. Never run\n  `gh pr ready` yourself, and do not wait for the review of the owner to\n  un-draft it.\n- A draft that stays a draft after a passed review and green checks is a fault\n  of the setup. The usual cause is a workflow with no agent review rules, as\n  Lifecycle has, or a bridge with no `review` work entry. Say so in the body.\n- Ready does not mean merged. `main` still needs the check `Loupe \u002F Approval`,\n  and you never approve your own work.\n- Review the diff against `origin\u002F\u003Cbase>`, never `main`. The local `main` of a\n  worktree is often stale, so a review against it reports findings for\n  already-merged code.\n- A reviewer inside an implementation run still runs, such as the per-task\n  reviewer of the build notes. Those reviews are part of the build.\n\n### The Design System artifact rebuild\n\nAfter the gate checks, run `bin\u002Fagents\u002Fdesign-system-changed origin\u002F\u003Cbase>`. The\nscript prints the changed design system paths. It prints nothing when none\nchanged.\n\nWhen it prints a path, try the rebuild with the `loupe-design-rebuild` skill. Do\nnot skip this step. When the rebuild cannot write, as in a headless worker with\nno `Artifact` tool, write the line `Design system rebuild: pending` in the pull\nrequest body. Then follow `references\u002Fdesign-system-rebuild.md`, which raises\none non-blocking to-do for the owner and never a duplicate.\n\n## A check is a fault until you have seen it fail\n\nA check that comes back clean is a fault in the check, until it has failed on a\nknown-bad input.\n\nA check that comes back one short is a fault in the check, until you prove\notherwise. Nobody tests this direction, because a check that reports a problem\nlooks self-justifying.\n\nA tool reports what it did. It does not report what it found. Doing nothing\nsuccessfully and finding nothing wrong produce the same output. So break the\ncheck on purpose, and watch it go red. Then restore it and trust the green.\n\nConfirm that the break landed before you read the result, for example with\n`git diff --quiet`. A break with wrong escaping leaves the file unchanged, and\nthe green then reads as \"the rule is fine\". A falsifier that does nothing is the\nsame fault one level up, and it is the more convincing of the two.\n\n| Signal | What it cannot distinguish |\n|---|---|\n| `phpstan` exit 0 | a clean tree from a rule that never loaded |\n| a test that pins behaviour | the behaviour existing from the test not asserting it |\n| `just cs` reporting success | a fixer that ran from a rule that silently no-opped |\n| a conflict report naming one file | the other files being unchanged from being reverted |\n| `pass=10` on a pull request | a current head from a head that has since moved |\n\nA good falsifier is small. A file that calls a constructor with no arguments\nproves that an arity rule runs. Adding the forbidden filter to a listener proves\nthat the test which forbids it goes red.\n\nGrep is where the second direction bites. A pattern that cannot match one form\nof the line reports one short, while every line is present. Read the region. Do\nnot grep for what you expect to find.\n\nA conflict resolution needs the same proof. Before you accept a resolution of a\nshared prose file, or of a stacked branch after its parent squashed, read\n`references\u002Fconflicts.md`. Its `comm` checks prove that no entry and no test\ndisappeared.\n\n### Ask what reads what you write\n\nInert code looks wired up when its input is present. A changelog fold proposed\nfor `docker\u002Fprod\u002Frelease.sh` reads as plausible, because `COPY . .` puts\n`docs\u002FCHANGELOG.md` into the production image. Nothing reads it there.\n`grep -rn CHANGELOG src\u002F templates\u002F config\u002F public\u002F` returns nothing, and the\ncontainer filesystem is discarded on each deploy. The fold would have run,\nreported success and changed nothing.\n\nFor any step that writes something, name what reads it. Require a grep that\nfinds the reader. An input that exists is not evidence that anything consumes\nthe output.\n\n## Documentation-only branches run `just cs` and push\n\nSkip the local checks. Say so in the PR body, so the record shows that the gate\nwas reduced deliberately and not forgotten. CI still runs every check, e2e\nincluded, because Markdown is not inert here. Prettier covers some of it, the\ngamache checks read `docs\u002F`, and a docs commit can break a build that greps\nthem. The agent review still reads the pull request.\n\nThe test is the diff, not the intent. Every changed file must end in `.md`.\nCheck it, and do not assume:\n\n```bash\ngit diff --name-only origin\u002Fmain...HEAD | grep -v '\\.md$'\n```\n\nAny output at all means that the full gate applies. A branch that also touches\n`.env`, a Twig template, a fixture, `composer.json` or a `justfile` recipe is\nnot documentation-only, however small the change looks.\n\nThe reduced gate does not extend to Markdown that a script *executes*. A `.md`\nfile that a script parses for commands is code with a `.md` suffix, so gate it\nfully. A `SKILL.md` sits at the edge. An agent reads it and no script parses it,\nso the reduced gate applies. Note that call on the gate line.\n\nThe reason is proportion. A gate that can never fail teaches a reader to stop\ntrusting gate results.\n\n## Keep the body brief\n\nThe owner reads every body. Write it so that he can read it in under a minute.\nPut the full reasoning in the commit messages, because the squash keeps them in\n`git log`.\n\nAim for about 100 words on a small change, and stay under 250 on a large one.\nUse short bullets. Do not use paragraphs.\n\nWrite only these, and leave out any line that has nothing to say:\n\n- Preview links, at the top. Every pull request has them.\n- The URL of the board card the branch works, when a card exists.\n- One or two sentences on what changed and why.\n- The rejected alternative, in one sentence, when there was a real one.\n- What you verified, one line per check.\n- What you could not verify.\n- A decision the owner must make.\n- A deploy need, a breaking change, or a merge order.\n- One gate line, such as \"Gate: cs, phpstan, arkitect, gamache and\n  `tests\u002FModule\u002FBoard` green.\" Name a reduced gate on that line.\n\nLeave these out:\n\n- A heading for every item. `## Preview` is the only heading a body needs.\n- Any line that says something does not apply: \"nothing to click\", \"no deploy\n  need\", \"no changelog fragment\", \"the gate was not reduced\".\n- The diff restated in prose, a code block of the change, or a table per file.\n- A narrative of how you got there. That goes in the commit message.\n\nA reviewer asks for detail when he needs it. Answer in a comment. Do not grow\nthe body.\n\n## Make the branch testable, not just reviewable\n\nA reviewer who has to build state by hand usually will not.\n\nPut the preview links at the very top of the body, under a `## Preview`\nheading. They go before the decision, the summary and everything else. They are\nthe first thing the owner looks for, so nothing goes above them. A demo section\ntwo thirds of the way down, next to the gate results, makes the reviewer hunt.\n\"Try it\", \"Click it\" and \"Verification\" are typical names for such a section.\nLead with the links, then explain the change.\n\nGive each link a one-line label that says what state it shows. When a change has several states, seed one document per\nstate and link each. A reviewer who can see all of them side by side reviews\nwhat the code does. Otherwise the reviewer sees only the one case you seeded.\n\nPoint at the running instance, and sign the reader in. Every worktree serves its\nown branch at `https:\u002F\u002F\u003Cslug>.loupe.dev.localhost`. Do not put a bare page URL\nin the body. It lands the reader on the login page, and the reader must sign in\nby hand. Mint a signed link instead, from inside the worktree:\n\n```bash\n( cd .worktrees\u002F\u003Cname> && bin\u002Fworktrees\u002Fcompose-exec.sh \\\n    bin\u002Fconsole app:dev:preview-login-link --path=\u002Fprojects )\n```\n\nThe link signs the reader in and lands them on the page you named, so the body\nneeds no credentials at all. Use `--email=admin@loupe.test` for an admin page.\nThe link does not expire, so it still works when the reviewer reads the body\ndays later. The signature covers the whole URL, host included. A link therefore\nworks against that worktree only, and the host resolves on your own machine.\nThe route is `#[When('dev')]`, so it does not exist in production.\n\nOpen the link yourself before you write it down. Seed and prove every link\nbefore the push, not after it. A branch that cannot show its marker is not\npushed as ready.\n\n### Prove each preview link shows its state\n\nA headless session cannot look at a page, so it proves each link with `curl`.\nDo this before you write the body. Pick a marker that the diff adds to the\npage: a translated label, a data attribute or a CSS class. A marker that the\npage showed before the branch proves nothing.\n\n```bash\nlink=$( ( cd .worktrees\u002F\u003Cname> && bin\u002Fworktrees\u002Fcompose-exec.sh \\\n    bin\u002Fconsole app:dev:preview-login-link --path=\u002Fprojects ) | tail -1 )\njar=$(mktemp) page=$(mktemp)\n\u002Fusr\u002Fbin\u002Fcurl -sSL -c \"$jar\" -b \"$jar\" -o \"$page\" \\\n    -w '%{http_code} %{url_effective}\\n' \"$link\"\ngrep -c 'Your projects' \"$page\"\n```\n\nThe link signs the reader in, sets a session cookie and redirects. Without the\ncookie jar, the redirect lands on `\u002Flogin`. The macOS `\u002Fusr\u002Fbin\u002Fcurl` trusts the\nlocal certificate authority through the keychain, so it needs no `-k`.\n\nRead two results. The effective URL must end in the `--path` you minted, or the\nsign-in failed. The count must be 1 or more, or the state is not seeded. For a\nsigned link, fetch the bare page URL once without the link, and confirm that\nthe count is 0.\n\nA page that shows records needs a second proof. The marker must show only when\nthe page holds its data. A page title, a heading, a panel id or a chart\ncontainer fails, because the page renders them with no data too. In\n`pr:loupe-ac\u002Floupe#1381`, the Metrics marker `data-metrics-title` counted 1 on a\nproject with 0 runs, so every chart was empty. Pick a marker that the template\nprints once for each record, such as a row id or a `data-series` attribute.\nThe module seeder that writes the data also writes an empty twin of the record\nwith a fixed id. Mint a link to that path, and fetch it with the same cookie jar:\n\n```bash\ntwin=$( ( cd .worktrees\u002F\u003Cname> && bin\u002Fworktrees\u002Fcompose-exec.sh \\\n    bin\u002Fconsole app:dev:preview-login-link --path=\u002Fprojects\u002F\u003Ctwin id>\u002Fanalytics\u002Fmetrics ) | tail -1 )\n\u002Fusr\u002Fbin\u002Fcurl -sSL -c \"$jar\" -b \"$jar\" -o \"$page\" \\\n    -w '%{http_code} %{url_effective}\\n' \"$twin\"\ngrep -c 'data-series' \"$page\"\n```\n\nThe count on the twin page must be 0. The bare URL fetch proves the sign-in,\nand the twin fetch proves the data. End the line with the empty path:\n\n```markdown\n- [Metrics, three runs](https:\u002F\u002Fcard-42.loupe.dev.localhost\u002Fdev\u002Fpreview-login?…), marker `data-series`, empty `\u002Fprojects\u002F\u003Ctwin id>\u002Fanalytics\u002Fmetrics`\n```\n\nA state that shows no records, such as a form or a dialog, ends with `no data`.\n\nWrite one Markdown list item per link in the Preview section. Name the marker\nthat you found:\n\n```markdown\n- [Board, empty Next column](https:\u002F\u002Fcard-42.loupe.dev.localhost\u002Fdev\u002Fpreview-login?…), marker `lp-empty-state`, no data\n```\n\nA page that only a signed-out visitor sees, such as the landing page at `\u002F`,\ntakes a plain link. A signed link signs the reader in, and the page then\nredirects. Prove the plain link with the same `curl`, with no cookie jar, and\nend the line with `. Signed out.`. The plain link is the bare page URL, so skip\nthe zero-count fetch. The effective URL must end in the path, and the count\nmust be 1 or more. The marker must not be on `main`:\n\n```markdown\n- [Landing page](https:\u002F\u002Fcard-42.loupe.dev.localhost\u002F), marker `rel=\"help\"`. Signed out.\n```\n\nA link to a file, an artifact or a CI run\ntakes the same shape with no marker. So does the card line:\n`- [Card 42: \u003Ctitle>](\u003Ccard URL>)`.\n\nA branch that changes a page and cannot show its marker is not ready.\n\"The tests cover it\", \"the seed holds no X\" and \"it shows after a bridge\nreports data\" do not replace a seeded state.\n\nEvery pull request has a Preview section. When a branch changes no page, link\nwhat the reviewer reads instead. That is each changed file rendered on GitHub,\na published artifact, or the CI run that shows the change working. Pin a GitHub\nlink to the pushed commit SHA, and not to the branch name. The link then shows\nthe code under review after the branch moves.\n\nPut the card URL on its own line under the Preview section, when a card exists.\n`loupe-board` says how to build that URL and how to add the pull request to the\ncard.\n\nEvery such URL must be clickable. That means one whole absolute URL in plain\ntext. A body with several pages to point at tends to give a bare host followed\nby paths in backticks. That renders as unclickable code spans, and the reviewer\nhas to assemble each URL by hand. That friction is enough to lose the click\nthat the seeding was for. So follow these rules:\n\n- Put no backticks around a URL.\n- Write no relative paths under a host that you give once.\n- Leave no `\u003Cslug>` or other placeholder for the reader to substitute.\n- Write the full `https:\u002F\u002F\u003Cslug>.loupe.dev.localhost\u002Fprojects\u002F…\u002Freview` per\n  destination, even when that repeats the host five times.\n- Paste one into a browser before you open the pull request.\n\nLeave the `## Preview` section in the body. The squash message is the commit\nmessages of the branch, and the merge sends no body, so the links never reach\n`git log`. A signed `*.dev.localhost` link points at a worktree that is torn\ndown within hours. Name the commit that the preview was built from, so a later\nreader knows which code the links showed. Never write \"this branch's head\". The\nphrase is true of every branch at every moment, so no reader can check it. The\nmerge stage copies the links of an epic child to the epic pull request after the\nmerge.\n\nThe same rule covers a branch with no worktree of its own. Link the page on\nwhatever instance does serve it. Do not describe the route and leave the reader\nto construct it.\n\nA branch that adds no route can still produce reviewable output, such as HTML\nfrom a renderer, a generated report or a file. Publish the output as an\nartifact and link it. Say which questions it answers and which it defers.\n\nSeed the data the change needs. `bin\u002Fconsole app:dev:seed` fills the database\nwith the demo dataset of the module seeders, which covers most pages. A diff\nfeature is untestable without a document that carries several versions. When\nthe dataset lacks the state, extend the module seeder in the branch. Give each\nrecord that a link names a fixed id. Write the exact shape the bug had, not\nmerely a happy path. A page behind a flag adds the flag to\n`DevFeatureFlagSeeder`. A link to an account page names a demo account, never\nthe dev or the admin account. Tell the reviewer which link to open and what to\nlook for.\n\n## Reviewing work you did not write\n\nA green gate is not evidence that the change is correct. One wave had six green\nbranches, and a review found a real defect in every one. The gate proves that\nthe suite passes. It does not prove that the change is right.\n\nSo read the diff yourself, especially the part that the author called routine.\nAn agent can report a decision that it made on your behalf. Check whether that\ndecision is orthogonal to the open questions it claims not to touch. One wave\nbranch added a unique index and called it unrelated to a design decision that\nit foreclosed.\n\nSend findings back to whoever wrote the code, not to a fresh agent. The author\nstill has the context. The second-order questions, such as \"does anything else\nin this file have the same shape?\", catch the bug the reviewer did not spot.\nAsk for a reproduction of the failure against the pre-fix code. You then know\nthat the new test discriminates and does not pass vacuously.\n\n## Running the suite locally is debugging, not gating\n\nThe eight `e2e-*` legs are the gate: `e2e-chromium`, `e2e-chromium-2` to\n`e2e-chromium-6`, `e2e-rest` and `e2e-global-flags`. They run the same\n`just e2e` against a disposable stack, with both `E2E_BASE_URL` and\n`MAILPIT_URL` set correctly. See `.github\u002Fworkflows\u002Fci.yml`.\n\nThe six chromium legs split that project per test. `rest` runs admin and the\ndestructive chain, and `global-flags` runs alone. Each leg is on its own runner\nwith its own stack. Read the red leg for the failure. `maxFailures: 1` is per\nprocess, so a red run can report one failure in each leg.\n\nEach leg is a required check only after the owner adds it to the main ruleset.\nOn `main`, the `lint` job fails and names each leg that the ruleset does not\nrequire.\n\nLocally the suite is slower, destructive, and fails for reasons unrelated to the\ndiff. So push, then read the checks, and fix every failure they report. Run one\nnamed spec locally while you change or debug it, with\n`just e2e tests\u002F\u003Carea>\u002F\u003Cspec>.spec.ts`. The `.agents\u002Fhooks\u002Fno-full-e2e.sh` hook\nrefuses a full run.\n\nA run with `E2E_BASE_URL` set by hand to a sibling worktree wipes the dev data\nof that worktree and skips the automatic repair. Run\n`bin\u002Fworktrees\u002Fworktree-bootstrap.sh \u003Cworktree-name>` after it, and read\n`project-e2e` `references\u002Fsibling-worktree-run.md` before it.\n\n## Merging\n\nThe `main` ruleset sets `strict_required_status_checks_policy` to `true`, so\nGitHub refuses a merge from a branch that is behind `main`. The sync below is a\nhard block, not a caution. Every merge to `main` puts every other open branch\nbehind, so a queue of N branches costs N sync-and-gate cycles. Two sessions\ncannot interleave their merges, so one session holds the queue at a time.\n\nBefore you hand-merge a pull request, or while you hold the queue, read\n`references\u002Fmerging.md`. It holds the detail of item 5, item 7 on a \"not\nmergeable\" error after a push, and item 8 on how to count the checks of the\nhead you merge. A green reading of an old head merges untested code.\n\n1. The final gate of a branch happens on the branch fully merged with current\n   main. A branch cut before a sibling merged has not really been gated. Its\n   e2e run never exercised the specs of the sibling against its code.\n2. Merge immediately after the gate goes green. Any merge to `main` between the\n   last sync of a branch and its own merge invalidates its PR through\n   conflicts, or invalidates its gate.\n3. After every merge, run `just cs` on main and commit the drift. A merge of two\n   individually clean branches produces fixer drift. Otherwise that drift lands\n   on whichever branch syncs next. The changelog needs nothing from you, because\n   the image build folds the fragments itself.\n4. Tear down the worktree of a merged branch only after `gh pr merge` is\n   confirmed. Never do it in the same command chain. Confirm the merge by reading\n   the result, not by having issued the command. A merge can fail for a reason\n   that is not a conflict, such as mergeability still computing or a check that\n   flipped. A tree destroyed first turns a retry into a rebuild from origin.\n   Nothing is lost while the branch is still on origin, so verify that before\n   anything else.\n5. A conflict-free merge is not a correct merge. A class rename on one branch\n   and a *new* file on another that uses the old name merge with no conflict.\n   So does a required argument against a new file that constructs the old\n   shape. Push the merged result and read CI before you trust such a merge.\n6. A resolution that takes one side can silently revert the fix of the other\n   side. Before you accept a resolution, re-verify the *behaviour* that both\n   branches were protecting. The absence of markers is not enough. The sharpest\n   form is rename\u002Frename. There neither side is correct, and the answer is the\n   content of the newer branch at the path of the other branch.\n\n## The changelog entry rides the pull request it describes\n\nEvery pull request that changes something a reader can act on carries its own\nchangelog fragment, in its own branch, at `changelog.d\u002F\u003Cnumber>.md`. Write it as\nyou write the change. Do not open a second pull request for it. Never edit\n`docs\u002FCHANGELOG.md` itself. `changelog.d\u002FREADME.md` holds the format, the six\ntags, the exemptions and how the fragments reach a reader.\n\nNothing checks that a branch carries a fragment at all. `just lint` runs\n`php bin\u002Fchangelog.php --check`, which reads format only. So the rule above is\nyours to keep. A rule that checks it belongs in a pull request on\nhttps:\u002F\u002Fgithub.com\u002Fubermuda\u002Fgamache.\n\nRe-read your own entry when review changes what the branch does. The entry\nrides the branch, so a feature cut in review leaves a line that describes work\nthat never shipped. It is your own diff, which is the one you stop reading.\n\nA pull request about changelog discipline that changes a skill file earns a\nfragment, and it carries that fragment itself.\n\nThe subject of the squash commit ends with `(#209)`. So\n`git log --first-parent --grep='(#209)$'` recovers the commit from the number,\nand `gh pr view 209 --json mergeCommit` gives the SHA directly. Keep the `$` on\nthat grep. `--grep` reads the whole commit message, and a body that cites\nanother pull request in the same form matches as well. `--grep='(#371)'`\nreturns five commits with the real one last.\n\nEntries written before this rule carry a SHA. Leave them alone. An older entry\nkeeps the position that its SHA gives it in `git log --first-parent`. To match\nits 7-character SHA, derive it with `git rev-parse --short=7`, never with\n`git log --format=%h`. `%h` honours `core.abbrev`, which is unset here, so git\nreturns 8 characters today. A grep built on `%h` reports zero hits on every\ncommit. A row of zeros is a fault in the check before it is a hole in the file.\n\n## What the ruleset actually requires\n\n`main` allows `--squash` only. A plain `gh pr merge` fails with\n`GraphQL: Merge commits are not allowed on this repository`. Use\n`gh pr merge \u003Cn> --squash`.\n\nDo not diagnose a rejected merge with `gh repo view`. It reports repository\n*settings*. These say that all three merge methods are allowed, while the\nruleset forbids two. The ruleset is the authority:\n\n```bash\nid=$(gh api repos\u002Floupe-ac\u002Floupe\u002Frulesets -q '.[]|select(.name==\"main\")|.id')\ngh api repos\u002Floupe-ac\u002Floupe\u002Frulesets\u002F$id -q '.rules[]|select(.type==\"pull_request\")|.parameters'\n```\n\nThat prints `required_approving_review_count` 0, so GitHub needs no approving\nreview. Read the required checks from the same ruleset, named `main`:\n\n```bash\ngh api repos\u002Floupe-ac\u002Floupe\u002Frulesets\u002F$id \\\n  -q '.rules[]|select(.type==\"required_status_checks\")|.parameters.required_status_checks[].context'\n```\n\nOn 2026-10-31 it printed 18 contexts. One of them is `Loupe \u002F Approval`, the\ncheck that Loupe posts as its GitHub App. `docs\u002Fusing\u002Fworkflows.md` \"Approval\nof a pull request\" says when Loupe posts it. Run the command, and do not trust\nthat count. Nothing in the repository fails when it goes stale.\n\nNo ruleset covers `epic\u002F*`. A pull request into `epic\u002F\u003Cn>` gets the required\nchecks of `main` by name, and `--required` fails there. Never force-push an\nepic branch. `references\u002Fepics.md` holds the commands that check an epic child.\n\nAn approval in chat is not an approval. Check `Loupe \u002F Approval` on the head\nbefore you conclude that something else blocks a merge:\n\n```bash\ngh pr checks \u003Cn> --json name,bucket -q '.[]|select(.name==\"Loupe \u002F Approval\")'\ngh pr view \u003Cn> --json mergeStateStatus\n```\n\nA job that runs in CI but is not in that list cannot block anything. To add one\nis a repository setting, so a branch cannot do it. If you add a CI job, say in\nthe PR body that requiring it is still owed. Otherwise the job is decoration.\n\nNever approve your own work on GitHub.\n\nMerging does not stay with a human. A PR with *all required checks green*,\n`Loupe \u002F Approval` included, is good to merge. Merge it without asking, when no\nworkflow rule will merge it. A PR linked to a card belongs to the `merge-ready`\nrule, so leave it to that rule. Hand-merge only a PR that no rule reaches. The\napproval already carried the decision, and a wait for a second confirmation\nparks finished work in a queue. Follow the merge protocol above when you\nhand-merge one. Sync with current main, let the checks re-run on the synced\nhead, merge, then run `just cs` on main.\n\nNever merge something unapproved. Never merge past a failing or pending check.\nNever use `--admin` to bypass either.\n\n## Keep working, and stack when you are waiting\n\nDo not stop because a pull request is unmerged. Stack on it and carry on.\nStacking is the recommendation of the owner, and a wait for an approval is not a\nblock. Branch off the pull request your work needs, and build the next piece.\n\nGenuinely blocked means that there is nothing you can do. Examples are a\ndecision only the owner can make, a credential you do not have, or a service\nthat is down. An unapproved pull request is none of those. Neither is a queue.\n\nThis overrides the caution that a session may carry from a bad wave of stacked\nbranches. Every failure in that wave was a merge that git could not see. A\n`CONFLICTING` pull request also never ran CI, because `pull_request` does not\nfire without a merge commit. So the discipline is merge-protocol item 5, not\nabstinence. Push the merged result and read CI. Do not trust a clean\n`git merge`. Check that the stack is not `CONFLICTING` before you believe a\ngreen check.\n\nSay in the body which pull request the branch stacks on, and why. The reviewer\nneeds it, and so does whoever holds the merge queue. A stack has an order, and\napprovals that arrive out of sequence do not respect it.\n\n### Open a stacked pull request against its parent's branch\n\nA stacked pull request targets the branch of the pull request it stacks on.\nNever target `main` from it. Against `main`, GitHub shows the commits of the\nparent as part of the child.\n\n```bash\ngh pr create --base \u003Cparent-branch> --title \"\u003Ctitle>\" --body-file \u003Cfile>\ngh pr edit \u003Cn> --base \u003Cparent-branch>   # fix one opened against main\n```\n\n- Write `Stacks on #\u003Cparent>. Merge #\u003Cparent> first.` near the top of the body.\n- CI runs on every pull request, whatever its base. A pull request stacked on a\n  branch other than `main` has no required checks, so `--required` fails there.\n  Read `gh pr checks \u003Cn>` without `--required`, and count every check. The merge\n  stage checks an epic child by name against the required checks of `main`.\n- Never merge the child while it targets the branch of its parent. That merge\n  lands on the parent branch with no required check, and never reaches `main`.\n  An epic child that targets `epic\u002F\u003Cn>` is the exception, as \"A child of an epic\n  targets the epic branch\" says.\n\nWhen the parent squash-merges, the child still targets the branch of the\nparent. This repository keeps a merged branch (`delete_branch_on_merge` is\n`false`), so GitHub does not retarget the child. Do it yourself:\n\n```bash\ngh pr edit \u003Cn> --base main\ngit fetch origin && git merge origin\u002Fmain\n```\n\nMerge `main` in. Never rebase a branch that holds merge commits. Expect\nconflicts in files that the child only extends, because the squash gave `main`\nthe same content under a commit that shares no history with the child. Prove\nthe resolution with `references\u002Fconflicts.md`.\n\n### A child of an epic targets the epic branch\n\nWhen an epic has an `epic\u002F\u003Cn>` branch, each child cuts its branch from\n`origin\u002Fepic\u002F\u003Cn>`. Its pull request targets `epic\u002F\u003Cn>`, never `main` and never\nthe branch of a sibling. An epic whose breakdown ran before the epic branch\nexisted has no `epic\u002F\u003Cn>`, and its children target `main`.\n\nThe merge stage merges the child into `epic\u002F\u003Cn>` with no approval, and it\ncarries the preview links of the child to the epic pull request.\n`references\u002Fepics.md` holds how the child merges, what the epic pull request\nneeds, and how the epic preview refreshes.\n\nSo write each Preview line of a child with a signed link, or a plain link for a\nsigned-out page. Add its marker in backticks. The database of the child goes at\nteardown, and the epic preview runs `app:dev:seed` only. So write the state of\neach link in a module seeder of the branch. The seed of the epic preview then\nholds it once the child merges. A link whose record the seed lacks reads \"not\nproved\" on the epic pull request.\n\n## Running several branches at once\n\nGive each branch its own worktree, and keep the branches off the files of each\nother. Two shared files used to collide on every branch, and neither does now.\nOpen work lives on the board, not in the branch. A changelog entry lives in\n`changelog.d\u002F\u003Cnumber>.md`, not at one append point in `docs\u002FCHANGELOG.md`.\n\nSequence by blast radius. A branch that changes shared infrastructure, such as\ncompose files, environment resolution or CI wiring, should merge last. Its merge\ninvalidates the environment that its siblings are still gated in. Say so in its\nbody.\n\nLand signature changes early. A branch that makes an argument required grows\nmore dangerous with every sibling merged ahead of it. Each merge can bring a new\nfile that constructs the old shape (see merge protocol item 5).\n\nBatch by file overlap, not by theme. Two agents that edit the same module\nconflict, however unrelated their tasks sound.\n",{"name":5,"description":7},"main","b0ae29efd5410c4e5bf9a6ed6aed4b6c1d82e55a",".agents\u002Fskills\u002Fworking-with-prs",0,"https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe","https:\u002F\u002Floupe.ac\u002F","https:\u002F\u002Fgithub.com\u002Floupe-ac","The control plane for your agent loops.","2026-11-15 04:50:14",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add loupe-ac\u002Floupe --skill working-with-prs",{"tool":39,"command":40},"bunx","bunx skills add loupe-ac\u002Floupe --skill working-with-prs",{"tool":42,"command":43},"pnpm","pnpm dlx skills add loupe-ac\u002Floupe --skill working-with-prs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworking-with-prs\u002FSKILL.md",true,[47,53,57,61,65],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fconflicts.md","REFERENCE","参考文档",2266,"https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworking-with-prs\u002Freferences\u002Fconflicts.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fdesign-system-rebuild.md",1240,"https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworking-with-prs\u002Freferences\u002Fdesign-system-rebuild.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fepics.md",2500,"https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworking-with-prs\u002Freferences\u002Fepics.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fmerging.md",4212,"https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworking-with-prs\u002Freferences\u002Fmerging.md",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Freading-the-rollup.md",1438,"https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworking-with-prs\u002Freferences\u002Freading-the-rollup.md",[70,77,84,91,98,105],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M75XHSK6MYZ0BH7PJHP378QV","loupe-workers","Use when reading worker runs or bridges through the loupe MCP, stopping, resuming or holding workers, cancelling a bridge command, or recovering workers after a usage limit or network outage.","https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002Fplugins\u002Floupe\u002Fskills\u002Floupe-workers\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M75XHPW77P75PPWY8Z7Q9XMZ","loupe-site-review","Use when acting on live-review feedback through the loupe MCP: reading the feedback of a card or project, fixing it, or marking it addressed.","https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002Fplugins\u002Floupe\u002Fskills\u002Floupe-site-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M75XHK6EZP2FZRQ1B4PS4CGH","loupe-inbox","Use when an agent needs a decision, answer or review from the project owner through the loupe MCP, hands a question or to-do to a person, resumes after an ask closed, or needs its session id.","https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002Fplugins\u002Floupe\u002Fskills\u002Floupe-inbox\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M75XHDN9XG71R4T248BZ540A","loupe-documents","Use when writing or revising a document for the Loupe app through the loupe MCP, such as a plan, spec, RFC, audit report or retrospective.","https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002Fplugins\u002Floupe\u002Fskills\u002Floupe-documents\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M75XHBERM2SWJ7SJ1EB5M4SB","loupe-discovery","Use when a bridge runs a discovery run of a Loupe project, when a prompt names loupe-discovery, or when writing a readiness report.","https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002Fplugins\u002Floupe\u002Fskills\u002Floupe-discovery\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M75XH7X2KCFWPVMQJJAMPYJN","loupe-board","Use when working a Loupe project board through the loupe MCP: reading or writing a card, moving a card, changing the columns, or linking a document or a pull request to a card.","https:\u002F\u002Fgithub.com\u002Floupe-ac\u002Floupe\u002Fblob\u002Fmain\u002Fplugins\u002Floupe\u002Fskills\u002Floupe-board\u002FSKILL.md",[],[]]