webwork-writer-expert
Skill5 starsChanged 22 days agoMITView on GitHub
Create, edit, review, and lint WeBWorK PG/PGML questions. Use for problem authoring, student-facing wording, distractor design, randomization, grading, HTML whitelist limits, PGML rendering failures, or renderer API validation.
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-md-fixerSkill
- arch-docsSkill
- book-to-markdownSkill
- docset-updaterSkill
- humanizerSkill
- news-release-docsSkill
- pdf-guideSkill
- readme-docsSkill
- screenshot-docsSkill
- see-also-docsSkill
- setup-install-usage-docsSkill
- bptools-writer-expertSkill
- color-accessibility-expertSkill
- css-creative-expertSkill
- game-design-expertSkill
- geometry-expertSkill
- glass-expertSkill
- hic-human-interact-expertSkill
- openscad-3d-printing-expertSkill
- podman-expertSkill
- postgresql-expertSkill
- pyside6-engineerSkill
- rust-code-expertSkill
- solid-js-expertSkill
- svg-creator-expertSkill
- typescript-engineerSkill
- ui-ux-engineerSkill
- vision-expertSkill
- wasm-rust-expertSkill
- delegate-manager-to-subagentsSkill
- gas-town-workflowSkill
- hang-checkSkill
- html-game-parallel-builderSkill
- parallel-planSkill
- stay-busySkill
- repo-rules-readerSkill
- blueprint-plan-drafterSkill
- ideonomy-plainSkill
- ideonomy-richSkill
- make-goalSkill
- modest-plan-drafterSkill
- audit-code-reviewerSkill
- old-python-code-reviewSkill
- prune-testsSkill
- unit-test-starterSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 8 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill to author or adjust PG/PGML problems with the local WebWork renderer, repo rules, and the docs in references/.
- Very specific: line 15
Before editing any .pg or .pgml file, before proposing fixes, and before running the renderer, you MUST use the Read tool on each of these …
- Distinctive: line 28
Do not summarize from memory.
- Very specific: line 43
Greenfield: no existing .pg/.pgml files in the target repo.
- Distinctive: line 76
Use PGML-first structure with inline grading.
- Very specific: line 81
Prefer local PGrandom seeded with problemSeed for deterministic randomization.
- Distinctive: line 82
Avoid MathJax color macros.
- Very specific: line 83
Always render with -r to visually confirm layout and checkbox behavior before reporting results.
- Distinctive: line 92
When several PGML files need the same helpers (SVG primitives, lookup tables, domain utilities), inline a copy of the helpers inside each …
- Very specific: line 106
Use # ==== BEGIN BLOCK: <name> (v<N>) ==== and matching END BLOCK lines.
- Distinctive: line 109
Keep each block independent (no cross-block calls that aren't also in the block set) so a block can be dropped into a new file without …
- Very specific: line 112
When fixing a bug in a block, update every PGML that carries it.
- Very specific: line 117
Read references/repos.md to locate local repos and paths.
- Very specific: line 118
Read references/docs.md for the full index of authoring docs, grouped by purpose.
- Very specific: line 119
Read references/linting.md to run renderer API linting.
- Distinctive: line 120
Check bundled reference docs and examples.
- Distinctive: line 124
Keep solution text plain when exporting to systems that do not render HTML.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WebWork question authoring
Overview
Use this skill to author or adjust PG/PGML problems with the local WebWork renderer, repo rules, and the docs in references/.
Required reading (load before any PGML edit)
<EXTREMELY-IMPORTANT>
Before editing any `.pg` or `.pgml` file, before proposing fixes, and before
running the renderer, you MUST use the Read tool on each of these files:references/docs/HOW_TO_LINT.mdreferences/docs/PG_COMMON_PITFALLS.mdreferences/docs/WEBWORK_PROBLEM_AUTHOR_GUIDE.md
For any task that writes or edits student-facing text (stems, choices, matching values, instructions, hints), also Read:
references/docs/QUESTION_PEDAGOGY_GUIDE.mdreferences/docs/QUESTION_VOICE_GUIDE.md
Do not summarize from memory. Do not skip because "you already know PGML." Agents that skip these docs ship problems with well-known pitfalls that fail renderer lint and waste human review time.
Exception: if you have already Read the required files earlier in the same
session, you do not need to re-read them. State explicitly that you already
loaded them this session before continuing.
</EXTREMELY-IMPORTANT>
Workflow
- Classify the request using
references/task_selection.md, then route to the correct guide viareferences/topic_index.md. Both files must be consulted before opening any PG/PGML file. - Determine project shape using
references/project_workflow.md:- Greenfield: no existing
.pg/.pgmlfiles in the target repo. Write the WebWork design contract first, then scaffold problems following the greenfield path. - Improve existing: existing
.pg/.pgmlfiles are present. Inspect the existing files, renderer harness, and OPL headers first; then apply changes one category at a time following the existing-repo path.
- Greenfield: no existing
- Satisfy the Required reading block above. This is step zero of editing; nothing else happens first.
- Identify the target repo and file, then read any additional relevant doc
references from
references/docs.mdfor the question type at hand. - Design the puzzle before code, following the Design workflow in
references/docs/QUESTION_PEDAGOGY_GUIDE.md: name the reasoning target (apply, analyze, evaluate, or recall), build the data, list the named student errors that become the distractors, and choose the closest exemplar inreferences/docs/QUESTION_EXEMPLARS.md. Record the plan in the design contract or in comments above the PGML. - Apply the PGML structure and rules from the WebWork author guide.
- Make edits in the problem file and update
docs/CHANGELOG.mddirectly when this skill runs as a standalone task; underdelegate-manager-to-subagents, dispatch a docs subagent to add the entry. - Render with
-rusing the local renderer API to visually confirm layout and checkbox behavior (prerequisite). - Lint or render with the local renderer API when the change affects PGML output.
- Student-text review: read the rendered stem and choices for several seeds
against the rubric that
references/topic_index.mdroutes for the PGML item type. Verify the key independently: enumerate every scenario (or sweep many seeds) or recompute with a second method for computed items; a separate agent checks recall items against the source data. - Validate against the oracles in
references/testing_and_oracles.md: lint output clean, visual render correct, grading test passes, student-text rubric applied, seed reproducible.
Core rules (from repo docs)
- Use PGML-first structure with inline grading; keep setup, answers, and PGML text in separate sections.
- Questions are puzzles with few words: the data carries the difficulty, each distractor comes from a named student error, and seriously absurd choices are welcome beside them.
- PGML is single-pass: do not build PGML tag wrappers inside Perl strings. If a variable contains HTML, render it with
[$var]*. - HTML whitelist blocks
table,tr,td; use flexbox divs or niceTables instead. - For matching problems on PG 2.17, use PopUp widgets and HTML-only
MODES(TeX => '', HTML => ...)wrappers for layout. - Prefer local
PGrandomseeded withproblemSeedfor deterministic randomization; avoidSRANDunless you want to reset the global RNG; sort hash keys before random selection. - Avoid MathJax color macros; use HTML spans and CSS for color.
- Always render with
-rto visually confirm layout and checkbox behavior before reporting results.
Self-contained PGML files
PGML files are uploaded to the problem server individually, so each file must
be fully self-contained. Do not factor shared helpers into a sibling .pl
macro and loadMacros() it from several PGMLs -- the uploaded file will not
have access to it.
When several PGML files need the same helpers (SVG primitives, lookup tables, domain utilities), inline a copy of the helpers inside each file. To keep maintenance sane, wrap each reusable chunk in a clearly labelled block so it can be copy-pasted between files verbatim:
# ==== BEGIN BLOCK: svg_primitives (v1) ====
sub svg_text { ... }
sub svg_rect { ... }
# ==== END BLOCK: svg_primitives ====Conventions:
- Use
# ==== BEGIN BLOCK: <name> (v<N>) ====and matchingEND BLOCKlines. - Bump the version suffix when the block changes so drift across files is easy
to spot with
grep. - Keep each block independent (no cross-block calls that aren't also in the block set) so a block can be dropped into a new file without pulling in a whole web of dependencies.
- When fixing a bug in a block, update every PGML that carries it; a repo-wide
grepon the block name surfaces them all.
Reference files
- Read references/repos.md to locate local repos and paths.
- Read references/docs.md for the full index of authoring docs, grouped by purpose.
- Read references/linting.md to run renderer API linting.
- Check bundled reference docs and examples; render them when needed to confirm renderer capabilities (for example, whether a macro is present).
Notes
- Keep solution text plain when exporting to systems that do not render HTML.
- For matching problems, use the PG 2.17-safe patterns documented in docs/webwork.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

