StationAPI AGENTS.md

A set of working rules for the StationAPI repository, a code project that provides train-station data through a GraphQL API. It describes the project layout, tools, data handling, testing, and deployment.

In plain words
What is it for?
Use it when changing StationAPI code, its station data, GraphQL schema, build process, or Cloudflare Worker deployment.
Why use it?
It gives coding agents and contributors shared instructions, helping them make changes that fit the project and keep releases predictable.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/trainlcd/stationapi/agents-md
Clone the repo
git clone --depth 1 https://github.com/TrainLCD/StationAPI

Made for: Codex, OpenCode.

Per session 6,146 This file is loaded in full into every session.
When invoked 6,146 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.06146 $0.06146
Opus 5 $0.03073 $0.03073
Sonnet 5 $0.01229 $0.01229
Haiku 4.5 $0.00615 $0.00615

Measured yesterday against content hash b9b120c524fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

StationAPI AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

StationAPI Repository Guidelines

This guide explains how automation agents and human contributors should work with the StationAPI repository so releases stay predictable, auditable, and safe. Update this file whenever you change the workflow or behavior it documents.

Project Layout

  • src/ – The Worker itself (stationapi-worker, wasm32 only). lib.rs holds the endpoints, index.rs parses the embedded CSVs into in-memory indexes, repository.rs implements the repository traits against those indexes, and graphql/ holds the async-graphql types and resolvers. index.rs also holds the spatial grid used by every coordinate lookup — see Coordinate lookups below.
  • schema/public.graphql – The published GraphQL schema. CI diffs the Worker's SDL against this file, so an unintended change fails the build.
  • build.rs – Stages generated/*.csv (falling back to data/*.csv) into OUT_DIR and pre-converts station_station_types into a fixed-width binary.
  • wrangler.jsonc – Staging and production deployment settings.
  • stationapi/src/domain/ – Entity definitions and repository abstractions. repository/ provides async_trait-based interfaces, and normalize.rs contains text normalization for search.
  • stationapi/src/use_case/ – Application logic. interactor/query.rs implements the QueryUseCase contract defined in traits/query.rs; dto/ converts entities into model types (this is where IPA and TTS segments are built).
  • stationapi/src/model.rs – The values the API returns. Formerly generated from .proto; kept as the layer between entities and GraphQL types.
  • preprocessor/ – Build-time CLI that assembles generated/*.csv from data/*.csv, the GTFS feeds, and the Tokyu ODPT JSON.
  • data/ – Canonical CSV datasets. Files follow the N!table.csv naming scheme. Detailed instructions are in data/README.md.
  • data_validator/ – CLI that verifies cross-file constraints (cargo run -p data_validator).
  • Makefile – Convenience targets (make help lists them all).

Read the full file on GitHub · 127 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 127 lines · 6,146 tokens per session scan A b9b120c524fe

Subscribe to this mod's changes

StationAPI AGENTS.md is an instructions file published in the GitHub repository TrainLCD/StationAPI (10 stars, last pushed 2d ago), licensed MIT. It adds 6,146 tokens to every session, about $0.0307 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.