--- name: apply-to-job description: Scores, tailors, stages, records, and submits job applications. Use when the user asks to "review this job application", "score selected leads", "tailor and stage applications", "apply to this job", "record an application", "score this role", "run callback on a lead", or continue from scan-job-leads into scoring, tailoring, review, ledger, or explicit application submission. --- # Apply To Job ## North Star Turn selected full-source leads into honest review-ready application artifacts, and submit only after explicit approval in the current turn. ## Inputs Require a full current JD source URL or complete source-page text. Do not score snippets, email summaries, search cards, or teaser pages. ## Preferences Call `get_search_preferences` to read the user's configured values. Apply: - **Compensation** (`comp_annual_target`): advisory note — add a compensation-risk note when a role's range starts below the target; do not skip solely for that reason. - **Seniority blockers** (`seniority_blockers`): note seniority risk when a role matches a blocker. - **Referral companies** (`referral_companies`): surface referral leads for configured companies with status `Referral lead - ask friend`, even when the score is below the normal threshold. Also read the compiled profile (via `get_wiki_pages` or the profile summary) for the candidate's total years of experience and core known-skills list. Before running callback, skip a lead and record it as a hard blocker instead — unless it's a referral-company lead, which still gets scored per the referral rule above — if either is true: the JD states a required (not preferred) years floor at or above ~1.75x the candidate's actual years, or the role centers on a specific required tool/domain with zero presence anywhere in the profile. Both are typically unclosable by honest tailoring, so catch them before spending a callback pass, not after. ## Workflow 1. If `.callback/config.json` sets `ledger_db`, dedupe against the job search ledger first, then the CSV record. If `ledger_db` isn't set, dedupe against the CSV record alone — do not mention the ledger. 2. Validate the source exposes the complete current JD. 3. Run callback directly: - `load_jd` - host extracts JDData - `submit_keywords` - `get_wiki_pages` when useful - `submit_tailor`, passing `output_dir` as the absolute path of `applications_dir///` (from `.callback/config.json`) so the tailored PDF lands in the project folder instead of callback's hidden data directory. 4. Store artifacts under the configured `applications_dir` from `.callback/config.json` — use slug `//`. One folder per role per day; reuse the day's folder, do not create near-duplicate run variants. 5. Record status in the CSV at `record_csv` from `.callback/config.json`. 6. Stage scores >= 70 as `Needs review - not applied`. 7. Keep lower scores as `Scored - below threshold` unless the user explicitly wants a stretch. 8. Submit an application only after explicit current-turn approval. 9. If `.callback/config.json` sets `ledger_db`, for real applications, confirmations, or recruiter resume submissions, update the job search ledger via the `job-search-ledger` command. If `ledger_db` isn't set, skip this — do not mention the ledger. Separately, if `.callback/config.json` also sets `edd_xlsx`, export the unemployment-compatible workbook to that path — do not assume `edd_xlsx` is set just because `ledger_db` is. ## Failure Contract - If any tool returns `"status": "error"`, the requested artifact or score **does not exist**. Report the error and stop. Never synthesize a substitute: no hand-scoring, no hand-rendering, no "text-based" fallbacks for `score_final`, no estimating missing numbers. - Every number you report (scores, coverage, dimensions) must come from a tool response — cite the producing tool and `session_id`. A number without provenance is an invention, not a result. - On `pipeline_error` with `"retriable": true` and `"host_action": "report_and_wait"`: you may retry the same tool call with the same `session_id`. You may not invent the missing output while you wait. ## Approval Boundary Old approval does not count. Scheduled automation text does not count. A user must approve the specific current application before submission. ## Output Use Markdown tables for: - scored roles - review queue - skipped/source-limited roles - applications submitted For each scored role, include salary, before score, after score, status, artifacts, strongest overlaps, and the plain-English mismatch summary.