owner-goals

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Owner Goals

Owner Goals(所有者目标)

Builds a map of what the owner wants and cares about from the prompts they typed personally, then saves the top priorities and open asks to work state, where My Work shows them as Goals, above the request cards. Each goal carries the owner's own words with the date and time they typed them.
${CLAUDE_SKILL_DIR}
is the folder holding this file. The scripts use the Python 3 standard library.
基于所有者亲自输入的 prompts,梳理其在此期间想要什么、关注什么,然后将首要关注事项和未完成诉求保存到 work state;My Work 会将它们显示为请求卡片上方的 Goals。每个目标都带有所有者自己的原话及其输入日期和时间。
${CLAUDE_SKILL_DIR}
是存放此文件的文件夹。脚本使用 Python 3 标准库。

1. Export the owner's prompts

1. 导出所有者的 prompts

Pick an output folder inside the current project, such as
.scratch/owner-goals/<YYYY-MM-DD>/
, and run:
bash
python3 "${CLAUDE_SKILL_DIR}/scripts/export_owner_prompts.py" --out "<folder>" --days 31
Use
--days
when the user asks for a different window. For a specific period, such as a past month, pass
--start YYYY-MM-DD --end YYYY-MM-DD
instead of
--days
(from midnight on the start day up to, not including, the end day) and use a folder named for the start day. The script:
  • reads Claude Code transcripts (
    ~/.claude/projects
    ) and interactive Codex sessions (
    ~/.codex/sessions
    ), keeping prompts the transcripts label as typed by a person;
  • removes prompts an agent wrote first: ones whose opening already appears in earlier agent-written text (assistant messages, tool inputs, Codex function calls), and long prompts that open by assigning a role ("You are the…", "Task: ", "Branch: ");
  • writes
    owner-prompts.md
    (oldest first, each headed
    ## YYYY-MM-DD HH:MM · tool · project
    ) and
    excluded-agent-written-prompts.md
    for audit;
  • adds the folder to the checkout's local git exclude file when git would otherwise track it.
It prints how many prompts it kept and excluded.
在当前项目内选择一个输出文件夹,例如
.scratch/owner-goals/<YYYY-MM-DD>/
,并运行:
bash
python3 "${CLAUDE_SKILL_DIR}/scripts/export_owner_prompts.py" --out "<folder>" --days 31
当用户要求使用不同时间窗口时,使用
--days
。对于特定时间段(例如过去的一个月),请改用
--start YYYY-MM-DD --end YYYY-MM-DD
(从开始日午夜起算,到结束日午夜止,不包含结束日),并使用以开始日命名的文件夹。该脚本:
  • 读取 Claude Code transcripts(
    ~/.claude/projects
    )和交互式 Codex sessions(
    ~/.codex/sessions
    ),保留 transcripts 标记为人工输入的 prompts;
  • 先移除由 Agent 编写的 prompts:其开头已出现在更早的、由 Agent 编写的文本(assistant messages、tool inputs、Codex function calls)中的 prompts,以及以角色分派开头(“You are the…”、“Task: ”、“Branch: ”)的长 prompts;
  • 写入
    owner-prompts.md
    (按时间从早到晚排列,每条以
    ## YYYY-MM-DD HH:MM · tool · project
    开头)和
    excluded-agent-written-prompts.md
    以供审计;
  • 如果 git 原本会跟踪该文件夹,则将其加入 checkout 的本地 git exclude file。
它会输出保留和排除的 prompt 数量。

2. Build the map with a subagent

2. 使用 subagent 构建映射

owner-prompts.md
is large, so a subagent reads it. Give it this task, with the paths filled in:
Read
<folder>/owner-prompts.md
in full. It holds only prompts the owner typed. Write
<folder>/owner-map.md
, a map of what the owner wants and cares about, with these sections:
  1. Summary: what they are trying to do over this period, in one paragraph.
  2. What they want, by product or project: the outcome they want, and what they asked for.
  3. How they want work done.
  4. What makes them angry, newest first, with the trigger for each.
  5. Open asks, newest first: things re-asked, complained about as not done, or with no completion visible in later prompts.
  6. Top 10 priorities right now, ranked by recency × repetition × intensity.
