agentleFS
devlikeaprodevlikeapro/waha/AGENTS.md

waha

AGENTS.md7.5k starsChanged 21 months agoApache-2.0View on GitHub

This guide summarizes how to explore, modify, and validate the WhatsApp HTTP API (WAHA) codebase when assisting as an automation or coding agent. - WAHA ships in Core and Plus editions - Core lives under src/core and supports the default session with minimal media features - Plus extends core via src/plus to add multi-session orchestration, richer media handling, and external storage integrations - Core code must remain free from Plus-only references (pre-commit hook rejects "plus" in core files) - Commit…

  • Reads credentials

Trending

Quiet since September.about the whole repository

Dec 2025: 0 mentionsJan 2026: 2 mentionsFeb 2026: 1 mentionMar 2026: 0 mentionsApr 2026: 3 mentionsMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 4 mentionsAug 2026: 0 mentionsSep 2026: 2 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the devlikeapro/waha repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about devlikeapro/waha

The biggest 5 of 20 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 20

Talked about on GitHub and Bluesky (20 times).

On GitHub · 17

12 more on GitHub
  • 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.

The file

We split this AGENTS.md into the rules it gives an agent

12 rules. About 0 are common, 2 are distinctive, and 10 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.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Commit subjects: changes that touch src/plus require [PLUS] … prefix.

    line 15
  2. Very specific:

    Prefer named function declarations over const arrow functions

    line 52
  3. Distinctive:

    Avoid naming unused variables with a leading underscore

    line 53
  4. Very specific:

    Always use explicit property names in object literals — never shorthand: write { key: value }, not { value } (even when the variable name …

    line 54
  5. Very specific:

    Do not write verbose ternaries.

    line 57
  6. Very specific:

    Do not place await or other async calls inside ternary expressions (?:) or nullish-coalescing expressions (??).

    line 59
  7. Very specific:

    Do not use decorative comment blocks (lines of dashes/underscores with a label) such as // ─────────── NAME ───────────.

    line 64
  8. Very specific:

    Add @Activity() (from src/core/abc/activity.ts) to every engine method that makes a network call to WhatsApp servers

    line 88
  9. Very specific:

    Check the corresponding *.tools.ts file and update the tool's inputSchema, description, or behavior if the API signature changed.

    line 103
  10. Distinctive:

    Ask the user whether an MCP tool is needed for the new endpoint before creating one.

    line 108
  11. Very specific:

    If yes, add the tool to the matching *.tools.ts file (or create a new file for a new domain).

    line 110
  12. Very specific:

    Every @Tool decorator must include an annotations block with all three fields:

    line 112

≈ “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.

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

WAHA Agent Playbook

This guide summarizes how to explore, modify, and validate the WhatsApp HTTP API (WAHA) codebase when assisting as an automation or coding agent.

Product & Variants

  • WAHA ships in Core and Plus editions
  • Core lives under src/core and supports the default session with minimal media features
  • Plus extends core via src/plus to add multi-session orchestration, richer media handling, and external storage integrations
  • Core code must remain free from Plus-only references (pre-commit hook rejects "plus" in core files)
  • Commit subjects: changes that touch src/plus require [PLUS] … prefix; everything else uses [core] …

Tech Stack

  • Runtime: Node.js 22.x, Yarn 3.6 (Berry)
  • Framework: NestJS v11 with dependency injection and modular controllers in src/api
  • Engines: WhatsApp engines are abstracted (WEBJS, GOWS, NOWEB, WPP). Core uses SessionManagerCore; Plus swaps to SessionManagerPlus with extra storage backends (Mongo/Postgres/SQLite)
  • ESM Bridge: ESM-only dependencies (Baileys) load through src/vendor/esm.ts
  • Utilities: RxJS streams drive webhook event fan-out. Prefer existing helpers in src/utils and src/core/utils

Key Paths

  • src/main.ts: runtime entry point; dynamically loads AppModule (Core vs Plus)
  • src/api/**: REST controllers and WebSocket gateway
  • src/core/**: shared abstractions (config services, engine bootstrap, storage, session management)
  • src/plus/**: multi-session orchestration, advanced media services, and external persistence layers
  • src/structures/** and src/utils/**: DTOs, enums (event names follow domain.action), helper utilities

Coding Expectations

  • Favor composability and long-lived solutions
  • Reuse existing helpers (parseBool, DefaultMap, media factories) instead of reinventing logic
  • Stick to NestJS patterns: inject dependencies through constructors, expose provider tokens from modules
  • Logging goes through injected PinoLogger or helpers in src/utils/logging.ts
  • Respect path aliases (@waha/...) defined in tsconfig.json
  • Prefer named function declarations over const arrow functions
  • Avoid naming unused variables with a leading underscore
  • Always use explicit property names in object literals — never shorthand: write { key: value }, not { value } (even when the variable name matches the key)
  • Do not write verbose ternaries; use idiomatic helpers like ?? (nullish coalescing)
  • Do not place await or other async calls inside ternary expressions (?:) or nullish-coalescing expressions (??); use explicit if/else blocks or assign the awaited value to a variable first
  • For configs, prefer runtime configurability over constants (environment keys follow WAHA_* and WAHA_SESSION_CONFIG_*)
  • Do not use decorative comment blocks (lines of dashes/underscores with a label) such as // ─────────── NAME ───────────; use plain inline comments or no comment at all

How to Run API

export DEBUG=1
export WAHA_API_KEY=666
export WAHA_DASHBOARD_PASSWORD=666
export WAHA_DASHBOARD_USERNAME=admin
export WWHATSAPP_SWAGGER_USERNAME=admin
export WHATSAPP_SWAGGER_PASSWORD=666
export WHATSAPP_DEFAULT_ENGINE={WEBJS|WPP|NOWEB|GOWS}
export WAHA_DEBUG_MODE=True
export WAHA_HTTP_STRICT_MODE=1
export WAHA_MEDIA_STORAGE=LOCAL
export WHATSAPP_FILES_FOLDER=./.media

npm run start

Code Guidelines

  • Add @Activity() (from src/core/abc/activity.ts) to every engine method that makes a network call to WhatsApp servers
  • It triggers maintainPresenceOnline() before the method runs, keeping the session ONLINE during API activity and scheduling an OFFLINE transition after an idle period
  • Skip it on methods that only throw NotImplementedByEngineError / AvailableInPlusVersion

MCP Tools

MCP tools live in src/apps/mcp/tools/ and expose the HTTP API to AI clients. Each tool file mirrors an API domain (e.g. chats.tools.ts → chats endpoints).

When you change an existing API endpoint:

  • Check the corresponding *.tools.ts file and update the tool's inputSchema, description, or behavior if the API signature changed.

When you add a new API endpoint:

  • Ask the user whether an MCP tool is needed for the new endpoint before creating one.
  • If yes, add the tool to the matching *.tools.ts file (or create a new file for a new domain).
  • Every @Tool decorator must include an annotations block with all three fields:
    annotations: {
      readOnlyHint: true | false,   // true = no side effects (GET-style)
      destructiveHint: true | false, // true = irreversible deletion/logout
      idempotentHint: true | false,  // true = safe to repeat with same args
    }
  • Input schemas live in the matching *.zod.ts file.
  • Tools call the API via this.textRequest({ method, url, ... }) inherited from McpController.

Related Sources

  • WEBJS: ../whatsapp-web.js
  • NOWEB: ../WhiskeySockets-Baileys and ../whatsapp-rust-bridge
  • GOWS: ../gows and ../whatsmeow
  • WPP: ../wa-js, ../wppconnect, ../wppconnect-server
  • ChatWoot: ../chatwoot

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.