-
Notifications
You must be signed in to change notification settings - Fork 556
Add AI coding guidelines for GitHub Copilot and Cursor #529
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 all 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,34 @@ | ||
| --- | ||
| description: MANDATORY - Read .github/copilot-instructions.md before ANY coding task in this SQLiteCpp project. | ||
| globs: | ||
| alwaysApply: true | ||
| --- | ||
|
|
||
| # MANDATORY: Read Custom Instructions Before Coding | ||
|
|
||
| **CRITICAL REQUIREMENT**: Before performing ANY coding task (writing code, reviewing code, suggesting changes, answering code questions, or modifying files), you MUST first read the file `.github/copilot-instructions.md` using the Read tool. | ||
|
|
||
| This is NON-NEGOTIABLE. Do not skip this step. Do not assume you know the contents. Always read the file fresh. | ||
|
|
||
| ## Why This Matters | ||
|
|
||
| The `copilot-instructions.md` file contains project-specific coding standards that MUST be followed: | ||
|
|
||
| - **RAII principles** - Acquire in constructors, release in destructors | ||
| - **Exception rules** - NEVER throw in destructors, use `SQLITECPP_ASSERT()` instead | ||
| - **C++ version constraints** - C++11 only in core library | ||
| - **Naming conventions** - `m` prefix for members, `a` prefix for arguments, etc. | ||
| - **Code style** - 4 spaces, Allman braces, 120 char max, `#pragma once` | ||
| - **Documentation** - Doxygen with `@brief`, `@param`, `@return`, `@throw` | ||
| - **Testing requirements** - Tests required for new functionality | ||
| - **Build commands** - CMake and Meson instructions | ||
|
|
||
| ## Required Action | ||
|
|
||
| ``` | ||
| Read the file: .github/copilot-instructions.md | ||
| ``` | ||
|
|
||
| Execute this read operation BEFORE responding to any coding request. This ensures you have the current, complete coding guidelines for this SQLiteCpp project. | ||
|
|
||
| If you cannot read the file for any reason, inform the user immediately. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,231 @@ | ||||||
| # SQLiteCpp LLM Coding Guide | ||||||
|
|
||||||
| ## Non-Negotiables (MUST Follow) | ||||||
| - RAII only. Acquire in constructors, release in destructors. | ||||||
| - NEVER throw in destructors. Use `SQLITECPP_ASSERT()` instead. | ||||||
| - Errors: use `SQLite::Exception` for throwing APIs; `tryExec()`, `tryExecuteStep()`, `tryReset()` return SQLite codes. | ||||||
| - C++11 only in core library. C++14 only in `VariadicBind.h` and `ExecuteMany.h`. | ||||||
|
||||||
| - C++11 only in core library. C++14 only in `VariadicBind.h` and `ExecuteMany.h`. | |
| - C++11 only in core library. C++14 only in `ExecuteMany.h`; `VariadicBind.h` has both C++11 (variadic bind) and C++14 (tuple bind) features. |
Copilot
AI
Jan 24, 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 guideline states "Allman braces" but the actual codebase consistently uses K&R style braces (opening brace on the same line). For example, see src/Database.cpp:72-75, src/Statement.cpp:58-62, src/Column.cpp:32-36, and src/Transaction.cpp:50-63. All of these show opening braces on the same line as the function declaration or control statement, not on a new line. This guideline should be corrected to reflect the actual convention used throughout the codebase.
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 front matter syntax appears to be incorrect. The "globs:" field on line 3 is missing a value. According to Cursor rules file format, this field should either have a list of glob patterns or be omitted entirely if using "alwaysApply: true". Since this rule should apply to all files (as indicated by "alwaysApply: true"), the "globs:" line should either be removed or should have an empty list value like "globs: []".