Skip to content

Make creating WooCommerce shop sites easy with Studio Code - #3741

Merged
youknowriad merged 6 commits into
trunkfrom
claude/keen-mestorf-c91651
Jun 9, 2026
Merged

Make creating WooCommerce shop sites easy with Studio Code#3741
youknowriad merged 6 commits into
trunkfrom
claude/keen-mestorf-c91651

Conversation

@youknowriad

Copy link
Copy Markdown
Contributor

Related issues

  • Related to #

How AI was used in this PR

Built with Claude Code. The skill/prompt changes were driven by analyzing real Studio Code session transcripts of an agent repeatedly failing to build a proper shop ("MyPet") — each fix targets a specific failure observed in those transcripts (trigger never firing, then firing but misclassifying the shop as informational, then the cart link never landing). All changes were reviewed by the author.

Proposed Changes

When a user asks Studio Code to build a shop, the agent used to produce a static catalog mockup — no WooCommerce, no products, no cart — even for an explicit "pet shop." This makes ecommerce the reliable default and gives the agent a complete happy path for standing up a real store.

  • A shop/store request is now treated as ecommerce by default (unless the user says otherwise). The agent provisions WooCommerce, turns off the "Coming soon" placeholder, creates products relevant to the shop's niche with real imported images, and adds a cart (mini-cart) to the header.
  • The site planning step now commits to a "Functionality & plugins" decision up front, so plugin needs are decided while gathering the spec rather than being skipped mid-build.
  • Design verification now covers every page — including the WooCommerce pages (Shop, Cart, Checkout) — while only iterating on the home page, so secondary pages get checked without inflating build time.
  • The Skill tool call renders as a single compact row in the chat transcript instead of dumping the full skill body, which keeps the conversation readable as the number of skills grows.

Testing Instructions

  1. npm run cli:build
  2. In Studio Code, prompt: "Build a small pet shop site called MyPet, keep it small, only 2-3 pages. I want to sell dog and cat products."
  3. Verify the agent: installs/activates WooCommerce, creates several products (each with an image), disables the "Coming soon" page, and adds a cart link to the header.
  4. Verify visual-polish runs across all pages (Home, Shop, Cart, etc.) but only loops on the home page.
  5. Optional — run the new eval: npm run eval (look for the woocommerce-shop-setup case).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
  • Logic verified against real agent session transcripts; minimal eval added.

🤖 Generated with Claude Code

@wpmobilebot

wpmobilebot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing e5393f8 vs trunk

app-size

Metric trunk e5393f8 Diff Change
App Size (Mac) 1384.39 MB 1384.39 MB 0.00 MB ⚪ 0.0%

site-editor

Metric trunk e5393f8 Diff Change
load 1639 ms 1698 ms +59 ms 🔴 3.6%

site-startup

Metric trunk e5393f8 Diff Change
siteCreation 9083 ms 9068 ms 15 ms ⚪ 0.0%
siteStartup 4495 ms 4400 ms 95 ms 🟢 -2.1%

Results are median values from multiple test runs.

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

youknowriad and others added 2 commits June 9, 2026 15:44
Teach the Studio Code agent to reliably build real ecommerce stores when a
user asks for a shop, instead of producing a static catalog mockup.

- Add a WooCommerce runbook to the plugin-recommendations skill: treat a
  shop/store request as ecommerce by default, install WooCommerce, disable
  "Coming soon" mode, create contextual products with imported images, and
  add a mini-cart to the header.
- Have the site-spec summary commit to a "Functionality & plugins" line so
  the plugin decision happens up front rather than being skipped.
- Polish every page (user + WooCommerce), looping only the home page.
- Render the Skill tool call as a single compact row in the transcript.
- Add a minimal eval asserting a shop request installs WooCommerce and
  creates products.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The agent was skipping the site-spec skill when a build prompt already
provided the site name, which meant the "Functionality & plugins" decision
(and thus WooCommerce setup for shop requests) never happened. Make loading
site-spec unconditional for new-site builds, and clarify that skipping
discovery only skips the questions — the site spec is still produced.

Verified with the woocommerce-shop-setup eval, which now passes: the agent
loads site-spec, installs WooCommerce, and creates products.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@youknowriad
youknowriad force-pushed the claude/keen-mestorf-c91651 branch from 71b9131 to ae10111 Compare June 9, 2026 13:44
The agent sometimes read "small" as a signal to skip WooCommerce. Make
explicit that size/scope words ("small", "simple", "just a few pages")
describe how big the site is, not whether it sells - a small shop is still
a shop and still gets WooCommerce.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for improving the creation of WooCommerce websites.
I tested it by running npm run eval -- --filter-pattern "shop request sets up WooCommerce" and also npm run cli:build && node apps/cli/dist/cli/main.mjs code with the following prompt: Create a small shop of surfing boards top brands, keep it small only 2 pages. The name of the shop is CanarySurf

The shop looked good and it contained 4 products.

Image

The eval failed to install WooCommerce and create the products. It seems we might need to tweak the skill description a bit more.

Image
Comment on lines +342 to +343
# Regression: a "shop"/"store" request must set up WooCommerce WITH products,
# even when framed with scope/style qualifiers ("small", "for inspiration")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💖

Comment thread apps/studio/src/components/studio-code-session/conversation/index.tsx Outdated
@youknowriad

Copy link
Copy Markdown
Contributor Author

I think the latest skill update might fix that eval issue.

The renderer tweak to collapse the Skill tool call to a single row did not
have the intended effect, so revert it and leave tool-result rendering as-is.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

sejas commented Jun 9, 2026

Copy link
Copy Markdown
Member

Yes! It passed correctly after latest changes. Thank you!

Screenshot 2026-06-09 at 15.29.34.png

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working great!

wp_cli option delete _transient__wc_activation_redirect
```

3. Configure store basics. Match the currency and base location to the user's context when known, otherwise use sensible defaults. Also turn off "Coming soon" mode, which fresh WooCommerce installs enable by default - otherwise the storefront shows a "Something big is brewing! Our store is in the works and will be launching soon!" placeholder instead of the real site:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise the storefront shows a "Something big is brewing! Our store is in the works and will be launching soon!" placeholder instead of the real site:

is this needed?

youknowriad and others added 2 commits June 9, 2026 16:55
The WooCommerce pages were phrased as an illustrative "such as" example, so
the agent could treat the single-product/Cart/Checkout pages as optional.
Make them a firm checklist (Shop, single-product, Cart, Checkout, My Account)
so every storefront page gets polished.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the verbatim placeholder message from the "Coming soon" step; the
instruction to disable it is enough.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@youknowriad

Copy link
Copy Markdown
Contributor Author

The unit test failure seems like the one being worked on separately and failing on trunk. So I'm merging this.

@youknowriad
youknowriad merged commit 5aa584b into trunk Jun 9, 2026
10 of 11 checks passed
@youknowriad
youknowriad deleted the claude/keen-mestorf-c91651 branch June 9, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants