CANdb domain rules in candb-studio — signal pool, message references, value tables, VAL_ merging, orphan pool signals, and DBC round-trip expectations. Use when editing parsers, serializers, CanDatabase, or value-description logic.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Dbc Domain And Serialization?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/afri-bit-dbc-domain-and-serialization)
---
name: dbc-domain-and-serialization
description: CANdb domain rules in candb-studio — signal pool, message references, value tables, VAL_ merging, orphan pool signals, and DBC round-trip expectations. Use when editing parsers, serializers, CanDatabase, or value-description logic.
---
# DBC domain and serialization (this repo)
## Core ideas
- **`CanDatabase`** holds nodes, messages, **signal pool**, value tables, attributes, etc.
- **Messages** reference pool signals by name; resolved layout uses `Message.getResolvedSignals(pool, db)`.
- **Value tables** (`ValueTable`): name, optional `comment` (`CM_ VAL_TABLE_`), `entries` map raw integer → label.
- **Signals** may set `valueTableName`; effective value labels merge table + per-signal/per-message `VAL_` via `valueDescriptionMerge.ts`.
## Serialization notes
- **Empty** `VAL_TABLE_ Name ;` must parse and round-trip (name-only line).
- **Orphan pool signals** (not on any frame) persist in extension block — see `orphanSignalBlob.ts` and serializer.
- After changing parser or serializer, run compile and add/extend tests under `test/unit/infrastructure/parsers/` when possible.
## Round-trip contract (automotive-grade)
- Parse -> serialize -> parse yields an equal logical database; serialize is idempotent.
- Anything the parser does not understand MUST be preserved or reported - never silently dropped. Prefer an explicit "unsupported construct" diagnostic.
- Test corpus: real CANdb++ exports (anonymised), multiplexing, extended IDs, FD DLCs, signed/Motorola signals, 64-bit signals, long comments with quotes/newlines, empty tables, attribute defaults.
- Normative behaviour for the editor lives in `openspec/specs/` (see `database-editor`, `signal-layout-and-val`).
## Automotive context
- Raw values are integers in tables unless project explicitly supports floats elsewhere.
- Bit numbering: Intel (`@1`) start bit = LSB; Motorola (`@0`) start bit = MSB with sawtooth walk. See `can-protocol-fundamentals`.
- For bus semantics (CAN, packing, OEM quirks), prefer project agent **automotive-can**.