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/events.mdc
Cursor rules

Quality

60/100

Scores the file, not the repository.

Length

430 words

6 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/events.mdcRawGitHub
1---
2globs: packages/core/src/event-handlers/**, packages/core/src/services/**, packages/client/src/event-handlers/**, packages/client/src/adapters/**, apps/server/src/**
3---
4## Cross-Layer Events & Protocol Design
5 
6- **Scope**: Any change that adds/renames/removes events flowing between:
7 - Vue/Pinia (apps/web)
8 - `packages/client`
9 - `apps/server` WebSocket layer
10 - `packages/core` event handlers & services
11 
12### 1. Before You Add or Change an Event
13 
14- Answer, in your head or in an RFC:
15 - **Where is the bottleneck?** (UX latency? DB load? Telegram API limits?)
16 - **What is the minimal new behavior?** (One sentence, domain language.)
17 - **What is the data flow?** (Component → store → client adapter → WS/core → DB → back.)
18 - **How does this handle failure?**
19 - Core error?
20 - Network loss?
21 - Partial success (e.g. some messages processed)?
22 
23### 2. Event Naming & Payloads
24 
25- Naming:
26 - Use `<domain>:<action>` or `<domain>:<action>:<subaction>`.
27 - Avoid generic verbs like `update`, `done`; always include the domain (`message`, `storage`, `auth`, etc.).
28- Payloads:
29 - Prefer **IDs + small shapes** over dumping full DB rows or Telegram objects.
30 - Do not leak raw internal schemas as event payloads unless they are explicitly part of the public model.
31 - Include enough context to render the UI without requiring a second roundtrip when reasonable.
32 
33### 3. End-to-End Wiring Checklist
34 
35When adding a new event, ensure all of the following are updated **in one change**:
36 
37- **Types & contracts**:
38 - `@tg-search/core` `ToCoreEvent` / `FromCoreEvent`.
39 - `@tg-search/server/types` WS mappings (`WsEventToServer`, `WsEventToClient`).
40 - Client event handler maps in `packages/client`.
41- **Handlers**:
42 - Core event handler under `packages/core/src/event-handlers`.
43 - Service function(s) in `packages/core/src/services`.
44 - Client-side handler that maps `FromCoreEvent` into Pinia state.
45- **UI**:
46 - Minimal component/store changes to actually use the new event.
47 
48### 4. Backwards Compatibility & Refactors
49 
50- Prefer **adding** new events over changing semantics of existing ones.
51- If an event must change:
52 - Keep the old event name working for at least one release where possible.
53 - Introduce a new event name for the new behavior and migrate callers gradually.
54- For refactors across layers (e.g. renaming a domain or action):
55 - Do a **mechanical rename** across types, handlers, and callers in one PR.
56 - Avoid long-lived “mixed” states where some code uses old names and some uses new ones.
57 
58### 5. Errors, Timeouts & Idempotency
59 
60- Treat every event as potentially:
61 - Lost (network issues).
62 - Duplicated (retries).
63 - Delayed (backpressure).
64- Design handlers to be **idempotent** where possible:
65 - Re-applying the same event should not corrupt state.
66 - Use message IDs and versioning to detect duplicates.
67- Error semantics:
68 - Core should emit structured error events with codes and key context, not just strings.
69 - Client should surface user-friendly messages and, where safe, allow retry.
70 
71 

Sections

  • Cross-Layer Events & Protocol Design
  • 1. Before You Add or Change an Event
  • 2. Event Naming & Payloads
  • 3. End-to-End Wiring Checklist
  • 4. Backwards Compatibility & Refactors
  • 5. Errors, Timeouts & Idempotency

What it covers

code-style

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/event-handlers/**
  • packages/core/src/services/**
  • packages/client/src/event-handlers/**
  • packages/client/src/adapters/**
  • apps/server/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/core.mdc · 4.0kCursor rulestypescriptdrizzle+11stylearchdependenciesdatabase+160/1003 days ago
groupultra/telegram-search.cursor/rules/db.mdc · 4.0kCursor rulestypescriptdrizzle+11styletypesdatabaseperformance59/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/core.mdc Diff against .cursor/rules/db.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