Extracts a part of a website and converts it to a Jaspr component. Use when you need to migrate a part of a website to Jaspr.
59
67%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./sites/www/.agents/skills/extract-to-jaspr/SKILL.mdThis document outlines the process and key learnings from extracting a complex HTML component from a live website to a Jaspr component using Dart.
Use this skill when you need to extract a part of a website and migrate it to Jaspr.
The migration process follows a strict "Structure Only" approach:
Fetch & Extract:
curl to fetch the raw HTML. This ensures you get the initial server-rendered markup without client-side modifications.curl for the source extraction.Markup Translation (Exact Match):
StatelessComponent for the extracted HTML.div, nav, ul, li, img, etc.).x- attributes from alpine.js) as is and DO NOT ATTEMPT TO RE-IMPLEMENT LOGIC in Dart.When encountering assets (images, videos, etc.), look for them in /assets/src/img or /assets/src/video.
Note: The production site appends hashes to asset names, but the source files do not have them.
Use the asset() function imported from lib/constants/asset_loader.dart with the non-hashed filename. It returns the correct path after bundling.
img(src: asset('my-image.png'), alt: 'My Image')For components with repetitive or dynamic content (like carousels, event grids, or country lists), separate the data from the structure:
content/_data/ (e.g., my_data_file.yaml).package:jaspr_content/jaspr_content.dart to access the data in your component.import 'package:jaspr_content/jaspr_content.dart';
// Inside build method
final items = context.page.data['my_data_file'] as List? ?? [];
div(classes: 'grid', [
for (final item in items)
_buildItem(item as Map<String, dynamic>),
])When possible, reuse existing sections from lib/components/sections like the CtaSection or NewsletterSection.
Do not add new sections yourself.
The desired outcome is 1-to-1 translation of the HTML to Jaspr. The component should be as close to the original HTML as possible.
Fidelity is King: When porting, trust that the original CSS/HTML structure is correct. Don't refactor the structure while migrating the technology. Data-driven patterns should enhance maintainability without changing the rendered HTML.
0438a63
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.