RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/groupultra/telegram-search

Cursor rule

.cursor/rules/core.mdc
Cursor rules

Quality

60/100

Scores the file, not the repository.

Length

356 words

5 headings · 0 code blocks

Repository

4.0k

— · pushed 2 days ago

Last changed

3 days ago

First indexed 3 days ago.
groupultra/telegram-search/.cursor/rules/core.mdcRawGitHub
1---
2globs: packages/core/src/**/*
3---
4 
5## Core (packages/core)
6 
7- **Role**: Event-driven "kernel" containing domain logic, database access, and message processing. It must stay UI-agnostic and transport-agnostic.
8- **Design rules**:
9 - New domain behavior belongs here first, then is exposed to clients via events.
10 - Separate **event handlers** from **services**:
11 - Event handlers translate `ToCoreEvent` / `FromCoreEvent` into service calls.
12 - Services encapsulate business logic, DB queries, and Telegram API access.
13 
14### Events & CoreContext
15 
16- Keep `CoreContext` the single point of coordination:
17 - One instance per session in server mode or browser mode.
18 - All cross-module collaboration flows through its event emitter and helpers.
19- When introducing new events:
20 - Add them to the typed `ToCoreEvent` / `FromCoreEvent` maps.
21 - Wire them through:
22 - `packages/core/src/event-handlers`
23 - `packages/client` adapters and event handler maps
24 - `@tg-search/server/types` for WS mode
25 - Provide **clear names** in `<domain>:<action>` form.
26 
27### Database & Drizzle
28 
29- Use `initDrizzle` as the only entry point for DB initialization:
30 - It must support both PostgreSQL and PGlite via the `DatabaseType` enum and `Config.database`.
31 - Avoid leaking raw `pg` or PGlite APIs outside dedicated DB modules (`pg.ts`, `pglite*.ts`).
32- For queries:
33 - Prefer Drizzle ORM APIs for type safety and portability.
34 - Reserve raw SQL for performance-critical paths and keep them well-documented.
35- When adding migrations:
36 - Update TypeScript schemas/models first.
37 - Use `drizzle-kit` to generate SQL migrations and avoid manual edits except for surgical fixes.
38 
39### Message Resolvers & Pipelines
40 
41- Resolvers under `src/message-resolvers` must:
42 - Treat messages as **streams**, not immutable global state.
43 - Be **idempotent**: re-running on the same input should not corrupt data.
44 - Rely on message IDs for ordering and deduplication.
45- Expensive operations (embeddings, link resolution) should:
46 - Cache results whenever reasonable.
47 - Defer to background-like processing while exposing progress events to clients.
48 
49### Error Handling & Logging
50 
51- Use `ctx.withError(error, description)` for all unexpected failures inside core services and handlers.
52- Emit errors as events suitable for user-facing handling:
53 - Avoid leaking raw Telegram or DB internals into error payloads.
54 - Prefer structured error codes + contextual fields.
55- Use `@guiiai/logg` consistently:
56 - Attach domain-specific fields (chat/message IDs, operation names) instead of dumping entire payloads.
57 
58 

Sections

  • Core (packages/core)
  • Events & CoreContext
  • Database & Drizzle
  • Message Resolvers & Pipelines
  • Error Handling & Logging

What it covers

code-stylearchitecturedependenciesdatabasemonorepo

Stack — with the evidence

typescript

(1.00)

drizzle

(1.00)

turborepo

(1.00)

vitest

(1.00)

eslint

(1.00)

node

(0.70)

vue

(0.70)

postgres

(0.70)

vite

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(0.60)

github-actions

(0.60)

Glob targeting

  • packages/core/src/**/*

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
groupultra
Language
—
License
—
Archived
no

All configs in this repo

Also in groupultra/telegram-search

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
groupultra/telegram-search.cursor/rules/testing.mdc · 4.0kCursor rulestypescriptdrizzle+11teststyletesting-strategydatabase55/1003 days ago
groupultra/telegram-search.cursor/rules/architecture.mdc · 4.0kCursor rulestypescriptdrizzle+11buildtestlint-formatarch+489/1003 days ago
groupultra/telegram-search.cursor/rules/backend-server.mdc · 4.0kCursor rulestypescriptdrizzle+11setupsecuritymonorepo52/1003 days ago
groupultra/telegram-search.cursor/rules/client.mdc · 4.0kCursor rulestypescriptdrizzle+11stylearchtypesdependencies+160/1003 days ago
groupultra/telegram-search.cursor/rules/contributing.mdc · 4.0kCursor rulestypescriptdrizzle+11styletypesgit56/1003 days ago
groupultra/telegram-search.cursor/rules/db.mdc · 4.0kCursor rulestypescriptdrizzle+11styletypesdatabaseperformance59/1003 days ago
groupultra/telegram-search.cursor/rules/events.mdc · 4.0kCursor rulestypescriptdrizzle+11style60/1003 days ago
groupultra/telegram-search.cursor/rules/frontend-web.mdc · 4.0kCursor rulestypescriptdrizzle+11stylesecurityuimonorepo56/1003 days ago
groupultra/telegram-search.cursor/rules/pglite-inspector.mdc · 4.0kCursor rulestypescriptdrizzle+11securityapi47/1003 days ago
groupultra/telegram-search.cursor/rules/tooling.mdc · 4.0kCursor rulestypescriptdrizzle+11buildlint-formatstyledeployment+167/1003 days ago
groupultra/telegram-search.github/copilot-instructions.md · 4.0kCopilot instructionstypescriptdrizzle+11teststyleagent-behaviour76/1003 days ago
groupultra/telegram-searchAGENTS.md · 4.0kAGENTS.mdtypescriptdrizzle+11setupbuildtestlint-format+1083/1003 days ago
Diff against .cursor/rules/testing.mdc Diff against .cursor/rules/architecture.mdc Diff against .cursor/rules/backend-server.mdc Diff against .cursor/rules/client.mdc Diff against .cursor/rules/contributing.mdc Diff against .cursor/rules/db.mdc Diff against .cursor/rules/events.mdc Diff against .cursor/rules/frontend-web.mdc Diff against .cursor/rules/pglite-inspector.mdc Diff against .cursor/rules/tooling.mdc Diff against .github/copilot-instructions.md Diff against AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack