LINUXDO_帖子随机数据库
6 subscribers
1.62K links
自动阅读脚本抓取的帖子会发送到这里
Download Telegram
标题: 发一个自用的代码解释的 prompt
作者: linux小白
内容: 感谢分享啊
时间: Sun, 08 Jun 2025 02:56:41 +0000
作者: 李白
回复: 感谢分享
时间: Sun, 08 Jun 2025 02:58:18 +0000
作者: Grogu
回复: 感谢佬友分享 看起来依然是解释代码,和实现的业务无关,怎么能让 AI 生成代码的业务解释啊
时间: Sun, 08 Jun 2025 02:58:49 +0000
作者: 暴富
回复: 感谢分享
时间: Sun, 08 Jun 2025 03:02:56 +0000
作者: 云逸
回复: 第二步的执行流程是可以解释业务代码的
时间: Sun, 08 Jun 2025 03:14:35 +0000
作者: 小滕先生
回复: 感谢佬友分享
时间: Sun, 08 Jun 2025 03:18:26 +0000
作者: 一液千精
回复: 谢谢分享
时间: Sun, 08 Jun 2025 03:18:50 +0000
作者: Grogu
回复: 我说的业务是很具体的,从设计角度出发的
时间: Sun, 08 Jun 2025 03:29:37 +0000
作者: 魔力鸽
回复: 感谢分享
时间: Sun, 08 Jun 2025 03:29:54 +0000
作者: 云逸
回复: 这个promt主要是为了梳理总体上的逻辑,后续的优化看看有没有大佬优化了
时间: Sun, 08 Jun 2025 03:36:28 +0000
作者: 印亭 坡
回复: 感谢分享,晚些时候试试
时间: Sun, 08 Jun 2025 03:38:14 +0000
作者: Grogu
回复: 个人感觉,到目前为止,难以和业务挂钩是大模型理解代码的最大痛点
时间: Sun, 08 Jun 2025 03:45:59 +0000
作者: coding
回复: 感谢分享
时间: Sun, 08 Jun 2025 03:47:08 +0000
作者: 𝓴𝓮𝓻𝓸𝓷
回复: 试了还真不错!感谢佬友
时间: Sun, 08 Jun 2025 03:49:39 +0000
作者: 𝒳
回复: 感谢分享! 题外话,标题应该是prompt
时间: Sun, 08 Jun 2025 03:53:40 +0000
作者: 大帅哥
回复: 感谢分享
时间: Sun, 08 Jun 2025 04:15:31 +0000
作者: 云逸
回复: 感谢纠正
时间: Sun, 08 Jun 2025 04:35:41 +0000
作者: aquarz
回复: 谢谢分享,我去试试效果
时间: Sun, 08 Jun 2025 04:46:49 +0000
作者: Brantfang
回复: 感谢佬友分享
时间: Sun, 08 Jun 2025 04:48:55 +0000
作者: ashirom39
回复: mark
时间: Sun, 08 Jun 2025 04:52:26 +0000
作者: watayy
回复: 感谢分享
时间: Sun, 08 Jun 2025 04:59:48 +0000
作者: Isler
回复: 感谢佬友分享经验
时间: Sun, 08 Jun 2025 05:00:18 +0000
作者: 聚道夫
回复: 2.0提示词效果啥样,楼主来个图瞅瞅
时间: Sun, 08 Jun 2025 05:04:33 +0000
作者: malousy
回复: 云逸: . 角色与核心原则 (Role & Core Principles) 你是一位拥有十年全栈开发经验的资深软件工程师,精通前端与设计。你的沟通风格专业、耐心、乐于助人,全程使用中文,语气友好、鼓励、简洁直白。 以下是你的四条黄金法则,必须无条件遵守: ① 类比为王 (Analogy First): 你最重要的使命是让零基础新手看懂代码。因此,解释任何技术概念时,必须使用通俗易懂、生动有趣的生活化类比。 ② 单一交付 (Single File Delivery): 无论何种情况,最终交付物只能是一个包裹在 ` html ... 代码块中的单一、完整、可独立运行的 HTML 文件。代码块前后不得有任何多余字符。 ③ 风格统一 (Consistent Design): 所有生成的页面必须严格遵循「#3. 建造蓝图」中定义的暖色、可爱、圆角、响应式设计语言。 ④ 格式严谨 (Strict Format): 必须在 HTML 代码块的正下方,紧跟「#4. 交付规范」中规定的说明文字,一字不差。 2. 工作流程:双路径决策 (Workflow: Two-Path Decision) 根据用户输入,自动选择并严格执行以下路径之一: 路径 A:用户提供代码 → 解读并生成页面 第一步:内部构思 (Internal Analysis) 在动手写代码前,先在脑中构思好一个包含以下部分的分析报告(此为思考过程,非直接输出): ## 🦉 代码魔法解读 ### 📥 您的代码: 用于展示用户提供的原始代码。 ### 📜 解读卡片 (Interpretation Cards): 针对每个关键代码片段,构思一个独立的“解读卡片”结构。这张卡片在视觉上应该是一个圆角、带阴影的容器,内部包含: 代码快照: 卡片顶部,用 <pre><code class="language-..."> 展示当前解读的代码片段。 解读双栏 (Interpretation Columns): 卡片主体部分,必须采用响应式的双栏网格布局 (grid grid-cols-1 md:grid-cols-2 gap-4)。每一栏都是一个带有圆角和内边距的浅色背景块,包含一个图标、标题和解释内容: 左栏:技术解密: 图标: ⚙️ (齿轮) 或类似的技术符号。 标题: "技术解密" 内容: 简洁直白地解释该代码的“作用是什么”。 右栏:生活类比: 图标: 💡 (灯泡) 或其他代表灵感、生活的可爱符号。 标题: "生活类比" 内容: 配上一个通俗易懂的生活化类比,说明“它像什么”。 ### 🗺️ 运行流程图 (DOT 语言): 构思出用于生成流程图的 DOT 语言字符串,它需要清晰地描绘出代码的执行逻辑。 ### 💡 核心概念卡片: 提炼出代码中的核心术语(如 Promise, API, Array),并为每个术语创建一个“概念卡片”,用生活场景打比方来解释。 第二步:生成交互式 HTML 页面 (Final Generation) 严格遵循「#3. 建造蓝图」的所有规范,创建完整的 HTML 页面。 将第一步构思的分析报告,转化为带有样式的 HTML 标签,优雅地填充到 <main id="content-area"> 区域内。 必须集成所有「#3. 建造蓝图」中为路径 A 指定的交互模块(如 highlight.js 和 Viz.js)。 路径 B:用户未提供代码 → 生成引导页面 创建占位符: 在 <main id="content-area"> 中,设计一个符合「#3. 建造蓝图」设计语言的友好提示卡片。 撰写文案: 使用类似 "🦉 嗨,老伙计!把你的代码“喂”给我,我来帮你揭开它的神秘面纱!" 的鼓励性话语。 生成页面: 基于「#3. 建造蓝图」,构建一个不包含代码解读和交互模块的简化版 HTML 页面。 3. 建造蓝图:页面生成指南 (The Blueprint: Page Generation Guide) 这是你生成所有 HTML 页面的唯一参考标准。 3.1. 设计语言 (Design Language) 色调: 暖色系。背景 bg-amber-50,主内容区 bg-white,强调色 orange-400/amber-500,常规文字 text-stone-700,标题文字 text-yellow-900。 形态: 大量使用圆角 (rounded-xl/2xl/full) 和柔和阴影 (shadow-md/xl)。 交互: 为按钮、链接等可点击元素添加 transition-all 和 hover:scale-105/hover:shadow-lg 等微动效。 布局: 响应式。使用 Flexbox/Grid 和 sm:/md:/lg: 断点,确保移动端优先。页面主体内容水平居中,并设置 max-w-5xl 防止在大屏上过宽。 图标: 必须使用内联 SVG,风格力求可爱、简洁。 3.2. 页面骨架与内容样式 (Structure & Prose) HTML 结构: <!DOCTYPE html> -> <html lang="zh-CN"> -> <head> -> <body> -> <header> -> <main id="content-area"> -> <footer>。 内容样式 (.content-prose): 在 <style> 标签内使用 @apply#content-area 中的元素(h2, h3, p, ul, code, pre, blockquote)统一设置符合设计语言的字体、颜色和间距,确保解读内容美观易读。 3.3. 交互模块 (Interactive Modules) 路径 A 强制模块: 代码高亮 (Highlight.js) 用
for #f9e9e9 */ } body { font-family: "Maple Mono NF CN", monospace, sans-serif !important; letter-spacing: 0.03em; line-height: 1.6; } /* UI Elements Font */ .ant-modal-content, .ant-popover-inner, div[class^="InputContainer-"], div[class^="OutputContainer-"], div[class^="HistoryContainner-"], .ant-notification-notice, .ant-message-notice-content, .ant-drawer-content, .ant-collapse-content-box, .ant-modal-body .ant-input-affix-wrapper input, .ant-segmented-group .ant-segmented-item-label, .ant-btn, .ant-dropdown-trigger, .ant-modal-header .ant-modal-title, .ant-collapse-header, li[class^="MenuItem-"], #content-container [class^="ListItemContainer-"], div[class^="SettingGroup-"] label, .ant-tooltip-inner, .markdown th, .ant-table-thead > tr > th, .markdown pre [class^="CodeHeader-"] { font-family: inherit !important; /* Inherits "Maple Mono NF CN" from body */ font-weight: 700 !important; /* Bold */ letter-spacing: inherit; line-height: inherit; } /* Markdown Headers Font */ .markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { font-family: inherit !important; /* Inherits "Maple Mono NF CN" from body */ font-weight: 700 !important; letter-spacing: 0.08em; } /* Specific Reading Areas Font */ .bubble .message-content-container, .inputbar-container textarea, .ant-modal .ant-modal-body, .ant-table-tbody > tr > td, .markdown blockquote, .markdown table, .markdown p, .markdown li, .markdown strong, .markdown b, .markdown em, .markdown i { font-family: "Maple Mono NF CN", monospace, sans-serif !important; letter-spacing: 0.03em !important; line-height: 1.6 !important; } /* Code Font */ code, pre, .markdown pre [class^="CodeContent-"] * { font-family: "Maple Mono NF CN", monospace, sans-serif !important; font-weight: 400 !important; /* Regular weight for code */ letter-spacing: normal !important; line-height: 1.45 !important; } /* --- Dark Mode --- */ body[theme-mode="dark"] { /* Accent Colors (Blue/Cyan) */ --color-cyber-accent: #00CED1; /* Dark Cyan */ --color-cyber-accent-bright: #40E0D0; /* Turquoise */ --color-cyber-accent-purple: #DA70D6; /* Orchid - Used for blockquote border/background */ --color-cyber-accent-rgb: 0, 206, 209; /* RGB for --color-cyber-accent */ --color-cyber-accent-purple-rgb: 218, 112, 214; /* RGB for --color-cyber-accent-purple */ /* Line & Corner Effects (Derived from Accent RGB) */ --color-cyber-line: rgba(var(--color-cyber-accent-rgb), 0.7); --color-cyber-line-dim: rgba(var(--color-cyber-accent-rgb), 0.3); /* Glow Effects (Derived from Accent RGB) */ --shadow-cyber-glow-teal: rgba(var(--color-cyber-accent-rgb), 0.15); --shadow-cyber-glow-purple: rgba(var(--color-cyber-accent-purple-rgb), 0.1); /* Used for blockquote shadow */ /* Background Colors (Semi-transparent for blur effect) */ --color-background: transparent; /* Main body background is image */ --color-background-soft: rgba(22, 27, 34, 0.8); /* Soft background for UI elements */ --color-background-mute: rgba(33, 38, 45, 0.8); /* Mute background for hover/focus */ --navbar-background: transparent; --chat-background: transparent; --chat-background-user: rgba(22, 27, 34, 0.65); /* User bubble background */ --chat-background-assistant: rgba(22, 27, 34, 0.65); /* Assistant bubble background */ --chat-customize-collapse-background: rgba(22, 27, 34, 0.7); /* Collapse panel content background */ --color-background-opacity: rgba(22, 27, 34, 0.6); /* More opaque background for some containers */ --color-background-rgb: 22, 27, 34; /* RGB for main background color */ --antd-arrow-background-color: rgba(33, 38, 45, 0.7); /* Antd tooltip/popover arrow background */ /* Text Colors */ --chat-text-user: #c5def4; /* User chat text color */ --color-text-1: #c3e0f9; /* Primary text color */ --color-text-2: #8a9aaf; /* Secondary text color */ --chat-customize-codeHeader: #7d8590; /* Code block header color */ --color-black: #161b22; /* Dark theme "black" (very dark grey) */ --color-white: #f9e9e9; /* Dark theme "white" (ve
m-border-radius) !important; color: var(--color-text-2); position: relative; background-color: transparent !important; } li[class^="MenuItem-"].active, #content-container [class^="ListItemContainer-"].active, .ant-segmented-group .ant-segmented-item-label[aria-selected="true"] { box-shadow: var(--chat-customize-box-shadow4) !important; background: var(--color-background-soft) !important; color: var(--color-text-1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); will-change: backdrop-filter; border-left: 2px solid var(--color-cyber-accent) !important; } li[class^="MenuItem-"].active::after, #content-container [class^="ListItemContainer-"].active::after { content: ""; position: absolute; right: 0; top: 5px; width: 5px; height: 5px; background-color: var(--color-cyber-accent); } li[class^="MenuItem-"]:hover, #content-container [class^="ListItemContainer-"]:hover, .ant-segmented-group .ant-segmented-item-label:hover { box-shadow: var(--chat-customize-box-shadow4) !important; background: var(--color-background-soft) !important; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); will-change: backdrop-filter; color: var(--color-text-1); } /* Sidebar Icons */ #app-sidebar [class^="Icon-"].active, #app-sidebar [class^="Icon-"]:hover { box-shadow: var(--chat-customize-box-shadow3) !important; background: transparent !important; transition: all 0.2s ease; border: none !important; color: var(--color-cyber-accent-bright) !important; position: relative; } #app-sidebar [class^="Icon-"].active::before { content: ""; position: absolute; top: -2px; right: -2px; width: 6px; height: 6px; border-top: 2px solid var(--color-cyber-accent); border-right: 2px solid var(--color-cyber-accent); } #app-sidebar [class^="Icon-"].active::after { content: ""; position: absolute; bottom: -2px; left: -2px; width: 6px; height: 6px; border-bottom: 2px solid var(--color-cyber-accent); border-left: 2px solid var(--color-cyber-accent); } /* Setting Group / Segmented Control */ div[class^="SettingGroup-"] .ant-segmented, div[class^="SettingContainer-"] div[class^="SettingGroup-"], .ant-segmented.ant-segmented-shape-round { border-radius: var(--list-item-border-radius) !important; background-color: var(--color-background-opacity) !important; box-shadow: var(--chat-customize-box-shadow) !important; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); will-change: backdrop-filter; clip-path: polygon(0 var(--cyber-angle-size), var(--cyber-angle-size) 0, calc(100% - var(--cyber-angle-size)) 0, 100% var(--cyber-angle-size), 100% calc(100% - var(--cyber-angle-size)), calc(100% - var(--cyber-angle-size)) 100%, var(--cyber-angle-size) 100%, 0 calc(100% - var(--cyber-angle-size))); border: var(--cyber-line-width) solid var(--color-cyber-line-dim); } .ant-segmented-thumb, label.ant-segmented-item.ant-segmented-item-selected { background-color: transparent !important; border: transparent !important; } .ant-segmented-thumb-motion-appear-active { display: none !important; } /* Collapse Panel */ .ant-collapse-item { border-radius: var(--list-item-border-radius) !important; box-shadow: var(--chat-customize-box-shadow) !important; overflow: hidden; background-color: transparent !important; margin-bottom: 1rem; clip-path: polygon(0 var(--cyber-angle-size), var(--cyber-angle-size) 0, calc(100% - var(--cyber-angle-size)) 0, 100% var(--cyber-angle-size), 100% calc(100% - var(--cyber-angle-size)), calc(100% - var(--cyber-angle-size)) 100%, var(--cyber-angle-size) 100%, 0 calc(100% - var(--cyber-angle-size))); border: var(--cyber-line-width) solid var(--color-cyber-line-dim); position: relative; } .ant-collapse-item::before { content: ""; position: absolute; top: 0; left: 0; width: 10px; height: 10px; border-top: 2px solid var(--color-cyber-accent); border-left: 2px solid var(--color-cyber-accent); z-index: 1; } .ant-collapse-header { background-color: var(--color-background-soft) !important; border-radius: 0 !important; backdrop-filter: blur(10px)
tive):after { width: 100%; transition: 800ms ease all; will-change: width; } .active .menu { background-color: transparent !important; border-radius: var(--list-item-border-radius); } .active .menu:hover { color: var(--color-cyber-accent) !important; } /* Message Bubble Container */ .bubble .message-content-container { border-radius: var(--list-item-border-radius) !important; box-shadow: var(--chat-customize-box-shadow); background-color: var(--chat-background-assistant) !important; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); will-change: backdrop-filter; position: relative; overflow: hidden; clip-path: polygon(0 var(--cyber-angle-size), var(--cyber-angle-size) 0, calc(100% - var(--cyber-angle-size)) 0, 100% var(--cyber-angle-size), 100% calc(100% - var(--cyber-angle-size)), calc(100% - var(--cyber-angle-size)) 100%, var(--cyber-angle-size) 100%, 0 calc(100% - var(--cyber-angle-size))); } .bubble .message-content-container::before { content: ''; position: absolute; inset: 0; border: var(--cyber-line-width) solid var(--color-cyber-line-dim); border-radius: calc(var(--list-item-border-radius) - 1px); pointer-events: none; clip-path: polygon(0 var(--cyber-angle-size), var(--cyber-angle-size) 0, calc(100% - var(--cyber-angle-size)) 0, 100% var(--cyber-angle-size), 100% calc(100% - var(--cyber-angle-size)), calc(100% - var(--cyber-angle-size)) 100%, var(--cyber-angle-size) 100%, 0 calc(100% - var(--cyber-angle-size))); } .bubble .message-content-container::after { content: ''; position: absolute; bottom: 0; right: 0; width: 20%; height: 1px; background: linear-gradient(90deg, transparent, var(--color-cyber-accent)); opacity: 0.8; z-index: 2; } /* Common Blurred Background Containers (Less frequent updates) */ .ant-popover-inner, div[class^="InputContainer-"], div[class^="OutputContainer-"], div[class^="HistoryContainner-"], .ant-notification-notice, .ant-message-notice-content, .ant-drawer-content, .ant-modal .ant-modal-content, div[class^="AgentCardContainer-"], .ant-modal-confirm-content div[class^="AgentPrompt-"], div[class^="CardInfo-"] { border-radius: var(--list-item-border-radius) !important; background: var(--color-background-opacity) !important; box-shadow: var(--chat-customize-box-shadow) !important; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); will-change: unset; /* Optimization: Limit will-change where possible */ border: var(--cyber-line-width) solid var(--color-cyber-line-dim); overflow: hidden; position: relative; /* Needed for pseudo-elements if added later */ } /* Modal Specifics */ .ant-modal .ant-modal-content { border: 1px solid var(--color-cyber-accent); color: var(--color-text-1); will-change: transform, opacity; /* Modal might animate */ } .ant-modal .ant-modal-content::before, .ant-modal .ant-modal-content::after { display: none; /* Overriding potential shared styles if needed */ } .ant-modal-header { background-color: transparent !important; border-bottom: 1px solid var(--color-cyber-accent); border-radius: var(--list-item-border-radius) var(--list-item-border-radius) 0 0 !important; padding: 16px 24px; color: var(--color-text-1) !important; position: relative; } .ant-modal-title { color: var(--color-text-1) !important; } .ant-modal-header::after { content: ""; position: absolute; bottom: -1px; right: 0; width: 25%; height: 1px; background: linear-gradient(90deg, transparent, var(--color-cyber-accent)); } /* Agent/Card Info Specific Backgrounds */ .ant-modal-confirm-content div[class^="AgentPrompt-"], div[class^="CardInfo-"] { box-shadow: var(--chat-customize-box-shadow3) !important; /* Different shadow */ background: var(--chat-customize-collapse-background) !important; color: var(--color-text-1); } /* Menu Item / List Item / Segmented Label */ li[class^="MenuItem-"], #content-container [class^="ListItemContainer-"], .ant-segmented-group .ant-segmented-item-label { border: 0 !important; transition: all 0.2s ease; box-sizing: border-box; border-radius: var(--list-ite