Skip to content

Commit 535d82b

Browse files
committed
Replace .cusor/rules/sqlitecpp-skills-routing.mdc by AGENTS.md
It's much more generic and should be loaded by most AI agents out there, but not by Github Copilot extensions in VS and Rider Mention AGENTS.md and skills in the README.md
1 parent 2897a89 commit 535d82b

File tree

3 files changed

+107
-38
lines changed

3 files changed

+107
-38
lines changed

.cursor/rules/sqlitecpp-skills-routing.mdc

Lines changed: 0 additions & 23 deletions
This file was deleted.

AGENTS.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# SQLiteCpp AI Agents Custom Instructions
2+
3+
## Project Overview
4+
- SQLiteCpp is a C++11 RAII wrapper around SQLite3 C APIs
5+
- Minimal dependencies: C++11 STL + SQLite3
6+
- Cross-platform: Windows, Linux, macOS
7+
- Thread-safe at SQLite multi-thread level
8+
9+
## Maintaining This Documentation
10+
11+
**IMPORTANT:** When the user explains how to do something, corrects your behavior, or points out errors:
12+
1. **Update AGENTS.md** if the information is a universal constraint or best practice for SQLiteCpp, a correction to existing guidance in this file
13+
2. **Update skills** if the information is Task-specific guidance (build, testing, documentation, etc.) a correction to existing skill content or a new process
14+
**Goal:** Keep this documentation accurate and comprehensive so future sessions benefit from corrections and clarifications.
15+
16+
## Core Non-Negotiables (MUST Follow)
17+
18+
1. **RAII only**: Acquire resources in constructors, release in destructors
19+
2. **Never throw in destructors**: Use `SQLITECPP_ASSERT()` instead
20+
3. **C++11 core library**: C++14 only in VariadicBind.h and ExecuteMany.h
21+
4. **Public API isolation**: Headers must NOT include sqlite3.h
22+
5. **Export macros**: Public API must use `SQLITECPP_API` from SQLiteCppExport.h
23+
6. **Threading constraint**: One Database/Statement/Column per thread
24+
7. **Tests required**: New functionality must have tests in tests/
25+
8. **Portability**: Code must work on Windows, Linux, and macOS
26+
9. **Const correctness**: Use `const` for methods that don't modify object state, `const&` for read-only parameters
27+
28+
## Error Handling
29+
- Throw `SQLite::Exception` for errors in throwing APIs
30+
- Use `tryExec()`, `tryExecuteStep()`, `tryReset()` for error codes
31+
- In destructors: use `SQLITECPP_ASSERT()` never throw
32+
33+
## Code Style
34+
- 4 spaces (no tabs)
35+
- Allman braces style
36+
- LF line endings (Unix style)
37+
- Final newline at end of file
38+
- `#pragma once` in headers
39+
40+
## Naming Conventions
41+
42+
| Element | Convention | Example |
43+
|---------|------------|---------|
44+
| Types | PascalCase | `Database`, `Statement`, `TransactionBehavior` |
45+
| Functions/vars | camelCase | `executeStep()`, `getColumn()`, `getErrorCode()` |
46+
| Member variables | `m` prefix | `mDatabase`, `mQuery`, `mStmt` |
47+
| Function arguments | `a` prefix | `aDatabase`, `aQuery`, `aFilename` |
48+
| Boolean variables | `b`/`mb` prefix | `bExists`, `mbDone`, `mbReadOnly` |
49+
| Pointer variables | `p`/`mp` prefix | `pValue`, `mpSQLite`, `mpStmt` |
50+
| Constants | ALL_CAPS | `OPEN_READONLY`, `SQLITE_OK` |
51+
52+
## Documentation Requirements
53+
- Doxygen required for all public API
54+
- ASCII only in code and comments
55+
- Max 120 characters per line
56+
57+
## Repository Structure
58+
```
59+
include/SQLiteCpp/ # Public headers
60+
src/ # Implementation files
61+
tests/ # Unit tests (*_test.cpp)
62+
sqlite3/ # Bundled SQLite3 source
63+
examples/ # Example applications
64+
```
65+
66+
## Key Classes
67+
- `Database`: Connection management and database operations
68+
- `Statement`: Prepared statement execution
69+
- `Column`: Result column access
70+
- `Exception`: Error handling
71+
72+
## Use skills for task guidance
73+
Skills live under `.claude/skills/`. Load the relevant skill(s) based on the task:
74+
- `sqlitecpp-coding-standards`: core library edits, public API rules, style and naming.
75+
- `sqlitecpp-workflow`: add methods/classes, tests, build file updates, changelog.
76+
- `sqlitecpp-git-branching`: branch creation and naming rules.
77+
- `sqlitecpp-build-cmake`: CMake builds, options, tests.
78+
- `sqlitecpp-build-meson`: Meson builds, options, tests.
79+
- `sqlitecpp-ci-workflows`: CI config updates and build matrices.
80+
- `sqlitecpp-doxygen-guide`: Doxygen standards and public API documentation.
81+
- `sqlitecpp-testing-practices`: GoogleTest patterns and test structure.
82+
- `sqlitecpp-troubleshooting`: compiler/linker/build issues.
83+
- `sqlitecpp-sqlite-flags`: SQLite/SQLiteCpp feature flags.
84+

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The "CMakeLists.txt" file defining the static library is provided in the root di
9999
so you simply have to add_subdirectory(SQLiteCpp) to you main CMakeLists.txt
100100
and link to the "SQLiteCpp" wrapper library.
101101

