-
Notifications
You must be signed in to change notification settings - Fork 0
docs: add AI assistant configuration guidelines #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||
| # Copilot Instructions | ||||||
|
|
||||||
| This is a modern C++ project template using CMake >= 3.20 and C++17. | ||||||
|
|
||||||
| ## Code Style | ||||||
|
|
||||||
| - Follow Google C++ style with 4-space indentation and 100-character column limit | ||||||
| - Variables, locals, and members use `lower_case` naming | ||||||
| - Classes and structs use `CamelCase` naming | ||||||
| - Pointer alignment is left: `int* ptr` not `int *ptr` | ||||||
| - Brace style: K&R (attach opening brace to statement) | ||||||
| - Include sorting: main header first, then system headers, then project headers, separated by blank lines | ||||||
|
|
||||||
| ## Project Architecture | ||||||
|
|
||||||
| - Each build target has its own subdirectory under `src/` with its own `CMakeLists.txt` | ||||||
| - Tests go in `tests/test_<target_name>.cpp` using GoogleTest (GTest) | ||||||
| - Use `target_include_directories` and `target_link_libraries` with correct CMake visibility keywords (PUBLIC, PRIVATE, INTERFACE) | ||||||
| - Shared libraries use RPATH (`$ORIGIN/../lib`) for portable deployment | ||||||
| - Plugins use a C-compatible API with `extern "C"` exported factory functions | ||||||
|
|
||||||
| ## Build & Test | ||||||
|
|
||||||
| - Build: `./scripts/build.sh` or `mkdir -p build && cd build && cmake .. && make` | ||||||
|
||||||
| - Build: `./scripts/build.sh` or `mkdir -p build && cd build && cmake .. && make` | |
| - Build: `./scripts/build.sh` |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,114 @@ | ||||||
| # AI Assistant Configuration Guide | ||||||
|
|
||||||
| This project includes configuration for **Claude Code** and **GitHub Copilot** | ||||||
| so AI tools generate code that matches the project's conventions out of the box. | ||||||
|
|
||||||
| Think of these files as onboarding documentation for AI pair programmers. | ||||||
|
|
||||||
| ## What's Configured | ||||||
|
|
||||||
| ### Claude Code | ||||||
|
|
||||||
| | File | Purpose | | ||||||
| |------|---------| | ||||||
| | `CLAUDE.md` | Project context: build commands, structure, conventions, anti-patterns | | ||||||
|
|
||||||
|
Comment on lines
+12
to
+15
|
||||||
| The following are **recommended additions** (not yet in the repo): | ||||||
|
|
||||||
| | File | Purpose | | ||||||
| |------|---------| | ||||||
| | `.claude/settings.json` | Pre-approved commands and auto-format hook | | ||||||
| | `.claude/commands/*.md` | Custom slash commands (e.g., `/project:build`, `/project:test`) | | ||||||
|
|
||||||
|
Comment on lines
+18
to
+22
|
||||||
| ### GitHub Copilot | ||||||
|
|
||||||
| | File | Purpose | | ||||||
| |------|---------| | ||||||
| | `.github/copilot-instructions.md` | Code style, architecture patterns, naming conventions | | ||||||
|
|
||||||
|
Comment on lines
+25
to
+28
|
||||||
| ## Claude Code Features Explained | ||||||
|
|
||||||
| ### CLAUDE.md (repository root) | ||||||
|
|
||||||
| Automatically loaded into every Claude Code conversation. Contains build | ||||||
| commands, project structure, code conventions, and anti-patterns. Claude uses | ||||||
| this to generate code that matches `.clang-format` and `.clang-tidy` rules | ||||||
| without needing to run the formatters. | ||||||
|
|
||||||
| Supports hierarchical placement — a `CLAUDE.md` in a subdirectory adds context | ||||||
| for that subtree (e.g., `tests/CLAUDE.md` could add test-specific instructions). | ||||||
|
|
||||||
| ### .claude/settings.json — Pre-approved Commands | ||||||
|
|
||||||
| Without this file, Claude asks permission every time it runs `cmake`, `ctest`, | ||||||
| or `./scripts/build.sh`. The settings file pre-approves safe commands: | ||||||
|
|
||||||
| ```jsonc | ||||||
| { | ||||||
| "permissions": { | ||||||
| "allow": [ | ||||||
| "Bash(./scripts/build.sh*)", | ||||||
| "Bash(cmake *)", | ||||||
| "Bash(ctest *)" | ||||||
| // ... additional commands | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| This eliminates repetitive permission prompts and makes Claude significantly | ||||||
| faster to work with. Dangerous commands (`rm -rf /`, `sudo`) are explicitly denied. | ||||||
|
|
||||||
| Personal overrides go in `.claude/settings.local.json` (gitignored). | ||||||
|
||||||
| Personal overrides go in `.claude/settings.local.json` (gitignored). | |
| Personal overrides should go in `.claude/settings.local.json`; add this path to your `.gitignore` so local settings aren't committed. |
Copilot
AI
Mar 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc mixes two different slash-command names: it says commands are /build//test//check//add-library above, but later describes them as /project:build, /project:test, etc. Please make these consistent so users know the exact invocation syntax.
Copilot
AI
Mar 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commands table uses || row prefixes, which will render with an unintended blank first column. Convert this to standard Markdown table syntax (| Command | What it does |, etc.) so the command list displays properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line describes plugins as exporting "factory functions", but the documented/implemented entrypoint is a single
register_plugin()symbol (void, no factory/instance semantics). Consider rewording to "exported entrypoint" (or similar) to match the actual plugin ABI and avoid confusion.