---
name: demo-employee-creator
description: >-
  Create demo employees on Gusto demo environment. Use when user says
  'new enrolled user', 'new unenrolled user', or wants to create test
  employees for flex pay testing.
---

# Consumer Money Test User Skill

Automates creating demo employees on the Gusto flex_pay_company_builder form using browser automation.

## Commands

| Command | Description |
|---------|-------------|
| "New enrolled user" | Creates 1 enrolled user with 6 card transactions |
| "New unenrolled user" | Creates 1 unenrolled user |
| "3 new enrolled users" | Creates 3 enrolled users |
| "6 new unenrolled users" | Creates 6 unenrolled users |

**Batch requests:** Include a number to create multiple users (e.g., "5 new enrolled users", "10 new unenrolled users").

---

## First-Time Setup

### Step 1: Check for Existing Configuration

Check if `~/.claude/skills/demo-employee-creator/config.json` exists.

If it exists and contains both `baseEmail` and `phoneNumber`, skip to the Execution Workflow.

If it doesn't exist or is missing fields, proceed with setup.

### Step 2: Auto-Detect Gusto Email

Run this command to get the user's git email:
```bash
git config --global user.email
```

### Step 3: Confirm Detected Email

**If a `@gusto.com` email was detected**, use AskUserQuestion to confirm:

Question: "I detected your Gusto email as: [detected_email]. Is this correct?"

Options:
- "Yes, use this email"
- "No, let me enter a different email"

**If no `@gusto.com` email was detected**, ask the user to provide their Gusto email.

### Step 4: Ask for Phone Number

Ask the user:

"What phone number would you like to use for 2FA on demo accounts? (10 digits, receives verification codes)"

### Step 5: Save Configuration

Create the directory and save config:

```bash
mkdir -p ~/.claude/skills/demo-employee-creator
```

Write `~/.claude/skills/demo-employee-creator/config.json` with:

```json
{
  "baseEmail": "john.smith@gusto.com",
  "phoneNumber": "9709018087"
}
```

Tell the user: "Saved your email and phone number for future use."

---

## How This Skill Works

This skill automates the Gusto Panda demo employee creation form at:
`https://app.gusto-demo.com/panda/flex_pay_company_builder`

**The automation:**
1. Opens a Chrome browser (controlled by Chrome DevTools MCP)
2. Navigates to the form URL
3. If not logged in, waits for user to complete Okta SSO
4. Fills form fields with preset values
5. Submits the form
6. Reports the created employee's email address

**Form values used:**

| Field | Enrolled | Unenrolled |
|-------|----------|------------|
| Spending Type | Enrolled with 6 card transactions | Not enrolled |
| Savings | No | No |
| Tier | Core | Core |
| Extra decorations | None | None |
| Phone | [your configured phone number] | [your configured phone number] |
| Email | [your.name]+[random 4 digits]@gusto.com | [your.name]+[random 4 digits]@gusto.com |

---

## Execution Workflow

### Step 1: Parse Request

Determine:
- **User type:** enrolled or unenrolled
- **Count:** number of users to create (default 1)

Examples:
- "new enrolled user" → type=enrolled, count=1
- "6 new unenrolled users" → type=unenrolled, count=6

### Step 2: Load Configuration

Read `~/.claude/skills/demo-employee-creator/config.json` to get:
- `baseEmail` - for generating employee emails
- `phoneNumber` - for the 2FA phone field

Parse the email to extract the username part (before @gusto.com).

### Step 3: Navigate to Form

Use the chrome-devtools MCP `navigate_page` tool:
- URL: `https://app.gusto-demo.com/panda/flex_pay_company_builder`

If redirected to Okta login, tell user: "Please log in to Gusto in the Chrome window, then let me know when you're done."

### Step 4: Create Users Loop

**Repeat the following for each user (1 to count):**

#### 4a: Generate Email

```bash
echo $((1000 + RANDOM % 9000))
```

Construct: `[username]+[XXXX]@gusto.com`

Store the generated email in a list.

#### 4b: Get Form Snapshot

Use the chrome-devtools MCP `take_snapshot` tool to see current form state.

#### 4c: Fill Form

**For enrolled user** - click the "Enrolled with 6 card transactions" radio button.

**For unenrolled user** - skip this step (default is "Not enrolled").

Fill phone number field (label contains "Phone for 2fa") with the configured `phoneNumber`.

Fill email field (label contains "User email") with the generated email.

#### 4d: Submit

Click the "Create new company" button.

#### 4e: Verify Success

Take a snapshot to verify success message appears before continuing to next user.

### Step 5: Report Results

**For single user, output:**

```
New [enrolled/unenrolled] user created!

Email address (click to copy):
```
```
john.smith+4827@gusto.com
```

**For multiple users, output each email in its own code block:**

```
Created [count] new [enrolled/unenrolled] users!

Email addresses (click any to copy):
```

```
john.smith+4827@gusto.com
```

```
john.smith+9163@gusto.com
```

Always mention: Password for all users is `password1`

---

## Configuration

The skill stores user configuration in `~/.claude/skills/demo-employee-creator/config.json`:

```json
{
  "baseEmail": "your.name@gusto.com",
  "phoneNumber": "9709018087"
}
```

To change your email or phone, edit this file or delete it to trigger setup again.

---

## Troubleshooting

**Browser window not visible** → Check Mission Control (F3) or Cmd+Tab. The Chrome window may be on another desktop.

**Redirected to Okta login** → User needs to authenticate. Wait for them to log in.

**Form elements not found** → Take a fresh snapshot. Element UIDs change between sessions.

**Want to change your email or phone?** → Edit or delete `~/.claude/skills/demo-employee-creator/config.json`

**Email wasn't auto-detected?** → Make sure your git email is set: `git config --global user.email "your.name@gusto.com"`
