一键导入
extract-to-jaspr
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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | extract-to-jaspr |
| description | 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. |
This 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.
Add or update a dart_mappable data model in lib/src/models/content/, including adding format validation, regenerating code, and adding tests. Use when adding a new content type or modifying an existing model's fields.
Extracts YouTube transcripts and generates professional Flutter showcase blog posts in Markdown format. Use when you need to create a technical marketing case study from a video success story.
Update and maintain the llms.txt file. Use when the user wants to add sections, add links, correct information, or review the llms.txt file.
Proofreads Markdown files against Google guidelines.
Stages the Flutter site locally. This includes checking for broken links, verifying excerpts, updating formatting, and serving the dev site.