swiparr
AGENTS.md799 starsChanged 12 days agoMITView on GitHub
Agent contract for this repo. The product is Messer Swipe: a swipe deck over a Jellyfin, Emby, Plex or TMDB library. Project skill: swiparr (load it first — it carries the live traps). A single-user-ish Next.js app that turns a media library into a Tinder-like deck, solo or in a group session. One repo, one deployable container (ghcr.io/jakobbjelver/messer-swipe), one stack in Komodo (video-stack). Providers are interchangeable behind one interface; a Jellyfin instance can also mix TMDB streaming catalogues into the…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,196 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 repository3 other files it gives its agents.
- docs/agents.mdAGENTS.md
- docs/llms.txtllms.txt
- messer-swipeSkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 1 is common, 0 are distinctive, and 5 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 58
MediaItem.Kindabsent means movie: Read it with itemKind(); never ?? - Very specific: line 68
src/proxy.tsis the only middleware: All request-level logic (CSP, auth, base-path rewrites) lives there. - Very specific: line 76
Tests are
node:test: Do not add vitest/jest; the lockfile cost is not worth it. - Very specific: line 97
Commit as Jakob (Jakob Bjelvér <jakobbjelver@gmail.com>).
- Very specific: line 98
After changing a provider or the deck service, prove it through /api/media/items — a helper having a test is not evidence the deck uses it.
- Common: line 104
Never accept a credential in chat.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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 — Messer Swipe
Agent contract for this repo. The product is Messer Swipe: a swipe deck over a Jellyfin, Emby,
Plex or TMDB library. Project skill: swiparr (load it first — it carries the live traps).
What this is
A single-user-ish Next.js app that turns a media library into a Tinder-like deck, solo or in a group
session. One repo, one deployable container (ghcr.io/jakobbjelver/messer-swipe), one stack in
Komodo (video-stack). Providers are interchangeable behind one interface; a Jellyfin instance can
also mix TMDB streaming catalogues into the same deck ("hybrid").
Read first
| File | Why |
MESSER.md | UI adoption record: brand, canon version, deviations |
.github/CONTRIBUTING.md | commit conventions (semantic-release reads them) |
AGENTS.md (this file) | invariants and commands |
PROJECT.yaml | machine-readable facts the audit cross-checks |
.hermes/plans/ | the shows/2.0 programme and its execution log |
Layout
src/app/ routes: deck (/), login, /ui sink, /healthz, /readyz, api/*
src/components/ deck, movie, shows, session, likes, settings, ui (shadcn atoms, local)
src/lib/providers/ jellyfin | emby | plex | tmdb + factory, item-source, mappers
(map.ts is provider-free on purpose: unit tests import it)
src/lib/services/ media-service (deck assembly), session-service, auth-service
src/lib/ pure helpers with their own *.test.ts siblings
src/db/ drizzle schema + generated SQL migrations (src/db/migrations)
src/styles/messer/ generated canon files — never edited by handCommands
npm ci # install (lockfile committed; Node 24+)
npm run dev # next dev on :3000 (needs a host-reachable JELLYFIN_URL)
npm run build # migrations + next build
npm run lint # eslint .
npm run typecheck # tsc --noEmit (authoritative; the patch tool's lint is not)
npm test # node --import tsx --test "src/**/*.test.ts"
npm run check # lint + typecheck + test — run before every commit
npm run doctor # env, provider reachability, db, version
npm run e2e # UI contract on a running instance (needs E2E_BASE_URL, defaults :3000)
npm run db:migrate # apply migrations (tsx)
npm run db:generate # new migration from schema changesThe canonical dev server is the Portal action (actions/actions.json, PM2 messer-swipe-dev) on
dev-server.messer.wtf; it overrides JELLYFIN_URL with the OrbStack name because a host process
cannot resolve Docker service names.
Invariants
MediaItem.Kindabsent means movie. Read it withitemKind(); never?? "movie"inline.src/lib/providers/item-source.tsis the only parser of typed ids (tmdb:movie:,tmdb:tv:). ForgetItemDetailspassdetailsIdFor(id, providerType): TMDB needs the prefixed id, every other provider the bare one. Stripping first resolves a series to the film that shares its numeric id.- A provider declares a capability only when its adapter exists.
hasSeries,hasSeasons,hasProgress,hasNextUpgate deck modes; a prematuretruerenders an empty deck with no error. deckModeis derived, filter chips are not. Storage carriesdeckMode+kinds; read them throughdeckModeOf()/withDeckDefaults()(src/lib/deck-mode.ts).- Every provider is reachable only through the factory, and the session's provider is the source of truth — never a client-supplied URL or provider.
src/proxy.tsis the only middleware. All request-level logic (CSP, auth, base-path rewrites) lives there;next.config.tsheaders()is build-time and runs after the middleware.- Mono is for machine values. Badges use the
metavariant; seeMESSER.md. - Icons are Phosphor (
@phosphor-icons/react/dist/ssr),weight="fill"only for state. The swipe mark isCardsThreeturned 270° (mark.rotatein messer-ui,rotate-[270deg]here) so the cards stand up with the thin ones on the left; the tab glyph uses the same turn. - A new provider mapper is a pure function in a
map.tswith no axios/Next import, so it is testable without a runtime. - Tests are
node:test. Do not add vitest/jest; the lockfile cost is not worth it. - An image request carries a size the provider understands.
imageQueryFor()(src/lib/image-request.ts) is the only place that knows a provider's dialect — Jellyfin/EmbymaxWidth, Plex's photo transcoder, TMDB's path segment — and the route forwards nothing a client sends unfiltered. A rawwidthis ignored by Jellyfin, which then re-encodes the original 2000×3000 poster per card, and ignored by Plex's/thumb, which serves it whole (issue #94).MAX_IMAGE_WIDTH(default 960) caps what any client may ask for. - A deck fetch never asks a provider for
Episode. A card is a show:deckFetchKinds()mapsepisode/season→seriesbefore any whole-library fetch, and the episodes deck is the bounded set of unwatched episodes of the shows you are watching, not a scan of the library. - The agent surface is
/api/v1, and it calls services — never the app's own HTTP API. Every handler is wrapped inagentRoute(scope, action, …)fromsrc/lib/agent/route.ts, which owns the bearer check, the envelope and the audit row;bin/messer-swipe.mjsis the only client shipped here, and the token it uses is minted by the container at first admin login. The UI's/api/*stays private; a new capability means a new/api/v1handler, not a second implementation.
Working rules
- Commits follow
.github/CONTRIBUTING.md.fix:only for the first attempt at a bug; iterations usechore:,refactor:orchore(fix):— eachfix:publishes a release onmaster. - Branch:
developis the working branch,masterreleases. Never commit tomasterby hand. - Commit as Jakob (
Jakob Bjelvér <jakobbjelver@gmail.com>); Vercel only builds his commits. - After changing a provider or the deck service, prove it through
/api/media/items— a helper having a test is not evidence the deck uses it. - UI changes are proven with
npm run e2e, which answers the media API from fixtures and asserts the things a unit test cannot see (a rating rendered once, a switch whose knob is the paper colour, a whole row that toggles, a sheet with no shadow). It writes screenshots toe2e/shots/. A visual fix reported without this is a guess. - Never accept a credential in chat; ask for a revocable token.
- Public communication (release notes, catalog PRs) is drafted for approval first.
Where the depth is
- Project skill
swiparr— provider traps, deploy and release flow, live verification recipes. MESSER.md— UI deviations with dates and exits..hermes/plans/2026-11-10_0015-messer-swipe-programme.md— 2.0 scope and decisions.CONTRIBUTING.md— commit and review conventions.docs/maintaining.md— the maintenance engine (sensors, brief, approval, applier) and the three things that break silently.
<!-- BEGIN:nextjs-agent-rules -->This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ (resolved from this file's directory; in monorepos the next package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by next dev — verify at node_modules/next/dist/server/lib/generate-agent-files.js. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
<!-- END:nextjs-agent-rules -->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.

