AGENT SKILL

doc-learning-artifact

The approved house style and build kit for study pages — an exam guide, a course explainer, a revision page: one section per tab, hand-drawn SVG diagrams whose boxes open a detail card INLINE under the diagram, a saved-answer quiz, study aids, and a Playwright check that runs in real Chrome on desktop and iPhone. USE WHEN building or updating a study guide, exam guide, course notes page, revision page or learning artifact; when somebody wants to learn a course, a lecture series or a topic from one page. NOT FOR an architecture or system diagram (`doc-atlas`), a status report or findings, or anything that is not meant to be studied.

License 许可
Apache-2.0
最近更新
2026-11-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
doc-learning-artifact
description
The approved house style and build kit for study pages — an exam guide, a course explainer, a revision page: one section per tab, hand-drawn SVG diagrams whose boxes open a detail card INLINE under the diagram, a saved-answer quiz, study aids, and a Playwright check that runs in real Chrome on desktop and iPhone. USE WHEN building or updating a study guide, exam guide, course notes page, revision page or learning artifact; when somebody wants to learn a course, a lecture series or a topic from one page. NOT FOR an architecture or system diagram (`doc-atlas`), a status report or findings, or anything that is not meant to be studied.
argument-hint
[ "course or topic", "and the deliverable folder" ]
disable-model-invocation
true

02 资源文件 12

03 SKILL.md 正文

doc-learning-artifact

Ideal state

A learner opens one local page and studies from it on a laptop or a phone without fighting it:

  • One section on screen at a time. A side list on desktop and a sticky, swipeable row of chips on a phone. Every section ends with a prev/next pager, every #id link opens the tab that holds it, browser back works, and a jump out of a tab (quiz → section, card → section) shows "↩ Back to …", which returns to the exact spot.
  • Every section has the same shape: a number and title, a one-line "The idea" box, diagrams, traps, recording notes with ▶ timestamp links, and a links row (builds on / leads to / quiz).
  • Diagrams explain themselves. Tapping any box opens its card directly under that diagram: source, title, explanation, an exam angle and a link to the full section. Never a fixed side drawer or bottom sheet; the operator found the sheet hard to see on a phone. Wide diagrams swipe, or "Fit whole".
  • Practice stays. A quiz with answers saved in the browser, progress, "next unanswered", and a "revise …" link to the section from each question. Sections marked data-review get a "reviewed" tick. Recording notes have an "only the stressed points" filter.
  • No horizontal page scroll, no console errors, light and dark themes.

The reference is the CCBD exam guide the operator approved on 2026-10-03, which is CCBD guide v8 in the learning-artifact-style memory. This kit is that page's engine with the course content removed.

The kit

kit/ builds a page from a content folder. Copy kit/example/ as the starting point:

File Holds
meta.json title, key (prefix for saved answers, unique per page), lang, ui (optional: every UI word, for a page in another language; see the T table in engine.js)
extra.css, extra.js optional page widgets: sliders, plots, simulations. extra.js runs after the engine
page.html <div class="shell"> with nav.toc (each link has two spans: number, name) and <main>: header.hero#start, then one section.topic per tab
cards.json { "<box label>": { t, d, x?, s?, a? } }: title, detail, exam angle, source, section id
quiz.json [{ topic, sec, type: multi|single|match|number, conf: sure|check, q, q2?, yours?, opts | items+choices | answer+unit+tol, why }]
python3 kit/build.py <content-dir> ~/Deliverables/<date>-<slug>/<slug>.html
uvx --with playwright python kit/check.py <that page> <screenshot-dir>

Pass --fragment when the page goes to a host that adds its own document skeleton (the Artifact tool does).

A large page with interactive widgets: the Lithuanian 9th-grade physics + maths guide (~/Deliverables/2026-10-03-fizmat-9/) is the worked example:

  • src/widgets/core.js is a widget toolkit (slider, plot, canvas, animation loop) and src/widgets_check.py proves every widget reacts to every control;
  • src/assemble.py merges per-unit files written by parallel builders, and BRIEF.md is the brief those builders were given.

Copy them rather than starting over.

A box becomes clickable when its <rect class="s-…"/> is followed by a <text> whose label is a key in cards.json. build.py prints cards never used. A non-empty list means a label and a key disagree.

Diagram vocabulary is in kit/head.html: s-box/s-acc boxes, s-t/s-tm text, s-line/s-lacc/s-dash lines and the #ar markers. Page blocks: .idea, .trap, .tbl, .rec, .links, .pill, .infobox, .warnbox, .examsaid. Read the CSS before you invent a class.

