resumix
Copilot instructions5 starsChanged 2 months agoMITView on GitHub
resumix turns a job description into a tailored, two-page LaTeX CV and an optional cover letter. It is a uv workspace of three packages, split so each can be deployed and tested independently: Dependency direction is one-way — client → contracts ← server, never client ↔ server — and enforced by tests/test_architecture.py (AST-based: it fails the build if either side imports the other, or if contracts pulls in anything heavier than pydantic). Read AGENTS.md first for the principles this design…
- Reads credentials
- Commits and pushes
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-clientSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
No usage/token fields here: each model call logs its own spend as one line.
- Distinctive: line 221
Keep the code simple; this is a personal tool wearing production-shaped seams (SOLID, tests, sandboxing) because it is a portfolio piece — …
- Distinctive: line 255
No test may need an API key, a network socket, or a terminal.
- Distinctive: line 267
If a design decision was not addressed or clarified in the prompt and implementing it one way forecloses another, stop and ask.
- Distinctive: line 274
Keep decisions as simple as possible — this is not over-engineered production code.
- Distinctive: line 278
If a decision introduces a lot of complexity for a small improvement, stop and ask before implementing it.
- Distinctive: line 280
Prefer clear contracts with mandatory parameters over defaults scattered across a method signature.
- Distinctive: line 282
Never commit or push — git commit/git push are strictly forbidden.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
Copilot Instructions — resumix
resumix turns a job description into a tailored, two-page LaTeX CV and
an optional cover letter. It is a uv workspace of three packages, split so
each can be deployed and tested independently:
contracts/ resumix_contracts — pydantic models + envelope + the free JD guess
server/ resumix_server — stateless FastAPI service: LLM calls + pdflatex
client/ resumix_client — the thing you run: clipboard/watch/submit/renderDependency direction is one-way — client → contracts ← server, never
client ↔ server — and enforced by tests/test_architecture.py (AST-based:
it fails the build if either side imports the other, or if contracts pulls
in anything heavier than pydantic). Read AGENTS.md first for
the principles this design follows (SOLID, one job per class, no hidden
global state); this file is the file map and the day-to-day commands.
Components (file map)
contracts/src/resumix_contracts/ — the wire format, nothing else
payloads.py—CVStatus(status,detail: where a CV job is now and one line about the step before, no history),RenderedCV(tex,pdf_base64,document),CoverLetter,ServerStatus. The CV document is a raw flat dict with no schema — what the model wrote with yourcandidate_datamerged over the top. The schema the CV model writes to is not here — seepipeline/cv_schema.py.jd.py—JDAnalysis(the analysis endpoint's output),JDDetection(is_job_description: bool, nothing else — the reason lives in the log, not the reply).envelope.py—Envelope[T](request_id,ok,data,error— every endpoint returns this shape, success or failure),LogEntry,RequestLog. No usage/token fields here: each model call logs its own spend as one line.guess.py—static_jd_guess(text) -> bool, the free structural check (length band, no binary) both sides can run before paying for anything.
server/src/resumix_server/ — personal data arrives per request and is
dropped when it ends; a request's own directory is the only thing kept
api/app.py—create_app(), the ASGI middleware that mints the request id (filtered: it names a directory) and sets the log collector contextvar, and the startup sweep that fails jobs a dead process left running.api/deps.py—AppState,envelope_for()/envelope_of(),claim_slot(),execute()(the blocking endpoints: semaphore + threadpool hop + scratch dir + the log on disk afterwards).api/jobs.py— the CV worker thread: re-establishes theRun, reports each step by rewritingstatus.json, stores the result or the failure.jobstore.py— one directory per request underRESUMIX_WORK_DIR(status.json,result.json,log.json,work/), atomic writes, pruned to the newest 200.api/routers/{health,jd,cv,letter,logs}.py— one router per resource.logs.pyisGET /logs/{request_id}againstjobstore.py's directory per request underRESUMIX_WORK_DIR(newest 200 kept) — the one piece of state the server holds, and it is disposable.api/errors.py— mapsPipelineError/ValidationError/openai.APIErrorto a status and anok:falseenvelope; never echoes the provider body.pipeline/cv_generator.py—CVGenerator: write → validate → regenerate (up tomax_attemptsrounds) → keyword highlight → render for good. Returns(document, tex, pdf, summary). Pure library code — inputs in memory, outputs returned, nothing read from a configured path; progress leaves through an injectedprogress(status, detail)callback, not a file.pipeline/cv_validator.py—CVValidator: what is wrong with one CV, as one list of violations — the content review against the master profile, then the render and the page count, whose condense instruction is appended as the last violation. Every attempt is rendered, rejected or not: a compile is cheap next to a model call. The review runs until it passes once.pipeline/cv_renderer.py—CVRenderer: Jinja (\VAR{}/\BLOCK{}delimiters,DictLoaderbuilt fresh per request since the template can be client-supplied) →pdflatex, sandboxed (-no-shell-escape,openin_any=p/openout_any=p, no stdin, a timeout, its own scratchmkdtempremoved in afinally) → page count.pipeline/jd_validator.py,pipeline/letter_generator.py— the other two LLM pipelines; same shape ascv_generator.py.pipeline/cv_schema.py—TailoredCVData, the CV model's output schema and the response model ofPOST /v1/cv. EveryField(description=...)is restated in a prompt — editing one changes model behaviour.extra="allow", so an undeclared field survives validation and reaches the template;prompt_schema()is the closed variant that goes into the request, because strictjson_schemaendpoints refuseadditionalProperties: true.model_selector.py—ModelSelector, one OpenAI-compatible endpoint per role (detect/summary/cv/review/highlight) fromresources/models.toml. Every LLM call ends with onelogger.infoline carrying model, duration and token counts — this is the entire token-accounting story; there is no per-request total anywhere.bundle.py—ResourceBundle(impersonal: prompts, template, image assets keyed by file name — built once at startup,with_overrides()per request) vs.CandidateInputs(personal: profile and preferences — always per-request, never cached, never written to disk). No candidate data: no endpoint takes it, because no model reads it.observability.py—Run/NullRun,current_runcontextvar,stage()context manager, the logging handler that turns log records intoLogEntrys for the run.
server/resources/ — the impersonal defaults baked into the image: four
prompts, resume.tex.jinja, models.toml, a blank candidate_signature.png
(the one image the stock template includes; a request's own images are merged
over the defaults by file name).
Packaged as resumix_server.resources (see server/pyproject.toml) so
importlib.resources still finds it despite living outside src/.
client/src/resumix_client/ — your data, a bearer token, no Python
required to run it (PyInstaller --onefile)
api.py—ResumixApi(Protocol) /HttpApi(httpx) — the only module that knows the server exists.ResumixErrorcarriesrequest_idso a caller can fetch what the server did.config.py/discovery.py— settings resolution, highest precedence first: CLI flag → env var →resumix.toml→ file found next to the executable → server default.CONFIG_KEYSmaps short TOML keys to the filenamesdiscovery.pylooks for.joblog.py—JobLog(per-joblog.log, client steps + folded-in server log),format_entries()(same rendering, forresumix logs <id>).workspace.py—Workspace: owns theworking/error/discarded/cvfolder tree, atomic moves, the daily subfolders.new_job()never replaces a folder of the same name (a CV may still be written in it).pending()andclean()serve clipboard's startup question about leftovers.sources/clipboard.py—ClipboardSource, aJDSource:poll()returns the clipboard's text once each time it changes.stages/— the one pipeline every mode runs on (it imports nothing frommodesorsources;tests/test_architecture.pychecks).analysis.py(free check → detect → analyze, for every new posting),inbox.py(watch's--in, on a thread),approval.py(watch's question: y/d/s/n/q or a URL),intake.py(clipboard's and submit's question: URL/y, n/s, q — every posting is asked about, and waits asPENDINGwhile you read),listener.py(clipboard's main thread: leftovers first, then the clipboard,qwhen idle),generation.py(the CV queue: on a thread for watch and clipboard, drained inline by submit), andworking.py(WorkingProcessor: every move, the duplicate check and both queues, under one lock). A folder goes wherejobfolder.route()says — the same pure table for new postings, dropped folders and leftovers inworking/.watcher.pyruns a foreground loop and the background stages:qfinishes what is running, Ctrl-C stops at once.modes/{clipboard,watch,submit,submit_raw,render,logs}.py— thin: build the stages and run them (clipboardasks r/c/q about leftovers first;submitwrites its CV on the main thread and returns when it is filed), or (forsubmit-raw/render/logs) call the API directly.tracking.py—XlsxTracker(openpyxl,applications.xlsx) /NullTracker.ui.py—Confirmerprotocol (PromptConfirmer, which reads theKeyboard, /AutoConfirmerfor--yes), the analysis table, the recovery prompt.
Shared
examples/candidate/— a fictional profile/data/preferences/image set, shipped so a fresh download has something to run against immediately.tests/test_architecture.py— the one-way dependency rule, enforced.tests/test_integration.py— client and server together in one process (httpx against the real ASGI app viastarlette.testclient.TestClient, only the model call faked) — the one test that catches the two sides disagreeing about the wire format.
Key contracts & invariants
- Every response is the same envelope, success or failure:
{request_id, ok, data, error}, whereerroris one string. Nothing else rides on it — no logs, no usage — so the common case pays nothing for what it does not ask for. GET /logs/{request_id}is the only way to see what a request did. Backed by that request's directory underRESUMIX_WORK_DIR(jobstore.py, newest 200 kept); an id that was pruned, that failed before any work started, or that landed on a different instance, is a404. The client fetches it after every call with--debug, and always on failure.- Token spend is per model call, not per request.
model_selector.pylogs one line per call (model, duration, prompt/completion tokens); there is no aggregate anywhere in the envelope or the contracts. - The CV document is one flat dict with no schema — whatever your LaTeX
template reads, put it in
candidate_data.jsonand it flows through untouched. It is{**what the model wrote, **your candidate_data}, so your own data wins a collision and the model can never replace a real contact detail. The client stores it and posts it back to/v1/cv/renderwithout parsing a field of it. POST /v1/cvis accept-then-poll and takescandidate_data. It answers202with a job id;GET /v1/cv/{id}/statusgives{status, detail}(the current step only, no history) andGET /v1/cv/{id}gives{document, tex, pdf_base64}once it saysEND. The job runs in a detached thread that reports by rewritingstatus.json.candidate_datais there because the loop compiles the CV to count its pages — no model is shown it.- The LaTeX subprocess is always sandboxed: shell escape off
(
-no-shell-escape,shell_escape=f), reads/writes confined to the per-request scratch dir (openin_any=p/openout_any=p), no stdin, a timeout. A client can supply the template and a whole.tex— treat both as hostile input. On a compile failure the TeX log tail goes to the server's own log, not into the error body (it is kilobytes; ask for it via/logsif you need it). submitcopies its input;watchdeletes it once handed over. An inbox gets emptied; an argument you named does not disappear.- Concurrency: one
BoundedSemaphore(RESUMIX_MAX_CONCURRENT_JOBS)(default 10) gates job handlers →429+Retry-Afterwhen full. No second gate for the LaTeX compile — it is fast enough not to need one. - Every model reply is re-validated. The schema is shown in the prompt
and requested via
response_format, and the reply is parsed by pydantic; aValidationErroris fed back to the model rather than trusted.
Conventions
- Python 3.12,
uvworkspace (pyproject.tomlat the root plus one per package);uv syncinstalls all three in editable mode. Console scripts:resumix-api(server),resumix(client). - LLM access via any OpenAI-compatible endpoint — one provider, one API key
(
MODEL_API_KEY/MODEL_BASE_URL; see.env.example), declared once in the[provider]table ofserver/resources/models.toml. A role withuse_alternate_provider = N(N ≥ 2) calls provider N instead (MODEL_API_KEY<N>/MODEL_BASE_URL<N>). The five roles (detect/summary/cv/review/highlight) each declare only model name and generation settings, which can also be overridden per role viaRESUMIX_<ROLE>_<FIELD>env vars (model/temperature/thinking/ reasoning_effort/thinking_budget/structured_output/use_alternate_provider; an empty thinking_budget unsets a budget declared in models.toml, which is how reasoning_effort wins back the request). %-style lazy logging args, never f-strings insidelogger.*— sanitized LaTeX can reach a log line and a literal%would break the formatter.- LaTeX templates use Jinja delimiters
\VAR{}/\BLOCK{}; escaping is done by_sanitize_latex/_sanitize_objincv_renderer.py— keep{}guard groups intact. - Console prints in the client use
flush=True(long-lived watch/clipboard processes). - Docker: classic builder only — no BuildKit features, no heredocs in a
Dockerfile (
Dockerfile, at the repo root, built withDOCKER_BUILDKIT=0). - PyInstaller (
client/packaging/resumix.spec), not Cython — Cython still needs an interpreter and does not produce a standalone exe. Build on the target OS; it does not cross-compile. - Keep the code simple; this is a personal tool wearing production-shaped seams (SOLID, tests, sandboxing) because it is a portfolio piece — do not add speculative options beyond what is asked.
Commands
# setup (once, after cloning or when deps change)
uv sync
# run from source
uv run resumix-api # the server
uv run resumix clipboard --out ~/applications # the client
# tests — all four suites, no API key, no network
uv run pytest
uv run pytest server/tests # one package only
uv run pytest -k architecture # the dependency-direction rule
# the server image (classic builder only)
DOCKER_BUILDKIT=0 docker build -t resumix-server .
docker run --rm -p 8080:8080 --env-file .env resumix-server
# the client executable (build on the OS you are targeting)
uv run --with pyinstaller pyinstaller client/packaging/resumix.specpdflatex-dependent tests skip themselves when it is not on PATH.
server/tests/server_helpers.py wires a real ModelSelector to a fake HTTP
client, so request assembly and structured-output negotiation stay under
test with no network call.
Testing guidance
- No test may need an API key, a network socket, or a terminal.
- Fake at the transport boundary, not above it — inside
ModelSelectorfor the server, behind theResumixApiprotocol (FakeApi) for the client — so the code that assembles a request is what actually runs under test. server/tests/golden/cv_golden.texpins the whole render byte-for-byte; an escaping regression is otherwise invisible until someone reads a bad PDF.tests/test_integration.pyis the one place both packages run together; keep it passing before touching either side's contract usage.
Interaction with the user
- The user is skilled: be concise.
- If a design decision was not addressed or clarified in the prompt and implementing it one way forecloses another, stop and ask.
Code style
- Clean up local variables that are only assigned or incremented with no effect on the logic.
- Keep decisions as simple as possible — this is not over-engineered production code; it borrows production patterns (typed contracts, sandboxing, tests) only where the split into a server/client actually requires them.
- If a decision introduces a lot of complexity for a small improvement, stop and ask before implementing it.
- Prefer clear contracts with mandatory parameters over defaults scattered across a method signature.
- Never commit or push —
git commit/git pushare strictly forbidden; the user reviews and commits every change.
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.

