Add an optional prompt file CLAUDE.md#706
Conversation
The prompt file is added under `contrib/prompt/`. `CLAUDE.md` in the project root is put in `.gitignore`. It is not checked in version control so everyone can use different contents without conflicting.
f92cbfa to
cdc86f6
Compare
There was a problem hiding this comment.
Took the contents of CLAUDE.md from #639 (comment) (@tigercosmos 's contribution) and revised.
The file is placed under contrib/prompt/.
| @@ -1,9 +1,11 @@ | |||
| /CLAUDE.md | |||
There was a problem hiding this comment.
Ignore CLAUDE.md in the project root. It is not put in version control and everyone can use their own prompt file.
| __pycache__/ | ||
| build/ | ||
| dist/ | ||
| profiling/results/ |
There was a problem hiding this comment.
Piggypack a missing ignore entry.
|
I have an opposite opinion. We should put |
|
I've seen a lot of criss-cross checkins for setting files when they are tracked in version control. A solution is to have a dedicated team to maintain the setting files. But it is not very feasible for an open source project like us. It's easy for contributors to mix changes to the settings and their work. It will be easy for them to include the setting files in unrelated PRs, and an additional burden to reviewers. The use of ignoring and separate directory here remove the issue while still keeping the settings under version control. |
| ## Code Style | ||
|
|
||
| ### C++ Style | ||
| - **Indentation**: 4 spaces (no tabs) | ||
| - **Naming**: | ||
| - Classes: `CamelCase` | ||
| - Functions/variables: `snake_case` | ||
| - Member variables: `m_snake_case` (prefix with `m_`) | ||
| - Constants: `UPPER_CASE` or `snake_case` (for foreign code interop) | ||
| - Type aliases: `snake_case_t` or `snake_case_type` | ||
| - **Format**: Use clang-format (`.clang-format` in repo root) | ||
| - **Line length**: No hard limit, prefer < 120 characters | ||
| - **Includes**: Use angle brackets (`#include <...>`), not quotes | ||
| - **Standard**: C++23 | ||
|
|
||
| ### Python Style | ||
| - **Indentation**: 4 spaces (no tabs) | ||
| - **Naming**: | ||
| - Classes: `CamelCase` | ||
| - Functions/variables: `snake_case` | ||
| - Constants: `UPPER_CASE` | ||
| - **Line length**: 79 characters (PEP-8) | ||
| - **Format**: Use flake8 | ||
|
|
||
| ### File Format | ||
| - **Encoding**: UTF-8 | ||
| - **Line endings**: Unix (`\n`) | ||
| - **Modelines**: Required at end of files | ||
|
|
||
| C++: | ||
| ```cpp | ||
| // vim: set ff=unix fenc=utf8 et sw=4 ts=4 sts=4: | ||
| ``` | ||
|
|
||
| Python: | ||
| ```python | ||
| # vim: set ff=unix fenc=utf8 et sw=4 ts=4 sts=4 tw=79: | ||
| ``` |
There was a problem hiding this comment.
Maybe we could add the description about the existence of STYLE.rst. The explanation of this file is more complete.
There was a problem hiding this comment.
Good point. I added in the beginning of this section.
yungyuc
left a comment
There was a problem hiding this comment.
Add a paragraph to point to STYLE.rst. Thank you for the good reminder, @ThreeMonth03 .
| ## Code Style | ||
|
|
||
| ### C++ Style | ||
| - **Indentation**: 4 spaces (no tabs) | ||
| - **Naming**: | ||
| - Classes: `CamelCase` | ||
| - Functions/variables: `snake_case` | ||
| - Member variables: `m_snake_case` (prefix with `m_`) | ||
| - Constants: `UPPER_CASE` or `snake_case` (for foreign code interop) | ||
| - Type aliases: `snake_case_t` or `snake_case_type` | ||
| - **Format**: Use clang-format (`.clang-format` in repo root) | ||
| - **Line length**: No hard limit, prefer < 120 characters | ||
| - **Includes**: Use angle brackets (`#include <...>`), not quotes | ||
| - **Standard**: C++23 | ||
|
|
||
| ### Python Style | ||
| - **Indentation**: 4 spaces (no tabs) | ||
| - **Naming**: | ||
| - Classes: `CamelCase` | ||
| - Functions/variables: `snake_case` | ||
| - Constants: `UPPER_CASE` | ||
| - **Line length**: 79 characters (PEP-8) | ||
| - **Format**: Use flake8 | ||
|
|
||
| ### File Format | ||
| - **Encoding**: UTF-8 | ||
| - **Line endings**: Unix (`\n`) | ||
| - **Modelines**: Required at end of files | ||
|
|
||
| C++: | ||
| ```cpp | ||
| // vim: set ff=unix fenc=utf8 et sw=4 ts=4 sts=4: | ||
| ``` | ||
|
|
||
| Python: | ||
| ```python | ||
| # vim: set ff=unix fenc=utf8 et sw=4 ts=4 sts=4 tw=79: | ||
| ``` |
There was a problem hiding this comment.
Good point. I added in the beginning of this section.
|
|
||
| ## Code Style | ||
|
|
||
| For complete description of the code style, use the file `STYLE.rst`. Important |
There was a problem hiding this comment.
No need to take actions. Just want to point out that now we can create a "style check" skill, and make such style intruction inside it.
| ### Virtual Environments | ||
|
|
||
| **IMPORTANT**: Using Python virtual environments (venv, conda) is | ||
| **strongly discouraged** for modmesh development. The project is designed to | ||
| work with system Python. Virtual environment bugs are not actively resolved. |
There was a problem hiding this comment.
This prompt may be dangerous to newbie, because it implies AI to install the dependency out of virtual enviroment.
We might tell AI to use devenv according to the note, or AI should get the consent from users before it installs dependency packages.
There was a problem hiding this comment.
We might tell AI to use devenv according to the note
I did not include the external hackmd link, in which we can consider to include some contents may be incorporated in the repository, maybe in the form of CI. But it is uncertain and a lot need to be discussed. So maybe it is not the best time to add the link.
yungyuc
left a comment
There was a problem hiding this comment.
Add a passage to ask to use devenv and all installation requires consent.
Thank you, @ThreeMonth03 .
| ### Virtual Environments | ||
|
|
||
| **IMPORTANT**: Using Python virtual environments (venv, conda) is | ||
| **strongly discouraged** for modmesh development. The project is designed to | ||
| work with system Python. Virtual environment bugs are not actively resolved. |
| **strongly discouraged** for modmesh development. The project is designed to | ||
| work with system Python. Virtual environment bugs are not actively resolved. | ||
|
|
||
| Use https://github.com/solvcon/devenv to build dependency from source and |
There was a problem hiding this comment.
Add a passage to ask to use devenv and all installation requires consent.
The prompt file is added under
contrib/prompt/to help align among contributors who use claude code for coding assist.CLAUDE.mdin the project root is put in.gitignore. It is not checked in version control so everyone can use different contents without conflicting.To use the prompt file, contributors may create a symbolic link to
contrib/prompt/CLAUDE.md, or copy it.This PR succeeds PR #639.