بهترین پرامپت‌های Google Antigravity برای برنامه‌نویسی

تیم پلاس‌پس · 22 دقیقه مطالعه

بهترین پرامپت های Google Antigravity برای برنامه نویسی

بهترین پرامپت‌های Google Antigravity برای برنامه‌نویسی

استفاده از Google Antigravity فقط به نوشتن چند خط کد با کمک هوش مصنوعی محدود نمی‌شود. این پلتفرم برای کار با Agentها طراحی شده و می‌تواند در توسعه قابلیت‌های جدید، بررسی کد، رفع خطا، اجرای تست و انجام وظایف پیچیده به برنامه‌نویس کمک کند.

پرامپت خوب برای Google Antigravity چه ویژگی‌هایی دارد؟

قبل از استفاده از پرامپت‌های آماده، بهتر است بدانیم چه چیزی یک دستور خوب را از یک دستور ضعیف جدا می‌کند.

به جای اینکه فقط بنویسید:

"این کد را درست کن."

بهتر است دقیقاً مشخص کنید مشکل چیست، چه محدودیت‌هایی وجود دارد و Agent در پایان چه نتیجه‌ای باید تحویل دهد.

۱. مشخص کردن هدف

ابتدا باید دقیقاً مشخص کنید از Antigravity چه می‌خواهید. هرچه هدف مشخص‌تر باشد، Agent راحت‌تر می‌تواند مسیر انجام کار را تعیین کند.

۲. توضیح وضعیت فعلی پروژه

اگر Agent قرار است روی یک پروژه موجود کار کند، بهتر است تکنولوژی‌ها، فایل‌های مرتبط و وضعیت فعلی پروژه را توضیح دهید.

۳. تعیین محدودیت‌ها

اگر نمی‌خواهید ساختار پروژه تغییر کند، کتابخانه جدیدی نصب شود یا APIهای فعلی تغییر کنند، این موارد را از ابتدا در پرامپت مشخص کنید.

پرامپت Google Antigravity برای ساخت پروژه از صفر

اگر می‌خواهید یک پروژه جدید را از ابتدا ایجاد کنید، بهتر است همه چیز را یک‌باره و بدون توضیح به Agent نسپارید. هدف پروژه، تکنولوژی مورد استفاده، ساختار مورد انتظار و نحوه تست باید مشخص باشد.

پرامپت آماده برای ساخت پروژه

I want you to create a [project type] from scratch.

Main project requirements:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]

Preferred technologies:
- Frontend: [Technology]
- Backend: [Technology]
- Database: [Database]

Before you start:
1. Analyze the project requirements.
2. Propose a suitable project structure.
3. Recommend an appropriate architecture.
4. Identify all required dependencies.
5. Ask me about any missing or ambiguous information before making major changes.

After the structure is approved:
- Create the project.
- Build a clean and logical folder structure.
- Write clean, maintainable, and well-organized code.
- Add the necessary tests.
- Run the project.
- Check for and fix any errors.

At the end, provide:
- A summary of the implemented features.
- The final project structure.
- The commands required to run the project.
- The tests that were executed.
- Any remaining issues or limitations.

توضیح ساده پرامپت ساخت پروژه

این پرامپت زمانی استفاده می‌شود که هنوز پروژه‌ای ندارید و می‌خواهید Google Antigravity آن را از ابتدا برای شما بسازد. در قسمت‌هایی که داخل کروشه قرار دارند، باید اطلاعات پروژه خودتان را بنویسید.

برای مثال، به جای [project type] می‌توانید بنویسید:

an online store

یا:

a task management web application

همچنین باید تکنولوژی‌های موردنظر خودتان را مشخص کنید؛ مثلاً React برای بخش ظاهری، Node.js برای Backend و PostgreSQL برای دیتابیس.

نکته مهم این پرامپت این است که از Agent می‌خواهد قبل از شروع کدنویسی، ابتدا ساختار و معماری پروژه را پیشنهاد دهد. این کار باعث می‌شود بدون برنامه، تعداد زیادی فایل و کد نامرتب تولید نشود. در پایان نیز Agent باید پروژه را اجرا کند، تست‌ها را انجام دهد و روش اجرای پروژه را به شما توضیح دهد.

بهترین پرامپت برای رفع باگ

یکی از کاربردهای مهم Antigravity، پیدا کردن علت اصلی خطا و اصلاح آن است. برای این کار بهتر است فقط پیام خطا را برای Agent ارسال نکنید.

پرامپت آماده برای رفع باگ

There is a software bug in this project.

Error message:
[Paste the error message here]

Expected behavior:
[Describe what should happen]

Current behavior:
[Describe what is happening now]

First, inspect the relevant code, dependencies, configuration files, and related components. Identify the root cause of the problem.

Do not simply hide the error or add a temporary workaround. Explain the actual root cause before applying a fix.

Then:
1. Propose the most appropriate solution.
2. Apply the smallest necessary change.
3. Preserve the existing behavior of unrelated parts of the application.
4. Run the relevant tests.
5. Check whether the fix introduces regressions or new errors.
6. If necessary, add a regression test for this bug.

At the end, explain:
- What caused the problem.
- Which files were changed.
- Why the selected solution is appropriate.
- Which tests were executed.
- Whether any issues remain.

توضیح ساده پرامپت رفع باگ

این پرامپت به Agent می‌گوید که فقط ظاهر خطا را پنهان نکند، بلکه علت اصلی مشکل را پیدا کند. برای استفاده از آن، پیام خطایی که دریافت کرده‌اید را در قسمت [Paste the error message here] قرار دهید.

در بخش [Describe what should happen] توضیح دهید که برنامه در حالت درست باید چه کاری انجام دهد. سپس در قسمت [Describe what is happening now] بنویسید که در حال حاضر چه اتفاقی می‌افتد.

برای مثال، اگر با کلیک روی دکمه ورود، صفحه سفید می‌شود، می‌توانید بنویسید:

  • رفتار مورد انتظار: کاربر باید وارد حساب خود شود و به داشبورد منتقل شود.
  • رفتار فعلی: بعد از کلیک روی دکمه ورود، صفحه سفید نمایش داده می‌شود.

این پرامپت از Agent می‌خواهد ابتدا فایل‌های مرتبط، تنظیمات و وابستگی‌ها را بررسی کند، سپس کمترین تغییر لازم را انجام دهد. این موضوع مهم است، چون تغییرات زیاد ممکن است بخش‌های سالم پروژه را خراب کند.

پرامپت برای ریفکتور کردن کد

اگر پروژه قدیمی یا کد شلوغی دارید، می‌توانید از Agent برای Refactor استفاده کنید. بهتر است به جای درخواست کلی برای "بهتر کردن کد"، دقیقاً مشخص کنید چه چیزی باید اصلاح شود.

پرامپت آماده برای Refactor

Review the following part of the project for code quality, readability, maintainability, and long-term scalability.

My goal is to refactor the code without changing its current behavior.

Before making any changes:
- Analyze the current structure.
- Identify duplicated code.
- Find unnecessary dependencies.
- Detect readability and maintainability issues.
- Identify possible sources of bugs.
- Check whether the current implementation follows the existing project conventions.
- Identify any risks related to changing this code.

Then, propose a step-by-step refactoring plan.

After the plan is approved:
- Apply the refactoring gradually.
- Preserve the existing behavior.
- Do not change public APIs without a clear reason.
- Do not introduce unnecessary libraries.
- Follow the existing coding style and architecture.
- Run all relevant tests.
- Add new tests if the current coverage is insufficient.

At the end, provide:
- A summary of all changes.
- The reason behind each important change.
- The tests that were executed.
- Any remaining technical debt or risks.

توضیح ساده پرامپت ریفکتور

ریفکتور یعنی بهتر کردن ساختار داخلی کد، بدون اینکه نتیجه‌ای که کاربر می‌بیند تغییر کند. برای مثال، ممکن است چند بخش از کد تکراری باشند یا یک فایل بیش از حد بزرگ و نامرتب شده باشد.

این پرامپت از Agent می‌خواهد ابتدا کد را بررسی کند و مشکلاتی مثل کدهای تکراری، وابستگی‌های اضافی و بخش‌های سخت‌خوان را پیدا کند. سپس باید قبل از تغییر، یک برنامه مرحله‌به‌مرحله پیشنهاد دهد.

این موضوع برای افراد مبتدی مهم است، چون Agent نباید بدون توضیح، کل پروژه را بازنویسی کند. بعد از تأیید برنامه، Agent باید تغییرات را کم‌کم انجام دهد و تست‌ها را اجرا کند تا مطمئن شود رفتار قبلی برنامه حفظ شده است.

پرامپت برای نوشتن تست نرم‌افزار

یکی دیگر از کاربردهای مهم Antigravity، ایجاد و اجرای تست‌های نرم‌افزاری است.

پرامپت آماده برای نوشتن تست

Analyze this project and create appropriate tests for [the name of the component, feature, function, or file].

First, infer and document the expected behavior from the existing code, project structure, documentation, and related components.

The tests must cover:
- Normal behavior.
- Valid inputs.
- Invalid inputs.
- Empty inputs.
- Null or undefined values where applicable.
- Error conditions.
- Boundary cases.
- Unexpected user behavior.
- Important integration scenarios.
- Regression cases for known bugs.

Use the testing framework and conventions already used in this project.

After creating the tests:
1. Run the test suite.
2. Review all test failures.
3. If a test fails because of a bug in the application code, identify and explain the root cause.
4. Make the tests readable, isolated, deterministic, and maintainable.
5. Avoid testing implementation details unless necessary.
6. Report the test coverage if the project supports coverage reporting.

At the end, summarize:
- The scenarios that were tested.
- The files that were created or modified.
- The test command that was used.
- Any remaining gaps in test coverage.

توضیح ساده پرامپت نوشتن تست

تست نرم‌افزار به شما کمک می‌کند مطمئن شوید کد در شرایط مختلف درست کار می‌کند. این پرامپت از Agent می‌خواهد برای یک فایل، تابع یا قابلیت مشخص، تست بنویسد.

در قسمت [the name of the component, feature, function, or file] باید نام بخشی را بنویسید که می‌خواهید تست شود. برای مثال:

the user registration function

یا:

the checkout component

Agent در این پرامپت باید حالت‌های مختلف را بررسی کند؛ مثل ورودی درست، ورودی اشتباه، ورودی خالی، خطاها و شرایط خاص. همچنین از آن خواسته می‌شود تست‌ها را اجرا کند و اگر تستی شکست خورد، مشخص کند مشکل از تست است یا از کد اصلی.

پرامپت برای ساخت رابط کاربری

برای ساخت UI با Antigravity، بهتر است علاوه بر ظاهر، ساختار صفحه و رفتار آن در دستگاه‌های مختلف را نیز مشخص کنید.

پرامپت آماده برای طراحی UI

Design and implement a professional user interface for [page or feature name] in this project.

Page goal:
[Describe the main purpose of the page]

Target users:
[Describe the target users]

Main components:
- [Component 1]
- [Component 2]
- [Component 3]

Design requirements:
- The interface must be responsive.
- It must work properly on mobile, tablet, and desktop.
- Use a clear visual hierarchy.
- Use consistent spacing, typography, colors, and component styles.
- Make reusable components whenever appropriate.
- Follow the existing design system and project conventions.
- Ensure proper loading, empty, success, and error states.
- Consider accessibility best practices.
- Use semantic HTML where applicable.
- Ensure keyboard navigation works correctly.
- Avoid unnecessary visual complexity.

Before implementation:
1. Inspect the existing project structure.
2. Review the current design system and reusable components.
3. Propose the page structure and component hierarchy.
4. Identify any missing information.

After implementation:
- Run the application.
- Inspect the page visually.
- Test the responsive layout.
- Check the main user flows.
- Fix layout and usability issues.
- Check the browser console for errors.
- Verify accessibility issues where possible.

At the end, summarize the implemented components and the main design decisions.

توضیح ساده پرامپت طراحی رابط کاربری

