agentleFS
solo-istsolo-ist/prose/.agents/skills/qa-web/SKILL.md

qa-web

Skill8 starsChanged 5 months agoMITView on GitHub

Validate Prose features against the web mode build using Playwright. Use for CI-compatible QA that doesn't require Electron or a display server.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If testing a specific PR branch:

    line 34
  2. Very specific:

    Add tests to tests/smoke.spec.ts or create new files under tests/.

    line 121
  3. Very specific:

    Start it manually: npm run dev:web then re-run tests

    line 212
  4. Very specific:

    Check npm run dev:web console for errors

    line 221

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

QA Web Mode

Automated QA testing for Prose using Playwright against the web mode build (http://localhost:5174). Unlike Circuit Electron, this runs headlessly in CI — no display server or Electron required.

Usage

/qa-web

Or target a specific PR branch:

/qa-web <branch-name>

Prerequisites

Playwright browsers must be installed once:

npx playwright install --with-deps chromium

Workflow

1. (Optional) Checkout Branch

If testing a specific PR branch:

git fetch origin
git checkout <branch-name>

2. Run Tests

With auto-managed dev server (recommended for local development):

npm run test:web

The Playwright config automatically starts npm run dev:web and waits for http://localhost:5174 to be ready.

Against an already-running dev server (if npm run dev:web is already running):

PLAYWRIGHT_TEST_BASE_URL=http://localhost:5174 npx playwright test

Against the production build (recommended for CI — faster, no HMR overhead):

npm run build:web
npm run preview:web &
npx playwright test --config playwright.config.ts

3. Interpret Results

StatusMeaning
✅ passedFeature works as expected
❌ failedBug detected — check error message and screenshot
⚠️ flakyTiming issue — re-run with --retries=2

On failure, Playwright saves a screenshot and trace under test-results/. Open the trace viewer:

npx playwright show-trace test-results/<test-name>/trace.zip

4. Report Results to PR

Post a comment on the PR with results:

gh pr comment <pr-number> --body "$(cat <<'EOF'
## Web QA Results

**Branch**: \`<branch>\`
**Tested**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")

### Results

| Test | Status | Notes |
|------|--------|-------|
| App loads without errors | ✅ | |
| File explorer renders files | ✅ | |
| Clicking file loads content | ✅ | |
| Editor accepts input | ✅ | |
| Settings panel opens | ✅ | |
| Theme toggle works | ✅ | |

### Recommendation

✅ **Ready for Review** — All smoke tests pass.
EOF
)"

Test Suite

The smoke test suite at tests/smoke.spec.ts covers:

  1. App loads without console errors — No JS errors on startup
  2. File explorer renders fixture files — Sidebar shows pre-loaded fixture files
  3. Clicking a file loads content — Clicking a file populates the editor
  4. Editor accepts text input — The ProseMirror editor is interactive
  5. Settings panel opens — More options → Settings shows the dialog
  6. Theme toggle works — Dark/light toggle switches the dark class on <html>

Writing New Tests

Add tests to tests/smoke.spec.ts or create new files under tests/.

Common Selectors

// Editor
const editor = page.locator('.ProseMirror')

// Toolbar buttons
page.getByRole('button', { name: /show files/i })     // file list toggle
page.getByRole('button', { name: /hide files/i })
page.getByRole('button', { name: /toggle theme/i })
page.getByRole('button', { name: /more options/i })   // overflow menu

// File items in sidebar
page.getByText('Welcome to Prose.md')
page.getByText('Formatting Examples.md')

// Dialogs
page.getByRole('dialog')                               // any dialog
page.getByRole('alertdialog')                          // alert dialogs (consent, delete confirm)

Dismissing the AI Consent Dialog

Prose shows a consent dialog on first launch in a fresh browser context. Dismiss it before testing:

async function dismissAIConsent(page: Page) {
  const dialog = page.getByRole('alertdialog').filter({ hasText: 'AI Writing Assistance' })
  if (await dialog.isVisible({ timeout: 3_000 }).catch(() => false)) {
    // "Use Without AI" closes in one click. "Enable AI Features" advances
    // OSS/web builds to a second step (skill download) that would also need
    // dismissal — avoid by declining.
    await page.getByRole('button', { name: 'Use Without AI' }).click()
    await dialog.waitFor({ state: 'hidden' })
  }
}

Waiting for App Initialization

async function waitForAppReady(page: Page) {
  await page.locator('[aria-label="Toggle theme"]').waitFor({ state: 'visible', timeout: 15_000 })
  await dismissAIConsent(page)
}

Keyboard Shortcuts

Unlike Electron, browser keyboard shortcuts work reliably with Playwright:

// Ctrl+/ to open chat (web mode uses Ctrl instead of Cmd)
await page.keyboard.press('Control+/')

// Type in editor
await editor.click()
await page.keyboard.type('Hello world')

Fixture Files

The web mock pre-loads these files at /Documents/:

FileDescription
Welcome to Prose.mdIntro document, exercises basic editor
Formatting Examples.mdMarkdown formatting showcase
Meeting Notes/Weekly Standup.mdSubdirectory — tests folder expansion
Meeting Notes/Q1 Planning.mdFrontmatter parsing
Blog Drafts/AI Writing Tools.mdLonger content
Empty Note.mdEmpty file edge case

Configuration

playwright.config.ts at the project root:

  • Base URL: http://localhost:5174 (web mode dev server)
  • Workers: 1 (serial execution — avoids IndexedDB conflicts between tests)
  • Global timeout: 120s (prevents hung CI jobs)
  • CI reporters: json (outputFile) + github (inline PR annotations)
  • Local reporter: list (human-readable terminal output)

Troubleshooting

net::ERR_CONNECTION_REFUSED

The dev server isn't running. Either:

  • Let Playwright start it automatically via npm run test:web
  • Start it manually: npm run dev:web then re-run tests

Tests time out waiting for .ProseMirror

The editor may be blocked by the AI consent dialog or recovery dialog. Make sure you call dismissAIConsent() in your test setup.

Fixture files not visible in file explorer

The file list auto-initializes from getDocumentsPath(). If files aren't showing:

  1. Check npm run dev:web console for errors
  2. Confirm the [aria-label="Show files"] button was clicked first

Theme toggle test fails

The initial theme (dark class on <html>) may differ if a previous test changed it. Use isolated browser contexts or clear localStorage between test runs:

test.beforeEach(async ({ page }) => {
  await page.addInitScript(() => localStorage.clear())
})

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.