No integrity check on stored configs -> risk: silent corruption affecting therapy.
Ignoring CRC failures -> risk: using bad data.
Mixing versioned/unversioned data without migration -> risk: misinterpretation.
Verification Checklist
CRC/HMAC applied to critical data/messages and verified.
ECC/redundancy used where feasible; correction paths handled.
Inputs validated; malformed data rejected safely.
Integrity failures trigger safe handling and logging.
Data formats versioned; migrations verified.
Traceability
REQ-DINT-### to TEST-DINT-###; logs of integrity failures retained.
References
IEC 62304 (data/control integrity expectations).
NIST SP 800-38 (for MAC modes) as informative.
Changelog
1.0.0 (2026-01-04): Initial data integrity skill with CRC/ECC, validation, and versioning.
Audit History
2026-01-04: Audit performed. Verified:
NIST SP 800-38 reference for MAC modes appropriate as informative
CRC and ECC patterns technically accurate
1---2name: data-integrity3description: Data Integrity4---56# Data Integrity78## Purpose9Ensure integrity of data in storage and transmission using checksums/CRCs/ECC, validation, and redundancy where needed for medical devices.1011## When to Apply12- Storing or transmitting patient/therapy data, logs, configs, firmware.13- Safety-critical control or sensor data paths.1415## Requirements (testable)161. Checksums/CRCs: Apply CRC or MAC to critical data blobs and messages; verify before use. Rationale: detect corruption.172. ECC/Redundancy: Use ECC or redundancy for persistent storage where feasible; handle correction/failure paths. Rationale: reliability.183. Input Validation: Validate size/range/format before processing; reject malformed data. Rationale: prevent misuse and corruption.194. Error Handling: On integrity failure, enter safe handling (retry, request retransmit, or safe state); log event. Rationale: safe recovery.205. Versioning: Version stored data formats; migrate safely; verify after migration. Rationale: compatibility and integrity.2122## Recommended Practices23- Include length and CRC fields in messages; keep CRC separate from payload.24- Use HMAC for integrity when authenticity is also needed.25- Periodically scrub/read-verify important data (configs/calibration) to detect bitrot.2627## Patterns28CRC on message:29```c30// REQ-DINT-CRC-01; TEST-DINT-0331bool validate_msg(const uint8_t *buf, size_t len, uint16_t expected_crc) {32 return crc16(buf, len) == expected_crc;33}34```3536ECC status handling:37```c38// REQ-DINT-ECC-02; TEST-DINT-0539if (ecc_corrected) log_event("ECC_CORRECTED");40if (ecc_uncorrectable) { enter_safe_state(); }41```4243Versioned config:44```yaml45# REQ-DINT-VERS-0346config_version: 247fields:48 - name: calib_factor49 crc: 0xABCD50```5152## Anti-Patterns (risks)53- No integrity check on stored configs -> risk: silent corruption affecting therapy.54- Ignoring CRC failures -> risk: using bad data.55- Mixing versioned/unversioned data without migration -> risk: misinterpretation.5657## Verification Checklist58- [ ] CRC/HMAC applied to critical data/messages and verified.59- [ ] ECC/redundancy used where feasible; correction paths handled.60- [ ] Inputs validated; malformed data rejected safely.61- [ ] Integrity failures trigger safe handling and logging.62- [ ] Data formats versioned; migrations verified.6364## Traceability65- `REQ-DINT-###` to `TEST-DINT-###`; logs of integrity failures retained.6667## References68- IEC 62304 (data/control integrity expectations).69- NIST SP 800-38 (for MAC modes) as informative.7071## Changelog72- 1.0.0 (2026-01-04): Initial data integrity skill with CRC/ECC, validation, and versioning.7374## Audit History75- **2026-01-04**: Audit performed. Verified:76 - NIST SP 800-38 reference for MAC modes appropriate as informative77 - CRC and ECC patterns technically accurate
Run npx skillmds@latest add aminalam/data-integrity in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Data Integrity It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
AminAlam (@aminalam) published this skill. Their other Agent Skills are listed on their SkillMD profile.