SKILL·532D1F

ax-narrate

Necmttn
更新于 9 days ago
93
9
93
在 GitHub 上查看
ai

关于

The ax-narrate skill generates a structured session narration when triggered by phrases like "narrate this session" or "summarize what changed." It captures the complete development story including corrections, abandoned attempts, and tool failures that don't appear in final PRs. The output is saved as a JSON file in `.ax/narrations/` for review in ax studio.

快速安装

Claude Code

推荐
主要方式
npx skills add Necmttn/ax -a claude-code
插件命令备选方式
/plugin add https://github.com/Necmttn/ax
Git 克隆备选方式
git clone https://github.com/Necmttn/ax.git ~/.claude/skills/ax-narrate

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

ax:narrate - write the session's story as a structured narration

You were there. This skill turns YOUR OWN memory of the session into a reviewable artifact: 3-7 stops in reading-flow order, each anchored to real evidence - code hunks, turn numbers, user quotes, failures. The point is to capture what a PR diff never shows: the corrections, the dead ends, the recoveries.

The artifact validates against SessionNarration in apps/studio/src/routes/narration-types.ts and renders in ax studio.

Step 1 - identify the session

  • Preferred: ax sessions here --days=1 --json and pick the current session's id (the one matching this conversation). Use the short id.
  • If ax is unavailable or the session isn't ingested yet, derive a slug: <repo>-<YYYYMMDD-HHmm>. Note in meta that turn seqs are best-effort ordinals in that case.
  • If available, ax sessions show <id> --json gives you the real turn seqs to anchor against. Prefer real seqs over guesses.

Step 2 - reconstruct the story from your own context

Re-read the conversation in your head before writing anything:

  1. What did the user originally ask for? (intent)
  2. What existed before, what exists now? (before/after)
  3. Where did the user redirect or correct you? EVERY one of these becomes a correction anchor. No exceptions.
  4. Which tool failures actually mattered (changed your approach, cost real time, forced a workaround)? Each becomes a tool_failure anchor. Skip trivial retries that changed nothing.
  5. Which attempts were abandoned? They get a stop or at least a turn anchor - abandonment is part of the story.

Step 3 - choose 3-7 stops, in reading-flow order

A stop is a LOGICAL unit of change, not a file. If three files changed for one reason, that is ONE stop with several anchors. Order rules (stolen from the code-tour playbook because they work):

  • Entry point first: the change that, understood alone, unlocks the rest.
  • Cause before effect: the correction comes before the code it caused.
  • Definitions before consumers: types/schema stops before usage stops.
  • Verification last: tests, typecheck, and the failures hit on the way.
  • Combine trivial housekeeping into one final stop, or omit it.

Step 4 - write each stop

  • title: short and friendly. "Call counts become a char diffstat", not "Changes to files-touched.ts".
  • gist: ONE sentence. Not two. A reader who reads nothing else must get the stop from the gist. Conversational, the way you'd say it to a colleague.
  • detail: 2-4 sentences of markdown (paragraphs, inline code, bold). Say WHY the change looks the way it does; "we did X instead of Y because Z" is exactly what the reader wants.
  • transition: a short connective phrase to the next stop; empty string "" for the last stop.
  • anchors: MUST be non-empty. An unanchored stop is an unsupported claim. Anchor kinds:
kindrequired fieldsuse for
file_hunkfile, old_text, new_text, label, opt turn_seqa real code change
code_stateartifact, label, lang, code, opt turn_seqthe evolving architecture snapshot
turnturn_seq, labela plain moment in the transcript
user_directionturn_seq, quoteuser steering (not correcting)
correctionturn_seq, quote, outcomeuser correcting course
tool_failureturn_seq, tool, error_excerpt, recoveryconsequential failure
termname, definitiona domain term the story leans on

Hard anchor rules

  • file_hunk carries VERBATIM old/new fragments from the actual edits you made - copy the real text, never paraphrase code. Keep hunks short (5-15 lines per side); pick the most telling fragment, not the whole edit. old_text: null for pure insertions, new_text: null for pure deletions. Never both null.
  • Every user correction/redirect in the session gets a correction anchor with a verbatim (trimmed) quote and a concrete outcome - what actually changed because of it.
  • Every consequential tool failure gets a tool_failure anchor with a real error_excerpt and how you recovered (or "abandoned").
  • Never fabricate turn seqs. Use ax sessions show seqs when you have them; otherwise count user turns from the start of the conversation and say so in the detail.
  • code_state is the architecture spine of the narration: pick ONE stable artifact id (e.g. "review-architecture") and restate the FULL snapshot at each stop where the design moved - pseudo-code of types/interfaces, how they compose, and the call stack (plan-style: Caller -> Callee // note). Consecutive snapshots of the same artifact animate token-by-token in studio, so KEEP shared lines byte-identical between stops and let only the real delta differ - a new method, a renamed shape, an added edge case. Use code_state for the evolving design; use file_hunk for one-off code jumps (those render as static before/after diffs, not motion).

Step 5 - emit the artifact

Write .ax/narrations/<session-id>.json (create the directory if needed) with exactly this top-level shape:

{
  "schema_version": 1,
  "kind": "narration",
  "meta": {
    "session_id": "<id>",
    "generated_at": "<ISO-8601 now>",
    "generator": "skill",
    "model": "<your model id>"
  },
  "title": "...",
  "intent": "...",
  "before": "...",
  "after": "...",
  "stops": [ { "title": "...", "gist": "...", "detail": "...", "transition": "...", "anchors": [ ... ] } ]
}

Before finishing, self-check against the validator's rules:

  • stops non-empty (3-7), every stop's anchors non-empty.
  • Every gist is one sentence; every correction has an outcome; every tool_failure has a recovery; no file_hunk with both sides null or empty.
  • Strings are plain JSON strings (escape newlines in hunks as \n).

Then tell the user where the file landed and give a 2-line summary of the story you wrote. Do not paste the whole JSON into chat.

GitHub 仓库

Necmttn/ax
路径: skills/narrate
0
agent-memoryagent-observabilityai-agentsbunclaude-codecodex
FAQ

常见问题

什么是 ax-narrate Skill?

ax-narrate 是一个 Claude Skill,作者为 Necmttn。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 ax-narrate 相关的任务。

如何安装 ax-narrate?

使用本页的安装命令:将 ax-narrate 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。

ax-narrate 属于哪个分类?

ax-narrate 属于元分类。

ax-narrate 可以免费使用吗?

可以。ax-narrate 已收录在 AIMCP,可免费安装。

相关推荐技能

content-collections

Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。

查看技能
polymarket

这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。

查看技能
creating-opencode-plugins

该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。

查看技能
sglang

SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。

查看技能