feat: add 'Explaining and Teaching' contract#573
Conversation
A gated teaching loop for explain/why/how requests: explain AND verify understanding, rather than just answering. Composes six existing anchors — 4MAT (Why-What-How-What-If), Programming as Theory Building (the why behind the design), Socratic Method (diagnose first), Feynman Technique (explain-it-back), Bloom's Taxonomy (understood = Apply/Analyze, not recall) and Definition of Done (a checklist demonstrated, not nodded at). Scales the ceremony to the size of the question. Added as the 17th entry in contracts.json (sibling of ELI5 / TLDR), plus a changelog entry. Anchor refs all resolve; render-contracts.js includes it in the static HTML.
WalkthroughEin neuer Semantic Contract „Explaining and Teaching" wird dokumentiert. Der Changelog-Eintrag beschreibt einen strukturierten Teaching-Ansatz kombiniert aus 4MAT, Socratic Method und Bloom's Taxonomy. Der Contract wird in die Contracts-Datendatei mit vollständigen Vorlagen in Englisch und Deutsch integriert. ChangesExplaining and Teaching Contract
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
website/public/data/contracts.json (1)
191-192: ⚡ Quick winTemplate in darstellbare Schritte aufteilen.
website/src/components/contracts-page.js:94-142undscripts/render-contracts.js:30-87formatierentemplatezeilenweise und erkennen nur mit-beginnende Zeilen als Listenpunkte. In der aktuellen Fassung werdentemplateundtemplateDedaher als je ein großer Textblock ausgegeben, obwohl der Contract selbst eine Sequenz und Checkliste beschreibt. Bitte in Absätze und--Punkte umbrechen, damit Kartenansicht,contracts.htmlundllms.txtbesser lesbar bleiben.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/public/data/contracts.json` around lines 191 - 192, The templates are rendered as single blocks because the renderer in scripts/render-contracts.js (the function that serializes contract.template/ templateDe) and the consumer in website/src/components/contracts-page.js (ContractsPage/renderContract or equivalent) only treat existing "- " lines as list items; update the serializer to split template/templateDe into paragraphs (split on double newlines) and into list lines by breaking long sentences/clauses into separate lines prefixed with "- " where the text reads like checklist steps (e.g., sentence boundaries, semicolons, "After each", "Keep a running", "Diagnose first", etc.), then have contracts-page.js use those newline-delimited paragraphs and "- " markers to render <p> and <li> properly and ensure scripts/render-contracts.js writes the same formatted output for contracts.html and llms.txt so cards, HTML, and text outputs show paragraphs and checklist bullets instead of one big paragraph.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@website/public/data/contracts.json`:
- Around line 191-192: The templates are rendered as single blocks because the
renderer in scripts/render-contracts.js (the function that serializes
contract.template/ templateDe) and the consumer in
website/src/components/contracts-page.js (ContractsPage/renderContract or
equivalent) only treat existing "- " lines as list items; update the serializer
to split template/templateDe into paragraphs (split on double newlines) and into
list lines by breaking long sentences/clauses into separate lines prefixed with
"- " where the text reads like checklist steps (e.g., sentence boundaries,
semicolons, "After each", "Keep a running", "Diagnose first", etc.), then have
contracts-page.js use those newline-delimited paragraphs and "- " markers to
render <p> and <li> properly and ensure scripts/render-contracts.js writes the
same formatted output for contracts.html and llms.txt so cards, HTML, and text
outputs show paragraphs and checklist bullets instead of one big paragraph.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 535bf146-63a5-4fdd-a4dd-8cf067187e2f
📒 Files selected for processing (2)
docs/changelog.adocwebsite/public/data/contracts.json
Adds a new semantic contract (not an anchor) to the
/contractspage — the 17th entry incontracts.json, a sibling of Simple Explanation (ELI5) and Concise Response (TLDR).What it is
A gated teaching loop for
explain… / why… / how does … workrequests: the goal is to explain and verify the learner understood, not just deliver an answer.It composes six anchors that already live in the catalog, each on its own axis:
The control flow no single anchor carries — gate each step, verify by active recall, stop when the checklist is met — is the contract's own contribution, and it scales to the size of the question (a quick "why is it named that?" gets one check, not a multi-stage session).
Changes
website/public/data/contracts.json— newexplaining-teachingentry (EN + DE template, all six anchor refs resolve)docs/changelog.adoc— New contracts entry under 2026-06-02Notes
contracts.htmlis a build artifact (gitignored);render-contracts.jsalready includes the new contract.templateDeis provided for the bilingual UI.Summary by CodeRabbit
Release Notes
New Features
Documentation