docyrus-record-detail-form-design
Installation
SKILL.md
Docyrus Record Detail Form Design
Build full Docyrus record create, edit, and detail experiences around shared field metadata.
Choose the build mode
-
Standard create/edit/view record screen → use
useDocyrusFormView.- Best when the page is a normal Docyrus form or detail surface.
- Handles metadata loading, item loading, option hydration, field rendering, and submit behavior.
- Read
references/hook-form-view.md.
-
Custom manual form or detail layout → use
DynamicFormField,DynamicValue, oruseDocyrusFieldComponent.- Best when the page already owns form state, layout, or data fetching.
- Read
references/manual-form-detail-patterns.md.
-
Inline editing, click-to-edit detail rows, or field-by-field editing → use
EditableRecordDetailandEditableValue.- Best when users should edit a record in place without switching to a full form.
- Read
references/advanced-inline-edit-and-renderers.md.
-
Complex query/schema/API work → also load
docyrus-api-devordocyrus-app-dev-react. -
Field-type mapping or unsupported-field decisions → read
references/field-type-mapping-and-fallbacks.md.
Default workflow
- Confirm
appSlug,dataSourceSlug,mode, anditemIdif the record already exists. - Decide whether the page should be hook-first or fully manual.
- Keep editable fields and read-only renderers on the same field-type registry.
- Hydrate enum, user, and relation options before declaring the page done.
- Verify create, edit, view, reset, and save behavior.
- If the page supports inline editing, verify companion-field saves for composite types such as money, phone, and status.
Non-negotiables
- Prefer
useDocyrusFormViewfor standard create/edit/view pages. - Manual editable layouts should use
DynamicFormField, specific form-field components, oruseDocyrusFieldComponent(..., 'form-field'). - Manual read-only layouts should use
DynamicValue, specific value renderers, oruseDocyrusFieldComponent(..., 'value-renderer'). - Do not invent parallel per-field switch statements when the shared registry already solves the dispatch.
useDocyrusFormViewalready keeps form fields, value renderers, and inline detail mode aligned throughuseDocyrusFieldComponent.clickToEditonuseDocyrusFormViewview layouts routes throughEditableRecordDetail; use it when you want view-first UX with inline saves.- Manual Docyrus item fetching must always send
columns.useDocyrusFormViewderives them automatically, including companion columns. - Composite fields can require companion keys on read and write: money, phone, status, avatar, and similar types must stay intact in manual save flows.
- If a field has no editable component, create-mode UX should usually skip it; edit/view UX should usually fall back to a value renderer unless you have a better explicit design.
References
references/hook-form-view.md— hook-first create, edit, view, layout, submit, and click-to-edit patterns.references/manual-form-detail-patterns.md— manual form and detail composition with field components, renderers, and shared field maps.references/advanced-inline-edit-and-renderers.md—EditableRecordDetail,EditableValue, renderer selection rules, and companion-field save patterns.references/field-type-mapping-and-fallbacks.md— shared field maps, fallback rules, and unsupported-field strategy by render mode.