RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Copilot instructions/groupultra/telegram-search

Copilot instructions

.github/copilot-instructions.md
Copilot instructions

Quality

76/100

Scores the file, not the repository.

Length

567 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/.github/copilot-instructions.mdRawGitHub
1# Copilot Instructions for telegram-search
2 
3This repo is a pnpm-powered monorepo for a Telegram search/export app. It uses an event-driven core with WebSocket bridging, Vue 3 frontend, and Drizzle ORM for storage (PostgreSQL + pgvector or in-browser PGlite).
4 
5## Architecture essentials
6- Monorepo layout:
7 - `apps/web`: Vue 3 app (Pinia, TanStack Query). Can run standalone with `VITE_WITH_CORE=true` (browser-only mode with PGlite).
8 - `apps/server`: WebSocket server (h3) that hosts the Core for server mode.
9 - `packages/core`: Event-driven Core (EventEmitter3), services, DB models and resolvers.
10 - `packages/client`: Browser-side bridge + client event handlers and stores.
11 - `packages/common`: Shared config, logger wrapper, utils.
12- Core event bus: `packages/core/src/context.ts` creates `CoreContext` around EventEmitter3. All cross-layer comms use events:
13 - To Core (requests): `auth:*`, `message:*`, `dialog:*`, `entity:*`, `storage:*`, `takeout:*`, etc.
14 - From Core (results): e.g. `auth:connected`, `message:data`, `dialog:data`, `storage:search:messages:data`.
15 - Event types and contracts live in `packages/core/src/types/events.ts`. Follow `<domain>:<action>` naming.
16- Event handlers and services:
17 - Handlers: `packages/core/src/event-handlers/*.ts` map bus events to services.
18 - Services: `packages/core/src/services/*.ts` implement business logic and emit results.
19 - Message pipeline resolvers in `packages/core/src/message-resolvers/*` (embedding, jieba, link, media, user) operate independently and stream results.
20- Client bridge:
21 - `packages/client/src/adapters/core-bridge.ts` initializes config/logger, creates Core in browser mode, registers handlers, and forwards events between UI and Core (or WebSocket server).
22 - For server mode, the browser uses a WebSocket adapter; the server routes events to a per-connection Core instance.
23- Database:
24 - Drizzle ORM schemas/models under `packages/core/src/{schemas,models}`; migrations in `drizzle/`.
25 - Two modes: PostgreSQL+pgvector (server) and PGlite (browser). Code paths must support both.
26 
27## Dev workflows
28- Node 24+ and pnpm required. Root scripts:
29 - Browser-only: `pnpm dev` (equivalent to `VITE_WITH_CORE=true pnpm -F @tg-search/web dev`).
30 - Server mode: `pnpm server:dev` and `pnpm web:dev` (two terminals). DB via `docker compose up -d pgvector`.
31 - Builds: `pnpm build`, `pnpm web:build`, `pnpm server:build`, `pnpm packages:build`.
32 - Types/tests/lint: `pnpm typecheck` (builds packages first), `pnpm test` (Vitest), `pnpm lint` / `pnpm lint:fix`.
33 - DB tools: `pnpm db:generate` (drizzle-kit).
34- Config:
35 - Browser mode uses `.env` (`VITE_TELEGRAM_API_ID`, `VITE_TELEGRAM_API_HASH`).
36 - Server mode uses environment variables (database, Telegram API, optional proxy) loaded via `.env` / `.env.local` and dotenvx. See `docs/ENVIRONMENT.md`.
37 
38## Conventions and patterns
39- Events are the API. Don’t call services directly across layers; emit on `ctx.emitter` and listen for results. Use types from `packages/core/src/types/events.ts`.
40- Naming:
41 - Event names: `<domain>:<action>` (e.g. `message:fetch`, `storage:search:messages`). Avoid timestamps for ordering—prefer Telegram message IDs.
42 - Files: kebab-case; components: PascalCase; constants: UPPER_SNAKE_CASE.
43- Logging & errors:
44 - Use `@guiiai/logg` (`useLogger()`). Include `withFields` context and `withError` on failures.
45 - Use `ctx.withError(err, description)` to emit `core:error` and log uniformly. In dev, `CoreContext` tracks listener counts and warns on potential leaks; emit `core:cleanup` when tearing down a context.
46- Session isolation:
47 - Each browser tab/WS connection has its own `CoreContext` and event subscriptions. Avoid global singletons in core logic.
48- Storage/search specifics:
49 - Vector search via embeddings (OpenAI/Ollama). Resolvers live under `packages/core/src/message-resolvers/embedding-resolver.ts` etc.
50 - Storage/search events: `storage:search:messages` -> emits `storage:search:messages:data` with ranked results.
51 
52## Where to look for examples
53- Event contracts: `packages/core/src/types/events.ts` (e.g., `MessageEventToCore`, `StorageEventFromCore`).
54- Handler -> service pattern: `packages/core/src/event-handlers/message.ts` and `packages/core/src/services/message.ts`.
55- Client event bridging: `packages/client/src/adapters/core-bridge.ts`.
56- DB schema and migrations: `packages/core/src/schemas/*`, `drizzle/*`.
57 
58## Gotchas and edge cases
59- Message ordering: always use Telegram Message ID over timestamps.
60- Dual DB mode: ensure code paths work for both Postgres and PGlite; avoid vendor-specific SQL in core logic.
61- Avoid memory leaks: unsubscribe listeners on cleanup and prefer one-time listeners when appropriate.
62 

