view .claude/skills/zenbu-bazel-c/SKILL.md @ 250:745fd127b2a1

[seobeo] Add bounded worker interface Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Tue, 04 Aug 2026 06:23:37 -0700
parents b8b6e726964a
children 117c4d53c9a4
line wrap: on
line source

---
name: zenbu-bazel-c
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.
---

# Zenbu Bazel/C Monorepo

Use this skill to orient yourself before changing first-party code in this workspace.

## What this repo is

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.

Important first-party packages:

- `dowa`: core C utilities, arena allocation, strings, math, dynamic arrays/hash maps.
- `seobeo`: HTTP/TCP/WebSocket/networking library.
- `mrjunejune`: personal website and production server.
- `hg-web`: Mercurial repository browser served by a C backend.
- `markdown_converter`: markdown-to-HTML C/WASM converter.
- `deita`: SQLite wrapper library.
- `s3`: S3 presigned upload helper.
- `gui_ze`: Bazel macros for bundling/copying web assets.

Avoid broad searches in `third_party/`, Bazel output directories, virtualenvs, `node_modules`, and generated bundles unless the task specifically requires them.

## Build and test commands

Use Bazel targets from the repository root:

```bash
bazel build //seobeo:seobeo
bazel test //seobeo:seobeo_client_test
bazel test //seobeo:seobeo_websocket_test
bazel test //seobeo:seobeo_websocket_server_test

bazel build //mrjunejune:mrjunejune_server
bazel test //mrjunejune/test:integration_test

bazel build //hg-web:hg_web_server
```

For debug builds, prefer existing debug targets where present:

```bash
bazel build //mrjunejune:mrjunejune_server_debug -c dbg
bazel build //seobeo:seobeo_debug -c dbg
```

If a change only touches docs or assistant skill files, Bazel verification is not required.

## Coding conventions to preserve

- Prefer Dowa's integer and boolean aliases (`uint8`, `uint16`, `uint32`,
  `uint64`, `int8`, `int16`, `int32`, `int64`, and `boolean`) plus
  `TRUE`/`FALSE` in first-party C. Do not introduce `<stdint.h>` `_t` aliases
  or `<stdbool.h>` `bool` when a Dowa type already expresses the value.
- C code generally uses `Dowa_Arena` for request-scoped allocations.
- HTTP responses are usually `Seobeo_Request_Entry *resp = NULL` maps filled with `Dowa_HashMap_Push_Arena`.
- Route handlers return response maps; streaming handlers receive `Seobeo_Handle *` directly.
- Existing code favors explicit status/content-type/body response fields.
- Use `Seobeo_Log` for seobeo-aware logging instead of introducing another logger.
- Keep Bazel dependencies precise. Add deps to the smallest target that needs them.
- Preserve platform-aware `select()` aliases for macOS/Linux targets.

## Mercurial workflow

This repo is not a Git repository. Use Mercurial commands if you need VCS status:

```bash
hg status
hg diff
```

Do not create Git-specific metadata or workflows unless explicitly asked.