{"owner":"swc-project","repo":"swc","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","CLAUDE.md"],"skills":{"AGENTS.md":"# Instructions\n\n## General rule\n\n-   Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.\n-   Do not search web unless explicitly asked to do so. Web search does not help in general for our project.\n-   Write performant code. Always prefer performance over other things.\n-   Use `gh` CLI tool for fetching data from `github.com`.\n-   Do not let sandbox constraints stall progress. If sandbox restrictions block required work, request escalation promptly and continue.\n\n## Code style\n\n-   Write comments and documentations in English.\n-   Write documentation for your code.\n-   When introducing a workaround, leave sufficient comments explaining why it is needed and any known limitations.\n-   Commit your work as frequent as possible using git. Do NOT use `--no-verify` flag.\n-   Prefer multiple small files over single large file.\n-   Prefer enum (or dedicated type) based modeling over raw string literals whenever possible.\n\n---\n\n-   When creating Atom instances, it's better to use `Cow<str>` or `&str` instead of `String`. Note that `&str` is better than `Cow<str>` here.\n\n## Debugging and logging\n\n-   Do not guess behavior. Verify assumptions by reading source, fixtures, and tests.\n-   Debug with logs when behavior is unclear.\n-   Write sufficient logs for debugging and operational troubleshooting.\n-   Prefer structured logging in Rust (`tracing`) over ad-hoc plain text logs when feasible.\n\n## Shell safety\n\n-   For shell commands or scripts, prefer `$(...)` over legacy backticks for command substitution.\n-   Quote and escape all dynamic shell values strictly.\n\n## Git workflow\n\n-   Run `git commit` only after `git add`.\n-   Once changes are staged, commit without unnecessary delay so staged history is preserved.\n-   When creating or updating a pull request, follow the repository pull request template.\n-   When creating a pull request, use the `add-changeset` skill to create the required changeset.\n-   After addressing pull request review comments and pushing updates, resolve the corresponding review threads.\n\n## Testing\n\n-   Write unit tests for your code.\n-   Prefer fixture tests over inline (`#[test]`) tests.\n-   Before running tests, run `git submodule update --init --recursive` to initialize and update all submodules.\n-   You can do `UPDATE=1 cargo test` to get test outputs updated for fixture tests.\n-   When instructed to fix tests, do not remove or modify existing tests.\n\n### Fixture Test Common Guide\n\n- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.\n- Find the exact fixture harness before adding files with: `rg -n \"#\\[(testing::)?fixture\\(\" tests src --glob \"*.rs\"`.\n- Keep each suite's naming conventions (for example: input.*, output.*, exec.*, .ans).\n- For snapshot-style tests, update expected outputs with `UPDATE=1 cargo test -p ...` using the exact crate command documented in each crate's AGENTS.md.\n- Always rerun the same crate tests without `UPDATE` before finishing.\n\n## Verification\n\n-   Before finishing a task, always run this baseline locally.\n    -   `cargo fmt --all`\n    -   `cargo clippy --all --all-targets -- -D warnings`\n-   For each touched Rust crate, run crate-level verification locally.\n    -   `cargo test -p <crate>`\n-   If wasm binding packages are touched, run:\n    -   `(cd bindings/binding_core_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_minifier_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_typescript_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)`\n-   If node bindings or integration paths are touched, run:\n    -   `(cd packages/core && pnpm build:dev && pnpm test)`\n\n## Compatibility rule\n\n-   Do not use unstable, nightly only features of rustc.\n-   Respect the project's MSRV. Do not rely on Rust language features or standard library APIs newer than the MSRV unless the change intentionally raises the MSRV.\n","CLAUDE.md":"# AI Agent Rules\n\nWhen working in a specific directory, apply the rules from that directory and all parent directories up to the root.\n\n## While working on `.`\n\n*Source: `AGENTS.md`*\n\n# Instructions\n\n## General rule\n\n-   Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.\n-   Do not search web unless explicitly asked to do so. Web search does not help in general for our project.\n-   Write performant code. Always prefer performance over other things.\n-   Use `gh` CLI tool for fetching data from `github.com`.\n\n## Code style\n\n-   Write comments and documentations in English.\n-   Write documentation for your code.\n-   Commit your work as frequent as possible using git. Do NOT use `--no-verify` flag.\n-   Prefer multiple small files over single large file.\n\n---\n\n-   When creating Atom instances, it's better to use `Cow<str>` or `&str` instead of `String`. Note that `&str` is better than `Cow<str>` here.\n\n## Testing\n\n-   Write unit tests for your code.\n-   Prefer fixture tests over inline (`#[test]`) tests.\n-   You can do `UPDATE=1 cargo test` to get test outputs updated for fixture tests.\n-   When instructed to fix tests, do not remove or modify existing tests.\n\n### Fixture Test Common Guide\n\n- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.\n- Find the exact fixture harness before adding files with: `rg -n \"#\\[(testing::)?fixture\\(\" tests src --glob \"*.rs\"`.\n- Keep each suite's naming conventions (for example: input.*, output.*, exec.*, .ans).\n- For snapshot-style tests, update expected outputs with `UPDATE=1 cargo test -p ...` using the exact crate command documented in each crate's AGENTS.md.\n- Always rerun the same crate tests without `UPDATE` before finishing.\n\n## Verification\n\n-   Before finishing a task, always run this baseline locally.\n    -   `cargo fmt --all`\n    -   `cargo clippy --all --all-targets -- -D warnings`\n-   For each touched Rust crate, run crate-level verification locally.\n    -   `cargo test -p <crate>`\n-   If wasm binding packages are touched, run:\n    -   `(cd bindings/binding_core_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_minifier_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_typescript_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)`\n-   If node bindings or integration paths are touched, run:\n    -   `(cd packages/core && pnpm build:dev && pnpm test)`\n\n## Compatibility rule\n\n-   Do not use unstable, nightly only features of rustc.\n\n\n---\n\n## While working on `crates/jsdoc`\n\n*Source: `crates/jsdoc/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p jsdoc.\n- Verify without UPDATE before finishing: cargo test -p jsdoc.\n\n\n---\n\n## While working on `crates/swc`\n\n*Source: `crates/swc/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/errors, tests/exec, tests/minify, tests/typescript, tests/vercel, tests/stacktrace, tests/babel-exec.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc.\n- Verify without UPDATE before finishing: cargo test -p swc.\n\n\n---\n\n## While working on `crates/swc_bundler`\n\n*Source: `crates/swc_bundler/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/deno-exec.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_bundler.\n- Verify without UPDATE before finishing: cargo test -p swc_bundler.\n\n\n---\n\n## While working on `crates/swc_core`\n\n*Source: `crates/swc_core/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_core.\n- Verify without UPDATE before finishing: cargo test -p swc_core.\n\n\n---\n\n## While working on `crates/swc_css_codegen`\n\n*Source: `crates/swc_css_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_css_parser/tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_css_codegen.\n\n\n---\n\n## While working on `crates/swc_css_compat`\n\n*Source: `crates/swc_css_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/nesting, tests/custom-media-query, tests/media-query-ranges, tests/color-hex-alpha, tests/color-legacy, tests/selector-not, tests/color-hwb, tests/all.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_css_compat.\n\n\n---\n\n## While working on `crates/swc_css_lints`\n\n*Source: `crates/swc_css_lints/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/rules/pass, tests/rules/fail.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_lints.\n- Verify without UPDATE before finishing: cargo test -p swc_css_lints.\n\n\n---\n\n## While working on `crates/swc_css_minifier`\n\n*Source: `crates/swc_css_minifier/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_css_minifier.\n\n\n---\n\n## While working on `crates/swc_css_modules`\n\n*Source: `crates/swc_css_modules/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/with-compat.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_modules.\n- Verify without UPDATE before finishing: cargo test -p swc_css_modules.\n\n\n---\n\n## While working on `crates/swc_css_parser`\n\n*Source: `crates/swc_css_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/line-comment, tests/recovery, tests/recovery-cssmodules.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_css_parser.\n\n\n---\n\n## While working on `crates/swc_css_prefixer`\n\n*Source: `crates/swc_css_prefixer/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_prefixer.\n- Verify without UPDATE before finishing: cargo test -p swc_css_prefixer.\n\n\n---\n\n## While working on `crates/swc_ecma_codegen`\n\n*Source: `crates/swc_ecma_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/str-lits, ../swc_ecma_parser/tests/test262-parser/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_codegen.\n\n\n---\n\n## While working on `crates/swc_ecma_lints`\n\n*Source: `crates/swc_ecma_lints/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_lints.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_lints.\n\n\n---\n\n## While working on `crates/swc_ecma_minifier`\n\n*Source: `crates/swc_ecma_minifier/AGENTS.md`*\n\n### Instructions\n\n- You can run execution tests by doing ./scripts/exec.sh to see if your changes are working.\n- If an execution test fails, you are wrong.\n- Always run execution tests after making changes.\n- You can run fixture tests by doing ./scripts/test.sh, and you can do UPDATE=1 ./scripts/test.sh to update fixtures.\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/terser, tests/mangle, tests/pass-1, tests/pass-default, tests/full, tests/projects, benches/full.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_minifier.\n\n\n---\n\n## While working on `crates/swc_ecma_parser`\n\n*Source: `crates/swc_ecma_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/js, tests/jsx, tests/typescript, tests/typescript-errors, tests/errors, tests/comments, tests/span, tests/shifted.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_parser.\n\n\n---\n\n## While working on `crates/swc_ecma_preset_env`\n\n*Source: `crates/swc_ecma_preset_env/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_preset_env.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_preset_env.\n\n\n---\n\n## While working on `crates/swc_ecma_transformer`\n\n*Source: `crates/swc_ecma_transformer/AGENTS.md`*\n\n### Instructions\n\n-   The Transformer must implement `VisitMut` and execute the `VisitMutHooks` of its subtypes.\n-   Other types like ES20xx or transforms for specific syntax MUST NOT implement `VisitMut`.\n-   Subtypes must implement `VisitMutHook<TraverseCtx>`.\n-   Before starting work, read `$repositoryRoot/crates/swc_ecma_hooks/src/`.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms`\n\n*Source: `crates/swc_ecma_transforms/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_base`\n\n*Source: `crates/swc_ecma_transforms_base/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/resolver, tests/ts-resolver, ../swc_ecma_parser/tests.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_base.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_base.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_compat`\n\n*Source: `crates/swc_ecma_transforms_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/arrow, tests/async-to-generator, tests/block-scoping, tests/class-properties, tests/class_fields_use_set, tests/classes, tests/destructuring, tests/for-of, tests/new-target, tests/object-rest-spread, tests/optional-chaining, tests/optional-chaining-loose, tests/parameters, tests/private-in-object, tests/shorthand_properties, tests/static-blocks.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_compat.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_module`\n\n*Source: `crates/swc_ecma_transforms_module/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/paths.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_module.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_module.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_optimization`\n\n*Source: `crates/swc_ecma_transforms_optimization/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/const-modules, tests/dce, tests/dce-jsx, tests/expr-simplifier.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_optimization.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_optimization.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_proposal`\n\n*Source: `crates/swc_ecma_transforms_proposal/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/decorators, tests/explicit-resource-management.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_proposal.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_proposal.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_react`\n\n*Source: `crates/swc_ecma_transforms_react/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/jsx/fixture, tests/integration/fixture, tests/script/jsx/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_react.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_react.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_typescript`\n\n*Source: `crates/swc_ecma_transforms_typescript/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc, ../swc_ecma_parser/tests/typescript.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_typescript.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_typescript.\n\n\n---\n\n## While working on `crates/swc_error_reporters`\n\n*Source: `crates/swc_error_reporters/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_error_reporters.\n- Verify without UPDATE before finishing: cargo test -p swc_error_reporters.\n\n\n---\n\n## While working on `crates/swc_estree_compat`\n\n*Source: `crates/swc_estree_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures, tests/flavor/acorn/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_estree_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_estree_compat.\n\n\n---\n\n## While working on `crates/swc_html_codegen`\n\n*Source: `crates/swc_html_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/options, ../swc_html_parser/tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_html_codegen.\n\n\n---\n\n## While working on `crates/swc_html_minifier`\n\n*Source: `crates/swc_html_minifier/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_html_minifier.\n\n\n---\n\n## While working on `crates/swc_html_parser`\n\n*Source: `crates/swc_html_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/recovery, tests/iframe_srcdoc, tests/html5lib-tests-fixture, tests/html5lib-tests.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_html_parser.\n\n\n---\n\n## While working on `crates/swc_node_bundler`\n\n*Source: `crates/swc_node_bundler/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_node_bundler.\n- Verify without UPDATE before finishing: cargo test -p swc_node_bundler.\n\n\n---\n\n## While working on `crates/swc_plugin_backend_tests`\n\n*Source: `crates/swc_plugin_backend_tests/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_plugin_backend_tests.\n- Verify without UPDATE before finishing: cargo test -p swc_plugin_backend_tests.\n\n\n---\n\n## While working on `crates/swc_ts_fast_strip`\n\n*Source: `crates/swc_ts_fast_strip/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/errors, ../swc_ecma_parser/tests/tsc.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ts_fast_strip.\n- Verify without UPDATE before finishing: cargo test -p swc_ts_fast_strip.\n\n\n---\n\n## While working on `crates/swc_typescript`\n\n*Source: `crates/swc_typescript/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/**/*.ts, tests/**/*.tsx.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_typescript.\n- Verify without UPDATE before finishing: cargo test -p swc_typescript.\n\n\n---\n\n## While working on `crates/swc_xml_codegen`\n\n*Source: `crates/swc_xml_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_xml_parser/tests/fixture, ../swc_xml_parser/tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_xml_codegen.\n\n\n---\n\n## While working on `crates/swc_xml_parser`\n\n*Source: `crates/swc_xml_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_xml_parser.\n\n\n---\n\n## While working on `crates/testing_macros`\n\n*Source: `crates/testing_macros/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/simple, tests/ignore.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p testing_macros.\n- Verify without UPDATE before finishing: cargo test -p testing_macros.\n"},"files":{"AGENTS.md":"# Instructions\n\n## General rule\n\n-   Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.\n-   Do not search web unless explicitly asked to do so. Web search does not help in general for our project.\n-   Write performant code. Always prefer performance over other things.\n-   Use `gh` CLI tool for fetching data from `github.com`.\n-   Do not let sandbox constraints stall progress. If sandbox restrictions block required work, request escalation promptly and continue.\n\n## Code style\n\n-   Write comments and documentations in English.\n-   Write documentation for your code.\n-   When introducing a workaround, leave sufficient comments explaining why it is needed and any known limitations.\n-   Commit your work as frequent as possible using git. Do NOT use `--no-verify` flag.\n-   Prefer multiple small files over single large file.\n-   Prefer enum (or dedicated type) based modeling over raw string literals whenever possible.\n\n---\n\n-   When creating Atom instances, it's better to use `Cow<str>` or `&str` instead of `String`. Note that `&str` is better than `Cow<str>` here.\n\n## Debugging and logging\n\n-   Do not guess behavior. Verify assumptions by reading source, fixtures, and tests.\n-   Debug with logs when behavior is unclear.\n-   Write sufficient logs for debugging and operational troubleshooting.\n-   Prefer structured logging in Rust (`tracing`) over ad-hoc plain text logs when feasible.\n\n## Shell safety\n\n-   For shell commands or scripts, prefer `$(...)` over legacy backticks for command substitution.\n-   Quote and escape all dynamic shell values strictly.\n\n## Git workflow\n\n-   Run `git commit` only after `git add`.\n-   Once changes are staged, commit without unnecessary delay so staged history is preserved.\n-   When creating or updating a pull request, follow the repository pull request template.\n-   When creating a pull request, use the `add-changeset` skill to create the required changeset.\n-   After addressing pull request review comments and pushing updates, resolve the corresponding review threads.\n\n## Testing\n\n-   Write unit tests for your code.\n-   Prefer fixture tests over inline (`#[test]`) tests.\n-   Before running tests, run `git submodule update --init --recursive` to initialize and update all submodules.\n-   You can do `UPDATE=1 cargo test` to get test outputs updated for fixture tests.\n-   When instructed to fix tests, do not remove or modify existing tests.\n\n### Fixture Test Common Guide\n\n- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.\n- Find the exact fixture harness before adding files with: `rg -n \"#\\[(testing::)?fixture\\(\" tests src --glob \"*.rs\"`.\n- Keep each suite's naming conventions (for example: input.*, output.*, exec.*, .ans).\n- For snapshot-style tests, update expected outputs with `UPDATE=1 cargo test -p ...` using the exact crate command documented in each crate's AGENTS.md.\n- Always rerun the same crate tests without `UPDATE` before finishing.\n\n## Verification\n\n-   Before finishing a task, always run this baseline locally.\n    -   `cargo fmt --all`\n    -   `cargo clippy --all --all-targets -- -D warnings`\n-   For each touched Rust crate, run crate-level verification locally.\n    -   `cargo test -p <crate>`\n-   If wasm binding packages are touched, run:\n    -   `(cd bindings/binding_core_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_minifier_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_typescript_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)`\n-   If node bindings or integration paths are touched, run:\n    -   `(cd packages/core && pnpm build:dev && pnpm test)`\n\n## Compatibility rule\n\n-   Do not use unstable, nightly only features of rustc.\n-   Respect the project's MSRV. Do not rely on Rust language features or standard library APIs newer than the MSRV unless the change intentionally raises the MSRV.\n","CLAUDE.md":"# AI Agent Rules\n\nWhen working in a specific directory, apply the rules from that directory and all parent directories up to the root.\n\n## While working on `.`\n\n*Source: `AGENTS.md`*\n\n# Instructions\n\n## General rule\n\n-   Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.\n-   Do not search web unless explicitly asked to do so. Web search does not help in general for our project.\n-   Write performant code. Always prefer performance over other things.\n-   Use `gh` CLI tool for fetching data from `github.com`.\n\n## Code style\n\n-   Write comments and documentations in English.\n-   Write documentation for your code.\n-   Commit your work as frequent as possible using git. Do NOT use `--no-verify` flag.\n-   Prefer multiple small files over single large file.\n\n---\n\n-   When creating Atom instances, it's better to use `Cow<str>` or `&str` instead of `String`. Note that `&str` is better than `Cow<str>` here.\n\n## Testing\n\n-   Write unit tests for your code.\n-   Prefer fixture tests over inline (`#[test]`) tests.\n-   You can do `UPDATE=1 cargo test` to get test outputs updated for fixture tests.\n-   When instructed to fix tests, do not remove or modify existing tests.\n\n### Fixture Test Common Guide\n\n- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.\n- Find the exact fixture harness before adding files with: `rg -n \"#\\[(testing::)?fixture\\(\" tests src --glob \"*.rs\"`.\n- Keep each suite's naming conventions (for example: input.*, output.*, exec.*, .ans).\n- For snapshot-style tests, update expected outputs with `UPDATE=1 cargo test -p ...` using the exact crate command documented in each crate's AGENTS.md.\n- Always rerun the same crate tests without `UPDATE` before finishing.\n\n## Verification\n\n-   Before finishing a task, always run this baseline locally.\n    -   `cargo fmt --all`\n    -   `cargo clippy --all --all-targets -- -D warnings`\n-   For each touched Rust crate, run crate-level verification locally.\n    -   `cargo test -p <crate>`\n-   If wasm binding packages are touched, run:\n    -   `(cd bindings/binding_core_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_minifier_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_typescript_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)`\n-   If node bindings or integration paths are touched, run:\n    -   `(cd packages/core && pnpm build:dev && pnpm test)`\n\n## Compatibility rule\n\n-   Do not use unstable, nightly only features of rustc.\n\n\n---\n\n## While working on `crates/jsdoc`\n\n*Source: `crates/jsdoc/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p jsdoc.\n- Verify without UPDATE before finishing: cargo test -p jsdoc.\n\n\n---\n\n## While working on `crates/swc`\n\n*Source: `crates/swc/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/errors, tests/exec, tests/minify, tests/typescript, tests/vercel, tests/stacktrace, tests/babel-exec.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc.\n- Verify without UPDATE before finishing: cargo test -p swc.\n\n\n---\n\n## While working on `crates/swc_bundler`\n\n*Source: `crates/swc_bundler/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/deno-exec.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_bundler.\n- Verify without UPDATE before finishing: cargo test -p swc_bundler.\n\n\n---\n\n## While working on `crates/swc_core`\n\n*Source: `crates/swc_core/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_core.\n- Verify without UPDATE before finishing: cargo test -p swc_core.\n\n\n---\n\n## While working on `crates/swc_css_codegen`\n\n*Source: `crates/swc_css_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_css_parser/tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_css_codegen.\n\n\n---\n\n## While working on `crates/swc_css_compat`\n\n*Source: `crates/swc_css_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/nesting, tests/custom-media-query, tests/media-query-ranges, tests/color-hex-alpha, tests/color-legacy, tests/selector-not, tests/color-hwb, tests/all.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_css_compat.\n\n\n---\n\n## While working on `crates/swc_css_lints`\n\n*Source: `crates/swc_css_lints/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/rules/pass, tests/rules/fail.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_lints.\n- Verify without UPDATE before finishing: cargo test -p swc_css_lints.\n\n\n---\n\n## While working on `crates/swc_css_minifier`\n\n*Source: `crates/swc_css_minifier/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_css_minifier.\n\n\n---\n\n## While working on `crates/swc_css_modules`\n\n*Source: `crates/swc_css_modules/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/with-compat.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_modules.\n- Verify without UPDATE before finishing: cargo test -p swc_css_modules.\n\n\n---\n\n## While working on `crates/swc_css_parser`\n\n*Source: `crates/swc_css_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/line-comment, tests/recovery, tests/recovery-cssmodules.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_css_parser.\n\n\n---\n\n## While working on `crates/swc_css_prefixer`\n\n*Source: `crates/swc_css_prefixer/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_prefixer.\n- Verify without UPDATE before finishing: cargo test -p swc_css_prefixer.\n\n\n---\n\n## While working on `crates/swc_ecma_codegen`\n\n*Source: `crates/swc_ecma_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/str-lits, ../swc_ecma_parser/tests/test262-parser/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_codegen.\n\n\n---\n\n## While working on `crates/swc_ecma_lints`\n\n*Source: `crates/swc_ecma_lints/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_lints.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_lints.\n\n\n---\n\n## While working on `crates/swc_ecma_minifier`\n\n*Source: `crates/swc_ecma_minifier/AGENTS.md`*\n\n### Instructions\n\n- You can run execution tests by doing ./scripts/exec.sh to see if your changes are working.\n- If an execution test fails, you are wrong.\n- Always run execution tests after making changes.\n- You can run fixture tests by doing ./scripts/test.sh, and you can do UPDATE=1 ./scripts/test.sh to update fixtures.\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/terser, tests/mangle, tests/pass-1, tests/pass-default, tests/full, tests/projects, benches/full.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_minifier.\n\n\n---\n\n## While working on `crates/swc_ecma_parser`\n\n*Source: `crates/swc_ecma_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/js, tests/jsx, tests/typescript, tests/typescript-errors, tests/errors, tests/comments, tests/span, tests/shifted.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_parser.\n\n\n---\n\n## While working on `crates/swc_ecma_preset_env`\n\n*Source: `crates/swc_ecma_preset_env/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_preset_env.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_preset_env.\n\n\n---\n\n## While working on `crates/swc_ecma_transformer`\n\n*Source: `crates/swc_ecma_transformer/AGENTS.md`*\n\n### Instructions\n\n-   The Transformer must implement `VisitMut` and execute the `VisitMutHooks` of its subtypes.\n-   Other types like ES20xx or transforms for specific syntax MUST NOT implement `VisitMut`.\n-   Subtypes must implement `VisitMutHook<TraverseCtx>`.\n-   Before starting work, read `$repositoryRoot/crates/swc_ecma_hooks/src/`.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms`\n\n*Source: `crates/swc_ecma_transforms/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_base`\n\n*Source: `crates/swc_ecma_transforms_base/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/resolver, tests/ts-resolver, ../swc_ecma_parser/tests.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_base.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_base.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_compat`\n\n*Source: `crates/swc_ecma_transforms_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/arrow, tests/async-to-generator, tests/block-scoping, tests/class-properties, tests/class_fields_use_set, tests/classes, tests/destructuring, tests/for-of, tests/new-target, tests/object-rest-spread, tests/optional-chaining, tests/optional-chaining-loose, tests/parameters, tests/private-in-object, tests/shorthand_properties, tests/static-blocks.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_compat.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_module`\n\n*Source: `crates/swc_ecma_transforms_module/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/paths.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_module.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_module.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_optimization`\n\n*Source: `crates/swc_ecma_transforms_optimization/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/const-modules, tests/dce, tests/dce-jsx, tests/expr-simplifier.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_optimization.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_optimization.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_proposal`\n\n*Source: `crates/swc_ecma_transforms_proposal/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/decorators, tests/explicit-resource-management.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_proposal.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_proposal.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_react`\n\n*Source: `crates/swc_ecma_transforms_react/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/jsx/fixture, tests/integration/fixture, tests/script/jsx/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_react.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_react.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_typescript`\n\n*Source: `crates/swc_ecma_transforms_typescript/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc, ../swc_ecma_parser/tests/typescript.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_typescript.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_typescript.\n\n\n---\n\n## While working on `crates/swc_error_reporters`\n\n*Source: `crates/swc_error_reporters/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_error_reporters.\n- Verify without UPDATE before finishing: cargo test -p swc_error_reporters.\n\n\n---\n\n## While working on `crates/swc_estree_compat`\n\n*Source: `crates/swc_estree_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures, tests/flavor/acorn/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_estree_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_estree_compat.\n\n\n---\n\n## While working on `crates/swc_html_codegen`\n\n*Source: `crates/swc_html_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/options, ../swc_html_parser/tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_html_codegen.\n\n\n---\n\n## While working on `crates/swc_html_minifier`\n\n*Source: `crates/swc_html_minifier/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_html_minifier.\n\n\n---\n\n## While working on `crates/swc_html_parser`\n\n*Source: `crates/swc_html_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/recovery, tests/iframe_srcdoc, tests/html5lib-tests-fixture, tests/html5lib-tests.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_html_parser.\n\n\n---\n\n## While working on `crates/swc_node_bundler`\n\n*Source: `crates/swc_node_bundler/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_node_bundler.\n- Verify without UPDATE before finishing: cargo test -p swc_node_bundler.\n\n\n---\n\n## While working on `crates/swc_plugin_backend_tests`\n\n*Source: `crates/swc_plugin_backend_tests/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_plugin_backend_tests.\n- Verify without UPDATE before finishing: cargo test -p swc_plugin_backend_tests.\n\n\n---\n\n## While working on `crates/swc_ts_fast_strip`\n\n*Source: `crates/swc_ts_fast_strip/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/errors, ../swc_ecma_parser/tests/tsc.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ts_fast_strip.\n- Verify without UPDATE before finishing: cargo test -p swc_ts_fast_strip.\n\n\n---\n\n## While working on `crates/swc_typescript`\n\n*Source: `crates/swc_typescript/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/**/*.ts, tests/**/*.tsx.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_typescript.\n- Verify without UPDATE before finishing: cargo test -p swc_typescript.\n\n\n---\n\n## While working on `crates/swc_xml_codegen`\n\n*Source: `crates/swc_xml_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_xml_parser/tests/fixture, ../swc_xml_parser/tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_xml_codegen.\n\n\n---\n\n## While working on `crates/swc_xml_parser`\n\n*Source: `crates/swc_xml_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_xml_parser.\n\n\n---\n\n## While working on `crates/testing_macros`\n\n*Source: `crates/testing_macros/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/simple, tests/ignore.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p testing_macros.\n- Verify without UPDATE before finishing: cargo test -p testing_macros.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# Instructions\n\n## General rule\n\n-   Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.\n-   Do not search web unless explicitly asked to do so. Web search does not help in general for our project.\n-   Write performant code. Always prefer performance over other things.\n-   Use `gh` CLI tool for fetching data from `github.com`.\n-   Do not let sandbox constraints stall progress. If sandbox restrictions block required work, request escalation promptly and continue.\n\n## Code style\n\n-   Write comments and documentations in English.\n-   Write documentation for your code.\n-   When introducing a workaround, leave sufficient comments explaining why it is needed and any known limitations.\n-   Commit your work as frequent as possible using git. Do NOT use `--no-verify` flag.\n-   Prefer multiple small files over single large file.\n-   Prefer enum (or dedicated type) based modeling over raw string literals whenever possible.\n\n---\n\n-   When creating Atom instances, it's better to use `Cow<str>` or `&str` instead of `String`. Note that `&str` is better than `Cow<str>` here.\n\n## Debugging and logging\n\n-   Do not guess behavior. Verify assumptions by reading source, fixtures, and tests.\n-   Debug with logs when behavior is unclear.\n-   Write sufficient logs for debugging and operational troubleshooting.\n-   Prefer structured logging in Rust (`tracing`) over ad-hoc plain text logs when feasible.\n\n## Shell safety\n\n-   For shell commands or scripts, prefer `$(...)` over legacy backticks for command substitution.\n-   Quote and escape all dynamic shell values strictly.\n\n## Git workflow\n\n-   Run `git commit` only after `git add`.\n-   Once changes are staged, commit without unnecessary delay so staged history is preserved.\n-   When creating or updating a pull request, follow the repository pull request template.\n-   When creating a pull request, use the `add-changeset` skill to create the required changeset.\n-   After addressing pull request review comments and pushing updates, resolve the corresponding review threads.\n\n## Testing\n\n-   Write unit tests for your code.\n-   Prefer fixture tests over inline (`#[test]`) tests.\n-   Before running tests, run `git submodule update --init --recursive` to initialize and update all submodules.\n-   You can do `UPDATE=1 cargo test` to get test outputs updated for fixture tests.\n-   When instructed to fix tests, do not remove or modify existing tests.\n\n### Fixture Test Common Guide\n\n- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.\n- Find the exact fixture harness before adding files with: `rg -n \"#\\[(testing::)?fixture\\(\" tests src --glob \"*.rs\"`.\n- Keep each suite's naming conventions (for example: input.*, output.*, exec.*, .ans).\n- For snapshot-style tests, update expected outputs with `UPDATE=1 cargo test -p ...` using the exact crate command documented in each crate's AGENTS.md.\n- Always rerun the same crate tests without `UPDATE` before finishing.\n\n## Verification\n\n-   Before finishing a task, always run this baseline locally.\n    -   `cargo fmt --all`\n    -   `cargo clippy --all --all-targets -- -D warnings`\n-   For each touched Rust crate, run crate-level verification locally.\n    -   `cargo test -p <crate>`\n-   If wasm binding packages are touched, run:\n    -   `(cd bindings/binding_core_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_minifier_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_typescript_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)`\n-   If node bindings or integration paths are touched, run:\n    -   `(cd packages/core && pnpm build:dev && pnpm test)`\n\n## Compatibility rule\n\n-   Do not use unstable, nightly only features of rustc.\n-   Respect the project's MSRV. Do not rely on Rust language features or standard library APIs newer than the MSRV unless the change intentionally raises the MSRV.\n","category":"root","tokens":995},{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# AI Agent Rules\n\nWhen working in a specific directory, apply the rules from that directory and all parent directories up to the root.\n\n## While working on `.`\n\n*Source: `AGENTS.md`*\n\n# Instructions\n\n## General rule\n\n-   Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.\n-   Do not search web unless explicitly asked to do so. Web search does not help in general for our project.\n-   Write performant code. Always prefer performance over other things.\n-   Use `gh` CLI tool for fetching data from `github.com`.\n\n## Code style\n\n-   Write comments and documentations in English.\n-   Write documentation for your code.\n-   Commit your work as frequent as possible using git. Do NOT use `--no-verify` flag.\n-   Prefer multiple small files over single large file.\n\n---\n\n-   When creating Atom instances, it's better to use `Cow<str>` or `&str` instead of `String`. Note that `&str` is better than `Cow<str>` here.\n\n## Testing\n\n-   Write unit tests for your code.\n-   Prefer fixture tests over inline (`#[test]`) tests.\n-   You can do `UPDATE=1 cargo test` to get test outputs updated for fixture tests.\n-   When instructed to fix tests, do not remove or modify existing tests.\n\n### Fixture Test Common Guide\n\n- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.\n- Find the exact fixture harness before adding files with: `rg -n \"#\\[(testing::)?fixture\\(\" tests src --glob \"*.rs\"`.\n- Keep each suite's naming conventions (for example: input.*, output.*, exec.*, .ans).\n- For snapshot-style tests, update expected outputs with `UPDATE=1 cargo test -p ...` using the exact crate command documented in each crate's AGENTS.md.\n- Always rerun the same crate tests without `UPDATE` before finishing.\n\n## Verification\n\n-   Before finishing a task, always run this baseline locally.\n    -   `cargo fmt --all`\n    -   `cargo clippy --all --all-targets -- -D warnings`\n-   For each touched Rust crate, run crate-level verification locally.\n    -   `cargo test -p <crate>`\n-   If wasm binding packages are touched, run:\n    -   `(cd bindings/binding_core_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_minifier_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_typescript_wasm && ./scripts/test.sh)`\n    -   `(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)`\n-   If node bindings or integration paths are touched, run:\n    -   `(cd packages/core && pnpm build:dev && pnpm test)`\n\n## Compatibility rule\n\n-   Do not use unstable, nightly only features of rustc.\n\n\n---\n\n## While working on `crates/jsdoc`\n\n*Source: `crates/jsdoc/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p jsdoc.\n- Verify without UPDATE before finishing: cargo test -p jsdoc.\n\n\n---\n\n## While working on `crates/swc`\n\n*Source: `crates/swc/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/errors, tests/exec, tests/minify, tests/typescript, tests/vercel, tests/stacktrace, tests/babel-exec.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc.\n- Verify without UPDATE before finishing: cargo test -p swc.\n\n\n---\n\n## While working on `crates/swc_bundler`\n\n*Source: `crates/swc_bundler/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/deno-exec.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_bundler.\n- Verify without UPDATE before finishing: cargo test -p swc_bundler.\n\n\n---\n\n## While working on `crates/swc_core`\n\n*Source: `crates/swc_core/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_core.\n- Verify without UPDATE before finishing: cargo test -p swc_core.\n\n\n---\n\n## While working on `crates/swc_css_codegen`\n\n*Source: `crates/swc_css_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_css_parser/tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_css_codegen.\n\n\n---\n\n## While working on `crates/swc_css_compat`\n\n*Source: `crates/swc_css_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/nesting, tests/custom-media-query, tests/media-query-ranges, tests/color-hex-alpha, tests/color-legacy, tests/selector-not, tests/color-hwb, tests/all.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_css_compat.\n\n\n---\n\n## While working on `crates/swc_css_lints`\n\n*Source: `crates/swc_css_lints/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/rules/pass, tests/rules/fail.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_lints.\n- Verify without UPDATE before finishing: cargo test -p swc_css_lints.\n\n\n---\n\n## While working on `crates/swc_css_minifier`\n\n*Source: `crates/swc_css_minifier/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_css_minifier.\n\n\n---\n\n## While working on `crates/swc_css_modules`\n\n*Source: `crates/swc_css_modules/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/with-compat.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_modules.\n- Verify without UPDATE before finishing: cargo test -p swc_css_modules.\n\n\n---\n\n## While working on `crates/swc_css_parser`\n\n*Source: `crates/swc_css_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/line-comment, tests/recovery, tests/recovery-cssmodules.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_css_parser.\n\n\n---\n\n## While working on `crates/swc_css_prefixer`\n\n*Source: `crates/swc_css_prefixer/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_prefixer.\n- Verify without UPDATE before finishing: cargo test -p swc_css_prefixer.\n\n\n---\n\n## While working on `crates/swc_ecma_codegen`\n\n*Source: `crates/swc_ecma_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/str-lits, ../swc_ecma_parser/tests/test262-parser/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_codegen.\n\n\n---\n\n## While working on `crates/swc_ecma_lints`\n\n*Source: `crates/swc_ecma_lints/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_lints.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_lints.\n\n\n---\n\n## While working on `crates/swc_ecma_minifier`\n\n*Source: `crates/swc_ecma_minifier/AGENTS.md`*\n\n### Instructions\n\n- You can run execution tests by doing ./scripts/exec.sh to see if your changes are working.\n- If an execution test fails, you are wrong.\n- Always run execution tests after making changes.\n- You can run fixture tests by doing ./scripts/test.sh, and you can do UPDATE=1 ./scripts/test.sh to update fixtures.\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/terser, tests/mangle, tests/pass-1, tests/pass-default, tests/full, tests/projects, benches/full.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_minifier.\n\n\n---\n\n## While working on `crates/swc_ecma_parser`\n\n*Source: `crates/swc_ecma_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/js, tests/jsx, tests/typescript, tests/typescript-errors, tests/errors, tests/comments, tests/span, tests/shifted.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_parser.\n\n\n---\n\n## While working on `crates/swc_ecma_preset_env`\n\n*Source: `crates/swc_ecma_preset_env/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_preset_env.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_preset_env.\n\n\n---\n\n## While working on `crates/swc_ecma_transformer`\n\n*Source: `crates/swc_ecma_transformer/AGENTS.md`*\n\n### Instructions\n\n-   The Transformer must implement `VisitMut` and execute the `VisitMutHooks` of its subtypes.\n-   Other types like ES20xx or transforms for specific syntax MUST NOT implement `VisitMut`.\n-   Subtypes must implement `VisitMutHook<TraverseCtx>`.\n-   Before starting work, read `$repositoryRoot/crates/swc_ecma_hooks/src/`.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms`\n\n*Source: `crates/swc_ecma_transforms/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_base`\n\n*Source: `crates/swc_ecma_transforms_base/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/resolver, tests/ts-resolver, ../swc_ecma_parser/tests.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_base.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_base.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_compat`\n\n*Source: `crates/swc_ecma_transforms_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/arrow, tests/async-to-generator, tests/block-scoping, tests/class-properties, tests/class_fields_use_set, tests/classes, tests/destructuring, tests/for-of, tests/new-target, tests/object-rest-spread, tests/optional-chaining, tests/optional-chaining-loose, tests/parameters, tests/private-in-object, tests/shorthand_properties, tests/static-blocks.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_compat.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_module`\n\n*Source: `crates/swc_ecma_transforms_module/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/paths.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_module.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_module.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_optimization`\n\n*Source: `crates/swc_ecma_transforms_optimization/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/const-modules, tests/dce, tests/dce-jsx, tests/expr-simplifier.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_optimization.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_optimization.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_proposal`\n\n*Source: `crates/swc_ecma_transforms_proposal/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/decorators, tests/explicit-resource-management.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_proposal.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_proposal.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_react`\n\n*Source: `crates/swc_ecma_transforms_react/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/jsx/fixture, tests/integration/fixture, tests/script/jsx/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_react.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_react.\n\n\n---\n\n## While working on `crates/swc_ecma_transforms_typescript`\n\n*Source: `crates/swc_ecma_transforms_typescript/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc, ../swc_ecma_parser/tests/typescript.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_typescript.\n- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_typescript.\n\n\n---\n\n## While working on `crates/swc_error_reporters`\n\n*Source: `crates/swc_error_reporters/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_error_reporters.\n- Verify without UPDATE before finishing: cargo test -p swc_error_reporters.\n\n\n---\n\n## While working on `crates/swc_estree_compat`\n\n*Source: `crates/swc_estree_compat/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixtures, tests/flavor/acorn/fixtures.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_estree_compat.\n- Verify without UPDATE before finishing: cargo test -p swc_estree_compat.\n\n\n---\n\n## While working on `crates/swc_html_codegen`\n\n*Source: `crates/swc_html_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/options, ../swc_html_parser/tests/fixture.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_html_codegen.\n\n\n---\n\n## While working on `crates/swc_html_minifier`\n\n*Source: `crates/swc_html_minifier/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_minifier.\n- Verify without UPDATE before finishing: cargo test -p swc_html_minifier.\n\n\n---\n\n## While working on `crates/swc_html_parser`\n\n*Source: `crates/swc_html_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/recovery, tests/iframe_srcdoc, tests/html5lib-tests-fixture, tests/html5lib-tests.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_html_parser.\n\n\n---\n\n## While working on `crates/swc_node_bundler`\n\n*Source: `crates/swc_node_bundler/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/pass.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_node_bundler.\n- Verify without UPDATE before finishing: cargo test -p swc_node_bundler.\n\n\n---\n\n## While working on `crates/swc_plugin_backend_tests`\n\n*Source: `crates/swc_plugin_backend_tests/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_plugin_backend_tests.\n- Verify without UPDATE before finishing: cargo test -p swc_plugin_backend_tests.\n\n\n---\n\n## While working on `crates/swc_ts_fast_strip`\n\n*Source: `crates/swc_ts_fast_strip/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/errors, ../swc_ecma_parser/tests/tsc.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ts_fast_strip.\n- Verify without UPDATE before finishing: cargo test -p swc_ts_fast_strip.\n\n\n---\n\n## While working on `crates/swc_typescript`\n\n*Source: `crates/swc_typescript/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/**/*.ts, tests/**/*.tsx.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_typescript.\n- Verify without UPDATE before finishing: cargo test -p swc_typescript.\n\n\n---\n\n## While working on `crates/swc_xml_codegen`\n\n*Source: `crates/swc_xml_codegen/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_xml_parser/tests/fixture, ../swc_xml_parser/tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_codegen.\n- Verify without UPDATE before finishing: cargo test -p swc_xml_codegen.\n\n\n---\n\n## While working on `crates/swc_xml_parser`\n\n*Source: `crates/swc_xml_parser/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/fixture, tests/recovery.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_parser.\n- Verify without UPDATE before finishing: cargo test -p swc_xml_parser.\n\n\n---\n\n## While working on `crates/testing_macros`\n\n*Source: `crates/testing_macros/AGENTS.md`*\n\n### Fixture Test Addition Guide\n\n- Preferred fixture roots in this crate: tests/simple, tests/ignore.\n- Update generated fixture outputs with: UPDATE=1 cargo test -p testing_macros.\n- Verify without UPDATE before finishing: cargo test -p testing_macros.\n","category":"root","tokens":4431}]}