tgcli
AGENTS.md43 starsChanged 5 months agoMITView on GitHub
Track issues and specs in GitHub Issues for kfastov/tgcli; read docs/agents/issue-tracker.md before tracker operations. Use the five canonical triage labels; read docs/agents/triage-labels.md when triaging or applying status labels. Use a single-context layout (CONTEXT.md and docs/adr/); read docs/agents/domain.md before exploring the codebase.
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repositoryOne other file it gives its agents.
- tgcliSkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Use ES modules with semicolons, two-space indentation, and camelCase identifiers.
- Very specific: line 20
Keep tool names descriptive and aligned with Telegram operations (listChannels, searchChannels, etc.).
- Very specific: line 22
Keep message sync queue strictly sequential.
- Very specific: line 26
Add coverage when extending telegram-client.js or message-sync-service.js by mocking MTProto responses to validate session reuse and …
- Very specific: line 28
Before pushing, run your test suite and a smoke npm start to verify authentication prompts and cache initialization remain intact.
- Very specific: line 31
Follow Conventional Commits (type: subject) as seen in docs(readme): add detailed login guide....
- Distinctive: line 32
Keep commits atomic; include body details when altering session management or cache persistence.
- Distinctive: line 39
Commit verified features before starting the next task.
- Very specific: line 49
Use the five canonical triage labels.
- Very specific: line 53
Use a single-context layout (CONTEXT.md and docs/adr/).
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
Repository Guidelines
Project Structure & Module Organization
mcp-server.js: MCP HTTP server built with@modelcontextprotocol/sdk, registering the Telegram tools (listChannels,searchChannels,getChannelMessages,scheduleMessageSync,listMessageSyncJobs).telegram-client.js: Domain logic for MTProto login, dialog traversal, and message helpers.client.js: Example CLI harness for manual testing without the MCP layer.message-sync-service.js: Background worker that archives messages into a local SQLite database.- Store location: OS app-data dir (tgcli store; override with
TGCLI_STORE); keep runtime artifacts out of version control. - Documentation lives in
README.mdandLIBRARY.md; configuration relies on environment variables and the tgcli store.
Build, Test, and Development Commands
npm install: Restore dependencies wheneverpackage-lock.jsonchanges.npm start: Boot the MCP server onhttp://localhost:8080/mcpusing Streamable HTTP transport; first run drives the Telegram login flow.node client.js: Run the sample script to exercise the client API and inspect dialog listings.npm run build: Currently a no-op placeholder—extend it only if a transpile/bundle step is introduced.npm test: Placeholder that echoes a notice; replace with real checks once tests exist.
Coding Style & Naming Conventions
- Use ES modules with semicolons, two-space indentation, and
camelCaseidentifiers. - Keep tool names descriptive and aligned with Telegram operations (
listChannels,searchChannels, etc.). - Emit log lines that explain side effects (login state, MTProto calls, sync progress) and reference chat IDs/titles.
- Keep message sync queue strictly sequential; jobs transition through
pending → in_progress → idleand may move toerrorif retries are needed. - Store secrets in
.env; never hard-code API credentials or session paths in commits.
Testing Guidelines
- Add coverage when extending
telegram-client.jsormessage-sync-service.jsby mocking MTProto responses to validate session reuse and message archiving. - Name new test files
<module>.test.jsundertests/or co-locate in__tests__/; makenpm testexecute them. - Before pushing, run your test suite and a smoke
npm startto verify authentication prompts and cache initialization remain intact.
Commit & Pull Request Guidelines
- Follow Conventional Commits (
type: subject) as seen indocs(readme): add detailed login guide...; use lowercase types for routine changes andfix:for bug patches. - Keep commits atomic; include body details when altering session management or cache persistence.
- PR descriptions should summarize intent, list manual verification (commands run, Telegram scenarios exercised), link related issues, and attach console excerpts when tool output changes.
- Confirm no sensitive credentials or runtime artifacts from the tgcli store are committed before requesting review.
Workflow
- On startup, read
backlog.mdand pull tasks from it. - Thoroughly verify implemented functionality (tests, smoke runs, manual checks).
- Commit verified features before starting the next task.
Agent skills
Issue tracker
Track issues and specs in GitHub Issues for kfastov/tgcli; read docs/agents/issue-tracker.md before tracker operations.
Triage labels
Use the five canonical triage labels; read docs/agents/triage-labels.md when triaging or applying status labels.
Domain docs
Use a single-context layout (CONTEXT.md and docs/adr/); read docs/agents/domain.md before exploring the codebase.
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.

