Google Antigravity Directory

The #1 directory for Google Antigravity prompts, rules, workflows & MCP servers. Optimized for Gemini 3 agentic development.

Resources

PromptsMCP ServersAntigravity RulesGEMINI.md GuideBest Practices

Company

Submit PromptAntigravityAI.directory

Popular Prompts

Next.js 14 App RouterReact TypeScriptTypeScript AdvancedFastAPI GuideDocker Best Practices

Legal

Privacy PolicyTerms of ServiceContact Us
Featured on FazierVerified on Verified ToolsFeatured on WayfindioAntigravity AI - Featured on Startup FameFeatured on Wired BusinessFeatured on Twelve ToolsListed on Turbo0Featured on findly.toolsFeatured on Aura++That App ShowFeatured on FazierVerified on Verified ToolsFeatured on WayfindioAntigravity AI - Featured on Startup FameFeatured on Wired BusinessFeatured on Twelve ToolsListed on Turbo0Featured on findly.toolsFeatured on Aura++That App Show

© 2026 Antigravity AI Directory. All rights reserved.

The #1 directory for Google Antigravity IDE

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

Antigravity AI Directory
PromptsMCPBest PracticesUse CasesLearn
Home
Prompts
Deno Runtime Development Patterns

Deno Runtime Development Patterns

Build modern server applications with Deno, Oak framework, and native TypeScript in Google Antigravity

DenoTypeScriptBackendRuntimeFresh
by Antigravity Team
⭐0Stars
👁️1Views
.antigravity
# Deno Runtime Development for Google Antigravity

Deno provides a secure runtime with native TypeScript support. This guide covers patterns optimized for Google Antigravity IDE and Gemini 3.

## Oak Server Setup

```typescript
// main.ts
import { Application, Router, Context } from 'https://deno.land/x/oak@v12.6.1/mod.ts';
import { oakCors } from 'https://deno.land/x/cors@v1.2.2/mod.ts';

const router = new Router();

// Middleware for logging
const logger = async (ctx: Context, next: () => Promise<unknown>) => {
  const start = Date.now();
  await next();
  const ms = Date.now() - start;
  console.log(`${ctx.request.method} ${ctx.request.url.pathname} - ${ms}ms`);
};

// Routes
router.get('/api/health', (ctx) => {
  ctx.response.body = { status: 'ok', timestamp: new Date().toISOString() };
});

router.get('/api/users', async (ctx) => {
  const users = await getUsers();
  ctx.response.body = users;
});

router.post('/api/users', async (ctx) => {
  const body = await ctx.request.body().value;
  const user = await createUser(body);
  ctx.response.status = 201;
  ctx.response.body = user;
});

router.get('/api/users/:id', async (ctx) => {
  const user = await getUser(ctx.params.id);
  if (!user) {
    ctx.response.status = 404;
    ctx.response.body = { error: 'User not found' };
    return;
  }
  ctx.response.body = user;
});

const app = new Application();
app.use(oakCors());
app.use(logger);
app.use(router.routes());
app.use(router.allowedMethods());

console.log('Server running on http://localhost:8000');
await app.listen({ port: 8000 });
```

## Database with Deno KV

```typescript
// db/kv.ts
const kv = await Deno.openKv();

interface User {
  id: string;
  email: string;
  name: string;
  createdAt: Date;
}

export async function createUser(data: Omit<User, 'id' | 'createdAt'>): Promise<User> {
  const id = crypto.randomUUID();
  const user: User = { ...data, id, createdAt: new Date() };
  
  await kv.atomic()
    .check({ key: ['users', id], versionstamp: null })
    .check({ key: ['users_by_email', data.email], versionstamp: null })
    .set(['users', id], user)
    .set(['users_by_email', data.email], id)
    .commit();
  
  return user;
}

export async function getUser(id: string): Promise<User | null> {
  const result = await kv.get<User>(['users', id]);
  return result.value;
}

export async function getUsers(): Promise<User[]> {
  const users: User[] = [];
  for await (const entry of kv.list<User>({ prefix: ['users'] })) {
    users.push(entry.value);
  }
  return users;
}

export async function getUserByEmail(email: string): Promise<User | null> {
  const idResult = await kv.get<string>(['users_by_email', email]);
  if (!idResult.value) return null;
  return getUser(idResult.value);
}

export async function deleteUser(id: string): Promise<boolean> {
  const user = await getUser(id);
  if (!user) return false;
  
  await kv.atomic()
    .delete(['users', id])
    .delete(['users_by_email', user.email])
    .commit();
  
  return true;
}
```

