/meddev-agent-skills:meddev-state-machinesfrom meddev-agent-skills
Defines explicit, testable state machines with safe states, guarded transitions, and error handling for medical device software safety classes A-C.
Ships in meddev-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Define explicit, testable state machines with safe states, controlled transitions, and error handling suited to medical device safety classes.
Table-driven state machine (C):
// REQ-SM-10, HZ-07, RISK-CTRL-19
typedef enum { ST_IDLE, ST_PRIME, ST_RUN, ST_ALARM, ST_SAFE } state_t;
typedef state_t (*handler_fn)(void);
typedef struct { state_t state; handler_fn fn; } state_entry_t;
static state_t handle_idle(void) { /* ... */ return ST_PRIME; }
static state_t handle_prime(void) { /* ... */ return ST_RUN; }
static state_t handle_run(void) { if (fault()) return ST_SAFE; return ST_RUN; }
static state_t handle_alarm(void) { /* annunciate */ return ST_SAFE; }
static state_t handle_safe(void) { stop_outputs(); return ST_SAFE; }
static const state_entry_t table[] = {
{ST_IDLE, handle_idle},
{ST_PRIME, handle_prime},
{ST_RUN, handle_run},
{ST_ALARM, handle_alarm},
{ST_SAFE, handle_safe},
};
Invalid transition guard:
// REQ-SM-21; TEST-SM-05
bool can_transition(state_t from, state_t to) {
switch (from) {
case ST_RUN: return (to == ST_ALARM || to == ST_SAFE);
case ST_IDLE: return (to == ST_PRIME);
default: return to == ST_SAFE; // fallback to safe only
}
}
Timeout to safe state:
// REQ-SM-30; TEST-SM-08
if (timer_expired(&t_wait)) {
set_state(ST_SAFE);
alarm_timeout();
}
REQ-SM-### to states/transitions and TEST-SM-### to transition coverage.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
59 skills in this plugin
/meddev-21-cfr-part-11Provide implementation guidance for electronic records/signatures (ER/ES) compliance: access control, audit trails, data integrity, and validation expectations in medical device software and supporting tools. Use when working on 21 cfr part 11 in medical device software./meddev-ai-assisted-development-governanceDefine governance for AI/LLM-assisted software development (e.g., Cursor, Copilot, Claude): human review expectations, evidence that generated code is covered by requirements-based tests, tool validation for GxP-adjacent workflows, and alignment with Computer Software Assurance (CSA) principles (risk-based, critical thinking) without replacing your SOPs. Use when working on ai assisted development governance in medical device software./meddev-ai-ml-medical-device-softwareAddress machine learning inside the regulated product (not LLM coding assistants): Good Machine Learning Practice (GMLP), training/validation data integrity, Predetermined Change Control Plans (PCCP) where applicable, drift monitoring, and linking models to ISO 14971 and software lifecycle controls. Use when working on ai ml medical device software in medical device software./meddev-audit-loggingDefine what and how to log for medical devices: security/safety events, integrity, protection, and retention of logs for compliance and forensics. Use when working on audit logging in medical device software./meddev-authenticationDefine secure user/device authentication, session management, and RBAC suitable for medical device risk profiles. Use when working on authentication in medical device software./meddev-automated-testingDefine how to automate tests (unit, integration, system/HIL where feasible) in CI/CD pipelines for medical devices with gating and evidence capture. Use when working on automated testing in medical device software.npx claudepluginhub aminalam/meddev-agent-skills --plugin meddev-agent-skillsOther plugins' skills for the same job