Imported from FENBROWSER/fenbrowser (
AGENTS.md). Install upstream withnpx skills add FENBROWSER/fenbrowser. Copyright stays with the author.
AGENTS.md — FenBrowser Root Guide
This file defines the default operating rules for agents working in FenBrowser.
Mission
Work on FenBrowser with:
- minimal scope
- root-cause fixes
- production-grade behavior
- deterministic verification
- low-regression changes
- compact communication
The browser may be referred to as fen or fenbrowser.
Repository shape
Primary projects:
FenBrowser.Core— DOM, parsing, resource/network primitives, shared browser typesFenBrowser.FenEngine— CSS, layout, rendering, scripting, runtime pipelineFenBrowser.Host— windowing, input, host integration, OS boundaryFenBrowser.DevTools— native devtools UI and remote debugging protocol
Other important surfaces:
FenBrowser.WebDriverFenBrowser.Tests- all tooling and scripts live under
scripts/— never at repo root
Default behavior:
- inspect the smallest relevant project first
- do not scan all projects unless the task is cross-cutting
- do not start in tests/conformance projects unless verification or test work is the task
Non-negotiable rules
- Reproduce before fixing.
- Prefer root cause over symptom patch.
- Keep changes minimal and local.
- Do not refactor unrelated code.
- Do not widen scope without evidence.
- Build or verify the smallest affected surface first.
- If behavior or architecture meaningfully changes, update the relevant canonical docs in the same change.
- Do not use platform-specific APIs outside host/platform layers unless the task is explicitly platform work.
- Treat native resource ownership as critical. Dispose correctly.
- Keep replies compact unless a deep dive is requested.
- Keep the repository root clean. Never add scripts or one-off helpers at root — they go in
scripts/.
Canonical documentation set
Use only these docs as the authoritative documentation map:
docs/VOLUME_I_SYSTEM_MANIFEST.mddocs/VOLUME_II_CORE.mddocs/VOLUME_III_FENENGINE.mddocs/VOLUME_IV_HOST.mddocs/VOLUME_V_DEVTOOLS.mddocs/VOLUME_VI_EXTENSIONS_VERIFICATION.mddocs/COMPLIANCE.mddocs/DEFINITION_OF_DONE.mddocs/GLOSSARY.mddocs/INDEX.mddocs/THIRD_PARTY_DEPENDENCIES.md
Do not assume legacy docs/TechnicalReference/, Part_*, or Volume_*_Tree.md structures are the active documentation contract.
Documentation synchronization rule
Documentation is required when a change affects:
- architecture or subsystem boundaries
- observable runtime behavior
- diagnostics or operator workflow
- verification/test workflow
- compliance/spec-status understanding
- terminology
- third-party dependency inventory or rationale
Small localized fixes do not require doc churn unless they change how the subsystem should be understood.
Mapping:
- Core changes ->
VOLUME_II_CORE.md - FenEngine changes ->
VOLUME_III_FENENGINE.md - Host changes ->
VOLUME_IV_HOST.md - DevTools changes ->
VOLUME_V_DEVTOOLS.md - WebDriver / tests / verification / tooling ->
VOLUME_VI_EXTENSIONS_VERIFICATION.md
Additional appendices only when relevant:
- compliance/spec planning ->
COMPLIANCE.md - merge/review gates ->
DEFINITION_OF_DONE.md - terminology ->
GLOSSARY.md - dependency surface ->
THIRD_PARTY_DEPENDENCIES.md - docs navigation/indexing ->
INDEX.md
Working style
Default sequence:
- Restate the bug/task in one sentence internally.
- Identify the owning subsystem.
- Inspect only likely files first.
- Reproduce or verify the failure.
- Patch the earliest broken stage.
- Run the smallest meaningful verification.
- Update docs only if required.
- Summarize:
- root cause
- files changed
- verification
- docs touched
Avoid:
- broad repo tours
- speculative rewrites
- architecture changes without evidence
- repeating the user prompt
- long educational explanations unless requested
Debug and artifact workflow
For runtime/rendering issues, prefer this diagnostic order:
logs/debug_screenshot.pnglogs/raw_source_*.htmllogs/dom_dump.txtlogs/fenbrowser_*.log
Default clean-state workflow:
- kill existing FenBrowser-related processes
- clear relevant logs/artifacts
- build/run cleanly
- allow startup/navigation enough time to settle
- inspect screenshot + DOM/log artifacts before patching
Diagnostics path policy (strict):
- Runtime artifacts must be written under workspace-root
logs/only. - Do not write diagnostics to repository root.
- Do not write diagnostics to
docs/. - Applies to generated
.txt,.png,.png.meta,.js,.htmlartifacts.
Result/report policy:
- Use workspace-root
Results/for generated reports and result bundles. - Keep
docs/limited to maintained documentation sources, not runtime outputs.
Scripts and root-cleanliness policy (strict):
- Every script (
.sh,.ps1,.py,.bat,.cmd) lives underscripts/— never at repo root, including throwaway one-offs. - Invoke scripts from repo root by path, e.g.
bash scripts/run_full_batched.sh; write script-internal paths relative to repo root (cwd), not to the script's own location. - The repo root holds only: solution/project files, top-level docs (
README,AGENTS.md,CLAUDE.md,CODEX.md), config/dotfiles, and the standing project directories. Nothing else accumulates there. - If a task tempts you to drop a file at root, put it in the right folder (
scripts/,logs/,Results/,docs/) instead.
Threading boundaries
UI thread only:
- widgets
- window management
- UI invalidation
- host/UI event handling
Render thread / engine-owned execution only:
- box/layout computation
- paint preparation
- rendering pipeline work
Queued/microtask/event-loop work:
- use the established coordinator/event-loop surfaces
- do not block hot paths with ad hoc synchronous work
Resource and safety discipline
- Use
using/ deterministic disposal for native Skia and similar native-backed objects. - Avoid unnecessary allocations in hot paths.
- Prefer pooling/reuse only when it simplifies hot-path cost without obscuring correctness.
- Never let a drawing library define layout semantics.
- Keep state flow explicit; avoid hidden globals.
- Keep Core/FenEngine/WebDriver logic platform-agnostic unless the task is explicitly platform work.
Terminology contract
Use project terms consistently:
- Box / LayoutBox
- Box Tree
- Paint Tree
- Bridge
- Host
- DOM
- Node / Element / ContainerNode
- Microtask
Avoid inventing alternate names for established subsystem concepts.
Verification policy
Choose the smallest verification that can falsify the change.
Typical order:
- focused build of touched project
- focused test slice for the changed path
- broader slice only if the change crosses subsystem boundaries
- full solution build/test only when necessary
Do not run large suites by default when a smaller proof is sufficient.
Test repository roots (mandatory — NEVER search the internet)
The conformance test repositories are local checkouts. All test counts, file searches, result data, and conformance information come from these local paths — never from GitHub, web search, or any remote source:
- test262 root:
C:\Users\udayk\Videos\test262 - WPT root:
C:\Users\udayk\Videos\wpt
Do not fetch test counts or repo info from github.com or anywhere else — use these local directories.
test262 timeout policy (mandatory, no exceptions)
Every test262 run MUST enforce a 2-second per-test timeout. Any test exceeding 2s is skipped, never awaited — a single test must never hang or block the suite. Always pass --timeout-ms 2000 (CLI) / -TimeoutMs 2000 (scripts) plus a stall watchdog (-StallTimeoutSec 30). This applies to every test262 invocation — quick categories, full chunks, single reruns — with no exception.
test262 real-results tracking (mandatory)
docs/test262_results.mdis the committed source of truth for per-category pass rates (regenerated byscripts/test262_report.pyfrom the local batched store). To check status, READ that file — do not re-run the full ~53k suite. A full run is for occasional rebaselining only.- Work loop: pick a category from that file's worklist → find the shared root cause in
Results/test262/batched/b_<tag>.json(failures[].details) → fix the engine → re-run only that category withbash scripts/rerun-test262-category.sh <category>(overwrites itsb_<tag>.jsonand regenerates the doc) → commit the updateddocs/test262_results.mdwith the fix.
test262 execution & results policy (mandatory)
- Run category by category, not the whole suite blindly. Drive one category at a time.
- A category is done at 100% pass rate — push every category to zero failures. No gate. Stay on a category (localize-and-fix loop) until it clears.
- Results layout — everything under
Results/test262/:Results/test262/full/— full-suite run results (summary + per-category breakdown of a full pass).Results/test262/categories/— individual per-category run results.
- Clear stale results and keep at most one day of history. Before/after a run, purge result files older than 24h so the folders only hold the latest day. Do not let
Results/test262/accumulate. (Results/is gitignored — this is local housekeeping, never committed.)
Commit and push discipline
Ship work in feature/component-sized units, one at a time. For each unit, before starting the next:
- Clean build of the affected project(s) succeeds with zero errors.
- Verify with test262, WPT, or local unit tests (whichever exercises the change); it must pass with no new failures.
- Only if verification passed, commit — human-style messages, split into the smallest coherent chunks (one logical change per commit).
- Push the committed work.
- Then move to the next unit.
Hard rules:
- Never commit unbuilt or unverified code.
- Never batch multiple unrelated features/fixes into one commit.
- Never leave a completed, verified unit unpushed before starting the next one.
- Do not add AI/co-author trailers to commit messages.
Output contract for agent responses
Default response format:
- Root cause
- Files inspected/changed
- Minimal patch plan or applied fix
- Verification command/result
- Docs updated or not needed
Keep the response brief and technical. Do not restate obvious context. Do not add background unless it materially helps the next action.