# Your first rule (/docs/editor/your-first-rule)

Build a rule that reports sped-up clips in the rule editor, see it report in Premiere, then make its limit an option.



In this tutorial you build **Fast clips**, a rule that reports clips played faster than 200 %. You will create the rule, write its condition and message, save it, see it report a clip, and then turn the 200 % into a setting. It takes about ten minutes, and you need nothing but Premiere Pro with PPROLint.

## 1. Create the rule [#1-create-the-rule]

1. Open the PPROLint panel's settings and choose **Rules**.
2. Click the **New rule** button, at the right of the search field, and choose **New rule from scratch**.

![The New rule button's menu open next to the Search rules field, with New rule from scratch and Import rules…](/docs/editor/new-rule-menu.webp)

The editor opens on an empty rule. A red box already lists three problems: the rule has no name, no description and no check yet. That is expected. You fix them in the next steps, and **Save** turns on once the list is empty.

![The editor on a new rule named new-rule, with 3 problems to fix before saving: an empty name, an empty description and no checks](/docs/editor/editor-blank.webp)

## 2. Name the rule [#2-name-the-rule]

In the **Rule** section:

* **Id**: `max-clip-speed`. The id is the rule's permanent name: lower-case words joined by hyphens. It can only be changed now, while the rule is new.
* **Name**: `Fast clips`. This is what the Rules settings list shows.
* **Description**: `Reports clips played faster than the allowed speed.`

Leave the other settings as they are. **Scope: Clip** means the rule looks at every clip of the sequence; **Severity: Warning** is how serious a report is.

![The Rule section filled in: Id max-clip-speed, Name Fast clips, the description, Category Static, Scope Clip, Severity Warning, Matching First check that holds](/docs/editor/tutorial-rule-section.webp)

## 3. Add a check [#3-add-a-check]

A **check** says when to report and what to say. In the **Checks** section, click **Add check**.

![A new Check 1 with Scope Same as the rule (Clip), a condition clip.id is (empty), an empty Message marked Must not be empty, Position and Data](/docs/editor/tutorial-check-added.webp)

The **Report when** row is the condition. It reads like a sentence: *field*, *operator*, *value*.

1. Click the first box, which shows `clip.id`, and choose **clip.speed**. Each field has a short description under its name; `clip.speed` is the playback speed, where 1 is 100 %.

![The field list open, showing clip fields with their descriptions; clip.speed reads Playback speed, 1 = 100 %](/docs/editor/tutorial-field-picker.webp)

2. Click the second box, the operator, and choose **is greater than**. The list only offers operators that make sense for a number.

![The operator list for a number field: is, is not, is greater than, is at least, is less than, is at most, is between, is one of, is not one of, is known, is unknown](/docs/editor/tutorial-operator-picker.webp)

3. Type `2` in the third box, the value.

![The finished condition: Report when clip.speed is greater than 2](/docs/editor/tutorial-condition.webp)

## 4. Write the message [#4-write-the-message]

The message is what the panel shows for each clip the rule reports. A good message says which clip and why.

Type in **Message**: `Clip "{clip.name}" on {clip.track} plays at {clip.speed}× speed.`

Words in braces are **placeholders**: PPROLint replaces `{clip.name}` with the clip's name, `{clip.track}` with its track (`V1`) and `{clip.speed}` with its speed. You don't have to type them: the **{ }** button at the right of the message lists every field and inserts the one you pick.

![The Insert field menu open next to the message, listing fields such as sequence.name and sequence.fps](/docs/editor/tutorial-insert-field.webp)

The check is complete, and the problems box is gone:

![Check 1 complete: clip.speed is greater than 2, and the message Clip {clip.name} on {clip.track} plays at {clip.speed}× speed.](/docs/editor/tutorial-check-done.webp)

## 5. Save and try it [#5-save-and-try-it]

Click **Save**. The editor closes and *Fast clips* is in the list, marked *Custom rule*. It is on, and it runs from the next check.

![The Rules settings with Fast clips at the top, described as Custom rule · Reports clips played faster than the allowed speed, and a Rule saved. notification](/docs/editor/tutorial-saved.webp)

To see it report, set a clip of your sequence to 300 % (**Clip > Speed/Duration…**). The PPROLint panel shows:

![The PPROLint panel listing one warning: Clip A002.mov on V1 plays at 3× speed, at 00:00:10:00, from max-clip-speed](/docs/editor/tutorial-results.webp)

Click the result to select the clip in the timeline.

## 6. Make the limit an option [#6-make-the-limit-an-option]

A fixed 200 % suits one project, not every one. An **option** turns the limit into a setting with a default value, which you can change later without touching the condition.

Open the rule again with its cogwheel. In **Options**, click **Add option** and fill in:

* **Name**: `maxSpeed`
* **Type**: Number
* **Default**: `2`
* **Description**: `Highest allowed speed; 1 is 100 %.`

![The Options section with one option: name maxSpeed, type Number, default 2, description Highest allowed speed; 1 is 100 %.](/docs/editor/tutorial-option.webp)

Now use it in the condition. In the value box, which still says `2`, clear the text and click its arrow: the list shows the number fields **and your options**. Choose **options.maxSpeed**.

![The value list open under the condition, ending with an options group holding options.maxSpeed](/docs/editor/tutorial-value-option.webp)

Change the message so it gives the limit too: `Clip "{clip.name}" on {clip.track} plays at {clip.speed}× speed (maximum {options.maxSpeed}×).`

## 7. Skip disabled clips [#7-skip-disabled-clips]

A disabled clip does not play, so its speed does not matter. Add a second condition:

1. Click **+ Add** under the condition and choose **Add condition**.

![The Add menu under the condition: Add condition, Add an all group, Add an any group, Add a not](/docs/editor/tutorial-add-menu.webp)

2. The condition becomes a group: **All of the following**, which holds when every condition in it does. Set the new row to **clip.disabled** **is** **No**.

![Report when All of the following: clip.speed is greater than options.maxSpeed, clip.disabled is No](/docs/editor/tutorial-group.webp)

## 8. Attach the measured values [#8-attach-the-measured-values]

The panel can show values next to each report. In **Diagnostic data**, click **Add entry** twice and fill in two entries: `speed` from **clip.speed**, and `maxSpeed` from **options.maxSpeed**.

![Diagnostic data with two entries: speed from clip.speed and maxSpeed from options.maxSpeed](/docs/editor/tutorial-data.webp)

Click **Save**. With `maxSpeed` set to 1.5, the panel now reports:

![The PPROLint panel listing: Clip A002.mov on V1 plays at 3× speed (maximum 1.5×)](/docs/editor/tutorial-results-option.webp)

## What you built [#what-you-built]

Your rule is a file, `max-clip-speed.rule.json`, in your rules folder:

```json title="max-clip-speed.rule.json"
{
  "formatVersion": 1,
  "id": "max-clip-speed",
  "name": "Fast clips",
  "description": "Reports clips played faster than the allowed speed.",
  "category": "static",
  "scope": "clip",
  "severity": "warning",
  "options": {
    "maxSpeed": { "type": "number", "default": 2, "description": "Highest allowed speed; 1 is 100 %." }
  },
  "checks": [
    {
      "condition": {
        "all": [
          { "field": "clip.speed", "operator": "greaterThan", "value": { "field": "options.maxSpeed" } },
          { "field": "clip.disabled", "operator": "equals", "value": false }
        ]
      },
      "message": "Clip \"{clip.name}\" on {clip.track} plays at {clip.speed}× speed (maximum {options.maxSpeed}×)."
    }
  ],
  "data": { "speed": "clip.speed", "maxSpeed": "options.maxSpeed" }
}
```

Along the way you used every part of the editor that most rules need:

* the [Rule section](/docs/editor/rule-section): id, name, scope, severity;
* a [check](/docs/editor/checks) with a [condition](/docs/editor/conditions) and a [message](/docs/editor/messages);
* an [option](/docs/editor/options), and [diagnostic data](/docs/editor/data).

Next, browse the [recipes](/docs/editor/recipes) for more rules to build, or read [How rules work](/docs/how-rules-work).
