Skip to content

feat(job-sources): read Jobs from links, files and copied text into tagged snapshots - #14

Merged
codeotter0201 merged 3 commits into
mainfrom
feat/issue-12-job-reading
Nov 8, 2026
Merged

codeotter0201 merged 3 commits into
mainfrom
feat/issue-12-job-reading

Conversation

@codeotter0201

Copy link
Copy Markdown
Owner

Summary

Implements Job reading from #12: Listings and Jobs from links, files and copied text, saved as tagged Job snapshots.

  • skills/headhunter/scripts/hhweb.py: site rules for 104, CakeResume, Yourator and LinkedIn; a fetcher that names itself in its User-Agent, applies robots.txt (wildcards, longest rule wins) and stops at refusals and bot checks; schema.org JobPosting reading; Job links from careers Listing pages; the Yourator Listing JSON
  • skills/headhunter/scripts/hh.py: job listing, job fetch [<url>] [--file], job save [--replace], job list, job accept <term> <tag>; validate checks Job snapshots; extract-text turns HTML into text
  • skills/headhunter/SKILL.md: a first step that sorts what the user gives (Candidate material, one Job, many Jobs, or a mix), the Job snapshot format, how each site is read, and the guided copy-and-paste flow for 104 and CakeResume
  • CONTEXT.md: Listing covers files and copied text; Job lists what a snapshot holds and how Jobs without a link are identified
  • README.md / README.zh-TW.md: the Job reading feature

Related Issues

Closes #12

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Data layout change (existing data folders need migration)
  • Documentation update
  • Refactoring (no functional changes)

Decisions

Item Decision Rejected alternatives
Reading method per site Yourator: fetched, Listings through its JSON, Jobs from JobPosting data and page text. Careers pages: fetched. 104 and CakeResume: guided; the user scrolls the results, copies and pastes, and Job pages come from a browser or copied text. LinkedIn: signed-in browser or pasted text only Fetching 104 with browser-like headers: that is working around its bot protection. Site-specific code for 104 and CakeResume pages: not needed when the user provides the content
How fetching behaves An honest User-Agent naming this project, robots.txt applied with its own reader (Python's parser ignores wildcards and downloads robots.txt with a default agent), and a stop at HTTP 401/403/429/503 or a bot check Retrying, rotating headers, or using a headless browser to pass checks
Job input forms A link, an HTML, Word, PDF or text file, or both; pasted text is saved to a file first. HTML files also give their JobPosting data; PDFs use pdftotext when installed, otherwise the agent reads them URL only
Job ids beyond the four sites Careers pages: j-<host>-<hash of URL>. No link: j-user-<hash of company and title>. Tracking parameters are stripped before hashing Asking the user to name each Job
Snapshot format jobs/<id>.md: a YAML block (the same subset as other Data folder files) with structured fields, then the posting text Separate YAML and text files
Requirement tagging Every requirement has at least one Tag or one proposed term; a proposed term that already has a Tag is refused; job accept moves an accepted term into tags across all snapshots Free-text requirements; untagged requirements
Combined Tag list Not stored; computed when needed A stored list that goes stale when snapshots are edited by hand
Saving the same Job twice Refused unless --replace Overwriting silently
Raw input files for Jobs Not kept; the snapshot holds the posting text Keeping every PDF or HTML

Acceptance criteria not met as written

These follow the direction in the session that opened this PR:

  • 104 and CakeResume Listings and Jobs were not read from the real sites. 104 refuses scripts (even its robots.txt) and, in the built-in browser, answers its own page data requests with 403; CakeResume shows a Cloudflare check to scripts and the built-in browser. Claude in Chrome was not connected. The skill therefore guides the user to copy and paste these pages, and the 104 path was tested with fictional copied text and a fictional job code; CakeResume follows the same path and was not tested separately.
  • LinkedIn was tested only with fictional pasted text.

Migration

jobs/ already exists in Data folders created by #1, and nothing wrote Job snapshots before this change, so no migration is needed.

Validation

All runs used a scratch HEADHUNTER_DATA_DIR outside any repository, on Python 3.9 unless noted.

Site testing (before the code)

  • curl with User-Agent: headhunter-agent (+repo) → 104 robots.txt and search: 403; CakeResume: 403 Cloudflare "Just a moment..."; Yourator robots.txt: only Disallow: /r/*, search page and /api/v4/jobs: 200
  • Built-in browser → 104 search: jobs/search/api/jobs 403, "共 0 筆"; 104 job pages job/8p1gz, job/7wutt: page 200, data request 403, redirect to the 404 page; CakeResume: "Performing security verification" did not clear

Yourator (real)

  • job listing "https://www.yourator.co/jobs?term%5B%5D=python&area%5B%5D=TPE" → 20 Jobs with title, company, location, salary and link
  • Screened to 3; job fetch each → JobPosting data and page text; job save → j-yourator-39119 (8 must-haves, 3 nice-to-haves, 2 proposed terms), j-yourator-48495, j-yourator-25039
  • Second job listing marks the 3 saved Jobs with *

Company careers page (real)

  • job listing https://jobs.lever.co/pinkoi → 6 Jobs with descriptive titles; job fetch of the Backend Engineer page → JobPosting data; saved as j-jobs-lever-co-91b1946a

Files, copied text and no link (fictional content)

  • job fetch --file with a real Yourator page saved as HTML → JobPosting data without a link; with the link → j-yourator-39119, "already saved"
  • job fetch --file posting.docx → text; --file posting.pdf → "no PDF text extractor is installed; read the PDF with your own file reading…" (the PDF was then read directly)
  • job save with no url → j-user-f6749e6b; saving again → "already exists; pass --replace"; the same Job marked read_with: fetch → refused
  • Copied 104 results with three Jobs → listed and screened by the agent; one saved from the user's link and copied posting as j-104-zz001 (tracking parameter jobsource stripped)
  • LinkedIn from pasted text → j-linkedin-4000000001; job fetch/job listing on LinkedIn URLs → refused; a LinkedIn snapshot marked fetch → refused

Checks

  • Unknown Tag → refused with "list it under proposed"; proposing Go → "already the Tag skill/go"
  • job accept "AI coding tools" tool/ai-coding-tools before the Tag exists → refused; after adding it → 2 snapshots updated; a later save proposing the same term → refused
  • robots.txt reader on sample files: wildcards, $, longest match and agent-specific groups; live Yourator: /api/v4/jobs allowed, /r/x disallowed
  • validate → OK: taxonomy.yml, 0 Candidate folder(s) and 7 Job snapshot(s) are valid. on Python 3.9 and 3.13; the Candidate data from [Feature] Candidate database: import, quality check, tags, CRUD and search #1 still validates
  • Every snapshot's YAML block parses identically with PyYAML and hhyaml
  • claude plugin validate . → passed; claude plugin validate .claude-plugin/plugin.json → passed with the expected CLAUDE.md warning
  • ruff check --select E,F,W,B skills/headhunter/scripts → all checks passed; all scripts parse on Python 3.9

Not run

  • Real 104, CakeResume and LinkedIn pages (see above)
  • Loading the skill in a fresh session with claude --plugin-dir .
  • PDF extraction with pdftotext installed; Windows

Checklist

  • No real candidate data in code, examples, fixtures, screenshots or this PR
  • skills/headhunter/SKILL.md, README.md and README.zh-TW.md updated when behavior or data layout changed
  • Migration for existing data folders described (data layout changes only)
  • Self-review completed
  • Documentation updated (if needed)

🤖 Generated with Claude Code

codeotter0201 and others added 3 commits November 8, 2026 02:27
Add job reading to the headhunter helper script. hhweb.py holds the site
rules, a fetcher that names itself and follows robots.txt, a schema.org
JobPosting reader, and Listing link extraction. hh.py gains job listing,
fetch, save, list and accept commands, and validate checks Job snapshots.

Yourator and company careers pages are fetched; 104 and CakeResume are
read in a browser because they refuse automated requests; LinkedIn is read
only from the user's signed-in browser or pasted text.

Refs #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g browser HTML

104 and CakeResume block automated requests, so the skill now guides the
user: scroll the search results until every Job has loaded, copy the page
and paste it, and read Job pages in a browser or from copied text. Drop the
--html options and the in-page snippet; job fetch --text covers copied text.

Refs #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ort user input

Users give Jobs and Candidate material in any form. job fetch now reads a
Job from a link, an HTML, Word, PDF or text file, or both; a Job saved
without a link gets a j-user id from its company and title, and read_with
gains "file". SKILL.md opens its workflows with a step that sorts what the
user gives into Candidate material, one Job, many Jobs, or a mix.

Refs #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area/agent-instructions AGENTS.md, CLAUDE.md, CONTEXT.md and skill instructions area/docs README and contributor documentation type/feature New functionality labels Nov 8, 2026
@codeotter0201
codeotter0201 merged commit a4e100f into main Nov 8, 2026
1 check passed
@codeotter0201
codeotter0201 deleted the feat/issue-12-job-reading branch November 8, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent-instructions AGENTS.md, CLAUDE.md, CONTEXT.md and skill instructions area/docs README and contributor documentation type/feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Job reading: Listings and Job snapshots

1 participant