### Quick Start Example in Bash and Python Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/docs-engineer/references/sharp_edges.md This snippet provides a basic 'Quick Start' guide for a library, including installation instructions via pip and a simple Python script to get a user started immediately. The bash command installs the `memory-service` package, and the Python code demonstrates creating an `Agent` and remembering a message. This approach aims for immediate user success and progressive disclosure of information. ```bash pip install memory-service ``` ```python from mind import Agent agent = Agent("my-agent") await agent.remember("Hello, world!") ``` -------------------------------- ### Quick Start Usage Example (JavaScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/documentation-that-slaps/references/patterns.md A basic JavaScript code snippet demonstrating how to import and use a function from an installed package, suitable for README quick start sections. ```javascript import { thing } from 'your-package'; thing.doAwesome(); // → magic happens ``` -------------------------------- ### Quick Start Installation (Bash) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/documentation-that-slaps/references/patterns.md A simple bash command to install a package using npm, commonly used in README quick start guides. ```bash npm install your-package ``` -------------------------------- ### README Structure Example (Bash, TypeScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/technical-writer/references/patterns.md Demonstrates a README structure designed for actual reader behavior, starting with a concise title and one-liner, followed by a quick start guide, common use cases, and reference material. Includes examples for npm installation and basic TypeScript usage. ```bash npm install paymentflow ``` ```typescript import { PaymentFlow } from 'paymentflow'; const pf = new PaymentFlow({ apiKey: process.env.STRIPE_KEY }); await pf.charge({ amount: 1000, currency: 'usd' }); ``` -------------------------------- ### Structuring Setup Instructions in Markdown Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/technical-writer/references/sharp_edges.md This Markdown snippet illustrates a method for providing detailed setup instructions for first-time users and a concise reference for subsequent uses. It guides users to create a configuration file and includes a placeholder for the actual code. ```markdown ## First time: Full setup 1. Create config file at `src/config/auth.ts` 2. Add the following code: [...] ## After first time: Quick reference Authentication config is in `src/config/auth.ts` ``` -------------------------------- ### README Structure Example Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/docs-engineer/references/patterns.md An example of a well-structured README file for a project. It includes sections for project name, description, quick start, installation, basic usage, documentation links, and license. This pattern is useful for onboarding new users and contributors. ```bash # Project Name One-sentence description of what this does and why you'd use it. ## Quick Start ```bash # Installation pip install memory-service # Basic usage from mind import Memory memory = Memory("Your memory content") await memory.save() ``` ## Why Memory Service? - **Semantic retrieval**: Find memories by meaning, not keywords - **Automatic consolidation**: Long-term memory without manual curation - **Privacy-first**: Your memories stay yours ## Installation ```bash pip install memory-service # With optional vector support pip install memory-service[vectors] ``` ## Basic Usage ```python from mind import Agent, Memory # Create an agent agent = Agent("my-agent") # Store a memory memory = await agent.remember( "User prefers dark mode", salience=0.8 ) # Retrieve relevant memories memories = await agent.recall("user preferences") ``` ## Documentation - [Full Documentation](https://docs.memory-service.io) - [API Reference](https://docs.memory-service.io/api) - [Tutorials](https://docs.memory-service.io/tutorials) - [Contributing](./CONTRIBUTING.md) ## License MIT - see [LICENSE](./LICENSE) ``` -------------------------------- ### LLMUnity Basic Setup in Unity Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/unity-llm-integration/references/patterns.md Demonstrates the standard configuration for LLMUnity in Unity projects. It covers installing the package, setting up GameObjects, and basic inspector configuration for LLM and LLMCharacter components. This is suitable for starting new Unity projects with LLM features. ```csharp using LLMUnity; public class LLMManager : MonoBehaviour { public LLM llm; public LLMCharacter character; void Start() { // LLM and LLMCharacter are set up in Inspector // Model downloaded via LLM Model Manager window } public async void GetResponse(string playerInput) { // Non-blocking call string response = await character.Chat(playerInput); Debug.Log($"NPC says: {response}"); } } ``` -------------------------------- ### Avoid Tutorial Jail: Start Core Gameplay Quickly (JavaScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/player-onboarding/references/sharp_edges.md This JavaScript example demonstrates a 'WRONG' approach to game start with a lengthy tutorial sequence and a 'RIGHT' approach that drops the player into action immediately and sprinkles teaching throughout the early game. It highlights the importance of quick access to the core gameplay loop to reduce player drop-off. ```javascript function gameStartWrong() { this.playIntroVideo(); // 2 min this.showStoryExposition(); // 3 min this.teachMovement(); // 2 min this.teachCombat(); // 3 min this.teachInventory(); // 2 min this.startRealGame(); // Player left 10 minutes ago } function gameStartRight() { // Player playing in 10 seconds this.dropPlayerIntoAction(); // Teach ONE thing (movement) // Then let them play for 60 seconds // Teach next thing when they need it // Sprinkle teaching across first 30 minutes } ``` -------------------------------- ### Tutorial Structure Example Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/docs-engineer/references/patterns.md A template for creating effective step-by-step tutorials. This structure includes a clear title, learning objectives, prerequisites, estimated time, and numbered steps with code examples. It's designed to guide users through a process logically. ```bash # Building Your First Memory Agent By the end of this tutorial, you'll have a working agent that remembers context across conversations. **Time**: 15 minutes **Prerequisites**: Python 3.10+, pip **You'll learn**: - How to create an agent - How to store and retrieve memories - How to use semantic search ## Step 1: Install Memory Service ```bash pip install memory-service ``` Verify installation: ```bash python -c "import mind; print(mind.__version__)" # Should print: 5.0.0 ``` ## Step 2: Create Your First Agent ``` -------------------------------- ### Provide Few-Shot Examples in System Prompt for Tool Use Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/llm-architect/references/sharp_edges.md This snippet demonstrates providing few-shot examples directly in the system prompt to guide LLM tool usage. It shows how to format examples for the 'search_products' tool, illustrating desired input and corresponding tool calls for different user queries. ```text SYSTEM = """When searching products: User: \"Find me cheap laptops\" Tool call: search_products(query=\"laptop\", price_max=500, sort_by=\"price\") User: \"Best rated headphones\" Tool call: search_products(query=\"headphones\", sort_by=\"rating\", sort_order=\"desc\") """ ``` -------------------------------- ### Project Setup: Initialize Prisma Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/prisma/references/patterns.md Sets up Prisma in a new project by installing necessary packages and initializing Prisma. This generates the schema file and .env file for database configuration. ```bash # Install Prisma npm install prisma --save-dev npm install @prisma/client # Initialize Prisma npx prisma init # Generated files: # prisma/schema.prisma - Schema file # .env - Database URL ``` ```prisma generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" // or mysql, sqlite, sqlserver, mongodb url = env("DATABASE_URL") } ``` ```env DATABASE_URL="postgresql://user:password@localhost:5432/mydb?schema=public" ``` ```prisma # For PlanetScale (MySQL) DATABASE_URL="mysql://user:password@host/db?sslaccept=strict" # Add to schema: datasource db { provider = "mysql" url = env("DATABASE_URL") relationMode = "prisma" // For PlanetScale } ``` ```env # For Neon (PostgreSQL serverless) DATABASE_URL="postgresql://user:password@host/db?sslmode=require" ``` -------------------------------- ### Gameplay Ability System (GAS) Setup Example (C++) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/unreal-engine/references/patterns.md Provides a basic C++ setup for the Gameplay Ability System (GAS) in Unreal Engine. GAS is used for complex ability and skill systems, supporting features like prediction and replication. This snippet shows the essential UAbilitySystemComponent that needs to be added to a character. ```cpp // 1. AbilitySystemComponent on your character UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Abilities") UAbilitySystemComponent* AbilitySystemComponent; ``` -------------------------------- ### Unreal Engine Network Replication Setup Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/unreal-engine/references/patterns.md Illustrates setting up network replication for an actor, including replicated properties with RepNotify, server RPCs, client RPCs, and multicast RPCs. It also shows how to define replicated properties using DOREPLIFETIME. ```cpp // Header UCLASS() class MYGAME_API AMyWeapon : public AActor { GENERATED_BODY() public: // Replicated property with RepNotify UPROPERTY(ReplicatedUsing = OnRep_AmmoCount) int32 AmmoCount; UFUNCTION() void OnRep_AmmoCount(); // Server RPC - client requests, server executes UFUNCTION(Server, Reliable, WithValidation) void Server_Fire(FVector_NetQuantize TargetLocation); // Client RPC - server tells specific client UFUNCTION(Client, Reliable) void Client_PlayHitMarker(); // Multicast RPC - server tells all clients UFUNCTION(NetMulticast, Unreliable) void Multicast_PlayFireEffect(); virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; }; // Implementation void AMyWeapon::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const { Super::GetLifetimeReplicatedProps(OutLifetimeProps); DOREPLIFETIME(AMyWeapon, AmmoCount); // Or with conditions: DOREPLIFETIME_CONDITION(AMyWeapon, AmmoCount, COND_OwnerOnly); } void AMyWeapon::Fire() { if (!HasAuthority()) { // Client - request server to fire } } ``` -------------------------------- ### Clearly List Hidden Prerequisites Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/dev-communications/references/patterns.md Tutorials should not fail due to undocumented setup requirements. Always lead with a complete checklist of prerequisites, including software versions, running services, and necessary environment variables. ```text Lead with complete requirements checklist: - Node.js 18+ - PostgreSQL running locally - Environment variables: API_KEY, DATABASE_URL ``` -------------------------------- ### Fetch Organization-Scoped Data with Clerk and Prisma Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/clerk-auth/references/patterns.md This example demonstrates fetching data scoped to a specific organization using Clerk's `auth()` function to get the `orgId` and Prisma for database queries. It ensures that only data belonging to the current organization is retrieved. Requires `@clerk/nextjs/server` and a Prisma setup. ```javascript // Org-scoped data access // app/dashboard/page.tsx import { auth } from '@clerk/nextjs/server'; import { prisma } from '@/lib/prisma'; import { redirect } from 'next/navigation'; export default async function DashboardPage() { const { orgId } = await auth(); if (!orgId) { redirect('/select-org'); } // Fetch org-scoped data const projects = await prisma.project.findMany({ where: { organizationId: orgId }, }); return (