این پرامپت برای ساخت صفحه‌های ظاهری سایت یا اپلیکیشن استفاده می‌شود. در قسمت [page or feature name] نام صفحه را بنویسید؛ مثلاً:

a user dashboard

یا:

a product details page

در بخش هدف صفحه توضیح دهید که این صفحه چه کاری انجام می‌دهد و کاربران اصلی آن چه کسانی هستند. همچنین اجزای اصلی صفحه را مشخص کنید؛ مثلاً منوی کناری، جدول کاربران، فرم ثبت‌نام یا کارت محصول.

این پرامپت فقط از Agent نمی‌خواهد یک صفحه زیبا بسازد، بلکه از آن می‌خواهد صفحه را برای موبایل، تبلت و دسکتاپ آماده کند. همچنین باید حالت‌های مختلف مثل در حال بارگذاری، نبودن اطلاعات، موفقیت و نمایش خطا را نیز در نظر بگیرد.

پرامپت برای بررسی کل پروژه

اگر وارد یک پروژه بزرگ شده‌اید و ابتدا می‌خواهید ساختار آن را بفهمید، بهتر است قبل از هرگونه تغییر، از Agent بخواهید پروژه را تحلیل کند.

پرامپت آماده برای تحلیل پروژه

Analyze this project thoroughly and prepare a technical report about its structure and current state.

Review the following areas:
1. Folder and file structure.
2. Technologies and frameworks.
3. Application entry points.
4. Overall architecture.
5. Important dependencies.
6. Data flow and state management.
7. Authentication and authorization.
8. API endpoints and external services.
9. Database structure and data access patterns.
10. Testing setup and current test coverage.
11. Build and deployment configuration.
12. Environment variables and configuration files.
13. Error handling and logging.
14. Performance risks.
15. Security risks.
16. Technical debt and maintainability issues.

Do not modify any files at this stage.

First, only analyze the project and provide a structured report.

For each important finding, include:
- The relevant file or directory.
- The issue or observation.
- Its potential impact.
- Its priority level.
- A recommended next step.

At the end, suggest which areas should have the highest priority for future development.

توضیح ساده پرامپت تحلیل پروژه

این پرامپت برای زمانی مناسب است که یک پروژه را تازه تحویل گرفته‌اید یا هنوز نمی‌دانید فایل‌ها و بخش‌های مختلف آن چه کاری انجام می‌دهند.

با استفاده از این دستور، Agent ساختار پوشه‌ها، تکنولوژی‌ها، APIها، سیستم ورود کاربران، تست‌ها، تنظیمات انتشار و مشکلات احتمالی پروژه را بررسی می‌کند.

نکته مهم این است که در پرامپت نوشته شده فعلاً هیچ فایلی تغییر نکند. بنابراین Agent فقط گزارش می‌دهد و شما می‌توانید قبل از هر تغییری، وضعیت پروژه را بهتر بشناسید.

پرامپت برای بهینه‌سازی عملکرد پروژه

اگر برنامه کند شده است، بهتر است قبل از تغییر کد از Agent بخواهید ابتدا مشکلات Performance را پیدا کند.

پرامپت آماده برای بهینه‌سازی

Analyze this project for performance problems and identify the main bottlenecks.

Before making any changes:
- Identify slow parts of the application.
- Find expensive operations.
- Review unnecessary database queries.
- Check for inefficient API requests.
- Analyze memory usage where possible.
- Identify unnecessary renders.
- Review large bundles and unused dependencies.
- Check image and asset optimization.
- Review caching opportunities.
- Inspect network requests and loading behavior.
- Look for blocking operations and inefficient algorithms.

For each issue:
1. Explain the likely root cause.
2. Identify the relevant file or component.
3. Estimate its impact.
4. Assign a priority level.
5. Recommend an appropriate solution.

Do not make major changes yet. Start with an analysis report.

After the problems are identified and the plan is approved:
- Apply the changes step by step.
- Preserve the existing functionality.
- Measure or compare performance before and after the changes.
- Run the relevant tests.
- Check for regressions.

At the end, provide a summary of the performance improvements and any remaining bottlenecks.

توضیح ساده پرامپت بهینه‌سازی عملکرد

