Style profiles
A style guide is a document. A style profile is what the builder can use from it: typed values that an admin approved, each one pointing at the passage of the guide it came from. The raw guide never reaches the model that writes your lessons.
How a profile is made
Section titled “How a profile is made”- Upload a style guide (Markdown, PDF or DOCX). The file is read like any other source, as untrusted input.
- One model call proposes the values. The call is logged like every other (model, tokens, cost). Values that do not
fit the schema, name something unknown, carry a link or markup, or cite no passage of the guide are dropped, and the
response lists what was dropped in
warnings. A style guide that says “ignore your instructions” can at most produce a value that is dropped. - Review the proposal.
GETon a profile shows the values, the passages they cite (so a reviewer who did not upload the guide can read them) and the diff against the approved profile. - Edit if needed. Values you add by hand have no citation and are marked as yours.
- An admin approves it. Approving replaces the approved profile of its scope; the old one stays as superseded. Nothing changes in an existing course or theme when a profile is approved.
Without AI on the installation, or when the model cannot read the guide, the profile starts empty with a warning and you fill it in by hand.
What a profile holds
Section titled “What a profile holds”| Part | Content |
|---|---|
theme |
theme preset, accent and secondary colour (six digit hex, with a warning when the accent is too weak on the preset), font family names (system or self-hosted fonts only; web-font URLs are ignored), logo file id |
voice |
person (you, we, neutral), formality 1 to 5, longest sentence in words |
readingLevel |
a CEFR level (A1 to C2) or grade-1 to grade-16 per language |
terminology |
the term to use and the terms to avoid, product names with exact casing |
banned |
phrases never to use, and blocking: whether a banned phrase blocks publishing (your decision, never the model’s) |
components |
preferred and disallowed layout components, which must exist in the page catalogue |
imagery |
alt text required, decorative images allowed, no text in images |
examples |
up to three short approved example paragraphs |
The JSON Schema is api/packages/course-builder/resources/schemas/style-profile/v1.json.
In the studio
Section titled “In the studio”Open Style in the studio rail (/studio/style).
- Upload a style guide (Markdown, PDF or DOCX) and, if you like, name the profile. The proposal opens below the list.
- Read what was dropped. The Dropped from the proposal list says which values did not fit and why.
- Check the changes. Changes against the approved profile marks every value Added, Changed or Removed with a word and a symbol, never by colour alone. Each value has a button for the passage of the guide it cites; it opens the text inline, so a reviewer who did not upload the guide can read it.
- Edit a suggestion. Remove a value with its × button, set the person, the formality (1 to 5) and the longest sentence, switch on A banned phrase blocks publishing, or edit all values as JSON. Invalid values are dropped when you save and listed again.
- Approve it (admins). An approved profile is read-only; Create a revision copies it into a new suggestion to change a rule.
- Theme. If the profile has a preset or an accent, Review the theme in settings opens the admin theme screen with the profile in the link. The screen shows the preset and accent as the same diff it shows for an imported brand, with the contrast report, and changes the academy’s theme only when an admin approves that diff.
The page works with the keyboard and a screen reader, at 320 px wide and with AI switched off.
How a course uses the profile
Section titled “How a course uses the profile”When the builder drafts anything for a course (outline, lessons, quizzes, metadata, chat edits, variants) it adds the approved profile to the cached block with the Course Brief, as typed data:
- the voice, reading level, terminology, banned phrases, component preferences, image rules and examples;
- not the citations (they point into the style guide, not into your course’s sources), not the theme (colours and fonts shape the site, not the sentences), not the blocking switch, and never the text of the style guide.
The profile is advisory: the instruction that comes with it says it never overrides the output schema, the citation rules or the facts of the source. Which profile is used:
- the profile the Course Brief names (
styleProfileId, Course Brief v4), if it is still approved; - otherwise the academy’s approved profile;
- otherwise none, and prompts are exactly what they were before.
The brief panel shows a Style row with the profile that will be used (Academy default: Northwind when the brief names
none). Name a profile with PUT .../sessions/{session}/brief ({"styleProfileId": "<id>"}, null for the academy
default) or ulams builder brief set <session> --style-profile-id <id> (none clears it). Only an approved profile is
accepted. Changing the profile after the outline marks the outline and lessons stale, like any other brief change that
shapes the writing; nothing is regenerated silently.
To keep more than one profile in use (for example an expert track beside the academy default), propose it with
--scope brief (scopeType: brief, named by scopeId). Approving a brief profile replaces only the approved profile of the
same name, never the academy default.
The style check
Section titled “The style check”The check is deterministic: no model is called, nothing is rewritten, and it cannot grade anyone or decide who gets access. It reports; you decide. It runs on the course that is about to be published (and on each approved variant), against the profile the brief names, else the academy’s, and its findings appear in the publish summary next to the other checks. Every finding names the style guide passage it comes from.
| Rule | Looks at | Result |
|---|---|---|
| Banned phrases | lessons, quiz questions, final test, the course’s title and description | blocks publishing when the profile’s A banned phrase blocks publishing switch is on, otherwise a warning |
| Terminology | the same text: a term to avoid, or a product name in the wrong casing | warning |
| Components | the landing page: a component the profile does not allow | warning |
| Images | Markdown images without alternative text, when the profile requires it | warning |
| Reading level | each lesson, per language: English by the Flesch-Kincaid grade, Polish by the Pisarek index, Chinese by sentence length in characters | hint |
| Sentence length | each lesson, when more than a fifth of the sentences are longer than the profile’s target | hint |
Matching is on whole words and phrases, ignoring case (a name with capitals must match its casing exactly); a Polish or other
inflected form is a different word. The readability formulas are approximate, and short texts (under three sentences or
30 words) are not judged, so reading level and sentence length are hints only: they are listed on the check result
(hints, and facts.style.hints of the publish check) and never need acknowledging or block anything. Image rules about text
inside images and decorative images cannot be checked from the text and are not.
Warnings must be acknowledged before publishing, like the other warnings. To see what a suggested profile would flag
before approving it, check a course against it: in the studio, open the profile and use Check a course against this
profile, or run ulams style-profiles check <profile> --course <id>.
Restyle a course that already exists
Section titled “Restyle a course that already exists”Changing a profile does not change courses by itself. For a course that was made before, open the approved profile in the
studio and use Restyle a course for this profile: enter the course id, read what a restyle would rewrite and what it
would cost, and create the proposal. It opens on the Living Course review screen, where you accept or reject each rewrite as
a diff and apply the ones you want. It rewrites banned phrases, terms to avoid and product-name casing only, never the correct
answer of a quiz question, and nothing reaches the course before you apply it. Details and limits:
Living Course, Restyle for a style profile. From the command line:
ulams living restyle <session> --confirm-estimate.
Measuring it
Section titled “Measuring it”php artisan course-builder:eval-style reads a short original style guide (resources/fixtures/style-guide.md), scores the
extraction against what the guide says (recall per rule and the share of values that cite a passage), writes a course from a
source with the approved profile and reports how often each rule is followed, with the cost of every call. It runs on the
fake driver by default and with --live on the real model, capped by COURSE_BUILDER_EVAL_MONTHLY_USD. It never touches the
academy’s approved profile. Reading level and sentence length are reported but not scored.
From the command line
Section titled “From the command line”ulams style-profiles propose --file ./style-guide.md # read and cite; returns a suggested profile with its warningsulams style-profiles get <profile> --json # values, cited passages, diff against the approved profileulams style-profiles edit <profile> --values @changes.json # fix a value (invalid ones are dropped and reported)ulams style-profiles approve <profile> # admins; replaces the approved profile of the scopeulams style-profiles propose --from <profile> --profile '{"terminology":[{"use":"participant","avoid":["learner"]}]}'ulams style-profiles propose --file ./expert-guide.md --scope brief --name "Expert track" # a named alternative a brief can pickulams builder brief set <session> --style-profile-id <profile> # none: back to the academy defaultulams style-profiles check <profile> --course 12 # blocking, warnings and hints, with the guide passagesulams style-profiles list --status approvedulams style-profiles delete <profile> --yes # a suggestion or a superseded profile, never the approved oneTo change a rule of the approved profile, propose a revision with --from, review its diff and approve it.
Who can do what
Section titled “Who can do what”Anyone who can use the Course Builder can list and read profiles and propose one; the creator of a suggestion or an admin edits or deletes it; only an admin approves, because an approved profile will shape every course drafted afterwards. Profiles belong to the whole academy (tenant), and an id from another tenant never resolves.
The endpoints are under /api/admin/course-builder/style-profiles and use the builder scope of a scoped token
(builder:read to read, builder:write to propose, edit, approve and delete).