From c8c23d4d7a92f03dd70ed37ae6985d52a03ff4d2 Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 12 Nov 2026 18:44:29 +0300 Subject: [PATCH 1/6] Name the exact commands of two skills and `AGENTS.md`. `check-pr-failures` and `write-context-doc` list only the commands they run, so any other command asks first. Each `gh` call of `check-pr-failures` names `google/site-kit-wp`, so it works in a checkout whose remote is a fork. Its `gh api` calls pass `--method GET`, which its list allows. `AGENTS.md` gives the test commands of `implement-issue`, which run the tests of the changed files and end. `npm run test` runs Jest in watch mode, which never ends. --- .agents/skills/check-pr-failures/SKILL.md | 18 +++++++++--------- .agents/skills/write-context-doc/SKILL.md | 2 +- AGENTS.md | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.agents/skills/check-pr-failures/SKILL.md b/.agents/skills/check-pr-failures/SKILL.md index 73e6dfd5fe1..d38321c74f1 100644 --- a/.agents/skills/check-pr-failures/SKILL.md +++ b/.agents/skills/check-pr-failures/SKILL.md @@ -7,7 +7,7 @@ description: > check or watch a PR's checks, or to work through test failures on a pull request (e.g. "why is CI failing on #12345", "check the failures on my PR", "/check-pr-failures 12345"). argument-hint: "[pr-number]" -allowed-tools: Bash, Read, Grep, Glob, Edit, Write +allowed-tools: Read Grep Glob Edit Write Bash(gh pr checks *) Bash(gh pr view *) Bash(gh run list *) Bash(gh run view *) Bash(gh api --method GET *) Bash(gh issue list *) Bash(git merge-base *) Bash(git worktree *) Bash(npm install *) Bash(npm run build:test *) Bash(npm run test:e2e *) Bash(npm run test:visualtest *) --- # Check a pull request's CI failures @@ -26,7 +26,7 @@ order. Don't guess how long they will take. Estimate it from recent passing runs workflow, using the workflow's file name from `.github/workflows/`: ``` -gh run list --workflow --status success --limit 5 --json databaseId,createdAt,updatedAt \ +gh run list --repo google/site-kit-wp --workflow --status success --limit 5 --json databaseId,createdAt,updatedAt \ --jq '.[] | "\(.databaseId)\t\(((.updatedAt | fromdate) - (.createdAt | fromdate)) / 60 | floor) min"' ``` @@ -34,7 +34,7 @@ A run's time includes any time it spent queued. For the time of each job on its those run IDs: ``` -gh run view --json jobs \ +gh run view --repo google/site-kit-wp --json jobs \ --jq '.jobs[] | select(.conclusion == "success") | "\(((.completedAt | fromdate) - (.startedAt | fromdate)) / 60 | floor) min\t\(.name)"' ``` @@ -42,7 +42,7 @@ Tell the user when to expect the slowest check. Rather than polling by hand, wat report each one as it lands: ``` -gh api "repos/google/site-kit-wp/commits/$(gh pr view --json headRefOid --jq .headRefOid)/check-runs?per_page=100" \ +gh api --method GET "repos/google/site-kit-wp/commits/$(gh pr view --repo google/site-kit-wp --json headRefOid --jq .headRefOid)/check-runs?per_page=100" \ --jq '.check_runs[]? | select(.status=="completed") | select(.conclusion!="skipped") | "\(.conclusion|ascii_upcase): \(.name)"' ``` @@ -64,8 +64,8 @@ already settled. ## Step 1 — Collect the check results ``` -gh pr checks -gh api "repos/google/site-kit-wp/commits/$(gh pr view --json headRefOid --jq .headRefOid)/check-runs?per_page=100" \ +gh pr checks --repo google/site-kit-wp +gh api --method GET "repos/google/site-kit-wp/commits/$(gh pr view --repo google/site-kit-wp --json headRefOid --jq .headRefOid)/check-runs?per_page=100" \ --jq '.check_runs[] | select(.conclusion=="failure" or .status!="completed") | "\(.status)\t\(.conclusion // "-")\t\(.name)"' ``` @@ -78,7 +78,7 @@ not workflow level, before telling anyone what broke. ## Step 2 — Get the failure detail ``` -gh run view --log-failed +gh run view --repo google/site-kit-wp --log-failed ``` Check-run **annotations are usually useless** (`Process completed with exit code 1`). The job @@ -127,8 +127,8 @@ PR's, make sure the result repeats: the test fails on every run here and passes the merge base. Then check whether the same job has recently failed on `develop`: ``` -gh run list --workflow --branch develop --status failure --limit 10 -gh run view --log-failed +gh run list --repo google/site-kit-wp --workflow --branch develop --status failure --limit 10 +gh run view --repo google/site-kit-wp --log-failed ``` If any of those runs failed the same test, the test is flaky. Report it as flaky, with links to diff --git a/.agents/skills/write-context-doc/SKILL.md b/.agents/skills/write-context-doc/SKILL.md index d4469d77f15..3cf73a98717 100644 --- a/.agents/skills/write-context-doc/SKILL.md +++ b/.agents/skills/write-context-doc/SKILL.md @@ -7,7 +7,7 @@ description: > (e.g. "document the new prompts system in docs/context", "rewrite the Notices section of admin-features.md", "update the context doc for this change") in the google/site-kit-wp repo. argument-hint: "[doc-path-or-system]" -allowed-tools: Bash, Read, Grep, Glob, Edit, Write +allowed-tools: Read Grep Glob Edit Write Bash(git diff *) --- # Write a context doc diff --git a/AGENTS.md b/AGENTS.md index 36cf8bb1a28..c6be3001fc4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,7 +45,7 @@ only for a rule that must hold even when the skill does not run. - `npm run build` / `npm run dev` - Asset builds - `npm run lint` / `composer run lint` - Code quality -- `npm run test` / `composer run test` - Run tests +- `npm -w tests/js run test:js -- ` / `composer test -- --filter ` - Run the tests of the files you changed - `npm run watch` - Development auto-rebuild ### Key Config Files From f91523f10f20b959314bc8ff486a5e6491f44a52 Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 12 Nov 2026 18:44:32 +0300 Subject: [PATCH 2/6] Make `implement-issue` run the checks CI runs. The skill runs the type check, the style lint and PHPStan on the files it changed, and the tests of each caller. Its fixers change those files alone. It checks a change in Storybook, in place of a hand-made copy of the styles. It fixes the code rather than the check, and reads why code was written before it changes that code. It lists only the commands it runs, and each GitHub read names the repository. --- .agents/skills/implement-issue/SKILL.md | 38 ++++++++----------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/.agents/skills/implement-issue/SKILL.md b/.agents/skills/implement-issue/SKILL.md index b0d4d04db68..67b6857078e 100644 --- a/.agents/skills/implement-issue/SKILL.md +++ b/.agents/skills/implement-issue/SKILL.md @@ -6,7 +6,7 @@ description: > "implement issue #12345", "build the feature in issue 12345", "follow the implementation brief for #12345") in the google/site-kit-wp repo. argument-hint: "[issue-number]" -allowed-tools: Bash, Read, Grep, Glob, Edit, Write +allowed-tools: Read Grep Glob Edit Write Bash(gh issue view *) Bash(gh pr list *) Bash(git status *) Bash(git diff *) Bash(git log *) Bash(git blame *) Bash(git grep *) Bash(git switch -c *) Bash(git checkout -b *) Bash(npm run lint:js:files *) Bash(npm run typecheck-staged *) Bash(npx stylelint *) Bash(npm run build:dev *) Bash(npm -w tests/js run test:js *) Bash(npm run storybook *) Bash(npm run test:visualtest *) Bash(npm run test:visualapprove *) Bash(composer lint *) Bash(composer lint-fix *) Bash(composer analyze *) Bash(composer test *) --- # Implement a GitHub issue @@ -21,8 +21,7 @@ convention docs relevant to the issue (see the map in Step 3). ## Step 1 — Fetch and parse the issue -Fetch the issue from `google/site-kit-wp` (e.g. `gh issue view --json title,body,labels`, -or the GitHub MCP issue tools). +Fetch the issue from `google/site-kit-wp` (e.g. `gh issue view --repo google/site-kit-wp --json title,body,labels`, or the GitHub MCP issue tools). Site Kit issues follow `.github/ISSUE_TEMPLATE/feature_request.md`. Extract these sections verbatim: @@ -56,11 +55,7 @@ builds on, `(see #13005)` for the extension point it leaves open, "the create va #13022" for the half that isn't yours. Those references carry requirements that the issue in front of you does not repeat. -Collect every issue referenced anywhere in the Feature Description, Acceptance criteria, -Implementation Brief and Test Coverage — `#12345`, a full `github.com/google/site-kit-wp/issues/…` -URL, the parent epic, and anything GitHub lists as linked — and read each one with -`gh issue view --json title,body,state,url` **before** you start implementing. From -each, take: +Collect every issue mentioned anywhere in the Feature Description, Acceptance criteria, Implementation Brief and Test Coverage. That covers `#12345`, a full `github.com/google/site-kit-wp/issues/…` URL, the parent epic, and anything GitHub lists as linked. Read each one with `gh issue view --repo google/site-kit-wp --json title,body,state,url` **before** you start implementing. From each, take: - **What it delivered**, when it is closed — the classes, selectors, hooks and constants your brief expects to already be there. Confirm they exist in the branch you are on; a closed @@ -142,6 +137,7 @@ Follow the conventions you loaded in Step 3. In addition: (see `docs/context/js/feature-flags.md`). - Cover every Implementation Brief checkbox and Acceptance criterion. Implement the **Test Coverage** items as real tests. +- **Code whose reason you can't see.** Before you change or delete existing code whose reason the code doesn't show, read its `git blame` and the pull request that added it. `gh pr list --repo google/site-kit-wp --search --state merged` finds that pull request. ## Step 5 — Self-review @@ -154,29 +150,19 @@ written and passing. Run, and fix anything that fails: +- **Fix the code, not the check**: add no `eslint-disable`, `phpcs:ignore` or `@phpstan-ignore`, no PHPStan baseline entry and no moved threshold, and make no test easier to pass. Where one such move is right, say why in your summary (Step 7). - **Lint** — prefer scoping to the files you touched over the whole codebase: - - JS: `npm run lint:js:files -- ` (auto-fix the full codebase with - `npm run lint:js-fix`, or just your files with - `npm run lint:js:files -- --fix `). - - PHP: `composer lint -- ` (auto-fix with `composer lint-fix`). + - JS: `npm run lint:js:files -- ` (auto-fix with `npm run lint:js:files -- --fix `). + - PHP: `composer lint -- ` (auto-fix with `composer lint-fix -- `). +- **Type check**: `npm run typecheck-staged -- `, over each `.ts` and `.tsx` file you touched. +- **Style lint**: `npx stylelint `, over each `.scss` file you touched. +- **PHPStan**: `composer analyze -- `, over each PHP file you touched under `includes/`. - **Build** — `npm run build:dev` when JS/asset changes are non-trivial. - **Tests** — run the **specific** test files you touched, not the whole suite: - JS: `npm -w tests/js run test:js -- ` - PHP: `composer test -- --filter ` -- **Visual check (any change that affects rendering)** — for SCSS, layout, spacing, - alignment, or responsive rules, **render the change and look at it** before declaring it - done. Lint and build passing do **not** prove visual correctness, and a change that looks - like a trivial value tweak in the brief can still be visually wrong. Prefer the Storybook - story at the affected viewport(s); if no dev server is running, build a throwaway HTML - reproduction using the **real computed values** (typography from - `assets/sass/components/global/_googlesitekit-typography.scss`, breakpoints/sizes from - `assets/sass/config/`) and open it in the browser. For responsive / `@media` changes, - check **both sides** of every breakpoint you touch (the breakpoint variables, such as - `$bp-tablet`, are defined in `assets/sass/config/_variables.scss`). A mobile-only rule is - invisible at desktop width, so look at the change at a width on each side. Confirm that - the VRT viewports in `tests/vrt/README.md` cover both sides too. Re-check the exact state - described in the issue (e.g. the badge *next to the title*, not just the component in - isolation). + - Callers: add the tests of each file that imports a file you changed. A data store's callers reach it through the registry rather than by an import, so find them by name for each selector, resolver, action and control you touched, with `git grep -l -w -e '' -- assets packages storybook tests/js`. +- **Visual check (any change that affects rendering)**: for SCSS, layout, spacing, alignment, or responsive rules, **render the change and look at it** before declaring it done. Lint and build passing do **not** prove that the change renders correctly. A change that looks like a trivial value tweak in the brief can still be visually wrong. Look at the Storybook story at the affected viewport(s). If no Storybook is running, start it with `npm run storybook`, and add a story where none shows the state. A hand-made HTML copy of the styles shows the copy, not the code that ships. For responsive / `@media` changes, check **both sides** of every breakpoint you touch (the breakpoint variables, such as `$bp-tablet`, are defined in `assets/sass/config/_variables.scss`). A mobile-only rule is invisible at desktop width, so look at the change at a width on each side. Confirm that the VRT viewports in `tests/vrt/README.md` cover both sides too. Re-check the exact state described in the issue (e.g. the badge *next to the title*, not just the component in isolation). - **VRT** — if you added/changed a Storybook story, check just that story rather than the full suite: `npm run test:visualtest -- --grep ""`, and `npm run test:visualapprove -- --grep ""` to write the new reference From 2ee2aec2668986f1cd6218289c1eabb1aa6a8a18 Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 12 Nov 2026 18:44:33 +0300 Subject: [PATCH 3/6] Make `review-pr` read the code and checks of the PR. The review reads each changed file as the pull request has it, with the code that calls it. It takes lint and test results from the CI checks of the pull request. It reports a finding only where the code gives a wrong result, misses a stated need or breaks a written team rule. Each finding names the input and the line. A brief item built another way is a finding only where it breaks a criterion, removes what the code relies on or adds a risk. Any other such difference needs its reason in the pull request, or the review asks the author for it. Its checklist asks for the checks CI runs, and for checks kept as strict. It lists only the commands it runs, and each GitHub read names the repository. --- .agents/skills/review-pr/SKILL.md | 36 ++++++++------------ .agents/skills/review-pr/review-checklist.md | 7 ++-- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/.agents/skills/review-pr/SKILL.md b/.agents/skills/review-pr/SKILL.md index 1168759226f..9537c610ccf 100644 --- a/.agents/skills/review-pr/SKILL.md +++ b/.agents/skills/review-pr/SKILL.md @@ -6,7 +6,7 @@ description: > request by number (e.g. "review PR #12345", "review pull request 12345", "/review-pr 12345") in the google/site-kit-wp repo. argument-hint: "[pr-number]" -allowed-tools: Bash, Read, Grep, Glob +allowed-tools: Read Grep Glob Bash(gh pr view *) Bash(gh pr diff *) Bash(gh pr checks *) Bash(gh issue view *) Bash(git fetch *) Bash(git show *) Bash(git grep *) --- # Review a pull request @@ -24,8 +24,8 @@ those, and don't duplicate them here. Run these in parallel (substitute ``): -- `gh pr view --json number,title,body,author,baseRefName,headRefName,files,additions,deletions,commits` -- `gh pr diff ` +- `gh pr view --repo google/site-kit-wp --json number,title,body,author,baseRefName,headRefName,headRefOid,files,additions,deletions,commits` +- `gh pr diff --repo google/site-kit-wp` **Stop and ask the user** if the PR can't be found or the diff is empty. @@ -41,12 +41,7 @@ Addresses issue: - # ``` -Extract that issue number from the PR body (the first `#` under "Addresses issue:"; -there may be more than one). Then fetch and parse the issue — `gh issue view --json title,body,labels` -— following the section map in `.agents/skills/implement-issue/SKILL.md` Step 1: **Feature Description**, -**Acceptance criteria**, **Implementation Brief**, **Test Coverage**, **QA Brief**. This is -the spec the PR must satisfy; the review is fundamentally a check of the diff **against the -issue**, not just against conventions. +Extract that issue number from the PR body: the first `#` under "Addresses issue:". There may be more than one. Then fetch the issue with `gh issue view --repo google/site-kit-wp --json title,body,labels`. Parse it following the section map in `.agents/skills/implement-issue/SKILL.md` Step 1: **Feature Description**, **Acceptance criteria**, **Implementation Brief**, **Test Coverage**, **QA Brief**. This is the spec the PR must satisfy. The review is fundamentally a check of the diff **against the issue**, not just against conventions. If the PR body has **no** linked issue (the `- #` line is empty), say so in the review, treat requirements adherence as "not verifiable", and review conventions and code quality only. Do @@ -62,27 +57,27 @@ The convention checklist in `review-checklist.md` (§2) maps each area to its au ## Step 4 — Inspect the changed files -For any non-trivial changed file (not auto-generated, not lock files), read the full file for -context around the changed lines. Focus on files where the diff alone is insufficient to judge -correctness. +For any non-trivial changed file (not auto-generated, not lock files), read the full file for context around the changed lines, as the PR has it. Your checkout holds your own branch, so fetch the PR with `git fetch origin pull//head`, and read each file with `git show :`. Focus on files where the diff alone is insufficient to judge whether the code is correct. + +Read the code that calls each changed function too, and search for what still uses each thing the diff removes or renames, with `git grep -n -w -e '' `. ## Step 5 — Judge against the checklist Grade the change against `review-checklist.md`: -- **Requirements adherence** (§1) — the primary check. Walk each **Acceptance criterion** and - each **Implementation Brief** checkbox from the linked issue (Step 2) and confirm the diff - actually implements it; call out anything missing, incomplete, or contradicting the brief. - Confirm every **Test Coverage** item exists as a real test. Skip only if no issue is linked. +- **Requirements adherence** (§1): the primary check. Walk each **Acceptance criterion** and each **Implementation Brief** checkbox from the linked issue (Step 2), and confirm the diff implements it. Call out anything missing or not fully done. Confirm every **Test Coverage** item exists as a real test, find the test behind each criterion, and call out a test that expects the opposite of one. Call out each change that no criterion or checkbox covers, as work the issue did not ask for. Skip only if no issue is linked. + - **A checkbox built another way, or left out.** The acceptance criteria are the contract, and the brief is one route to them (`.agents/skills/implement-issue/SKILL.md` Step 1). Such a difference is a finding where it breaks a criterion, removes something the code relies on, or adds a risk. Any other difference is no finding where the PR's "Relevant technical choices" gives its reason. Where none gives one, ask the author for it. - **Convention adherence** (§2) — check only the areas the change actually touches; cite the context file + section for every deviation. - **Code quality** (§3) — correctness, security, performance, documentation, accessibility. -- **Verification** (§4) — lint, tests run, build for non-trivial asset changes. +- **Verification** (§4): lint, tests run, build for non-trivial asset changes. Read the results from the PR's own checks, with `gh pr checks --repo google/site-kit-wp`, because CI ran them on the code under review. Where CI did not run a check on the PR's last commit, say so in the review. ## Step 6 — Produce the review Structure the output as below. Omit any section with nothing to report. +Report a finding only on one of three grounds. The code gives a wrong result, or the change misses a stated need such as an acceptance criterion, or it breaks a written team rule. Leave out a matter of taste. Report a fault the change did not bring in as pre-existing, apart from the blocking issues. Give a fault that repeats as one finding that names every place it shows. + --- ### PR # — [title] @@ -114,7 +109,7 @@ For each principle area that applies to files in this PR, report: --- #### Code Quality Issues -Bugs, logic errors, edge cases, or correctness problems not covered above. Include `file:line`. +Bugs, logic errors, edge cases, or any other wrong result the code gives, not covered above. Give each the input or the state that leads to the wrong result, and the `file:line` in the source that shows it. Leave out a finding that rests on a name alone, or on an input no caller sends. #### Security Concerns XSS, capability checks, nonce verification, direct SQL, or data-sanitization issues. @@ -126,7 +121,7 @@ Unnecessary re-renders, missing memoization, expensive selectors, N+1 queries, l Changed logic lacking test coverage, or existing tests not updated for new behavior. #### Minor / Nits -Optional: style, naming, or documentation improvements that don't affect correctness. +Optional: style, naming, or documentation improvements that don't affect whether the code is correct. Give at most five, and the rest as a count. --- @@ -142,6 +137,5 @@ Brief justification. If requesting changes, list the blocking issues as a number - **Read-only by default.** Produce the review; do **not** post comments, approve, or change the PR state on GitHub unless the user explicitly asks. -- **Cite, don't assert.** For every convention violation, name the principle, the context file - + section that defines it, and the affected `file:line`. +- **Cite, don't assert.** For every convention violation, name the principle, the context file + section that defines it, and the affected `file:line`. For every finding about what the code does, give the input that leads to the wrong result and the `file:line` that shows it. - **Scope the read.** Load only the convention docs the change touches — not everything. diff --git a/.agents/skills/review-pr/review-checklist.md b/.agents/skills/review-pr/review-checklist.md index 582b338693d..86aa2f3d4fa 100644 --- a/.agents/skills/review-pr/review-checklist.md +++ b/.agents/skills/review-pr/review-checklist.md @@ -12,7 +12,7 @@ the file + section when flagging a violation. ## 1. Requirements adherence - Every **Acceptance criterion** is met. -- Every **Implementation Brief** checkbox is implemented. +- Every **Implementation Brief** checkbox is implemented, or is built another way that breaks no criterion and adds no risk, with its reason in the PR's "Relevant technical choices". - Every **Test Coverage** item exists as a real, passing test. - Edge cases named in the issue are handled. No required behavior is missing. @@ -56,11 +56,12 @@ the file + section when flagging a violation. - **Performance** — no needless re-renders, missing memoization, expensive selectors, N+1 queries, or large asset bloat. - **Documentation** — complex logic and all exports documented. - Accessibility and backward compatibility where relevant. +- **Checks kept as strict**: no check made easier to pass with no reason given. Such a change is a threshold moved in a lint, PHPStan or test config, or a test made easier to pass. So is a new `eslint-disable`, `phpcs:ignore`, `@phpstan-ignore` or PHPStan baseline entry, or unfinished work such as an empty `catch`. ## 4. Verification -- Lint passes — for the full suite: `npm run lint:js` / `composer lint`; scoped to the - changed files: `npm run lint:js:files -- ` / `composer lint -- `. +- Lint passes over the changed files: `npm run lint:js:files -- ` / `composer lint -- `. +- The type check, the style lint and PHPStan pass over the changed files: `npm run typecheck-staged -- <.ts and .tsx files>`, `npx stylelint <.scss files>` and `composer analyze -- `. - Relevant tests were **actually executed** and pass. - Build succeeds for non-trivial asset changes (`npm run build:dev`). - Any change that affects rendering (SCSS, layout, spacing, alignment) is **visually From 8e6967a637c513e36e2e0ea6b04d0fb1bdc49d56 Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 12 Nov 2026 18:44:34 +0300 Subject: [PATCH 4/6] Add plain-writing rules to `write-implementation-brief`. A brief keeps each sentence to 25 words, writes the verb in place of a noun made from it, and gives each thing one name. It states each fact as checked in the code. An update of a brief already on the issue keeps each name, value, path, link and scope line, or says why one went. A Test Coverage line that says nothing is needed comes after the lines that add tests, in one line with no reason. The skill lists only the commands it runs, and each GitHub read names the repository. --- .../write-implementation-brief/SKILL.md | 49 ++++++------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/.agents/skills/write-implementation-brief/SKILL.md b/.agents/skills/write-implementation-brief/SKILL.md index cd2511556a8..c240ad7a82b 100644 --- a/.agents/skills/write-implementation-brief/SKILL.md +++ b/.agents/skills/write-implementation-brief/SKILL.md @@ -6,7 +6,7 @@ description: > implementation brief and/or test coverage for an issue (e.g. "write the implementation brief for #12345", "fill in the brief and test coverage for this issue") in the google/site-kit-wp repo. argument-hint: "[issue-number-or-path]" -allowed-tools: Bash, Read, Grep, Glob, Edit, Write +allowed-tools: Read Grep Glob Edit Write Bash(gh issue view *) Bash(gh browse *) --- # Write an implementation brief @@ -27,7 +27,7 @@ so short that the scope of the work is hidden. The issue comes to you one of two ways, and only the user can tell you which: -- **An issue number** — fetch it with `gh issue view --json title,body,labels`. +- **An issue number**: fetch it with `gh issue view --repo google/site-kit-wp --json title,body,labels`. - **A path to a local issue file** — read that path. Do not go looking for it: such a file has no fixed home, so the user must give you the path. @@ -105,8 +105,7 @@ issue", not "the issue that adds the datastore". **Ask the user for the number.** Never infer it from a design doc's ordering, never guess it from a nearby issue number, and never leave a placeholder to be filled in later: -- **The issue is already in GitHub** — ask the user for its number, then confirm it is the issue - you mean with `gh issue view --json title` before citing it. +- **The issue is already in GitHub**: ask the user for its number, then confirm it is the issue you mean with `gh issue view --repo google/site-kit-wp --json title` before citing it. - **The issue only exists locally** — a markdown file that has not been filed yet. Say so, and ask the user to create it in GitHub and give you the new number. Wait for it: a cross-reference is the one thing you cannot write around. @@ -188,6 +187,10 @@ first language. Every sentence must be clear on the first reading: - **List the members of any set you name.** If you write "an allowlist", "the excluded hosts", "the usual guards", write out what is in it, inline. A set the reader has to guess at is the same as no set at all. +- **Keep each sentence to 25 words or fewer.** Split a sentence past 30 words in two. Put the condition first, before what it decides: "When the flag is off, the tab renders nothing", not "The tab renders nothing when the flag is off". +- **Write the verb, not a noun made from it.** "Decide", not "make a decision". "Check", not "perform a check". Cut the words that add length and no meaning, such as "very", "really", "basically", "actually", "genuinely" and "honestly". Write what a thing does in place of a word that rates it, such as "seamless", "powerful", "comprehensive" or "essential". +- **Give each thing one name.** Call one thing by the same name in the whole brief and its Test Coverage, and give no name two meanings. Take the name the code or the acceptance criteria already use. +- **State each fact as you checked it.** Write no "may", "should probably", "it is worth noting" or "could potentially" over a fact you checked in the code. Name the one thing you could not check, and leave a real choice open as a choice. Delete every bullet the engineer would do anyway, and check that every area the change touches is named. @@ -195,6 +198,8 @@ is named. Read each bullet once more before you finish, and rewrite every sentence that needs a second reading. This applies to your reply to the user (Step 7) as much as to the issue text. +When the issue already has a brief, as when the user asks you to adjust or update it, start by listing what has to survive the edit. That is each name, value, path, link, scope line and open decision. After the edit, check that each one is still there, or say in your reply why it went. + **Say what to do, and nothing else.** Every bullet is an instruction. Leave a genuine implementation choice open rather than inventing a detail, but never leave the implementer to search for something the codebase has already decided. @@ -237,33 +242,15 @@ and the index file to import it into. Do **not** include: -- **Rationale.** No "because", no "this keeps X out of Y", no trade-off discussion, no - restatement of a decision's benefits. The design doc and the acceptance criteria hold the - *why*; the brief holds the *what*. A reason is the exception, allowed in two places only: - where the brief settles a real technical choice an engineer would otherwise stop and - question — keep it to a clause — and for a section the issue template asks for that needs - nothing (see the next bullet). -- **Work that isn't needed.** No "no migration needed", "no new settings", "no REST route" for a - concern the issue never raised. Silence already says it. The exception is what the template - asks for by name — automated tests, and Storybook and VRT changes: when those aren't needed, - say so and say why (Step 6). +- **Rationale.** No "because", no "this keeps X out of Y", no trade-off discussion, no restatement of a decision's benefits. The design doc and the acceptance criteria hold the *why*. The brief holds the *what*. A reason is the exception, allowed in one place only: where the brief decides a real technical choice an engineer would otherwise stop and question. Keep that reason to a clause. +- **Work that isn't needed.** No "no migration needed", "no new settings", "no REST route" for a concern the issue never raised. Leaving the line out already says so. The exception is what the template asks for by name: automated tests, and Storybook and VRT changes. When those aren't needed, say so in one line (Step 6). - **Routine commands.** No lint, build, test or VRT invocations — the `implement-issue` skill's Step 6 owns verification, and every engineer already knows to build. Mention a command only when it is unusual and specific to this issue. - **Links to local design docs.** They don't resolve for someone reading the issue on GitHub; restate the constraint in one clause instead. External links — Figma, a hosted design doc — are fine. -- **Plain-text line numbers.** No `includes/Core/Modules/Modules.php:212`, no "see line 212", no - `file:line` anywhere in the two sections. The number is wrong as soon as anyone edits the file, - and a reader on GitHub cannot click it. When a bullet has to point at an exact place in the - code, use a GitHub permalink instead — a URL pinned to a commit SHA, with the line or range on - the end: - `https://github.com/google/site-kit-wp/blob//includes/Core/Modules/Modules.php#L212-L218`. - Get one by opening the file on GitHub and pressing `y`, or with - `gh browse --no-browser --commit= ` and adding the `#L-L` yourself. - A URL built on a branch name (`/blob/main/`, `/blob/develop/`) is **not** a permalink — it points - at different lines next week — so never use one. Naming the symbol is still better than linking - to it: link only when there is no name to give, such as an unnamed block inside a long function. +- **Plain-text line numbers.** No `includes/Core/Modules/Modules.php:212`, no "see line 212", no `file:line` anywhere in the two sections. The number is wrong as soon as anyone edits the file, and a reader on GitHub cannot click it. When a bullet has to point at an exact place in the code, use a GitHub permalink instead. A permalink is a URL pinned to a commit SHA, with the line or range on the end: `https://github.com/google/site-kit-wp/blob//includes/Core/Modules/Modules.php#L212-L218`. Get one by opening the file on GitHub and pressing `y`, or with `gh browse --no-browser --repo google/site-kit-wp --commit= ` and adding the `#L-L` yourself. A URL built on a branch name (`/blob/main/`, `/blob/develop/`) is **not** a permalink. It points at different lines next week, so never use one. Naming the symbol is still better than linking to it: link only when there is no name to give, such as an unnamed block inside a long function. - **Restated acceptance criteria**, a recap of the Feature Description, or background on how the existing system works. This covers the user-facing copy the criteria define — headings, descriptions, CTA labels, error text. Copy gets reworded during brief review, and a verbatim @@ -316,16 +303,8 @@ Keep it short — a handful of bullets, not a test plan. Two shapes, both in use scenarios and the reference images — a new scenario for a new story, new reference images for a component whose rendering changes. "No VRT changes expected" is a complete answer when nothing the VRT job renders can move. Do not give screenshot paths. -- **Say so when nothing is needed, and say why.** Never leave Test Coverage empty, and never drop - the Storybook or VRT line in silence. When the change needs no tests or no story, write one - bullet that says so with the reason — "No tests required because the change only edits - documentation", "No Storybook story required because the change adds no UI". VRT is the - exception: a bare "No VRT changes expected" needs no reason. An empty section reads as a - forgotten section, and a moderator cannot tell the two apart. -- **Never write `N/A` for tests.** Tests are almost never inapplicable, so `N/A` reads as a - skipped question rather than an answer — give the reason instead, as above. The VRT line is - where `N/A` is allowed, because there it is often literally true: PHP-only changes, tooling and - build config, anything the VRT job never renders. +- **Say so when nothing is needed, in one line with no reason.** Never leave Test Coverage empty, and never drop the Storybook or VRT line without saying so. When the change needs no tests or no story, write one bullet that says so, such as "No tests required." or "No Storybook story required.", after the bullets that add tests. A reason such as "because the change adds no UI" tells the reader nothing the line doesn't. "No VRT changes expected" stays the VRT line. An empty section reads as a forgotten section, and a moderator cannot tell the two apart. +- **Never write `N/A` for tests.** Tests are almost never inapplicable, so `N/A` reads as a skipped question rather than an answer. Write "No tests required." instead, as above. The VRT line is where `N/A` is allowed, because there it is often literally true: PHP-only changes, tooling and build config, anything the VRT job never renders. - Name any new fixture, fake or mock the coverage needs, and the directory it belongs in. - Call out **existing** tests the change will break, so the work is budgeted rather than discovered mid-implementation — "Fix any failing tests/snapshots" when the blast radius isn't From 4d79f1a55fd0604f8e8aaf030535d0dbba0b2eac Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 12 Nov 2026 18:44:34 +0300 Subject: [PATCH 5/6] Cover each state and reader in `write-issue-requirements`. Its criteria cover each state and reader the change reaches, such as loading, an error and a view-only user. They say a shared condition once. Before it writes an issue, the skill searches GitHub for one already filed on the same problem. Its steps to reproduce undo what an earlier visit changed. Its reply names user-facing copy, journeys or experiences that no design gives, for the Product Manager to approve. It takes the sentence, verb, name and fact rules of `write-implementation-brief`. It lists only the commands it runs, and each GitHub read names the repository. --- .../skills/write-issue-requirements/SKILL.md | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.agents/skills/write-issue-requirements/SKILL.md b/.agents/skills/write-issue-requirements/SKILL.md index 7b5dfe8759e..c8e0fa5c813 100644 --- a/.agents/skills/write-issue-requirements/SKILL.md +++ b/.agents/skills/write-issue-requirements/SKILL.md @@ -9,7 +9,7 @@ description: > for the audience tile showing no data", "write the remaining issues from design-doc.md", "add acceptance criteria to #12345") in the google/site-kit-wp repo. argument-hint: "[design-doc-path, issue-number, bug report, or requirements]" -allowed-tools: Bash, Read, Grep, Glob, Edit, Write +allowed-tools: Read Grep Glob Edit Write Bash(gh issue view *) Bash(gh search issues *) --- # Write an issue's requirements @@ -61,8 +61,7 @@ Source material arrives one of three ways, and only the user can tell you which: - **A design doc** — a path in the repo, or a hosted doc. - **Requirements written directly in the user's message.** -- **An existing issue** — a GitHub issue number (`gh issue view --json title,body`) or a - path to a local issue file, when only the criteria are wanted. +- **An existing issue**: a GitHub issue number (`gh issue view --repo google/site-kit-wp --json title,body`) or a path to a local issue file, when only the criteria are wanted. There are two modes, and they decide what you are allowed to touch: @@ -93,6 +92,7 @@ breakdown: one issue per row, with its title and its point estimate. Do not re-s - **For a bug report, the whole report as the user gave it** — the plugin version, the module state, the browser, the exact values they saw. Read whatever the report names as evidence: a support thread, a linked issue, or the pull request the user says introduced the problem. +- **An issue already filed on the same problem.** Search GitHub with two or three words of it: `gh search issues --repo google/site-kit-wp '' --json number,title,state`. Where an open issue covers the whole problem, write no new issue, and name that issue in your reply. Where one covers a part, write the rest, and name it in the description. ## Step 3 — Verify everything against the code @@ -160,8 +160,7 @@ issue", not "the issue that adds the store". **Ask the user for the number.** Never infer it from the design doc's ordering, never guess it from a nearby issue number, and never leave a placeholder to be filled in later: -- **The issue is already in GitHub** — ask the user for its number, then confirm it is the issue - you mean with `gh issue view --json title` before citing it. +- **The issue is already in GitHub**: ask the user for its number, then confirm it is the issue you mean with `gh issue view --repo google/site-kit-wp --json title` before citing it. - **The issue only exists locally** — a markdown file you or the user wrote that has not been filed yet. Say so, and ask the user to create it in GitHub and give you the new number. Wait for it: a cross-reference is the one thing you cannot write around. @@ -217,6 +216,7 @@ The **Steps to reproduce** are the numbered list a tester follows with nothing b - **Start from a state the tester can reach.** A fresh install, a connected module, a setting at a named value. Make the starting state step 1 when the bug needs one. +- **Undo what an earlier visit changed.** Where a step changes what the screen shows next time, such as a dismissed notice, add the step that undoes it, so the steps work a second time. - **One action per step**, with the real thing to click, type or paste — the page, the menu item, the URL, the value in the field. "Set the date range to `Last 28 days`", not "choose a date range". @@ -244,6 +244,10 @@ English as a first language, and none of them should have to read a sentence twi contact link, the listener emits `contact_link_click` and stops, so the same click is never also reported as an outbound click" can be read in only one. - **Cut the sentence that only sounds good.** If removing it loses no information, remove it. +- **Keep each sentence to 25 words or fewer.** Split a sentence past 30 words in two. Put the condition first, before what it decides: "When the flag is off, the tab renders nothing", not "The tab renders nothing when the flag is off". +- **Write the verb, not a noun made from it.** "Decide", not "make a decision". "Check", not "perform a check". Cut the words that add length and no meaning, such as "very", "really", "basically", "actually", "genuinely" and "honestly". Write what a thing does in place of a word that rates it, such as "seamless", "powerful", "comprehensive" or "essential". +- **Give each thing one name.** Call one thing by the same name in the whole description and the criteria, and give no name two meanings. Take the name the code or the design doc already uses. +- **State each fact as you checked it.** Write no "may", "should probably", "it is worth noting" or "could potentially" over a fact you checked in the code. Name the one thing you could not check, and flag a decision you had to make as a decision (Step 7). Read the finished description once more and rewrite every sentence that needs a second reading. The same rules apply to the acceptance criteria (Step 6) and to your reply to the user (Step 7). @@ -295,6 +299,7 @@ and the fix stay out of the criteria, in the same way technique does for a featu - **One outcome per bullet.** Nest a second level when a single outcome has an enumerable set of cases — the conditions under which a hook must not fire, the values a param may take, the forms excluded from a match rule. +- **Say a shared condition once.** Where several outcomes share a condition, such as one user role, one feature flag or one screen, open one criterion on that condition and put each outcome under it. Say a shared outcome once the same way. Open no criterion on "the same" or "as above". - A **table** when a criterion enumerates a lookup that prose would obscure (each widget slug and the module that owns it). Inline it; never link out to it. @@ -318,12 +323,12 @@ Each bullet states an outcome: - **List every case you refer to as a group.** "Share links are excluded" is not checkable until the criterion writes out the share links it means. Give the members inline, or in a table the criterion carries. -- **Give the values**: `viewContext: 'mainDashboard'`, `dateRange: 'last-28-days'`, `limit: 3`, - a 300-second cache TTL. +- **Give the values**: `viewContext: 'mainDashboard'`, `dateRange: 'last-28-days'`, `limit: 3`, a 300-second cache TTL. - **State cardinality** when it matters: "at most once per request", "exactly once per page view", "exactly one of the four states". - **Say what must stay unchanged** when the change touches shared code, naming the consumers that would otherwise regress. +- **Walk each state and reader the change reaches**: loading, an error, zero data, a view-only user, a keyboard user, a screen reader user, each dashboard and each screen size. Where a screen loads several requests, give the outcome when one of them fails. End on what keeps working, with "still". ### Keep them compact @@ -364,6 +369,7 @@ Everything you decided, cut or discovered belongs in your reply to the user — user can overrule them. - **Discrepancies** between the design doc and the code, with the `file:line` you checked. - **Anything you added** beyond the design doc's scope for this issue, so the user can drop it. +- **User-facing copy, journeys or experiences that no design gives**, for the Product Manager to approve, often with the Engineering Lead. - **On a bug report**: the cause you found, with its `file:line`; anything in the report you could not confirm in the code; and the environment facts you left blank because the user did not state them. From 8bb652aa23619ddf0e9490e2fa09bb1896fe1c7c Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 12 Nov 2026 19:07:12 +0300 Subject: [PATCH 6/6] Add the JS and PHP test commands to `check-pr-failures`. The skill reruns a failing JS or PHP test locally to reproduce it. --- .agents/skills/check-pr-failures/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.agents/skills/check-pr-failures/SKILL.md b/.agents/skills/check-pr-failures/SKILL.md index d38321c74f1..3bfb31febd4 100644 --- a/.agents/skills/check-pr-failures/SKILL.md +++ b/.agents/skills/check-pr-failures/SKILL.md @@ -7,7 +7,7 @@ description: > check or watch a PR's checks, or to work through test failures on a pull request (e.g. "why is CI failing on #12345", "check the failures on my PR", "/check-pr-failures 12345"). argument-hint: "[pr-number]" -allowed-tools: Read Grep Glob Edit Write Bash(gh pr checks *) Bash(gh pr view *) Bash(gh run list *) Bash(gh run view *) Bash(gh api --method GET *) Bash(gh issue list *) Bash(git merge-base *) Bash(git worktree *) Bash(npm install *) Bash(npm run build:test *) Bash(npm run test:e2e *) Bash(npm run test:visualtest *) +allowed-tools: Read Grep Glob Edit Write Bash(gh pr checks *) Bash(gh pr view *) Bash(gh run list *) Bash(gh run view *) Bash(gh api --method GET *) Bash(gh issue list *) Bash(git merge-base *) Bash(git worktree *) Bash(npm install *) Bash(npm run build:test *) Bash(npm run test:e2e *) Bash(npm run test:visualtest *) Bash(npm -w tests/js run test:js *) Bash(composer test *) --- # Check a pull request's CI failures