Skip to content

The agent that grows with you

feat(onboarding): first tasks are full prompts, livelier pills, and a repeat apply is steered forward

alt-glitch95eaa4a0179e
diff --git a/agent/onboarding_first_tasks.py b/agent/onboarding_first_tasks.py
index d2ebcbf85c5..214949b9389 100644
--- a/agent/onboarding_first_tasks.py
+++ b/agent/onboarding_first_tasks.py
@@ -25,13 +25,18 @@ OWN_ID = "own"
@dataclass(frozen=True)
class FirstTask:
"""``skills`` load first, before the work; an entry ``a|b`` means one of them, whichever fits.
- Plugin skills use the ``<plugin>:<skill>`` form skill_view resolves."""
+ Plugin skills use the ``<plugin>:<skill>`` form skill_view resolves. ``goal`` finishes the
+ sentence "Your job: ..."; ``<open>`` in a step is replaced with how this host shows a page."""
id: str
label: str
gate: Callable[[Facts, Mapping[str, Any]], bool]
skills: tuple[str, ...]
- skeleton: str
+ goal: str
+ steps: tuple[str, ...]
+ output: str
+ quality: str
+ done: str
def _always(facts: Facts, picks: Mapping[str, Any]) -> bool:
@@ -52,44 +57,191 @@ def _macos(facts: Facts, picks: Mapping[str, Any]) -> bool:
FIRST_TASKS: tuple[FirstTask, ...] = (
- FirstTask("hermes", "How Hermes works", lambda facts, picks: False, ("hermes-agent", "claude-design", "p5js"),
- "Make a designed HTML page from real facts about this install: the skill learning loop (and the skills "
- "used in this chat), automations (cron, webhooks), and what Hermes can do. Draw the loop as a small "
- "p5js animation. Save it under ~/hermes-first-task/ and <open>."),
- FirstTask("games", "Tune my games", _plugin("nvidia-app"), ("nvidia-app:nvidia-app",),
- "Check NVIDIA App is running. Read the installed games and their settings, optimise them, then show "
- "what changed."),
- FirstTask("broadcast", "Set up Broadcast", _plugin("nvidia-broadcast"), ("nvidia-broadcast:nvidia-broadcast",),
- "Check NVIDIA Broadcast is running. Set up camera and mic effects for a call, then show the before and "
- "after."),
- FirstTask("blender", "Make something in Blender", _plugin("blender"), ("blender:blender",),
- "Check Blender is running. Make one small scene from a short script, render it and show it."),
- FirstTask("brief", "Today's brief", _connected, ("claude-design",),
- "Write today's brief from the connected apps: what needs attention, what changed, what is next. "
- "Then offer a morning cron job that sends it."),
- FirstTask("week", "My week in one page", _connected, ("weekly-review-planning", "claude-design"),
- "Pull the past seven days from the connected apps and make one page: meetings, threads, work shipped, "
- "open loops, and a plan for next week."),
- FirstTask("mac", "Mac helpers", _macos, ("apple-reminders", "apple-notes", "hermes-agent"),
- "Make one real reminder and one real note with them, then set up a morning routine as a cron job."),
- FirstTask("notes", "Turn my notes into a wiki", _always, ("obsidian", "llm-wiki"),
- "Ask which folder holds their notes, then make an index page and three linked topic pages."),
- FirstTask("explain", "Explain a topic", _always,
- ("grounded-citations", "claude-design", "p5js", "blocked-page-recovery"),
- "Offer three topic guesses in one clarify. Research it with citations (for a technical topic also "
- "load arxiv), then make one designed page with one interactive p5js figure."),
- FirstTask("youtube", "A video as one page", _always, ("youtube-content", "claude-design", "p5js"),
- "Ask for a video link, get the transcript, then make one HTML page that lays the ideas out visually "
- "with timestamps and quotes."),
- FirstTask("watch", "Watch something daily", _always,
- ("competitor-news-monitor|product-price-monitor", "grounded-citations"),
- "Ask what to watch. Run the first check now, then set up a daily cron job that reports here."),
- FirstTask("site", "Design a page", _always, ("claude-design", "popular-web-designs", "design-md", "p5js"),
- "Offer three design directions in one clarify, then make one designed page with a p5js hero and offer "
- "a variation."),
- FirstTask("repo", "Map a repo", _always, ("codebase-inspection", "architecture-diagram", "github"),
- "Ask which repo and ask before reading it. Show its language breakdown, then make an architecture page."),
+ FirstTask(
+ "hermes", "Explain how Hermes works", lambda facts, picks: False, ("hermes-agent", "claude-design", "p5js"),
+ goal="build a designed page of at least three screens that shows how Hermes works, from the real docs "
+ "and real facts about this install",
+ steps=(
+ "Read the docs with web_extract, starting at https://hermes-agent.nousresearch.com/docs (the "
+ "hermes-agent skill links the pages): the agent loop, skills and the learning loop, cron and "
+ "automations, tools and toolsets, memory.",
+ "Read facts from this install with your own tools: how many skills are installed, which apps are "
+ "connected, which model is configured, and which skills this chat used.",
+ "Write a first version within a minute and <open>. Then refine the same file.",
+ "Screen 1, the agent loop: model, tools, results, back to the model, as an animated diagram.",
+ "Screen 2, the skill learning loop: Hermes notices a procedure, saves it as a skill and loads it next "
+ "time. Name the skills this chat used.",
+ "Screen 3, automations and what they can do: cron jobs, webhooks, connectors, messaging, with "
+ "examples that fit them.",
+ ),
+ output="One self-contained HTML file in ~/hermes-first-task/, at least three full-screen sections, each "
+ "with its own graphic (a p5js animation or an SVG diagram).",
+ quality="Designed with claude-design, not a plain document. Every name and number comes from the docs or "
+ "this install. Copy is short and plain.",
+ done="The page is open, every screen has its graphic and real facts, and you said where the file is."),
+ FirstTask(
+ "games", "Tune my games for this PC", _plugin("nvidia-app"), ("nvidia-app:nvidia-app",),
+ goal="optimise the games on this PC with NVIDIA App and show what changed",
+ steps=(
+ "Check NVIDIA App is running, as the skill says. If it is not, say how to start it and wait.",
+ "Read the installed games and their current settings.",
+ "Ask once before changing anything, naming the games you will change.",
+ "Apply the optimised settings, then read them back.",
+ ),
+ output="A before and after table in chat: one row per game, what changed and why.",
+ quality="Only settings NVIDIA App reports and really changed. Never guess a value.",
+ done="The changes are applied and read back, and the table shows each one."),
+ FirstTask(
+ "broadcast", "Make my mic and camera pro", _plugin("nvidia-broadcast"), ("nvidia-broadcast:nvidia-broadcast",),
+ goal="set up NVIDIA Broadcast so their mic and camera are ready for a call",
+ steps=(
+ "Check NVIDIA Broadcast is running, as the skill says. If it is not, say how to start it and wait.",
+ "Read the mic, speaker and camera devices and the effects this machine offers.",
+ "Ask in one clarify what the setup is for, with three options such as a meeting, a stream or a "
+ "noisy room.",
+ "Turn on the effects that fit, then read them back.",
+ ),
+ output="A short list in chat: each effect, its device, before and after.",
+ quality="Only effects Broadcast reports on this machine.",
+ done="The effects are on and they know how to turn each one off."),
+ FirstTask(
+ "blender", "Build a 3D scene in Blender", _plugin("blender"), ("blender:blender",),
+ goal="make one small 3D scene in Blender from a script, render it and show it",
+ steps=(
+ "Check Blender is running, as the skill says. If it is not, say how to start it and wait.",
+ "Offer three scene ideas that fit them in one clarify.",
+ "Write a short Python script, run it in Blender and render one still.",
+ "Show the render, then offer one variation.",
+ ),
+ output="The script and the PNG render in ~/hermes-first-task/; the render shown with desktop_preview.",
+ quality="A real Blender render, lit and framed. Never a placeholder.",
+ done="The render is shown and you said where the script and image are."),
+ FirstTask(
+ "brief", "Brief me on today", _connected, ("claude-design",),
+ goal="write today's brief from their connected apps",
+ steps=(
+ "Check the connected apps with manage_connections(action=\"status\").",
+ "Read today from them: mail, calendar, messages, tasks. Read only.",
+ "Show a first version early, then fill it in: what needs attention, what changed, what is next.",
+ "Offer a morning cron job that sends the brief. Schedule it only on yes.",
+ ),
+ output="One designed HTML page in ~/hermes-first-task/, shown with desktop_preview.",
+ quality="Every item comes from a connected app and says which one. Nothing invented.",
+ done="The brief is shown and the morning job is set up or declined."),
+ FirstTask(
+ "week", "Recap my week on one page", _connected, ("weekly-review-planning", "claude-design"),
+ goal="make one page that recaps their past seven days from the connected apps",
+ steps=(
+ "Check the connected apps with manage_connections(action=\"status\").",
+ "Read the past seven days from them. Read only.",
+ "Show a first version early, then fill it in: meetings, threads, work shipped, open loops.",
+ "End with a short plan for next week built from the open loops.",
+ ),
+ output="One designed HTML page in ~/hermes-first-task/, shown with desktop_preview.",
+ quality="Every item comes from a connected app and says which one. Nothing invented.",
+ done="The page is shown with all five parts filled from real data."),
+ FirstTask(
+ "mac", "Set up my Mac helpers", _macos, ("apple-reminders", "apple-notes", "hermes-agent"),
+ goal="set up their Mac helpers: one real reminder, one real note and a morning routine",
+ steps=(
+ "Ask in one clarify what the reminder and the note should be, with three concrete suggestions.",
+ "Make the reminder in Reminders and the note in Notes with the skills.",
+ "Propose a morning routine as a cron job: what it does and when. Schedule it only on yes.",
+ ),
+ output="The reminder and note in their apps and the cron job, each named in chat.",
+ quality="Real items they asked for. No test items.",
+ done="The reminder and note exist, and the morning job is set up or declined."),
+ FirstTask(
+ "notes", "Turn my notes into a wiki", _always, ("obsidian", "llm-wiki"),
+ goal="turn their notes into a small linked wiki",
+ steps=(
+ "Ask which folder holds their notes. Never search the disk for it.",
+ "Read the notes there and find the three main topics.",
+ "Write an index page and three linked topic pages, each citing the notes it came from.",
+ "Show the index page.",
+ ),
+ output="Four Markdown pages in ~/hermes-first-task/wiki/, unless they ask for their notes folder.",
+ quality="Only what their notes say. Every link resolves.",
+ done="The four pages exist, the links work and the index is shown."),
+ FirstTask(
+ "explain", "Explain a topic I care about", _always,
+ ("grounded-citations", "claude-design", "p5js", "blocked-page-recovery"),
+ goal="explain a topic they care about on one designed page with an interactive figure",
+ steps=(
+ "If the label they clicked names a topic, use it. Otherwise offer three topic guesses from what you "
+ "learned about them in one clarify.",
+ "Research it with citations. For a technical topic, also load arxiv.",
+ "Show a first version early, then refine the same file.",
+ "Add one interactive p5js figure that shows the core idea.",
+ ),
+ output="One self-contained HTML file in ~/hermes-first-task/, shown with desktop_preview, sources at "
+ "the end.",
+ quality="Designed with claude-design. Every claim is cited. The figure responds to input.",
+ done="The page is shown with the figure working and every source listed."),
+ FirstTask(
+ "youtube", "Turn a video into a page", _always, ("youtube-content", "claude-design", "p5js"),
+ goal="turn one video into a page that lays its ideas out visually",
+ steps=(
+ "Ask for the video link.",
+ "Get the transcript with the skill.",
+ "Pull out the main ideas, each with a timestamp and a quote.",
+ "Show a first version early, then lay the ideas out visually, with one figure where it helps.",
+ ),
+ output="One self-contained HTML file in ~/hermes-first-task/, shown with desktop_preview; each "
+ "timestamp links to that moment in the video.",
+ quality="Designed with claude-design. Quotes are exact words from the transcript.",
+ done="The page is shown and every idea has its timestamp and quote."),
+ FirstTask(
+ "watch", "Watch something for me daily", _always,
+ ("competitor-news-monitor|product-price-monitor", "grounded-citations"),
+ goal="watch something for them every day and report here",
+ steps=(
+ "Ask what to watch in one clarify, with three concrete options from what you know about them.",
+ "Run the first check now and report it with sources.",
+ "Propose a daily cron job: when it runs and what it reports. Schedule it only on yes.",
+ ),
+ output="The first report in chat, and the daily cron job.",
+ quality="Every finding has a source link. Nothing invented.",
+ done="The first report is shown and the daily job is set up or declined."),
+ FirstTask(
+ "site", "Design a page for me", _always, ("claude-design", "popular-web-designs", "design-md", "p5js"),
+ goal="design one web page for them",
+ steps=(
+ "If you do not know what the page is for, ask in one line.",
+ "Offer three design directions in one clarify.",
+ "Show a first version early with a p5js hero, then refine the same file.",
+ "Offer one variation.",
+ ),
+ output="One self-contained HTML file in ~/hermes-first-task/, shown with desktop_preview.",
+ quality="Designed with the skills. Real content they gave you, never filler text.",
+ done="The page is shown and a variation is offered."),
+ FirstTask(
+ "repo", "Map one of my repos", _always, ("codebase-inspection", "architecture-diagram", "github"),
+ goal="map one of their code repositories on an architecture page",
+ steps=(
+ "Ask which repo, as a path or a URL, and ask before reading it.",
+ "Show its language breakdown.",
+ "Read its entry points and main modules.",
+ "Draw the architecture page: the modules, how they connect, where to start reading.",
+ ),
+ output="One self-contained HTML file in ~/hermes-first-task/, shown with desktop_preview.",
+ quality="Only modules that are really in the repo, named by their paths.",
+ done="The page is shown and every box on it maps to a real path."),
)
+# A task the user names in words: the same prompt shape, without a catalog row.
+OWN_TASK = FirstTask(
+ OWN_ID, "", lambda facts, picks: False, ("hermes-agent",),
+ goal="build the task they named in their own words",
+ steps=(
+ "Also load the skills that fit what they asked.",
+ "If you know what it is, say the first slice in one line and start. If not, ask one short question "
+ "(a clarify with three concrete options is fine).",
+ "Cut a big ask to a first slice and say so in one line.",
+ "Show a first version early, then refine it.",
+ ),
+ output="Whatever fits the task; a page is one self-contained HTML file shown with desktop_preview.",
+ quality="Real data only, designed with the skills when it is a page.",
+ done="The first slice is shown and you said where its files are.")
TASK_BY_ID = {task.id: task for task in FIRST_TASKS}
EVERY_TASK_SKILL = "humanizer"
@@ -142,8 +294,7 @@ def pick_error(options: Any, facts: Facts, picks: Mapping[str, Any]) -> str | No
def task_skills(option: str, has_skill: Callable[[str], bool]) -> list[str]:
"""The skills a task loads first, humanizer last. A bundled skill missing here is dropped; a plugin
skill (``plugin:skill``) is kept, since the plugin being installed is the row's gate."""
- task = TASK_BY_ID.get(option)
- names = [*(task.skills if task else ("hermes-agent",)), EVERY_TASK_SKILL]
+ names = [*TASK_BY_ID.get(option, OWN_TASK).skills, EVERY_TASK_SKILL]
kept = []
for entry in names:
found = [name for name in entry.split("|") if ":" in name or has_skill(name)]
diff --git a/agent/onboarding_flow.py b/agent/onboarding_flow.py
index 00277d9e924..2be3c1ca50a 100644
--- a/agent/onboarding_flow.py
+++ b/agent/onboarding_flow.py
@@ -233,8 +233,7 @@ def _build_picks_error(record: dict, event: Shown, facts: Facts) -> str | None:
def _shown(record: dict, event: Shown, facts: Facts, now: float) -> Step:
if not BEAT_BY_ID[event.beat].when(facts, record["picks"]):
record["beats"][event.beat] = SKIPPED
- return Step(record, {"beat": event.beat, "skipped": True, "next": _next_field(record)},
- f"after_{event.beat}")
+ return Step(record, {"beat": event.beat, "skipped": True, "next": _next_field(record)}, "moved_on")
if event.beat == "build" and (error := _build_picks_error(record, event, facts)):
return Step(record, {"beat": "build", "error": error})
# A later card on screen means the user moved on from an earlier card left open.
@@ -352,13 +351,16 @@ def _applied_beats(event: Applied) -> list[tuple[str, dict]]:
def _applied(record: dict, event: Applied, facts: Facts, now: float) -> Step:
"""The reminder names the last beat this result newly settled, so the model moves on instead of
- recording it again with setup_beat. ``after_<beat>``, not ``Beat.after``: the tour already started."""
- settled = ""
+ recording it again with setup_beat. ``after_<beat>``, not ``Beat.after``: the tour already started.
+ A repeat apply of a theme or layout already settled gets ``already_<beat>``, so it stops re-applying."""
+ settled, repeated = "", ""
for beat, patch in _applied_beats(event):
if record["beats"][beat] != DONE:
settled = beat
+ elif beat in APPLIED_BY:
+ repeated = beat
_settle(record, beat, patch)
- return Step(record, {}, f"after_{settled}" if settled else "")
+ return Step(record, {}, f"after_{settled}" if settled else f"already_{repeated}" if repeated else "")
_HANDLERS: dict[type, Callable[[dict, Any, Facts, float], Step]] = {
diff --git a/agent/onboarding_text.py b/agent/onboarding_text.py
index 8cfd6485fc4..8d26382a70c 100644
--- a/agent/onboarding_text.py
+++ b/agent/onboarding_text.py
@@ -11,7 +11,9 @@ from __future__ import annotations
from collections.abc import Callable, Mapping
from typing import Any
-from agent.onboarding_first_tasks import MAX_LABEL, MAX_PICKS, TASK_BY_ID, eligible_tasks, task_skills
+from agent.onboarding_first_tasks import (
+ FIXED_ID, MAX_LABEL, MAX_PICKS, OWN_TASK, TASK_BY_ID, eligible_tasks, task_skills,
+)
from agent.onboarding_flow import Facts, next_beat
CHAT_TITLE = "Getting started"
@@ -117,13 +119,17 @@ _CLOSE = ('When the first thing is built and shown, ask with clarify: "How does
'"Looks right", "Change something" and "Take it further", exactly. Put the next-step idea in your text. '
'After they answer, call setup_beat(beat="done").')
-_BUILD_RULES = (
- "Rules: real data only (connected apps, or tools signed in on this computer); never mock or invented data, "
- "never route around a connector. Visible work within a minute, a first result within five. First reply: one "
- "line and a tool call. At most two checks and one question before work. Connect or install once each, with "
- "exact ids, no searching. Never search the whole disk. Save every file in ~/hermes-first-task/ and say where "
- "it is; no test files. A page is one self-contained HTML file opened with desktop_preview, unless the "
- "task says otherwise.")
+_HOW_TO_WORK = (
+ "Real data only: their connected apps, or tools signed in on this computer. Never mock or invent data, and "
+ "never route around a connector.",
+ "Show visible progress within a minute and a first result within five.",
+ "Your first reply is one line, then a tool call.",
+ "At most two checks and one question before you start working.",
+ "Connect or install anything once, with exact ids and no searching, then use it.",
+ "Never search the whole disk.",
+ "Save every file in ~/hermes-first-task/ and say where it is. No test files.",
+ "A page is one self-contained HTML file shown with desktop_preview, unless the task says otherwise.",
+)
_CONNECTORS = (
'Reading a connected app: check it with manage_connections(action="status"). Find its tools with tool_search '
@@ -133,10 +139,6 @@ _CONNECTORS = (
"write may run as the connector's bot.")
_CONNECTOR_TASKS = ("brief", "week")
-_OWN_TASK = ("They named their own task; also load the skills that fit what they asked. If you know what it is, "
- "start now: one line on the first slice, then build it. If not, ask one short question (clarify with "
- "three concrete options is fine), then build. Cut a big ask to a first slice and say so in one line.")
-
_OS_LINES = {
"macos": ("This Mac: check with `which brew` and `ls -d /Applications/<App>.app`; install with "
"`brew install --cask <app>`; on Apple silicon check `lipo -archs` for a binary's architecture."),
@@ -149,6 +151,7 @@ _OS_LINES = {
_ARM_WINDOWS = ("On Windows on Arm, read arm64 vs x64 from winget's install output, not the manifest, and say when "
"an app is x64 only.")
_SPARK_LINE = "This machine is built for local models; say so once when it fits what they asked."
+_REMOTE_LINE = "Hermes runs on another computer than the user's: say which machine anything is installed on."
_OPEN = {"macos": "`open <file>`", "windows": '`start "" <file>`'}
@@ -160,23 +163,33 @@ def _open_line(facts: Facts) -> str:
return f"open it in the default browser with {_OPEN.get(facts.os, '`xdg-open <file>`')}"
-def _task_lines(option: str, facts: Facts, has_skill: Callable[[str], bool]) -> list[str]:
- task = TASK_BY_ID.get(option)
- lines = [f"Load these skills with skill_view first: {', '.join(task_skills(option, has_skill))}.",
- task.skeleton.replace("<open>", _open_line(facts)) if task else _OWN_TASK]
- return [*lines, _CONNECTORS] if option in _CONNECTOR_TASKS else lines
+def _task_prompt(option: str, label: str, facts: Facts, has_skill: Callable[[str], bool]) -> list[str]:
+ task = TASK_BY_ID.get(option, OWN_TASK)
+ picked = f'They picked "{label or task.label}". ' if (label or task.label) else ""
+ steps = [f"{n}. {step.replace('<open>', _open_line(facts))}" for n, step in enumerate(task.steps, 1)]
+ return [f"{picked}Your job: {task.goal}.",
+ f"Load these skills with skill_view first: {', '.join(task_skills(option, has_skill))}.",
+ "Steps:", *steps, f"Output: {task.output}", f"Quality bar: {task.quality}", f"Done when: {task.done}"]
-def build_guidance(option: str, facts: Facts, has_skill: Callable[[str], bool] = lambda name: True) -> str:
- """The reminder once a first task is picked; ``has_skill`` says whether a bundled skill is on this install."""
- lines = [*_task_lines(option, facts, has_skill), _BUILD_RULES, _OS_LINES.get(facts.os, _OS_LINES["linux"])]
+def _bullets(title: str, lines) -> str:
+ return "\n".join([f"{title}:", *(f"- {line}" for line in lines)])
+
+
+def build_guidance(option: str, facts: Facts, has_skill: Callable[[str], bool] = lambda name: True,
+ label: str = "") -> str:
+ """The prompt once a first task is picked; ``label`` is the card text they clicked, ``has_skill``
+ says whether a bundled skill is on this install."""
+ work = [*_HOW_TO_WORK, *((_CONNECTORS,) if option in _CONNECTOR_TASKS else ())]
+ host = [_OS_LINES.get(facts.os, _OS_LINES["linux"])]
if facts.os == "windows" and facts.arch == "arm64":
- lines.append(_ARM_WINDOWS)
+ host.append(_ARM_WINDOWS)
if facts.nvidia_platform in ("rtx_spark", "dgx_spark"):
- lines.append(_SPARK_LINE)
+ host.append(_SPARK_LINE)
if facts.facts_source == "remote":
- lines.append("Hermes runs on another computer than the user's: say which machine anything is installed on.")
- return "\n".join([*lines, _CLOSE])
+ host.append(_REMOTE_LINE)
+ return "\n\n".join(["\n".join(_task_prompt(option, label, facts, has_skill)), _bullets("How to work", work),
+ _bullets("This computer", host), f"When it is shown:\n{_CLOSE}"])
def _names(values) -> str:
@@ -186,11 +199,12 @@ def _names(values) -> str:
def _build_menu(record: Mapping[str, Any]) -> str:
"""The rows the model picks the build card from."""
rows = eligible_tasks(Facts.from_stored(record["facts"]), record["picks"])
- listed = "\n".join(f"- {task.id} ({task.label}): {task.skeleton}" for task in rows)
+ listed = "\n".join(f"- {task.id} ({task.label}): {task.goal}." for task in rows)
return (f"For the build card, pick up to {MAX_PICKS} of these that fit what you learned about them, earlier rows "
f'first when they fit, and call setup_beat(beat="build", options=[{{"id": ..., "label": ...}}]). Reword '
- f"each label to fit them, {MAX_LABEL} characters max; ids only from this list. How Hermes works is added "
- f"last by itself.\n{listed}")
+ f"each label to fit them and keep its energy: a short, specific action they would want to click, "
+ f"{MAX_LABEL} characters max. Ids only from this list. \"{TASK_BY_ID[FIXED_ID].label}\" is added last "
+ f"by itself.\n{listed}")
def _next(record: Mapping[str, Any]) -> str:
@@ -204,7 +218,20 @@ def _next(record: Mapping[str, Any]) -> str:
def _after_layout(record, facts) -> str:
label = {"sidebar-left": "Basic", "terminal-deck": "Elite"}.get(record["picks"]["layout"], record["picks"]["layout"])
offer = f" {_LOOK_AROUND}" if record["look_around"] == "not_offered" else ""
- return f"Layout {label} is on. {_next(record)}{offer}"
+ return f"Layout {label} is on, already applied. Do not call set_theme for it again. {_next(record)}{offer}"
+
+
+def _after_connectors(record, facts) -> str:
+ picks = record["picks"]
+ again = " These are already connected; do not connect them again." if picks["connected"] else ""
+ return (f"Connected: {_names(picks['connected'])}; newly connected: {_names(picks['newly_connected'])}."
+ f"{again} {_next(record)}")
+
+
+def _after_plugins(record, facts) -> str:
+ installed = record["picks"]["installed"]
+ again = " They are already installed; do not install them again." if installed else ""
+ return f"Installed plugins: {_names(installed)}.{again} {_next(record)}"
def _tour(preset: str):
@@ -219,12 +246,12 @@ def _waiting_beat(record) -> str | None:
_REMINDERS = {
"after_name": lambda r, f: f"They go by {r['picks']['name']}. Greet them by name in a few words. {_next(r)}",
- "after_theme": lambda r, f: f"Accent {r['picks']['accent'] or 'Nous blue'} is on. React in three words or fewer. {_next(r)}",
+ "after_theme": lambda r, f: (f"Accent {r['picks']['accent'] or 'Nous blue'} is on, already applied. Do not call "
+ f"set_theme for it again. React in three words or fewer. {_next(r)}"),
"after_layout": _after_layout,
- "after_connectors": lambda r, f: (f"Connected: {_names(r['picks']['connected'])}; newly connected: "
- f"{_names(r['picks']['newly_connected'])}. {_next(r)}"),
- "after_plugins": lambda r, f: f"Installed plugins: {_names(r['picks']['installed'])}. {_next(r)}",
- "after_tour": lambda r, f: _next(r),
+ "after_connectors": _after_connectors,
+ "after_plugins": _after_plugins,
+ "after_tour": lambda r, f: f"The tour is already running; do not start it again. {_next(r)}",
"after_build": lambda r, f: _next(r),
"tour_quick": _tour("quick"),
"tour_full": _tour("full"),
@@ -237,6 +264,12 @@ _REMINDERS = {
}
+def _already(record, beat: str) -> str:
+ """A repeat apply of a settled beat: steer the model forward instead of drawing another receipt."""
+ return (f"The {beat} was already set by the card or an earlier call. Do not apply it again unless they ask "
+ f"for a change. {_next(record)}")
+
+
def _said(record, facts, beat: str) -> str:
return (f"They typed this while the {beat} card waited; the card is closed. If their words answer it, apply it "
f"yourself ({_TYPED_ANSWER[beat]}) and move on. Otherwise answer them properly and briefly, then bring "
@@ -257,7 +290,11 @@ def reminder(key: str, record: Mapping[str, Any], facts: Facts, beat: str | None
if key in ("said", "timed_out"):
return (_said if key == "said" else _timed_out)(record, facts, beat or _waiting_beat(record) or "build")
if key.startswith("build_"):
- return build_guidance(key.removeprefix("build_"), facts, has_skill)
+ option = key.removeprefix("build_")
+ label = next((o["label"] for o in record["picks"].get("build_options") or () if o["id"] == option), "")
+ return build_guidance(option, facts, has_skill, label)
+ if key.startswith("already_"):
+ return _already(record, key.removeprefix("already_"))
return _REMINDERS[key](record, facts)
diff --git a/tests/agent/test_onboarding_first_tasks.py b/tests/agent/test_onboarding_first_tasks.py
index 012eeacf271..064186fdc31 100644
--- a/tests/agent/test_onboarding_first_tasks.py
+++ b/tests/agent/test_onboarding_first_tasks.py
@@ -38,13 +38,43 @@ def test_brief_and_week_need_an_app_connected_this_run_and_mac_helpers_need_maco
def test_a_task_reminder_opens_with_its_skills_and_drops_a_bundled_skill_this_install_lacks():
text = reminder("build_explain", new_record(MAC), MAC, has_skill=lambda name: name != "p5js")
- assert text.startswith("Load these skills with skill_view first: grounded-citations, claude-design, "
- "blocked-page-recovery, humanizer.\n")
+ goal, skills = text.split("\n")[:2]
+ assert goal == ('They picked "Explain a topic I care about". Your job: explain a topic they care about on one '
+ "designed page with an interactive figure.")
+ assert skills == ("Load these skills with skill_view first: grounded-citations, claude-design, "
+ "blocked-page-recovery, humanizer.")
# Plugin skills come with the plugin, which is the row's gate; a typed task starts from hermes-agent.
- assert reminder("build_games", new_record(PC), PC, has_skill=lambda name: False).startswith(
+ assert reminder("build_games", new_record(PC), PC, has_skill=lambda name: False).split("\n")[1] == (
"Load these skills with skill_view first: nvidia-app:nvidia-app.")
- assert reminder("build_own", new_record(MAC), MAC).startswith(
- "Load these skills with skill_view first: hermes-agent, humanizer.")
+ assert reminder("build_own", new_record(MAC), MAC).split("\n")[:2] == [
+ "Your job: build the task they named in their own words.",
+ "Load these skills with skill_view first: hermes-agent, humanizer."]
+
+
+def test_a_task_prompt_names_the_label_they_clicked_and_reads_in_sections():
+ record = new_record(MAC)
+ record["picks"]["build_options"] = [{"id": "repo", "label": "Map the hermes repo"}]
+ text = reminder("build_repo", record, MAC)
+
+ assert text.startswith('They picked "Map the hermes repo". Your job: ')
+ for section in ("\nSteps:\n1. ", "\nOutput: ", "\nQuality bar: ", "\nDone when: ", "\n\nHow to work:\n- ",
+ "\n\nThis computer:\n- This Mac", "\n\nWhen it is shown:\n"):
+ assert section in text, section
+ assert "\u2014" not in text
+
+
+def test_every_catalog_row_is_a_full_prompt():
+ for task in FIRST_TASKS:
+ assert task.goal and task.output and task.quality and task.done and 2 <= len(task.steps) <= 6, task.id
+
+
+def test_how_hermes_works_reads_the_docs_and_builds_three_screens():
+ text = reminder("build_hermes", new_record(MAC), MAC)
+
+ assert text.split("\n")[1] == ("Load these skills with skill_view first: hermes-agent, claude-design, p5js, "
+ "humanizer.")
+ assert "https://hermes-agent.nousresearch.com/docs" in text and "web_extract" in text
+ assert all(f"Screen {n}" in text for n in (1, 2, 3)) and "~/hermes-first-task/" in text
@pytest.mark.parametrize(("facts", "opens"), [
@@ -59,4 +89,4 @@ def test_the_app_tasks_carry_the_connectors_playbook_and_the_menu_lists_only_eli
assert "connectors__<slug>__<ACTION>" in reminder("build_week", new_record(PC), PC)
assert "connectors__" not in reminder("build_site", new_record(PC), PC)
menu = reminder("tour_skip", new_record(MAC), MAC)
- assert "- mac (Mac helpers)" in menu and "- brief" not in menu and "- hermes" not in menu
+ assert "- mac (Set up my Mac helpers)" in menu and "keep its energy" in menu and "- brief" not in menu and "- hermes" not in menu
diff --git a/tests/agent/test_onboarding_flow.py b/tests/agent/test_onboarding_flow.py
index 1ea89858368..03da26edc51 100644
--- a/tests/agent/test_onboarding_flow.py
+++ b/tests/agent/test_onboarding_flow.py
@@ -116,8 +116,27 @@ def test_set_theme_settling_the_layout_beat_tells_the_model_the_next_beat():
settled, again = steps[-2], steps[-1]
assert settled.reminder == "after_layout"
text = reminder(settled.reminder, settled.record, facts)
- assert text.startswith("Layout Basic is on.") and 'setup_beat(beat="next") shows the connectors card' in text
- assert again.reminder == ""
+ assert text.startswith("Layout Basic is on, already applied.") and "Do not call set_theme" in text
+ assert 'setup_beat(beat="next") shows the connectors card' in text
+ # A second set_theme on the settled layout steers forward instead of returning nothing.
+ assert again.reminder == "already_layout" and again.record["picks"]["layout"] == "terminal-deck"
+
+
+def test_live_run_a_set_theme_after_the_theme_card_is_told_it_is_already_set():
+ """Sid's run: the theme card applied green, then the model called set_theme(accent=green) again and a
+ second receipt drew. The card's reminder says it is applied; a repeat call names the next step."""
+ facts = MACHINES["mac"]
+ steps = run(facts, Shown("name"), Answered("name", {"name": "Sid"}), Shown("theme"),
+ Answered("theme", {"accent": "green"}),
+ Applied("set_theme", {"accent": "green"}, {"success": True, "applied": {"accent": "green"}}))
+
+ answered, repeat = steps[-2], steps[-1]
+ card_text = reminder(answered.reminder, answered.record, facts)
+ assert "already applied" in card_text and "Do not call set_theme" in card_text
+ assert repeat.reminder == "already_theme"
+ text = reminder(repeat.reminder, repeat.record, facts)
+ assert "The theme was already set" in text and "Do not apply it again" in text
+ assert 'setup_beat(beat="next") shows the layout card' in text
def test_run_hrs0_off_script_questions_keep_one_card_and_continue_settles_it():
@@ -246,7 +265,7 @@ def test_results_that_pick_nothing_settle_nothing(tool, args, result):
@pytest.mark.parametrize("options", [
None, [], [{"id": "games", "label": "Games"}], [{"id": "scan", "label": "Scan"}],
- [{"id": "hermes", "label": "How Hermes works"}], [{"id": x, "label": x} for x in ("notes", "site", "repo", "watch", "explain")],
+ [{"id": "hermes", "label": "Explain how Hermes works"}], [{"id": x, "label": x} for x in ("notes", "site", "repo", "watch", "explain")],
[{"id": "notes", "label": "A"}, {"id": "notes", "label": "B"}], [{"id": "notes", "label": "x" * 33}],
[{"id": "notes", "label": " "}], ["notes"],
])
@@ -263,7 +282,7 @@ def test_valid_picks_are_the_card_with_how_hermes_works_last_and_any_card_id_ans
shown = run(facts, Shown("build", "call_b", picks))[-1]
card = flow.BEAT_BY_ID["build"].card(facts, shown.record["picks"])
- assert card == {"options": [*picks, {"id": "hermes", "label": "How Hermes works"}]}
+ assert card == {"options": [*picks, {"id": "hermes", "label": "Explain how Hermes works"}]}
# Brought back without picks, the same card returns.
assert apply(shown.record, Shown("build", "call_c"), facts).result == {}
for value in ("repo", "hermes", "own"):
diff --git a/tests/tools/test_setup_beat_tool.py b/tests/tools/test_setup_beat_tool.py
index ef63e32b9f8..3cb55d180cb 100644
--- a/tests/tools/test_setup_beat_tool.py
+++ b/tests/tools/test_setup_beat_tool.py
@@ -115,7 +115,7 @@ def test_done_ends_the_run_only_after_the_build_card(db, desktop):
assert "notes" in no_picks["error"] and desktop.shown == []
desktop.replies.append({"answer": {"build": "notes"}})
build = call(db, desktop, beat="build", options=[{"id": "notes", "label": "Notes to wiki"}])
- assert desktop.shown[-1]["card"]["options"][-1] == {"id": "hermes", "label": "How Hermes works"}
+ assert desktop.shown[-1]["card"]["options"][-1] == {"id": "hermes", "label": "Explain how Hermes works"}
done = call(db, desktop, beat="done")
assert "error" in refused