| name | tml-context |
| description | Loads TML organisational context into the current session. Run at the start of any session involving TML codebases to give the AI background on what TML is, what it builds, and how the repos are organised. |
TML Context
Load the following context for this session. Apply it to all responses involving TML codebases, products, and decisions.
Who is TML
Transportes Metropolitanos de Lisboa (TML) is an inter-municipal authority covering the Lisbon metropolitan area. TML's role is regulatory and technical — it defines what public transport runs, when, where, at what standard, and through which systems. Operators execute on the ground; TML does not operate vehicles directly.
Carris Metropolitana (CM)
Carris Metropolitana is TML's public-facing bus brand across the Lisbon metro area, split into 4 geographic areas each run by a different operator. TML sets the standards; operators run the buses.
CM is TML's first and largest deployment of its platform. The systems built for CM are being generalised to work with any transport company and mode. The carrismetropolitana GitHub org is a legacy of the earlier CM-first phase and will shrink over time.
GO — The Core Platform
GO is TML's main software product: a platform for managing public transport operations across operators, companies, and modes. It is already being adopted by other entities beyond CM and is designed to become a standard for any transport authority in Portugal and beyond.
GO is a TypeScript monorepo (Turborepo + npm workspaces) organised into domain modules. Each module is self-contained and owns its own API (Fastify), frontend (Next.js), and optionally background workers.
Current modules: alerts, apex, auth, controller, dates, eta, exporter, fleet, hub, locations, offer, performance, plans, replicator, stops, tracker.
Key shared packages (all under @tmlmobilidade/): types · interfaces · ui · consts · fastify · utils · mongo · rabbitmq.
GitHub Organisations
| Organisation | Purpose |
|---|
tmlmobilidade | Core platform — GO and strategic infrastructure |
carrismetropolitana | CM-specific projects — website, app, CM-facing tooling. Migrating to GO APIs. |
When in doubt, prefer tmlmobilidade.
Tech Stack
| Layer | Technology |
|---|
| Frontend | Next.js (App Router), TypeScript strict |
| Components | Mantine — always via @tmlmobilidade/ui, never imported directly |
| API | Fastify via @tmlmobilidade/fastify |
| Primary DB | MongoDB via @tmlmobilidade/interfaces |
| Analytics DB | Clickhouse |
| Queue | RabbitMQ via @tmlmobilidade/rabbitmq |
| Infra | Kubernetes |
Commit Conventions
Format: type(scope): description
Types: feat · fix · refactor · perf · test · docs · chore · ci · style · revert · wip
Scopes are repo-specific and defined in each repo's commitlint.config.cjs. In GO, scopes are module names (alerts, auth, offer, etc.) and package names (ui, types, interfaces, etc.).
Use the tml-commit skill to generate a properly formatted message.
Team Knowledge Base
Full documentation — architecture decisions, product specs, operational guides — lives at tmlmobilidade/docs on GitHub (public). Use @GitHub in Cursor or the GitHub MCP to read it when deeper context is needed.