Skip to content

Commit 3d264d3

Browse files
committed
docs: update AGENTS.md
Signed-off-by: Niu Zhihong <zhihong@nzhnb.com>
1 parent a6dcb17 commit 3d264d3

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

AGENTS.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,23 @@ cmake/ # Toolchain files, build helpers
5151
| `src/task/include/*.hpp` | Task/scheduler interfaces | `src/task/*.cpp` |
5252

5353
## CONVENTIONS
54-
- **Style**: Google C++ via `.clang-format`, enforced by pre-commit
55-
- **Naming**: files=`snake_case`, classes=`PascalCase`, vars=`snake_case`, members=`snake_case_` (trailing _), constants=`kCamelCase`, macros=`SCREAMING_SNAKE`
56-
- **Headers**: `#pragma once` guard (all headers use this consistently)
57-
- **Copyright**: `/** @copyright Copyright The SimpleKernel Contributors */`
58-
- **Includes**: system → third-party → project. Use `kstd_cstdio`/`kstd_vector`, never std dynamic alloc
59-
- **Returns**: trailing return type `auto Func() -> RetType`
54+
55+
> Full reference: `docs/coding_standards.md` — read it before generating any code.
56+
> Baseline example file: `src/include/spinlock.hpp`
57+
58+
- **C++ style**: see `docs/coding_standards.md` (naming, headers, includes, returns, attributes, Doxygen, error handling, freestanding constraints)
6059
- **CMake**: UPPERCASE commands/keywords, 4-space indent, 80-char lines, space before `(`
6160

6261
## ANTI-PATTERNS
63-
- **NO** exceptions, RTTI, `dynamic_cast`, `typeid`
64-
- **NO** heap allocation before memory subsystem init — use `src/libc/` and `src/libcxx/`
65-
- **NO** standard library dynamic containers in freestanding — use `sk_` prefixed versions
66-
- **NO** implementation in interface headers (exception: `__always_inline` perf-critical, utility parsers)
62+
63+
> See also `docs/coding_standards.md` §9–§10 for full prohibited-patterns list.
64+
6765
- **NO** modifying interface .h/.hpp files to add implementation
6866
- **NO** `as any`/type suppression equivalents
6967

7068
## UNIQUE STYLES
71-
- `Expected<T>` for all error returns (no exceptions)
7269
- `etl::singleton<T>` with named aliases in `kernel.h` (e.g. `TaskManagerSingleton::instance()`, `DeviceManagerSingleton::create()`)
7370
- `LockGuard<SpinLock>` RAII locking
74-
- `__builtin_unreachable()` for dead code paths
75-
- `[[nodiscard]]`, `[[maybe_unused]]` attributes used extensively
76-
- Doxygen `@pre`/`@post`/`@brief` on every interface method
7771

7872
## COMMANDS
7973
```bash

0 commit comments

Comments
 (0)