- Extract AI prompt construction into a tested utility for report editor generation.
- Make doctor instructions and structured report fields higher priority than old template body and target-region HTML.
- Tell the AI not to carry over default gallbladder or liver descriptions when the doctor asks for another procedure or body part.
- Limit old full-report context length to reduce anchoring on default template content.
- Update README, AGENTS, report editor, design, progress, and testing docs for the AI prompt priority model.
- Add unit tests covering AI prompt priority and old-content truncation.
- Add fieldLibrary metadata to HTML template packages, including form fields, custom time formats, multi-select options, and anesthesia options.
- Restore imported template field metadata into local compatibility caches and the backend field library API when available.
- Preserve legacy JSON template import compatibility while keeping user-facing exports on HTML packages.
- Prevent template field saves from overwriting stored multi-select and anesthesia options with empty values.
- Update README, AGENTS, feature, requirement, design, module, progress, component, and testing docs for complete template export behavior.
- Extend template export tests to cover field library metadata round-tripping.