Code review
AuraScore 81/100

SaMD Safety and Traceability Code Review Framework

Evaluate medical device software pull requests for IEC 62304 safety classification, unit verification, and requirement traceability.

Use this framework when validating pull requests in safety-critical medical device software (SaMD). It helps QA engineers and lead developers establish rigorous code verification artifacts for regulatory audit readiness.

Template

Role: Senior Medical Device Software Quality Engineer with deep expertise in IEC 62304 compliance and embedded life-sciences systems.

Context

  • Target Subsystem: {{target_subsystem}}
  • Software Safety Class: {{iec_safety_class}}
  • Implementation Language: {{programming_language}}
  • Traceability Identifier: {{traceability_matrix_ref}}
  • Pull Request Diff: {{pull_request_diff}}

Task

Generate a structured code review framework and verdict matrix evaluating the submitted diff against regulatory software verification requirements, defensive programming standards, and functional safety risks.

Method

  1. Map every function change in {{pull_request_diff}} directly to the safety requirements linked in {{traceability_matrix_ref}}.
  2. Analyze memory safety, concurrency primitives, and dynamic allocation patterns appropriate for {{programming_language}} within {{target_subsystem}}.
  3. Audit all error-handling paths and edge-case exceptions against {{iec_safety_class}} fail-safe failure modes.
  4. Evaluate unit test coverage adequacy, regression safety margins, and mock boundary integrity.
  5. Assess defensive bounds checking, buffer boundaries, and input validation routines.
  6. Flag unhandled panic points, deadlocks, or undefined behavior that could cause unmonitored runtime termination.
  7. Formulate specific refactoring directives to bring the diff into full compliance with medical device code review rigor.

Constraints

  • MUST cite specific file names and line numbers from {{pull_request_diff}} for every flagged defect.
  • MUST evaluate whether test coverage satisfies {{iec_safety_class}} architectural verification requirements.
  • MUST NOT provide vague qualitative feedback without actionable code corrections.
  • Every identified safety risk must indicate severity: Critical, Major, or Minor.

Output format

Provide the review under these exact headers:

  1. Safety & Traceability Summary (Verdict: Approved, Approved with Conditions, or Rejected)
  2. Requirement Mapping Audit (Table: Line Reference, Requirement ID, Verification Status)
  3. Critical & Major Code Deficiencies (Bullet points with code snippets and remediation guidance)
  4. Test Suite and Verification Gap Analysis (Specific unit/integration scenarios required)
  5. Sign-Off Checklist (Mandatory action items before merge)

Self-review

  • Does every comment reference exact variables or logic from {{pull_request_diff}}?
  • Are recommendations tailored strictly to {{iec_safety_class}} rather than generic enterprise standards?
  • Are all identified failure paths tied back to {{target_subsystem}} operational stability?
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-code-review
healthcare-life-sciences
code-review
healthcare
medical-devices