Add AI coding guidelines for GitHub Copilot and Cursor#529
Conversation
SRombauts
commented
Jan 24, 2026
- Add .github/copilot-instructions.md with project-specific coding guidelines for AI assistants (GitHub Copilot, Cursor, etc.)
- Add Cursor rule (.cursor/rules/load-github-copilot-instructions.mdc) to ensure the guidelines are loaded before any coding task
- Update .editorconfig charset to latin1 for compatibility with existing source files
Add comprehensive documentation for AI coding assistants covering project overview, architecture, coding conventions, build systems, testing patterns, and Git workflow.
There was a problem hiding this comment.
Pull request overview
This pull request adds AI coding guidelines documentation to help GitHub Copilot, Cursor, and similar AI assistants follow project-specific conventions. The PR creates a comprehensive coding guide in .github/copilot-instructions.md with non-negotiables, workflows, build instructions, naming conventions, and code examples. It also adds a Cursor rule to ensure the guidelines are loaded before any coding task, and changes the .editorconfig charset setting from utf-8 to latin1.
Changes:
- Added comprehensive AI coding guidelines document with RAII principles, exception handling rules, C++ version constraints, naming conventions, build commands, and code examples
- Added Cursor rule to automatically load the guidelines before any coding task
- Changed
.editorconfigcharset from utf-8 to latin1
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/copilot-instructions.md | New comprehensive coding guidelines for AI assistants covering non-negotiables, workflows, build instructions, naming conventions, file templates, and API examples |
| .cursor/rules/load-github-copilot-instructions.mdc | New Cursor rule configuration to ensure copilot-instructions.md is read before any coding task |
| .editorconfig | Changed charset from utf-8 to latin1 for compatibility with source files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Public API must have Doxygen: `@brief`, `@param`, `@return`, `@throw`. | ||
| - Tests required for new functionality in `tests/`. | ||
| - Portability: Windows, Linux, macOS. | ||
| - Style: ASCII only, 4 spaces, Allman braces, max 120 chars, LF line endings, final newline, `#pragma once`. |
There was a problem hiding this comment.
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.
.editorconfig
Outdated
| # 4 space indentation | ||
| [*] | ||
| charset = latin1 |
There was a problem hiding this comment.
Changing charset from utf-8 to latin1 is problematic and conflicts with both the guideline in copilot-instructions.md (which states "ASCII only") and the actual codebase. The README.md file contains UTF-8 characters (e.g., "Sébastien" on line 25), and source files contain standard ASCII-compatible UTF-8. The guideline should either be "utf-8" (which is the modern standard and what was previously configured) or if truly ASCII-only is desired, the existing non-ASCII characters in the codebase should be addressed first. Latin1 is a legacy encoding that doesn't match modern development practices or the stated "ASCII only" goal.
| charset = latin1 | |
| charset = utf-8 |
| @@ -0,0 +1,34 @@ | |||
| --- | |||
| description: MANDATORY - Read .github/copilot-instructions.md before ANY coding task in this SQLiteCpp project. | |||
| globs: | |||
There was a problem hiding this comment.
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: []".
| globs: | |
| globs: [] |
| - 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`. |
There was a problem hiding this comment.
The guideline states "C++14 only in VariadicBind.h" but this is misleading. VariadicBind.h contains both C++11 code (the basic variadic bind function, see lines 47-54 in include/SQLiteCpp/VariadicBind.h) and C++14 code (the tuple-based functions, see lines 56-96). Only the tuple-based functionality requires C++14. Consider clarifying this as "C++14 only in ExecuteMany.h; VariadicBind.h has both C++11 (variadic bind) and C++14 (tuple bind) features" or similar.
| - 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. |
Ensures Cursor AI reads the coding guidelines file before any coding task, since the @files directive doesn't reliably inject file content.
85eb2b0 to
a9d117e
Compare