API Developer Skill
SkillDatabases & dataThis skill helps your AI work on the Deno and TypeScript backend API in the covoiturage-gouv-fr mono repository. Once added, your AI can create new actions, repositories, and service providers, and change how routing works. It follows the conventions the project already uses, including ILOS framework patterns, decorators, SQL queries, and the Docker stack.
Available today. Use it from your connected AI after setup.
No other account needed.
Add the skill, then ask your AI to make a change to the backend API, such as creating a new action or adjusting routing. It will use the ILOS patterns and Docker setup already in place.
Then ask your AI: use the API Developer Skill skill
What your AI can do with it
- Create actions in the backend API
- Add repositories and service providers
- Modify API routing
- Write SQL queries that fit the project's setup
- Follow ILOS framework patterns and use decorators
- Work within the project's Docker stack
What this skill tells your AI
The instructions your AI receives, as published by covoiturage-gouv-fr/mono in .claude/skills/api/SKILL.md and read by ahel’s review.
Read
api/README.mdfirst for setup, commands, and configuration.
ILOS Framework (IoC)
The API uses a custom IoC framework (ILOS) with Inversify for dependency injection.
Key Decorators
| Decorator | Purpose |
|---|---|
@handler() | Defines action handlers with service, method, middlewares, API routes |
@serviceProvider() | Decorates service providers with handlers, commands, validators |
@provider() | Marks injectable service classes |
@middleware() | Marks middleware classes |
@command() | CLI commands with signature and options |
Key Components
- Kernel (
api/src/pdc/proxy/Kernel.ts): Registers all service providers, connections, and commands - Service Providers: Each domain module is a service provider that registers actions and repositories
- Actions: Extend
Actionclass, implementhandle(params, context)method - Repositories: Database access layer using PostgreSQL
Service Provider Structure
Each service follows this pattern:
services/<name>/
├── <Name>ServiceProvider.ts # Registers all components
├── actions/ # Action handlers
├── repositories/ # Database access
├── contracts/ # TypeScript interfaces
├── commands/ # CLI commands (optional)
└── config/ # Service configuration
Action Pattern
@handler({
service: "acquisition",
method: "create",
middlewares: [
["validate", CreateJourneyParamsValidator],
"scopeToSelf",
],
apiRoute: {
path: "/v3/journeys",
method: "POST",
rateLimiter: { max: 2000 },
},
})
export class CreateJourneyAction extends Action {
async handle(params: ParamsType, context: ContextType): Promise<ResultType> {
// Implementation
}
}
Repository Pattern
Always use the sql template literal for parameterized queries:
import { sql } from "@/lib/pg/sql.ts";
const result = await this.connection.getClient().query(sql`
SELECT * FROM carpools WHERE id = ${id}
`);
No ORM is used. DenoPostgresConnection.ts is the current provider (replaces LegacyPostgresConnection.ts).
API Routing
- External REST:
GET/POST/PUT/DELETE /v3/{service}/{action} - Internal RPC:
POST /rpcwith{ "method": "service:action", "params": {...} }
Routes defined in api/src/pdc/proxy/HttpTransport.ts.
External routes should be defined in the Action decorator.
Internal RPC calls are being migrated to shared providers in api/src/pdc/providers.
Service Modules
Located in api/src/pdc/services/:
| Service | Purpose |
|---|---|
acquisition | Trip data capture from operators |
auth | Authentication (JWT, ProConnect, Dex) |
dashboard | CRUD for users, operators, territories for app-partners |
export | Data export functionality |
policy | Carpooling campaigns |
operator | Operator management |
territory | Territory/jurisdiction management |
apdf | APDF reporting |
cee | Mobility tax incentive (CEE) |
honor | PDF certificate generation |
geo | Geolocation services |
company | Company lookup (INSEE API) |
Shared Types
Domain interfaces in shared/ directory — import with @pdc/shared/{domain}.
Being deprecated as the older frontend was removed in favor of app-partners.
Docker Compose Overlays
docker-compose.base.yml- Service definitions (no exposed ports)docker-compose.dev.yml- Exposes ports for localhost development (defaultjust dc)docker-compose.proxy.yml- Adds Traefik for *.covoiturage.test domainsdocker-compose.e2e.yml- E2E test configuration (just dc_e2e)
Run just add-hosts to add domain aliases to /etc/hosts.
Deno Configuration
api/deno.jsonc:
- Import aliases:
@/maps to./src/(use Deno's Organise Imports LSP feature) - Legacy decorators enabled for Inversify
- Line width: 120 for formatting
Development Notes
- NixOS users: Add
DOCKER_SOCK=/run/user/1000/docker.socktoapi/.env - Use
just seed-local-usersfor test accounts (requiresAPP_ENV=local) - Keep test databases with
APP_POSTGRES_KEEP_TEST_DATABASES=true, then clean withjust drop_test_databases - Pre-commit: Talisman for secret detection configured in
.talismanrc. Runpre-commit installwhen hook not found.
Signals
- GitHub stars
- 36
- Forks
- 12
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
api- Source
- github.com/covoiturage-gouv-fr/mono