Skip to content

Commit 27f094d

Browse files
authored
chore: Improve AI prompt (#10189)
**Description:** Applies https://kdy1.dev/2025-3-12-prompt-context
1 parent 44e7c39 commit 27f094d

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.AI.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
1. Write performant code. Always prefer performance over other things.
2+
2. Write comments in English.
3+
3. Do not use unstable, nightly only features.
4+
4. 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.
5+
5. Write unit tests for your code.
6+
6. When instructed to fix tests, do not remove or modify existing tests.
7+
7. Write documentation for your code. The documentation should be written in English.
8+
8. If you are not sure about something, ask me.

.cursorrules

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
1. You should write performant code. Always prefer performance over other things.
2-
2. Always write comments in English.
3-
3. Do not use unstable, nightly only features.
4-
4. 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.
1+
- First, look for glob `**/.AI.md`. Use terminal command `find . -name '.AI.md'` from the project root, if required.
2+
- Second, if you are going to read and/or write any file in a directory containing `.AI.md` files from the first step, read all of them and respect the instructions in them.
3+
- For example, if you are reading or writing a file at /a/b/c, you should check for `/a/.AI.md`, `/a/b/.AI.md` and `/a/b/c/.AI.md` in the order.

crates/swc_ecma_fast_parser/.AI.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1. Run `cargo test -p swc_ecma_fast_parser` for each change you make.

crates/swc_ecma_minifier/.AI.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1. You can run execution tests by doing `./scripts/exec.sh` to see if your changes are working.
2+
2. If an execution test fails, you are wrong.
3+
3. Always run execution tests after making changes.
4+
4. You can run fixture tests by doing `./scripts/test.sh`, and you can do `UPDATE=1 ./scripts/test.sh` to update fixtures.

0 commit comments

Comments
 (0)