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
-
Create a feature branch:
git checkout -b feature/my-change -
Make your changes to
src/index.js -
Test manually:
node src/index.js --url "..." --no-headless -
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:
- Open a challenge in non-headless mode (
--no-headless) - Use the browser DevTools to inspect the updated DOM
- Add new selectors to the appropriate constant array (
QUESTION_SELECTORS,ANSWER_CONTAINER_SELECTORS, etc.) - Test with multiple challenges to ensure broad compatibility
Security
- Never commit session IDs, API keys, or credentials
- Always use
.envfor sensitive configuration - HTML snapshots of challenge pages should not be committed (they may contain session-bound tokens)