این پرامپت برای زمانی است که سایت یا برنامه شما کند شده است. به جای اینکه از Agent بخواهید بدون بررسی کد را تغییر دهد، ابتدا از آن می‌خواهید دلیل کندی را پیدا کند.

Agent در این دستور باید مواردی مثل Queryهای اضافی دیتابیس، درخواست‌های زیاد به سرور، فایل‌های بزرگ، Renderهای غیرضروری و مصرف حافظه را بررسی کند.

بعد از پیدا کردن مشکلات، باید میزان اهمیت هر مشکل و راه‌حل پیشنهادی را توضیح دهد. سپس شما می‌توانید برنامه تغییرات را تأیید کنید تا Agent اصلاحات را مرحله‌به‌مرحله انجام دهد.

پرامپت برای بررسی امنیت کد

قبل از انتشار یک پروژه، بررسی امنیتی می‌تواند به شناسایی مشکلات مهم کمک کند.

پرامپت آماده برای بررسی امنیت

Perform a comprehensive security review of this project.

Check the following areas:
- Authentication.
- Authorization.
- Session management.
- Password handling.
- Secret and environment variable management.
- Input validation and sanitization.
- SQL injection.
- NoSQL injection where applicable.
- Cross-site scripting (XSS).
- Cross-site request forgery (CSRF).
- Insecure direct object references.
- Unauthorized API access.
- Rate limiting.
- File upload security.
- Sensitive information exposure.
- Insecure error messages.
- Dependency vulnerabilities.
- CORS configuration.
- Security headers.
- Logging and monitoring.
- Client-side and server-side validation.

For every finding:
- Describe the potential vulnerability.
- Identify the exact file, endpoint, or component.
- Explain the possible impact.
- Assign a severity level: Critical, High, Medium, or Low.
- Provide a recommended remediation.
- Explain how the issue can be verified safely.

Do not make broad security changes without my approval.

At the end, provide a prioritized security report and clearly separate confirmed vulnerabilities from potential risks.

توضیح ساده پرامپت بررسی امنیت

این پرامپت به Agent می‌گوید پروژه را از نظر مشکلات امنیتی بررسی کند. برای مثال، بررسی کند آیا کاربران می‌توانند بدون اجازه به اطلاعات دیگران دسترسی پیدا کنند یا اطلاعات حساس در کد قرار گرفته است.

همچنین مواردی مثل SQL Injection، XSS، مدیریت رمز عبور، دسترسی APIها، فایل‌های آپلودی و وابستگی‌های آسیب‌پذیر بررسی می‌شوند.

در این پرامپت از Agent خواسته می‌شود شدت هر مشکل را مشخص کند؛ مثلاً Critical، High، Medium یا Low. همچنین باید بین مشکل قطعی و خطری که فقط احتمال آن وجود دارد تفاوت بگذارد.

بهتر است بدون بررسی گزارش Agent، تغییرات امنیتی گسترده را به‌صورت خودکار اعمال نکنید. بعضی اصلاحات امنیتی ممکن است روی ورود کاربران یا عملکرد بخش‌های دیگر اثر بگذارند.

پرامپت برای کار با چند Agent

یکی از کاربردهای مهم Antigravity، تقسیم یک پروژه بزرگ به چند وظیفه مستقل است.

پرامپت آماده برای تقسیم وظایف بین Agentها

Divide this project analysis into several independent tasks and assign each task to a specialized agent.

Agent 1:
Analyze the backend architecture, server-side code, and API endpoints.

Agent 2:
Analyze the frontend architecture, user interface, and client-side state management.

Agent 3:
Review the existing tests, identify missing coverage, and find unreliable or failing tests.

Agent 4:
Review dependencies, configuration files, authentication, and security risks.

Agent 5:
Analyze performance bottlenecks, database queries, network requests, and build output.

Each agent must focus only on its assigned area and avoid making unrelated changes.

Each agent should provide:
- A summary of its findings.
- Relevant files and locations.
- Severity or priority.
- Recommended next steps.
- Any uncertainties or assumptions.

