MISRA Automotive C — Review Skill
name: misra-automotive-c
by budhadityarano · published 2026-04-01
$ claw add gh:budhadityarano/budhadityarano-misra-automotive-c---
name: misra-automotive-c
version: 1.0.0
description: >
Review automotive Embedded C code against MISRA C:2012 rules. Flags violations
with rule numbers, ASIL classification, and provides a MISRA-compliant
replacement for every non-compliant line.
metadata:
openclaw:
emoji: "🚗"
requires:
bins: []
always: false
triggers:
- misra
- misra check
- misra review
- review my c code
- automotive c
- embedded c review
- check misra
- iso 26262
- asil
license: MIT-0
---
# MISRA Automotive C — Review Skill
Quick Reference
| File | Coverage |
|---|---|
| `misra-mandatory.md` | Mandatory rules — never violate, no deviation allowed |
| `misra-required.md` | Required rules — must comply or raise formal deviation |
| `types-and-casting.md` | Essential types, fixed-width integers, casts, essential type model |
| `memory-embedded.md` | No dynamic alloc, volatile, ISR constraints, stack discipline |
| `control-flow.md` | goto, loops, switch, if-else chains, single exit |
| `preprocessor.md` | Macros, include guards, #undef, ## operator |
| `iso26262-mapping.md` | ASIL A–D relevance for key MISRA C:2012 rules |
---
When to Activate
Activate this skill when the user:
---
Review Workflow — Follow These Steps in Order
Step 1 — Parse the Code
Step 2 — Check Mandatory Rules First (load `misra-mandatory.md`)
Mandatory rules have zero tolerance — flag every violation immediately.
Priority mandatory checks:
Step 3 — Check Required Rules (load `misra-required.md`, `types-and-casting.md`, `control-flow.md`, `preprocessor.md`)
Required rules must be complied with unless a formal deviation exists. Check:
Step 4 — Check Embedded / Memory Rules (load `memory-embedded.md`)
Step 5 — Map to ISO 26262 ASIL (load `iso26262-mapping.md`)
Step 6 — Generate the Violation Report
Output the report in EXACTLY this format for every violation found:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
VIOLATION #<N>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Rule : MISRA C:2012 Rule <X.Y>
Category : Mandatory | Required | Advisory
ASIL : A | B | C | D | Not mapped
Severity : CRITICAL | HIGH | MEDIUM | LOW
Location : Line <N> — <brief description of what the line does>
Non-Compliant Code:
<exact offending line(s)>
Why it violates Rule <X.Y>:
<1–3 sentence plain-English explanation of the rule and why this code breaks it>
MISRA-Compliant Replacement:
<corrected code, complete and ready to use>
Explanation of fix:
<1–2 sentences explaining what changed and why it is now compliant>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━After all individual violations, output a summary table:
REVIEW SUMMARY
──────────────────────────────────────────────────
Total violations : <N>
Mandatory : <N> ← must fix before any safety certification
Required : <N> ← must fix or raise formal deviation
Advisory : <N> ← recommended to fix
ASIL breakdown:
ASIL D : <N> ← safety critical, fix immediately
ASIL C : <N>
ASIL B : <N>
ASIL A : <N>
Not mapped : <N>
Overall compliance status: FAIL | CONDITIONAL | PASS
──────────────────────────────────────────────────---
Code Generation Workflow
When asked to **generate** new automotive/embedded C code (not review existing code):
Always apply these rules unconditionally — no exceptions:
**Types:**
**Memory:**
**Control flow:**
**Functions:**
**Macros:**
---
Escalation Rules
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...