Mercurial
annotate .claude/skills/zenbu-bazel-c/SKILL.md @ 248:b8b6e726964a
[style] Use Dowa type aliases in C
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 04 Aug 2026 02:44:06 -0700 |
| parents | |
| children | 117c4d53c9a4 |
| rev | line source |
|---|---|
|
248
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
1 --- |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
2 name: zenbu-bazel-c |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
3 description: Use this skill when working anywhere in the Zenbu monorepo, especially C/C++ libraries, Bazel targets, Mercurial workflow, shared assets, or cross-project dependencies. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
4 --- |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
5 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
6 # Zenbu Bazel/C Monorepo |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
7 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
8 Use this skill to orient yourself before changing first-party code in this workspace. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
9 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
10 ## What this repo is |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
11 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
12 Zenbu is a Mercurial/Bazel monorepo for reusable C libraries, web servers, frontend bundles, and experiments. Prefer first-party libraries over adding new external dependencies. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
13 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
14 Important first-party packages: |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
15 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
16 - `dowa`: core C utilities, arena allocation, strings, math, dynamic arrays/hash maps. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
17 - `seobeo`: HTTP/TCP/WebSocket/networking library. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
18 - `mrjunejune`: personal website and production server. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
19 - `hg-web`: Mercurial repository browser served by a C backend. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
20 - `markdown_converter`: markdown-to-HTML C/WASM converter. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
21 - `deita`: SQLite wrapper library. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
22 - `s3`: S3 presigned upload helper. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
23 - `gui_ze`: Bazel macros for bundling/copying web assets. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
24 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
25 Avoid broad searches in `third_party/`, Bazel output directories, virtualenvs, `node_modules`, and generated bundles unless the task specifically requires them. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
26 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
27 ## Build and test commands |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
28 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
29 Use Bazel targets from the repository root: |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
30 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
31 ```bash |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
32 bazel build //seobeo:seobeo |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
33 bazel test //seobeo:seobeo_client_test |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
34 bazel test //seobeo:seobeo_websocket_test |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
35 bazel test //seobeo:seobeo_websocket_server_test |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
36 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
37 bazel build //mrjunejune:mrjunejune_server |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
38 bazel test //mrjunejune/test:integration_test |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
39 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
40 bazel build //hg-web:hg_web_server |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
41 ``` |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
42 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
43 For debug builds, prefer existing debug targets where present: |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
44 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
45 ```bash |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
46 bazel build //mrjunejune:mrjunejune_server_debug -c dbg |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
47 bazel build //seobeo:seobeo_debug -c dbg |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
48 ``` |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
49 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
50 If a change only touches docs or assistant skill files, Bazel verification is not required. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
51 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
52 ## Coding conventions to preserve |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
53 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
54 - Prefer Dowa's integer and boolean aliases (`uint8`, `uint16`, `uint32`, |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
55 `uint64`, `int8`, `int16`, `int32`, `int64`, and `boolean`) plus |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
56 `TRUE`/`FALSE` in first-party C. Do not introduce `<stdint.h>` `_t` aliases |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
57 or `<stdbool.h>` `bool` when a Dowa type already expresses the value. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
58 - C code generally uses `Dowa_Arena` for request-scoped allocations. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
59 - HTTP responses are usually `Seobeo_Request_Entry *resp = NULL` maps filled with `Dowa_HashMap_Push_Arena`. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
60 - Route handlers return response maps; streaming handlers receive `Seobeo_Handle *` directly. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
61 - Existing code favors explicit status/content-type/body response fields. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
62 - Use `Seobeo_Log` for seobeo-aware logging instead of introducing another logger. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
63 - Keep Bazel dependencies precise. Add deps to the smallest target that needs them. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
64 - Preserve platform-aware `select()` aliases for macOS/Linux targets. |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
65 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
66 ## Mercurial workflow |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
67 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
68 This repo is not a Git repository. Use Mercurial commands if you need VCS status: |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
69 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
70 ```bash |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
71 hg status |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
72 hg diff |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
73 ``` |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
74 |
|
b8b6e726964a
[style] Use Dowa type aliases in C
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
75 Do not create Git-specific metadata or workflows unless explicitly asked. |