Skip to content

Commit dbcb704

Browse files
chore: willboosterify this repo
1 parent 6e1f809 commit dbcb704

File tree

11 files changed

+431
-312
lines changed

11 files changed

+431
-312
lines changed

.cursor/rules/general.mdc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,26 @@ alwaysApply: true
88

99
- Name: @exercode/problem-utils
1010
- Description: :100: A set of utilities for judging programs on Exercode (https://exercode.willbooster.com/).
11-
- Package Manager: yarn
11+
- Package Manager: yarn on zsh
1212

1313
## General Instructions
1414

15+
- Create a new branch if the current branch is `main`.
1516
- Do not write tests unless explicitly requested.
1617
- When fixing tests, gather debug information through logging and screenshots before modifying the code.
17-
- After making code changes, run `yarn check-all-for-ai` to execute all tests (note: this may take up to 30 minutes), or run `yarn check-for-ai` for type checking and linting only.
18+
- After making code changes, run `yarn check-all-for-ai` to execute all tests (takes up to 1 hour), or run `yarn check-for-ai` for type checking and linting only (takes up to 10 minutes).
1819
- If you are confident your changes will not break any tests, you may use `check-for-ai`.
19-
- Once you have verified your changes, commit them to the non-main branch using the `--no-verify` option and push to the current branch.
20-
- Follow conventional commits, i.e., your commit message should start with `feat:`, `fix:`, etc.
21-
- Make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Cursor) <agent@willbooster.com>`.
20+
- Once you have verified your changes, commit them to a non-main branch using the `--no-verify` option and push to the current branch.
21+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
22+
- If not specified, make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Cursor) <agent@willbooster.com>`.
2223
- Always create new commits. Avoid using `--amend`.
2324

2425
## Coding Style
2526

26-
- Write comments that explain "why" rather than "what". Avoid explanations that can be understood from the code itself.
27-
- Use stderr for logging debug messages temporarily since stdout output is sometimes omitted.
28-
- When adding new functions or classes, define them below any functions or classes that call them to maintain clear call order.
29-
- Prefer `undefined` over `null` unless explicitly dealing with APIs or libraries that require `null`.
30-
- Always perform existence checks on array due to `noUncheckedIndexedAccess: true`.
27+
- Simplify code as much as possible to eliminate redundancy.
28+
- Design each module with high cohesion, grouping related functionality together.
29+
- Refactor existing large modules into smaller, focused modules when necessary.
30+
- Create well-organized directory structures with low coupling and high cohesion.
31+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
32+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
33+
- Prefer `undefined` over `null` unless explicitly required by APIs or libraries.

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-push

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
24

