CLAUDE.md
CLAUDE.mdCLAUDE.mdroot
Quality
82/100
Scores the file, not the repository.Length
2,086 words
84 headings · 0 code blocksRepository
34k
— · pushed 0 days agoLast changed
2 days ago
First indexed 2 days ago.1# AI Agent Rules23When working in a specific directory, apply the rules from that directory and all parent directories up to the root.45## While working on `.`67*Source: `AGENTS.md`*89# Instructions1011## General rule1213- Read the codebase - the codebase is source of truth, and you should prefer reading lots of source code over searching.14- Do not search web unless explicitly asked to do so. Web search does not help in general for our project.15- Write performant code. Always prefer performance over other things.16- Use `gh` CLI tool for fetching data from `github.com`.1718## Code style1920- Write comments and documentations in English.21- Write documentation for your code.22- Commit your work as frequent as possible using git. Do NOT use `--no-verify` flag.23- Prefer multiple small files over single large file.2425---2627- 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.2829## Testing3031- Write unit tests for your code.32- Prefer fixture tests over inline (`#[test]`) tests.33- You can do `UPDATE=1 cargo test` to get test outputs updated for fixture tests.34- When instructed to fix tests, do not remove or modify existing tests.3536### Fixture Test Common Guide3738- Add new coverage by extending existing fixture suites instead of adding ad-hoc inline tests.39- Find the exact fixture harness before adding files with: `rg -n "#\[(testing::)?fixture\(" tests src --glob "*.rs"`.40- Keep each suite's naming conventions (for example: input.*, output.*, exec.*, .ans).41- 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.42- Always rerun the same crate tests without `UPDATE` before finishing.4344## Verification4546- Before finishing a task, always run this baseline locally.47 - `cargo fmt --all`48 - `cargo clippy --all --all-targets -- -D warnings`49- For each touched Rust crate, run crate-level verification locally.50 - `cargo test -p <crate>`51- If wasm binding packages are touched, run:52 - `(cd bindings/binding_core_wasm && ./scripts/test.sh)`53 - `(cd bindings/binding_minifier_wasm && ./scripts/test.sh)`54 - `(cd bindings/binding_typescript_wasm && ./scripts/test.sh)`55 - `(cd bindings/binding_es_ast_viewer && ./scripts/test.sh)`56- If node bindings or integration paths are touched, run:57 - `(cd packages/core && pnpm build:dev && pnpm test)`5859## Compatibility rule6061- Do not use unstable, nightly only features of rustc.626364---6566## While working on `crates/jsdoc`6768*Source: `crates/jsdoc/AGENTS.md`*6970### Fixture Test Addition Guide7172- Preferred fixture roots in this crate: tests/fixtures.73- Update generated fixture outputs with: UPDATE=1 cargo test -p jsdoc.74- Verify without UPDATE before finishing: cargo test -p jsdoc.757677---7879## While working on `crates/swc`8081*Source: `crates/swc/AGENTS.md`*8283### Fixture Test Addition Guide8485- Preferred fixture roots in this crate: tests/fixture, tests/errors, tests/exec, tests/minify, tests/typescript, tests/vercel, tests/stacktrace, tests/babel-exec.86- Update generated fixture outputs with: UPDATE=1 cargo test -p swc.87- Verify without UPDATE before finishing: cargo test -p swc.888990---9192## While working on `crates/swc_bundler`9394*Source: `crates/swc_bundler/AGENTS.md`*9596### Fixture Test Addition Guide9798- Preferred fixture roots in this crate: tests/fixture, tests/deno-exec.99- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_bundler.100- Verify without UPDATE before finishing: cargo test -p swc_bundler.101102103---104105## While working on `crates/swc_core`106107*Source: `crates/swc_core/AGENTS.md`*108109### Fixture Test Addition Guide110111- Preferred fixture roots in this crate: tests/fixture.112- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_core.113- Verify without UPDATE before finishing: cargo test -p swc_core.114115116---117118## While working on `crates/swc_css_codegen`119120*Source: `crates/swc_css_codegen/AGENTS.md`*121122### Fixture Test Addition Guide123124- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_css_parser/tests/fixture.125- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_codegen.126- Verify without UPDATE before finishing: cargo test -p swc_css_codegen.127128129---130131## While working on `crates/swc_css_compat`132133*Source: `crates/swc_css_compat/AGENTS.md`*134135### Fixture Test Addition Guide136137- 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.138- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_compat.139- Verify without UPDATE before finishing: cargo test -p swc_css_compat.140141142---143144## While working on `crates/swc_css_lints`145146*Source: `crates/swc_css_lints/AGENTS.md`*147148### Fixture Test Addition Guide149150- Preferred fixture roots in this crate: tests/rules/pass, tests/rules/fail.151- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_lints.152- Verify without UPDATE before finishing: cargo test -p swc_css_lints.153154155---156157## While working on `crates/swc_css_minifier`158159*Source: `crates/swc_css_minifier/AGENTS.md`*160161### Fixture Test Addition Guide162163- Preferred fixture roots in this crate: tests/fixture.164- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_minifier.165- Verify without UPDATE before finishing: cargo test -p swc_css_minifier.166167168---169170## While working on `crates/swc_css_modules`171172*Source: `crates/swc_css_modules/AGENTS.md`*173174### Fixture Test Addition Guide175176- Preferred fixture roots in this crate: tests/fixture, tests/with-compat.177- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_modules.178- Verify without UPDATE before finishing: cargo test -p swc_css_modules.179180181---182183## While working on `crates/swc_css_parser`184185*Source: `crates/swc_css_parser/AGENTS.md`*186187### Fixture Test Addition Guide188189- Preferred fixture roots in this crate: tests/fixture, tests/line-comment, tests/recovery, tests/recovery-cssmodules.190- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_parser.191- Verify without UPDATE before finishing: cargo test -p swc_css_parser.192193194---195196## While working on `crates/swc_css_prefixer`197198*Source: `crates/swc_css_prefixer/AGENTS.md`*199200### Fixture Test Addition Guide201202- Preferred fixture roots in this crate: tests/fixture.203- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_css_prefixer.204- Verify without UPDATE before finishing: cargo test -p swc_css_prefixer.205206207---208209## While working on `crates/swc_ecma_codegen`210211*Source: `crates/swc_ecma_codegen/AGENTS.md`*212213### Fixture Test Addition Guide214215- Preferred fixture roots in this crate: tests/fixture, tests/str-lits, ../swc_ecma_parser/tests/test262-parser/pass.216- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_codegen.217- Verify without UPDATE before finishing: cargo test -p swc_ecma_codegen.218219220---221222## While working on `crates/swc_ecma_lints`223224*Source: `crates/swc_ecma_lints/AGENTS.md`*225226### Fixture Test Addition Guide227228- Preferred fixture roots in this crate: tests/pass.229- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_lints.230- Verify without UPDATE before finishing: cargo test -p swc_ecma_lints.231232233---234235## While working on `crates/swc_ecma_minifier`236237*Source: `crates/swc_ecma_minifier/AGENTS.md`*238239### Instructions240241- You can run execution tests by doing ./scripts/exec.sh to see if your changes are working.242- If an execution test fails, you are wrong.243- Always run execution tests after making changes.244- You can run fixture tests by doing ./scripts/test.sh, and you can do UPDATE=1 ./scripts/test.sh to update fixtures.245246### Fixture Test Addition Guide247248- Preferred fixture roots in this crate: tests/fixture, tests/terser, tests/mangle, tests/pass-1, tests/pass-default, tests/full, tests/projects, benches/full.249- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_minifier.250- Verify without UPDATE before finishing: cargo test -p swc_ecma_minifier.251252253---254255## While working on `crates/swc_ecma_parser`256257*Source: `crates/swc_ecma_parser/AGENTS.md`*258259### Fixture Test Addition Guide260261- Preferred fixture roots in this crate: tests/js, tests/jsx, tests/typescript, tests/typescript-errors, tests/errors, tests/comments, tests/span, tests/shifted.262- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_parser.263- Verify without UPDATE before finishing: cargo test -p swc_ecma_parser.264265266---267268## While working on `crates/swc_ecma_preset_env`269270*Source: `crates/swc_ecma_preset_env/AGENTS.md`*271272### Fixture Test Addition Guide273274- Preferred fixture roots in this crate: tests/fixtures.275- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_preset_env.276- Verify without UPDATE before finishing: cargo test -p swc_ecma_preset_env.277278279---280281## While working on `crates/swc_ecma_transformer`282283*Source: `crates/swc_ecma_transformer/AGENTS.md`*284285### Instructions286287- The Transformer must implement `VisitMut` and execute the `VisitMutHooks` of its subtypes.288- Other types like ES20xx or transforms for specific syntax MUST NOT implement `VisitMut`.289- Subtypes must implement `VisitMutHook<TraverseCtx>`.290- Before starting work, read `$repositoryRoot/crates/swc_ecma_hooks/src/`.291292293---294295## While working on `crates/swc_ecma_transforms`296297*Source: `crates/swc_ecma_transforms/AGENTS.md`*298299### Fixture Test Addition Guide300301- Preferred fixture roots in this crate: tests/fixture.302- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms.303- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms.304305306---307308## While working on `crates/swc_ecma_transforms_base`309310*Source: `crates/swc_ecma_transforms_base/AGENTS.md`*311312### Fixture Test Addition Guide313314- Preferred fixture roots in this crate: tests/resolver, tests/ts-resolver, ../swc_ecma_parser/tests.315- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_base.316- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_base.317318319---320321## While working on `crates/swc_ecma_transforms_compat`322323*Source: `crates/swc_ecma_transforms_compat/AGENTS.md`*324325### Fixture Test Addition Guide326327- 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.328- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_compat.329- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_compat.330331332---333334## While working on `crates/swc_ecma_transforms_module`335336*Source: `crates/swc_ecma_transforms_module/AGENTS.md`*337338### Fixture Test Addition Guide339340- Preferred fixture roots in this crate: tests/fixture, tests/paths.341- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_module.342- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_module.343344345---346347## While working on `crates/swc_ecma_transforms_optimization`348349*Source: `crates/swc_ecma_transforms_optimization/AGENTS.md`*350351### Fixture Test Addition Guide352353- Preferred fixture roots in this crate: tests/const-modules, tests/dce, tests/dce-jsx, tests/expr-simplifier.354- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_optimization.355- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_optimization.356357358---359360## While working on `crates/swc_ecma_transforms_proposal`361362*Source: `crates/swc_ecma_transforms_proposal/AGENTS.md`*363364### Fixture Test Addition Guide365366- Preferred fixture roots in this crate: tests/decorators, tests/explicit-resource-management.367- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_proposal.368- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_proposal.369370371---372373## While working on `crates/swc_ecma_transforms_react`374375*Source: `crates/swc_ecma_transforms_react/AGENTS.md`*376377### Fixture Test Addition Guide378379- Preferred fixture roots in this crate: tests/jsx/fixture, tests/integration/fixture, tests/script/jsx/fixture.380- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_react.381- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_react.382383384---385386## While working on `crates/swc_ecma_transforms_typescript`387388*Source: `crates/swc_ecma_transforms_typescript/AGENTS.md`*389390### Fixture Test Addition Guide391392- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc, ../swc_ecma_parser/tests/typescript.393- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ecma_transforms_typescript.394- Verify without UPDATE before finishing: cargo test -p swc_ecma_transforms_typescript.395396397---398399## While working on `crates/swc_error_reporters`400401*Source: `crates/swc_error_reporters/AGENTS.md`*402403### Fixture Test Addition Guide404405- Preferred fixture roots in this crate: tests/fixture.406- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_error_reporters.407- Verify without UPDATE before finishing: cargo test -p swc_error_reporters.408409410---411412## While working on `crates/swc_estree_compat`413414*Source: `crates/swc_estree_compat/AGENTS.md`*415416### Fixture Test Addition Guide417418- Preferred fixture roots in this crate: tests/fixtures, tests/flavor/acorn/fixtures.419- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_estree_compat.420- Verify without UPDATE before finishing: cargo test -p swc_estree_compat.421422423---424425## While working on `crates/swc_html_codegen`426427*Source: `crates/swc_html_codegen/AGENTS.md`*428429### Fixture Test Addition Guide430431- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/options, ../swc_html_parser/tests/fixture.432- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_codegen.433- Verify without UPDATE before finishing: cargo test -p swc_html_codegen.434435436---437438## While working on `crates/swc_html_minifier`439440*Source: `crates/swc_html_minifier/AGENTS.md`*441442### Fixture Test Addition Guide443444- Preferred fixture roots in this crate: tests/fixture, tests/document_fragment, tests/recovery.445- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_minifier.446- Verify without UPDATE before finishing: cargo test -p swc_html_minifier.447448449---450451## While working on `crates/swc_html_parser`452453*Source: `crates/swc_html_parser/AGENTS.md`*454455### Fixture Test Addition Guide456457- Preferred fixture roots in this crate: tests/fixture, tests/recovery, tests/iframe_srcdoc, tests/html5lib-tests-fixture, tests/html5lib-tests.458- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_html_parser.459- Verify without UPDATE before finishing: cargo test -p swc_html_parser.460461462---463464## While working on `crates/swc_node_bundler`465466*Source: `crates/swc_node_bundler/AGENTS.md`*467468### Fixture Test Addition Guide469470- Preferred fixture roots in this crate: tests/pass.471- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_node_bundler.472- Verify without UPDATE before finishing: cargo test -p swc_node_bundler.473474475---476477## While working on `crates/swc_plugin_backend_tests`478479*Source: `crates/swc_plugin_backend_tests/AGENTS.md`*480481### Fixture Test Addition Guide482483- Preferred fixture roots in this crate: tests/fixture, ../swc_ecma_parser/tests/tsc.484- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_plugin_backend_tests.485- Verify without UPDATE before finishing: cargo test -p swc_plugin_backend_tests.486487488---489490## While working on `crates/swc_ts_fast_strip`491492*Source: `crates/swc_ts_fast_strip/AGENTS.md`*493494### Fixture Test Addition Guide495496- Preferred fixture roots in this crate: tests/fixture, tests/errors, ../swc_ecma_parser/tests/tsc.497- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_ts_fast_strip.498- Verify without UPDATE before finishing: cargo test -p swc_ts_fast_strip.499500501---502503## While working on `crates/swc_typescript`504505*Source: `crates/swc_typescript/AGENTS.md`*506507### Fixture Test Addition Guide508509- Preferred fixture roots in this crate: tests/**/*.ts, tests/**/*.tsx.510- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_typescript.511- Verify without UPDATE before finishing: cargo test -p swc_typescript.512513514---515516## While working on `crates/swc_xml_codegen`517518*Source: `crates/swc_xml_codegen/AGENTS.md`*519520### Fixture Test Addition Guide521522- Preferred fixture roots in this crate: tests/fixture, tests/options, ../swc_xml_parser/tests/fixture, ../swc_xml_parser/tests/recovery.523- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_codegen.524- Verify without UPDATE before finishing: cargo test -p swc_xml_codegen.525526527---528529## While working on `crates/swc_xml_parser`530531*Source: `crates/swc_xml_parser/AGENTS.md`*532533### Fixture Test Addition Guide534535- Preferred fixture roots in this crate: tests/fixture, tests/recovery.536- Update generated fixture outputs with: UPDATE=1 cargo test -p swc_xml_parser.537- Verify without UPDATE before finishing: cargo test -p swc_xml_parser.538539540---541542## While working on `crates/testing_macros`543544*Source: `crates/testing_macros/AGENTS.md`*545546### Fixture Test Addition Guide547548- Preferred fixture roots in this crate: tests/simple, tests/ignore.549- Update generated fixture outputs with: UPDATE=1 cargo test -p testing_macros.550- Verify without UPDATE before finishing: cargo test -p testing_macros.551
Also in swc-project/swc
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| swc-project/swcAGENTS.md · 34k | AGENTS.md | testlint-formatstyletesting-strategy+2 | 88/100 | 2 days ago | |
| swc-project/swccrates/jsdoc/AGENTS.md · 34k | AGENTS.md | testtesting-strategydocs | 16/100 | 2 days ago | |
| swc-project/swccrates/swc/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 28/100 | 2 days ago | |
| swc-project/swccrates/swc_bundler/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_core/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_css_codegen/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_css_compat/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 28/100 | 2 days ago | |
| swc-project/swccrates/swc_css_lints/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_css_minifier/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_css_modules/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_css_parser/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_css_prefixer/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_ecma_codegen/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_ecma_lints/AGENTS.md · 34k | AGENTS.md | testtesting-strategy | 16/100 | 2 days ago | |
| swc-project/swccrates/swc_ecma_minifier/AGENTS.md · 34k | AGENTS.md | testtesting-strategyagent-behaviour | 51/100 | 2 days ago |
Diff against AGENTS.md Diff against crates/jsdoc/AGENTS.md Diff against crates/swc/AGENTS.md Diff against crates/swc_bundler/AGENTS.md Diff against crates/swc_core/AGENTS.md Diff against crates/swc_css_codegen/AGENTS.md Diff against crates/swc_css_compat/AGENTS.md Diff against crates/swc_css_lints/AGENTS.md Diff against crates/swc_css_minifier/AGENTS.md Diff against crates/swc_css_modules/AGENTS.md Diff against crates/swc_css_parser/AGENTS.md Diff against crates/swc_css_prefixer/AGENTS.md Diff against crates/swc_ecma_codegen/AGENTS.md Diff against crates/swc_ecma_lints/AGENTS.md Diff against crates/swc_ecma_minifier/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| livewire/livewireCLAUDE.md · 24k | CLAUDE.md | setupbuildteststyle+4 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today |
