Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

docs: clarify html follow-up handoff mode

Trevin Chow51b6762f4b2c
diff --git a/skills/last30days/references/save-html-brief.md b/skills/last30days/references/save-html-brief.md
index 94e5c0f7..1253f201 100644
--- a/skills/last30days/references/save-html-brief.md
+++ b/skills/last30days/references/save-html-brief.md
@@ -127,14 +127,16 @@ Same flow when the topic is `X vs Y` (or `X vs Y vs Z`). The engine routes throu
## Follow-up turn
-If the user runs `/last30days OpenClaw` normally, sees the synthesis in chat, and THEN says "save that as HTML" or "give me a shareable version" in a follow-up turn, do the same save flow on the synthesis you wrote in the previous turn. Do not re-research; the synthesis is already in the conversation history. Just write it to the temp file and call the engine with `--emit=html --synthesis-file`, then use the normal-report-plus-HTML artifact block.
+If the user runs `/last30days OpenClaw` normally, sees the synthesis in chat, and THEN explicitly refers back to that visible synthesis ("save that as HTML", "make this shareable", "turn the above into HTML"), do the same save flow on the synthesis you wrote in the previous turn. Do not re-research; the synthesis is already in the conversation history. Just write it to the temp file and call the engine with `--emit=html --synthesis-file`, then use the normal-report-plus-HTML artifact block.
+
+If the follow-up instead asks for a new HTML deliverable ("give it to me in HTML", `--emit=html`, `--html`) rather than referring back to an already-visible report, treat it as HTML-as-deliverable mode.
## What NOT to do
- Do NOT save HTML if the user didn't ask. The sparse mode (no synthesis) produces a thin file; not useful as a shareable.
- Do NOT add content to the temp file beyond your synthesis prose. The badge / footer / colophon come from the engine.
- Do NOT change the file path convention. `${LAST30DAYS_MEMORY_DIR}/${SLUG}-brief.html` is the canonical location.
-- Do NOT silently overwrite an existing file. The `--emit=html` output is written via a shell redirect (`>| "$HTML_PATH"`), which OVERWRITES the collision-guarded path — use `>|` not `>` because `set -o noclobber` refuses plain `>` when the file already exists. The collision guard in step 2 handles same-topic re-runs: if `{slug}-brief.html` already exists it date-suffixes to `{slug}-brief-YYYY-MM-DD.html`. Always print whichever path the redirect actually used.
+- Do NOT silently overwrite an existing file. The `--emit=html` output is written via a shell redirect (`>| "$HTML_PATH"`), which OVERWRITES the collision-guarded path — use `>|` not `>` because `set -o noclobber` refuses plain `>` when the file already exists. The collision guard in step 2 handles same-topic re-runs: if `{slug}-brief.html` already exists it date-suffixes to `{slug}-brief-YYYY-MM-DD.html`. Always report whichever path the redirect actually used in the chat handoff.
- Do NOT include the data quality warning text in the temp file or in your final chat line. Warnings are an engine-stderr concern, not an artifact concern.
- Do NOT publish, upload, or send the HTML to a third-party service. This reference only saves and opens local files.
diff --git a/tests/test_html_save_contract.py b/tests/test_html_save_contract.py
index f5b8b4e6..bde9808a 100644
--- a/tests/test_html_save_contract.py
+++ b/tests/test_html_save_contract.py
@@ -31,6 +31,7 @@ def test_html_deliverable_is_artifact_first_not_full_markdown_repeat():
assert "Do not paste it to chat first" in text
assert "the chat handoff is the single user-visible" in text
assert "printf '📎 Shareable brief saved to %s\\n'" not in text
+ assert 'echo "📎 Shareable brief saved to $HTML_PATH"' not in text
assert "do **not** paste the full Markdown report back into chat" in text
assert "The user asked for an HTML deliverable" in text
@@ -48,3 +49,10 @@ def test_html_save_flow_does_not_publish_or_upload():
text = SAVE_HTML.read_text(encoding="utf-8")
assert "Do not offer public publishing or upload in this flow" in text
assert "Do NOT publish, upload, or send the HTML to a third-party service" in text
+
+
+def test_follow_up_turn_preserves_html_deliverable_mode():
+ text = SAVE_HTML.read_text(encoding="utf-8")
+ assert "explicitly refers back to that visible synthesis" in text
+ assert "treat it as HTML-as-deliverable mode" in text
+ assert "Always report whichever path the redirect actually used in the chat handoff" in text