---
name: job-forge
description: Run the JobForge AI job-search pipeline for job URLs and descriptions, offer evaluation, tailored CV/PDF generation, portal scanning, application submission, tracking, follow-up, outreach, rejection analysis, and negotiation. Use when the user invokes $job-forge or /job-forge, pastes a job posting, or asks to manage any stage of a JobForge search.
user_invocable: true
args: mode
---

Invocation input:

{{mode}}

# JobForge

Run JobForge from the consumer project root. Treat the current user request as
the invocation input; do not expect a template variable to contain arguments.

## Start safely

1. Read `AGENTS.harness.md` when it exists. It is the shared operational
   contract. Continue to obey the consumer project's root `AGENTS.md` and any
   closer overrides.
2. Before responding, check for `cv.md`, `config/profile.yml`, and
   `portals.yml`. If any are missing, enter onboarding and follow
   `modes/reference-setup.md` instead of evaluating or applying.
3. When the request selects a mode, announce it before taking mode actions.
   For a bare discovery invocation, show the menu without inventing a mode.
4. Read only the mode-specific context listed below. Do not preload the whole
   tracker, portal catalog, scan history, or every mode.

## Select a mode

| User intent | Mode |
|---|---|
| Pastes a job description or URL | `auto-pipeline` |
| Evaluates one offer | `offer` |
| Compares offers | `compare` |
| Drafts LinkedIn outreach | `contact` |
| Researches a company | `deep` |
| Generates a tailored CV/PDF | `pdf` |
| Evaluates training or certification | `training` |
| Evaluates a portfolio project | `project` |
| Reviews application status | `tracker` |
| Fills or submits an application | `apply` |
| Searches configured portals | `scan` |
| Processes pending URLs | `pipeline` |
| Batch-processes offers | `batch` |
| Finds follow-ups | `followup` |
| Records or analyzes a rejection | `rejection` |
| Handles a received offer | `negotiation` |

If the invocation contains no mode, URL, job description, or recognizable
intent, show the discovery menu below. If an intent remains ambiguous, ask
which mode fits instead of guessing.

## Load context

Read `modes/_shared.md` plus `modes/{mode}.md` for:

- `auto-pipeline`, `offer`, `compare`, `pdf`, `contact`, `apply`, `pipeline`,
  `scan`, and `batch`.

Read only `modes/{mode}.md` for:

- `tracker`, `deep`, `training`, `project`, `followup`, `rejection`, and
  `negotiation`.

Load data only when the selected mode needs it:

| Data | Modes |
|---|---|
| `data/applications.md` or `data/applications/*.md` | `tracker`, `followup`, `rejection`, `compare`, and dedup/numbering in `auto-pipeline` or `batch` |
| `data/pipeline.md` | `pipeline`, `scan` |
| `data/scan-history.tsv` and `portals.yml` | `scan` |
| `batch/batch-prompt.md`, `batch/batch-state.tsv` | `batch` |
| `config/profile.yml` | modes that load `_shared.md` |
| `cv.md` | `pdf`, `auto-pipeline`, and CV tailoring in `apply` |

## Execute

Follow `modes/{mode}.md` exactly, including its gates and output format. Apply
the hard limits in `AGENTS.harness.md` to any multi-job workflow.

Map shared orchestration terms to the active client instead of inventing tool
names:

- In OpenCode, use its `task` subagent primitive.
- In Codex, use the available collaboration/subagent tools.
- If the client has no subagent capability, run safe inline work and report any
  mode requirement that cannot be satisfied.

Use the MCP tools actually exposed in the session. Follow the documented
fallback when Geometra or Gmail is unavailable; never claim that a live page,
form, submission, or mailbox action succeeded without tool evidence.

## Discovery menu

Show both native invocation forms so the user can continue in the same client:

```text
JobForge command center

Codex:    $job-forge <mode or job URL>
OpenCode: /job-forge <mode or job URL>

Modes: auto-pipeline, offer, compare, contact, deep, pdf, training, project,
       tracker, pipeline, apply, scan, batch, followup, rejection, negotiation

Paste a job URL or description to run auto-pipeline.
```
