|
2 | 2 |
|
3 | 3 | ## General |
4 | 4 |
|
5 | | -- Prefer simple solutions |
6 | | -- Prefer self-explanatory code |
7 | | -- Prefer short-lived variables |
8 | | -- Prefer short functions |
9 | | - |
10 | | -## Your Ability |
11 | | - |
12 | | -- You have the right to do these without the pilot's approval: |
13 | | - - Inspect code, history, and file tree. this includes: |
14 | | - - `package-lock.json`, `pnpm-lock.json`, or `bun.lock` for which package manager to use |
15 | | - - `package.json` for scripts. |
16 | | - - git history for commit message convention. |
17 | | - - Create decisions based on the code. |
18 | | - - Suggest changes to the code. |
19 | | - - Make up your own mind. |
20 | | - - Guess the pilot's next move: create new function, variable, etc. |
| 5 | +## Coding Style |
| 6 | + |
| 7 | +- Prefer simple solutions. |
| 8 | +- Prefer self-explanatory code. |
| 9 | +- Prefer short and self-explanatory variable names. |
| 10 | +- Make wrong code look wrong. you may add prefixes or suffixes to variables if that makes wrong things more clear. (e.g. `distance_km` `kg_weight`) |
| 11 | +- Prefer short-lived variables. |
| 12 | +- Prefer short functions. |
| 13 | +- TypeScript: Always add extensions to imports: `import "./foo.ts"`, not `import "./foo"`. |
| 14 | + |
| 15 | +### Codebase structure |
| 16 | + |
| 17 | +- Large file is bad file. Split logic into multiple files as soon as possible. |
| 18 | +- Prefer flat directory structure until it's no longer managable (~15 files). |
21 | 19 |
|
22 | 20 | ## Documentation |
23 | 21 |
|
24 | | -- Don't overuse comments |
25 | | -- Use comments to explain the intent, not the implementation |
26 | | -- Comment only the documentation |
27 | | -- Use types for type-checkable documentation |
28 | | -- Use docstrings for documentation for human readers |
| 22 | +- Don't overuse comments. |
| 23 | +- Use comments to explain the intent, not the implementation. |
| 24 | +- Comment only the documentation. |
| 25 | +- Use types for type-checkable documentation. |
29 | 26 |
|
30 | 27 | ## Cascade Session |
31 | 28 |
|
32 | | -- Avoid running commands unless absoutely necessary. |
33 | | - reason: |
34 | | - - windsurf can't terminate it properly |
35 | | - - it lags the computer |
36 | | - if it's absolutely necessary, make sure |
37 | | - - you give it a timeout |
38 | | - - if I terminate it, it's because it has stopped and you don't respond. |
39 | 29 | - If I don't explicitly review your changes, it means the diff was good. |
40 | 30 |
|
41 | 31 | ## Commit Message |
42 | 32 |
|
43 | | -- Prefix commit message, e.g. `fix:`, `feat:`, `chore:`, `breaking:` |
44 | | -- Commit message should describe what has become possible after the commit, rather than describint what has changed in detail |
45 | | -- Commit message should only contain one line. Avoid commit "body". |
| 33 | +- Prefix commit message, e.g. `fix:`, `feat:`, `chore:`, `breaking:`. |
| 34 | +- Commit message should describe what has become possible after the commit, rather than describint what has changed in detail. |
| 35 | +- Commit message should only contain one line. Avoid commit body. |
| 36 | + |
0 commit comments