3.6 KiB
3.6 KiB
Create a procedural skill widget for: {{title}}
Procedure Type
{{procedureType}}
Task
{{task}}
Scene Description
{{description}}
Key Points
{{keyPoints}}
Tools or Materials
{{tools}}
Ordered Steps
{{steps}}
Success Criteria
{{successCriteria}}
Error Consequences
{{errorConsequences}}
Language
{{languageDirective}}
Generate a complete, self-contained HTML procedural skill widget with these mandatory features:
- Embedded JSON config in
<script type="application/json" id="widget-config">. widget-config.typeexactly equal to"procedural-skill".- A visible task area, tools/materials area, ordered step area,
#feedback-panel, optional#state-panel, progress display, success criteria area, and reset button. - Visible, enabled, clickable learner controls for actions.
#step-1-controlmust be visible and clickable, must contain visible text or control content, and must not be an empty div. - At least one learner action must visibly update progress or feedback.
#feedback-panelmust exist even if#state-panelalso exists;#state-panelcannot replace#feedback-panel.- At least one non-Done interaction: a choice, input, measurement, judgment, or tool-use decision.
- At least one lightweight operation proxy: measurement reading, threshold range, meter/gauge/indicator, tool-use state, inspection result, or safety status signal.
- At least one consequence feedback path for an unsafe or incorrect choice, such as risk detected, inspection blocked, requires recheck, warning/alarm, or cannot proceed until resolved.
- Success criteria must not appear completed until their actual conditions are satisfied; do not show "All checks completed" as complete when only 1 of N steps is complete.
- A visible, enabled, clickable reset button that restores all learner state: progress, feedback, state/status, step classes, success criteria, proxy values, and initial enabled/disabled controls.
- Reset must use a central
resetState()or equivalent full reset path, not a visual-only text change. - A platform-to-iframe listener using only existing message types:
SET_WIDGET_STATE,HIGHLIGHT_ELEMENT,ANNOTATE_ELEMENT, andREVEAL_ELEMENT. - The listener must use
event.data.typebecause MAIC's renderer sends the platform message type in that field. SET_WIDGET_STATEmust readdata.state;HIGHLIGHT_ELEMENT,REVEAL_ELEMENT, andANNOTATE_ELEMENTmust readdata.target.SET_WIDGET_STATEwithdata.state.completedStepsmust update visible progress, step completion, feedback/status, and success criteria.- Learner click actions and widget action
SET_WIDGET_STATEmust use the same shared state update/render path. - Generated JavaScript must guard DOM access before writing to elements; never set
disabled,textContent,className, orstyleon null elements. - No iframe-to-platform messages and no new postMessage action types.
- Responsive, self-contained HTML with inline CSS and JavaScript only.
- Choose a visual layout that fits this scene instead of defaulting every procedural-skill widget to the same dark dashboard or checklist panel. Possible layouts include a light step-card board, work-order desk, safety inspection station, measurement station, process kanban, simulator-like control board, GO/STOP decision station, handoff checklist board, or troubleshooting station.
- Regardless of visual style, preserve task operation, decision, feedback, progress, reset, completion checking, stable selectors, and the existing postMessage listener contract.
Return only the full HTML document. Do not include Markdown fences or explanatory text.