102-
Example for Linux:
102+
Example for Linux:
103103
```cmake
104104
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/thirdparty/SQLiteCpp)
105105
@@ -110,7 +110,7 @@ target_link_libraries(main
110110
pthread
111111
dl
112112
)
113-
```
113+
```
114114
Thus this SQLiteCpp repository can be directly used as a Git submodule.
115115
See the [SQLiteCpp_Example](https://github.com/SRombauts/SQLiteCpp_Example) side repository for a standalone "from scratch" example.
116116

@@ -144,7 +144,7 @@ The SQLiteCpp port in vcpkg is kept up to date by Microsoft team members and com
144144

145145
#### Using SQLiteCpp on a system-wide installation
146146

147-
If you installed this package to your system, a `SQLiteCppConfig.cmake` file will be generated & installed to your system.
147+
If you installed this package to your system, a `SQLiteCppConfig.cmake` file will be generated & installed to your system.
148148
This file lets you link against the SQLiteCpp library for use in your Cmake project.
149149

150150
Here's an example of using this in your CMakeLists.txt
@@ -205,7 +205,7 @@ Arch Linux:
205205
sudo pacman -Syu clang ninja
206206
# install python and pip (required for meson)
207207
sudo pacman -Syu python python-pip
208-
# install meson
208+
# install meson
209209
pip install meson
210210
```
211211

@@ -224,7 +224,7 @@ for example you can build the library using the default options with:
224224

225225
```sh
226226
# setup the build directory
227-
meson setup builddir
227+
meson setup builddir
228228
# build sqlitecpp
229229
meson compile -C builddir
230230
```
@@ -276,6 +276,14 @@ You can:
276276
- or turn off the `option(SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getColumnOriginName(). Require support from sqlite3 library." ON)` in [CMakeFiles.txt](CMakeFiles.txt) (or other build system scripts)
277277
- or turn on the `option(SQLITECPP_INTERNAL_SQLITE "Add the internal SQLite3 source to the project." ON)` in [CMakeFiles.txt](CMakeFiles.txt)
278278

279+
### AI Coding Assistance
280+
281+
SQLiteCpp includes instructions for AI coding assistants:
282+
- `/AGENTS.md`: base custom instructions for all tasks
283+
- `/.claude/skills`: specialized skills covering specific subjects, workflow and processes
284+
285+
These files help AI assistants understand SQLiteCpp's coding standards, architecture, and best practices.
286+
279287
### Continuous Integration
280288

281289
This project is continuously tested under Ubuntu Linux with the gcc and clang compilers
@@ -315,28 +323,28 @@ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose b
315323
or uncoment the line at the end of [build.sh](build.sh)
316324

317325
## Examples
318-
### The first sample demonstrates how to query a database and get results:
326+
### The first sample demonstrates how to query a database and get results:
319327

320328
```C++
321329
try
322330
{
323331
// Open a database file
324332
SQLite::Database db("example.db3");
325-
333+
326334
// Compile a SQL query, containing one parameter (index 1)
327335
SQLite::Statement query(db, "SELECT * FROM test WHERE size > ?");
328-
336+
329337
// Bind the integer value 6 to the first parameter of the SQL query
330338
query.bind(1, 6);
331-
339+
332340
// Loop to execute the query step by step, to get rows of result
333341
while (query.executeStep())
334342
{
335343
// Demonstrate how to get some typed column value
336344
int id = query.getColumn(0);
337345
const char* value = query.getColumn(1);
338346
int size = query.getColumn(2);
339-
347+
340348
std::cout << "row: " << id << ", " << value << ", " << size << std::endl;
341349
}
342350
}
@@ -375,8 +383,8 @@ catch (std::exception& e)
375383
### The third sample shows how to manage a prepared statement with a transaction:
376384

377385
```C++
378-
try
379-
{
386+
try
387+
{
380388
SQLite::Database db("test.db3", SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE);
381389

382390
db.exec("DROP TABLE IF EXISTS test");
@@ -454,8 +462,8 @@ See bellow a short comparison of other wrappers done at the time of writing:
454462
- [sqdbcpp](http://code.google.com/p/sqdbcpp/): RAII design, simple, no dependencies, UTF-8/UTF-16, new BSD license
455463
- [sqlite3cc](http://ed.am/dev/sqlite3cc): uses boost, modern design, LPGPL
456464
- [sqlite3pp](https://github.com/iwongu/sqlite3pp): modern design inspired by boost, MIT License
457-
- [SQLite++](http://sqlitepp.berlios.de/): uses boost build system, Boost License 1.0
458-
- [CppSQLite](http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite/): famous Code Project but old design, BSD License
459-
- [easySQLite](http://code.google.com/p/easysqlite/): manages table as structured objects, complex
465+
- [SQLite++](http://sqlitepp.berlios.de/): uses boost build system, Boost License 1.0
466+
- [CppSQLite](http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite/): famous Code Project but old design, BSD License
467+
- [easySQLite](http://code.google.com/p/easysqlite/): manages table as structured objects, complex
460468
- [sqlite_modern_cpp](https://github.com/keramer/sqlite_modern_cpp): modern C++11, all in one file, MIT license
461469
- [sqlite_orm](https://github.com/fnc12/sqlite_orm): modern C++14, header only all in one file, no raw string queries, BSD-3 license

0 commit comments

Comments
 (0)