Projects

{projects.map((p) => (
{p.name}
))}
); } ``` -------------------------------- ### Development Builds with Native Modules in Expo Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/expo/references/patterns.md Guides on using native modules in Expo applications by creating development builds. This is necessary when Expo Go lacks required native libraries. It covers installing modules, configuring `app.json` with plugins, building the development client, and starting the development server. ```bash # Install native module npx expo install expo-camera # Some libraries need config plugins npx expo install react-native-ble-plx ``` ```json # app.json with config plugins { "expo": { "plugins": [ "expo-camera", [ "react-native-ble-plx", { "isBackgroundEnabled": true, "modes": ["peripheral", "central"] } ], [ "expo-build-properties", { "ios": { "deploymentTarget": "15.0" }, "android": { "compileSdkVersion": 34 } } ] ] } } ``` ```bash # Build development client eas build --platform ios --profile development # Or for simulator eas build --platform ios --profile development --local # Start dev server npx expo start --dev-client ``` ```javascript // plugins/with-custom-config.js const { withAppDelegate } = require("expo-build-properties"); module.exports = function withCustomConfig(config) { return withAppDelegate(config, async (config) => { // Modify native code return config; }); }; ``` -------------------------------- ### Context Window Management Examples (C# and JavaScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/llm-game-development/references/patterns.md Shows different strategies for managing the LLM's context window. It provides examples for minimal context (focused on a single file), medium context (integrating multiple components), and full context (for architectural reviews). It also includes a specific example for debugging with error messages and surrounding code. ```csharp // Minimal context (fast, focused): const prompt = ` Fix the jump bug in this PlayerController: ```csharp ${currentFile} ``` Bug: Player can jump mid-air. ` ``` ```csharp // Medium context (for integration): const prompt = ` Add enemy spawning to this game. Current game structure: - GameManager.cs: ${summaryOfGameManager} - Player.cs: Has TakeDamage(int amount) method - Enemy.cs: ${fullEnemyCode} Spawn enemies from points marked with "SpawnPoint" tag. ` ``` ```csharp // Full context (for architecture): const prompt = ` Review my game's architecture and suggest improvements. File structure: ${fileTree} Key files: GameManager.cs: ${gameManagerCode} Player.cs: ${playerCode} [... other relevant files ...] ` ``` ```csharp // IMPORTANT: Always include error messages in full const debugPrompt = ` Getting this error: ``` ${fullErrorWithStackTrace} ``` In this code: ``` ${codeAroundError} ``` ` ``` -------------------------------- ### Monitor Lambda Cold Starts (JavaScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/aws-serverless/references/sharp_edges.md A JavaScript example for tracking cold starts in Lambda functions using a custom metric. This helps in monitoring the frequency of cold starts and understanding their impact. ```javascript // Track cold starts with custom metric let isColdStart = true; exports.handler = async (event) => { if (isColdStart) { console.log('COLD_START'); // CloudWatch custom metric here isColdStart = false; } // ... ``` -------------------------------- ### Set Up and Use Firebase Emulators for Development Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/firebase/references/sharp_edges.md Provides instructions and code examples for setting up and using Firebase emulators to test applications locally. This prevents accidental data loss in production environments and enables offline development. It covers installing the Firebase CLI, initializing emulators, starting them, and connecting to them from client-side code and tests. ```bash # Install Firebase CLI npm install -g firebase-tools # Initialize emulators firebase init emulators # Start emulators firebase emulators:start ``` ```javascript // Connect to emulators in development import { connectFirestoreEmulator } from 'firebase/firestore'; import { connectAuthEmulator } from 'firebase/auth'; if (process.env.NODE_ENV === 'development') { connectFirestoreEmulator(db, 'localhost', 8080); connectAuthEmulator(auth, 'http://localhost:9099'); } ``` ```javascript // In tests import { initializeTestEnvironment } from '@firebase/rules-unit-testing'; const testEnv = await initializeTestEnvironment({ projectId: 'test-project', firestore: { rules: fs.readFileSync('firestore.rules', 'utf8') } }); // Clean up after tests await testEnv.clearFirestore(); ``` -------------------------------- ### Install Design System Package (Bash) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/design-systems/references/sharp_edges.md Demonstrates the 'good' approach to installing a design system, emphasizing a single package installation with zero configuration, contrasting with the 'bad' approach requiring multiple dependencies and complex setup. ```bash npm install @acme/design-system ``` -------------------------------- ### Initialize Game Quickly: Avoid Unskippable Intros Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/player-onboarding/references/sharp_edges.md This pattern focuses on starting the game immediately upon player input, avoiding any unskippable logos, cutscenes, or 'press any key' screens. The goal is to achieve a 'time to first input' of under 5 seconds to maximize player retention. ```javascript class GameStart { constructor() { // NO unskippable logos // NO unskippable cutscenes // NO "press any key to start" screens // Player mashing buttons from splash screen? // Catch that input and START THE GAME. this.timeToFirstInput = 0 this.targetTime = 5 // seconds // If story is important, tell it DURING gameplay // Voice over while running // Environmental storytelling // Dialog during downtime } // Start with action, explain later // "In medias res" - drop into the middle of things } ``` -------------------------------- ### Python Bolt App: Basic Setup and Message Handling Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/slack-bot-builder/references/patterns.md This Python snippet demonstrates the basic setup of a Bolt app, including token initialization, message event handling for 'hello', and responding to users. It requires the 'slack_bolt' library and environment variables for SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET. ```python from slack_bolt import App from slack_bolt.adapter.socket_mode import SocketModeHandler import os # Initialize with tokens from environment app = App( token=os.environ["SLACK_BOT_TOKEN"], signing_secret=os.environ["SLACK_SIGNING_SECRET"] ) # Handle messages containing "hello" @app.message("hello") def handle_hello(message, say): """Respond to messages containing 'hello'.""" user = message["user"] say(f"Hey there <@{user}>!") # To run this app, you would typically add: # if __name__ == "__main__": # SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start() ``` -------------------------------- ### Curse of Knowledge - Good Documentation Example (Bash, TypeScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/technical-writer/references/patterns.md Illustrates how to overcome the curse of knowledge in documentation by providing clear, actionable steps for someone unfamiliar with the codebase. Includes examples for installing a package and configuring middleware. ```bash npm install @app/auth ``` ```typescript import { authMiddleware } from '@app/auth'; app.use(authMiddleware({ providers: ['google', 'github'], secret: process.env.AUTH_SECRET, })); ``` -------------------------------- ### Unreal Engine Enhanced Input System Setup Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/unreal-engine/references/patterns.md Demonstrates how to set up and bind input actions using Unreal Engine's Enhanced Input System. It involves creating Input Action and Input Mapping Context assets and binding them in the PlayerController or Character. ```cpp void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); if (UEnhancedInputComponent* EnhancedInput = Cast(PlayerInputComponent)) { // Bind actions EnhancedInput->BindAction(IA_Move, ETriggerEvent::Triggered, this, &AMyCharacter::Move); EnhancedInput->BindAction(IA_Look, ETriggerEvent::Triggered, this, &AMyCharacter::Look); EnhancedInput->BindAction(IA_Jump, ETriggerEvent::Started, this, &AMyCharacter::StartJump); EnhancedInput->BindAction(IA_Jump, ETriggerEvent::Completed, this, &AMyCharacter::StopJump); } // Add mapping context if (APlayerController* PC = Cast(GetController())) { if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem(PC->GetLocalPlayer())) { Subsystem->AddMappingContext(DefaultMappingContext, 0); } } } void AMyCharacter::Move(const FInputActionValue& Value) { FVector2D MovementVector = Value.Get(); // Apply movement } ``` -------------------------------- ### Handle Neon Database Cold Starts with Retries in Application Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/neon-postgres/references/patterns.md This code example demonstrates a strategy for handling cold start latency in applications connecting to Neon Database. It implements a `queryWithRetry` function that automatically retries database queries upon encountering specific connection errors (P1001, P1002), which are common during cold starts. ```typescript // lib/db-with-retry.ts import { prisma } from './prisma'; const MAX_RETRIES = 3; const RETRY_DELAY = 1000; export async function queryWithRetry( query: () => Promise ): Promise { let lastError: Error | undefined; for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) { try { return await query(); } catch (error) { lastError = error as Error; // Retry on connection errors (cold start) if (error.code === 'P1001' || error.code === 'P1002') { console.log(`Retry attempt ${attempt}/${MAX_RETRIES}`); await new Promise(r => setTimeout(r, RETRY_DELAY * attempt)); continue; } throw error; } } throw lastError; } // Usage const users = await queryWithRetry(() => prisma.user.findMany() ); ``` -------------------------------- ### Code First Documentation Example (TypeScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/dev-communications/references/patterns.md Demonstrates the 'Code First Documentation' pattern by presenting a working code example before the explanation. This approach helps developers quickly grasp the functionality. It requires an SDK package like '@your/sdk' and environment variables for API keys. ```typescript import { createClient } from '@your/sdk'; const client = createClient({ apiKey: process.env.API_KEY }); const result = await client.users.create({ email: 'user@example.com' }); // Now explain: This creates an authenticated client... ``` -------------------------------- ### Enhance Tool Descriptions with Examples Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/llm-architect/references/sharp_edges.md This Python snippet shows how to improve LLM tool usage by including concrete examples within the tool's description. It defines a 'search_products' tool with a schema and provides multiple usage examples, along with important conventions, to guide the LLM in calling the tool correctly. ```python tools = [{ "name": "search_products", "description": """Search for products in the catalog. EXAMPLES: - Simple search: {"query": "red shoes", "limit": 10} - With filters: {"query": "laptop", "category": "electronics", "price_max": 1000} - Sort by rating: {"query": "headphones", "sort_by": "rating", "sort_order": "desc"} IMPORTANT: - Always include 'limit' (default 10, max 100) - Use 'category' to narrow results when user mentions a category - 'price_min' and 'price_max' should be used together """, "input_schema": { "type": "object", "properties": { "query": {"type": "string"}, "category": {"type": "string"}, "limit": {"type": "integer", "default": 10}, "price_min": {"type": "number"}, "price_max": {"type": "number"}, "sort_by": {"type": "string", "enum": ["relevance", "price", "rating"]}, "sort_order": {"type": "string", "enum": ["asc", "desc"]} }, "required": ["query"] } }] ``` -------------------------------- ### Starting Ugly: Iterative Tool Development (Text) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/personal-tool-builder/references/patterns.md This outlines a phased approach to building personal tools, starting with a minimal viable script and progressively adding robustness, features, and user-friendliness over time. It emphasizes starting with a functional script for personal use before considering broader audiences. ```text Day 1: Script that solves YOUR problem - No UI, just works - Hardcoded paths, your data - Zero error handling - You understand every line Week 1: Script that works reliably - Handle your edge cases - Add the features YOU need - Still ugly, but robust Month 1: Tool that might help others - Basic docs (for future you) - Config instead of hardcoding - Consider sharing ``` -------------------------------- ### Large Dependencies Anti-Pattern Example Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/aws-serverless/references/patterns.md Demonstrates the anti-pattern of importing the entire AWS SDK v2, which increases deployment package size and cold start times. The good example shows importing only necessary clients from SDK v3. ```javascript // Imports entire AWS SDK v2 const AWS = require('aws-sdk'); const dynamodb = new AWS.DynamoDB.DocumentClient(); ``` ```javascript // Import only needed clients from SDK v3 const { DynamoDBClient } = require('@aws-sdk/client-dynamodb'); const { DynamoDBDocumentClient } = require('@aws-sdk/lib-dynamodb'); ``` -------------------------------- ### Database Branching with Neon CLI and GitHub Actions Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/neon-postgres/references/patterns.md This section demonstrates how to create, manage, and utilize database branches for development and CI/CD workflows. It includes examples using the Neon CLI for branch operations and a GitHub Actions workflow for automated branch creation and deployment. ```bash # Create branch via Neon CLI neon branches create --name feature/new-feature --parent main # Create branch from specific point in time neon branches create --name debug/yesterday \ --parent main \ --timestamp "2024-01-15T10:00:00Z" # List branches neon branches list # Get connection string for branch neon connection-string feature/new-feature # Delete branch when done neon branches delete feature/new-feature ``` ```yaml // In CI/CD (GitHub Actions) // .github/workflows/preview.yml name: Preview Environment on: pull_request: types: [opened, synchronize] jobs: create-branch: runs-on: ubuntu-latest steps: - uses: neondatabase/create-branch-action@v5 id: create-branch with: project_id: ${{ secrets.NEON_PROJECT_ID }} branch_name: preview/pr-${{ github.event.pull_request.number }} api_key: ${{ secrets.NEON_API_KEY }} username: ${{ secrets.NEON_ROLE_NAME }} - name: Run migrations env: DATABASE_URL: ${{ steps.create-branch.outputs.db_url_with_pooler }} run: npx prisma migrate deploy - name: Deploy to Vercel env: DATABASE_URL: ${{ steps.create-branch.outputs.db_url_with_pooler }} run: vercel deploy --prebuilt // Cleanup on PR close on: pull_request: types: [closed] jobs: delete-branch: runs-on: ubuntu-latest ``` -------------------------------- ### Funnel Tracking with Entry Points - JavaScript Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/analytics-architecture/references/patterns.md This pattern describes how to track conversion funnels, including capturing the entry point for each user. This provides deeper insights into where users originate from before starting a conversion process. The example shows tracking the start of a signup funnel with entry point and UTM parameters. ```javascript // Track where users entered funnel track('signup_started', { entry_point: 'hero_cta' | 'pricing_page' | 'blog_post', source: utm_source, medium: utm_medium }); track('signup_step_completed', { step: 2, method: 'email' }); track('signup_completed', { plan: 'pro' }); ``` -------------------------------- ### Execute README Code Examples with npm Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/technical-writer/references/patterns.md This command-line instruction shows how to run tests specifically designed to extract and execute code blocks found within README files. This is crucial for ensuring that examples in project documentation are up-to-date and functional. ```bash npm run test:examples # Extract and run README code blocks ``` -------------------------------- ### Schedule Temporal Cron Workflow Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/workflow-automation/references/patterns.md Initiates a Temporal workflow to run on a cron schedule. This example demonstrates how to start the `dailyReportWorkflow` to execute daily at 9 AM. ```typescript // Schedule workflow to run on cron const handle = await client.workflow.start(dailyReportWorkflow, { taskQueue: 'reports', workflowId: 'daily-report', cronSchedule: '0 9 * * *', // 9 AM daily }); ``` -------------------------------- ### Example-First Documentation Principle (JavaScript) Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/documentation-that-slaps/references/patterns.md Illustrates the 'example-first' documentation principle by showing a practical JavaScript code snippet for authentication before providing a textual explanation. ```javascript const session = await authenticate({ username: 'dev@example.com', password: 'hunter2' }); // session.token → 'eyJhbGc...' ``` -------------------------------- ### Test Isolation Setup Example Source: https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/qa-engineering/references/patterns.md Illustrates the Test Isolation pattern, ensuring each test operates independently by creating its own data and cleaning up afterward. This is crucial for tests sharing resources like databases, preventing order-dependent failures and enabling parallel execution. It uses `beforeEach` and `afterEach` hooks for setup and teardown. ```javascript beforeEach(async () => { // Create fresh data for this test testUser = await createTestUser({ email: `test-${uuid()}@test.com` }) }) afterEach(async () => { // Clean up test data await cleanupTestUser(testUser.id) }) // Tests can run in any order, in parallel ``` -------------------------------- ### Install Skills for a Specific Project using Bash Source: https://context7.com/omer-metin/skills-for-antigravity/llms.txt This bash script demonstrates how to set up skills for a particular project by creating a project-specific skills directory and copying only the necessary skills. This is useful for managing project dependencies and reducing overhead. ```bash # Create project skills directory if it doesn't exist mkdir -p .agent/skills/ # Copy specific skills you need cp -r skills-library-antigravity/skills/nextjs-app-router .agent/skills/ cp -r skills-library-antigravity/skills/ai-code-generation .agent/skills/ cp -r skills-library-antigravity/skills/typescript .agent/skills/ ```