Skip to content

olaafrossi/FoamPilot / .claude/skills/browse

browse

Flagged

Fast headless browser for QA testing and site dogfooding. Navigate any URL, interact with elements, verify page state, diff before/after actions, take annotated screenshots, check responsive layouts, test forms and uploads, handle dialogs, and assert element states. ~100ms per command. Use when you need to test a feature, verify a deployment, dogfood a user flow, or file a bug with evidence. Use when asked to "open in browser", "test the site", "take a screenshot", or "dogfood this".

FileKindSize
SKILL.mdskill md22.5 KB
SKILL.md.tmplother4.1 KB
scripts/build-node-server.shscript1.9 KB
src/activity.tsscript6.4 KB
src/browser-manager.tsscript33.3 KB
src/buffers.tsscript4.2 KB
src/bun-polyfill.cjsscript2.9 KB
src/cli.tsscript25.0 KB
src/commands.tsscript9.0 KB
src/config.tsscript4.6 KB
src/cookie-import-browser.tsscript22.5 KB
src/cookie-picker-routes.tsscript8.5 KB
src/cookie-picker-ui.tsscript21.6 KB
src/find-browse.tsscript1.7 KB
src/meta-commands.tsscript20.6 KB
src/platform.tsscript634 B
src/read-commands.tsscript13.4 KB
src/server.tsscript47.9 KB
src/sidebar-agent.tsscript10.0 KB
src/sidebar-utils.tsscript629 B
src/snapshot.tsscript15.1 KB
src/url-validation.tsscript3.5 KB
src/write-commands.tsscript14.1 KB
test/activity.test.tsscript4.4 KB
test/adversarial-security.test.tsscript1.2 KB
test/browser-manager-unit.test.tsscript677 B
test/bun-polyfill.test.tsscript2.9 KB
test/commands.test.tsscript76.7 KB
test/compare-board.test.tsscript11.3 KB
test/config.test.tsscript13.0 KB
test/cookie-import-browser.test.tsscript20.8 KB
test/cookie-picker-routes.test.tsscript9.5 KB
test/file-drop.test.tsscript10.0 KB
test/find-browse.test.tsscript2.0 KB
test/findport.test.tsscript6.2 KB
test/fixtures/basic.htmlother914 B
test/fixtures/cursor-interactive.htmlother883 B
test/fixtures/dialog.htmlother603 B
test/fixtures/empty.htmlother43 B
test/fixtures/forms.htmlother1.8 KB
test/fixtures/iframe.htmlother852 B
test/fixtures/network-idle.htmlother974 B
test/fixtures/qa-eval-checkout.htmlother4.2 KB
test/fixtures/qa-eval-spa.htmlother3.2 KB
test/fixtures/qa-eval.htmlother1.7 KB
test/fixtures/responsive.htmlother1.4 KB
test/fixtures/snapshot.htmlother1.5 KB
test/fixtures/spa.htmlother638 B
test/fixtures/states.htmlother567 B
test/fixtures/upload.htmlother849 B
test/gstack-config.test.tsscript5.2 KB
test/gstack-update-check.test.tsscript21.4 KB
test/handoff.test.tsscript8.1 KB
test/path-validation.test.tsscript3.3 KB
test/platform.test.tsscript1.0 KB
test/server-auth.test.tsscript3.0 KB
test/sidebar-agent-roundtrip.test.tsscript7.5 KB
test/sidebar-agent.test.tsscript6.8 KB
test/sidebar-integration.test.tsscript9.8 KB
test/sidebar-security.test.tsscript4.2 KB
test/sidebar-unit.test.tsscript3.3 KB
test/snapshot.test.tsscript19.7 KB
test/state-ttl.test.tsscript1.3 KB
test/test-server.tsscript1.7 KB
test/url-validation.test.tsscript2.8 KB
test/watch.test.tsscript4.0 KB

test/activity.test.ts

View on GitHub
import { describe, it, expect } from 'bun:test';
import { filterArgs, emitActivity, getActivityAfter, getActivityHistory, subscribe } from '../src/activity';

