Communitygithub.com

Olexan-art/page-text-to-prompts

将网页文案拆分成多个区块(如英雄区、优势、工作原理、客户评价、定价、FAQ等),并为每个区块生成一个可复用的提示词。每个提示词针对不同产品生成相同类型的文案,并附带参考示例。仅处理文字,忽略设计。

page-text-to-prompts 是什么?

这是一个AI技能,专为需要逆向工程或拆解落地页文案的开发者设计。它通过读取一个公开网页,自动将其文案分割成多个逻辑区块(如英雄区、优势、工作原理、客户评价、定价、FAQ等),并为每个区块生成一个结构化的提示词。每个提示词包含输出格式、字数范围、示例和写作规则,使其可复用:用户只需替换产品变量,即可为新项目生成风格一致的文案。该技能完全基于命令行运行(Node 22+),无需API密钥,也不调用任何AI模型,所有分析和提示词构建完全由本地脚本完成。它支持从网页读取、用户编辑判断文件(analysis.md),然后构建最终输出(包含HTML报告、Markdown提示词和JSON数据)。核心规则包括:不得复制原文连续6个词、不得提及品牌名称、不得虚构事实。该技能适用于Claude Code、Cursor、Codex等支持命令行工具的AI Agent平台,特别适合营销人员、产品经理和开发者在竞品分析、文案重构或快速创建相似落地页时使用。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Olexan-art/page-text-to-prompts/tree/HEAD/skills/page-text-to-prompts

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

版本 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/ 是默认目录,并非强制规则。

  1. 读取(脚本)。 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、没有网络),用一行告知用户并提供保存页面导入的替代方案。
  2. 填写 work/analysis.md(判断文件)。 参见下一节。使用英文编写,或者使用用户要求的语言,并在 language: 中指定语言代码。
  3. 构建(脚本)。 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(缺少字段或值不允许),或无法读取的行。仅修复列出的行并重新运行构建。

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格式时。

相关技能