Skip to main content

Contributing

Contributions are welcome! Here's how to get started.

Development setup​

git clone https://github.com/catesandrew/scw-ai.git
cd scw-ai
pnpm install
cp .env.example .env
# Edit .env with your SCW session ID

Making changes​

  1. Create a feature branch:

    git checkout -b feature/my-change
  2. Make your changes to src/index.js

  3. Test manually:

    node src/index.js --url "..." --no-headless
  4. Verify the build:

    pnpm build

Documentation​

The documentation site is built with Docusaurus and lives in website/.

Local development​

cd website
pnpm install
pnpm start

This starts a local dev server at http://localhost:3000/scw-ai/.

Building​

cd website
pnpm build

Code style​

  • The project uses CommonJS modules (require/module.exports)
  • Functions use camelCase naming
  • CSS selectors are organized in constant arrays at the top of the file
  • Browser-side code runs inside frame.evaluate() and must be self-contained

Adding new selectors​

If the SCW UI changes and selectors stop matching:

  1. Open a challenge in non-headless mode (--no-headless)
  2. Use the browser DevTools to inspect the updated DOM
  3. Add new selectors to the appropriate constant array (QUESTION_SELECTORS, ANSWER_CONTAINER_SELECTORS, etc.)
  4. Test with multiple challenges to ensure broad compatibility

Security​

  • Never commit session IDs, API keys, or credentials
  • Always use .env for sensitive configuration
  • HTML snapshots of challenge pages should not be committed (they may contain session-bound tokens)