## Fresh Web Framework

```typescript
// routes/index.tsx
import { Head } from '$fresh/runtime.ts';
import Counter from '../islands/Counter.tsx';

export default function Home() {
  return (
    <>
      <Head>
        <title>Fresh App</title>
      </Head>
      <div class="p-4 mx-auto max-w-screen-md">
        <h1 class="text-4xl font-bold">Welcome to Fresh</h1>
        <Counter start={3} />
      </div>
    </>
  );
}

// islands/Counter.tsx
import { useSignal } from '@preact/signals';

interface CounterProps {
  start: number;
}

export default function Counter(props: CounterProps) {
  const count = useSignal(props.start);
  return (
    <div class="flex gap-4 items-center">
      <button onClick={() => count.value--} class="px-4 py-2 bg-gray-200 rounded">-</button>
      <p class="text-2xl">{count}</p>
      <button onClick={() => count.value++} class="px-4 py-2 bg-blue-500 text-white rounded">+</button>
    </div>
  );
}
```

## Testing

```typescript
// tests/user_test.ts
import { assertEquals, assertExists } from 'https://deno.land/std@0.208.0/assert/mod.ts';
import { createUser, getUser, deleteUser } from '../db/kv.ts';

Deno.test('User CRUD operations', async (t) => {
  let userId: string;

  await t.step('create user', async () => {
    const user = await createUser({ email: 'test@example.com', name: 'Test User' });
    assertExists(user.id);
    assertEquals(user.email, 'test@example.com');
    userId = user.id;
  });

  await t.step('get user', async () => {
    const user = await getUser(userId);
    assertExists(user);
    assertEquals(user.name, 'Test User');
  });

  await t.step('delete user', async () => {
    const deleted = await deleteUser(userId);
    assertEquals(deleted, true);
    const user = await getUser(userId);
    assertEquals(user, null);
  });
});
```

## Best Practices

1. **Permissions**: Run with minimal permissions
2. **Import Maps**: Use import_map.json for dependencies
3. **Deno KV**: Built-in key-value database
4. **TypeScript**: Native support, no config needed
5. **Testing**: Built-in test runner
6. **Deploy**: Deno Deploy for edge functions

Google Antigravity's Gemini 3 understands Deno patterns and generates secure server code.

When to Use This Prompt

This Deno prompt is ideal for developers working on:

  • Deno applications requiring modern best practices and optimal performance
  • Projects that need production-ready Deno code with proper error handling
  • Teams looking to standardize their deno development workflow
  • Developers wanting to learn industry-standard Deno patterns and techniques

By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their deno implementations.

How to Use

  1. Copy the prompt - Click the copy button above to copy the entire prompt to your clipboard
  2. Paste into your AI assistant - Use with Claude, ChatGPT, Cursor, or any AI coding tool
  3. Customize as needed - Adjust the prompt based on your specific requirements
  4. Review the output - Always review generated code for security and correctness
💡 Pro Tip: For best results, provide context about your project structure and any specific constraints or preferences you have.

Best Practices

  • ✓ Always review generated code for security vulnerabilities before deploying
  • ✓ Test the Deno code in a development environment first
  • ✓ Customize the prompt output to match your project's coding standards
  • ✓ Keep your AI assistant's context window in mind for complex requirements
  • ✓ Version control your prompts alongside your code for reproducibility

Frequently Asked Questions

Can I use this Deno prompt commercially?

Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.

Which AI assistants work best with this prompt?

This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.

How do I customize this prompt for my specific needs?

You can modify the prompt by adding specific requirements, constraints, or preferences. For Deno projects, consider mentioning your framework version, coding style, and any specific libraries you're using.

Related Prompts

💬 Comments

Loading comments...