ai 编程老乱动代码怎么办 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要在回答技术问题时复制粘贴 AI 生成的内容
AndrewHenry
V2EX    程序员

ai 编程老乱动代码怎么办

  •  
  •   AndrewHenry 2025 年 2 月 19 日 2794 次点击
    这是一个创建于 329 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我将一个写好的插件项目丢给 ai ,让 ai 给我完善一个功能 ai 直接把我 ui 改了
    如果项目一口气全程写完则不会发生,这似乎是 ai 编程通病?
    12 条回复    2025-02-20 16:56:15 +08:00
    coolfan
        1
    coolfan  
       2025 年 2 月 19 日
    添加提示词约束
    换别的模型
    Zy143L
        2
    Zy143L  
       2025 年 2 月 19 日 via Android
    建议局部修改+强化一下你的 prompt
    AndrewHenry
        3
    AndrewHenry  
    OP
       2025 年 2 月 19 日
    @coolfan 有提示词模板推荐吗
    radishzz
        4
    radishzz  
       2025 年 2 月 19 日
    1 、请记住,没有我的允许,不要修改我的文件!
    2 、请仔细思考,有哪些解决方案?哪个方案最合适?
    3 、请直接展示你的解决方案,并说明修改了什么?原来是什么?
    4 、给出方案后,请检查验证,方案是否存在问题?
    5 、如果没有问题,在得到我的允许后,你才能修改我的文件,切记!
    Solix
        5
    Solix  
       2025 年 2 月 19 日 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 thinking3. 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  
       2025 年 2 月 20 日
    @gaobh 太长了 chatgpt 里面塞不下
    Solix
        7
    Solix  
       2025 年 2 月 20 日 via iPhone   1
    @ZekeRuan #6 不是,加到设置里有个填提示词的地方,不是在你聊天的时候加
    Solix
        8
    Solix  
       2025 年 2 月 20 日 via iPhone
    @ZekeRuan #6 这个是 corsor 的提示词,加到设置里
    DT27
        9
    DT27  
       2025 年 2 月 20 日
    昨天试了下 officeai 助手,编辑 excel 文档时没实现我说的功能,对文档的编辑还 TM 撤销不了。。。
    jackleeforce3615
    &bsp;   10
    jackleeforce3615  
       2025 年 2 月 20 日
    填在设置里面的 Rules for AI 吗? @gaobh
    jqknono
        11
    jqknono  
       2025 年 2 月 20 日
    这是 vscode 的 github copilot 增加规则的地方: github.copilot.chat.codeGeneration.instructions

    参阅: https://code.visualstudio.com/docs/copilot/copilot-customization#_define-testgeneration-custom-instructions
    MoeDisk
        12
    MoeDisk  
       2025 年 2 月 20 日
    ChatGPT 我有一次和他说 “就单纯加新功能别 TM 改我上面之前的代码” ,就 OK 了,加约束词。
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3794 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 26ms UTC 10:35 PVG 18:35 LAX 02:35 JFK 05:35
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86