@beff/aula-method 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The aula authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,12 @@
1
- # Temporary Holding Version
1
+ # @beff/aula-method
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The aula method: one way to make a narrated explainer video with [aula](https://github.com/lucasavila00/aula). It is a layer over the engine (`@beff/aula`) and the `aula` command (`@beff/aula-cli`). The engine never imports it.
4
+
5
+ | File | Contents |
6
+ | --- | --- |
7
+ | [SKILL.md](SKILL.md) | The production steps for agents: write, review the text, animate, review the pictures, polish, watch. |
8
+ | [RULES.md](RULES.md) | The rules for scripts, storyboards and pictures. |
9
+ | [REVIEW.md](REVIEW.md) | What blocks a review, what is polish, and the steps of the text and picture reviews. |
10
+ | `index.ts` | ``paragraph`mechanism`({ sources })``: the checks of the rules that a program can check. |
11
+
12
+ A project writes a short skill that says "follow the aula skill", and adds its sources, its guide, its extra rubric items and its gates. Its kit can wrap `paragraph` to add its own checks. Refer to [Kits](https://github.com/lucasavila00/aula/blob/main/docs/agents/kits.md#editorial-rules).
package/REVIEW.md ADDED
@@ -0,0 +1,66 @@
1
+ # Review
2
+
3
+ The aula method has two reviews: the text review (step 2 of [SKILL.md](SKILL.md)), before any animation code, and the picture review (step 6), on the preview stills. [RULES.md](RULES.md) has the rules that the reviews apply.
4
+
5
+ ## The reviewer
6
+
7
+ - The reviewer is a new agent, with a new context, in each round. It did not write the text or the pictures.
8
+ - The reviewer edits nothing. It reads, and it gives a verdict.
9
+ - The coordinator gives the reviewer only these: this file, RULES.md, the project guide and the extra rubric items of the project, the sources, the last line of `aula check`, and the command output or the preview folder. The coordinator does not tell the reviewer what to find. In a later round of the text review, it gives the changed paragraphs and the earlier findings. The briefs are in [SKILL.md](SKILL.md#briefs).
10
+ - The rules that RULES.md tags [check] and [core] passed when `aula check` has no findings, and the rules that it tags [preview] when `aula preview` has no warnings. The reviewer does not check them again. These include the length of each text on screen, a text that repeats the narration and the attribution text of a dashed shape. The number of labels on screen (Pictures 11) is a limit of approximately eight: when `aula check` reports more, the picture reviewer decides if the case is acceptable.
11
+
12
+ ## Blocking and polish
13
+
14
+ A **blocking** finding stops the video until it is fixed:
15
+
16
+ - a claim that is wrong, that has no source, or that lost its attribution;
17
+ - a mechanism that is absent or misleading;
18
+ - key content that a viewer cannot read;
19
+ - a text or a dashed shape that is drawn so that the checks cannot see it (Pictures 13);
20
+ - an item that the project skill adds as blocking.
21
+
22
+ A **polish** finding does not block: a long narration wait, a bad transition, a small overlap, a leftover, a label that almost does not fit. The picture reviewer lists each polish defect that is cheap to fix, as a finding that does not block. No other agent looks for polish. The animator fixes it in the polish step.
23
+
24
+ A picture finding that adds an object, or changes what a move shows, is never polish, also when it is small. Mark it blocking. The animator changes the note of the move with it.
25
+
26
+ When you do not know if a finding is blocking, ask: "Does the viewer learn something false, or not learn the mechanism?" If yes, it is blocking.
27
+
28
+ ## Each finding
29
+
30
+ Each finding has:
31
+
32
+ 1. the address `<chapter file>:<line>`, as the commands print it;
33
+ 2. the rule, by its section and number in RULES.md (for example, "Pictures 4"), or the rubric item;
34
+ 3. **blocking** or **polish** (the picture review), or only the change (the text review, where each finding blocks);
35
+ 4. the change, in one sentence: what to write or draw in its place.
36
+
37
+ A finding that is a matter of taste, with no rule, is not a finding.
38
+
39
+ ## The text review
40
+
41
+ Read the output of `aula script <project>` and `aula timeline <project>`, and the sources. Do not open the chapter modules: the text must work as the commands print it. In a later round, the coordinator names the paragraphs that changed and gives the findings of the earlier round. Review only the changed paragraphs, and say for each earlier finding if it is fixed. A new finding on a paragraph that did not change does not block: report it as a note.
42
+
43
+ 1. **Script against the sources.** For each paragraph, read its sources. Is each claim, number, date and name in a source, with nothing added? Is the attribution kept (Scripts 3)? Do open questions stay open (Scripts 4)? Is it written for the ear (Scripts 5)?
44
+ 2. **Each paragraph:**
45
+ 1. Is the mechanism correct and faithful to the narration?
46
+ 2. Does the picture of the notes show the mechanism with no text (Storyboards 4)?
47
+ 3. Does it use the metaphor of the chapter?
48
+ 4. Does each note say what changes, and where each new object comes from (Storyboards 2 and 6)?
49
+ 5. Is a note a slide (Storyboards 3, Pictures 12)?
50
+ 6. Can the kit or `m` build it, and can a viewer read it at 480p?
51
+ 3. **The video:** Is the frame correct (Scripts 9)? Does the recap only repeat (Scripts 10)? Does each symbol, word and colour keep one meaning (Storyboards 5)?
52
+ 4. **Verdict:** `PASS`, or the list of findings.
53
+
54
+ ## The picture review
55
+
56
+ Review one chapter as soon as its animator finishes. Read the folder of `aula preview <project> <folder> <chapter>`. Each chapter folder has `moves.md`, the stills (`stills/`), the frames every 0.5 seconds (`motion/t*.png`), and the contact sheets (`stills/sheet-*.png`, `motion/sheet-*.png`). Open a still or a frame at full size when a sheet is too small to read.
57
+
58
+ 1. **Look first, with no narration.** Look at the contact sheets of each chapter before you read `moves.md` or the script. Write, for each chapter, what it shows in three sentences or fewer. This is the sound-off test (Storyboards 4).
59
+ 2. **Compare.** Read `moves.md` (the line, the second and the note of each still), `aula timeline <project>` (the words that each move goes with) and RULES.md. For each move: Does the picture agree with its note? Is something crowded, unreadable, a slide, a leftover, or not the metaphor? Does the picture obey its own arithmetic (Pictures 5)?
60
+ 3. **Verdict:** no blocking finding, or the list of findings. Mark each finding blocking or polish.
61
+
62
+ In a later round, the coordinator gives the blocking findings of the earlier round. Review the full chapter again, because a fix can break another move, and say for each earlier finding if it is fixed.
63
+
64
+ **The whole video.** When each chapter passed its review, one new reviewer reads the last preview folder of each chapter for what crosses chapters only: each recurring object, symbol and colour of the storyboard header keeps its look and its meaning (Storyboards 5). It does not review each chapter again.
65
+
66
+ Teaching value is first. Polish is second and never blocks a video.
package/RULES.md ADDED
@@ -0,0 +1,68 @@
1
+ # Rules
2
+
3
+ These are the rules of the aula method for scripts, storyboards and pictures. [SKILL.md](SKILL.md) gives the steps that use them. [REVIEW.md](REVIEW.md) gives what blocks a review.
4
+
5
+ The narrator says every word. The picture has one job: it shows the **mechanism**. It shows what connects to what, what moves, what grows or drains, what blocks what, and what is bigger than what. A viewer with the sound off must be able to say what happens in each chapter. A video that puts the words of the narration on screen is a slideshow. It fails, also when its animation is good.
6
+
7
+ Each rule has a tag when a program finds it:
8
+
9
+ - **[check]**: the `paragraph` of `@beff/aula-method` reports it. `aula check` prints it as a warning.
10
+ - **[core]**: `aula check` reports it with no kit.
11
+ - **[preview]**: `aula preview` reports it as a warning. It is polish.
12
+ - **[project]**: the project adds its part, in its guide or in its kit.
13
+
14
+ A rule with no tag is for the writer, the animator and the reviewer.
15
+
16
+ A project can add rules in its own guide. When a project rule replaces a rule of this file, the project guide names the rule that it replaces, for example "replaces Pictures 6". The project rule wins.
17
+
18
+ ## Scripts
19
+
20
+ 1. **One mechanism for each paragraph.** A paragraph is one narration cue and one visual idea. Its `mechanism` names, in one sentence, what the viewer must understand. [check: a paragraph with no mechanism]
21
+ 2. **Sourced.** Each claim, number, date and name comes from a source. Each paragraph names its sources in `sources`, or it is a recap (`["recap"]`). Remove a sentence that has no source. Do not add facts that are not in the sources, also when you know them. When the sources are not clear, flag it to the person. Do not guess. [check: a paragraph with no sources, a path that is not a file] [project: what a source is]
22
+ 3. **Attributed.** Keep what a source claims separate from what is established. The narration says whose view a claim is ("the author argues", "the report estimates"). A sentence that comes from a different source than the main one names that source. A comparison ("biggest", "most", "first") needs a source that makes the comparison. If the sources list items in no order, do not add an order of cause or size.
23
+ 4. **Open questions stay open.** A doubt, a forecast, a proposal or a plan is not a fact. The script, the picture and the recap keep it open. Do not give a size that no source gives.
24
+ 5. **Spoken.** Use short sentences and plain words. Define a term when the picture first shows it. Write each number, symbol and formula as the words that the voice must say ("four square units", not "4 u²"). Use no lists, tables, quotes, Markdown or LaTeX in a `say`.
25
+ 6. **Written with the picture.** Write the script and the storyboard notes together, for a listener who watches at the same time. Put the sentences in the order in which the picture changes. Refer to what is on screen ("this gap", "the left column"). Do not read a source aloud and add pictures after it: text for readers is dense and never refers to a picture. The sources are the truth for content. The script is free in wording, order and emphasis.
26
+ 7. **Spatial words agree with the layout.** If the script says "on the left" or "above", the picture has that layout. Change the layout, not the words.
27
+ 8. **Paced.** Approximately one move for each two seconds of speech. A move takes the share of its `say` that its timing gives, usually `` `25%` ``, so a `say` is long enough for its move: the parts of the move (each play, fade or hold) split it in proportion to their Manim run times, and each gets a minimum of 0.5 seconds. To time a move to a word, split the `say` at that word. Give a move seconds (`` `3s` ``) only when a share does not fit. A paragraph is long enough for its moves, and not longer. [preview: the narration waits 1 second or more for a move] The length target of a video is four to six minutes. This is a default, not a rule.
28
+ 9. **Frame.** The title, then a first move that shows the central object of the video and the question that the video answers. Show the object. Do not list an agenda. Each chapter has one idea. The last paragraph is a recap. In a video of one chapter, the recap is the last paragraph of that chapter. [check: the video ends with a recap paragraph]
29
+ 10. **The recap only repeats.** The recap brings back two or three core objects of the video, side by side, at a size that you can read. It plays the key motion of each object again, one time, while its sentence is spoken. It adds no facts, no new pictures and no labels. It keeps the attribution of each claim, and it keeps open questions open. Its words never go further than the strongest sourced sentence that it repeats.
30
+ 11. **Short names.** Give a name of three or more words a short label (an abbreviation) the first time that it is spoken. Long names break the label rules.
31
+
32
+ ## Storyboards
33
+
34
+ The storyboard is the `metaphor` of each chapter, the `storyboard` header of the project and the note of each `show`.
35
+
36
+ 1. **One metaphor for each chapter.** Choose a concrete picture: a reservoir, a stack of blocks, a pipe, a time line, a fence, a grid of tiles. Keep it while the idea develops, so that each sentence changes something that the viewer already understands. Use a new picture only for a new idea. [core: each chapter has a metaphor]
37
+ 2. **One move for each change.** A note says what changes on screen: which object, and how. When a note adds an object, it says where the object comes from (Storyboards 6). A move is a change of state. A `say` has a maximum of one `show`: for two changes, split the `say`. To keep the picture still while a `say` is spoken, write no `show` under it. Write ``` show`note``25%` ``` with no function until the text review passes. Each `show` has a timing after its note: `` `25%` `` is the usual value. Write another share only when the note needs it, as `` `100%` `` for a motion that runs to the end of the `say`.
38
+ 3. **A note is a picture, not a slide.** No captions, bullets, cards, quote boxes or text that appears.
39
+ 4. **The sound-off test.** For each paragraph, ask: "With the sound off, what does a viewer understand from this picture?" If the answer is "they read the words", the paragraph fails. If the answer is "they see the square grow and its four tiles fill it", it passes.
40
+ 5. **One symbol, one meaning. One word, one object.** The `storyboard` header defines the recurring objects, symbols and colours one time. A recurring device (a dashed outline, a cap line, a thread) has the same meaning each time, and other things look different. Do not use one narration word for two objects. Each colour keeps one meaning in the full video. [project: its colour meanings]
41
+ 6. **New objects grow from objects that are on screen.** When a chapter needs a new view (a time axis, a ladder), derive it visibly from the recurring object. For example, lift one block out of the stack onto the time axis.
42
+ 7. **It can be built.** The kit or `m` can draw it, and you can read it at the preview size (480p).
43
+
44
+ ## Pictures
45
+
46
+ 1. **Quantities move.** Levels rise and fall, blocks grow and shrink, dots flow. Show a comparison by size, position or count, not by a sentence.
47
+ 2. **Cause, then effect, on screen and in order.** If A causes B, animate A, then B as it reacts. A loop loops: the thing that drains comes back and drains more. No state comes from nowhere. A reset is visible: the picture rewinds.
48
+ 3. **An element appears on the `say` that names it,** and stays long enough to be read: until a later move. [core: a text that leaves in the move that shows it]
49
+ 4. **Labels name things.** A label has a maximum of three words: nouns, numbers, axis names, dates and attributions ("Smith's view"). A label is not a conclusion and does not repeat the narration. [check: a text on screen of more than three words; a text on screen that repeats three words of the narration]
50
+ 5. **The picture obeys its own arithmetic.** Sizes agree with the spoken numbers. Proportions stay the same from move to move. Countable groups match the stated counts. A part that the narration says does not change does not change in the geometry. [project: the invariants of its subject, in its kit]
51
+ 6. **A view has one style and a tag.** Draw what is claimed, forecast, proposed, planned or not known in one style, and tag it with whose view it is. The default style is a dashed outline. Draw what is measured, and real limits, solid. Use dashes only for this. [check: a dashed shape with no attribution text near it]
52
+ 7. **Mark numbers that are only illustrative.** Mark a picture with sizes that are not data, for example with a "schematic units" note. Do not show invented numbers as data. Each size, step or ruler agrees with one of these: the narration speaks it, it is marked schematic, or it is a tagged view (Pictures 6).
53
+ 8. **Actors act.** An actor (a person, an institution, a force) pushes, cuts, routes, moves or pays an object of the picture. It is not a stamp on the picture.
54
+ 9. **Show a contrast as two pictures** that behave differently, side by side. Do not write "A ≠ B".
55
+ 10. **No leftovers.** An object that has done its job leaves fully. Half-faded ghosts, stray bars and old labels confuse the next picture.
56
+ 11. **Readable.** A maximum of approximately eight labels on screen at 480p. No miniatures: a recap or an overview keeps each object at a size that you can read. [check: more than eight texts on screen at the end of an animation of a move]
57
+ 12. **Banned:**
58
+ - narration words, or a paraphrase of them, on screen;
59
+ - a box, card or pill that contains only a claim, a key point or a question;
60
+ - a list of reasons as stacked labels with arrows into a title. Show each cause as it acts on the object;
61
+ - motion that shows no change of state: flashes, circles around an object, decorative indications;
62
+ - quote boxes, crossed-out claims, question marks as content;
63
+ - a prop that has meaning only with the narration: knobs, gauges, levers, stamps, glowing highlights.
64
+ 13. **Nothing hides from the checks.** Draw each text that a viewer can read as a text object (`m.Text`, `m.Tex`, `m.MathTex`, `m.Code`). Draw each dashed outline with the dashed objects of `m` (`m.DashedVMobject`, `m.DashedLine`). Do not draw them as copies of letter shapes, as rows of short lines, or in a different way that the checks cannot see. When `aula check` gives a finding, correct the picture. Do not change how you draw the object to remove the finding. To explain a rule, do not break it on screen: show a correct case, show the limit of the rule as a diagram, or use a plain shape in the place of the text.
65
+
66
+ ## Priorities
67
+
68
+ Teaching value is first: a faithful script, and pictures that make each mechanism clear. Polish is second. A polish defect (a long narration wait, a bad transition, a small overlap, a leftover) is a defect. Fix it when the fix is cheap. It never blocks a video, and it is never more important than accuracy or understanding.
package/SKILL.md ADDED
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: aula-video
3
+ description: Make or change one narrated explainer video with aula - write the script and the storyboard, review them, animate each move, review the pictures, polish, and have the person watch it. Use when asked to make a new aula video, to continue one, or to change the script or the pictures of a video.
4
+ ---
5
+
6
+ # Make a video with aula
7
+
8
+ This skill makes or changes one video. It keeps no state: each run starts at step 0, and `aula check` tells which step is next. [RULES.md](RULES.md) has the rules for scripts, storyboards and pictures. [REVIEW.md](REVIEW.md) has the review rubric.
9
+
10
+ A project uses this skill through its own short skill. The project skill gives its sources, its guide, its kit, its extra rubric items and its gates. Read the project skill first when there is one. Refer to [How a project adds to this skill](#how-a-project-adds-to-this-skill).
11
+
12
+ ## Words
13
+
14
+ - **Project**: one video, in one folder. Its `index.ts` is the project module (`defineProject({ title, theme, storyboard, chapters })`). The folder also has one chapter module for each chapter, and the notes and pictures of the project. A project imports only the files of its folder and packages. Each command takes the path of the project folder: `<project>` below. No file lists the projects.
15
+ - **Chapter**: one module, `export default defineChapter({ heading, metaphor, rows })`. `rows` returns the rows in time order. Commands name a chapter as `NN-<heading slug>`, for example `01-double-the-side`: `NN` is its place in `chapters`. The file name of the module is free, and it is not the chapter name.
16
+ - **Rows**: ``paragraph`mechanism`({ sources })`` starts a paragraph. ``say`text` `` is the next words of the narration. ``` show`note``25%` ``` is an **open move**: a storyboard note with its timing and no animation. ``` show`note``25%`((s) => { … }) ``` is a move with its animation. The timing after the note is required: `` `25%` `` (a quarter of its `say`) is the usual value. The text of a row is on one line, in backticks, with no `${…}`. Each paragraph has a minimum of one `show`. A `say` has a maximum of one `show`, and it can have none: then the picture stays still while it is spoken. A move takes the share of its `say` that its timing gives (refer to [How long a move takes](https://github.com/lucasavila00/aula/blob/main/docs/agents/chapters.md#how-long-a-move-takes)). A note always says a change; to keep the picture still, write no `show`.
17
+ - **Imports**: a chapter module imports `m`, `defineChapter`, `say` and `show` from `@beff/aula`, and `paragraph` from `@beff/aula-method` (or `kit.paragraph` from the project's kit). A project module imports `defineProject` from `@beff/aula`, and `theme` from the project's kit.
18
+ - **The paragraph of the method**: ``paragraph`mechanism`({ sources })`` of `@beff/aula-method`, or the `paragraph` of the project's kit, which wraps it. Do not use the core `paragraph()` of `@beff/aula`: it has no checks of the method.
19
+ - **Address**: `<chapter file>:<line>`. Each command prints it, and each finding cites it. Lines move when an animator adds functions. When a later step uses an earlier finding, find the row by its quoted text, not by its old line.
20
+ - **Clock**: the word times. `check` uses no clock. `timeline` and `preview` use the times of the narrator's clock, with no audio. `aula web` and `aula export` narrate, and use the real word times. The narrator (aula-voice) gives the same times on both clocks.
21
+
22
+ ## Roles
23
+
24
+ - The **coordinator** starts the other agents, runs the commands of steps 0 and 9, and runs the gates.
25
+ - The **writer** writes the texts: the project module, and in each chapter the `heading`, the `metaphor` and the rows, with no functions.
26
+ - One **animator** for each chapter writes the function of each `show` of its chapter, applies the picture findings of its chapter and polishes it (steps 5, 7 and 8).
27
+ - A **reviewer** has a new context, edits nothing, and is a new agent in each round. Refer to [REVIEW.md](REVIEW.md).
28
+
29
+ The coordinator starts each agent with its brief (refer to [Briefs](#briefs)). It does not wait for a group of agents: each chapter goes to its next step when its agent finishes.
30
+
31
+ The roles are a default. The coordinator can also take the writer and animator roles, and a project can join or split roles. With more than 3 chapters, the coordinator does not animate: it gives each chapter to an animator, and it acts on each report before other work. One rule does not change: a reviewer has a new context and does not edit. If you cannot start other agents, do each role in turn, but start each review with no memory of the work: read only what the reviewer reads.
32
+
33
+ ## The commands
34
+
35
+ | Command | Use |
36
+ | --- | --- |
37
+ | `aula check <project> [<chapter> ...]` | Every check that draws no frames. It prints the findings, then `<folder name>: N errors, M warnings, T open moves`. With chapters, it prints only the findings of those chapters, and N, M and T count only those chapters. One line `other chapters: N errors, M warnings` gives the count of the findings of the other chapters. |
38
+ | `aula script <project>` | The narration text, with the line of each paragraph. |
39
+ | `aula timeline <project> [<chapter> ...]` | The storyboard header, then each chapter file and metaphor, each paragraph with its notes, and each `say` and move, with its line, its second and its note. |
40
+ | `aula preview <project> <folder> [<chapter>[:<line>] ...]` | It runs `check` first and prints its findings. Then PNG pictures from the Lottie file, and a warning at each move that the narration waits for 1 second or more: for each chapter a folder with `moves.md`, one still for each move (its end state, just before the next move), one frame each 0.5 seconds and contact sheets. `<chapter>:<line>` draws only the paragraph that holds that line. |
41
+ | `aula web [<parent>]` | A local page that plays the video of each project folder in `<parent>` (default: the current folder) in a browser, with its narration. It builds a chapter again when its files change. A move with no animation holds its picture. The person watches the video here. |
42
+ | `aula export <project> <file.mp4>` | The video as one MP4 file (H.264 and AAC, 1280 × 720, 30 fps) that plays everywhere. It runs `check` first and stops on an error or an open move, then narrates the video. It needs `ffmpeg` on the `PATH`. Use it to send the video. |
43
+ | `aula bundle <project> <file.zip>` | The project zip: the source files that the video uses, its kit and its assets. The page of `aula web` or of the Pages site plays it when the person drops it. Use it to send a video that the receiver can edit, or to host it. |
44
+
45
+ Run the commands as `pnpm aula <command>` (or with the package runner of the repository), in the folder of `package.json`. Do not write wait loops around them: they wait for their locks.
46
+
47
+ ## Step 0: start
48
+
49
+ Run `aula check <project>`. Continue at the step that its output gives:
50
+
51
+ | `check` prints | Continue at |
52
+ | --- | --- |
53
+ | `<project> has no index.ts`, with exit code 1 | step 1. In a new repository, first set it up (refer to [Set up a repository](#set-up-a-repository)). |
54
+ | Findings, and each move is open | step 1 (step 3, if a review gave findings) |
55
+ | No findings, each move is open | step 2 |
56
+ | Some moves are open | step 5, for the chapters that have open moves |
57
+ | No move is open, with findings | step 7 |
58
+ | No move is open, no findings | step 6 |
59
+
60
+ "Findings" are errors and warnings. `check` cannot know if a review passed. When you do not know, do the review again: a review is cheap and edits nothing.
61
+
62
+ If the repository has no `package.json` with the aula packages, set it up first. Refer to [Set up a repository](#set-up-a-repository).
63
+
64
+ ## Step 1: write
65
+
66
+ **Role**: writer. **Reads**: the subject, the sources, RULES.md, the project guide. **Edits**: the project module and the chapter modules, with no functions.
67
+
68
+ 1. Read the sources. List the claims, numbers and examples that the video can use.
69
+ 2. Choose the chapters: one idea for each chapter, a first move that shows the central object, a recap last (Scripts 9).
70
+ 3. Write the project module: the `title`, the `storyboard` header (the recurring objects, symbols and colours, and what the sizes mean) and the `chapters` in order.
71
+ 4. For each chapter, write the `heading`, the `metaphor` and the rows: ``paragraph`mechanism`({ sources })``, ``say`text` `` and ``` show`note``25%` ```. Write the `say` rows and the notes together (Scripts 6). Give each `show` the timing `` `25%` ``, unless the picture needs a different share of its `say`: `` `100%` `` for a motion that runs with the words to the end of the `say`.
72
+ 5. Run `aula check <project>`. It also checks that each path in `sources` is a file. Fix each finding.
73
+
74
+ **Exit**: no findings. Then step 2.
75
+
76
+ ## Step 2: review the text
77
+
78
+ **Role**: a new reviewer. **Reads**: `aula script <project>` against the sources, and `aula timeline <project>` (the rows and the notes of each paragraph) against REVIEW.md and RULES.md. It does not open the chapter modules. **Edits**: nothing.
79
+
80
+ The coordinator starts the reviewer with the [first-round brief](#briefs).
81
+
82
+ Follow [The text review](REVIEW.md#the-text-review). **Exit**: `PASS`, or findings. With findings, go to step 3.
83
+
84
+ ## Step 3: apply the text findings
85
+
86
+ **Role**: writer. **Reads**: the findings. **Edits**: the texts that the findings cite. Run `aula check <project>`. Before the next round, read the items of [The text review](REVIEW.md#the-text-review) for each paragraph that you changed, and fix what they find. **Exit**: no findings. Then step 2 again, with a new reviewer and the [later-round brief](#briefs), for the changed paragraphs only.
87
+
88
+ ## Step 4: text gate
89
+
90
+ **Role**: coordinator. The project approves the text, if its skill gives a text gate. With no gate, continue. The person listens to the script in `aula web`: it plays the video with its narration, and each move with no animation holds its picture.
91
+
92
+ ## Step 5: animate
93
+
94
+ **Role**: one animator for each chapter, in parallel. A chapter starts when the text review gives no finding on it, also when other chapters are still in step 3. Do not animate a paragraph before its text passes: a finding on it deletes the functions. **Reads**: this step, its chapter module, `aula timeline <project> <chapter>`, the storyboard header, RULES.md (Pictures), the project guide and the kit, the timing rules ([Timing on spoken words](https://github.com/lucasavila00/aula/blob/main/docs/agents/chapters.md#timing-on-spoken-words), [How long a move takes](https://github.com/lucasavila00/aula/blob/main/docs/agents/chapters.md#how-long-a-move-takes) and [Run times](https://github.com/lucasavila00/aula/blob/main/docs/agents/api.md#run-times)), and the type declarations of `@beff/aula`. `grep -r` the package folder in the `node_modules` of the repository (`node_modules/@beff/aula/`, also when it is a link) for the names and signatures: `engine.d.ts` has the mobjects, the animations and the scene `s`, and `manim.d.ts` lists the names of `m`. In a link to a source checkout of aula, they are `src/engine.ts` and `src/manim.ts`. Do not read all of the Chapters and API pages. **Edits**: the function of each open move of its chapter, and the rows that the writer sends (refer to [Rewrites](#rewrites)). The animator owns its chapter module until it reports.
95
+
96
+ Before the animators start, the coordinator makes one kit function for each recurring object of the storyboard header. No animator starts before each of these functions exists. Each chapter, and the recap, draws the object with that function, so that it looks the same in each chapter (Storyboards 5). An animator does not draw a recurring object again in its own way.
97
+
98
+ 1. Give each ``` show`note``25%` ``` its function: ``` show`note``25%`((s) => { … }) ```. The function makes the picture that the note says, and nothing more.
99
+ 2. The frame is approximately 14.2 units wide and 8 units high, with the origin at the center. The chapter heading docks at the top left: keep the picture below it. Objects for the whole chapter go before the `return [` of `rows`. An object that one move makes and a later move uses is a `let` before `return [`.
100
+ 3. The timing after the note gives the length of the move: a share of its `say` (`` `25%` ``) or seconds (`` `3s` ``). The timing gives the length of the move. Write the plays as in Manim: a `runTime` or the seconds of a wait make a part longer or shorter than the other parts, and do not change the length of the move. To start a move on a later word, split its `say` at that word into two adjacent `say` rows. Change the share when the motion is too fast or too slow on the motion sheets. Use seconds only when a share does not fit. Do not change the words or the notes. If a note cannot be drawn, stop and report it (refer to [Where a finding goes](#where-a-finding-goes)).
101
+ 4. Run `tsc --noEmit` and fix each error. `tsc` finds a name that `m` or a mobject does not have. `aula check` gives only `… is not a function` for it.
102
+ 5. Run `aula preview <project> <folder> <chapter>:<line>` for one paragraph, or `<chapter>` for the chapter. `preview` runs `check` first and prints its findings: do not run `aula check` before it. Fix each finding. It prints only the findings of your chapter, and its line gives the open moves of your chapter only. A narration-wait warning (`the narration waits 2.1 s for this move`) is polish: give the move fewer parts or a smaller share. A slow-move warning (`this move runs 4.5 s, 4.5 times its 1.0 s in Manim: it moves slowly`) is polish: give the move a smaller share. When only more words in its `say` fix it, report it: do not change the words. Look at the stills and the contact sheets yourself before you report. As Manim's `construct()`, the function of a move runs one time for each drawing. An updater with `dt` runs on the real clock: after the first part of a move, the move does not read or change its object (refer to [Updaters in a move](../../docs/agents/chapters.md#updaters-in-a-move)).
103
+
104
+ **Exit**: no open move and no findings in the chapter, other than the narration waits that it reported, and the animator looked at its sheets. Then step 6 for that chapter, also when other animators did not finish.
105
+
106
+ ## Step 6: review the pictures
107
+
108
+ **Role**: a new reviewer for each chapter, as soon as its animator finishes. Run `aula preview <project> <folder> <chapter>`. **Reads**: the contact sheets first, with no narration, then `moves.md`, `aula timeline <project> <chapter>`, the notes, RULES.md and REVIEW.md. **Edits**: nothing.
109
+
110
+ Follow [The picture review](REVIEW.md#the-picture-review). **Exit**: no blocking finding. Each finding is blocking or polish. A finding that adds an object or changes what a move shows is blocking, also when it is small. With blocking findings, go to step 7. Then go to step 8 for that chapter.
111
+
112
+ When each chapter passed this step, one more new reviewer reviews the whole video, only for what crosses chapters (refer to [The picture review](REVIEW.md#the-picture-review)). It reads the last preview folder of each chapter. Do not make a new preview of the whole project. Polish does not wait for it. A blocking finding goes to step 7 for its chapter, and a polish finding to step 8 for its chapter.
113
+
114
+ ## Step 7: apply the picture findings
115
+
116
+ **Role**: the animator of the chapter. As in step 5. A finding names one move, but its rule applies to the full chapter: find each move of the chapter that breaks the same rule, and fix it in the same edit. When a finding adds an object or changes what a move shows, change the note of that move in the same edit, so that the note says what the picture shows. Do not change the narration. When no word of the narration changes, step 2 does not run again. **Exit**: step 6 again, for the changed chapters only, with the [later-round brief](#briefs).
117
+
118
+ ## Step 8: polish
119
+
120
+ **Role**: the animator of the chapter, as soon as the review of its chapter ends, one round. **Reads**: the polish findings, and the stills and motion sheets of its chapter (`aula preview <project> <folder> <chapter>`). **Edits**: the functions of its chapter.
121
+
122
+ The animator fixes only the polish findings that it gets: small, local defects, for example motion timing, leftovers, overlaps, a label that does not fit. It adds no object and does not change what a move shows. It adds no ideas. It does not change the narration, the notes, other chapters or the kit. It reports a problem that needs a larger change, and does not fix it. Then it runs one preview of its chapter and looks at the new sheets, because the checks do not find each collision. Polish needs no new review. **Exit**: each polish finding is fixed or reported, and `aula preview` of the chapter has no findings, other than the narration waits that it reported.
123
+
124
+ ## Step 9: watch
125
+
126
+ **Role**: coordinator. Run `aula web <parent>` and give its address to the person. The person watches the video in `aula web`, and approves it or asks for changes. A change starts a rewrite (refer to [Rewrites](#rewrites)). The project skill can give a different watch gate. With no person and no gate, the video is done when step 8 is done.
127
+
128
+ **Share, only when the person asks**: run `aula export <project> <file.mp4>` and give the MP4 file to the person. It plays in browsers, chat apps and video players. When the receiver must edit the video, run `aula bundle <project> <file.zip>` and give the zip to the person. Other people drop it on https://lucasavila00.github.io/aula/. For a link, host the zip where CORS is allowed (GitHub Pages or a raw GitHub URL) and give `https://lucasavila00.github.io/aula/?src=<URL of the zip>`.
129
+
130
+ ## Briefs
131
+
132
+ Copy the brief of the role. Put the names in place of `<project>`, `<chapter>`, `<file>` (the chapter module) and `<folder>`, and the other text in `<…>`. When there is a project skill, add its guide, its kit and its extra rubric items. Do not tell a reviewer what to find.
133
+
134
+ **Text reviewer, first round** (step 2):
135
+
136
+ > You review the text of the aula video `<project>`. You edit nothing. Read REVIEW.md, RULES.md and the sources in `<sources>`. The last line of `aula check <project>` is: `<line>`. Run `aula script <project>` and `aula timeline <project>`. Do not open the chapter modules. Follow "The text review" of REVIEW.md. Give `PASS`, or the findings.
137
+
138
+ **Text reviewer, later round** (step 2 again):
139
+
140
+ > You review the changes to the text of the aula video `<project>`. You edit nothing. Read REVIEW.md, RULES.md and the sources of the changed paragraphs: `<sources>`. The changed paragraphs are: `<address and first words of each>`. The findings of the earlier round are: `<findings>`. Run `aula timeline <project> <chapter> ...` for the chapters that changed, and read only the changed paragraphs. Do not open the chapter modules. Follow "The text review" of REVIEW.md for a later round. Give `PASS`, or the findings.
141
+
142
+ **Animator** (step 5):
143
+
144
+ > You animate chapter `<chapter>` of the aula video `<project>`, in `<file>`. Read step 5 of SKILL.md and only what it lists, then do step 5. For names and signatures, `grep -r` the type declarations in `node_modules/@beff/aula/` (step 5 gives the files). Draw the recurring objects with their kit functions: `<functions>`. Edit only the functions of the open moves in `<file>`, and insert word for word the rows that the writer sends you. Preview into `<folder>`. Do not hide an object from the checks (Pictures 13). `preview` runs `check`: do not run `aula check` before it. Report when the preview has no findings and you looked at the sheets.
145
+
146
+ **Picture reviewer** (step 6):
147
+
148
+ > You review the pictures of chapter `<chapter>` of the aula video `<project>`. You edit nothing. Read REVIEW.md and RULES.md. Run `aula preview <project> <folder> <chapter>`. Look at its contact sheets first, with no narration. Then read `moves.md` and `aula timeline <project> <chapter>`. Do not open the chapter modules. Follow "The picture review" of REVIEW.md. Give no blocking finding, or the findings, each blocking or polish. List each polish defect that is cheap to fix, as a polish finding.
149
+
150
+ **Picture reviewer, later round** (step 6 again): the same brief, and add: "The blocking findings of the earlier round are: `<findings>`. Say for each if it is fixed."
151
+
152
+ For the review of the whole video, use the same brief with "the whole video" in place of the chapter, and `aula timeline <project>`. In place of `aula preview`, give the last preview folder of each chapter: `<folders>`. It follows "The whole video" in REVIEW.md.
153
+
154
+ **Animator, findings** (step 7):
155
+
156
+ > You apply the picture findings of chapter `<chapter>` of the aula video `<project>`, in `<file>`. Read step 7 of SKILL.md and do it. The blocking findings are: `<findings>`. Do only these, but apply the rule of each finding to each move of the chapter. Polish findings wait for step 8. Change the note of each move whose picture changes, in the same edit. Do not change the words of a `say`. Edit only `<file>`. Preview into `<folder>` and look at the sheets. Do not hide an object from the checks (Pictures 13). `preview` runs `check`: do not run `aula check` before it. Report when the preview has no findings.
157
+
158
+ **Animator, polish** (step 8, to the same animator):
159
+
160
+ > The review of chapter `<chapter>` ended. Read step 8 of SKILL.md and do it. The polish findings are: `<findings>`. Fix only these, in the functions of `<file>`. Report a problem that needs a larger change, and do not fix it. Then run one `aula preview <project> <folder> <chapter>` and look at the stills and the motion sheets. Do not hide an object from the checks (Pictures 13). Report when the preview has no findings.
161
+
162
+ ## Where a finding goes
163
+
164
+ | Finding | Go to |
165
+ | --- | --- |
166
+ | Step 6: the animation is wrong, and the note is correct | step 7 |
167
+ | Step 6: the picture needs a new object, or a move must show something else, and the words stay | step 7. The animator changes the note in the same edit. No step 2. |
168
+ | Step 6: the note or the words are wrong, or the picture cannot show the mechanism | delete the function, correct the texts (step 3), and do step 2 for that paragraph. An animator does not hide a bad script. |
169
+ | A kit component could prevent the defect in all videos | correct the kit first, then step 7 |
170
+ | aula could prevent it with a check or a better default | open an issue on aula, then continue with step 7 |
171
+ | A polish finding | step 8. It does not block. |
172
+
173
+ ## Loop limits
174
+
175
+ - **Step 2**: the first round reads the full video. A later round reviews only the paragraphs that step 3 changed (refer to [The text review](REVIEW.md#the-text-review)). A round fails when a finding repeats a finding of an earlier round. After three rounds that fail, stop. Report the open findings to the person who asked for the video. Do not animate a text that is not approved.
176
+ - **Step 6**: when the same blocking finding stays after two rounds of step 7, open the move again: delete its function, write a new note, and go to step 2 for that paragraph. Do not try a third time. After three rounds of step 6 on a chapter, the coordinator stops and gives the open findings to the person who asked for the video. A round that only checks the fixes and finds no new blocking finding is a pass.
177
+
178
+ ## Rewrites
179
+
180
+ A rewrite uses the same steps. The size of the change selects the first step.
181
+
182
+ | Change | Edit | Do again |
183
+ | --- | --- | --- |
184
+ | A text change during step 5 | the writer sends the new rows to the animator of the chapter. The animator inserts them word for word, with no function | step 2 for that paragraph only; then the animator animates it (step 5) |
185
+ | The words of a sentence | the `say` text | step 2 for the paragraph; `preview <chapter>:<line>`, because the timing moved |
186
+ | One animation | the function of one `show` | `preview <chapter>:<line>`; step 6 for the chapter |
187
+ | The picture of one move | delete the function, write a new note | step 2 for the note; steps 5 and 6 for the chapter |
188
+ | Move or remove paragraphs | the rows from one `paragraph` to the next | step 2 for the chapter; step 6 for the moved paragraphs and each later paragraph of the chapter, because the picture state moves with them |
189
+ | Move or remove chapters | the `chapters` list | step 2 for the recap and for each sentence that refers to another chapter |
190
+ | A new script for a chapter | delete each function, then write | from step 2 |
191
+ | A new video | a new project | from step 1 |
192
+
193
+ ## How a project adds to this skill
194
+
195
+ A project writes its own short skill. It says "follow the aula skill", and adds only what is about the project:
196
+
197
+ - **Where things are**: the project folder, the kit, the project guide.
198
+ - **Sources**: what a source is and how a paragraph names it. `aula check` checks that a path is a file, not the reviewer.
199
+ - **Rules**: the project guide adds rules. A rule that replaces a rule of RULES.md names it.
200
+ - **Rubric**: extra review items. Each item is blocking or polish.
201
+ - **Pipeline**: extra inputs, commands or gates for a step, by the number of the step. The order of the steps does not change.
202
+ - **Gates**: what the text gate (step 4) and the watch gate (step 9) are. With no gate, the step continues.
203
+
204
+ The project's kit can add checks in code: its `paragraph` calls ``paragraph`…`(notes, check)`` of `@beff/aula-method` with a check that calls `findings(p, chapter, notes)` and adds or removes findings. The method has no settings.
205
+
206
+ ## Set up a repository
207
+
208
+ aula needs Node 24 or later. The narration (aula-voice) needs no other tool. aula does not install Node. Install the packages with the package manager of the repository, for example `pnpm add @beff/aula @beff/aula-cli @beff/aula-method` and `pnpm add -D typescript @types/node`.
209
+
210
+ A repository has these files:
211
+
212
+ | File | Contents |
213
+ | --- | --- |
214
+ | `package.json` | The dependencies: the aula packages and the kit. It has no aula configuration. |
215
+ | `tsconfig.json` | `{ "compilerOptions": { "module": "nodenext", "target": "es2024", "strict": true, "noEmit": true, "allowImportingTsExtensions": true, "types": ["node"] } }`. Relative imports end in `.ts`. |
216
+ | The kit | A package that exports `theme` (type `m.Theme`): `background`, `heading`, `accent` and `docked` (colours, `"#RRGGBB"`), and `headingSize`, `kickerSize`, `dockedSize` and `numberSize` (text sizes, for example 52, 20, 24 and 16). It also has the parts that two or more projects use. Refer to [Kits](https://github.com/lucasavila00/aula/blob/main/docs/agents/kits.md). |
217
+ | `<slug>/index.ts` | The project module of the project folder `<slug>/` (the folder name is the project's name: in `check`, in the web app and in zip names; the folders can also be in one parent folder): `export default defineProject({ title, theme, storyboard, chapters })`, with `theme` from the kit. A new folder with `index.ts` is a new project: do not list it in another file. |
218
+ | `<slug>/<chapter>.ts` | One chapter module for each chapter: `export default defineChapter({ heading, metaphor, rows })`. |
219
+ | `notes/` | The sources, if the project skill gives no other place. |
220
+
221
+ For the setup, read [Getting started](https://github.com/lucasavila00/aula/blob/main/docs/agents/getting-started.md). [Chapters](https://github.com/lucasavila00/aula/blob/main/docs/agents/chapters.md), [API](https://github.com/lucasavila00/aula/blob/main/docs/agents/api.md) and [CLI](https://github.com/lucasavila00/aula/blob/main/docs/agents/cli.md) have the chapter format, the `m` API and the commands.
@@ -0,0 +1,25 @@
1
+ /** The checks of the aula method: each paragraph names its sources (each path a file) and the
2
+ * one mechanism that the viewer must understand, and the texts on screen name things and are
3
+ * few. RULES.md
4
+ * tags these rules [check]. The core never imports this package: `paragraph` returns a core paragraph row whose
5
+ * check returns each broken rule as a finding with a message that says the fix, which
6
+ * `aula check` prints. */
7
+ import { type Check, type CheckedChapter, type CheckedParagraph, type Finding, type Row } from "@beff/aula";
8
+ /** The notes of one paragraph. */
9
+ export interface ParagraphNotes {
10
+ /** The sources that support it, or `["recap"]` for a paragraph that only repeats earlier
11
+ * ones. A source with no space and no `://`, and with a `/` or a `.`, is a path from the
12
+ * working directory, and it must be a file. */
13
+ sources: readonly string[];
14
+ /** What the viewer must understand, in one sentence. */
15
+ mechanism: string;
16
+ }
17
+ /** The broken rules of paragraph `p` of the complete chapter text `chapter`. A kit that adds
18
+ * its own rules calls it and adds its findings (refer to `paragraph`). */
19
+ export declare function findings(p: CheckedParagraph, chapter: CheckedChapter, notes: ParagraphNotes): Finding[];
20
+ /** ``paragraph`mechanism`({ sources })``: a paragraph with its notes, a core paragraph
21
+ * row. The text of the tag is the mechanism: one line, with no `${…}`. `aula timeline` prints the
22
+ * notes. Each finding is a warning at the paragraph's line. The default check is `findings`. A
23
+ * kit gives its own check to add or remove findings:
24
+ * ``paragraph`…`(notes, (p, chapter) => [...findings(p, chapter, { mechanism, ...notes }), ...mine(p)])``. */
25
+ export declare function paragraph(strings: TemplateStringsArray): (notes: Omit<ParagraphNotes, "mechanism">, check?: Check) => Row;
package/dist/index.js ADDED
@@ -0,0 +1,129 @@
1
+ /** The checks of the aula method: each paragraph names its sources (each path a file) and the
2
+ * one mechanism that the viewer must understand, and the texts on screen name things and are
3
+ * few. RULES.md
4
+ * tags these rules [check]. The core never imports this package: `paragraph` returns a core paragraph row whose
5
+ * check returns each broken rule as a finding with a message that says the fix, which
6
+ * `aula check` prints. */
7
+ import { paragraph as row, tagText, } from "@beff/aula";
8
+ /** The most labels on screen at one instant, approximately (Pictures 11). */
9
+ const MAX_LABELS = 8;
10
+ /** The opacity over which a text counts as a label on screen: a text that fades in or out
11
+ * counts while it is more than half opaque. */
12
+ const LABEL_OPACITY = 0.5;
13
+ /** The most words of one text on screen. */
14
+ const MAX_TEXT_WORDS = 3;
15
+ /** Consecutive narration words that make a text on screen an echo. */
16
+ const ECHO_WORDS = 3;
17
+ /** Text words that say whose view a dashed shape is. */
18
+ const ATTRIBUTION_WORDS = [
19
+ "view",
20
+ "claim",
21
+ "forecast",
22
+ "estimate",
23
+ "proposed",
24
+ "external",
25
+ "schematic",
26
+ "not measured",
27
+ "expected",
28
+ "alleged",
29
+ ];
30
+ /** The largest gap, in frame units, between a dashed shape and its attribution text. */
31
+ const NEAR = 1;
32
+ const quote = (s) => JSON.stringify(s);
33
+ /** The lowercase words of `text`: runs of `[a-z0-9$%]`. */
34
+ function words(text) {
35
+ return text.toLowerCase().match(/[a-z0-9$%]+/g) ?? [];
36
+ }
37
+ /** True for a source that is a path: it has no space and no `://`, and it has a `/` or a `.`.
38
+ * So `recap`, URLs and free text are not paths. */
39
+ function isPath(source) {
40
+ return !/\s/.test(source) && !source.includes("://") && /[/.]/.test(source);
41
+ }
42
+ /** True if `text` repeats three or more consecutive words of the narration. */
43
+ function echoes(text, narration) {
44
+ const tokens = words(text);
45
+ const spoken = ` ${words(narration).join(" ")} `;
46
+ for (let i = 0; i + ECHO_WORDS <= tokens.length; i++) {
47
+ if (spoken.includes(` ${tokens.slice(i, i + ECHO_WORDS).join(" ")} `))
48
+ return true;
49
+ }
50
+ return false;
51
+ }
52
+ /** True if `text` says whose view a dashed shape is ("Smith's view", "IMF forecast"). */
53
+ function isAttribution(text) {
54
+ const lower = text.toLowerCase();
55
+ return (ATTRIBUTION_WORDS.some((w) => lower.includes(w)) ||
56
+ /(^|[^\p{L}\p{N}_])\p{Lu}[\p{L}\p{N}_.&-]*['’]s(?![\p{L}\p{N}_])/u.test(text));
57
+ }
58
+ /** True if the bounds of `a` and `b` are at most `NEAR` apart. */
59
+ function near(a, b) {
60
+ const dx = Math.max(a.low[0] - b.high[0], b.low[0] - a.high[0], 0);
61
+ const dy = Math.max(a.low[1] - b.high[1], b.low[1] - a.high[1], 0);
62
+ return Math.hypot(dx, dy) <= NEAR;
63
+ }
64
+ /** The broken rules of paragraph `p` of the complete chapter text `chapter`. A kit that adds
65
+ * its own rules calls it and adds its findings (refer to `paragraph`). */
66
+ export function findings(p, chapter, notes) {
67
+ const out = [];
68
+ const add = (message, at = p.place) => {
69
+ out.push({ message, ...(at === undefined ? {} : { at }) });
70
+ };
71
+ if (notes.mechanism.trim() === "")
72
+ add("the paragraph has no mechanism: name the one mechanism that the viewer must understand");
73
+ if (notes.sources.length === 0)
74
+ add('the paragraph has no sources (give its sources, or ["recap"])');
75
+ for (const source of notes.sources) {
76
+ if (isPath(source) && !chapter.exists(source))
77
+ add(`${quote(source)}: this path is not a file: correct the path or add the file`);
78
+ }
79
+ const spoken = chapter.paragraphs.flatMap((q) => q.says.map((say) => say.text)).join(" ");
80
+ const texts = new Map();
81
+ for (const instant of p.screen.instants) {
82
+ for (const shown of instant.texts)
83
+ texts.set(JSON.stringify([shown.place, shown.text]), shown);
84
+ }
85
+ for (const shown of texts.values()) {
86
+ if (shown.text.split(/\s+/).filter(Boolean).length > MAX_TEXT_WORDS)
87
+ add(`text on screen over ${String(MAX_TEXT_WORDS)} words: ${quote(shown.text)}; make it shorter`, shown.place);
88
+ if (echoes(shown.text, spoken))
89
+ add(`text on screen repeats the narration: ${quote(shown.text)}; use other words`, shown.place);
90
+ }
91
+ // At most about eight labels on screen at each instant: report the most of each move.
92
+ const labels = new Map();
93
+ for (const instant of p.screen.instants) {
94
+ const count = new Set(instant.texts.filter((t) => t.opacity > LABEL_OPACITY).map((t) => t.id)).size;
95
+ const key = JSON.stringify(instant.place);
96
+ if (count > (labels.get(key)?.count ?? MAX_LABELS))
97
+ labels.set(key, { count, at: instant.place });
98
+ }
99
+ for (const { count, at } of labels.values())
100
+ add(`${String(count)} labels on screen (about ${String(MAX_LABELS)} at most): show fewer labels at one time, or split the picture`, at);
101
+ // A dashed shape needs an attribution text near it at one instant at least.
102
+ const unattributed = new Map();
103
+ const attributed = new Set();
104
+ for (const instant of p.screen.instants) {
105
+ for (const dashed of instant.dashed) {
106
+ if (instant.texts.some((shown) => isAttribution(shown.text) && near(shown, dashed)))
107
+ attributed.add(dashed.id);
108
+ else
109
+ unattributed.set(dashed.id, dashed);
110
+ }
111
+ }
112
+ for (const [id, dashed] of unattributed) {
113
+ if (!attributed.has(id))
114
+ add('dashed shape with no attribution text near it: put a text that says whose view it is, such as "Smith\'s view", next to it', dashed.place);
115
+ }
116
+ const last = chapter.number === chapter.count && p.index === chapter.paragraphs.length - 1;
117
+ if (last && !(notes.sources.length === 1 && notes.sources[0] === "recap"))
118
+ add('the video must end with a recap paragraph (sources: ["recap"])');
119
+ return out;
120
+ }
121
+ /** ``paragraph`mechanism`({ sources })``: a paragraph with its notes, a core paragraph
122
+ * row. The text of the tag is the mechanism: one line, with no `${…}`. `aula timeline` prints the
123
+ * notes. Each finding is a warning at the paragraph's line. The default check is `findings`. A
124
+ * kit gives its own check to add or remove findings:
125
+ * ``paragraph`…`(notes, (p, chapter) => [...findings(p, chapter, { mechanism, ...notes }), ...mine(p)])``. */
126
+ export function paragraph(strings) {
127
+ const mechanism = tagText("paragraph", strings);
128
+ return ({ sources }, check) => row({ mechanism, sources }, check ?? ((p, chapter) => findings(p, chapter, { mechanism, sources })));
129
+ }
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@beff/aula-method",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "The aula method: one way to make a narrated explainer video with aula. SKILL.md has the production steps, RULES.md the rules for scripts, storyboards and pictures, REVIEW.md the review rubric, and `paragraph` the checks of the rules that a program can check.",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/lucasavila00/aula.git",
10
+ "directory": "packages/aula-method"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "SKILL.md",
22
+ "RULES.md",
23
+ "REVIEW.md"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "engines": {
29
+ "node": ">=24"
30
+ },
31
+ "dependencies": {
32
+ "@beff/aula": "0.1.0"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -p tsconfig.build.json",
36
+ "typecheck": "tsc --noEmit -p ."
37
+ }
6
38
  }