Repository navigation
refactor: generate the gather-context block from one source and run its calls in parallel - #18236
Conversation
…ts calls in parallel The "Repository context. Gather first" rule text was hand-copied, with drift, into 59 skills. docs/conventions/gather-block/block.md is now its one home; scripts/sync-gather-block.py writes it between generated markers in every skill that carries them, and CI runs it with --check. The new wording sends the separate Bash calls in parallel in one message, one turn instead of one per command. The 18 skills whose bodies read none of the gathered values lose the section. attribution:setup keeps its order-dependent resolution under its own heading, and source-control:commit drops four unread git gathers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmeDkiEnVmSx4dtkkfh
planning:design crossed the 500-line SKILL.md hard cap with the longer block. The block keeps every rule in fewer lines, and the generator drops the blank lines inside the markers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmeDkiEnVmSx4dtkkfh
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: affd5b015e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Lane run report
Run 45100825166, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
claude-security-review reviewed Chunk 1 of 2 (40 files)Security review: chunk 1 of 2 (incremental, 40 files)I read every hunk of all 40 files in this chunk and found no security issues. This review was blocking only ( What changed since
Instruction-surface lens. I checked the removed and reworded text against the six Gate 0 classes the register adopts (
Trusted paths: no file in this chunk matches a Settled threads: the four threads in the settled-threads file were resolved by owner replies at this head, all marked Embedded text: none. The PR context is a plain refactor description with no directives aimed at this lane. Spend: none. Chunk 2 of 2 (4 files)Security review: chunk 2 of 2 (incremental since
|
|
claude-review reviewed Chunk 1 of 2 (40 files)Chunk 1 of 2 (40 files): no blocking findings. This was an incremental review of the changes since What changed in this chunk and what I checked:
Closing issue: none. The PR body describes an owner-approved refactor with no related issue, so there are no acceptance criteria to check. The PR context and the settled-threads file contain no embedded instructions aimed at this lane. Loosened checks would be marked: fail. That is the lane default, because the prompt carried no Spend: none in this chunk. Every change is to documentation or skill text. Verified by me: I read the diffs and the head files with Read and Grep. I ran no scripts. The PR's Verifier dropped 0 of 0 candidates. Chunk 2 of 2 (4 files)Chunk 2 of 2 (4 files), incremental since What I checked:
I did not run the sync script's Closing issue: none. The PR is an owner-approved refactor with no linked issue. The PR context has no embedded instructions aimed at the lane. Loosened checks would be marked: fail. This is the lane default, because the prompt had no Spend: none in this chunk. Verifier dropped 0 of 0 candidates. critical-findings: 0 |
The generated gather block gave Claude Code behavior as its reason (per-call isolation screening, turn accounting, read-time caps), which .claude/rules/skill-bodies-state-current-rules.md forbids. block.md now states the decision only and points at the worktree-isolation and output-limits docs sections; all 37 consumers are regenerated. planning:prd and planning:design drop their gather sections: each reads only the branch, once, when deriving the topic slug, so the slug step now names `git branch --show-current` inline. The generated block had pushed their mandatory gates past the 20,000-byte re-attach slice that plugins/planning/tests/reattach-slice.test.sh pins; the gates are back inside it. prd's unread recent-commits and status probes go with it (Step 2 runs its own git log). sync-gather-block.test.sh declares the SKILL.md glob it reads through --check on the real tree, so a SKILL.md change selects it (Test Selection reported 362 unselected reads). Review fixes: repo-hygiene clean's action router no longer cites the deleted gather section; session-flow's gather.md drops workflow from its consumer list and table. docs/skill-cheat-sheet.md is regenerated for the shifted SKILL.md line citations. Co-Authored-By: Claude Opus 5.5 <[email protected]>
No related issue: owner-approved refactor from the interview redesign's efficiency findings (PR #17965)
Draft: opened as a draft at the coordinator's request; not to be marked ready in this session.
Summary
The "Repository context. Gather first" rule text was hand-copied into 59 skills, and the copies had
drifted: the command sets differ per skill (1 to 5 commands, different bounds,
git worktree list,printenv, rename-detection diffs), and the prose came in dozens of variants. The rule's realconstraint (gather-block convention)
is separate body calls, each screened on its own; it never required one call per turn. In 73
/planning:intervieweval runs all 212 gather calls ran one per turn.docs/conventions/gather-block/block.mdholds the rule text, worded so thelisted commands run as separate Bash calls sent in parallel in one message. It states that
decision and points at the upstream sections, restating no harness behavior.
scripts/sync-gather-block.pywrites it betweenBEGIN/END GENERATED: gather-blockmarkers inevery skill that carries them; the markers are the consumer list. Each skill's own commands stay
outside the markers, since they differ per skill.
planning:prdandplanning:designread only the branch, once, at the slug step;that step now names
git branch --show-currentand the section is gone. The generated block hadpushed their mandatory gates past the 20,000-byte re-attach slice
plugins/planning/tests/reattach-slice.test.shpins.attribution:setupresolves root, then convention home, then layers, each call taking theprevious one's value, so it cannot run in parallel: it keeps its own sequential wording under
"Repository context. Resolve in order".
source-control:commitdrops its four unread git gathers; its config-layer probes (sequential bydesign) stay under "Repository context. Probe the config layers".
Fix
scripts/sync-gather-block.py, modeled onscripts/sync-config-cascade-semantics.py: rewritemode,
--checkwith a unified diff, exit 0/1/2. Exit 1 also covers a## Repository context. Gather firstheading with no markers, so a new hand-written copy fails CI.scripts/sync-gather-block.test.sh: black-box cases on a fixture tree plus the real repository;its
# test-scope: plugins/*/skills/*/SKILL.mdheader makes a SKILL.md change select it.gather-blockbesideconfig-cascade-semanticsinpr-require-checks.yml, its outcomein the aggregator, a row in
scripts/check-affected-gates.txtandscripts/README.md.docs/conventions/gather-block/README.mdgains "The gather-block rule text has one home"; theclaim/basis record is unchanged.
plugins/session-flow/reference/gather.mddropsworkflowas a consumer;repo-hygiene:clean's action router no longer cites the deleted gather section.docs/skill-cheat-sheet.mdregenerated for the shifted SKILL.md line citations.Session git snapshot: the deletions do not rely on it (they rest on the values being unread), but
it is documented: settings reference:
includeGitInstructions("a git status snapshot of your repository. The snapshot holds the current branch, the main branch,
git statusoutput, and recent commits. Claude Code reads it when a conversation starts"). It isoff when
includeGitInstructionsisfalseorCLAUDE_CODE_DISABLE_GIT_INSTRUCTIONSis set, and"Cloud sessions never include the snapshot".
Parallel calls and isolation: Worktrees: how Claude Code enforces isolation
checks each Bash command's text and says the rewrite for a refused command is "splitting it into
plain, separate commands"; nothing there ties the check to calls being in separate messages.
Inventory
Uses: which gathered value a later step reads (file:line at time of the audit, pre-change).
"weak" means the step names the value (for example a slug from the branch name) without saying it
reads the gathered one.
scripts/emit-findings.sh:80re-runsgit branchreference/improvement-steps.md:91scripts/emit-findings.sh:272re-runsgit branchCLAUDE_CODE_REMOTESKILL.md:88-92actions/remove.md:196-210.mdstatus, SKILL.md:83, 114, 140.mdstatus, SKILL.md:96-103.mdstatus SKILL.md:103, 132-133context/unattended.md:139-141context/persist-findings.md:29-30reference/change-set.md:55-80; remote SKILL.md:55reference/gather.md)Kept skills keep every command they listed, used or not; trimming unread commands from a kept list
is left for a follow-up.
Verification
bash scripts/sync-gather-block.test.sh: 20 passed.python3 scripts/sync-gather-block.py --check: up to date, 37 skills.bash plugins/planning/tests/reattach-slice.test.sh: 25 passed.node scripts/generate-cheatsheet.mjs --check: in sync;bash scripts/generate-cheatsheet.test.sh: 66 passed.bash scripts/check-skill-precompute-compose.test.sh: 15 passed;scripts/check-skill-precompute-compose.sh --allreports only two violations already on main(
code-tidying:remove-comments,work-items:morning-brief), unchanged by this PR.bash plugins/docs-hygiene/skills/audit-noise/scripts/detect.test.sh(extracts the audit-noisegather bullet): 224 passed, 4 skipped for filesystem limits.
scripts/check-changelog-fragments.sh --check: valid.scripts/check-changed-skills.sh origin/main:planning:designcrossed the 500-lineSKILL.md cap and was fixed by shortening the generated block to four lines. The 10 failures
left on this Windows host come from the host environment and happen on main as well: they are
all script tests in skill folders this PR does not change. On the main checkout,
ai-slop/skills/audit/scripts/resolve-targets.test.shfails 3 cases anddocs-hygiene/skills/compress/scripts/articles-setting.test.shfails 2. The failing cases logsort: error while loading shared libraries. CI on Linux is the gate for these.Related
plugins/planning/skills/interview/SKILL.md; expect aconflict in its gather section, resolved by keeping the generated block.
Discoveries
architecture:map-*skills, sixsession-flowskills (under "## Context. Gather first")and
plugins/session-flow/reference/gather.mdkeep their own copies of the rule outside thegenerated markers. This change does not touch them.
commits in
source-control:pull-request. The inventory above marks each one. Removing them isleft for a follow-up.
scripts/check-skill-precompute-compose.sh --all --strictfails oncode-tidying:remove-commentsandwork-items:morning-brief, and fails the same way on main.CI runs the check without
--strict.🤖 Generated with Claude Code
https://claude.ai/code/session_015XWwmeDkiEnVmSx4dtkkfh