Repository navigation
feat(candidate-db): add data folder, checked import, tags, CRUD and search - #13
Merged
Merged
Conversation
…earch Implement the candidate database from issue #1. A stdlib-only helper script (skills/headhunter/scripts/hh.py) creates the Data folder, assigns ids, keeps raw Sources, writes Facts with validation, archives and restores Candidates, and builds and queries a rebuildable SQLite Index. A bundled YAML subset reader/writer (hhyaml.py) keeps the files readable without third-party packages. SKILL.md describes the file formats and the import workflow the agent follows: quality check, Import report, follow-up questions saved as interview Sources, inferred Facts that need confirmation, conflicts, and Tags from a starter bilingual Taxonomy. CONTEXT.md defines Import report, Tag and Taxonomy; both READMEs describe the feature and the Python requirement. Closes #1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the candidate database from #1: Data folder, Sources, structured Facts, quality check, follow-up questions, inferred Facts, Tags from a shared Taxonomy, CRUD, and a rebuildable Index with search.
skills/headhunter/scripts/hh.py: helper CLI for the fixed operations:init,candidate new|list|show|archive|restore,source add|github|state,fact add|update,next-id,import-report,questions,extract-text,taxonomy find,validate,index,search candidates|facts,queryskills/headhunter/scripts/hhyaml.py: reads and writes the YAML subset the Data folder uses, with line-numbered errors for anything outside itskills/headhunter/assets/taxonomy.yml: starter Taxonomy, 153 Tags in 8 dimensions with Chinese and English labels and aliases, copied to<data>/taxonomy.ymlon first useskills/headhunter/SKILL.md: layout, file formats and the agent workflows (import with quality check, Import report, follow-up questions, inferred Facts, conflicts, tags, search)CONTEXT.md: defines Import report, Tag and Taxonomy; Source and Fact now mention evidence levels, inferred Facts and idsREADME.md/README.zh-TW.md: Candidate database feature and the Python requirement.gitignore: ignores__pycache__/Related Issues
Closes #1
Type of Change
Decisions
<slug>is formedc-001-王小明)hh.py)sqlite3: cannot parse YAML reliablyc-001,s-001,f-001,q-001fact add/fact updatetake JSON or YAML on stdin, assign ids, and write nothing if any check fails; hand edits are allowed andvalidatechecks themfacts.ymldirectly with no gate- [ ] q-004: ...), parsed by the script to list open onesindex.sqlitewhen any Data folder file is newer;indexalways deletes and rebuildsMigration
No released version has created a Data folder (
skills/headhunter/SKILL.mdhad only the skeleton and no scripts), so there are no existing Data folders to migrate. On first run,init(or any other command) creates the layout and the starter Taxonomy, and never overwrites existing files.Validation
All runs used fictional Candidates, 王小明 (
c-001) and 林小華 (c-002), withHEADHUNTER_DATA_DIRset to a scratch folder outside any repository. The scripts ran on Python 3.9 (the oldest supported version) and again on Python 3.13. I acted as the agent followingSKILL.md: I read each Source, wrote the Facts and Import reports, and simulated the user's answers.Data folder
HEADHUNTER_DATA_DIR=<a folder inside a fresh git repo> hh.py init→error: the Data folder ... is inside the git working tree ..., exit 1HEADHUNTER_DATA_DIR=<inside this plugin folder> hh.py init→ refused with the plugin-folder message, exit 1hh.py inittwice → first:Created: ..., candidates/, jobs/, companies/, archive/, taxonomy.yml; second:Already set up; nothing changed.Create and import every kind of Source
candidate new --name 王小明 --name-en "Hsiao-Ming Wang"→c-001;candidate new --name 林小華 ...→c-002source add ... --type note), work log, PDF resume, certificate photo (--evidence documented), GitHub repository (source github c-1 codeotter0201/headhunter-agent), and aninterviewSource from stdinextract-text), note, an unknown binary file (--type other, recorded asunreadablewithsource state, content not guessed), and aninterviewSourceextract-text <pdf>withoutpdftotextinstalled → error telling the agent to read the PDF itself; the PDF and the photo were read with the agent's own file readingsource github c-1 https://github.com/cli), and a missing repository →gh: Not Found (HTTP 404), exit 1Quality check, conflicts, follow-up questions, inference
f-002: when, who, result), vague lines rejected with reasons ("很會溝通…", "最近在研究一些新技術")conflict,candidate showlistsConflicts waiting for the user, years of experience excludes conflicting FactsinterviewSources; resolved Facts citeat: q-00N; losers set tosupersededwithsuperseded_by; answered questions checked off in their reportsc-001 q-007,c-002 q-004) still listed byquestionsafterwardsorigin: inferred,derived_from,reasoning) shown asinferred, unconfirmed, excluded fromsearch candidates(--tag devops→No matching Candidates.), then confirmed (fact update ... {"origin": "sourced", "sources": [...]}) → matched afterwardsskill/computer-scienceandtool/looker-studioadded totaxonomy.ymlonly after the simulated acceptance; the waiting education Fact was written afterwardsValidation gate
fact addwith an unknown Tag and no Source →nothing written:with both errorsvalidatecaught a real mistake during the run: an unquoted comma in a one-line glossary mapping (line 1: expected ':' in flow mapping)validate→OK: taxonomy.yml and 2 Candidate folder(s) are valid.on Python 3.9 and 3.13Index and search
search candidates --tag python --industry finance --min-years 5→ onlyc-002 林小華 (active, mid, 7.4 years), with matched Facts per Tag--tag kubernetes,--tag 後端 --seniority senior,--tag "google data studio"(alias),--tag 資訊工程(Chinese alias),search facts --evidence documented,--tag etl --since 2023,--kind education,--state superseded, aqueryoncandidate_tags, andquestionsindex.sqlite, ranindex, repeated all 12 commands →diffof the outputs is emptyquery "DELETE FROM facts"→attempt to write a readonly database, exit 1Archive and restore
candidate archive c-1→ gone fromsearch candidates --tag kubernetesandcandidate list, shown bycandidate list --archived;fact update c-1 ...→error: c-001 is archivedcandidate restore c-1→ back in bothRepository checks
claude plugin validate .→ passedclaude plugin validate .claude-plugin/plugin.json→ passed with the expected warning thatCLAUDE.mdat the plugin root is not loaded as plugin contexthhyamlagainst PyYAML on a sample with nested lists, flow collections, quoted strings, block scalars and comments → identical results, and dumped output parses the same in both; rejected inputs (anchors, tabs, duplicate keys,a: b: c, unterminated flow) fail with line numbers. Ran on Python 3.9 and 3.13skills/headhunter/assets/taxonomy.ymlparsed identically by PyYAML andhhyaml;validate_taxonomyfinds no errorsSKILL.mdfrontmatter parses with keysnameanddescription; both plugin manifests parse as JSONruff check --select E,F,W,B skills/headhunter/scripts→ all checks passedNot run
claude --plugin-dir .and letting that session drive the workflow; the walkthrough ran the scripts directly while I followedSKILL.mdextract-texton a PDF withpdftotextinstalled (not installed here)Checklist
skills/headhunter/SKILL.md,README.mdandREADME.zh-TW.mdupdated when behavior or data layout changed🤖 Generated with Claude Code