ChatGPT prompts for software development
این پرامپت برای کدنویسی، بازبینی و رفع اشکال سریعتر نوشته شده است. چیزی که از مدل میخواهد: «These software development prompts cover code writing and review, system design and architecture, testing and debugging, and the documentation and process work…»
متن پرامپت
These software development prompts cover code writing and review, system design and architecture, testing and debugging, and the documentation and process work that supports shipping. Development course modules: Create [number] sequenced modules for a beginner course on [specialty] for [audience]. For each, include the learning outcome, key skills, prerequisites, and brief rationale. Course length and constraints: [insert details]. Structure example: [Insert example] Animation ideas: Suggest [number] purposeful animations for this web application. For each, include the use case, effect, recommended technology, performance cost, fallback, and reduced-motion behavior. Range from simple CSS to justified JavaScript effects. Context: [Insert product and stack details] Software testing flow: Create a Mermaid flowchart for testing a [system type]. Cover planning, automated and manual tests, integration, security, performance, release gates, defect handling, and production monitoring. Include roles, entry and exit criteria, and assumptions. Context: [Insert architecture and release process] Development roadmap guide: Explain how to create a development roadmap for a new web application. Cover requirements, dependencies, milestones, deliverables, risks, owners, release criteria, and feedback loops. Context: [Insert scope, team, timeline, and constraints] Ideas for incorporating SOLID principles: Suggest [number] practical SOLID improvements for this [language and application type] codebase. For each, show a short before-and-after structure and explain the trade-off. Do not add abstractions without a clear benefit. Context: [Insert architecture or code]. Example: [Insert example] User authentication solutions: Recommend an authentication architecture for [application, users, and risk level]. Compare suitable options and cover account creation, MFA, sessions, recovery, authorization, threats, and implementation trade-offs. Prefer established identity providers and maintained libraries over custom implementations. Stack and constraints: [insert details] Code analysis: Explain this [language and version] code, section by section. Identify confirmed bugs, security risks, maintainability issues, and improvements, with line references. Preserve intended behavior and state assumptions. Code and context: [Insert code] Agile workshop ideas: Suggest [number] workshop topics on agile development for [audience]. For each, include the learning objective, activity, duration, and expected takeaway. Context: [Insert team challenges] Coding challenge: Suggest [number] coding challenges for [experience level] [language or role] developers. For each, include the skill tested, difficulty, requirements, constraints, and evaluation criteria. Code improvement: Review this JavaScript code for performance. Use the supplied runtime, workload, and profiling data to identify likely bottlenecks, then recommend measurable changes that preserve behavior. Distinguish performance fixes from style improvements. [insert code and context] RESTful API development: Build a [stack, e.g., Node.js and Express] API for [domain] using [versions]. Include the supplied data model, routes, persistence, validation, authentication and authorization, errors, tests, and API documentation. State setup steps and assumptions. Requirements: [insert details] Software documentation guidelines: Create guidelines and examples for documenting a REST API for [audience]. Cover overview, authentication, endpoints, parameters, schemas, errors, examples, versioning, and changelogs using [documentation format] Refactoring code snippet: Refactor this [language] code for readability and maintainability while preserving behavior. Explain each material change and avoid unnecessary abstractions. Constraints and tests: [Insert context and code] Architectural patterns and tech guidance: Recommend an architecture for [system] based on its scale, workloads, team, reliability needs, data, and deployment constraints. Compare a modular monolith and microservices before recommending patterns and technologies. State trade-offs and assumptions. Code best practices: Explain clean and maintainable coding practices for [language, application type, and team]. Prioritize the [number] practices with the greatest practical impact and include concise examples. Debug assistance: Diagnose the issue below. Rank likely causes by confidence, explain the evidence, and give a specific fix and verification step for each. Expected behavior: [details]. Actual behavior: [details]. Errors, environment, reproduction steps, and code: [insert details] Unit test generation: Write [framework and version] unit tests for this code, covering documented behavior, edge cases, and error handling. Do not invent requirements; flag unclear behavior before encoding it in a test. Code and specifications: [insert details] Code review: Review this [language and version] code. Report confirmed and potential issues by severity across correctness, security, performance, and maintainability. Include line references, reasoning, recommended fixes, and confidence. Context and code: [insert details]
چطور از این پرامپت استفاده کنم؟
این یک پرامپت در سطح «پیشرفته» از دسته برنامهنویسی و توسعه نرمافزار است. برای اینکه بهترین نتیجه را بگیری، این مسیر را دنبال کن:
۱) کپی کن. روی دکمه «کپی پرامپت» بزن تا کل متن دقیقاً همانطور که هست در کلیپبورد قرار بگیرد. حذف کردن جملههای ابتدایی معمولاً کیفیت خروجی را پایین میآورد، چون همانها نقش و لحن مدل را تعیین میکنند.
۲) در یک گفتگوی تازه بچسبان. این پرامپت را به عنوان اولین پیام یک چت جدید بفرست. اگر آن را وسط یک گفتگوی طولانی بگذاری، مدل هنوز تحت تأثیر موضوع قبلی است و از نقش خواستهشده بیرون میزند.
۳) بلافاصله بعد از آن، موضوع خودت را بنویس. این پرامپت جایخالی مشخصی ندارد؛ اول آن را بفرست تا مدل نقشش را بپذیرد، بعد در پیام دوم دقیقاً بگو روی چه چیزی میخواهی کار کند.
۴) به مدل زمینه بده. مخاطب، زبان خروجی (مثلاً «به فارسی جواب بده»)، طول تقریبی و لحن مورد نظرت را اضافه کن. بیشتر جوابهای ضعیف نتیجه نبودِ همین سه خط اضافهاند، نه ضعف خودِ پرامپت.
۵) یک بار اصلاح کن. جواب اول را نهایی فرض نکن. بنویس «این بخش را کوتاهتر کن»، «مثال واقعی اضافه کن» یا «سه نسخه متفاوت بده». دور دوم تقریباً همیشه بهتر از دور اول است.
۶) کد را قبل از اجرا بخوان. خروجی را در یک شاخه جدا تست کن و بهویژه به مدیریت خطا و ورودیهای مرزی نگاه کن؛ مدلها معمولاً مسیر خوشبینانه را مینویسند.
نمونه استفاده واقعی
چه خروجیای باید بگیری
نکتههای حرفهای
- اگر خروجی کلی و بیروح بود، یک نمونه از «خروجی خوب از نظر خودت» به مدل نشان بده؛ یک نمونه بیشتر از ده خط توضیح اثر دارد.
- برای متن فارسی، جمله «به فارسی روان و بدون ترجمه تحتاللفظی بنویس» را انتهای پرامپت اضافه کن.
- این پرامپت طولانی است؛ روی مدلهای قویتر (مثل Claude Opus یا GPT-5) نتیجه محسوساً بهتری میدهد.
- نسخه زبان و فریمورک را صریح بنویس (مثلاً «Node.js 24 و TypeScript 5») تا کد قدیمی تحویل نگیری.