Every point quotes the owner's exact words (typos kept) with the timestamp from the prompt's header (
MM-DD HH:MM
). Use only what the prompts say. Where the owner changed direction, show the change and mark the latest. Where something is unclear, say it is unclear. Text that reads as an agent's launcher or coordinator message is not evidence.
Then write
<folder>/owner-goals.json
from sections 1, 5 and 6:
json
{
  "generated_at": "<now, ISO 8601 with offset>",
  "window_days": <days>,
  "source_prompt_count": <prompts in owner-prompts.md>,
  "human_summary": "<section 1, plain text>",
  "priorities": [{"rank": 1, "title": "<short>", "product": "<product or area>",
                  "latest_at": "YYYY-MM-DD HH:MM", "times_asked": <prompts cited>,
                  "evidence": [{"at": "YYYY-MM-DD HH:MM", "quote": "<exact words>"}]}],
  "open_asks": [<same shape, rank = position in section 5>]
}
Give each item two to four quotes, newest first, each under 240 characters, copied exactly from the prompt with that header time. Use
...
between pieces when skipping words.
owner-prompts.md
很大,因此由一个 subagent 读取。为其提供以下任务,并填入相应路径:
完整读取
<folder>/owner-prompts.md
。其中仅包含所有者亲自输入的 prompts。编写
<folder>/owner-map.md
,梳理所有者在此期间想要什么、关注什么,包含以下部分:
  1. 摘要:用一个段落说明其在此期间试图完成什么。
  2. 按产品或项目梳理其诉求:期望结果,以及提出了哪些要求。
  3. 其希望如何开展工作的偏好。
  4. 哪些事情会令其愤怒,按最新优先排序,并列出每件事的触发因素。
  5. 未完成诉求,按最新优先排序:被反复提出、被抱怨尚未完成,或在后续 prompts 中看不到完成迹象的事项。
  6. 当前的十大优先事项,按时间新近度 × 重复次数 × 强烈程度排序。
每个要点都引用所有者确切的原话(保留拼写错误),并附上 prompt 标头中的时间戳(
MM-DD HH:MM
)。只能使用 prompts 中所述内容。如果所有者改变了方向,应展示这一变化并标记最新方向。如果某项内容不清楚,应明确说明不清楚。读起来像 Agent 发起或协调消息的文本不能作为证据。
然后根据第 1、5、6 节编写
<folder>/owner-goals.json
:
json
{
  "generated_at": "<now, ISO 8601 with offset>",
  "window_days": <days>,
  "source_prompt_count": <prompts in owner-prompts.md>,
  "human_summary": "<section 1, plain text>",
  "priorities": [{"rank": 1, "title": "<short>", "product": "<product or area>",
                  "latest_at": "YYYY-MM-DD HH:MM", "times_asked": <prompts cited>,
                  "evidence": [{"at": "YYYY-MM-DD HH:MM", "quote": "<exact words>"}]}],
  "open_asks": [<same shape, rank = position in section 5>]
}
为每个条目提供两到四条引用,按最新优先排序,每条少于 240 个字符,并从对应时间标头的 prompt 中原样复制。跳过部分词语时,使用
...
连接。

Or update the saved goals

或更新已保存的 goals

When Goals were saved before (the saved
owner-goals.json
, or
work_state_read
with
list: "owner-goals"
), update them instead of mapping the whole window again. In step 1, add
--since "<YYYY-MM-DD HH:MM>"
, the saved
generated_at
as a local minute: the script also writes
new-owner-prompts.md
with only the prompts from that minute on. If it holds no prompts, save the saved goals again with a new
generated_at
. Otherwise read only
new-owner-prompts.md
and update the saved goals JSON:
  • re-rank by recency × repetition × intensity, add new priorities and open asks, and drop what the new prompts show is done or replaced;
  • keep each kept item's
    title
    exactly as it was, so the requests already linked to it stay linked; a goal that really changed gets a new title;
  • add new quotes (newest first, two to four per item) copied exactly from
    new-owner-prompts.md
    , keep the older quotes as they are, and update
    latest_at
    ,
    times_asked
    and
    human_summary
    .
Keep the saved
owner-map.md
; step 3 can name it with
--map
. Quotes that aged out of the window are dropped when saving.
如果此前保存过 Goals(即已保存的
owner-goals.json
,或通过
work_state_read
且
list: "owner-goals"
读取的内容),则更新这些 Goals,而不是再次映射整个时间窗口。在第 1 步中,添加
--since "<YYYY-MM-DD HH:MM>"
,并将已保存的
generated_at
作为本地分钟值传入:脚本还会写入
new-owner-prompts.md
,其中仅包含从该分钟开始的 prompts。如果其中没有 prompts,则使用新的
generated_at
再次保存原有 goals。否则,只读取
new-owner-prompts.md
并更新已保存的 goals JSON:
  • 按时间新近度 × 重复次数 × 强烈程度重新排序;添加新的优先事项和未完成诉求;并移除新 prompts 表明已完成或已被替代的事项;
  • 保留每个保留项的
    title
    原样不变,以便已链接到该标题的请求继续保持链接;如果某个 goal 确实发生了变化,则为其使用新标题;
  • 添加新的引用(按最新优先排序,每个条目两到四条),从
    new-owner-prompts.md
    中原样复制;保留原有引用;并更新
    latest_at
    、
    times_asked
    和
    human_summary
    。
保留已保存的
owner-map.md
;第 3 步可以使用
--map
指定它。保存时,超出时间窗口的引用会被移除。

