Skip to content

Development

m4bwav edited this page Nov 3, 2026 · 8 revisions

How the repository is laid out, how to test a change, and how a release is made. The repository's own rules for agents and people are in AGENTS.md.

Layout

Path Holds
skills/historywright/ the hub's SKILL.md, references/ (method, answer format, dates, the command list) and scripts/
skills/historywright/scripts/ hw.py, the only entry point, and its modules hw_net.py (fetching, pace, fixtures), hw_dates.py (calendars), hw_sources.py (Wikidata, Wikipedia, gazetteers, the registry), hw_check.py (verification and packs)
skills/historywright-sources/references/ registry.json (96 sources), eras.md (the era outline), recipes.md
skills/historywright-pack/references/contract.md the research pack contract
tests/ check_skills.py, test_hw.py, fixtures/ (recorded HTTP answers and the two test packs)
scripts/budget.py the size budget
evals/evals.json, evals/cases/ the agent evals
RESEARCH.md, CHANGELOG.md, LEARNINGS.md, TESTS.md, evergreen.json, MAINTENANCE.md the evergreen unit the three skills share
ai-docs/ session notes, decisions, research reports and the handoff

Checks

Run all three from the repository root before every commit. CI runs the same three on Linux, macOS and Windows with Python 3.9 and 3.14 (.github/workflows/tests.yml).

python tests/check_skills.py
python tests/test_hw.py
python scripts/budget.py
  • check_skills.py: the plugin manifest, each skill's frontmatter, a description of at most 700 characters and a body of at most 200 lines, relative links in every markdown file, LF line endings, the evergreen companion files and hw.py lint. It fails on any key-like string of 40 or more characters outside tests/fixtures/, on a home-folder path, and on an AI credit line. It skips evals/cases/results/, which holds local eval output and is git-ignored.
  • test_hw.py: 64 tests at 0.6.1 (63 at 0.6.0, 62 at 0.5.1, 61 at 0.5.0, 58 at 0.4.0, 53 at 0.3.0, 46 at 0.2.0, 34 at 0.1.0), offline. HTTP answers come from tests/fixtures/http/index.json through HW_FIXTURES, and the home folder is a temporary one.
  • budget.py: install size, era outline size and the description tokens every session pays, each with a green, yellow or red band.

Recording fixtures

A new command or option gets an offline test. To record the answers it needs:

HW_RECORD=tests/fixtures/new python skills/historywright/scripts/hw.py wd claims Q1048 --prop P570

HW_RECORD saves each response body and appends a row to index.json in that folder. The row's pattern is built from the URL with key and token values hidden, so a key never lands in a fixture (fixed on 2026-10-18; before that the raw URL was written). Replay with HW_FIXTURES=<dir>. Move only the rows the test needs into tests/fixtures/http/.

Evals

evals/evals.json holds 19 cases: 5 trigger cases, 3 decoys, 8 outcome cases graded on the answer, and 3 action cases graded on the commands in the trace. They run with the evergreen plugin: claude plugin eval for triggers and decoys, evergreen.py worth --ab for the with-and-without comparison. Two lessons from the first runs are in LEARNINGS.md:

  • L-005: a research skill's comparison must grant the research tools to both arms. The value cases list Bash, PowerShell, WebFetch, WebSearch and Edit; without them the run measures the permission prompt.
  • Up to 0.1.0 the eval runs shared the user's real ~/.historywright/cache unless HW_HOME was moved, so an earlier run's cache entry could end the research at Step 0. Since 0.2.0 a .historywright folder in the working directory is the home folder, and the three action cases run in a folder that has one (evals/fixtures/project-home).

Releases

Eight releases so far: 0.1.0 and 0.2.0 on 2026-10-18, 0.3.0 on 2026-10-24, 0.4.0, 0.5.0 and 0.5.1 on 2026-11-01, 0.6.0 and 0.6.1 on 2026-11-02 (Versions and upgrading). When a packaged file changes, the version in plugin.json and the release notes in CHANGELOG.md move together. Pushing a tag vX.Y.Z runs .github/workflows/release.yml, which:

  1. fails unless the tag matches the version in plugin.json;
  2. runs check_skills.py and budget.py;
  3. zips skills/ with README.md, LICENSE and SECURITY.md as historywright-X.Y.Z.zip;
  4. publishes a GitHub release with that zip.

The test fixtures, evals and ai-docs are not in the zip.

Maintenance

The three skills share one evergreen unit (tier moderate, a research refresh every 30 days; the next one is due on 2026-11-16). A refresh runs hw.py probe first, which calls every registry endpoint and reports ok, moved, gone, blocked or unreachable. Changed endpoints, limits and licences get an R- entry in RESEARCH.md with their source before the registry changes.

Clone this wiki locally