Skip to content

Commit d94b9fc

Browse files
chore: willboosterify this repo
1 parent 9e41e14 commit d94b9fc

File tree

11 files changed

+509
-393
lines changed

11 files changed

+509
-393
lines changed

.cursor/rules/general.mdc

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,27 @@ 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-
- Do not write tests unless explicitly requested.
15+
- Create a new branch if the current branch is `main`.
16+
- Write tests ONLY if explicitly requested.
17+
- Make sure to continue to modify the tests and code until the tests pass.
1618
- 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.
19+
- 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).
1820
- 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>`.
21+
- Once you have verified your changes, commit and push them to the current (non-main) branch then create a PR via `gh`.
22+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
23+
- 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>`.
2224
- Always create new commits. Avoid using `--amend`.
2325

2426
## Coding Style
2527

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`.
28+
- Simplify code as much as possible to eliminate redundancy.
29+
- Design each module with high cohesion, grouping related functionality together.
30+
- Refactor existing large modules into smaller, focused modules when necessary.
31+
- Create well-organized directory structures with low coupling and high cohesion.
32+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
33+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
34+
- 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: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
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-
- Do not write tests unless explicitly requested.
9+
- Create a new branch if the current branch is `main`.
10+
- Write tests ONLY if explicitly requested.
11+
- Make sure to continue to modify the tests and code until the tests pass.
1012
- 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.
13+
- 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).
1214
- 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>`.
15+
- Once you have verified your changes, commit and push them to the current (non-main) branch then create a PR via `gh`.
16+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
17+
- 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>`.
1618
- Always create new commits. Avoid using `--amend`.
1719

1820
## Coding Style
1921

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`.
22+
- Simplify code as much as possible to eliminate redundancy.
23+
- Design each module with high cohesion, grouping related functionality together.
24+
- Refactor existing large modules into smaller, focused modules when necessary.
25+
- Create well-organized directory structures with low coupling and high cohesion.
26+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
27+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
28+
- Prefer `undefined` over `null` unless explicitly required by APIs or libraries.

CLAUDE.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
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-
- Do not write tests unless explicitly requested.
9+
- Create a new branch if the current branch is `main`.
10+
- Write tests ONLY if explicitly requested.
11+
- Make sure to continue to modify the tests and code until the tests pass.
1012
- 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.
13+
- 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).
1214
- 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>`.
15+
- Once you have verified your changes, commit and push them to the current (non-main) branch then create a PR via `gh`.
16+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
17+
- 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>`.
1618
- Always create new commits. Avoid using `--amend`.
1719

1820
## Coding Style
1921

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`.
22+
- Simplify code as much as possible to eliminate redundancy.
23+
- Design each module with high cohesion, grouping related functionality together.
24+
- Refactor existing large modules into smaller, focused modules when necessary.
25+
- Create well-organized directory structures with low coupling and high cohesion.
26+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
27+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
28+
- Prefer `undefined` over `null` unless explicitly required by APIs or libraries.

GEMINI.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
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-
- Do not write tests unless explicitly requested.
9+
- Create a new branch if the current branch is `main`.
10+
- Write tests ONLY if explicitly requested.
11+
- Make sure to continue to modify the tests and code until the tests pass.
1012
- 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.
13+
- 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).
1214
- 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>`.
15+
- Once you have verified your changes, commit and push them to the current (non-main) branch then create a PR via `gh`.
16+
- Follow conventional commits; your commit message should start with `feat:`, `fix:`, etc.
17+
- 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>`.
1618
- Always create new commits. Avoid using `--amend`.
1719

1820
## Coding Style
1921

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`.
22+
- Simplify code as much as possible to eliminate redundancy.
23+
- Design each module with high cohesion, grouping related functionality together.
24+
- Refactor existing large modules into smaller, focused modules when necessary.
25+
- Create well-organized directory structures with low coupling and high cohesion.
26+
- When adding new functions or classes, define them below any functions or classes that call them to maintain a clear top-down call order.
27+
- Write comments that explain "why" rather than "what". Avoid stating what can be understood from the code itself.
28+
- 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: '*.{astro,cjs,css,cts,gql,htm,html,java,js,json,json5,jsonc,jsx,md,mjs,mts,scss,svelte,ts,tsx,vue,yaml,yml}'
13+
run: yarn run format && yarn run lint-fix && 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: 8 additions & 12 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,27 +63,26 @@
6663
"build-ts": "17.0.21",
6764
"conventional-changelog-conventionalcommits": "9.3.0",
6865
"dotenv-cli": "11.0.0",
69-
"eslint": "9.39.1",
66+
"eslint": "^9",
7067
"eslint-config-flat-gitignore": "2.2.1",
7168
"eslint-config-prettier": "10.1.8",
7269
"eslint-import-resolver-typescript": "4.4.4",
73-
"eslint-plugin-import-x": "4.16.1",
70+
"eslint-plugin-import-x": "4.16.2",
7471
"eslint-plugin-sort-class-members": "1.21.0",
7572
"eslint-plugin-sort-destructure-keys": "3.0.0",
7673
"eslint-plugin-unicorn": "63.0.0",
7774
"eslint-plugin-unused-imports": "4.4.1",
7875
"globals": "17.4.0",
79-
"husky": "9.1.7",
80-
"lint-staged": "16.3.2",
76+
"lefthook": "2.1.4",
77+
"lint-staged": "16.3.3",
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.38.0",
8682
"semantic-release": "25.0.3",
8783
"sort-package-json": "3.6.1",
8884
"typescript": "5.9.3",
89-
"typescript-eslint": "8.56.1",
85+
"typescript-eslint": "8.57.0",
9086
"vitest": "4.0.18"
9187
},
9288
"packageManager": "yarn@4.12.0",

0 commit comments

Comments
 (0)