Skip to content

apps/cli: build WP sites incrementally#3198

Closed
dereksmart wants to merge 4 commits intotrunkfrom
try/no-mega-one-shot
Closed

apps/cli: build WP sites incrementally#3198
dereksmart wants to merge 4 commits intotrunkfrom
try/no-mega-one-shot

Conversation

@dereksmart
Copy link
Copy Markdown

@dereksmart dereksmart commented Apr 22, 2026

Related issues

See p1776889791701059/1776881604.011089-slack-C08LZ79MKG9

The turn immediately after site_create (and after any "redesign / rebuild /
start over" prompt) was consistently producing one huge assistant response —
planning essay + multiple Writes + full theme scaffold all in one turn. At
Anthropic streaming rates that's 10–15 minutes of model generation. The CLI
TUI only renders complete assistant messages (no stream_event handler), so
the whole window is a silent "Meandering…" spinner; upstream gateways
sometimes time out with 504 before the response finishes.

How AI was used in this PR

Proposed Changes

  • Add a "Working cadence" section to the local system prompt: one Write/Edit per turn, skeleton-first for long files (>~200 lines), short prose between tool calls, and a hard cap on the turn that immediately follows any site-wide scaffolding trigger.
  • Frame cadence as a quality lever (screenshot loop) alongside UX, so the model doesn't read it as a cap on ambition.
  • Expand the site-spec skill's "After site_create returns" section with matching rules at the single biggest offending point.

Testing Instructions

  • studio ai → "make me a site" → runs site-spec, creates site, next turn is small (site_info or short Write), not a 15-minute silent span
  • studio ai with existing site → "redesign the site" → cadence rule for scaffolding triggers kicks in; no mega-turn
  • Visual quality on the final build is on-par with or better than before (screenshots mid-build are exercised)
  • Existing test suites (apps/cli/ai/tests/*) still green — tests mock buildSystemPrompt, so content changes don't affect them

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@dereksmart dereksmart changed the title apps/cli: cap post-site_create turn size to prevent 10-min agent hangs apps/cli: keep site-spec skill incremental after site_create Apr 22, 2026
@dereksmart dereksmart marked this pull request as ready for review April 22, 2026 20:46
@dereksmart dereksmart changed the title apps/cli: keep site-spec skill incremental after site_create apps/cli: build WP sites incrementally Apr 22, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 4100410 vs trunk

app-size

Metric trunk 4100410 Diff Change
App Size (Mac) 1491.75 MB 1491.75 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 4100410 Diff Change
load 1602 ms 1908 ms +306 ms 🔴 19.1%

site-startup

Metric trunk 4100410 Diff Change
siteCreation 8107 ms 8128 ms +21 ms ⚪ 0.0%
siteStartup 4956 ms 4950 ms 6 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

youknowriad added a commit that referenced this pull request Apr 22, 2026
…dence approach

Combines the complementary halves of the two approaches to the
"silent mega-turn" problem:

- From #3198 (Derek): the broad "one Write/Edit per turn" rule and the
  small-turn rule for the turn immediately after site_create. Without
  these, the agent packs an entire theme scaffold into one turn.

- From this branch (section-by-section anchors): the concrete skeleton
  patterns for style.css (`/* === <concern> === */`) and page content
  (`<!-- section:<concern> -->` + `--post_content-file=`). Without
  these, the "skeleton-first" guidance alone was ignored for
  style.css — session 8 still wrote 12KB in a single Write (46.6s gap).

Replaces the earlier verbose step 3a/4a blocks with a single compact
"Working cadence" section after step 6 (roughly half the line count)
while retaining the concrete anchor patterns.

Also adds a short post-site_create reminder to the site-spec skill at
the point where the rule matters most.

Session 9 with the combined rules is in progress: longest
content-generation gap measured so far is 18.3s (a 3.5KB style.css
section fill). The 30s perceptual threshold is no longer breached on
the generation side.
@dereksmart
Copy link
Copy Markdown
Author

done in #3199

@dereksmart dereksmart closed this Apr 23, 2026
@youknowriad youknowriad deleted the try/no-mega-one-shot branch April 23, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants