flight-finder
AGENTS.md163 starsChanged 6 months agoMITView on GitHub
Guidance for AI coding agents working on Flight Finder, a self-hosted flight price tracker. This is the cross-tool entry point. See README.md for the product overview and API.md for the runtime HTTP API you can call against a running instance. - Before opening or updating a PR, read .github/PULL_REQUEST_TEMPLATE.md and fill every applicable section, including when using the GitHub CLI or API. Use the specialized template when one applies. - Every PR, including documentation and dependency updates, must link a…
- Reads credentials
- Installs packages
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.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 10
Before opening or updating a PR, read .github/PULL_REQUEST_TEMPLATE.md and fill every applicable section, including when using the GitHub …
- Distinctive: line 12
Use the specialized template when one applies.
- Distinctive: line 13
Every PR, including documentation and dependency updates, must link a real tracking issue.
- Very specific: line 16
Use Closes #123 only when the PR fully resolves the issue.
- Distinctive: line 18
Keep the issue and PR consistent with the final scope and validation results.
- Distinctive: line 19
Follow the session's authorization rules for publishing or editing them.
- Very specific: line 66
All four version points (root, apps/web, packages/cli, apps/desktop) are kept in lockstep.
- Very specific: line 71
TypeScript strict, no
any: Use early returns, at most 3 nesting levels, and keep source files at or below 1000 lines. - Very specific: line 81
Commits: use Conventional Commit subjects: feat:, fix:, docs:, refactor:, chore:, test:.
- Very specific: line 86
Never use .env files and never commit secrets.
≈ “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.
Files
AGENTS.md
Guidance for AI coding agents working on Flight Finder, a self-hosted flight price tracker. This is the cross-tool entry point. See README.md for the product overview and API.md for the runtime HTTP API you can call against a running instance.
Pull request workflow
- Before opening or updating a PR, read
.github/PULL_REQUEST_TEMPLATE.mdand fill every applicable section, including when using the GitHub CLI or API. Use the specialized template when one applies. - Every PR, including documentation and dependency updates, must link a real tracking issue. Search and reuse an existing issue, or open one describing the problem, expected behavior, and acceptance criteria before opening the PR.
- Use
Closes #123only when the PR fully resolves the issue. UseRelated to #123for partial work and list the remaining tasks. - Keep the issue and PR consistent with the final scope and validation results. Follow the session's authorization rules for publishing or editing them. An inspection-only request does not authorize creating an issue or PR.
- Record the author's actual review-assistance preference. Do not infer consent to AI-assisted follow-up work or merging.
Stack
TypeScript (strict) monorepo on Node >= 22, npm workspaces. Next.js 16 (App Router, React 19) web app, Prisma 7 over PostgreSQL 16, Redis 7 for caching and rate limiting, Playwright for scraping, Vitest for tests. The caller supplies secrets through the environment, never committed files.
Setup
npm install
docker compose up -d db redis # or: make setup
npm run db:push # apply the Prisma schema
npm run db:generate # generate the Prisma client
npm run dev # Next.js web app on http://localhost:3003make dev wraps the database, Redis, and dev-server steps.
Checks (run before every commit and PR)
npm run ci # lint + typecheck + test + build (web) + build (cli)
# or individually:
npm run lint # ESLint, both workspaces, --max-warnings 0
npm run typecheck # tsc strict, both workspaces
npm run test # Vitest, both workspacesnpm run ci must pass before you push; GitHub Actions runs the same gate. Linting
is zero-warnings and typecheck is strict (noUncheckedIndexedAccess).
Monorepo layout
apps/web: the Next.js app and API backend (@flight-finder/web). Prisma schema atapps/web/prisma/schema.prisma; core logic underapps/web/src/lib/(auth, prisma, redis, notifications, scraper).packages/cli: the Ink/React terminal UI (@flight-finder/cli). It reuses the scraper fromapps/webvia relative imports.apps/desktop: the Tauri (Rust) launcher. It is not an npm workspace and is built and versioned on its own.
All four version points (root, apps/web, packages/cli, apps/desktop) are kept
in lockstep; the /create-release flow bumps them together.
Conventions
- TypeScript strict, no
any. Use early returns, at most 3 nesting levels, and keep source files at or below 1000 lines. New source files must use a focused subdirectory when the current directory already contains 10 source files; the pre-commit hooks enforce both limits. - Styling is CSS Modules only (
Component.tsx+Component.module.css). No Tailwind, no inline styles. Server Components by default; add'use client'only when needed. - API routes validate input, return proper HTTP status codes, and respond via
the
apiSuccess()/apiError()helpers. - Tests target behavior, not implementation details (Vitest).
- Commits use Conventional Commit subjects:
feat:,fix:,docs:,refactor:,chore:,test:.
Secrets
Never use .env files and never commit secrets. Shared scripts must accept the
caller's environment without hardcoded secret-manager accounts or wrappers.
Provider API keys (Anthropic, OpenAI, Gemini, local)
resolve through resolveApiKey() in apps/web/src/lib/scraper/ai-registry.ts,
where DB-stored encrypted keys take precedence over env vars. Do not read
process.env.<PROVIDER>_API_KEY directly; go through the registry.
CLI shim gotcha
packages/cli maps @/* to packages/cli/src/ and reuses the scraper from
apps/web via relative imports. Any new @/lib/<x> import added to a shared
scraper file needs a matching shim in packages/cli/src/lib/ (re-export the real
module or provide a stub). Web-only tests pass without it; the full npm run ci
(web + cli) is what catches a missing shim.
Releasing
Releases are tag driven and version-locked across all four packages. Run the
pre-release gate first (the docker-smoke, install-flow, cli-runtime, and
migration scripts under scripts/), then use the
/create-release flow, which bumps every version point and regenerates the
lockfiles. Web tags are vX.Y.Z; desktop tags are desktop-vX.Y.Z.
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
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.

