Skip to content

Commit e900d2e

Browse files
chore: willboosterify this repo
1 parent 54354c5 commit e900d2e

File tree

12 files changed

+378
-358
lines changed

12 files changed

+378
-358
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

.lintstagedrc.cjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
const fs = require('node:fs');
2-
const path = require('node:path');
3-
1+
const fs = require('fs');
2+
const path = require('path');
43
const micromatch = require('micromatch');
54

65
module.exports = {
@@ -25,7 +24,7 @@ module.exports = {
2524
},
2625
'./**/migration.sql': (files) => {
2726
for (const file of files) {
28-
const content = fs.readFileSync(file, 'utf8');
27+
const content = fs.readFileSync(file, 'utf-8');
2928
if (content.includes('Warnings:')) {
3029
return [
3130
`echo '!!! Migration SQL file (${path.relative('', file)}) contains warnings !!! Solve the warnings and commit again.'`,

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

0 commit comments

Comments
 (0)