At the end:
- Collect and compare the results from all agents.
- Remove duplicate findings.
- Resolve conflicting conclusions.
- Prioritize the most important issues.
- Prepare a final consolidated project report.

Do not make broad code changes before presenting the analysis and receiving approval.

توضیح ساده پرامپت کار با چند Agent

این پرامپت برای پروژه‌های بزرگ کاربرد دارد. به جای اینکه یک Agent همه بخش‌های پروژه را بررسی کند، وظایف بین چند Agent تقسیم می‌شود.

برای مثال، یک Agent فقط Backend را بررسی می‌کند، Agent دیگر روی Frontend تمرکز می‌کند و Agentهای دیگر تست‌ها، امنیت یا عملکرد را بررسی می‌کنند.

مزیت این روش این است که هر Agent روی یک موضوع مشخص تمرکز می‌کند و گزارش دقیق‌تری ارائه می‌دهد. در پایان نیز نتایج همه Agentها با هم ترکیب می‌شوند و مشکلات تکراری حذف می‌شوند.

پرامپت برای دیباگ و تست نهایی

گاهی کد نوشته شده، اما هنوز مشخص نیست که قابلیت موردنظر واقعاً درست کار می‌کند یا نه. در این شرایط می‌توانید از Agent بخواهید مانند یک QA Engineer عمل کند.

پرامپت آماده برای تست نهایی

Test this feature as a QA engineer.

Feature under test:
[Feature name]

Expected behavior:
[Describe the expected behavior]

Perform the following checks:
1. Inspect the related code and configuration.
2. Run the application.
3. Test the main user flows.
4. Test valid inputs.
5. Test invalid and unexpected inputs.
6. Test empty, missing, and boundary values.
7. Check loading, success, empty, and error states.
8. Check browser console and runtime errors.
9. Run automated tests where available.
10. Check the feature on different screen sizes if it has a user interface.
11. Check performance and usability issues.
12. Verify that existing features still work.

If you find a problem:
- Describe the issue clearly.
- Identify the root cause.
- Assign a severity level.
- Provide a recommended fix.
- Reproduce the issue if possible.
- Add a regression test when appropriate.

Do not declare the feature ready until the main checks have been completed successfully.

At the end, provide:
- A test summary.
- Passed and failed scenarios.
- Discovered bugs.
- Remaining risks.
- A final readiness recommendation.

توضیح ساده پرامپت تست نهایی

این پرامپت از Agent می‌خواهد مانند یک تست‌کننده نرم‌افزار، قابلیت موردنظر را بررسی کند. در قسمت [Feature name] نام قابلیت را بنویسید و در بخش رفتار مورد انتظار توضیح دهید که این قابلیت باید چه کاری انجام دهد.

Agent باید مسیرهای اصلی کاربر، ورودی‌های درست و اشتباه، حالت‌های بارگذاری و خطا، اندازه‌های مختلف صفحه و خطاهای مرورگر را بررسی کند.

در پایان، Agent باید بگوید چه تست‌هایی موفق بوده‌اند، چه مشکلاتی پیدا شده و آیا قابلیت برای انتشار آماده است یا هنوز نیاز به اصلاح دارد.

پرامپت حرفه‌ای برای توسعه یک Feature جدید

اگر می‌خواهید قابلیت جدیدی به پروژه اضافه کنید، بهتر است ابتدا ساختار پروژه و تأثیر Feature جدید را بررسی کنید.

پرامپت آماده برای ساخت Feature

I want to add the following feature to this project:

[Provide a complete description of the feature]

First, inspect the existing codebase and identify the appropriate location and architecture for implementing this feature.

Before writing code:
- Review the current project architecture.
- Identify related files, components, services, and APIs.
- Check existing dependencies and reusable utilities.
- Consider the current coding conventions.
- Identify how this feature will affect existing functionality.
- Identify possible edge cases and failure scenarios.
- Propose a step-by-step implementation plan.
- List any questions or missing requirements.

Do not make code changes until the implementation plan is clear.

After the plan is approved:
1. Implement the feature.
2. Follow the existing architecture and coding standards.
3. Reuse existing components and utilities where appropriate.
4. Add the required validation and error handling.
5. Add unit, integration, or end-to-end tests as appropriate.
6. Run the application.
7. Run the relevant test suite.
8. Fix any errors or regressions.
9. Review the final implementation for maintainability and security.

