tego / rules
Cursor rule1.1k starsChanged 12 months agoApache-2.0View on GitHub
Establish consistent backend development patterns and best practices for Tego core framework. 为 Tego 核心框架建立一致的后端开发模式和最佳实践。 Automatically activated in the following situations: 在以下情况下自动激活:
Files
Backend Development Guidelines / 后端开发指南
Purpose / 目的
Establish consistent backend development patterns and best practices for Tego core framework.
为 Tego 核心框架建立一致的后端开发模式和最佳实践。
When to Use This Guide / 何时使用此指南
Automatically activated in the following situations: 在以下情况下自动激活:
- Creating or modifying core packages / 创建或修改核心包
- Building server-side functionality / 构建服务端功能
- Implementing middleware / 实现中间件
- Database operations / 数据库操作
- Error handling / 错误处理
- Configuration management / 配置管理
Quick Start / 快速开始
New Package Checklist / 新包清单
- Package Structure / 包结构:Clear directory organization / 清晰的目录组织
- Exports / 导出:Clear public API / 清晰的公共 API
- Type Definitions / 类型定义:Complete TypeScript types / 完整的 TypeScript 类型
- Dependencies / 依赖:Minimal dependencies / 最小化依赖
- Testing / 测试:Unit tests + integration tests / 单元测试 + 集成测试
Package Structure / 包结构
Core Package Structure / 核心包结构
packages/core/src/
├── index.ts # Main exports / 主导出
├── types.ts # Type definitions / 类型定义
├── utils/ # Utility functions / 工具函数
├── classes/ # Core classes / 核心类
└── __tests__/ # Tests / 测试Server Package Structure / 服务端包结构
packages/server/src/
├── index.ts # Main exports / 主导出
├── server.ts # Server class / 服务器类
├── middleware/ # Middleware / 中间件
└── types.ts # Type definitions / 类型定义Core Patterns / 核心模式
1. Application Class / Application 类
import { Application } from '@tego/core';
const app = new Application({
database: {
dialect: 'postgres',
// ...
},
});
await app.load();2. Database Operations / 数据库操作
import { Database } from '@tachybase/database';
const db = new Database({
dialect: 'postgres',
// ...
});
// Define collection / 定义集合
db.defineCollection({
name: 'users',
fields: [
{ name: 'name', type: 'string' },
],
});3. Dependency Injection / 依赖注入
import { Container } from '@tachybase/di';
const container = new Container();
container.bind('UserService').to(UserService);
const userService = container.get('UserService');Best Practices / 最佳实践
- Single Responsibility / 单一职责:Each package has one clear purpose / 每个包有单一明确的目的
- Minimal Dependencies / 最小依赖:Avoid unnecessary dependencies / 避免不必要的依赖
- Type Safety / 类型安全:Fully utilize TypeScript type system / 充分利用 TypeScript 类型系统
- Clear API / 清晰的 API:Export only what's needed / 只导出需要的
- Test Coverage / 测试覆盖:Write tests for core functionality / 为核心功能编写测试
Trending
Quiet this year.about the whole repository
Who's talking about tegojs/tego
- tegojs/tego-standard“feat: core update”GitHub · Nov 24, 2025
- tegojs/docs“chore: sync plugins-list.md from tegojs/tego repo”GitHub · Jul 26, 2025
- tegojs/docs“chore: sync plugins-list.md from tegojs/tego repo”GitHub · Jul 25, 2025
- tegojs/docs“chore: sync plugins-list.md from tegojs/tego repo”GitHub · Jul 25, 2025
- tegojs/docs“chore: sync plugins-list.md from tegojs/tego repo”GitHub · Jul 25, 2025
The biggest 5 of 40 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 40
Talked about on GitHub (40 times).
On GitHub · 40
- Nov 24, 2025feat: core update — tegojs/tego-standard0 reactions · 31 comments
- Jul 26, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 25, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 25, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 25, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
35 more on GitHub
- Jul 25, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 25, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 24, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 24, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 24, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 24, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 24, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 24, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 23, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 23, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 23, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 23, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 22, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 22, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 21, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 18, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 18, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 17, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 17, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 17, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 17, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 17, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 17, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 16, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 16, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 16, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 16, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 15, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 15, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 14, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 14, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 14, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 11, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 11, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
- Jul 10, 2025chore: sync plugins-list.md from tegojs/tego repo — tegojs/docs0 reactions · 1 comment
In this repository12 other files it gives its agents.
- .cursor/rules/ai-assistant.mdCursor rule
- .cursor/rules/code-style.mdCursor rule
- .cursor/rules/database-patterns.mdCursor rule
- .cursor/rules/development.mdCursor rule
- .cursor/rules/frontend-guidelines.mdCursor rule
- .cursor/rules/index.mdCursor rule
- .cursor/rules/lint-check.mdCursor rule
- .cursor/rules/performance.mdCursor rule
- .cursor/rules/project.mdCursor rule
- .cursor/rules/quick-reference.mdCursor rule
- .cursor/rules/security.mdCursor rule
- .cursor/rules/testing.mdCursor rule
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

