Solution · Your first Rule
A reference solution that satisfies the exercise’s success criteria.
Example rule
# rules/kitchen-timer.yaml
id: rule.kitchen-timer
kind: timer
value: "Time's up! (5m)"Why it satisfies the criteria
- Valid YAML — matches the flat
id/kind/valueshape the referencebin/picoparser accepts. - Stable
id— namespaced underrule.and named after the concept, not the implementation. - Composer-actionable — a
timer-aware Composer could read the scalarvalueand emit a Pico that surfaces the message when the duration elapses. The reference Composer in this repo only handleskind: greeting, so this Rule intentionally targets a broader design conversation rather than direct composition here.
Automatable check
pico parse rules/kitchen-timer.yaml --out /tmp/parsed.json \
&& echo "OK: parsed rules/kitchen-timer.yaml"Expected output ends with OK: parsed rules/kitchen-timer.yaml and the command exits with status 0.
Variations
- Replace
timerwith a domain of your own (e.g.greeting,webhook,sensor) — keeping the flatid/kind/valueshape sopico parsestill accepts it. - Add a second Rule and compose both into a single Pico, matching the “two rules” variation in
labs/hello-pico/solution.qmd.