mercury
AGENTS.md0 starsChanged 5 months agoUnlicenseView on GitHub
Working notes for AI agents (and humans) contributing to Mercury. This file holds the project conventions, architecture, build/dev workflow, and gotchas that don't belong in the user-facing README. A job-search companion split into two halves: 1. Skills (skills/*/SKILL.md) — plain-markdown agent skills loaded by any skill-aware assistant (opencode, Claude Code, Cursor, …). They orchestrate the LinkedIn MCP + Chrome MCP and persist results through the mercury CLI. 2. App (app/) — a Bun + TypeScript CLI that is BOTH the…
- Pipes a download into a shell
- Commits and pushes
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 31,774 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 repository7 other files it gives its agents.
- experience-bankSkill
- job-scoutSkill
- outreach-trackerSkill
- portal-fillerSkill
- profile-optimizerSkill
- recruiter-outreachSkill
- resume-tailorSkill
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
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 28
One schema, one source of truth: Every mutation goes through the mercury CLI write subcommands (recruiter, job, metric, score, interview, …
- Very specific: line 34
After a write the CLI pings a running dashboard via ~/.mercury/dashboard.lock ({port,token}) so the UI live-refreshes over WebSocket.
- Very specific: line 99
No new SQL outside
db//CLI: Add a write subcommand instead. - Very specific: line 109
Skills persist via the CLI: When adding a skill capability that produces trackable data, add the matching mercury … call to its SKILL.md …
- Very specific: line 129
Before tagging, add a section to CHANGELOG.md for the new version using the Keep a Changelog format (## [X.Y.Z] - YYYY-MM-DD).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Working notes for AI agents (and humans) contributing to Mercury. This file holds the project conventions, architecture, build/dev workflow, and gotchas that don't belong in the user-facing README.
What Mercury is
A job-search companion split into two halves:
- Skills (
skills/*/SKILL.md) — plain-markdown agent skills loaded by any skill-aware assistant (opencode, Claude Code, Cursor, …). They orchestrate the LinkedIn MCP + Chrome MCP and persist results through themercuryCLI. - App (
app/) — a Bun + TypeScript CLI that is BOTH the dashboard launcher AND the write API the skills call. Ships as a single compiled binary with the Svelte UI embedded.
Architecture
skills ──(agent runs `mercury …` via bash)──▶ ~/.mercury/mercury.db (SQLite, WAL)
▲
mercury dashboard ──Bun.serve + WebSocket──────────────┘ (reads + live-updates)
├─ MCP client → LinkedIn MCP (hybrid instant search)
└─ ACP client → opencode / Claude Code (Launch tab runs skills)- One schema, one source of truth. Every mutation goes through the
mercuryCLI write subcommands (recruiter,job,metric,score,interview,application,answer,activity). Read/utility helpers:match,detect-portal,export. Never have a skill write SQL or markdown directly. (The dashboard's Answers tab writes viaPOST /api/answer, which uses the same upsert asmercury answer setand broadcasts achangedevent.) - After a write the CLI pings a running dashboard via
~/.mercury/dashboard.lock({port,token}) so the UI live-refreshes over WebSocket. - Server binds
127.0.0.1on a random port with a URL token. Never expose it.
Key directories
app/
├── src/
│ ├── cli/ # command entry + write subcommands + setup
│ ├── db/ # schema, connection (bun:sqlite, WAL), change notify
│ ├── server/ # Bun.serve dashboard, REST/WS, queries, embedded assets
│ ├── mcp/ # LinkedIn MCP client + hybrid search
│ ├── acp/ # ACP client, provider registry, session manager
│ └── paths.ts # ~/.mercury path resolution + config
└── web/ # Svelte 5 dashboard (Vite build → embedded into the binary)
skills/ # the agent skills (copied into agent dirs by `mercury setup`)
bootstrap.sh # curl|bash installer/updater (prebuilt binary + source fallback)The .mercury/ user data dir
Per-user job-search state lives at ~/.mercury/ (override with MERCURY_HOME):
~/.mercury/
├── mercury.db # SQLite (WAL): recruiters, jobs, metrics, interviews, …
├── config.json # provider + preferences
├── dashboard.lock # {port,token,pid} of a running dashboard
├── update-check.json # cached release-check result
├── src/ # repo clone (bootstrap source path) — `mercury setup` reads skills here
├── base/ experience/ tailored/ cover-letters/ reports/ logs/ # resume-tailor + experience-bank artifactsBuild & dev
Requires Bun.
cd app
bun install
bun run dev # run the CLI from source: bun run src/cli/index.ts
bun run typecheck # tsc --noEmit (must pass before committing)
bun run build # build:web → embed assets → compile single binarybun run build chains:
build:web— Vite builds the Svelte app toapp/web/distembed—scripts/embed-assets.tsinlinesweb/distas base64 intosrc/server/assets.gen.ts(so the binary is self-contained)build:bin—bun build --compile→app/dist/mercury
Convention:
app/src/server/assets.gen.tsis generated. Keep it committed as an empty map (export const EMBEDDED_ASSETS = {}) — the build regenerates it. Reset it to empty before committing so diffs stay clean.
Installing your local build
install -m 755 app/dist/mercury ~/.local/bin/mercury
mercury setup --all # copy skills into every detected agentConventions
- No new SQL outside
db//CLI. Add a write subcommand instead. - bun:sqlite named params can't use a
$statusJS shorthand key — that's not a valid identifier. Type binding objects asRecord<string,string|number|null>. Bun.serve<WSData>takes a single generic in this Bun version (not two).- Svelte 5 runes:
bind:thistargets must be declared with$state()or the effect that uses them won't re-run. - ACP: providers live in
src/acp/providers.ts. Each returns{cmd, env?}. Model selection is threaded as an optionalmodel→OPENCODE_CONFIG_CONTENT(opencode) orANTHROPIC_MODEL(Claude Code). Model lists come fromopencode models/claude config listat runtime. - Skills persist via the CLI. When adding a skill capability that produces
trackable data, add the matching
mercury …call to its SKILL.md and a write subcommand if needed.
Releases (maintainers)
CI (.github/workflows/release.yml) builds and publishes on tag push:
git tag v0.3.0 && git push origin v0.3.0The workflow pins app/package.json to the tag, cross-compiles all five targets
(linux-x64, linux-arm64, darwin-x64, darwin-arm64, windows-x64.exe) with
bun build --compile --target=…, writes SHA256SUMS, and attaches them to a
GitHub Release. The bootstrap then downloads the prebuilt binary (SHA-verified),
falling back to a source build if no target matches.
Changelog → release notes
Before tagging, add a section to CHANGELOG.md for the new version using the
Keep a Changelog format
(## [X.Y.Z] - YYYY-MM-DD). The release workflow runs
scripts/extract-changelog.sh <version> to pull that section and use it as the
GitHub Release body. If no matching section exists, it falls back to GitHub's
auto-generated notes (so a missing entry won't fail the release — but always add
one). Keep an ## [Unreleased] section at the top for in-flight changes.
Update check internals
mercury checks the Releases API
at most once per 10h (cached in ~/.mercury/update-check.json) and prints a
one-line stderr notice when a newer tag exists. Best-effort: short timeout, never
blocks, silent when offline. Disable with MERCURY_NO_UPDATE_CHECK=1; redirect
with MERCURY_UPDATE_URL.
Gotchas (operational)
- LinkedIn analytics aren't API-exposed — they enter the system only when
profile-optimizerruns and callsmercury metric record --breakdown '…'. - The dashboard can't scrape LinkedIn itself; the Launch → Scan button drives
profile-optimizerover ACP to refresh metrics. - Backgrounded dev servers die when a parent shell command times out — use
nohup … & disownwhen testing the dashboard across shell invocations.
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.

