generate-types

Generate FHIR types and custom resources using @atomic-ehr/codegen.

2|1|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/HealthSamurai/phr --skill generate-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-types
Source: https://github.com/HealthSamurai/phr/tree/main/.claude/skills/generate-types
Command: npx skills add https://github.com/HealthSamurai/phr --skill generate-types

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @atomic-ehr/codegen, and includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the creation and updating of FHIR types, enhancing the efficiency of development and maintenance processes.

Core Features & Use Cases

  • FHIR Type Generation: Automatically generates FHIR types using @atomic-ehr/codegen with tree-shaking capabilities.
  • Resource Type Addition: Supports adding new resource types and custom StructureDefinitions to FHIR implementations.
  • Custom Resource Management: Facilitates the management of custom resources within a FHIR context.

Quick Start

To add a new FHIR resource type, follow these steps:

  1. Read the scripts/generate-types.ts script.
  2. Add the StructureDefinition URL to the treeShake section.
  3. Run the generate-types command.
  4. Update imports in code to use the generated type from src/fhir-types/.

Frequently Asked Questions about generate-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate FHIR types automatically for my healthcare project?

FHIR type generation is automated using the @atomic-ehr/codegen library, which creates type definitions in your src/fhir-types/ directory. You simply run the generate-types command after configuring your StructureDefinitions.

Can I add custom StructureDefinitions to my FHIR implementation?

Yes, you can manage custom resources by adding the StructureDefinition URL to the treeShake section in the scripts/generate-types.ts file. Running the generate-types command then updates your FHIR implementation with the new resource types.

What is tree-shaking in FHIR type generation and why use it?

Tree-shaking during FHIR type generation eliminates unused resource types from the final output, ensuring efficient type management. This process keeps your generated codebase lightweight and optimized for your specific healthcare application requirements.

Do I need @atomic-ehr/codegen to generate FHIR resource types?

Yes, @atomic-ehr/codegen is a required dependency for this FHIR type generation workflow. The generate-types script relies on this library to parse StructureDefinitions and output the corresponding TypeScript types.

What is the best way to update imports after adding a new FHIR resource type?

After running the generate-types command, you should update your code imports to reference the newly generated type from the src/fhir-types/ directory. This ensures your application uses the correct type definitions for the newly added FHIR resource.