add-application-field
Skill2 starsChanged 6 months agoMITView on GitHub
Add a new field to the ApplicationMeta schema (the meta.json shape). Use this when the user wants to track additional per-application data. Covers the cross-cutting parts that are easy to half-do — backwards compatibility with existing snapshots, CLI/MCP surface decisions, and invariants.
In this repository3 other files it gives its agents.
- add-cli-commandSkill
- add-mcp-toolSkill
- smart-job-searchSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Required fields break every existing snapshot: Don't do this unless you're prepared to write a migration that backfills the field for every …
- Distinctive: line 15
Default to optional unless there's a strong reason.
- Distinctive: line 63
README: Add the field to the user-facing README only if a user of the CLI/MCP needs to know about it.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill 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
Add a field to ApplicationMeta
The schema is defined in src/jobtrack/models.py. Every existing meta.json on disk is a record someone already submitted — backwards compatibility is not optional. This skill covers the cross-cutting changes a new field requires.
Decide first: required or optional?
- Required fields break every existing snapshot. Don't do this unless you're prepared to write a migration that backfills the field for every
meta.jsonalready on disk. - Optional fields are safe. Pydantic loads existing snapshots fine if the field has a default (
= None,= "",= Field(default_factory=list), etc.). This is almost always what you want.
Default to optional unless there's a strong reason. The flight-recorder principle: old snapshots are historical artifacts; we don't rewrite them.
Decide second: capture surface
How does the field get populated?
- At
addtime — new flag onjobtrack add(CLI) and a new parameter oncore.add_application(...). - Post-hoc edit — new CLI command (use
add-cli-commandskill) and likely a new MCP write tool (useadd-mcp-toolskill). Examples in-tree:note,tag. - Computed from existing files at add-time — like
resume_hash. Computed incore.add_applicationafter the file is copied into the snapshot dir; never trust the source path.
The pattern
- Add the field to
ApplicationMetainmodels.py. Group it with the existing optional fields:class ApplicationMeta(BaseModel): # ... required fields ... status_history: list[StatusEvent] # Optional jd_url: str | None = None cover_letter_file: str | None = None notes: str = "" tags: list[str] = Field(default_factory=list) my_new_field: str | None = None # <-- here - If the field has an invariant, encode it in a
@model_validator(mode="after"). See the existing_check_initial_statusvalidator for the canonical pattern (status_history[0]agreement withapplied_at). Invariants enforced by pydantic stay enforced everywhere — CLI, MCP, direct edits tometa.json. - Populate it where the data comes from:
- At-add fields: thread the parameter through
core.add_application(...)and atyper.Option(...)incli.py::add. Pass it into theApplicationMeta(...)constructor. - Post-hoc fields: add a
core.set_<field>(app_id, value)function that reads viastorage.read_meta, mutates, writes viastorage.write_meta. Mirror theadd_note/edit_tagsshape. - File-snapshot fields (like an extra captured document): copy into the snapshot dir via
storage.copy_into_snapshot(...), store the filename (not the path) in the field. Same pattern ascover_letter_file.
- At-add fields: thread the parameter through
MCP exposure decision. Two helpers in
mcp_server.pyshape MCP output:_full(meta)callsmeta.model_dump(mode="json")— new fields appear automatically inget_application,get_recent, and anywhere else_fullis used._summary(meta)builds a dict by hand with explicit fields (id,company,role,applied_at,status,tags) — new fields do NOT appear unless you edit_summary. Used bylist_applications,search_applications, and as the"updated"payload in write-tool responses.
Decide whether the field belongs in the small list view (edit
_summary) or only in the detailed view (do nothing,_fullalready shows it).- Search consideration. If the field is text the user might search by, update
search_applicationsinmcp_server.pyto include it in the matched-fields scan. Note that file-based content (resume text, JD, cover letter) is searched by reading the snapshot file, not by reading meta.json — onlynotesis searched out ofmeta.jsontoday. - Tests — three places:
tests/test_storage.pyif the field affects on-disk shapetests/test_core.pyfor the business logic (capture, mutation, invariants)tests/test_mcp_server.pyonly if you're adding new tool surface — otherwise the existing tests catch regressions via_full/_summary
- Backwards-compat test. Worth adding a test that loads a fixture
meta.jsonwithout the new field and confirmsApplicationMeta.model_validate(...)succeeds. One-line guardrail that prevents anyone from accidentally making the field required later. - README. Add the field to the user-facing README only if a user of the CLI/MCP needs to know about it. Internal/computed fields don't warrant a mention.
Worked example — adding recruiter_email
A user wants to record the recruiter's email per application, set at add-time, editable post-hoc.
models.py:recruiter_email: str | None = Noneunder the optional block.core.add_application: addrecruiter_email: str | None = Noneparameter, pass into the constructor.cli.py::add: addrecruiter_email: Optional[str] = typer.Option(None, "--recruiter-email"). Pass through.core.py: addset_recruiter_email(app_id, email)— mirroradd_note.cli.py: addrecruiter_email_cmdcommand (use theadd-cli-commandskill). Or fold it into a more generaleditcommand — design call.mcp_server.py: addset_recruiter_emailwrite tool (use theadd-mcp-toolskill). It'll show up in_fullautomatically because pydantic dumps it; consider whether_summaryshould include it (probably not — too long for a list view).- Tests: round-trip in
test_core.py, write tool intest_mcp_server.py, backwards-compat intest_storage.py.
Anti-patterns
- ❌ Making the field required without writing a backfill. Existing snapshots will fail to load.
- ❌ Storing absolute paths. Always store filenames relative to the snapshot dir (see
resume_file,jd_file,cover_letter_file). - ❌ Mutating existing snapshots to backfill a new optional field. Snapshots are immutable — that's a load-bearing invariant from the brief.
- ❌ Adding a field that duplicates information already on disk. If the data can be computed from existing snapshot files, compute it; don't denormalize into
meta.json.
Verify
uv run pytest -vAnd manually load an old snapshot:
uv run python -c "from jobtrack import storage; print(storage.list_meta())"This must not error on any pre-existing meta.json.
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.

