agentset / rules
Cursor rule2.1k starsChanged 10 months agoMITView on GitHub
Project structure, monorepo management, and architectural patterns for the Agentset platform
- Reads credentials
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about agentset-ai/agentset
- A Hacker News story“Show HN: Agentset – Open-source RAG with vector DB, embeddings, and API built-in”Hacker News · Oct 17, 2025 · 6 points
- A Hacker News story“Show HN: Agentset – An open-source RAG platform for AI apps”Hacker News · May 15, 2025 · 4 points
- colinhacks/zod“Unhandled `undefined` in `to-json-schema`'s `flattenRef` method”GitHub · Jan 14, 2026 · 2 reactions
- agentset-ai/partition-api-v2“Add EU region support”GitHub · Sep 27, 2026
- sudosubin/agents.nix“agent-skills.github.agentset-ai.agentset: init at 0-unstable-2026-01-26”GitHub · Sep 25, 2026
The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 8
Talked about on GitHub and Hacker News (8 times).
On GitHub · 6
- Jan 14, 2026Unhandled `undefined` in `to-json-schema`'s `flattenRef` method — colinhacks/zod2 reactions · 2 comments
- Sep 27, 2026Add EU region support — agentset-ai/partition-api-v20 reactions
- Sep 25, 2026agent-skills.github.agentset-ai.agentset: init at 0-unstable-2026-01-26 — sudosubin/agents.nix0 reactions
- Aug 1, 2026docs: add Agentset to LLM knowledge tools — xlabs-club/awesome-x-ops0 reactions
- Jan 31, 2026Add Agentset to Frameworks section — Yigtwxx/awesome-rag-production0 reactions
1 more on GitHub
- Oct 26, 2025Add missing email validation — better-auth/better-auth0 reactions · 5 comments
On Hacker News · 2
- Oct 17, 2025Show HN: Agentset – Open-source RAG with vector DB, embeddings, and API built-in6 points
- May 15, 2025Show HN: Agentset – An open-source RAG platform for AI apps4 points
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository13 other files it gives its agents.
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- docs/CLAUDE.mdCLAUDE.md
- animationsCursor rule
- .cursor/rules/clean-code.mdcCursor rule
- .cursor/rules/nextjs.mdcCursor rule
- .cursor/rules/shadcn.mdcCursor rule
- tailwindcssCursor rule
- baseline-uiSkill
- fixing-accessibilitySkill
- fixing-metadataSkill
- react-emailSkill
- trigger-dev-tasksSkill
- vercel-react-best-practicesSkill
The file
Show its rules and text
We split this project-structure.mdc into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Use bun as the package manager (required by packageManager field)
- Distinctive: line 41
Use catalog: references for shared external dependencies
- Distinctive: line 67
Avoid camelCase or PascalCase for directories
- Distinctive: line 84
Import from packages using their configured aliases:
- Very specific: line 126
Use dotenv -e ../../.env in package scripts to access root env
- Very specific: line 139
Use tsc for building TypeScript packages
- Distinctive: line 158
Keep component files, styles, and tests together
- Distinctive: line 159
Place utility functions near their usage
- Very specific: line 166
Use catalog: for shared dependencies across packages
- Distinctive: line 167
Avoid duplicate dependencies across packages
- Distinctive: line 172
Keep related packages in sync (e.g., React ecosystem)
- Distinctive: line 173
Use exact versions for critical dependencies
- Distinctive: line 174
Document breaking changes in package versions
- Distinctive: line 189
Use dependency injection for complex relationships
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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.
Files
---
description: Project structure, monorepo management, and architectural patterns for the Agentset platform
globs:
alwaysApply: true
---
# Project Structure & Monorepo Guidelines
## Overview
Agentset is a **Turborepo monorepo** containing a Next.js web app and supporting packages. This is an **open-source RAG (Retrieval-Augmented Generation) platform** built with modern web technologies.
## Monorepo Structure
### Core Applications
- `apps/web/` - Main Next.js application with App Router
### Internal Packages (Workspace Dependencies)
- `packages/db/` - Database schema, Prisma client, and types
- `packages/demo/` - Demo data and templates
- `packages/emails/` - Email templates and components (using react-email and resend)
- `packages/engine/` - RAG engine with vector stores and embeddings
- `packages/jobs/` - Background job definitions (Trigger.dev)
- `packages/storage/` - File storage utilities (S3)
- `packages/stripe/` - Payment processing utilities
- `packages/tinybird/` - Data warehousing and analytics (Tinybird)
- `packages/ui/` - Shared UI components (Shadcn-based)
- `packages/utils/` - Shared utility functions
- `packages/validation/` - Shared Zod schemas
- `packages/webhooks/` - Webhook definitions and handlers
- `tooling/` - Development and build tooling
## Package Management
### Use Bun with Workspace Protocol
- Use `bun` as the package manager (required by packageManager field)
- Reference internal packages with `workspace:*` in package.json
- Use catalog: references for shared external dependencies
```json
{
"dependencies": {
"@agentset/db": "workspace:*",
"@agentset/ui": "workspace:*",
"typescript": "catalog:"
}
}
```
### Workspace Scripts
- `bun dev` - Start all services in watch mode
- `bun dev:web` - Start web app with dependencies
- `bun build` - Build all packages
- `bun lint` - Run linting across workspace
- `bun typecheck` - Type check all packages
## Directory Naming Conventions
### Use Kebab-Case for Directories
- Directory names should use lowercase with dashes: `auth-wizard/`, `api-client/`
- File names should use kebab-case: `auth-provider.tsx`, `user-settings.ts`
- Avoid camelCase or PascalCase for directories
### Package Organization
```
packages/
├── db/ # Database-related code
├── ui/ # UI components
├── engine/ # Core RAG functionality
├── validation/ # Shared schemas
└── utils/ # Utility functions
```
## Import Patterns
### Use Package Aliases
Import from packages using their configured aliases:
```typescript
// ✅ Correct - use package aliases
import { Button } from "@agentset/ui"
import { db } from "@agentset/db/client"
import { env } from "@agentset/engine/env"
// ❌ Avoid relative paths to packages
import { Button } from "../../packages/ui/src/components/button"
```
### Barrel Exports
Each package should export through `src/index.ts`:
```typescript
// packages/utils/src/index.ts
export * from "./functions"
export * from "./error"
export * from "./fetch"
```
## Environment Management
### Environment Configuration
- Environment variables are validated using `@t3-oss/env-nextjs`
- Each package can extend the environment schema
- Main environment is defined in [apps/web/src/env.ts](mdc:apps/web/src/env.ts)
```typescript
// Extending environment in packages
export const env = createEnv({
extends: [engineEnv, storageEnv, stripeEnv],
// ... configuration
});
```
### Environment Files
- `.env` - Main environment file at root
- Use `dotenv -e ../../.env` in package scripts to access root env
## Build and Development
### Turborepo Configuration
- Configured in [turbo.json](mdc:turbo.json) at root
- Uses build cache and parallel execution
- Each package defines its own build pipeline
### Package Development
- Each package should be independently buildable
- Use `tsc` for building TypeScript packages
- Web app uses Next.js build system
## File Organization Principles
### Group by Feature, Then by Type
```
src/
├── app/ # Next.js App Router pages
├── components/ # Shared UI components
├── lib/ # Utilities and configurations
├── hooks/ # Custom React hooks
├── types/ # TypeScript type definitions
└── services/ # External service integrations
```
### Co-locate Related Files
- Keep component files, styles, and tests together
- Place utility functions near their usage
- Group related API routes in the same directory
## Dependency Management
### External Dependencies
- Use `catalog:` for shared dependencies across packages
- Avoid duplicate dependencies across packages
- Pin AI SDK versions for consistency
### Version Management
- Keep related packages in sync (e.g., React ecosystem)
- Use exact versions for critical dependencies
- Document breaking changes in package versions
## Package Boundaries
### Clear Responsibilities
- `@agentset/db` - All database operations and schemas
- `@agentset/ui` - Reusable UI components only
- `@agentset/engine` - RAG functionality, no UI code
- `@agentset/validation` - Shared schemas, no business logic
### Avoid Circular Dependencies
- Packages should not depend on apps
- Higher-level packages can depend on lower-level ones
- Use dependency injection for complex relationships
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
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.