The new feature must not break existing functionality.

At the end, provide:
- A summary of the implementation.
- A list of changed and created files.
- The tests that were added and executed.
- Any assumptions made.
- Any remaining limitations or future improvements.

توضیح ساده پرامپت ساخت قابلیت جدید

این پرامپت زمانی استفاده می‌شود که می‌خواهید یک قابلیت جدید به پروژه اضافه کنید؛ مثلاً سیستم پرداخت، صفحه پروفایل، امکان جست‌وجو یا ورود با شماره موبایل.

در قسمت [Provide a complete description of the feature] باید قابلیت را با جزئیات توضیح دهید. هرچه توضیح شما دقیق‌تر باشد، Agent بهتر می‌تواند آن را پیاده‌سازی کند.

این پرامپت از Agent می‌خواهد قبل از کدنویسی، فایل‌های مرتبط و معماری پروژه را بررسی کند و یک برنامه مرحله‌به‌مرحله ارائه دهد. بعد از تأیید شما، قابلیت را پیاده‌سازی می‌کند، تست می‌نویسد و بررسی می‌کند که بخش‌های قبلی پروژه خراب نشده باشند.

چطور از این پرامپت‌ها نتیجه بهتری بگیریم؟

حتی بهترین پرامپت آماده هم اگر بدون اطلاعات کافی استفاده شود، ممکن است نتیجه مطلوبی نداشته باشد. هنگام نوشتن دستور برای Antigravity، اطلاعاتی مثل تکنولوژی پروژه، هدف دقیق، محدودیت‌ها، فایل‌های مرتبط و نتیجه مورد انتظار را مشخص کنید.

همچنین برای پروژه‌های بزرگ بهتر است وظایف پیچیده را به چند مرحله تقسیم کنید. به جای اینکه در یک دستور از Agent بخواهید کل پروژه را بررسی، بازنویسی و تست کند، ابتدا تحلیل پروژه را انجام دهید، سپس برنامه تغییرات را مشخص کنید و در مرحله بعد اجرای تغییرات را به Agent بسپارید.

یک قالب عمومی برای نوشتن پرامپت‌های Antigravity

اگر می‌خواهید برای پروژه خودتان پرامپت جدیدی بنویسید، می‌توانید از قالب زیر استفاده کنید.

قالب آماده پرامپت

Role:
You are acting as a [role] working on this project.

Objective:
[Clearly describe what you want to achieve]

Project context:
[Briefly describe the project, its purpose, and current state]

Relevant files or areas:
[List the relevant file paths, components, services, or directories]

Requirements:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]

Constraints:
- [Constraint 1]
- [Constraint 2]
- [Constraint 3]

Required process:
1. Inspect the relevant parts of the project.
2. Analyze the problem or requirement.
3. Identify assumptions and missing information.
4. Propose an implementation plan.
5. Wait for approval before making major changes.
6. Apply the changes.
7. Run the relevant tests and checks.
8. Review the final result for regressions.

Success criteria:
[Describe how we will determine that the task is complete]

At the end:
- Summarize the changes.
- List the files that were modified or created.
- Report the tests and checks that were executed.
- Mention any remaining issues, risks, or limitations.

توضیح ساده قالب عمومی پرامپت

این قالب را می‌توانید برای تقریباً هر کاری در Google Antigravity استفاده کنید. ابتدا نقش Agent را مشخص می‌کنید؛ مثلاً برنامه‌نویس Backend، متخصص امنیت یا طراح رابط کاربری.

سپس هدف خودتان را توضیح می‌دهید و اطلاعاتی درباره پروژه، فایل‌های مرتبط و محدودیت‌ها ارائه می‌کنید. در بخش مراحل انجام کار نیز مشخص می‌کنید که Agent ابتدا باید پروژه را بررسی کند، برنامه بدهد، بعد از تأیید شما تغییرات را اعمال کند و در پایان تست‌ها را اجرا کند.

