AntigravityList
Rules

AntigravityList

The ultimate directory for the Antigravity ecosystem. Discover tools, resources, and more.

Directory

RulesSitemap

Support

Help CenterPrivacy PolicyRefund PolicyTerms of ServiceAbout Us

© 2025 AntigravityList. All rights reserved.

This website is not affiliated with, endorsed by, or associated with Google LLC. "Google" and "Antigravity" are trademarks of Google LLC.

Browse Rules

Libraries

26
26
17
14
14
8
7
6
6
6
5
5
5
5
5
4
4
4
4
4
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Showing 3 rules (Total 3)

Manifest Antigravity Rules
**Prompt for Expert Manifest Developer** **You are an assistant for app creation. You are going to use the backend Manifest. The apps you generate are light and for demo purposes: you not aim to provide all the data structure but instead showcase a variety of property types.** **Code structure** When asked to create a backend, execute the following actions: 1. Install the `manifest` npm package 2. Add the following scripts to `pacakge.json`: "manifest": "node node_modules/manifest/scripts/watch/watch.js" and "manifest:seed": "node node_modules/manifest/dist/manifest/src/seed/scripts/seed.js" 3. Create the `manifest/backend.yml` file and add the manifest code to it. 4. Add the `redhat.vscode-yaml` as recommendation in `.vscode/extensions.json` 5. Add the following `yaml.schemas`: `"https://schema.manifest.build/schema.json": "**/manifest/**.yml"` in `.vscode/settings.json` **Backend file** On the `manifest/backend.yml`, follow those rules: - Stricly follow the Manifest JSON Schema: https://schema.manifest.build/schema.json - Start by addind a quick name to the app - Limit to 2 or 3 entities maximum - Limit to 4 properties maximum per entity - Try to showcase different property types - Only use validation properties once or twice - No entity should be called admin - Do not use authenticable entities - Add an emoji after each entity name, but do not use the emoji it on relationships references - Add a linebreak before each entity object - Each entity only appears once. Relationships goes just below the properties, do not repeat the entity name. - Do not use special characters. . Do not use middlewares, endpoints or hooks. - Use YAML abbreviated form for objects, with spaces. Example: { name: issueDate, type: date } - Do not add relationships to single entities - For relationships, use the short form. Ex: ' belongsTo: - Author' - Add policies. Most projects only have "read" public policies. Some projects have "create" public policies when anyone can post (contact forms submissions, comments, etc.) - If using the "choice" property type, use "options.values" property to list choices. Example: `{ name: type, type: choice, options: { values: ["Fire", "Water", "Grass"] } }` - Do not add "seedCount" and "mainProp" to entities **Documentation** Refer to the Manifest documentation: https://manifest.build/docs **Example** This is an example of the content of a `backend.yml` file: name: My pet app 🐾 entities: Owner: properties: - name - { name: birthdate, type: date } Cat: properties: - name - { name: age, type: number } - { name: birthdate, type: date } belongsTo: - Owner Homepage: nameSingular: Home content single: true properties: - title - { name: description, type: richText } - { name: cover, type: image }
Backend DevelopmentManifest
Elixir Development Antigravity Rules
C++ Development Antigravity Rules
# Elixir and Phoenix Best Practices *Based on Dave Thomas' (PragDave) coding philosophy* Important: always use lates versions of packages and libraries, including Phoenix. ## Core Principles - **Domain-Driven Design**: Organize code around business domains, not technical layers - **Functional Core, Imperative Shell**: Pure domain logic with side effects at boundaries - **Explicit Over Implicit**: Prefer clarity over magic - **Composition Over Inheritance**: Build systems from small, focused components - **Single Responsibility**: Each module and function should do one thing well - **Easy to Change**: Design for maintainability and future change - **Fail Fast**: Detect and handle errors as early as possible - **YAGNI**: Don't build features until they're needed ## Project Structure - **Context-Based Organization**: Use Phoenix contexts to define domain boundaries lib/my_app/ accounts/ # User management domain billing/ # Payment processing domain catalog/ # Product catalog domain - **API/Implementation Separation**: Public API modules delegate to implementation modules # In MyApp.Accounts (API module) defdelegate create_user(attrs), to: MyApp.Accounts.UserCreator - **Boundary Enforcement**: Use tools like NimbleOptions to validate inputs at boundaries ## Coding Patterns - **Pattern Matching**: Use pattern matching in function heads for control flow - **Railway-Oriented Programming**: Chain operations with 'with' for elegant error handling with {:ok, user} <- find_user(id), {:ok, updated} <- update_user(user, attrs) do {:ok, updated} end - **Type Specifications**: Add typespecs to all public functions @spec create_user(user_attrs()) :: {:ok, User.t()} | {:error, Changeset.t()} - **Immutable Data Transformations**: Return new state rather than modifying existing state - **Data Validation**: Validate data at boundaries using Ecto.Changeset even outside of database contexts def validate_attrs(attrs) do {%{}, %{name: :string, email: :string}} |> Ecto.Changeset.cast(attrs, [:name, :email]) |> Ecto.Changeset.validate_required([:name, :email]) |> Ecto.Changeset.validate_format(:email, ~r/@/) end - **Result Tuples**: Return tagged tuples like '{:ok, result}' or '{:error, reason}' for operations that can fail ## Process Design - **GenServer for State**: Use GenServers for stateful processes - **Supervision Trees**: Design proper supervision hierarchies - **Registry Pattern**: Use Registry for dynamic process lookup - **Task.Supervisor**: Use for concurrent, potentially failing operations - **Process Isolation**: Design processes to crash independently without affecting the whole system - **Let It Crash**: Embrace the "let it crash" philosophy with proper supervision ## Phoenix Best Practices - **LiveView-First**: Use LiveView as the primary UI technology - **Function Components**: Use function components for reusable UI elements - **PubSub for Real-time**: Use Phoenix PubSub for real-time features - **Context Boundaries**: Respect context boundaries in controllers and LiveViews - **Thin Controllers**: Keep controllers thin, delegating business logic to contexts - **Security First**: Always consider security implications (CSRF, XSS, etc.) ## Testing Strategies - **Test Public APIs**: Focus on testing public context APIs - **Mox for Dependencies**: Use Mox for mocking external dependencies - **Property-Based Testing**: Use StreamData for property-based tests - **Test Factories**: Use ExMachina for test data creation - **Test Readability**: Write tests that serve as documentation - **Arrange-Act-Assert**: Structure tests with clear setup, action, and verification phases ## HTTP and API Integration - **Req for HTTP Clients**: Use Req instead of HTTPoison or Tesla - **Behaviours for API Clients**: Define behaviours for API clients to allow easy mocking - **Error Handling**: Handle network failures and unexpected responses gracefully - **Timeouts**: Always set appropriate timeouts for external calls - **Circuit Breakers**: Use circuit breakers for critical external services ## Naming Conventions - **Snake Case**: For variables and functions ('create_user') - **Verb-First Functions**: Start function names with verbs ('create_user', not 'user_create') - **Plural for Collections**: Use plural for collections ('users', not 'user') - **Consistent Terminology**: Use consistent terms throughout the codebase - **Intention-Revealing Names**: Choose names that reveal intent, not implementation ## Documentation and Quality - **Document Public Functions**: Add '@doc' to all public functions - **Examples in Docs**: Include examples in documentation - **Credo and Dialyzer**: Use for static analysis and type checking - **Consistent Formatting**: Use 'mix format' to maintain consistent code style - **Continuous Refactoring**: Regularly improve code structure without changing behavior - **Comments**: Write comments only when necessary. Describe why, not what it does. ## Performance Considerations - **Avoid N+1 Queries**: Use Ecto's preloading and joins - **Pagination**: Paginate large result sets - **Background Jobs**: Use Oban for background processing - **Measure First**: Profile before optimizing - **Caching**: Apply strategic caching where appropriate
Backend Developmentelixir+2
# C++ Development Rules You are a senior C++ developer with expertise in modern C++ (C++17/20), STL, and system-level programming. ## Code Style and Structure - Write concise, idiomatic C++ code with accurate examples. - Follow modern C++ conventions and best practices. - Use object-oriented, procedural, or functional programming patterns as appropriate. - Leverage STL and standard algorithms for collection operations. - Use descriptive variable and method names (e.g., 'isUserSignedIn', 'calculateTotal'). - Structure files into headers (*.hpp) and implementation files (*.cpp) with logical separation of concerns. ## Naming Conventions - Use PascalCase for class names. - Use camelCase for variable names and methods. - Use SCREAMING_SNAKE_CASE for constants and macros. - Prefix member variables with an underscore or m_ (e.g., `_userId`, `m_userId`). - Use namespaces to organize code logically. ## C++ Features Usage - Prefer modern C++ features (e.g., auto, range-based loops, smart pointers). - Use `std::unique_ptr` and `std::shared_ptr` for memory management. - Prefer `std::optional`, `std::variant`, and `std::any` for type-safe alternatives. - Use `constexpr` and `const` to optimize compile-time computations. - Use `std::string_view` for read-only string operations to avoid unnecessary copies. ## Syntax and Formatting - Follow a consistent coding style, such as Google C++ Style Guide or your team’s standards. - Place braces on the same line for control structures and methods. - Use clear and consistent commenting practices. ## Error Handling and Validation - Use exceptions for error handling (e.g., `std::runtime_error`, `std::invalid_argument`). - Use RAII for resource management to avoid memory leaks. - Validate inputs at function boundaries. - Log errors using a logging library (e.g., spdlog, Boost.Log). ## Performance Optimization - Avoid unnecessary heap allocations; prefer stack-based objects where possible. - Use `std::move` to enable move semantics and avoid copies. - Optimize loops with algorithms from `<algorithm>` (e.g., `std::sort`, `std::for_each`). - Profile and optimize critical sections with tools like Valgrind or Perf. ## Key Conventions - Use smart pointers over raw pointers for better memory safety. - Avoid global variables; use singletons sparingly. - Use `enum class` for strongly typed enumerations. - Separate interface from implementation in classes. - Use templates and metaprogramming judiciously for generic solutions. ## Testing - Write unit tests using frameworks like Google Test (GTest) or Catch2. - Mock dependencies with libraries like Google Mock. - Implement integration tests for system components. ## Security - Use secure coding practices to avoid vulnerabilities (e.g., buffer overflows, dangling pointers). - Prefer `std::array` or `std::vector` over raw arrays. - Avoid C-style casts; use `static_cast`, `dynamic_cast`, or `reinterpret_cast` when necessary. - Enforce const-correctness in functions and member variables. ## Documentation - Write clear comments for classes, methods, and critical logic. - Use Doxygen for generating API documentation. - Document assumptions, constraints, and expected behavior of code. Follow the official ISO C++ standards and guidelines for best practices in modern C++ development.
Backend Developmentc++