Commands it names

  • pnpm dev
  • pnpm server:dev
  • pnpm web:dev
  • docker compose up -d pgvector
  • pnpm build
  • pnpm web:build
  • pnpm server:build
  • pnpm packages:build
  • pnpm typecheck
  • pnpm test
  • pnpm lint
  • pnpm lint:fix
  • pnpm db:generate

Sections

  • Copilot Instructions for telegram-search
  • Architecture essentials
  • Dev workflows
  • Conventions and patterns
  • Where to look for examples
  • Gotchas and edge cases

What it covers

testcode-styleagent-behaviour

Stack — with the evidence

typescript

(1.00)

drizzle

(1.00)

turborepo

(1.00)

vitest

(1.00)

eslint

(1.00)

node

(0.95)

monorepo

(0.85)

pnpm

(0.85)

vue

(0.70)

postgres

(0.70)

vite

(0.70)

javascript

(0.60)

github-actions

(0.60)

Format

Copilot instructions

Two layers: one always-on repo file, plus optional glob-scoped instruction files. Lives under .github/ rather than the repo root, which is the tell that it is aimed at the GitHub platform surface as much as the editor.

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/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-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/events.mdc Diff against .cursor/rules/frontend-web.mdc Diff against .cursor/rules/pglite-inspector.mdc Diff against .cursor/rules/tooling.mdc Diff against AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
louislam/uptime-kuma.github/copilot-instructions.md · 90kCopilot instructionstypescriptjavascript+10setupbuildtestlint-format+9100/1003 days ago
chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63Copilot instructionstypescriptreact+7buildlint-formatstylearch+4100/1003 days ago
JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31kCopilot instructionstypescriptnode+7buildlint-formatstylearch+397/1002 days ago
nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32Copilot instructionstypescriptnode+8setupbuildtestlint-format+1196/1003 days ago
thangaram611/second-brain.github/copilot-instructions.md · 0Copilot instructionstypescriptnode+12setupteststylearch+496/1003 days ago
darkmatter/nixmac.github/copilot-instructions.md · 24Copilot instructionstypescriptrust+14setupbuildtestlint-format+896/1003 days ago
keycloak/keycloak.github/copilot-instructions.md · 36kCopilot instructionsjavanode+9setupbuildtestlint-format+693/1003 days ago
jnPiyush/AgentX.github/instructions/typescript.instructions.md · 14Copilot instructionstypescriptnode+5setuptestlint-formatstyle+592/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