dbc-to-comment

Convert CAN DBC files into JSON with C-style signal comments.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/Delay-n-days/dbcjson5 --skill dbc-to-comment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbc-to-comment
Source: https://github.com/Delay-n-days/dbcjson5/tree/main/.github/skills/dbc-to-comment
Command: npx skills add https://github.com/Delay-n-days/dbcjson5 --skill dbc-to-comment

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cantools, typer, rich, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the conversion of CAN DBC files into C language-style comments in JSON format, streamlining the process of documenting CAN signals for embedded systems development.

Core Features & Use Cases

  • Signal Information Extraction: Parses DBC files to extract signal name, start bit, length, scale, offset, unit, and description.
  • C Comment Generation: Formats extracted signal data into a tab-separated C comment string.
  • JSON Output: Outputs the generated comments as a JSON array, suitable for integration into C codebases or documentation.
  • Use Case: Convert a complex automotive DBC file into a JSON file containing C-style comments for each signal, which can then be included in a C header file for easy reference by developers.

Quick Start

Use the dbc-to-comment skill to convert the file 'my_can_signals.dbc' into a JSON file with C-style comments.

Frequently Asked Questions about dbc-to-comment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a CAN DBC file into C comments for signal documentation?

To convert CAN DBC files into C comments, this Skill parses DBC signal data and outputs a JSON array of tab-separated C-style comment strings. It extracts signal names, start bits, lengths, scales, offsets, and units for direct integration into C header files.

What CAN signal information is extracted when generating C comments from a DBC file?

Generating C comments from a DBC file extracts comprehensive signal information including the signal name, start bit, length, scale, offset, unit, and description. This data is formatted into a structured JSON array of C-style comments for embedded systems documentation.

How to generate JSON documentation from automotive DBC files for an embedded C codebase?

You generate JSON documentation from automotive DBC files by running the internal conversion script. It parses all CAN signals and outputs a JSON file containing tab-separated C comment strings, which can be directly included in C header files for developer reference.

Does this DBC to C comment generator support extracting signal scale and offset values?

Yes, the DBC to C comment generator supports automatic parsing of all signal properties including scale and offset values. It also extracts start bit, length, unit, and description, formatting them into a JSON array of C-style comments.

Can I use cantools to parse DBC files and output C-style comments in JSON format?

Yes, this Skill utilizes the cantools dependency to parse DBC files and output C-style comments in JSON format. It leverages cantools to extract signal attributes and formats them into structured JSON arrays suitable for C codebase integration.

What is the best way to document CAN bus signals in C header files using DBC files?

The best way to document CAN bus signals in C header files is converting DBC files into a JSON array of C-style comments. This approach extracts all signal attributes and generates ready-to-include comment blocks, streamlining embedded systems documentation.