describe('filterArgs — privacy filtering', () => {
  it('redacts fill value for password fields', () => {
    expect(filterArgs('fill', ['#password', 'mysecret123'])).toEqual(['#password', '[REDACTED]']);
    expect(filterArgs('fill', ['input[type=passwd]', 'abc'])).toEqual(['input[type=passwd]', '[REDACTED]']);
  });

  it('preserves fill value for non-password fields', () => {
    expect(filterArgs('fill', ['#email', 'user@test.com'])).toEqual(['#email', 'user@test.com']);
  });

  it('redacts type command args', () => {
    expect(filterArgs('type', ['my password'])).toEqual(['[REDACTED]']);
  });

  it('redacts Authorization header', () => {
    expect(filterArgs('header', ['Authorization:Bearer abc123'])).toEqual(['Authorization:[REDACTED]']);
  });

  it('preserves non-sensitive headers', () => {
    expect(filterArgs('header', ['Content-Type:application/json'])).toEqual(['Content-Type:application/json']);
  });

  it('redacts cookie values', () => {
    expect(filterArgs('cookie', ['session_id=abc123'])).toEqual(['session_id=[REDACTED]']);
  });

  it('redacts sensitive URL query params', () => {
    const result = filterArgs('goto', ['https://example.com?api_key=secret&page=1']);
    expect(result[0]).toContain('api_key=%5BREDACTED%5D');
    expect(result[0]).toContain('page=1');
  });

  it('preserves non-sensitive URL query params', () => {
    const result = filterArgs('goto', ['https://example.com?page=1&sort=name']);
    expect(result[0]).toBe('https://example.com?page=1&sort=name');
  });

  it('handles empty args', () => {
    expect(filterArgs('click', [])).toEqual([]);
  });

  it('handles non-URL non-sensitive args', () => {
    expect(filterArgs('click', ['@e3'])).toEqual(['@e3']);
  });
});

describe('emitActivity', () => {
  it('emits with auto-incremented id', () => {
    const e1 = emitActivity({ type: 'command_start', command: 'goto', args: ['https://example.com'] });
    const e2 = emitActivity({ type: 'command_end', command: 'goto', status: 'ok', duration: 100 });
    expect(e2.id).toBe(e1.id + 1);
  });

  it('truncates long results', () => {
    const longResult = 'x'.repeat(500);
    const entry = emitActivity({ type: 'command_end', command: 'text', result: longResult });
    expect(entry.result!.length).toBeLessThanOrEqual(203); // 200 + "..."
  });

  it('applies privacy filtering', () => {
    const entry = emitActivity({ type: 'command_start', command: 'type', args: ['my secret password'] });
    expect(entry.args).toEqual(['[REDACTED]']);
  });
});

describe('getActivityAfter', () => {
  it('returns entries after cursor', () => {
    const e1 = emitActivity({ type: 'command_start', command: 'test1' });
    const e2 = emitActivity({ type: 'command_start', command: 'test2' });
    const result = getActivityAfter(e1.id);
    expect(result.entries.some(e => e.id === e2.id)).toBe(true);
    expect(result.gap).toBe(false);
  });

  it('returns all entries when cursor is 0', () => {
    emitActivity({ type: 'command_start', command: 'test3' });
    const result = getActivityAfter(0);
    expect(result.entries.length).toBeGreaterThan(0);
  });
});

describe('getActivityHistory', () => {
  it('returns limited entries', () => {
    for (let i = 0; i < 5; i++) {
      emitActivity({ type: 'command_start', command: `history-test-${i}` });
    }
    const result = getActivityHistory(3);
    expect(result.entries.length).toBeLessThanOrEqual(3);
  });
});

describe('subscribe', () => {
  it('receives new events', async () => {
    const received: any[] = [];
    const unsub = subscribe((entry) => received.push(entry));

    emitActivity({ type: 'command_start', command: 'sub-test' });

    // queueMicrotask is async — wait a tick
    await new Promise(resolve => setTimeout(resolve, 10));

    expect(received.length).toBeGreaterThanOrEqual(1);
    expect(received[received.length - 1].command).toBe('sub-test');
    unsub();
  });

  it('stops receiving after unsubscribe', async () => {
    const received: any[] = [];
    const unsub = subscribe((entry) => received.push(entry));
    unsub();

    emitActivity({ type: 'command_start', command: 'should-not-see' });
    await new Promise(resolve => setTimeout(resolve, 10));

    expect(received.filter(e => e.command === 'should-not-see').length).toBe(0);
  });
});
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