Skip to content

woocommerce/woocommerce-android / .agents/skills/setup-test-stores

setup-test-stores

Verified

Provision a disposable Jurassic Ninja store for the Maestro smoke suite, connect Jetpack to the developer's own WordPress.com test account, create WooCommerce API keys, and write .maestro/.env.local. Use when Maestro setup is missing, when .env.local points at an expired store, or when a clean store is wanted.

FileKindSize
SKILL.mdskill md5.8 KB
---
name: setup-test-stores
description: Provision a disposable Jurassic Ninja store for the Maestro smoke suite, connect Jetpack to the developer's own WordPress.com test account, create WooCommerce API keys, and write .maestro/.env.local. Use when Maestro setup is missing, when .env.local points at an expired store, or when a clean store is wanted.
user-invocable: true
allowed-tools: "Bash, Read, mcp__context-a8c__context-a8c-load-provider, mcp__context-a8c__context-a8c-execute-tool"
argument-hint: "[--fresh]"
---

# Set up a Maestro test store

Provisions a Jurassic Ninja (JN) site and configures it as the Maestro lab store.
Site creation is only possible through the `jurassic-ninja` ContextA8C MCP, so this
skill drives that part; everything after "site exists and its password is known" is
handled by `.maestro/scripts/setup-jn-store.sh`, which a developer can also run by
hand against a site created in a browser.

## Prerequisites

- ContextA8C MCP configured with the `jurassic-ninja` provider.
- `wc.oauth.app_id` and `wc.oauth.app_secret` present in
  `secrets.properties` (see Environment Setup in `AGENTS.md`).
- `expect` on PATH (ships with macOS) for password-based SSH.
- A **WordPress.com test account with two-factor authentication disabled**. The OAuth
  password grant used to connect Jetpack cannot answer a 2FA challenge non-interactively.
  Never use a personal or production account. The account is read from `.env.local`, or
  from `MAESTRO_WOO_LAB_WPCOM_EMAIL` / `MAESTRO_WOO_LAB_WPCOM_PASSWORD` in the
  environment; see step 0.

## Steps

0. **Make sure the WordPress.com account is available.** The script needs a test account
   to connect Jetpack to, and it cannot prompt when run by an agent because there is no
   terminal attached; it will exit with a message naming what is missing.

   If `.env.local` has no `MAESTRO_WOO_LAB_WPCOM_EMAIL` / `MAESTRO_WOO_LAB_WPCOM_PASSWORD`,
   stop and ask the user to either add those two lines themselves, or run the script
   directly in their own terminal, where it prompts without echoing:

   ```bash
   .maestro/scripts/setup-jn-store.sh --site <domain>.jurassic.ninja
   ```

   Do not ask the user to paste a password into the conversation, and never pass one as a
   command-line argument.

1. **Check whether setup is already usable.** If `.maestro/.env.local` exists, probe the
   store in one bash call that sources the file, so no credential is read into the chat:

   ```bash
   ( set -a; . .maestro/.env.local; set +a
     curl -s -o /dev/null -w '%{http_code}' \
       -u "${MAESTRO_WOO_LAB_CONSUMER_KEY:-$MAESTRO_WOO_CONSUMER_KEY}:${MAESTRO_WOO_LAB_CONSUMER_SECRET:-$MAESTRO_WOO_CONSUMER_SECRET}" \
       "$MAESTRO_WOO_LAB_JETPACK_STORE_URL/wp-json/wc/v3/products?per_page=1" )
   ```

   A `200` means the store is alive and the keys work; report that and stop, unless the
   user passed `--fresh`. Anything else means the store is gone or expired: continue, and
   reuse the existing WP.com account lines rather than asking for them again.

2. **Provision three sites.** The lab store, a WooCommerce site without Jetpack for
   `no_jetpack.yaml` and `push_no_jetpack.yaml`, and a WooCommerce site with Jetpack, left unconnected, for
   `jetpack_not_connected.yaml`:

   ```
   provision-site  features: {"woocommerce":"true","woocommerce-import-sample-data":"true","jetpack":"true"}
   provision-site  features: {"woocommerce":"true","jetpack":"false"}
   provision-site  features: {"woocommerce":"true","jetpack":"true"}
   ```

   Note all three returned domains.

3. **Fetch their passwords.** For each site:

   ```
   list-sites  domain: <domain>, include_passwords: true, include_config: true
   ```

   `JN_PASSWORD` in the returned config is both the wp-admin and the SSH password. The
   admin username is `demo`.

   Do not echo these values in your reply.

4. **Configure the stores.** Pass each password through the environment so it never lands
   in `ps` output:

   ```bash
   JN_SSH_PASS='<lab JN_PASSWORD>' .maestro/scripts/setup-jn-store.sh --site <lab domain>
   JN_SSH_PASS='<no-Jetpack JN_PASSWORD>' .maestro/scripts/setup-jn-store.sh --no-jetpack-site <no-Jetpack domain>
   JN_SSH_PASS='<third JN_PASSWORD>' .maestro/scripts/setup-jn-store.sh --jetpack-not-connected-site <third domain>
   ```

   The script waits for JN to finish provisioning (it answers HTTP before its plugins
   finish installing), connects Jetpack, creates the API keys, and writes
   `.maestro/.env.local`.

   This assumes `.env.local` already has `MAESTRO_WOO_LAB_WPCOM_EMAIL` and
   `MAESTRO_WOO_LAB_WPCOM_PASSWORD`. If it does not, see step 0.

5. **Report** the store URLs and the lab store's blog ID. Do not print any credential.

## Verifying

```bash
.maestro/scripts/lint-env.py
```

## What the provisioned store supports

A fresh store has the WooCommerce sample products. The script tops it up to 100 products
and 100 completed orders, and adds one customer and a `maestro10` coupon, so the product,
order and dashboard flows run against it.

The site without Jetpack gets the same orders and products as the lab store, and the site
with Jetpack not connected only gets API keys. Their flows log in with the site credentials,
and the runner resets each one before its flow runs.

The negative-login fixtures (`MAESTRO_WOO_NOT_A_WOO_STORE_*`,
`MAESTRO_WOO_WRONG_ACCOUNT_STORE_URL`) are shared read-only sites from the smoke testing
guide and are filled in by hand.

## Notes

- JN sites expire after 7 days of inactivity. Re-run this skill when a store stops
  responding; it reuses the WordPress.com account already in `.env.local`.
- Only test stores and test accounts. Destructive flows publish and delete real data.
- The previous `.env.local` is backed up outside the repository, because `.gitignore`
  matches `.env.local` exactly and a sibling backup file would not be ignored.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall