@h2loop/safe-c-coding-plugin 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
mode: subagent
|
|
3
3
|
displayName: Safe-C Reviewer
|
|
4
4
|
description: >-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
ALWAYS invoke this subagent once you have written, generated, or modified any C or C++
|
|
6
|
+
code (.c, .h, .cpp, .hpp), or whenever you want to review existing C/C++ code — do not
|
|
7
|
+
skip this for one-line changes or code that looks routine. Reviews the code against the
|
|
8
|
+
safe-c-coding (MISRA C:2012-aligned) guidelines. Given a file, diff, or code range, it
|
|
9
|
+
scans for undefined behaviour, dynamic allocation, unchecked returns, implicit
|
|
10
|
+
conversions, missing switch defaults, recursion, and other hazardous constructs, and
|
|
11
|
+
reports each as "severity — file:line — what's wrong -> safe fix". Use it to audit
|
|
12
|
+
hand-written or generated C/C++ before it lands, especially for embedded / safety-critical
|
|
13
|
+
targets.
|
|
11
14
|
permission:
|
|
12
15
|
# deny-all FIRST, then allow specifics: PermissionNext resolves with findLast
|
|
13
16
|
# (last matching rule wins), so "*": deny MUST precede the allows or it overrides them.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h2loop/safe-c-coding-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Safe-C coding plugin for Hydron — MISRA C:2012-aligned defensive C/C++ guidelines as an always-on skill plus a safe-c-reviewer subagent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -21,10 +21,14 @@
|
|
|
21
21
|
],
|
|
22
22
|
"files": [
|
|
23
23
|
".hydron-plugin",
|
|
24
|
+
"plugins",
|
|
24
25
|
"skills",
|
|
25
26
|
"agents",
|
|
26
27
|
"README.md"
|
|
27
28
|
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@kilocode/plugin": "*"
|
|
31
|
+
},
|
|
28
32
|
"repository": {
|
|
29
33
|
"type": "git",
|
|
30
34
|
"url": "git+https://github.com/h2loop/safe-c-misra-skill-plugin.git"
|
package/plugins/index.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Plugin } from "@kilocode/plugin"
|
|
2
|
+
|
|
3
|
+
export const SafeCCodingPlugin: Plugin = async () => ({
|
|
4
|
+
"experimental.chat.system.transform": async (_input, output) => {
|
|
5
|
+
output.system.push(
|
|
6
|
+
"Before writing, generating, modifying, or reviewing any C or C++ code " +
|
|
7
|
+
"(.c, .h, .cpp, .hpp), invoke the safe-c-coding skill. After writing or " +
|
|
8
|
+
"modifying C/C++ code, invoke the safe-c-reviewer subagent. Do this even " +
|
|
9
|
+
"for a one-line change or code that looks routine.",
|
|
10
|
+
)
|
|
11
|
+
},
|
|
12
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: safe-c-coding
|
|
3
|
-
description:
|
|
3
|
+
description: ALWAYS invoke this skill before writing, generating, modifying, or reviewing any C or C++ code (.c, .h, .cpp, .hpp) — no exception for one-line changes, snippets, or code that looks routine. Applies especially to embedded, automotive, medical, aerospace, or other safety-critical or resource-constrained targets where reliability, determinism, and freedom from undefined behaviour matter, but the mandatory-invocation rule applies to all C/C++ work.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Safe C Coding
|