Reference orient triage skills
Triggers¶
| Phrase | Tool | Behavior |
|---|---|---|
/triage, "triage", "quick scan", "where am I" |
tool_triage |
Pulls unsorted Inbox + open Tasks across all 5 brand DBs. Sub-Sonnet sorts items into automate / schedule / reformat / drop. Returns categorized list. NO execution. ~10-20s. |
/orient, "orient", "orient me", "plan my day", "reorient" |
tool_orient_propose |
Pulls Inbox + Tasks + Goals + Areas + today's calendar (timeMin/timeMax bounded) + wellness. Sub-Sonnet builds a CONCRETE plan: worker briefings for automate, proposed_start ISO datetimes for schedule, exact field changes for reformat, archive list for drop. Saves plan JSON to forge/data/orient-plans/latest.json. Returns human-readable plan with plan_id and "Reply 'go' to execute". ~30-60s. |
| "go", "execute", "do it", "run the plan" (after orient_propose) | tool_orient_execute |
Reads latest.json. Spawns workers for automate (via tool_spawn_worker), creates calendar events for schedule (via tool_create_calendar_event), updates task fields for reformat (via NotionAPI.page_update), archives drop items (via NotionAPI.page_archive). |
| "skip 2 in schedule", "skip automate 1 and 3" | tool_orient_execute with skip_indices={"automate":[1,3], "schedule":[2]} |
1-based indices per bucket. |
Plan storage¶
Single-slot file at forge/data/orient-plans/latest.json. Each /orient call OVERWRITES the prior plan. Future improvement: multi-slot keyed by plan_id if multiple plans need to coexist.
Architecture¶
forge_orient.py is registered as 3 tools in forge_telegram_inbox_brain.py:
- tool_triage()
- tool_orient_propose()
- tool_orient_execute(skip_indices=None)
All three are coordinator-persona only (capture stays narrow). The tools internally call a sub-Sonnet via claude -p (separate from the brain's main Sonnet call). Sub-Sonnet output goes through forge_text_sanitize.strip_em_dashes automatically.
The brain orchestrates with two iterations: iter 0 calls the tool with done:false, iter 1 sees the result and composes the reply. System prompt instructs the brain to relay tool output verbatim for /triage and /orient because plan_id matters for the follow-up "go".
CLI for ad-hoc testing¶
python3 /home/justinwieb/forge/scripts/forge_orient.py triage
python3 /home/justinwieb/forge/scripts/forge_orient.py propose
python3 /home/justinwieb/forge/scripts/forge_orient.py execute # uses saved plan
Failure modes¶
- Sub-Sonnet returns non-JSON: tool returns "Orient/Triage failed: Sonnet didn't return parseable JSON" plus first 400 chars of raw output for debugging.
- No plan saved when "go" fires: returns "No orient plan saved. Run /orient first."
- Worker spawn / calendar / Notion call fails on a single item: per-item error captured into the result line, other items continue. Atomic-by-item, not all-or-nothing.
[Claude Code, bot-refiner-v2, 2026-04-29]