$npx -y skills add popmechanic/VibesOS --skill testSelf-contained test automation — invoke directly, do not decompose. End-to-end integration test that assembles a fixture, deploys to Cloudflare (with auto-provisioned Connect), and presents a live URL for browser verification. Use when testing the plugin, running E2E tests, verif
| 1 | > **Plan mode**: If you are planning work, this entire skill is ONE plan step: "Invoke /vibes:test". Do not decompose the steps below into separate plan tasks. |
| 2 | |
| 3 | ## Integration Test Skill |
| 4 | |
| 5 | Orchestrates the full test pipeline: credentials → fixture assembly → Cloudflare deploy (with auto-provisioned Connect) → live URL → unit tests. |
| 6 | |
| 7 | **Working directory:** `test-vibes/` (gitignored, persists across runs) |
| 8 | |
| 9 | ### Phase 1: Credentials |
| 10 | |
| 11 | Check if `test-vibes/.env` exists and has OIDC credentials. |
| 12 | |
| 13 | ```bash |
| 14 | # From the plugin root |
| 15 | cat test-vibes/.env 2>/dev/null |
| 16 | ``` |
| 17 | |
| 18 | **If the file exists and contains `VITE_OIDC_AUTHORITY`:** |
| 19 | |
| 20 | ``` |
| 21 | AskUserQuestion: |
| 22 | Question: "Reuse existing test credentials? (OIDC authority: https://...)" |
| 23 | Header: "Credentials" |
| 24 | Options: |
| 25 | - Label: "Yes, reuse" |
| 26 | Description: "Use the OIDC credentials already in test-vibes/.env" |
| 27 | - Label: "No, enter new credentials" |
| 28 | Description: "I want to use different OIDC credentials" |
| 29 | ``` |
| 30 | |
| 31 | **If the file doesn't exist or credentials are missing, or user wants new ones:** |
| 32 | |
| 33 | ``` |
| 34 | AskUserQuestion: |
| 35 | Question: "Paste your OIDC Authority URL (e.g., https://studio.exe.xyz/auth)" |
| 36 | Header: "OIDC Authority" |
| 37 | Options: |
| 38 | - Label: "I need to set up OIDC first" |
| 39 | Description: "I'll configure Pocket ID and come back" |
| 40 | ``` |
| 41 | |
| 42 | If they need to set up OIDC, tell them: |
| 43 | > You need a Pocket ID instance for authentication. Connect is auto-provisioned on first deploy -- you just need the OIDC Authority URL and Client ID from your Pocket ID configuration. |
| 44 | |
| 45 | Then ask for the client ID: |
| 46 | |
| 47 | ``` |
| 48 | AskUserQuestion: |
| 49 | Question: "Paste your OIDC Client ID" |
| 50 | Header: "OIDC Client ID" |
| 51 | ``` |
| 52 | |
| 53 | Write `test-vibes/.env`: |
| 54 | ``` |
| 55 | VITE_OIDC_AUTHORITY=<authority-url> |
| 56 | VITE_OIDC_CLIENT_ID=<client-id> |
| 57 | ``` |
| 58 | |
| 59 | ### Phase 2: Connect (Auto-Provisioned) |
| 60 | |
| 61 | Connect is automatically provisioned on first Cloudflare deploy -- no manual setup needed. |
| 62 | The `deploy-cloudflare.js` script handles R2 bucket, D1 databases, and cloud backend |
| 63 | Worker provisioning via alchemy. Subsequent deploys skip Connect setup. |
| 64 | |
| 65 | Proceed directly to fixture selection. |
| 66 | |
| 67 | ### Phase 3: Fixture Selection |
| 68 | |
| 69 | ``` |
| 70 | AskUserQuestion: |
| 71 | Question: "Which fixture to test?" |
| 72 | Header: "Fixture" |
| 73 | Options: |
| 74 | - Label: "basic (Recommended)" |
| 75 | Description: "TinyBase data operations with React singleton — the standard integration test" |
| 76 | - Label: "minimal" |
| 77 | Description: "Template + Babel + import map only — fastest, no data layer" |
| 78 | - Label: "sell-ready" |
| 79 | Description: "useTenant() + multi-tenant routing — tests factory assembly path" |
| 80 | - Label: "ai-proxy" |
| 81 | Description: "/api/ai/chat endpoint + CORS — requires OpenRouter key" |
| 82 | ``` |
| 83 | |
| 84 | **For sell-ready fixture:** Check `test-vibes/.env` for a cached admin user ID from a previous run: |
| 85 | |
| 86 | ```bash |
| 87 | grep OIDC_ADMIN_USER_ID test-vibes/.env 2>/dev/null |
| 88 | ``` |
| 89 | |
| 90 | **If found**, offer to reuse it (mask the middle of the value in the prompt, e.g., `user_37ici...ohcY`): |
| 91 | |
| 92 | ``` |
| 93 | AskUserQuestion: |
| 94 | Question: "Reuse stored admin user ID? (user_37ici...ohcY)" |
| 95 | Header: "Admin ID" |
| 96 | Options: |
| 97 | - Label: "Yes, reuse" |
| 98 | Description: "Use the cached user ID from test-vibes/.env" |
| 99 | - Label: "Skip admin" |
| 100 | Description: "Deploy without admin — you can set it up after deploy" |
| 101 | ``` |
| 102 | |
| 103 | If "Yes, reuse": use the stored value in Phase 4 assembly. |
| 104 | If "Skip admin": omit `--admin-ids` in Phase 4. Admin setup will be offered post-deploy in Phase 5.5. |
| 105 | |
| 106 | **If not found:** No prompt needed. Admin will be set up post-deploy in Phase 5.5 after the user has a chance to sign up on the live app. |
| 107 | |
| 108 | ### Phase 3.5: Factory Configuration (sell-ready only) |
| 109 | |
| 110 | **Condition:** Only runs when the user selected `sell-ready` in Phase 3. |
| 111 | |
| 112 | **Ask billing mode:** |
| 113 | |
| 114 | ``` |
| 115 | AskUserQuestion: |
| 116 | Question: "Which billing mode should this factory test use?" |
| 117 | Header: "Billing" |
| 118 | Options: |
| 119 | - Label: "Free (billing off)" |
| 120 | Description: "Claims work without payment — tests auth + tenant routing only" |
| 121 | - Label: "Billing required" |
| 122 | Description: "Claims require subscription — tests auth gate flow (Stripe billing is phase 2)" |
| 123 | ``` |
| 124 | |
| 125 | **If "Free":** Store `BILLING_MODE=off` in `test-vibes/.env`. Skip webhook setup. Proceed to Phase 4. |
| 126 | |
| 127 | **If "Billing required":** Store `BILLING_MODE=required` in `test-vibes/.env`. Note that Stripe billing integration is phase 2, so the paywall will be a placeholder. |
| 128 | |
| 129 | Proceed to Phase 4. |
| 130 | |
| 131 | ### Phase 4: Assembly |
| 132 | |
| 133 | Copy the selected fixture and assemble: |
| 134 | |
| 135 | ```bash |
| 136 | # Copy fixture to working directory |
| 137 | cp scripts/__tests__/fixtures/<fixture>.jsx test-vibes/app.jsx |
| 138 | |
| 139 | # Source env for assembly |