Skip to content

Add an optional prompt file CLAUDE.md#706

Merged
yungyuc merged 3 commits into
solvcon:masterfrom
yungyuc:devtool/claude-prompt
Apr 4, 2026
Merged

Add an optional prompt file CLAUDE.md#706
yungyuc merged 3 commits into
solvcon:masterfrom
yungyuc:devtool/claude-prompt

Conversation

@yungyuc
Copy link
Copy Markdown
Member

@yungyuc yungyuc commented Mar 30, 2026

The prompt file is added under contrib/prompt/ to help align among contributors who use claude code for coding assist.

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.

To use the prompt file, contributors may create a symbolic link to contrib/prompt/CLAUDE.md, or copy it.

This PR succeeds PR #639.

@yungyuc yungyuc self-assigned this Mar 30, 2026
@yungyuc yungyuc added the enhancement New feature or request label Mar 30, 2026
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.
@yungyuc yungyuc force-pushed the devtool/claude-prompt branch from f92cbfa to cdc86f6 Compare March 30, 2026 15:05
Comment thread contrib/prompt/CLAUDE.md
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took the contents of CLAUDE.md from #639 (comment) (@tigercosmos 's contribution) and revised.

The file is placed under contrib/prompt/.

Comment thread .gitignore
@@ -1,9 +1,11 @@
/CLAUDE.md
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore CLAUDE.md in the project root. It is not put in version control and everyone can use their own prompt file.

Comment thread .gitignore
__pycache__/
build/
dist/
profiling/results/
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Piggypack a missing ignore entry.

@yungyuc yungyuc marked this pull request as ready for review March 30, 2026 15:08
@yungyuc yungyuc added documentation Improvements or additions to documentation and removed enhancement New feature or request labels Mar 30, 2026
@tigercosmos
Copy link
Copy Markdown
Collaborator

tigercosmos commented Apr 1, 2026

I have an opposite opinion. We should put CLAUDE.md at the root. We force everyone follow the same AI instruction to make the output close to the project style and standard.

@yungyuc
Copy link
Copy Markdown
Member Author

yungyuc commented Apr 1, 2026

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.

Comment thread contrib/prompt/CLAUDE.md
Comment on lines +175 to +212
## 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:
```
Copy link
Copy Markdown
Collaborator

@ThreeMonth03 ThreeMonth03 Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could add the description about the existence of STYLE.rst. The explanation of this file is more complete.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I added in the beginning of this section.

Copy link
Copy Markdown
Member Author

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a paragraph to point to STYLE.rst. Thank you for the good reminder, @ThreeMonth03 .

Comment thread contrib/prompt/CLAUDE.md
Comment on lines +175 to +212
## 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:
```
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I added in the beginning of this section.

Comment thread contrib/prompt/CLAUDE.md

## Code Style

For complete description of the code style, use the file `STYLE.rst`. Important
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention STYLE.rst here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread contrib/prompt/CLAUDE.md
Comment on lines +263 to +267
### 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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely.

Copy link
Copy Markdown
Member Author

@yungyuc yungyuc Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

@yungyuc yungyuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a passage to ask to use devenv and all installation requires consent.

Thank you, @ThreeMonth03 .

Comment thread contrib/prompt/CLAUDE.md
Comment on lines +263 to +267
### 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.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely.

Comment thread contrib/prompt/CLAUDE.md
**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
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a passage to ask to use devenv and all installation requires consent.

Copy link
Copy Markdown
Collaborator

@tigercosmos tigercosmos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yungyuc yungyuc merged commit d920511 into solvcon:master Apr 4, 2026
14 checks passed
@yungyuc yungyuc deleted the devtool/claude-prompt branch April 4, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants