Repository navigation
feat: h5p-author, a skill that builds and verifies a text-only quiz - #68
Merged
Merged
Conversation
An agent asked for an H5P quiz could check a package with h5p-verify but had nothing to build one with, and hand-written packages break in ways the files do not show. - skills/h5p-author: the brief, a validated quiz source, the build, the verifier trusted and untrusted, and a look at the screenshot. Text-only Multiple Choice and Question Set, with the limits stated. - scripts/build-quiz.mjs, portable: loads the library pack and zip.js from the calling project and refuses a zip.js older than 2.24. Copies only the selected libraries' runtime dependencies, each part checked against the pack index's SHA-256. Fills fields from the installed semantics, gives each question a UUID subContentId, and never overwrites its output. - Two examples: a two-question starter, and eight phishing scenarios with an answer key and the fail, pass and retry attempts. - Tests: the helper in Node; the scenarios played through the app, trusted and untrusted; every example through the verifier with no warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eside the author skill Two conflicts, both kept whole: AGENTS.md's layout of packages/verify/tests names preview.test.ts and author.test.mjs, and docs/verify.md has the preview paragraph followed by the author skill's. The verifier's tests pass on the merged tree, 28 of 28, author.test.mjs and preview.test.ts among them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t of the demo The demo is not tested but for its installable app (the owner's rule of 2026-10-17), and #68 had put two of the skill's tests there because the demo had the pack and zip.js installed. apps/skills is a project of the kind the skill runs in: it installs the pack and zip.js, which the helper resolves from it, and the verifier. All three of the skill's tests are in it: - author.test.ts, the helper in Node, moved as it was; - author-verify.test.ts, from the verifier's author.test.mjs, now through the verifier's published API and typed against its declarations, so the verifier's tests are its own; - author-playback.test.ts plays the eight scenarios in the verifier's preview instead of the demo's installable app: the page the skill will hand a person to review a quiz in. It runs in Chromium only, where the demo's engines job ran it in Firefox and WebKit too. The lockfile gains the app's importer and nothing else. AGENTS.md, docs/development.md and CONTRIBUTING.md name the app. 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.
Closes #67.
An agent asked for an H5P quiz could check a package with
h5p-verify, but had nothing to build one with.h5p-authoris a new skill inskills/, beside the other three. From a brief it:.h5pfrom the library pack installed in the user's project;It covers text-only Multiple Choice and Question Set.
Changes
The skill (
skills/h5p-author/)SKILL.mdwalks through the brief, the source, the build, the verification and the hand-over, and states the limits:It tells the agent not to substitute a quiz for another kind of activity, and never to make a check pass by removing a question.
references/quiz-format.mddescribes the source format;assets/quiz.jsonis a two-question starter.assets/phishing-scenarios.json, withreferences/scenario-quiz.md, is a fuller example: eight scenarios, four with several correct answers, an 80% pass mark, an answer key, and attempts that fail at 75%, pass at 83.3% and retry to 100%.LICENSEis the repository's MIT licence, installed with the skill.The helper (
skills/h5p-author/scripts/build-quiz.mjs)Validation: it checks the source field by field; an unknown field or a wrong type fails with its path.
Dependencies: it loads
@missing-elements/h5p-librariesand@zip.js/zip.jsfrom the calling project, not from the skill's folder, so an installed or symlinked skill works. It refuses a zip.js older than 2.24 and prints the install command.appendZiphas nofilteroption before 2.20, and without it each part's ownh5p.jsonwould be copied too.Libraries: it takes Multiple Choice and Question Set from the pack and walks their preloaded and dynamic dependencies. Each part is checked against the pack index's SHA-256, and its
library.jsonagainst the index entry. Only those folders are copied:Content: every field comes from the installed
semantics.jsondefaults, and a required field it cannot fill fails the build. Authored text is escaped into the HTML fields. Each question gets a UUIDsubContentId.h5p.jsonis written first andcontent/content.jsonlast.Output: it builds in a temporary folder next to the output and copies with
COPYFILE_EXCL. An existing file is never overwritten, and a failed build leaves nothing behind.Tests (
apps/skills/, a new workspace app)The demo is not tested, except its installable app, so the skill's tests live in a project of their own.
apps/skillsis the kind of project the skill runs in: it installs the pack and zip.js, which the helper resolves from it, and the verifier. Nothing in it ships.tests/author.test.tsruns the helper in Node, 29 tests:tests/author-verify.test.tsruns both kinds and the scenarios through the verifier's published API, trusted and untrusted against the installed pack (6 tests). Each passes with no warnings and no errors.tests/author-playback.test.tsplays the eight scenarios in the verifier's preview, the page the skill will hand a person for review, trusted and untrusted (2 tests):finishedcomes from the Question Set alone, never from a question.Docs: the README's agent-skills section,
docs/verify.md,docs/development.md,CONTRIBUTING.md, and AGENTS.md's layout and test lists.Testing
pnpm typecheckacross the workspace passes, the new app included.apps/skills: 37 of 37 in 18 s.mainmerged in and the author test moved out: 22 of 22.enginesjob also ran it in Firefox and WebKit, 2 of 2 in each.Not verified
npx skills addfrom GitHub, which can only fetch the skill once it is onmain. The portable test copies the folder instead.SKILL.mdsays.Later
The review step will name
h5p-verify --previewonce h5p-verify 1.2.0 is on npm.npx skills addreads the skill frommain, so the step cannot land there before the release.Release
None. Skills are fetched from the repository rather than published, and the tests don't ship. The README paragraph reaches npm with the player's next release, since
prepackcopies the root README.🤖 Generated with Claude Code