element-runtime-assets
SkillDev toolsUse when creating a new PrairieLearn element or changing an element's runtime dependencies, scripts, styles, or bundled assets.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the element-runtime-assets skill
What this skill tells your AI
The instructions your AI receives, as published by prairielearn/prairielearn in .agents/skills/element-runtime-assets/SKILL.md and read by ahel’s review.
Use this when adding a new element under apps/prairielearn/elements/ or when changing how an element loads JavaScript, CSS, or other runtime assets.
Core requirement
Any file referenced from an element's dependencies or dynamicDependencies must be browser-loadable as a standalone asset. It must be bundled or otherwise self-contained so it does not rely on extra import/require resolution from the browser runtime.
In practice, this means:
- Prefer a real bundled artifact over a package entry point that still pulls in additional modules.
- Verify that the served asset can be loaded directly by the app's asset pipeline.
- If the asset needs more module resolution than the current import-map flow provides, choose a different asset or bundle it first.
Distinguishing dependencies from dynamicDependencies
Use these two concepts carefully:
dependenciesare for assets that are part of the element's baseline runtime and should be loaded up front. These assets typically create global variables or otherwise register themselves with the browser runtime so that the element's code can use them immediately. They are loaded using<script src="...">or<link rel="stylesheet" href="...">tags in the page header. Element code can assume that these assets are available immediately after the page loads, and may reference its resources using global variables.dynamicDependenciesare for optional or on-demand loading. They are useful when a feature, data payload, or interaction path is only needed after some user action or condition is met. They may also be used as ESM modules that are imported by the element's code at runtime, though still browser-loadable as standalone assets. Their import-map entries map module specifiers to asset URLs. The browser fetches a dynamic dependency when the element executesimport(). Use staticimportonly when the element script is loaded as an ES module. The element's code should not assume that it is available until it has been explicitly loaded.
Workflow
- Create or update the element's controller, template, CSS, JavaScript, and
info.jsontogether. - Keep the runtime asset wiring in
info.jsonaligned with the actual files that are shipped and loadable in the browser. - Update the element docs and example-course questions when author-facing behavior changes.
- Verify the asset path in the browser or via the app's asset-serving checks before calling the change complete.
Typical files
apps/prairielearn/elements/<tag>/info.jsonapps/prairielearn/elements/<tag>/<tag>.pyapps/prairielearn/elements/<tag>/<tag>.jsapps/prairielearn/elements/<tag>/<tag>.mustachedocs/elements/<tag>.md
Signals
- GitHub stars
- 500
- Forks
- 391
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
element-runtime-assets- Source
- github.com/prairielearn/prairielearn