to-prompt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

To Prompt

转换为Prompt

Transform code, issues, or context into detailed prompts for another LLM to fix or implement.
将代码、问题或上下文转换为详细的Prompt,供其他LLM进行修复或实现。

Overview

概述

This skill helps create comprehensive, context-rich prompts for external LLM assistance. The goal is to provide all necessary context about the problem, current state, and requirements without prescribing implementation approaches. The receiving LLM decides how to implement the solution based on the context provided.
本技能用于为外部LLM协助生成内容全面、上下文丰富的Prompt。目标是提供关于问题、当前状态、需求的所有必要上下文,而不指定实现方案,由接收请求的LLM基于提供的上下文自行决定如何实现解决方案。

Core Principles

核心原则

<critical> - **MUST** explain all context comprehensively and in detail - **MUST** show code snippets only to illustrate current implementation, structure, or problem areas - **MUST NOT** include implementation suggestions, solutions, or "how to fix" instructions - **MUST NOT** show example solutions, code patterns, or step-by-step guides - **MUST** let the receiving LLM decide how to implement the solution based on the context provided - **MUST** focus on "what" (problem, requirements, current state) not "how" (implementation approach) </critical>
<critical> - **必须**全面详细地解释所有上下文 - **必须**仅在说明当前实现、结构或问题区域时展示代码片段 - **严禁**包含实现建议、解决方案或「如何修复」的指导 - **严禁**展示示例解决方案、代码模式或分步指南 - **必须**让接收请求的LLM基于提供的上下文自行决定如何实现解决方案 - **必须**聚焦于「是什么」(问题、需求、当前状态)而非「怎么做」(实现方案) </critical>

Task Type Guidance

任务类型指引

Bug Fix

Bug修复

When transforming a bug fix task, ensure the prompt includes:
  • Reproduction steps: Exact steps to reproduce the bug consistently
  • Error messages and logs: Complete error messages, stack traces, console logs, and any diagnostic output
  • Current behavior: What actually happens when the bug occurs
  • Expected behavior: What should happen instead
  • Environment context: OS, browser, Node version, dependencies versions, configuration
  • Recent changes: What changed recently that might have introduced the bug (git history, recent commits)
  • Affected code: Show the current implementation of code paths involved in the bug
  • Related components: Files, modules, or systems that interact with the buggy code
  • Regression tests: Current tests (if any) and what regression tests should be written to prevent the bug from recurring
  • Impact: Who/what is affected by this bug and severity
当转换Bug修复任务时,确保Prompt包含以下内容:
  • 复现步骤:可稳定复现Bug的准确步骤
  • 错误信息与日志:完整的错误信息、栈追踪、控制台日志以及所有诊断输出
  • 当前行为:Bug发生时实际产生的结果
  • 预期行为:期望产生的正确结果
  • 环境上下文:OS、浏览器、Node版本、依赖版本、配置信息
  • 最近变更:近期可能引入Bug的改动(git历史、最近提交记录)
  • 受影响代码:展示Bug涉及的代码路径的当前实现
  • 相关组件:与存在Bug的代码有交互的文件、模块或系统
  • 回归测试:现有测试(如有)以及需要编写的回归测试,用于避免Bug重复出现
  • 影响范围:该Bug影响的对象/范围以及严重程度

Improvement

优化

When transforming an improvement task, ensure the prompt includes:
  • Current state: Detailed description of how things work now
  • Current implementation: Code showing the existing approach
  • What needs improvement: Specific aspects that need enhancement (performance, maintainability, usability, etc.)
  • Constraints: Technical constraints, backward compatibility requirements, or limitations
  • Success criteria: How to measure if the improvement is successful
  • Related code: Files and modules that will be affected
  • Dependencies: External libraries, APIs, or systems involved
  • User impact: How users will benefit from the improvement
  • Non-goals: What should NOT be changed or improved
当转换优化任务时,确保Prompt包含以下内容:
  • 当前状态:现有功能运行逻辑的详细描述
  • 当前实现:展示现有实现方案的代码
  • 待优化点:需要增强的具体维度(性能、可维护性、易用性等)
  • 约束条件:技术约束、向后兼容要求或限制
  • 成功标准:衡量优化是否成功的指标
  • 相关代码:会受影响的文件和模块
  • 依赖项:涉及的外部库、API或系统
  • 用户影响:用户可从该优化中获得的收益
  • 非目标:不需要改动或优化的内容

Feature

功能开发

When transforming a feature task, ensure the prompt includes:
  • Requirements: Complete functional requirements and user stories
  • Current system context: How the system works now and where the feature fits
  • Integration points: Where the feature connects with existing code
  • Data models: Current data structures and what needs to be added/modified
  • API contracts: Existing APIs and what new endpoints or methods are needed
  • User flows: How users will interact with the feature
  • Edge cases: Boundary conditions and special scenarios to consider
  • Constraints: Technical, business, or design constraints
  • Dependencies: External services, libraries, or systems required
  • Testing requirements: What needs to be tested (unit, integration, E2E)
当转换功能开发任务时,确保Prompt包含以下内容:
  • 需求说明:完整的功能需求和用户故事
  • 当前系统上下文:系统现有运行逻辑以及新功能的适配位置
  • 集成点:新功能与现有代码的连接位置
  • 数据模型:现有数据结构以及需要新增/修改的内容
  • API协议:现有API以及需要新增的端点或方法
  • 用户流程:用户与该功能的交互路径
  • 边界场景:需要考虑的边界条件和特殊场景
  • 约束条件:技术、业务或设计约束
  • 依赖项:需要的外部服务、库或系统
  • 测试要求:需要测试的内容(单元测试、集成测试、E2E测试)

What NOT to Include

禁止包含的内容

  • Implementation suggestions or "how to fix" instructions
  • Example solutions or code patterns to follow
  • Step-by-step implementation guides
  • Prescribed approaches or methodologies
  • "Before/after" code examples showing solutions
  • 实现建议或「如何修复」的指导
  • 可供参考的示例解决方案或代码模式
  • 分步实现指南
  • 指定的实现方案或方法论
  • 展示解决方案的「修改前/修改后」代码示例

Usage

使用方法

When asked to transform code, issues, or context into a prompt:
  1. Gather comprehensive context: Collect all relevant information about the problem, current state, and requirements
  2. Show current code: Include code snippets to illustrate the current implementation, structure, or problem areas
  3. Describe the problem: Clearly explain what needs to be fixed, improved, or implemented
  4. Provide context: Include environment details, related components, dependencies, and constraints
  5. Avoid solutions: Do not include implementation suggestions, examples, or step-by-step guides
  6. Focus on "what": Describe the problem, requirements, and current state, not how to solve it
The resulting prompt should be comprehensive enough for another LLM to understand the full context and decide on the best implementation approach independently.
当收到将代码、问题或上下文转换为Prompt的请求时:
  1. 收集全面上下文:汇总所有与问题、当前状态、需求相关的信息
  2. 展示当前代码:包含代码片段以说明当前实现、结构或问题区域
  3. 描述问题:清晰说明需要修复、优化或实现的内容
  4. 提供上下文信息:包含环境详情、相关组件、依赖项和约束条件
  5. 避免给出解决方案:不要包含实现建议、示例或分步指南
  6. 聚焦于「是什么」:描述问题、需求和当前状态,而非如何解决问题
最终生成的Prompt应足够全面,让其他LLM能够理解完整上下文,并独立决定最优的实现方案。