35
run_if_changed() {
@@ -6,7 +8,5 @@ run_if_changed() {
68
fi
79
}
810

9-
run_if_changed "\..+-version" "awk '{print \$1}' .tool-versions | xargs -I{} asdf plugin add {}"
10-
run_if_changed "\..+-version" "asdf plugin update --all"
11-
run_if_changed "\..+-version" "asdf install"
11+
run_if_changed "(mise\.toml|\.mise\.toml|\.tool-versions|\..+-version)" "mise install"
1212
run_if_changed "package\.json" "yarn"

.lefthook/pre-push/check.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yarn run typecheck

AGENTS.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22

33
- Name: @exercode/problem-utils
44
- Description: :100: A set of utilities for judging programs on Exercode (https://exercode.willbooster.com/).
5-
- Package Manager: yarn
5+
- Package Manager: yarn on zsh
66

77
## General Instructions
88

9+
- Create a new branch if the current branch is `main`.
910
- Do not write tests unless explicitly requested.
1011
- When fixing tests, gather debug information through logging and screenshots before modifying the code.
11-
- After making code changes, run `yarn check-all-for-ai` to execute all tests (note: this may take up to 30 minutes), or run `yarn check-for-ai` for type checking and linting only.
12+
- After making code changes, run `yarn check-all-for-ai` to execute all tests (takes up to 1 hour), or run `yarn check-for-ai` for type checking and linting only (takes up to 10 minutes).
1213
- If you are confident your changes will not break any tests, you may use `check-for-ai`.
13-
- Once you have verified your changes, commit them to the non-main branch using the `--no-verify` option and push to the current branch.
14-
- Follow conventional commits, i.e., your commit message should start with `feat:`, `fix:`, etc.
15-
- Make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>`.
14+
- Once you have verified your changes, commit them to a non-main branch using the `--no-verify` option and push to the current branch.
15+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
16+
- If not specified, make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>`.
1617
- Always create new commits. Avoid using `--amend`.
1718

1819
## Coding Style
1920

20-
- Write comments that explain "why" rather than "what". Avoid explanations that can be understood from the code itself.
21-
- Use stderr for logging debug messages temporarily since stdout output is sometimes omitted.
22-
- When adding new functions or classes, define them below any functions or classes that call them to maintain clear call order.
23-
- Prefer `undefined` over `null` unless explicitly dealing with APIs or libraries that require `null`.
24-
- Always perform existence checks on array due to `noUncheckedIndexedAccess: true`.
21+
- Simplify code as much as possible to eliminate redundancy.
22+
- Design each module with high cohesion, grouping related functionality together.
23+
- Refactor existing large modules into smaller, focused modules when necessary.
24+
- Create well-organized directory structures with low coupling and high cohesion.
25+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
26+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
27+
- Prefer `undefined` over `null` unless explicitly required by APIs or libraries.

CLAUDE.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22

33
- Name: @exercode/problem-utils
44
- Description: :100: A set of utilities for judging programs on Exercode (https://exercode.willbooster.com/).
5-
- Package Manager: yarn
5+
- Package Manager: yarn on zsh
66

77
## General Instructions
88

9+
- Create a new branch if the current branch is `main`.
910
- Do not write tests unless explicitly requested.
1011
- When fixing tests, gather debug information through logging and screenshots before modifying the code.
11-
- After making code changes, run `yarn check-all-for-ai` to execute all tests (note: this may take up to 30 minutes), or run `yarn check-for-ai` for type checking and linting only.
12+
- After making code changes, run `yarn check-all-for-ai` to execute all tests (takes up to 1 hour), or run `yarn check-for-ai` for type checking and linting only (takes up to 10 minutes).
1213
- If you are confident your changes will not break any tests, you may use `check-for-ai`.
13-
- Once you have verified your changes, commit them to the non-main branch using the `--no-verify` option and push to the current branch.
14-
- Follow conventional commits, i.e., your commit message should start with `feat:`, `fix:`, etc.
15-
- Make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>`.
14+
- Once you have verified your changes, commit them to a non-main branch using the `--no-verify` option and push to the current branch.
15+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
16+
- If not specified, make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>`.
1617
- Always create new commits. Avoid using `--amend`.
1718

1819
## Coding Style
1920

20-
- Write comments that explain "why" rather than "what". Avoid explanations that can be understood from the code itself.
21-
- Use stderr for logging debug messages temporarily since stdout output is sometimes omitted.
22-
- When adding new functions or classes, define them below any functions or classes that call them to maintain clear call order.
23-
- Prefer `undefined` over `null` unless explicitly dealing with APIs or libraries that require `null`.
24-
- Always perform existence checks on array due to `noUncheckedIndexedAccess: true`.
21+
- Simplify code as much as possible to eliminate redundancy.
22+
- Design each module with high cohesion, grouping related functionality together.
23+
- Refactor existing large modules into smaller, focused modules when necessary.
24+
- Create well-organized directory structures with low coupling and high cohesion.
25+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
26+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
27+
- Prefer `undefined` over `null` unless explicitly required by APIs or libraries.

GEMINI.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22

33
- Name: @exercode/problem-utils
44
- Description: :100: A set of utilities for judging programs on Exercode (https://exercode.willbooster.com/).
5-
- Package Manager: yarn
5+
- Package Manager: yarn on zsh
66

77
## General Instructions
88

9+
- Create a new branch if the current branch is `main`.
910
- Do not write tests unless explicitly requested.
1011
- When fixing tests, gather debug information through logging and screenshots before modifying the code.
11-
- After making code changes, run `yarn check-all-for-ai` to execute all tests (note: this may take up to 30 minutes), or run `yarn check-for-ai` for type checking and linting only.
12+
- After making code changes, run `yarn check-all-for-ai` to execute all tests (takes up to 1 hour), or run `yarn check-for-ai` for type checking and linting only (takes up to 10 minutes).
1213
- If you are confident your changes will not break any tests, you may use `check-for-ai`.
13-
- Once you have verified your changes, commit them to the non-main branch using the `--no-verify` option and push to the current branch.
14-
- Follow conventional commits, i.e., your commit message should start with `feat:`, `fix:`, etc.
15-
- Make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Gemini CLI) <agent@willbooster.com>`.
14+
- Once you have verified your changes, commit them to a non-main branch using the `--no-verify` option and push to the current branch.
15+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
16+
- If not specified, make sure to add a new line at the end of your commit message with: `Co-authored-by: WillBooster (Gemini CLI) <agent@willbooster.com>`.
1617
- Always create new commits. Avoid using `--amend`.
1718

1819
## Coding Style
1920

20-
- Write comments that explain "why" rather than "what". Avoid explanations that can be understood from the code itself.
21-
- Use stderr for logging debug messages temporarily since stdout output is sometimes omitted.
22-
- When adding new functions or classes, define them below any functions or classes that call them to maintain clear call order.
23-
- Prefer `undefined` over `null` unless explicitly dealing with APIs or libraries that require `null`.
24-
- Always perform existence checks on array due to `noUncheckedIndexedAccess: true`.
21+
- Simplify code as much as possible to eliminate redundancy.
22+
- Design each module with high cohesion, grouping related functionality together.
23+
- Refactor existing large modules into smaller, focused modules when necessary.
24+
- Create well-organized directory structures with low coupling and high cohesion.
25+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
26+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
27+
- Prefer `undefined` over `null` unless explicitly required by APIs or libraries.

lefthook.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
post-merge:
2+
scripts:
3+
prepare.sh:
4+
runner: bash
5+
pre-push:
6+
scripts:
7+
check.sh:
8+
runner: bash
9+
pre-commit:
10+
commands:
11+
cleanup:
12+
glob: '*.{cjs,css,cts,htm,html,js,json,json5,jsonc,jsx,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}'
13+
run: yarn run cleanup && git add {staged_files}
14+
check-migrations:
15+
glob: '**/migration.sql'
16+
run: |-
17+
if grep -q 'Warnings:' {staged_files}; then
18+
echo "Migration SQL files ({staged_files}) contain warnings! Please solve the warnings and commit again."
19+
exit 1
20+
fi

package.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,17 @@
3232
"scripts": {
3333
"build": "build-ts lib --input src/index.ts src/presets/*.ts",
3434
"check-all-for-ai": "yarn check-for-ai && yarn test",
35-
"check-for-ai": "yarn install > /dev/null && yarn format > /dev/null 2> /dev/null || true && yarn lint-fix --quiet && yarn typecheck",
35+
"check-for-ai": "yarn install > /dev/null && yarn format > /dev/null 2> /dev/null || true && yarn typecheck && yarn lint-fix --quiet",
3636
"cleanup": "yarn format && yarn lint-fix",
3737
"format": "sort-package-json && yarn prettify",
38-
"postinstall": "husky || true",
3938
"lint": "eslint --color",
4039
"lint-fix": "yarn lint --fix",
41-
"prepack": "pinst --disable",
42-
"postpack": "pinst --enable",
43-
"prepare": "husky || true",
40+
"prepare": "lefthook install || true",
4441
"prettify": "prettier --cache --color --write \"**/{.*/,}*.{cjs,css,cts,htm,html,java,js,json,json5,jsonc,jsx,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}\" \"!**/test{-,/}fixtures/**\" || true",
4542
"start": "build-ts run src/index.ts",
4643
"test": "rm -fr temp && dotenv -c test -- vitest test",
4744
"test/ci-setup": "yarn build && bun install --cwd example",
48-
"typecheck": "tsc --noEmit --Pretty"
45+
"typecheck": "tsc --noEmit"
4946
},
5047
"prettier": "@willbooster/prettier-config",
5148
"dependencies": {
@@ -66,7 +63,7 @@
6663
"build-ts": "17.0.17",
6764
"conventional-changelog-conventionalcommits": "9.1.0",
6865
"dotenv-cli": "11.0.0",
69-
"eslint": "9.39.1",
66+
"eslint": "9.39.2",
7067
"eslint-config-flat-gitignore": "2.1.0",
7168
"eslint-config-prettier": "10.1.8",
7269
"eslint-import-resolver-typescript": "4.4.4",
@@ -76,10 +73,9 @@
7673
"eslint-plugin-unicorn": "62.0.0",
7774
"eslint-plugin-unused-imports": "4.3.0",
7875
"globals": "17.3.0",
79-
"husky": "9.1.7",
76+
"lefthook": "2.1.0",
8077
"lint-staged": "16.2.7",
8178
"micromatch": "4.0.8",
82-
"pinst": "3.0.0",
8379
"prettier": "3.8.1",
8480
"prettier-plugin-java": "2.8.1",
8581
"puppeteer": "24.36.1",

0 commit comments

Comments
 (0)