قسمت Success criteria یا معیار موفقیت نیز بسیار مهم است. در این بخش باید بنویسید از کجا بفهمیم کار با موفقیت انجام شده است. برای مثال:

  • کاربر بتواند با ایمیل وارد شود.
  • تست‌های مربوط به ورود با موفقیت اجرا شوند.
  • هیچ خطایی در Console وجود نداشته باشد.
  • ظاهر صفحه در موبایل و دسکتاپ درست نمایش داده شود.

آیا استفاده از پرامپت آماده در Google Antigravity کافی است؟

خیر. پرامپت آماده فقط نقطه شروع است. برای گرفتن خروجی بهتر، باید مسئله را دقیق تعریف کنید و اطلاعات لازم درباره پروژه را در اختیار Agent قرار دهید.

در پروژه‌های بزرگ نیز بهتر است به جای یک دستور بسیار طولانی، کار را به چند Task مشخص تقسیم کنید. این روش کنترل بیشتری روی تغییرات ایجاد می‌کند و بررسی نتیجه را ساده‌تر خواهد کرد.

جمع‌بندی

Google Antigravity زمانی بیشترین کاربرد را دارد که به جای استفاده از آن به عنوان یک ابزار ساده برای تکمیل کد، از قابلیت‌های Agent محور آن برای انجام وظایف واقعی توسعه نرم‌افزار استفاده کنید.

پرامپت‌های این مقاله می‌توانند برای شروع مناسب باشند، اما بهترین نتیجه زمانی به دست می‌آید که آن‌ها را متناسب با پروژه، تکنولوژی و هدف خودتان تغییر دهید.

اگر هنوز با Google Antigravity آشنا نیستید، پیشنهاد می‌کنیم ابتدا مقاله "Antigravity گوگل چیست و چطور بخریم؟" را مطالعه کنید تا با قابلیت‌ها و نحوه تهیه آن آشنا شوید.

پس اگر به دنبال استفاده حرفه‌ای از هوش مصنوعی برای برنامه‌نویسی، توسعه پروژه‌ها، رفع باگ و انجام کارهای پیچیده نرم‌افزاری هستید، تهیه اشتراک Google Antigravity می‌تواند تجربه کامل‌تری در اختیار شما قرار دهد.

خرید اشتراک Antigravity یک ساله

سوالات متداول

آیا Google Antigravity برای رفع باگ مناسب است؟

بله، Google Antigravity می‌تواند کد را بررسی کند، علت اصلی خطا را پیدا کند و راه‌حل مناسب ارائه دهد. همچنین می‌توان از آن برای اجرای تست و بررسی نتیجه اصلاحات استفاده کرد.

بهترین پرامپت برای Google Antigravity چیست؟

بهترین پرامپت، دستوری است که هدف، شرایط پروژه، محدودیت‌ها و نتیجه مورد انتظار را به‌صورت دقیق مشخص کند. هرچه دستور واضح‌تر باشد، Agent می‌تواند خروجی دقیق‌تری ارائه دهد.

آیا می‌توان با Antigravity کد را ریفکتور کرد؟

بله، Antigravity می‌تواند کدهای شلوغ یا تکراری را بررسی و ساختار آن‌ها را بهبود دهد. بهتر است قبل از ریفکتور، محدودیت‌های پروژه و حفظ عملکرد فعلی را مشخص کنید.

آیا Google Antigravity برای ساخت پروژه از صفر مناسب است؟

بله، می‌توانید از Antigravity برای طراحی ساختار پروژه، نوشتن کد، ایجاد تست و اجرای پروژه استفاده کنید. با ارائه توضیحات دقیق درباره نیازمندی‌ها، نتیجه بهتری خواهید گرفت.

چطور یک پرامپت حرفه‌ای برای Antigravity بنویسیم؟

ابتدا هدف و نیازمندی پروژه را مشخص کنید و سپس فایل‌های مرتبط، محدودیت‌ها و نتیجه مورد انتظار را توضیح دهید. بهتر است مراحل انجام کار و معیار موفقیت را هم در پرامپت مشخص کنید.

این سرویس‌ها را ببینید

مطالب مرتبط