版本 1.008。
Page text to prompts - 页面文案转提示词
用途
脚本读取一个网页,将其文案分割成候选区块。你编写一个简短的判断文件(judgement file),构建脚本将其转化为每个区块的提示词和带度量的示例。仅处理文本:一个公开页面、桌面版、无需登录、无需绕过验证码、不处理图片中的文字。
要求
- Node 22 或更高版本。无需安装,无需API密钥。从本技能文件夹内运行
dist/目录下的脚本。 - Shell 环境需要网络访问权限。
规则
- R1. 不要先向用户提问。一个URL就足够了。
- R2. 自己的表述。 你写的每一行都不能重复页面中连续6个单词(忽略大小写和标点,称为
overlap)。此规则适用于所有字段和所有示例。 - R3. 不要提及网站的品牌:域名、
og:site_name(称为brand)。不要使用页面中的任何名称。 - R4. 使用文件写入工具编写
analysis.md和所有输入文件,绝不要使用shell heredoc。如果该工具拒绝(某些工具链会拒绝子代理写入.md文件),则以其他名称写入文件,然后用cp命令复制。 - R5. 绝不要手动重复脚本的工作。不要统计单词或字符数量。不要编写提示词。
- R6. 绝不要虚构事实。绝不要写俄文。脚本不调用任何模型。
操作步骤
以下每个路径都可以指向任何可写入的位置;work/ 是默认目录,并非强制规则。
- 读取(脚本)。
node dist/read.mjs <url> --out work/page.json- 选项:
--no-render(仅源HTML),--lang <code>(草稿语言)。 - 结果:在
work/目录下,生成brief.md(请阅读此文件)、analysis.md(草稿,每个候选区块有一个带猜测类型的标题)和page.json(供构建脚本使用,请勿打开)。如果analysis.md已存在,则草稿写入analysis.draft.md。 brief.md每行包含一个元素:类型、字数、状态(js_only、collapsed、not_in_a11y,若无状态则为ok)、文本,并按候选区块编号bNN分组。[g3#2]表示第g3组的第2张卡片。- 耗时:5 到 30 秒。渲染在45秒后停止,读取过程会转而使用HTML继续。
- 失败时:
REFUSED <code>(退出码2):停止并告知用户(参见拒绝代码)。如果脚本无法运行(没有Node 22、没有shell、没有网络),用一行告知用户并提供保存页面导入的替代方案。
- 选项:
- 填写
work/analysis.md(判断文件)。 参见下一节。使用英文编写,或者使用用户要求的语言,并在language:中指定语言代码。 - 构建(脚本)。
node dist/build.mjs work/page.json work/analysis.md --html work/report.html --md work/page-prompts.md --json work/page-prompts.json- 结果:生成3个文件,并输出
checks: 5 of 5 passed。示例超出范围仅作为警告。 - 失败时:
REFUSED列出每个问题及其检查项:overlap(规则R2)、brand(规则R3)、volume(字数范围缺失)、variables(未声明的{name})、blocks(候选区块缺失、未知或被重复使用)、schema(缺少字段或值不允许),或无法读取的行。仅修复列出的行并重新运行构建。
- 结果:生成3个文件,并输出
analysis.md - 判断文件
从 brief.md 获取字数信息,并围绕它们编写范围。不要填写字符范围。
language: en
example_product: a fictional booking app for small pilates studios
page_type: SaaS landing
audience: owners of small studios who take bookings by chat
awareness: comparing_solutions
tone: businesslike, warm; formality 2; you
promise: {product} gives {audience} {main_benefit} without {pain}.
logic: result and first step first, proof next, the steps before the prices
threads:
- the promise of no more calls returns in the hero, the steps and the closing call
## p01 hero | Hero | b01
role: say within five seconds what changes for the reader, and offer the first step
- eyebrow | 3-5 | the main change for the reader | No more booking calls
- h1 "Headline" | 7-11 | the result for {audience}, without the product's name | Clients reserve a reformer, and you stay with the class
- button | 2-4 | verb + object, the action {cta_action} | Set up bookings
- risk_line | 5-8 | {risk_remover} | Free to start, cancel at any time
techniques:
- Keep {product}'s name out of the headline; it first appears in the subheadline.
tone: businesslike, warm; you
avoid: "innovative"; a question as the headline
## p07 pricing | Pricing | b07
role: help the reader pick a plan and see the price fits the studio's size
- h2 | 4-8 | the price tied to the reader's size | Pay for the size you are
- 3 x plan "Plan":
- h3 | 1-3 | the studio's size | Single room
- price | 1-3 | {plan_n} | [price] / mo
- items 3 | 2-6 | what is included, most important first | Self-service reservations / Client reminders / Card checkout
techniques:
- Name the plans after the studio's size, not after levels such as basic or pro.
允许的值(其他值会被构建脚本拒绝):
awareness:unaware,problem_aware,comparing_solutions,product_aware,ready_to_buy。- 区块类型:
hero,social_proof_logos,problem,solution,features,benefits,how_it_works,use_cases,testimonials,case_study,stats,comparison,pricing,faq,guarantee,about,team,cta,lead_form,newsletter,other。other类型需要reason:行。 formality:1位数字,1到5(报告显示“N of 5”;不会被拒绝)。language:ISO代码;uk生成乌克兰语提示词,其他代码生成英语提示词。page_type:自由文本。- 变量:
product,category,audience,language,pain,pain_n,main_benefit,benefit_n,feature_n,step_n,use_case_n,alternative,objection_n,cta_action;事实变量risk_remover,outcome_number,customer_count,customer_n,testimonial_n,plan_n,guarantee,deadline。在vars:下声明新的变量,格式为- name: what goes in,如果是事实变量则添加[fact]。
必需字段: language, example_product, page_type, audience, awareness, promise, logic;每个区块必须包含类型、名称、role、1个或多个元素、1个或多个技巧。
行格式:
- 元素:
code "Label" | words | must | example。must部分将变成提示词中的对应行。 - 组:
N x code "Label":,子元素缩进;示例为1张卡片。组不能嵌套。 - 列表:
items N;示例项之间用/分隔。 - 合并候选区块:在标题中使用
| b03 b04。丢弃候选区块:在顶部附近使用drop: b10 <reason>。
最容易违反的规则:
- 1个区块,1个任务。忽略装饰性文本(微件标签、计数器)。
- 每个候选区块恰好属于1个区块或被丢弃。不能分割候选区块。
- 非常大的候选区块(例如1400词的文章,包含许多子节)应保留为1个区块:将其重复的子节编写为1个组,例如
5 x section "Section":,包含h3和text。使用最接近的类型,或使用other。 - 技巧是指令,而不是标签:不要写“uses PAS”,而应写“在第一句中指出问题,第二句指出代价,第三句引出{product}”。只描述文案实际做了什么。
- 示例是针对1个虚构产品的完整区块。接近字数是允许的。
验证
- 每个候选区块属于1个区块或被丢弃。
- 最终构建未输出
REFUSED。 -
work/report.html已存在。
显示报告
- 如果用户或调用者指示不要发布或打开任何内容,则在
report.html存在时停止并给出其路径。 - 否则,如果当前会话可以发布HTML,则发布
report.html;如果不能,则给出其绝对路径。 - 报告默认以英文打开,并带有EN/UK切换开关;
#lang=uk以乌克兰语打开。
聊天摘要
- 区块数量、骨架、1到2个有用的技巧。
- 重要的可见性说明:仅JavaScript渲染后出现的文本、折叠的FAQ答案。
- 不要粘贴每个提示词。如果用户询问了某个特定区块,则展示其提示词和示例。
- 说明一次:区块和措辞为你的解读;层次结构、计数和检查由脚本完成。
拒绝代码
保存页面路径:node dist/read.mjs --file saved.html --url <address> --out work/page.json
| 代码 | 告知用户 |
|---|---|
invalid_url, blocked_scheme, blocked_host, blocked_address | 不是公开的网址。 |
unreachable, http_error, blocked | 网站未响应或拒绝了自动化读取(blocked:HTTP 401、403或429)。建议使用保存页面导入。 |
challenge | 存在验证码或机器人检测。不要尝试绕过;建议使用保存页面导入。 |
not_html, too_large, empty | 不是可读的网页,或没有文本(可能全是图片)。 |
refused_ru_domain, refused_ru_hosting, refused_ru_audience, refused_language_ru | 不分析:俄语页面,或位于俄罗斯域名区域、托管在俄罗斯或包含俄语版本的网站。该决定由发布者作出。 |
参考
| 文件 | 何时阅读 |
|---|---|
references/block-types.md | 对区块类型不确定时。 |
references/variables.md | 需要使用 {variable} 或添加新变量时。 |
references/analysis-schema.md | 需要完整格式或JSON格式时。 |