agentleFS
openstory-soopenstory-so/openstory/.cursor/rules/context7-integration.mdc

openstory / rules

Cursor rule693 starsChanged 2 months agoMITView on GitHub

Context7 MCP integration for up-to-date documentation

We split this context7-integration.mdc into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always use Context7 MCP when you need current documentation for:

    line 9
  2. Very specific:

    Use these Context7 library IDs for OpenStory's tech stack:

    line 19
  3. Distinctive:

    Instead of relying on potentially outdated training data, Context7 provides:

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
context7-integration.mdc
---
description: Context7 MCP integration for up-to-date documentation
globs: []
alwaysApply: true
---

# Context7 MCP Integration

Always use Context7 MCP when you need current documentation for:
- Code generation and setup steps
- Library/API documentation  
- Configuration examples
- Framework-specific patterns

This means you should automatically use the Context7 MCP tools to resolve library IDs and get library docs without me having to explicitly ask.

## Pre-configured Library IDs

Use these Context7 library IDs for OpenStory's tech stack:

### Core Framework
- `/vercel/next.js` - Next.js 15 documentation and patterns
- `/microsoft/typescript` - TypeScript best practices
- `/facebook/react` - React 19 features and hooks

### UI & Styling
- `/tailwindlabs/tailwindcss` - Tailwind CSS 4 utilities and configuration
- `/radix-ui/primitives` - Radix UI component APIs
- `/shadcn/ui` - shadcn/ui component library

### Backend & Data
- `/elysiajs/elysia` - Elysia web framework patterns
- `/drizzle-team/drizzle-orm` - Drizzle ORM queries and migrations
- `/temporalio/sdk-typescript` - Temporal TypeScript SDK
- `/tanstack/query` - TanStack Query v5 patterns
- `/arktypeio/arktype` - ArkType runtime validation (backend validation)

### AI Integration
- `/fal-ai/client` - Fal.ai SDK for image/video generation
- `/openai/openai-node` - OpenAI API for script analysis

### Infrastructure
- `/upstash/redis` - Redis for caching (via @upstash/redis)
- `/oven-sh/bun` - Bun runtime and package manager

## When to Use Context7

Automatically invoke Context7 when:
- Setting up new components or features
- Working with framework-specific APIs (Next.js 15 App Router, React Server Components)
- Implementing authentication patterns (Better Auth)
- Configuring AI model integrations (Fal.ai models)
- Working with async job queues (QStash patterns)
- Implementing real-time features (Supabase Realtime)
- Setting up validation schemas (Zod)
- Troubleshooting integration issues
- Learning new library features

## OpenStory-Specific Context Needs

Prioritize Context7 for:
- **Next.js 15**: Server Actions, async request params, React 19 features
- **Elysia**: Route handlers, plugins, lifecycle hooks
- **Drizzle ORM**: Query patterns, relations, migrations
- **Temporal**: Workflow definitions, activity patterns, worker setup
- **TanStack Query**: Query keys factory pattern, optimistic updates
- **Fal.ai**: Model-specific parameters (flux, imagen4, veo3, kling, wan)

## Example Usage

Instead of relying on potentially outdated training data, Context7 provides:
- Current API signatures (especially for Next.js 15 breaking changes)
- Latest configuration options (Tailwind 4, React 19)
- Up-to-date code examples (async params in App Router)
- Recent best practices (Server Components vs Client Components)
- Breaking changes and migrations (React 18→19, Next.js 14→15)

This ensures all generated code uses current, working patterns rather than deprecated or incorrect approaches.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.