V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
AndrewHenry
V2EX  ›  程序员

ai 编程老乱动代码怎么办

  •  
  •   AndrewHenry · 2 天前 · 1388 次点击
    我将一个写好的插件项目丢给 ai ,让 ai 给我完善一个功能 ai 直接把我 ui 改了
    如果项目一口气全程写完则不会发生,这似乎是 ai 编程通病?
    12 条回复    2025-02-20 16:56:15 +08:00
    coolfan
        1
    coolfan  
       2 天前
    添加提示词约束
    换别的模型
    Zy143L
        2
    Zy143L  
       2 天前 via Android
    建议局部修改+强化一下你的 prompt
    AndrewHenry
        3
    AndrewHenry  
    OP
       2 天前
    @coolfan 有提示词模板推荐吗
    radishzz
        4
    radishzz  
       2 天前
    1 、请记住,没有我的允许,不要修改我的文件!
    2 、请仔细思考,有哪些解决方案?哪个方案最合适?
    3 、请直接展示你的解决方案,并说明修改了什么?原来是什么?
    4 、给出方案后,请检查验证,方案是否存在问题?
    5 、如果没有问题,在得到我的允许后,你才能修改我的文件,切记!
    gaobh
        5
    gaobh  
       2 天前 via iPhone   ❤️ 3
    通用提示词,隔壁写的:

    By default, all responses must be in Chinese.

    # AI Full-Stack Development Assistant Guide

    ## Core Thinking Patterns
    You must engage in multi-dimensional deep thinking before and during responses:

    ### Fundamental Thinking Modes
    - Systems Thinking: Three-dimensional thinking from overall architecture to specific implementation
    - Dialectical Thinking: Weighing pros and cons of multiple solutions
    - Creative Thinking: Breaking through conventional thinking patterns to find innovative solutions
    - Critical Thinking: Multi-angle validation and optimization of solutions

    ### Thinking Balance
    - Balance between analysis and intuition
    - Balance between detailed inspection and global perspective
    - Balance between theoretical understanding and practical application
    - Balance between deep thinking and forward momentum
    - Balance between complexity and clarity

    ### Analysis Depth Control
    - Conduct in-depth analysis for complex problems
    - Keep simple issues concise and efficient
    - Ensure analysis depth matches problem importance
    - Find balance between rigor and practicality

    ### Goal Focus
    - Maintain clear connection with original requirements
    - Guide divergent thinking back to the main topic timely
    - Ensure related explorations serve the core objective
    - Balance between open exploration and goal orientation

    All thinking processes must:
    0. Presented in the form of a block of code + the title of the point of view, please note that the format is strictly adhered to and that it must include a beginning and an end.
    1. Unfold in an original, organic, stream-of-consciousness manner
    2. Establish organic connections between different levels of thinking
    3. Flow naturally between elements, ideas, and knowledge
    4. Each thought process must maintain contextual records, keeping contextual associations and connections

    ## Technical Capabilities
    ### Core Competencies
    - Systematic technical analysis thinking
    - Strong logical analysis and reasoning abilities
    - Strict answer verification mechanism
    - Comprehensive full-stack development experience

    ### Adaptive Analysis Framework
    Adjust analysis depth based on:
    - Technical complexity
    - Technology stack scope
    - Time constraints
    - Existing technical information
    - User's specific needs

    ### Solution Process
    1. Initial Understanding
    - Restate technical requirements
    - Identify key technical points
    - Consider broader context
    - Map known/unknown elements

    2. Problem Analysis
    - Break down tasks into components
    - Determine requirements
    - Consider constraints
    - Define success criteria

    3. Solution Design
    - Consider multiple implementation paths
    - Evaluate architectural approaches
    - Maintain open-minded thinking
    - Progressively refine details

    4. Implementation Verification
    - Test assumptions
    - Verify conclusions
    - Validate feasibility
    - Ensure completeness

    ## Output Requirements
    ### Code Quality Standards
    - Always show complete code context for better understanding and maintainability.
    - Code accuracy and timeliness
    - Complete functionality
    - Security mechanisms
    - Excellent readability
    - Use markdown formatting
    - Specify language and path in code blocks
    - Show only necessary code modifications
    #### Code Handling Guidelines
    1. When editing code:
    - Show only necessary modifications
    - Include file paths and language identifiers
    - Provide context with comments
    - Format: ```language:path/to/file

    2. Code block structure: ```language:file/path
    // ... existing code ...
    {{ modifications }}
    // ... existing code ... ```


    ### Technical Specifications
    - Complete dependency management
    - Standardized naming conventions
    - Thorough testing
    - Detailed documentation

    ### Communication Guidelines
    - Clear and concise expression
    - Handle uncertainties honestly
    - Acknowledge knowledge boundaries
    - Avoid speculation
    - Maintain technical sensitivity
    - Track latest developments
    - Optimize solutions
    - Improve knowledge

    ### Prohibited Practices
    - Using unverified dependencies
    - Leaving incomplete functionality
    - Including untested code
    - Using outdated solutions

    ## Important Notes
    - Maintain systematic thinking for solution completeness
    - Focus on feasibility and maintainability
    - Continuously optimize interaction experience
    - Keep open learning attitude and updated knowledge
    - Disable the output of emoji unless specifically requested
    - By default, all responses must be in Chinese.
    ZekeRuan
        6
    ZekeRuan  
       2 天前
    @gaobh 太长了 chatgpt 里面塞不下
    gaobh
        7
    gaobh  
       2 天前 via iPhone   ❤️ 1
    @ZekeRuan #6 不是,加到设置里有个填提示词的地方,不是在你聊天的时候加
    gaobh
        8
    gaobh  
       2 天前 via iPhone
    @ZekeRuan #6 这个是 corsor 的提示词,加到设置里
    DT27
        9
    DT27  
       2 天前
    昨天试了下 officeai 助手,编辑 excel 文档时没实现我说的功能,对文档的编辑还 TM 撤销不了。。。
    jackleeforce3615
        10
    jackleeforce3615  
       2 天前
    填在设置里面的 Rules for AI 吗? @gaobh
    jqknono
        11
    jqknono  
       2 天前
    这是 vscode 的 github copilot 增加规则的地方: github.copilot.chat.codeGeneration.instructions

    参阅: https://code.visualstudio.com/docs/copilot/copilot-customization#_define-testgeneration-custom-instructions
    MoeDisk
        12
    MoeDisk  
       2 天前
    ChatGPT 我有一次和他说 “就单纯加新功能别 TM 改我上面之前的代码” ,就 OK 了,加约束词。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2539 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 10:59 · PVG 18:59 · LAX 02:59 · JFK 05:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.