ax-extract-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ax:extract-workflow - reconstruct the recipe behind a shipped artifact

ax:extract-workflow - 重构已发布工件的实现流程

Given a deliverable (a demo, a PR, a feature) the user wants to know: what skills, in what order, produced it? This skill resolves an anchor (date or sha), windows the relevant sessions, and narrates the ordered skill arcs in plain text. Eats its own dogfood: it is itself a framing skill.
Assumes
ax
(axctl) is on PATH. If
ax sessions here
fails, tell the user to check
docs/development.md#setup
(DuckDB dylib setup - no daemon required) and stop.
当用户拿到一个交付物(例如演示项目、PR、功能模块)时,他们想知道:是哪些技能、按什么顺序产出了这个交付物?本技能可解析锚点(日期或提交哈希),筛选相关会话,并以通俗易懂的文字描述有序的技能路径。该技能自身也遵循框架技能的设计理念,做到了“吃自己的狗粮”(即自身也使用所定义的工作流)。
假设
ax
(axctl)已配置在系统PATH中。如果
ax sessions here
命令执行失败,请告知用户查看
docs/development.md#setup
(DuckDB动态链接库配置 - 无需守护进程),并终止操作。

When to fire

触发时机

ONLY on explicit reconstruction triggers:
  • "what made <X> work" / "how did we ship <Y>"
  • "extract workflow from <date>" / "extract workflow from <sha>"
  • "what was the workflow around <topic>"
  • "reconstruct the recipe for <artifact>"
  • "show me how I built <feature>"
Do NOT fire on generic "what did I do today" or "show recent activity". That is
ax sessions here
territory, not this skill.
仅在收到明确的重构请求时触发:
  • “是什么让<X>正常运行” / “我们是如何发布<Y>的”
  • “从<日期>提取工作流” / “从<提交哈希>提取工作流”
  • “<主题>相关的工作流是什么”
  • “重构<工件>的实现流程”
  • “展示我是如何构建<功能>的”
请勿在用户提出“我今天做了什么”或“显示近期活动”这类通用请求时触发。这类请求属于
ax sessions here
的处理范畴,而非本技能。

Step 1 - resolve the anchor

步骤1 - 解析锚点

Decide one of three modes based on what the user gave you:
User saidModeAction
commit sha (full or short)shause it directly
date or date range (YYYY-MM-DD)dateuse
ax sessions around <date>
topic / feature / artifact nametopic
ax recall "<topic>" --sources=commit --json
to find candidate shas
"this repo, recently"pwd
ax sessions here --days=14
For topic mode pick the most relevant sha and proceed in sha mode. If results are ambiguous, ask the user to pick one before continuing.
根据用户提供的信息,选择以下三种模式之一:
用户输入模式操作
提交哈希(完整或短哈希)sha直接使用该哈希
日期或日期范围(YYYY-MM-DD)date执行
ax sessions around <date>
主题/功能/工件名称topic执行
ax recall "<topic>" --sources=commit --json
查找候选哈希
“当前仓库,近期”pwd执行
ax sessions here --days=14
对于主题模式,选择最相关的哈希,然后切换到sha模式继续操作。如果结果存在歧义,请先让用户选择一个哈希再继续。

Step 2 - window the sessions

步骤2 - 筛选会话

Pick the right command for the resolved anchor:
  • sha mode:
    ax sessions near <sha> --json
  • date mode:
    ax sessions around <date> --days=3 --json
  • pwd mode:
    ax sessions here --days=14 --json
Pick the N most relevant sessions from the JSON (default N=5). Bias to sessions with the highest turn counts and that touch files related to the artifact.
根据解析后的锚点选择合适的命令:
  • sha模式:
    ax sessions near <sha> --json
  • date模式:
    ax sessions around <date> --days=3 --json
  • pwd模式:
    ax sessions here --days=14 --json
从JSON结果中选取N个最相关的会话(默认N=5)。优先选择交互次数最多且涉及与工件相关文件的会话。

Step 3 - inspect each session

步骤3 - 检查每个会话

For each picked session:
ax sessions show <id> --json
ax sessions show <id> --by-role     # optional, see Step 4
Read the
top_skills
and
agent_delegations
arrays. If a subagent's work looks central to the artifact, drill in:
ax sessions show <id> --expand=<subagent-uuid>
对于每个选中的会话:
ax sessions show <id> --json
ax sessions show <id> --by-role     # 可选,用于步骤4
读取
top_skills
agent_delegations
数组。如果子代理的工作对工件至关重要,则深入查看:
ax sessions show <id> --expand=<subagent-uuid>

Step 4 - narrate

步骤4 - 生成叙述内容

Produce two artifacts inline (no files written - keep the answer in chat).
直接在聊天中生成两类内容(无需写入文件)。

4a. Ordered skill arc

4a. 有序技能路径

Lead with the framing skill that opened the work (use
--by-role
output if available - the
framing
group goes first). Then execution skills, then verification. For each skill, name it and write one line on what it produced.
Example:
1. brainstorming    -> defined the workflow extraction problem
2. writing-plans    -> turned 13 grilled questions into a plan
3. subagent-driven  -> executed the plan as 17 typed-CLI tasks
4. code-review      -> two-stage spec + quality review per task
5. test-driven-dev  -> 100% green throughout
以开启工作的框架技能开头(如果有
--by-role
的输出,则优先使用
framing
组的内容),接着是执行类技能,最后是验证类技能。对于每个技能,写出其名称并简要描述它产出的成果。
示例:
1. brainstorming    -> 定义了工作流提取的问题
2. writing-plans    -> 将13个细化问题转化为执行计划
3. subagent-driven  -> 将计划拆分为17个CLI任务并执行
4. code-review      -> 对每个任务进行两轮规范+质量评审
5. test-driven-dev  -> 全程保持测试100%通过

4b. Key decisions

4b. 关键决策点

Pull 2-4 turn excerpts where the user steered the work. Use:
ax recall "<keyword>" --skill=<framing-skill> --limit=5 --json
Quote one line per decision; cite the session id.
提取2-4处用户引导工作方向的交互片段。使用以下命令:
ax recall "<keyword>" --skill=<framing-skill> --limit=5 --json
每个决策点引用一行内容,并标注会话ID。

4c. Reproducer brief (optional, if user asks)

4c. 重现指南(可选,仅当用户要求时提供)

A one-paragraph "to do this again, you would" summary - the skills, the order, and the key user inputs at the steering points.
用一段文字总结“如果要再次实现该工件,需要怎么做”——包括所需技能、执行顺序,以及关键决策点的用户输入内容。

When to recommend ax skills classify

何时推荐使用ax skills classify

If
ax sessions show <id> --by-role
returns many skills in the
(unclassified)
group, the role-weighted output above will be noisy. Suggest the user run
ax skills classify
once - it generates briefs the user can fill in to seed roles. Don't block on it; the artifact-reconstruction story still works without roles.
如果
ax sessions show <id> --by-role
返回的结果中有大量技能属于
(unclassified)
组,那么基于角色权重的输出会显得杂乱。此时建议用户运行一次
ax skills classify
——该命令会生成概要内容,用户可补充信息来为技能分配角色。无需在此步骤阻塞操作;即使没有角色信息,工件重构的叙述依然有效。

Output contract

输出约定

Write everything inline. Do not create files under
.ax/tasks/
or anywhere else. Do not modify the repo. This is a read-only, reconstruction-focused skill.
If the user asks for a permanent recipe, recommend they paste your output into
docs/recipes/<name>.md
themselves - ax intentionally has no recipe save format yet (per the workflow-extraction-frictions plan).
所有内容直接在聊天中输出。请勿在
.ax/tasks/
或其他位置创建文件。请勿修改仓库。本技能是只读的,专注于工作流重构。
如果用户要求保存永久的实现流程,建议他们将你的输出粘贴到
docs/recipes/<name>.md
中——根据工作流提取的痛点规划,ax目前暂未提供流程保存格式。