Skip to content

feat: Healthcare domain — 4 skills + 1 agent for health-tech applications#955

Open
drkeyurpatel-wq wants to merge 3 commits intoaffaan-m:mainfrom
drkeyurpatel-wq:feat/healthcare-patterns
Open

feat: Healthcare domain — 4 skills + 1 agent for health-tech applications#955
drkeyurpatel-wq wants to merge 3 commits intoaffaan-m:mainfrom
drkeyurpatel-wq:feat/healthcare-patterns

Conversation

@drkeyurpatel-wq
Copy link
Copy Markdown

@drkeyurpatel-wq drkeyurpatel-wq commented Mar 27, 2026

Healthcare Domain Skills & Agent

First healthcare/clinical domain contribution to ECC. All patterns are generalized and framework-agnostic — usable by any health-tech team building EMR/EHR, clinical decision support, or health information systems.

New Skills (4)

Skill Description
healthcare-emr-patterns EMR/EHR encounter workflows, smart clinical templates, medication safety patterns, prescription generation, accessibility-first clinical UI
healthcare-phi-compliance PHI/PII protection — data classification, RLS templates for multi-tenant healthcare, common leak vectors (errors, console, URLs, storage), audit trail patterns, deployment checklist
healthcare-cdss-patterns Clinical Decision Support — drug interaction checking (bidirectional), dose validation, clinical scoring (NEWS2, qSOFA), alert severity classification, zero-tolerance testing patterns
healthcare-eval-harness Patient safety CI/CD gate — automated test suites for CDSS accuracy (100% required), PHI exposure (100% required), data integrity, clinical workflow, integration compliance. GitHub Actions example included

New Agent (1)

Agent Description
healthcare-reviewer Clinical safety reviewer — CDSS accuracy, PHI compliance, medical data integrity, integration validation. Read-only tools (no Bash). Uses Opus for clinical reasoning.

Origin

Battle-tested at Health1 Super Speciality Hospitals (Ahmedabad, India) — 5 centres, 410 operational beds, full digital ecosystem (EMR, HMIS, vendor management, doctor payouts, HR). Patterns extracted from production healthcare applications handling real PHI.

What is not included

No PHI, no patient data, no credentials, no Health1-specific business logic. All patterns are generalized templates.

Testing

All skills follow ECC v1.9 format with YAML frontmatter including version, observe, feedback, and rollback metadata.


Contributed by Dr. Keyur Patel (@drkeyurpatel-wq) — MD, Health1 Super Speciality Hospitals


Summary by cubic

Adds the healthcare domain with 4 reusable skills and a clinical safety reviewer agent for EMR/CDSS features with strict PHI protection and patient safety gates. Tightens safety checks, normalizes skill frontmatter, and hardens CI examples to avoid silenced errors.

  • New Features

    • healthcare-emr-patterns — Encounter workflows, medication safety, accessibility-first clinical UI.
    • healthcare-phi-compliance — PHI/PII classification, RLS templates, leak vectors, audit/deployment checklist.
    • healthcare-cdss-patterns — Drug interactions, dose validation, NEWS2/qSOFA scoring, alert severity patterns.
    • healthcare-eval-harness — CI safety gate for CDSS accuracy, PHI exposure, data integrity; clinical/integration suites; GitHub Actions example.
    • healthcare-reviewer — Read-only agent for CDSS accuracy, PHI compliance, data integrity, and integration validation.
  • Bug Fixes

    • CDSS/EMR/PHI hardening: weight-missing now blocks; critical interactions hard-block with required override reason; logging guidance uses opaque UUIDs; validateDose respects age/renal rules; suggestedRange typed as | null; null guard added in checkInteractions.
    • Eval harness + docs: CI enforces 95% thresholds and CDSS coverage; no silenced errors (2>&1), $RESULT quoted, empty-suite guard; Jest noted as reference (framework-agnostic thresholds); skills frontmatter trimmed to allowed fields only.

Written for commit 9b24bed. Summary will update on new commits.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive healthcare guidance covering CDSS safety patterns, medication dosing/interaction checks, scoring rules, and EMR encounter/workflow standards (sign/lock/addenda, non‑dismissable critical alerts).
    • Introduced a patient‑safety evaluation harness with strict test gates, CRITICAL/HIGH thresholds, and deployment block/warn rules.
    • Added a clinical reviewer specification detailing responsibilities, PHI/PII exposure checks, audit/override requirements, and required review output/decision rules.

New skills:
- healthcare-emr-patterns: EMR/EHR encounter workflows, smart templates, medication safety, clinical UI patterns
- healthcare-phi-compliance: PHI/PII protection patterns, RLS templates, leak vector checklist, audit trail patterns
- healthcare-cdss-patterns: Drug interaction checking, dose validation, clinical scoring (NEWS2/qSOFA), alert severity
- healthcare-eval-harness: Patient safety CI/CD gate — CDSS accuracy, PHI exposure, data integrity, clinical workflows

New agent:
- healthcare-reviewer: Clinical safety reviewer for CDSS accuracy, PHI compliance, medical data integrity

All patterns are generalized and framework-agnostic. Applicable to any health-tech stack.
Origin: Health1 Super Speciality Hospitals, Ahmedabad, India.
@ecc-tools
Copy link
Copy Markdown
Contributor

ecc-tools bot commented Mar 27, 2026

Analyzing 5000 commits...

@ecc-tools
Copy link
Copy Markdown
Contributor

ecc-tools bot commented Mar 27, 2026

Analysis Failed

Not Found - https://docs.github.com/rest/git/refs#get-a-reference

Troubleshooting
Cause Resolution
Large repository Analysis may timeout on repos with extensive history
API rate limits Wait 15 minutes before retrying
Network issues Queue timeout is 15 minutes; retry may succeed
Permissions Verify app has Contents: Read access

Retry: /ecc-tools analyze


Report Issue | ECC Tools

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7fc7faa8-a075-41e6-8482-7c49ca4db48a

📥 Commits

Reviewing files that changed from the base of the PR and between e3f2bda and 9b24bed.

📒 Files selected for processing (4)
  • skills/healthcare-cdss-patterns/SKILL.md
  • skills/healthcare-emr-patterns/SKILL.md
  • skills/healthcare-eval-harness/SKILL.md
  • skills/healthcare-phi-compliance/SKILL.md
✅ Files skipped from review due to trivial changes (4)
  • skills/healthcare-eval-harness/SKILL.md
  • skills/healthcare-phi-compliance/SKILL.md
  • skills/healthcare-emr-patterns/SKILL.md
  • skills/healthcare-cdss-patterns/SKILL.md

📝 Walkthrough

Walkthrough

Adds five new healthcare documentation/specification files covering a clinical-safety agent spec, CDSS patterns, EMR workflow patterns, PHI/PII compliance guidance, and a patient-safety evaluation harness with CI gating and test criteria.

Changes

Cohort / File(s) Summary
Agent Specification
agents/healthcare-reviewer.md
New agent spec for “Healthcare Reviewer — Clinical Safety & PHI Compliance”: purpose, tools, model selection, responsibilities, critical checklists (CDSS alerts, PHI scans, workflow constraints, data integrity), output template, and explicit rule statements.
CDSS Patterns
skills/healthcare-cdss-patterns/SKILL.md
New CDSS patterns: pure-function engine design, checkInteractions, validateDose, calculateNEWS2 interfaces, severity→UI behaviors, TypeScript test strategy, example tests, and anti-patterns.
EMR Patterns
skills/healthcare-emr-patterns/SKILL.md
New EMR/EHR workflow patterns: encounter control flow, smart templates, medication safety workflow (blocking, overrides, audit trail), locked-encounter behavior, vitals/labs UI rules, accessibility constraints, and prohibited anti-patterns.
PHI Compliance
skills/healthcare-phi-compliance/SKILL.md
New PHI/PII compliance guidance: data classification, access control, audit, RLS SQL examples, AuditEntry interface, common leak vectors and mitigations, schema tagging, deployment checklist, and examples.
Safety Eval Harness
skills/healthcare-eval-harness/SKILL.md
New evaluation harness spec: Jest-backed test categories and execution order, pass/fail thresholds (CRITICAL/HIGH), CI gate behavior (--bail/coverage), GitHub Actions example, pass-rate scripts, and eval report template.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • affaan-m

Poem

🐰 I hopped through specs both crisp and bright,
Guards for PHI and alerts in sight,
CDSS, EMR, tests in a row—
Safety-first, steady and slow,
A rabbit nods: ship it right! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introduction of 4 healthcare skills and 1 healthcare agent for health-tech applications, which matches the changeset content.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR adds the first healthcare/clinical domain to ECC: four skills covering CDSS patterns, PHI/PII compliance, EMR/EHR workflows, and a patient-safety CI/CD eval harness, plus a read-only healthcare-reviewer agent that uses Opus for clinical reasoning. All patterns are extracted from production use at a multi-centre hospital system and are well-structured with "When to Use", "How It Works", and "Examples" sections.

Convergence from prior review round: All critical items from previous threads have been resolved — the DoseValidationResult.suggestedRange interface now correctly types as | null, the non-standard YAML frontmatter fields (observe, feedback, rollback) have been removed, the null-guard on checkInteractions is now explicit (if (!newDrug) return []), the CI YAML no longer uses 2>/dev/null, $RESULT is correctly quoted throughout, and division-by-zero in the pipeline is guarded by an explicit if [ "$TOTAL" -eq 0 ] check.

Remaining minor items:

  • The RLS examples in healthcare-phi-compliance use auth.uid(), which is a Supabase-specific extension function. Adding a one-line note (and the plain-PostgreSQL equivalent using current_setting(...)) would make the skill genuinely framework-agnostic as advertised.
  • Example 2 in healthcare-eval-harness still has a bare .numPassedTests/.numTotalTests*100 jq expression that would error on empty test suites — a small inconsistency given the skill otherwise models defensive patterns throughout.

Confidence Score: 4/5

Safe to merge after addressing the Supabase-specific auth.uid() documentation note; no correctness or security issues in the core patterns.

All blocking concerns from the prior review round have been resolved (null interface, silent CI errors, non-standard frontmatter). The two remaining items are both P2 documentation quality suggestions with no runtime impact. The overall contribution is high quality: comprehensive clinical patterns, well-structured skill files, and a properly constrained read-only agent.

skills/healthcare-phi-compliance/SKILL.md — auth.uid() Supabase dependency worth noting for framework-agnostic claims.

Important Files Changed

Filename Overview
agents/healthcare-reviewer.md New read-only clinical safety reviewer agent using Opus; well-structured checklists for CDSS, PHI, workflow, and data integrity with clear output format and verdict tiers.
skills/healthcare-cdss-patterns/SKILL.md CDSS patterns with drug interaction, dose validation (weight/age/renal blocks), NEWS2 scoring, and zero-tolerance test suite. Prior issues (null interface, null-guard test, non-standard frontmatter) are all resolved.
skills/healthcare-emr-patterns/SKILL.md EMR encounter workflow patterns, locked-encounter addendum pattern, medication safety flow, and accessibility requirements; clear and well-structured with no issues found.
skills/healthcare-eval-harness/SKILL.md CI safety gate with five-tier test categories. Prior issues (division-by-zero, stderr silencing, unquoted $RESULT) are addressed in CI YAML; Example 2 retains a potential jq division-by-zero edge case in local usage context only.
skills/healthcare-phi-compliance/SKILL.md PHI/PII protection patterns covering classification, RLS, audit trail, leak vectors, and deployment checklist; RLS examples use Supabase-specific auth.uid() without noting this dependency, which could mislead teams on plain PostgreSQL.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[EMR UI — Clinician Input] --> B[CDSS Engine]
    B --> C{checkInteractions}
    B --> D{validateDose}
    B --> E{calculateNEWS2}
    C -->|Critical| F[Block + Non-dismissable Modal]
    C -->|Major| G[Warning Banner]
    C -->|Minor| H[Info Note]
    D -->|weight missing| F
    D -->|out of range| F
    D -->|within range| I[Allow prescribing]
    E -->|HIGH risk| F
    E -->|low/medium| J[Show escalation guidance inline]
    F --> K{Clinician overrides?}
    K -->|Yes - documents reason| L[Audit Trail Entry]
    K -->|No| M[Action Blocked]
    L --> N[Proceed with documented override]
    subgraph CI Safety Gate
        O[Push / PR] --> P[CDSS Accuracy - 100% required]
        P -->|PASS| Q[PHI Exposure - 100% required]
        Q -->|PASS| R[Data Integrity - 100% required]
        R -->|PASS| S[Clinical Workflow - 95%+ required]
        S --> T[Integration Compliance - 95%+ required]
        T -->|All gates pass| U[SAFE TO DEPLOY]
        P -->|FAIL| V[BLOCK deployment]
        Q -->|FAIL| V
        R -->|FAIL| V
    end
Loading

Reviews (3): Last reviewed commit: "fix: address Greptile review — frontmatt..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/healthcare-cdss-patterns/SKILL.md`:
- Around line 15-239: Add the required canonical headings to conform to repo
standards: insert explicit sections titled "When to Use", "How It Works", and
"Examples" in SKILL.md; under "When to Use" summarize activation scenarios
(e.g., drug interaction checking, dose validation, clinical scoring) by reusing
the existing "When to Activate" content, under "How It Works" describe the
architecture and key pure-function principle and reference the primary
functions/modules (checkInteractions, validateDose, NEWS2 engine) and data
models (DrugInteractionPair, DoseValidationResult, NEWS2Input/NEWS2Result), and
under "Examples" provide short example usages for checkInteractions and
validateDose (test cases from the test suite) and a snippet describing expected
NEWS2 output; ensure headings are top-level Markdown headers and preserve all
safety warnings and testing requirements.
- Around line 111-127: The DoseValidationResult.suggestedRange is declared
non-nullable but validateDose returns null for the "no rules available" path;
change the type to allow null (e.g., suggestedRange: { min: number; max: number;
unit: string } | null) or make it optional, and update any code that reads
suggestedRange accordingly (including the validateDose return and any callers)
so the interface DoseValidationResult and the validateDose implementation have
matching, null-safe types.

In `@skills/healthcare-emr-patterns/SKILL.md`:
- Around line 15-139: Rename the "When to Activate" header to "When to Use" and
add two new top-level headings "How It Works" and "Examples" (exact phrases
required by the skill format); move or reorganize existing content so "Core
Principles", "Single-Page Encounter Flow", "Smart Template System", "Medication
Safety Pattern", "Locked Encounter Pattern", "UI Patterns for Clinical Data",
"Accessibility for Healthcare", and "Anti-Patterns" become the "How It Works"
section content (keeping their subheadings and details intact), and create an
"Examples" section that contains 2–3 concrete, short examples such as "Patient
encounter flow (chief complaint → diagnosis → prescription)", "Medication safety
workflow (interaction check → override logging)", and "Locked encounter +
addendum workflow" to illustrate usage; ensure the new headings are top-level
Markdown headings and preserve all existing text under the appropriate new
headings.

In `@skills/healthcare-eval-harness/SKILL.md`:
- Around line 15-169: The doc is missing the required top-level section
headings; rename "When to Activate" to the exact heading "When to Use", and add
new sections titled "How It Works" and "Examples" (verbatim) to satisfy
docs-format checks; place "How It Works" after "When to Use" summarizing the
evaluation flow (reference the existing Eval Categories and CI/CD Integration
paragraphs and the GitHub Actions snippet), and add an "Examples" section that
shows example commands (reference the existing jest commands npx jest
--testPathPattern='tests/cdss' --bail --ci etc.) and a short example report
template (use the existing Eval Report Format) so the file contains the three
required headings and illustrative examples.

In `@skills/healthcare-phi-compliance/SKILL.md`:
- Line 41: Replace the phrase "Non-patient sensitive data in healthcare systems"
with hyphenated form "Non-patient-sensitive data in healthcare systems" in
SKILL.md; locate the exact text used in the heading/line and update it to the
hyphenated version to improve consistency and readability.
- Around line 15-185: The SKILL.md uses non-canonical section names (e.g., "When
to Activate") and is missing the required top-level headings "When to Use", "How
It Works", and "Examples"; update the document to rename "When to Activate" ->
"When to Use", add a new "How It Works" section that summarizes the rationale
and mechanics behind the guidance (covering Data Classification, Access Control
Patterns like the RLS policies shown, and Audit Trail Requirements), and add an
"Examples" section that provides short, concrete examples drawn from the
existing content (e.g., the RLS SQL snippet, PHI vs PII examples, and good/bad
error logging examples) so the file conforms to the canonical skill structure
while keeping existing guidance under the appropriate new headings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: faa8607d-845b-4f32-9436-5a42b73ca79f

📥 Commits

Reviewing files that changed from the base of the PR and between 678fb6f and 6373754.

📒 Files selected for processing (5)
  • agents/healthcare-reviewer.md
  • skills/healthcare-cdss-patterns/SKILL.md
  • skills/healthcare-emr-patterns/SKILL.md
  • skills/healthcare-eval-harness/SKILL.md
  • skills/healthcare-phi-compliance/SKILL.md

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 issues found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/healthcare-cdss-patterns/SKILL.md">

<violation number="1" location="skills/healthcare-cdss-patterns/SKILL.md:114">
P2: `suggestedRange` is typed as a required object but returned as `null` in one code path, creating an inconsistent and unsafe contract.</violation>

<violation number="2" location="skills/healthcare-cdss-patterns/SKILL.md:124">
P2: `validateDose` accepts age and renal-function inputs but never uses them, despite presenting these as considered dosing factors.</violation>

<violation number="3" location="skills/healthcare-cdss-patterns/SKILL.md:130">
P1: Weight-based dose safety check is conditionally skipped on missing/falsy patient weight, allowing false-negative validation for mg/kg drugs.</violation>
</file>

<file name="skills/healthcare-emr-patterns/SKILL.md">

<violation number="1" location="skills/healthcare-emr-patterns/SKILL.md:81">
P1: Medication safety guidance is internally contradictory for critical interactions (hard block vs overrideable by default), risking inconsistent clinical safety behavior.</violation>
</file>

<file name="skills/healthcare-eval-harness/SKILL.md">

<violation number="1" location="skills/healthcare-eval-harness/SKILL.md:128">
P2: The documented 95%+ HIGH-gate policy is not enforced by the CI example, which only runs plain Jest commands without percentage-threshold logic.</violation>

<violation number="2" location="skills/healthcare-eval-harness/SKILL.md:159">
P2: Coverage target is documented in the report, but the provided test/CI commands do not collect or enforce coverage, creating a safety-gate documentation mismatch.</violation>
</file>

<file name="skills/healthcare-phi-compliance/SKILL.md">

<violation number="1" location="skills/healthcare-phi-compliance/SKILL.md:105">
P1: The compliance guide inconsistently treats patient IDs as safe to log, despite defining identifier numbers as PHI, which can lead to PHI leakage in logs.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

CodeRabbit fixes (6 comments):
- All 4 skills: renamed 'When to Activate' → 'When to Use', added 'How It Works' and 'Examples' sections
- CDSS: DoseValidationResult.suggestedRange now typed as '| null'
- PHI: hyphenated 'Non-patient-sensitive'

Cubic fixes (7 issues):
- P1: CDSS weight-based check now BLOCKS when weight missing (was false-negative pass)
- P1: EMR medication safety clarified — critical = hard block, override requires documented reason
- P1: PHI logging guidance clarified — use opaque UUIDs only, not medical record numbers
- P2: CDSS validateDose now uses age and renal function params (ageAdjusted, renalAdjusted rules)
- P2: Eval CI example now enforces 95% threshold with jq + bc calculation
- P2: Eval CI example now includes --coverage --coverageThreshold on CDSS suite
- P2: CDSS suggestedRange null type fixed (same as CodeRabbit)
@ecc-tools
Copy link
Copy Markdown
Contributor

ecc-tools bot commented Mar 27, 2026

Analyzing 5000 commits...

@ecc-tools
Copy link
Copy Markdown
Contributor

ecc-tools bot commented Mar 27, 2026

Analysis Failed

Not Found - https://docs.github.com/rest/git/refs#get-a-reference

Troubleshooting
Cause Resolution
Large repository Analysis may timeout on repos with extensive history
API rate limits Wait 15 minutes before retrying
Network issues Queue timeout is 15 minutes; retry may succeed
Permissions Verify app has Contents: Read access

Retry: /ecc-tools analyze


Report Issue | ECC Tools

Greptile fixes:
- Removed non-standard YAML frontmatter fields (observe, feedback, rollback) from all 4 skills — only name, description, origin, version per CONTRIBUTING.md
- Added null guard to checkInteractions implementation (was missing despite test)
- CI: replaced 2>/dev/null with 2>&1 (was silencing safety-critical errors)
- CI: quoted $RESULT variable (was breaking jq on JSON with spaces)
- CI: added division-by-zero guard when test suite is empty
- CI: added note that Jest is reference implementation, thresholds are framework-agnostic
@ecc-tools
Copy link
Copy Markdown
Contributor

ecc-tools bot commented Mar 27, 2026

Analyzing 5000 commits...

@ecc-tools
Copy link
Copy Markdown
Contributor

ecc-tools bot commented Mar 27, 2026

Analysis Failed

Not Found - https://docs.github.com/rest/git/refs#get-a-reference

Troubleshooting
Cause Resolution
Large repository Analysis may timeout on repos with extensive history
API rate limits Wait 15 minutes before retrying
Network issues Queue timeout is 15 minutes; retry may succeed
Permissions Verify app has Contents: Read access

Retry: /ecc-tools analyze


Report Issue | ECC Tools

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/healthcare-emr-patterns/SKILL.md">

<violation number="1" location="skills/healthcare-emr-patterns/SKILL.md:76">
P2: Medication policy wording is internally inconsistent for CRITICAL interactions (hard block vs overrideable block), which can lead to inconsistent safety behavior.</violation>
</file>

<file name="skills/healthcare-eval-harness/SKILL.md">

<violation number="1" location="skills/healthcare-eval-harness/SKILL.md:60">
P2: Documentation references `scripts/check-pass-rate.js`, but the script does not exist anywhere in the repo, so the example commands will fail for users.</violation>

<violation number="2" location="skills/healthcare-eval-harness/SKILL.md:111">
P2: The CI example merges stderr into stdout (`2>&1`) and then parses the output as JSON with `jq`. Any Jest warnings or stderr output will break JSON parsing and fail the step unexpectedly. Keep stderr separate or use `--outputFile` for JSON to avoid non‑deterministic failures.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

→ Check encounter medications for interactions
→ Check patient allergies
→ Validate dose against weight/age/renal function
→ If CRITICAL interaction: BLOCK prescribing entirely
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Medication policy wording is internally inconsistent for CRITICAL interactions (hard block vs overrideable block), which can lead to inconsistent safety behavior.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/healthcare-emr-patterns/SKILL.md, line 76:

<comment>Medication policy wording is internally inconsistent for CRITICAL interactions (hard block vs overrideable block), which can lead to inconsistent safety behavior.</comment>

<file context>
@@ -68,72 +63,97 @@ interface ClinicalTemplate {
   → Validate dose against weight/age/renal function
-  → Display alerts (critical = block, major = require override reason)
-  → Log override reason if clinician proceeds
+  → If CRITICAL interaction: BLOCK prescribing entirely
+  → Clinician must document override reason to proceed past a block
+  → If MAJOR interaction: display warning, require acknowledgment
</file context>
Suggested change
→ If CRITICAL interaction: BLOCK prescribing entirely
→ If CRITICAL interaction: BLOCK by default; allow proceed only with explicit clinician override reason
Fix with Cubic

# HIGH gates — 95%+ required
- name: Clinical Workflows
run: |
RESULT=$(npx jest --testPathPattern='tests/clinical' --ci --json 2>&1) || true
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The CI example merges stderr into stdout (2>&1) and then parses the output as JSON with jq. Any Jest warnings or stderr output will break JSON parsing and fail the step unexpectedly. Keep stderr separate or use --outputFile for JSON to avoid non‑deterministic failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/healthcare-eval-harness/SKILL.md, line 111:

<comment>The CI example merges stderr into stdout (`2>&1`) and then parses the output as JSON with `jq`. Any Jest warnings or stderr output will break JSON parsing and fail the step unexpectedly. Keep stderr separate or use `--outputFile` for JSON to avoid non‑deterministic failures.</comment>

<file context>
@@ -113,57 +94,89 @@ jobs:
       - name: Clinical Workflows
-        run: npx jest --testPathPattern='tests/clinical' --ci
+        run: |
+          RESULT=$(npx jest --testPathPattern='tests/clinical' --ci --json 2>&1) || true
+          TOTAL=$(echo "$RESULT" | jq '.numTotalTests // 0')
+          PASSED=$(echo "$RESULT" | jq '.numPassedTests // 0')
</file context>
Fix with Cubic

Tests end-to-end flows: encounter lifecycle, template rendering, medication sets, drug/diagnosis search, prescription PDF, red flag alerts.

```bash
npx jest --testPathPattern='tests/clinical' --ci 2>&1 | node scripts/check-pass-rate.js 95
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Documentation references scripts/check-pass-rate.js, but the script does not exist anywhere in the repo, so the example commands will fail for users.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/healthcare-eval-harness/SKILL.md, line 60:

<comment>Documentation references `scripts/check-pass-rate.js`, but the script does not exist anywhere in the repo, so the example commands will fail for users.</comment>

<file context>
@@ -21,83 +20,65 @@ Automated verification system for healthcare application deployments. A single C
 
 ```bash
-npx jest --testPathPattern='tests/clinical' --ci
+npx jest --testPathPattern='tests/clinical' --ci 2>&1 | node scripts/check-pass-rate.js 95

</file context>


</details>

<a href="https://www.cubic.dev/action/fix/violation/8e4014c4-50e3-4f97-ae98-04e136d5b6f8" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://cubic.dev/buttons/fix-with-cubic-dark.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://cubic.dev/buttons/fix-with-cubic-light.svg">
    <img alt="Fix with Cubic" src="https://cubic.dev/buttons/fix-with-cubic-dark.svg">
  </picture>
</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant