src/index.ts: application entrypoint and subsystem wiring.src/bot/: Telegram handlers, formatting, command parsing, i18n, middleware.src/orchestrator/: routing, MCP client, skill registry, GitHub/MCP skills.src/runner/: Codex SDK/CLI runner management, PTY fallback handling, and restricted shell execution.src/cron/: scheduled proactive jobs.tests/: Node built-in test suite, one*.test.jsfile per module area.
npm install: install dependencies.npm run start: start the Telegram bot with the current.env.npm run dev: run the bot in watch mode for local development.- Use
CODEX_BACKEND=sdkfor the preferred SDK-backed runner; keepCODEX_BACKEND=clionly when you specifically need the legacy PTY/CLI path.
npm test: run the full unit test suite with the Node test runner plustsx.npm run check: run the repository typecheck gate.npm run typecheck: runtsc --noEmitdirectly.npm run healthcheck: run the local runtime health check.npm run healthcheck:live: run the live Codex + Telegram health probe when local credentials are configured.
npm run lint: run ESLint over source, tests, scripts, and local JS/CJS config files.npm run lint:fix: apply safe ESLint fixes.npm run format: run Prettier across the repository.npm run format:check: verify formatting without writing changes.- Do not submit formatting-only churn or rewrap unrelated files.
- Do not edit
.git/ornode_modules/. - Do not commit or rewrite
.env, secrets, Telegram tokens, or local session artifacts. - Do not manually edit
.codex-telegram-claws-state.json; it is runtime state. - Avoid changing files outside this repository root, even when
/repoor shell features reference other workspaces.
- Use ES Modules and keep new files under the existing feature-oriented layout.
- Keep user-facing bot copy in English by default. Localized strings must go through
src/bot/i18n.js. - Prefer focused changes. Do not mix feature work with unrelated refactors.
- Add or update tests for behavior changes in
tests/.
- Run
npm run check. - Run
npm run lint. - Run
npm run format:check. - Run
npm test. - Run
npm run healthcheck. - Run
npm run healthcheck:livebefore production-facing releases when real credentials are available. - Review
git diff --statandgit status --shortfor accidental edits. - If bot commands or behavior changed, update
README.mdand include a Telegram usage example in the PR or commit notes.