Done means

  • check.py exits 0 on both profiles against the page you built.
  • If the page has widgets (kit/widgets/: core.js toolkit + core.css, mounted by mount.js, placed as <div class="wg" data-wg="name">), widgets_check.py exits 0 in all four modes. It clicks every button and fails one that changes nothing, and it fails a ▶ that does not start motion or does not restart on a second press.
  • You viewed both *-card.png screenshots, because a pass is not an appearance.
  • build.py reports no unused cards.
  • The page sits in ~/Deliverables/<date>-<slug>/ and is handed over as a file:// link. Publish it only when asked.

Gotchas, each one measured

  • Never keep animation state in a range input. The input snaps to its step, so adding 0,03 s per frame to a 0,1 s slider is rounded back every frame and the ▶ button looks dead (15 failing button checks per mode on the first fizmat-9 build, worse at 120 Hz). H.slider keeps the exact value itself; widget code must not round per-frame steps either.

  • Reduce Motion is common on real devices. An animation the student starts with ▶ plays anyway, because the motion is the lesson; nothing moves by itself. Jumping to the last frame instead read as a broken button.

  • The CSS sets scroll-behavior: smooth. A router scroll must pass behavior: "instant", or the back pill restores the wrong position (3351 vs 6123 measured).

  • A test asserting the card is in view proves nothing about where it sits. Assert previousElementSibling is the figure and position is static. A planted regression of the placement passed the viewport check and failed only that one.

  • Scrolling to the whole card pushes the tapped box off a phone screen. It did for 122 of 267 boxes in the CCBD guide. openCard therefore scrolls no further than keeps the box in view, and always shows at least the card's first 160 px. That left 18, all in diagrams taller than the screen, so keep diagrams short or split them.

04 同仓库更多 Skills

VytCepas
VytCepas/harbor-core

systems-thinking

For a problem where the obvious fix has already failed or made things worse. The cause usually lives three or four layers below the events that keep appearing; this finds that structure, matches it against the ~10 known archetypes to get the canonical intervention, and checks second-order effects before you commit. Event-level fixes are what it exists to replace. USE WHEN systems thinking, causal loop, feedback loops, archetypes, leverage points, iceberg model, fix the system, why does this keep happening, recurring problem, second-order effects, the fix made it worse, this keeps coming back. NOT FOR incident causal chains (use root-cause-analysis).

★ 0
VytCepas
VytCepas/harbor-core

red-team

Adversarial analysis deploying parallel expert agents to stress-test ideas, strategies, and plans — decomposes into atomic claims, attacks them, then steelmans and counter-argues, producing severity-ranked findings with remediation. USE WHEN red team, attack idea, counterarguments, critique, stress test, devil's advocate, find weaknesses, break this, poke holes, strongest objection. NOT FOR collaborative debate to find best path (use council).

★ 0
VytCepas
VytCepas/harbor-core

first-principles

Physics-based reasoning framework (Musk methodology) that deconstructs a problem to irreducible fundamental truths, classifies every element as hard constraint, soft constraint, or assumption, then reconstructs the optimal solution from fundamentals alone. USE WHEN first principles, fundamental truths, challenge assumptions, real constraint, rebuild from scratch, start over, physics first, question everything, reasoning by analogy. NOT FOR structural feedback loops (use systems-thinking).

★ 0
VytCepas
VytCepas/harbor-core

company-help

Explains this laptop's safety settings in plain words: why a step was stopped, asked about or is waiting for an admin, where work files belong, and how to get a website allowed. USE WHEN a step is refused or blocked, a permission question appears, a site or download fails, or someone asks what Harbor is or where to save files. NOT FOR changing a setting: nobody here can.

★ 0
VytCepas
VytCepas/harbor-core

test-strength

Prove a load-bearing test can actually fail, and that it fails for the right reason. Break the thing it guards, watch it go red, restore — then check it stays green on a valid-but-unusual input, because red on a mutant proves discrimination, not correctness. USE WHEN a suite is written or changed, a guard is trusted, a gate reports zero, or a green result is about to be cited as evidence. NOT FOR reviewing a diff for defects (audit-review-fanout), or running a suite to see it pass (`bin/test-suite-run.sh`).

★ 0
VytCepas
VytCepas/harbor-core

status-suggest-scan

Runs the repeated-work scan and says in plain words what a person keeps doing by hand. USE WHEN a person asks what they repeat or what Harbor could take over. NOT FOR building what it finds.

★ 0