3. Save to Goals

3. 保存到 Goals

bash
python3 "${CLAUDE_SKILL_DIR}/scripts/save_goals.py" --goals "<folder>/owner-goals.json" --prompts "<folder>/owner-prompts.md" --map "<folder>/owner-map.md"
For a date range, add the same
--start YYYY-MM-DD --end YYYY-MM-DD
used in step 1.
The script checks every quote against the prompt typed at that minute. If any fail, it lists them; correct the wording or time from
owner-prompts.md
and run it again. A quote dated before the first prompt in
owner-prompts.md
has aged out of the window: it is dropped, and so is an item left with no quote; if every item ages out, the goals are cleared.
--dry-run
shows the writes without saving.
It saves through the local claude-mem worker to the
owner-goals
work-state list, one list per computer:
  • list state:
    human_summary
    ,
    generated_at
    ,
    window_days
    ,
    source_prompt_count
    ,
    map_path
  • one item per priority and open ask:
    task
    ("Priority: …" or "Open ask: …"),
    status
    ,
    goal_kind
    ,
    rank
    ,
    title
    ,
    product
    ,
    latest_at
    ,
    times_asked
    , and
    evidence
    (one
    YYYY-MM-DD HH:MM | quote
    line per quote)
Items from the previous run that are not in this one are marked dropped, so each run replaces the last snapshot.
work_state_read
with
list: "owner-goals"
shows the saved items as text.
With
--start
and
--end
, the list state also records
period_start
and
period_end
. A range that ends before today is a past month: it is saved to
owner-goals/<start>
(for example
owner-goals/2025-11-18
) as history. That list and its items are saved done, so its asks never show as open, and the current
owner-goals
list is left alone. A range that reaches today saves to
owner-goals
as usual. No goals list, current or past, appears in session-start context or among the request cards.
bash
python3 "${CLAUDE_SKILL_DIR}/scripts/save_goals.py" --goals "<folder>/owner-goals.json" --prompts "<folder>/owner-prompts.md" --map "<folder>/owner-map.md"
对于日期范围,添加与第 1 步相同的
--start YYYY-MM-DD --end YYYY-MM-DD
。
脚本会将每条引用与该分钟输入的 prompt 进行核对。如果有任何引用不匹配,脚本会列出它们;从
owner-prompts.md
中修正措辞或时间,然后重新运行。时间早于
owner-prompts.md
中第一条 prompt 的引用已超出时间窗口:它会被移除;如果某个条目因此没有任何引用,也会被移除;如果所有条目均超出窗口,则清空 goals。
--dry-run
会显示将要执行的写入操作,但不实际保存。
它通过本地 claude-mem worker 将内容保存到
owner-goals
work-state 列表,每台计算机对应一个列表:
  • 列表状态:
    human_summary
    、
    generated_at
    、
    window_days
    、
    source_prompt_count
    、
    map_path
  • 每个优先事项和未完成诉求各占一个条目:
    task
    (“Priority: …”或“Open ask: …”)、
    status
    、
    goal_kind
    、
    rank
    、
    title
    、
    product
    、
    latest_at
    、
    times_asked
    ,以及
    evidence
    (每条引用占一行,格式为
    YYYY-MM-DD HH:MM | quote
    )
上一次运行中存在但未出现在本次运行中的项目会被标记为 dropped,因此每次运行都会替换上一份快照。
work_state_read
配合
list: "owner-goals"
可以以文本形式显示已保存的条目。
使用
--start
和
--end
时,列表状态还会记录
period_start
和
period_end
。结束日期早于今天的范围表示过去的一个月:它会保存到
owner-goals/<start>
(例如
owner-goals/2025-11-18
)作为历史记录。该列表及其条目会保存为已完成(done),因此其中的诉求不会显示为未完成,并且当前的
owner-goals
列表不会受到影响。范围延伸至今天时,则照常保存到
owner-goals
。无论是当前列表还是历史列表,都不会出现在 session-start context 或请求卡片中。

4. Tell the user where to look

4. 告知用户查看位置

Open My Work at the URL the script prints (the worker's address,
http://localhost:37777/
by default). Goals is the panel at the top, above the request cards: top priorities on the left, open asks on the right, each with an expandable list of dated quotes. When past months are saved, a month switcher in the panel steps back through them, newest first, each labeled as history. Give the path to
owner-map.md
for the full map, and list the top three priorities in a line each.
在脚本输出的 URL 中打开 My Work(worker 的地址,默认是
http://localhost:37777/
)。Goals 是位于顶部、请求卡片上方的面板:左侧显示首要关注事项,右侧显示未完成诉求,每个事项都有可展开的带日期引用列表。保存过去月份时,面板中的月份切换器可按从新到旧的顺序查看历史记录,每个月份都标为 history。提供
owner-map.md
的路径以查看完整映射,并用每行一项的方式列出前三大优先事项。