agentleFS
kfastovkfastov/tgcli/AGENTS.md

tgcli

AGENTS.md44 starsChanged 23 days 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/agen

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 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.

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
  1. Very specific:

    Use ES modules with semicolons, two-space indentation, and camelCase identifiers.

    line 20
  2. Very specific:

    Keep tool names descriptive and aligned with Telegram operations (listChannels, searchChannels, etc.).

    line 21
  3. Very specific:

    Keep message sync queue strictly sequential.

    line 23
  4. Very specific:

    Add coverage when extending telegram-client.js or message-sync-service.js by mocking MTProto responses to validate session reuse and …

    line 27
  5. Very specific:

    Before pushing, run your test suite and a smoke npm start to verify authentication prompts and cache initialization remain intact.

    line 29
  6. Very specific:

    Follow Conventional Commits (type: subject) as seen in docs(readme): add detailed login guide....

    line 32
  7. Distinctive:

    Keep commits atomic; include body details when altering session management or cache persistence.

    line 33
  8. Distinctive:

    Commit verified features before starting the next task.

    line 42
  9. Very specific:

    Use the five canonical triage labels.

    line 52
  10. Very specific:

    Use a single-context layout (GLOSSARY.md and docs/adr/).

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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.md and LIBRARY.md; configuration relies on environment variables and the tgcli store.

Build, Test, and Development Commands

  • npm install: Restore dependencies whenever package-lock.json changes.
  • npm start: Boot the MCP server on http://localhost:8080/mcp using Streamable HTTP transport; first run drives the Telegram login flow.
  • node cli.js <command>: Run the CLI from the clone (Node 22, see .nvmrc); docs/development.md covers trying a change on the real account with node cli.js server restart.
  • 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 camelCase identifiers.
  • 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 → idle and may move to error if 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.js or message-sync-service.js by mocking MTProto responses to validate session reuse and message archiving.
  • Name new test files <module>.test.js under tests/ or co-locate in __tests__/; make npm test execute them.
  • Before pushing, run your test suite and a smoke npm start to verify authentication prompts and cache initialization remain intact.

Commit & Pull Request Guidelines

  • Follow Conventional Commits (type: subject) as seen in docs(readme): add detailed login guide...; use lowercase types for routine changes and fix: 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.
  • Releases are automated: merging the release PR that the Release workflow keeps open publishes to npm and Homebrew. Never bump the version, tag or publish by hand; see docs/releasing.md.
  • Squash-merge pull requests (gh pr merge --squash) with a user-facing Conventional Commit title: every fix:/feat: on main is a changelog line. Review fixes and refactors stay inside the squash.

Workflow

  • On startup, read backlog.md and 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 (GLOSSARY.md and docs/adr/); read docs/agents/domain.md before exploring the codebase.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.