-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Canonical approach to supporting AI agent directions #16735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
titusfortner
wants to merge
9
commits into
trunk
Choose a base branch
from
agents
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cd67289
create agents files
titusfortner 45073e0
ignore common AI directories and files
titusfortner c8e7dc2
put testing files in another PR and make language file headings common
titusfortner b03aa5d
add section on how to run bazel commands.
titusfortner 7382f54
fix linting issues
titusfortner eb211ff
.gitignore entries don't work when you have spaces at the beginning
titusfortner 80e18d3
make suggested updates
titusfortner a71137d
more tweaks
titusfortner 57cfb3a
fixes
titusfortner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Always read AGENTS.md before answering |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| <!-- | ||
| Guidance for AI agents working in the Selenium monorepo. | ||
| Language-specific details live in respective subdirectories. | ||
| --> | ||
|
|
||
| Selenium is a Bazel-built monorepo implementing the W3C WebDriver (and related) protocols, | ||
| shipping multiple language bindings plus Grid and Selenium Manager. | ||
| The repository README is aimed at contributors; end-user docs live elsewhere. | ||
|
|
||
| If the user is asking a question (no code change requested), answer directly—no plans/checklists. | ||
| If the user requests a patch, follow the guidance below. | ||
|
|
||
| ## Execution model (important) | ||
| In many AI-agent environments, Bazel cannot be executed (restricted network/toolchain/browser access). | ||
| Agents MUST: | ||
| - Never claim commands/tests ran unless the user provides output. | ||
| - Provide copy/paste-ready commands for the user to run in an admin terminal. | ||
| - Ask for the exact output needed (errors, failing targets, stack traces), then iterate. | ||
|
|
||
| ### Terminal run request format: | ||
| Goal: <why this is being run> | ||
| Run: <command> | ||
|
|
||
| ## Invariants (don’t violate unless explicitly asked) | ||
| - Treat `bazel-*` as generated output. | ||
| - Treat `third_party/` as read-only. | ||
| - Preserve Apache 2.0 headers and NOTICE/LICENSE content. | ||
| - Avoid repo-wide refactors/formatting; prefer small, reversible diffs. | ||
|
|
||
| ## Repo layout | ||
| Bindings: | ||
| - Java: `java/` (see `java/AGENTS.md`) | ||
| - Python: `py/` (see `py/AGENTS.md`) | ||
| - Ruby: `rb/` (see `rb/AGENTS.md`) | ||
| - JavaScript: `javascript/selenium-webdriver/` (see `javascript/selenium-webdriver/AGENTS.md`) | ||
| - .NET: `dotnet/` (see `dotnet/AGENTS.md`) | ||
| Other components: | ||
| - `rust/` (Selenium Manager, see `rust/AGENTS.md`) | ||
| - `common/` (shared build/test wiring; changes can affect multiple areas) | ||
| - `common/src/` (test HTML fixtures; changes can break tests) | ||
| - `javascript/atoms/` (shared JS atoms; very high blast radius) | ||
| - `scripts/`, `rake_tasks/`, `.github/`, `Rakefile` (tooling/build; high risk) | ||
|
|
||
| ## Toolchain | ||
| - Expect Bazelisk + JDK 17+ (JAVA_HOME should point to a JDK) | ||
| - Prefer `./go <task>` if applicable (Rake tasks execute bazel & scripts, used by CI) | ||
| - Use targeted Bazel commands. Use `bazel query ...` to locate labels before build/test | ||
|
|
||
| ## Cross-binding consistency checks | ||
| When changing user-visible behavior, compare with at least one other binding: | ||
| - `rg <term> java/ py/ rb/ dotnet/ javascript/selenium-webdriver/` | ||
|
|
||
| If behavior is shared/low-level (protocol, serialization, “remote”/transport), expect follow-up parity work or file an issue explicitly. | ||
|
|
||
| ## Testing | ||
| Use each binding’s testing guide (see `<dir>/TESTING.md`). | ||
| Consider these flags when testing locally: | ||
| - `--test_size_filters=small` (unit tests only) | ||
| - `--test_output=all|streamed` (displays console output to debug) | ||
| - `--cache_test_results=no` (force re-running all tests) | ||
| - `--test_env FOO=bar` (if tests need environment variables) | ||
|
|
||
| ## Dependencies & lockfiles | ||
| - Don’t hand-edit lockfiles (`pnpm-lock.yaml`, `multitool.lock.json`, `Cargo.Bazel.lock`, etc). | ||
| - Use the binding’s documented update/repin flow (see `<dir>/AGENTS.md`). | ||
|
|
||
| ## High risk changes (request verification before modifying unless explicitly instructed) | ||
| - Everything referenced above as high risk | ||
| - WebDriver/BiDi semantics, capability parsing, wire-level behavior | ||
| - Dependency updates / `MODULE.bazel` / repin flows | ||
| - Grid routing/distributor/queue logic | ||
|
|
||
| ## After making code changes | ||
| - Call out any high risk areas touched | ||
| - List exact commands the user ran (or needs to run) + outcomes | ||
| - Note cross-binding impact and any follow-up issues needed | ||
| - Recommend formatting/lint if applicable (e.g., `./scripts/format.sh`) | ||
| - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @AGENTS.md | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <!-- Guidance for AI agents working in Selenium .NET Bindings --> | ||
|
|
||
| ## Code location | ||
| - Core: `dotnet/src/webdriver/` | ||
| - Support: `dotnet/src/support/` | ||
| - Tests: `dotnet/test/common/` | ||
|
|
||
| ## Common commands | ||
| - Build: `bazel build //dotnet/...` | ||
|
|
||
| ## Dependency management | ||
| ??? | ||
|
|
||
| ## Testing | ||
| See `dotnet/TESTING.md` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <!-- Guidance for AI agents working in Selenium Java Bindings and Grid. --> | ||
|
|
||
| ## Code location | ||
| - Java Bindings: `java/src/`, `java/test/` | ||
| - Grid Server: `java/src/org/openqa/selenium/grid/`, `java/test/org/openqa/selenium/grid` | ||
|
|
||
| ## Common commands | ||
| - Build: `bazel build //java/...` | ||
|
|
||
| ## Dependency management | ||
| - Dependencies live in `MODULE.bazel`; after edits: | ||
| - `RULES_JVM_EXTERNAL_REPIN=1 bazel run @maven//:pin` | ||
|
|
||
| ## Testing | ||
| See `java/TESTING.md`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <!-- Guidance for AI agents working in Selenium JavaScript Bindings --> | ||
|
|
||
| ## Code location | ||
|
|
||
| -`javascript/selenium-webdriver/` | ||
|
|
||
| ## Common commands | ||
|
|
||
| - Build: `bazel build //javascript/...` | ||
|
|
||
| ## Dependency management | ||
|
|
||
| ## Testing | ||
|
|
||
| See `javascript/selenium-webdriver/TESTING.md`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <!-- Guidance for AI agents working in Selenium Python Bindings --> | ||
|
|
||
| ## Code location | ||
| - Package: `py/selenium/` | ||
| - Remote/transport: `py/selenium/webdriver/remote/` | ||
|
|
||
| ## Common commands | ||
| - Build: `bazel build //py/...` | ||
|
|
||
| ## Dependency management | ||
| - Dev dependencies must be updated in `py/requirements.txt` and then run `scripts/update_py_dependencies.sh` | ||
| - Package dependencies must be updated in `py/pyproject.toml` and `py/BUILD.bazel` | ||
|
|
||
| ## Testing | ||
| See `py/TESTING.md` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <!-- Guidance for AI agents working in Selenium Ruby Bindings --> | ||
|
|
||
| ## Code location | ||
| - Library: `rb/lib/selenium/webdriver` | ||
| - Tests: `rb/spec/unit/selenium/webdriver` and `rb/spec/integration/selenium/webdriver` | ||
| - Bazel will build and use the version of Ruby specified in `rb/.ruby-version` | ||
|
|
||
| ## Common commands | ||
| - `bazel build //rb/...` | ||
|
|
||
| ## Dependency management | ||
| - Dependencies must be updated in `rb/selenium-webdriver.gemspec` | ||
| - Then run `bazel build @bundle//:bundle` | ||
|
|
||
| ## Testing | ||
| See `rb/TESTING.md` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- Guidance for AI agents working in Selenium Manager code --> | ||
|
|
||
| ## Code location | ||
| - `rust/src` and `rust/tests` | ||
|
|
||
| ## Common commands | ||
|
|
||
| ## Dependency management | ||
| Keep `Cargo.Bazel.lock` synchronized with `Cargo.lock`: | ||
| - `CARGO_BAZEL_REPIN=true bazel sync --only=crates` | ||
|
|
||
| ## Testing | ||
| See `rust/TESTING.md` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.