Skip to content

Run the start-work loop's deferred suites and CI read in parallel #1161

Description

@vivek7405

Problem

The self-review loop in webjs-start-work defers every heavy suite to after the last clean round (the #1157 rule), but says nothing about HOW they run there, so they run the way everything used to: one after another. The deferred set (full Node suite, browser, e2e, Bun matrix, four-app dogfood boot check, then a CI read) is fully independent work, and serially it costs their SUM (~15+ minutes) when the wall clock could be their MAX (~5). The same session that measured the loop's other costs (#1159) also demonstrated the fix ad hoc: CI reads ran as background watches with until-loops while other work continued.

There is also an undocumented judgment worth pinning so it survives future "optimization": reviewers are deliberately ONE-SHOT fresh agents, never persistent teammates, because a teammate that keeps context across rounds re-derives its own prior assumptions, which is the blind-spot sharing the fresh-reviewer rule exists to kill. Nothing in the skill says this, so a future agent could reasonably "improve" the loop with a long-lived reviewer teammate and quietly destroy its independence.

Design / approach

Two additions to .claude/skills/webjs-start-work/SKILL.md, both in the loop section:

  1. Step 4 (the post-clean-round step, currently "NOW run everything the loop deferred") gains the parallel mechanics: launch each deferred suite as its own background Bash task in one batch (run_in_background: true), plus the CI read as a background until-loop watch, then collect ALL results before reporting. Every suite still runs and every result is still reported (the Stop the self-review loop re-running suites and waiting on CI #1157 WHEN-not-WHETHER rule is untouched); only the shape changes from serial to parallel.
  2. A short "why one-shot reviewers" note beside the fresh-subagent rationale in step 1: teammates (named agents, SendMessage, persistent context) are the right tool for COLLABORATING work, and exactly the wrong tool for reviewing, where accumulated context is the failure mode.

Implementation notes (for the implementing agent)

  • Where to edit: .claude/skills/webjs-start-work/SKILL.md, step 4 of ### How the loop works (grep "run everything the loop deferred", currently near L368), and step 1's fresh-reviewer sentence (grep "no prior context on the decisions you made", near L332).
  • Landmine: the deferred-suite list must stay in sync with the one already named in the fast-loop rules (grep "the e2e suite, the full Node suite, the browser suite, the Bun matrix"): state the mechanics ONCE and point, never restate the list, since duplicated statements drifting apart is this file's documented recurring disease (see the docs: make the self-review loop fast, parallel, and stall-proof #1159 review trail).
  • Landmine: background Bash tasks notify on completion; the skill must say collect EVERY task's result before the report, since a forgotten background suite that later fails is a silent gap. Pair with the reporting shape at ### Reporting after the loop (only report after suites AND CI are read).
  • Invariants: AGENTS.md invariant 11 on all new prose; .claude/hooks/block-prose-punctuation.sh enforces on write.
  • Mirror both copies (.claude/ and ~/.claude/), diff -q afterwards, in-repo is the newer one.
  • Tests / docs: node --test test/hooks/route-skills.test.mjs still passes; no other surface.

Acceptance criteria

  • Step 4 launches the deferred suites as parallel background tasks and the CI read as a background watch, in one batch
  • It states results are collected from every launched task before anything is reported
  • The WHEN-not-WHETHER rule is explicitly untouched (no layer skipped)
  • Step 1 states why reviewers are one-shot fresh agents and never persistent teammates
  • The deferred-suite list is stated once and pointed to, not restated
  • Both skill copies identical (diff -q)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions