Open-source design-controlled development infrastructure for medical device and SaMD teams — includes dhfkit
Project description
MedHarness
AI harness and DHF tooling for medical device software teams.
MedHarness is an open-source framework for building AI-driven engineering workflows on IEC 62304 / FDA-regulated software projects. It combines two things:
-
medharness— a CI harness that structures how AI agents (Claude Code) interact with a Design History File: pre-computing context, enforcing approval gates, persisting decisions, and generating audit-ready evidence. -
dhfkit— a standalone DHF engine for managing items, enforcing traceability (UC → CRS → SRS → SWDD → TC), validating schema, and generating specification documents.
Harness engineering: Rather than prompting an AI to "do compliance," MedHarness pre-computes the DHF context, injects it into the agent environment, defines approval gates the agent must pass through, and captures the agent's decisions back into the DHF — so the engineer controls the loop, not the agent.
Install
# From source (not yet on PyPI):
git clone https://github.com/itercharles/MedHarness
cd MedHarness
pip install -e .
Verify:
medharness --help
dhfkit --help
Quick Start
medharness init
Interactively scaffolds two repos:
- DHF repo —
DHF/config/, item YAML templates, spec/plan Jinja2 templates, GitHub Actions workflows for CR analysis, design, and CI validation - Product repo files —
CLAUDE.md,engineering-control.yml,cr-complete.yml, Claude Code skills (.claude/skills/)
How it works
A Change Request flows through five AI-assisted stages, each enforced by GitHub Actions:
Issue → cr-analyze (AI spec) → cr-design (AI DHF items) → cr-develop (AI code) → cr-complete
At each stage MedHarness:
- Pre-computes DHF context (
medharness dhf context overview) and injects it as$DHF_CONTEXT - Runs Claude with
--dangerously-skip-permissionsinside the DHF repo - Commits transitions back to the DHF (
medharness dhf item transition --commit --push) - Stores session IDs in PR comments for iterative review (
medharness ci claude-session put/get)
CLI surface
medharness init
# DHF operations (run from DHF repo with --dhf DHF)
medharness --dhf DHF dhf item list|get|create|update|delete|transitions|transition
medharness --dhf DHF dhf validate schema|traceability
medharness --dhf DHF dhf doc list|generate|export
medharness --dhf DHF dhf test list
medharness --dhf DHF dhf context overview|implementation
medharness --dhf DHF dhf config doc-types
# CI gates (run from product repo)
medharness ci dhf-validate --dhf DHF
medharness ci test-coverage --dhf DHF
medharness ci evidence bundle --dhf DHF --out-dir ...
medharness ci artifacts generate --dhf DHF --out-dir ...
# GitHub Actions helpers
medharness ci github-event --github-output "$GITHUB_OUTPUT"
medharness ci claude-session put <pr_number> <session_id>
medharness ci claude-session get <pr_number>
# CR workflow
medharness cr workflow intake-github-issue-ci
medharness cr workflow complete-from-github-pr
Python API
Use dhfkit directly in product repo automation without shelling out:
from medharness.client import DHFClient
client = DHFClient(Path("../my-project-DHF/DHF"))
cr = client.get_item("CR-034")
context = client.get_cr_context("CR-034") # {"cr": {...}, "spec": "..."}
client.transition_item("CR-034", "in_review", performed_by="alice")
Or use dhfkit standalone (no dependency on medharness):
from dhfkit.local_adapter import LocalDHFAdapter
adapter = LocalDHFAdapter(Path("DHF"))
items = adapter.list_items("SRS")
Repository layout
| Directory | Purpose |
|---|---|
medharness/ |
CLI harness, CI gates, CR workflows, init scaffolding |
dhfkit/ |
DHF engine: items, lifecycle, traceability, document generation |
dhfkit/templates/ |
Starter DHF scaffold — config, specs, plans, sample items |
docs/ |
Architecture, ADRs, compatibility contracts, roadmap |
dhfkit has no dependency on medharness and can be used standalone.
Docs
- docs/roadmap.md — vision and milestone plan
- docs/architecture.md — packages, scaffold model, DHF lifecycle
- docs/compatibility-contracts.md — stable public contracts
- docs/adr/ — architecture decision records
- CHANGELOG.md — version history
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file medharness-0.1.0.tar.gz.
File metadata
- Download URL: medharness-0.1.0.tar.gz
- Upload date:
- Size: 108.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d45a82f1afebb7033c73b809f8911912ff370f65eafd37c156a470b64471b6a0
|
|
| MD5 |
217fc51c511f0d272c3f7368d5348a77
|
|
| BLAKE2b-256 |
ef7f41c7ac6d42d404178acb994018653e0cd58dca4cc85f5ccc1b417300bc21
|
Provenance
The following attestation bundles were made for medharness-0.1.0.tar.gz:
Publisher:
release.yml on itercharles/MedHarness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
medharness-0.1.0.tar.gz -
Subject digest:
d45a82f1afebb7033c73b809f8911912ff370f65eafd37c156a470b64471b6a0 - Sigstore transparency entry: 1440258818
- Sigstore integration time:
-
Permalink:
itercharles/MedHarness@f311f45c68321ac5cf015d41c0b695220deff92d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/itercharles
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f311f45c68321ac5cf015d41c0b695220deff92d -
Trigger Event:
push
-
Statement type:
File details
Details for the file medharness-0.1.0-py3-none-any.whl.
File metadata
- Download URL: medharness-0.1.0-py3-none-any.whl
- Upload date:
- Size: 143.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
130483f28b0e8a0068fb6bf06b60fe60c33a4adff29300293b144211bbe2d534
|
|
| MD5 |
c2c83907da2feaf193b2b97e0d814709
|
|
| BLAKE2b-256 |
02b450ca15ab05c00ae6934f84921b43124abc707f2e0f6baef7ef216fcfeff5
|
Provenance
The following attestation bundles were made for medharness-0.1.0-py3-none-any.whl:
Publisher:
release.yml on itercharles/MedHarness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
medharness-0.1.0-py3-none-any.whl -
Subject digest:
130483f28b0e8a0068fb6bf06b60fe60c33a4adff29300293b144211bbe2d534 - Sigstore transparency entry: 1440258823
- Sigstore integration time:
-
Permalink:
itercharles/MedHarness@f311f45c68321ac5cf015d41c0b695220deff92d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/itercharles
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f311f45c68321ac5cf015d41c0b695220deff92d -
Trigger Event:
push
-
Statement type: