Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(ai): replace demo system skills with Catch Me Up and What I Did Yesterday (#5545)

Eric Hayes00b29fbc99d9
diff --git a/crates/skills/src/domain/service/test.rs b/crates/skills/src/domain/service/test.rs
index a37ab84d28..a2604aae8f 100644
--- a/crates/skills/src/domain/service/test.rs
+++ b/crates/skills/src/domain/service/test.rs
@@ -136,15 +136,15 @@ async fn search_includes_matching_system_skills() {
let service = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused());
let results = service
- .search_skills(&user(), "skill authoring", SkillMatchType::Partial)
+ .search_skills(&user(), "catch me up", SkillMatchType::Partial)
.await
.unwrap();
assert_eq!(
results,
vec![SkillSummary {
- document_id: system_skills::skill_authoring::SKILL.id(),
- name: "Skill Authoring Guide".to_string(),
+ document_id: system_skills::catch_me_up::SKILL.id(),
+ name: "Catch Me Up".to_string(),
updated_at: None,
}]
);
@@ -152,13 +152,13 @@ async fn search_includes_matching_system_skills() {
#[tokio::test]
async fn search_excludes_non_matching_system_skills() {
- // "author" alone only prefix-matches when partial; exact must not match.
+ // "yester" alone only prefix-matches when partial; exact must not match.
let partial = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused())
- .search_skills(&user(), "author", SkillMatchType::Partial)
+ .search_skills(&user(), "yester", SkillMatchType::Partial)
.await
.unwrap();
let exact = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused())
- .search_skills(&user(), "author", SkillMatchType::Exact)
+ .search_skills(&user(), "yester", SkillMatchType::Exact)
.await
.unwrap();
@@ -170,9 +170,9 @@ async fn search_excludes_non_matching_system_skills() {
async fn system_skill_matching_requires_adjacent_tokens() {
let service = SkillServiceImpl::new(FakeSearcher::returning(vec![]), FakeLister::unused());
- // "skill guide" skips the middle token, so the phrase must not match.
+ // "catch up" skips the middle token, so the phrase must not match.
let results = service
- .search_skills(&user(), "skill guide", SkillMatchType::Partial)
+ .search_skills(&user(), "catch up", SkillMatchType::Partial)
.await
.unwrap();
diff --git a/crates/system_skills/src/catch_me_up.rs b/crates/system_skills/src/catch_me_up.rs
new file mode 100644
index 0000000000..ff42a44e73
--- /dev/null
+++ b/crates/system_skills/src/catch_me_up.rs
@@ -0,0 +1,46 @@
+//! System skill for catching the user up on messages and activity they missed.
+
+use prompt::StaticPrompt;
+
+use crate::SystemSkill;
+
+static TITLE: &str = "Catch Me Up";
+
+static INSTRUCTIONS: &str = r##"Follow this skill when the user asks to catch up on what they missed — unread messages, new activity, or what happened while they were away.
+
+## Gather what they missed
+
+Run these lookups, in parallel where possible:
+
+1. `ListNotifications` with `seen: false` for unseen notifications, and once more with no filters for recent context. Notifications are the primary "what needs my attention" signal.
+2. `ListEntities` sorted by `recently_updated` for workspace activity (documents, channels, emails, calls) since the user was last active. If the user gives a window ("since Friday", "this morning"), apply it with `df`/`ef` updatedAt bounds; otherwise default to the last 24 hours.
+3. `ListEntities` with `emailPreset: "signal"` for important unread email threads.
+
+For each channel or thread that surfaced, read just enough to summarize accurately: `ReadChannelMessages` / `ReadChannelThread` for channels, `ReadThread` for emails. Do not read items the user has clearly already handled.
+
+## Report
+
+Present a prioritized briefing, most important first:
+
+1. **Needs your response** — direct mentions, questions addressed to the user, and threads blocked on them. Cite who is asking and what they need.
+2. **Worth knowing** — decisions made, announcements, and important emails, one line each.
+3. **Everything else** — a one-line roll-up per channel ("#design: 12 messages about the icon refresh").
+
+Link every item you mention so the user can jump in. Keep the whole briefing scannable — lead with counts ("3 things need you, 5 worth a look"), never a wall of prose.
+
+End by offering to mark the covered notifications as seen (`MarkNotificationsSeen`); only do so if the user says yes.
+"##;
+
+static INTENT: &str = "Catch-up requests produce a prioritized, linked briefing — needs-response first, \
+ then notable activity, then per-channel roll-ups — built from unseen notifications and recent \
+ workspace activity.";
+
+/// The skill's instructions as a composable prompt section.
+pub static PROMPT: StaticPrompt<'static> = StaticPrompt::borrowed(TITLE, INSTRUCTIONS, INTENT);
+
+/// The catch-me-up system skill.
+pub static SKILL: SystemSkill = SystemSkill {
+ slug: "catch-me-up",
+ name: "Catch Me Up",
+ content: &PROMPT,
+};
diff --git a/crates/system_skills/src/demo.rs b/crates/system_skills/src/demo.rs
deleted file mode 100644
index 0e06347893..0000000000
--- a/crates/system_skills/src/demo.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-//! Demo system skill with obviously observable behavior, for verifying the
-//! system skill plumbing end-to-end (menu, search, listing, and ReadContent).
-
-use prompt::StaticPrompt;
-
-use crate::SystemSkill;
-
-static TITLE: &str = "Demo Skill";
-
-static INSTRUCTIONS: &str = r##"Follow this skill when the user references the Demo Skill. It exists to make skill-following visible, so its rules are deliberately conspicuous.
-
-- Start your reply with the exact line: `Demo skill active.`
-- Answer the user's request in exactly three bullet points.
-- End with a one-line summary prefixed with `Summary:`.
-
-Apply these rules only to the reply that invoked the skill, not to the rest of the conversation.
-"##;
-
-static INTENT: &str = "Replies that invoke the demo skill start with \"Demo skill active.\", answer in exactly \
- three bullets, and end with a \"Summary:\" line.";
-
-/// The skill's instructions as a composable prompt section.
-pub static PROMPT: StaticPrompt<'static> = StaticPrompt::borrowed(TITLE, INSTRUCTIONS, INTENT);
-
-/// The demo system skill.
-pub static SKILL: SystemSkill = SystemSkill {
- slug: "demo",
- name: "Demo Skill",
- content: &PROMPT,
-};
diff --git a/crates/system_skills/src/lib.rs b/crates/system_skills/src/lib.rs
index 452de21227..27f40cde39 100644
--- a/crates/system_skills/src/lib.rs
+++ b/crates/system_skills/src/lib.rs
@@ -15,8 +15,8 @@
use prompt::Section;
use uuid::Uuid;
-pub mod demo;
-pub mod skill_authoring;
+pub mod catch_me_up;
+pub mod what_i_did_yesterday;
#[cfg(test)]
mod test;
@@ -51,7 +51,7 @@ impl SystemSkill {
}
/// Every system skill, in display order.
-pub static SYSTEM_SKILLS: &[&SystemSkill] = &[&skill_authoring::SKILL, &demo::SKILL];
+pub static SYSTEM_SKILLS: &[&SystemSkill] = &[&catch_me_up::SKILL, &what_i_did_yesterday::SKILL];
/// Look up a system skill by its well-known id.
pub fn system_skill(id: Uuid) -> Option<&'static SystemSkill> {
diff --git a/crates/system_skills/src/skill_authoring.rs b/crates/system_skills/src/skill_authoring.rs
deleted file mode 100644
index 777c8de2bf..0000000000
--- a/crates/system_skills/src/skill_authoring.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-//! System skill teaching the AI how to write effective Macro skills.
-
-use prompt::StaticPrompt;
-
-use crate::SystemSkill;
-
-static TITLE: &str = "Skill Authoring Guide";
-
-static INSTRUCTIONS: &str = r##"Follow this guide when the user asks for help writing or improving a skill.
-
-Skills are markdown documents containing instructions the AI reads and follows when the skill is referenced in a request. A good skill:
-
-- Opens with one sentence stating when the skill applies, so it can be judged relevant without reading the whole document.
-- States concrete steps and rules, not aspirations. "Run `just prepare_db` after editing SQL" beats "keep the query cache up to date".
-- Includes worked examples of correct output when format matters.
-- Names its inputs: which documents, tools, or context the AI should gather before starting.
-- Stays single-purpose. Split unrelated workflows into separate skills so search finds the right one.
-
-Structure the skill with a short intro, then `##` sections in execution order. Keep it under a page; link out to reference documents for background instead of inlining them.
-"##;
-
-static INTENT: &str = "The AI writes skills that open with an applicability sentence, give concrete \
- single-purpose instructions in execution order, and stay under a page.";
-
-/// The skill's instructions as a composable prompt section.
-pub static PROMPT: StaticPrompt<'static> = StaticPrompt::borrowed(TITLE, INSTRUCTIONS, INTENT);
-
-/// The skill authoring system skill.
-pub static SKILL: SystemSkill = SystemSkill {
- slug: "skill-authoring-guide",
- name: "Skill Authoring Guide",
- content: &PROMPT,
-};
diff --git a/crates/system_skills/src/what_i_did_yesterday.rs b/crates/system_skills/src/what_i_did_yesterday.rs
new file mode 100644
index 0000000000..c32a75fe21
--- /dev/null
+++ b/crates/system_skills/src/what_i_did_yesterday.rs
@@ -0,0 +1,46 @@
+//! System skill for reconstructing a timeline of the user's activity yesterday.
+
+use prompt::StaticPrompt;
+
+use crate::SystemSkill;
+
+static TITLE: &str = "What I Did Yesterday";
+
+static INSTRUCTIONS: &str = r##"Follow this skill when the user asks what they did yesterday (or on another specific day) — for a standup, a work log, or their own recall. Build a single chronological timeline from every source available, then present it.
+
+Compute the day's bounds in the user's timezone first: yesterday runs from 00:00 to 24:00 local time, as ISO timestamps. Use those exact bounds in every query below.
+
+## Gather activity from every source
+
+Run these in parallel:
+
+1. **Macro workspace** — `ListEntities` sorted by `recently_updated` with a `df` updatedAt window for the day: documents edited, projects touched, calls joined. Query tasks separately with `df` subtype task plus the same window, filtering Status = Completed and Assignees = the user, to find tasks they finished.
+2. **Conversations** — from the entities that surfaced, note channels and email threads the user was active in; use `ReadChannelMessages` / `ReadThread` only where needed to attribute what the user actually said or sent, not just what changed around them.
+3. **GitHub and other integrations** — `SearchTools` with queries like "github commits", "github pull requests", "github reviews", then call the loaded tools scoped to the user and the day: commits pushed, PRs opened or merged, reviews given. Repeat for other connected trackers that record the user's work (e.g. Linear issues closed). If no integration matches, say so rather than silently omitting that source.
+
+Only include things the user did — skip other people's edits, messages, and commits.
+
+## Present the timeline
+
+Order everything chronologically and group by part of day (morning / afternoon / evening). One line per event:
+
+- `9:14 — Merged PR #512 "fix flaky retry test" (macro-inc/macro)`
+- `11:30 — Call with design team (32 min)`
+- `2:05 — Completed task "Migrate mentions table"`
+
+Link each event to its Macro item or external URL. After the timeline, add a two-or-three-sentence summary of the day's main threads of work — what the day was mostly about, not a restatement of every line. If a source returned nothing, note it in one line ("No GitHub activity yesterday").
+"##;
+
+static INTENT: &str = "Day-recap requests produce a chronological, linked timeline of the user's own actions \
+ across Macro, GitHub, and connected integrations, grouped by part of day and followed by a short \
+ summary of the day's main work.";
+
+/// The skill's instructions as a composable prompt section.
+pub static PROMPT: StaticPrompt<'static> = StaticPrompt::borrowed(TITLE, INSTRUCTIONS, INTENT);
+
+/// The what-i-did-yesterday system skill.
+pub static SKILL: SystemSkill = SystemSkill {
+ slug: "what-i-did-yesterday",
+ name: "What I Did Yesterday",
+ content: &PROMPT,
+};