project-distill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/project:distill

/project:会话见解提炼

Distill session insights into reusable project knowledge. Reviews what was done during a session and proposes targeted updates to Claude rules, skills, and justfile recipes.
将会话见解提炼为可复用的项目知识。回顾会话期间完成的工作,并针对性地提出对Claude规则、Skills以及justfile配方的更新建议。

When to Use This Skill

该Skill的适用场景

Use this skill when...Use alternative when...
End of session, want to capture learningsNeed to write a blog post about work done ->
/blog:post
Discovered a pattern worth reusingNeed to analyze git history for docs gaps ->
/git:log-documentation
Found a CLI workflow worth saving as a recipeNeed to configure a justfile from scratch ->
/configure:justfile
Want to update rules based on session experienceNeed to check project infrastructure ->
/configure:status
Avoiding reinventing solutions next sessionNeed to resume work where you left off ->
/project:continue
适用该Skill的场景...适用替代工具的场景...
会话结束时,想要捕获学习成果需要撰写关于已完成工作的博客文章 ->
/blog:post
发现了值得复用的模式需要分析git历史以查找文档缺口 ->
/git:log-documentation
找到了值得保存为配方的CLI工作流需要从头配置justfile ->
/configure:justfile
想要根据会话经验更新规则需要检查项目基础设施 ->
/configure:status
避免在下一次会话中重复造轮子需要从上次中断的地方继续工作 ->
/project:continue

Core Principle: Update Over Add

核心原则:优先更新,而非新增

Adding is not always better. Before proposing any new artifact, evaluate:
QuestionIf yes...
Does this replace an existing rule/recipe/skill?Remove the old one, add the new
Does this improve an existing one?Update in place
Does an existing one already cover this?Skip it
Is this genuinely new and reusable?Add it
Is this a one-off that won't be needed again?Skip it
新增并非总是更好。 在提出任何新工件之前,请先评估:
问题如果是...
这是否会替代现有的规则/配方/Skill?删除旧的,添加新的
这是否能改进现有的工件?原地更新
现有的工件是否已经覆盖了这个内容?跳过
这是否是真正全新且可复用的内容?添加它
这只是一次性需求,后续不会再用到?跳过

Context

上下文说明

The primary context source is the current conversation history — all messages, tool calls, and results from this session are available. Git history is supplemental and may be unavailable (e.g., in non-git directories or multi-repo workspaces).
  • Git repo detected: !
    find . -maxdepth 1 -name '.git' -type d
  • Justfile: !
    find . -maxdepth 1 \( -name 'justfile' -o -name 'Justfile' \) -print -quit
  • Rules directory: !
    find .claude/rules -name '*.md' -type f
主要的上下文来源是当前对话历史 —— 本次会话中的所有消息、工具调用和结果均可用。Git历史作为补充信息,可能无法获取(例如在非git目录或多仓库工作区中)。
  • Git仓库检测:!
    find . -maxdepth 1 -name '.git' -type d
  • Justfile:!
    find . -maxdepth 1 \( -name 'justfile' -o -name 'Justfile' \) -print -quit
  • 规则目录:!
    find .claude/rules -name '*.md' -type f

Parameters

参数说明

ParameterDescription
--rules
Only analyze potential rule updates
--skills
Only analyze potential skill updates
--recipes
Only analyze potential justfile recipe updates
--all
Analyze all three categories (default)
--dry-run
Show proposals without applying changes
参数描述
--rules
仅分析潜在的规则更新
--skills
仅分析潜在的Skill更新
--recipes
仅分析潜在的justfile配方更新
--all
分析所有三类内容(默认选项)
--dry-run
仅显示建议,不应用更改

Execution

执行流程

Execute this session distillation workflow:
执行以下会话见解提炼工作流:

Step 1: Analyze session activity

步骤1:分析会话活动

Understand what happened during this session using all available context:
  1. Review the conversation history — tool calls, file edits, commands run, agent dispatches, and results
  2. If in a git repo, supplement with:
    git log --oneline --max-count=20
    and
    git log --stat --oneline --max-count=10
  3. Identify patterns: repeated operations, workarounds, discoveries
  4. Catalog tools used: effective commands, flags, workflows
  5. Note pain points: where time was spent figuring things out
Note: Conversation history is the primary source. Git history is supplemental — it may be empty (non-git directory, multi-repo workspace, or no commits this session).
利用所有可用上下文了解会话期间的工作内容:
  1. 回顾对话历史 —— 工具调用、文件编辑、执行的命令、Agent调度及结果
  2. 如果在Git仓库中,补充执行:
    git log --oneline --max-count=20
    git log --stat --oneline --max-count=10
  3. 识别模式:重复操作、解决方案、新发现
  4. 记录使用的工具:高效的命令、参数、工作流
  5. 标记痛点:花费时间摸索的环节
注意: 对话历史是主要来源。Git历史仅作为补充 —— 可能为空(非Git目录、多仓库工作区或本次会话无提交)。

Step 2: Evaluate against existing knowledge

步骤2:与现有知识对比评估

For each potential insight, check existing artifacts:
Rules (
.claude/rules/*.md
):
  • Does it update, contradict, or duplicate an existing rule?
  • Prefer updating existing rules over creating new files
Skills (relevant plugin skills):
  • Does this improve existing skill commands/examples?
  • Does this suggest missing guidance?
Justfile recipes:
  • Is there a repeated command that should become a recipe?
  • Should an existing recipe be updated with better flags?
  • Is an existing recipe now redundant?
针对每个潜在的见解,检查现有工件:
规则
.claude/rules/*.md
):
  • 它是否会更新、矛盾或重复现有规则?
  • 优先更新现有规则,而非创建新文件
Skills(相关插件Skills):
  • 这是否能改进现有的Skill命令/示例?
  • 这是否暗示了缺失的指导内容?
Justfile配方
  • 是否有重复执行的命令应该保存为配方?
  • 是否应该用更优的参数更新现有配方?
  • 现有配方是否已冗余?

Step 3: Check redundancy

步骤3:检查冗余性

For each proposed change, answer:
  1. Does this make an existing artifact redundant? → Propose removal
  2. Does this overlap with existing artifacts? → Propose merging
  3. Is the existing version still better? → Skip the proposal
  4. Will this be used more than once? → Skip if one-off
针对每个拟议的更改,回答以下问题:
  1. 这是否会使现有工件变得冗余? → 建议删除
  2. 这是否与现有工件重叠? → 建议合并
  3. 现有版本是否仍更优? → 跳过该建议
  4. 这是否会被多次使用? → 如果是一次性需求则跳过

Step 4: Present proposals

步骤4:呈现建议

Categorize findings as:
  • [UPDATE]
    .claude/rules/X.md
    - Reason for update (description of change)
  • [SKIP] Considered rule Y, but Z already covers it
  • [UPDATE]
    plugin/skills/skill-name/SKILL.md
    - Pattern discovered
  • [NEW] Genuinely new and reusable artifact (only if justified)
  • [UPDATE]
    recipe-name
    - Better flags discovered (before/after)
  • [REDUNDANT]
    old-recipe
    - Superseded by new approach
将发现的内容分类为:
  • [UPDATE]
    .claude/rules/X.md
    - 更新原因(更改描述)
  • [SKIP] 考虑过规则Y,但Z已覆盖该内容
  • [UPDATE]
    plugin/skills/skill-name/SKILL.md
    - 发现的模式
  • [NEW] 真正全新且可复用的工件(仅在合理情况下添加)
  • [UPDATE]
    recipe-name
    - 发现更优参数(前后对比)
  • [REDUNDANT]
    old-recipe
    - 被新方法取代

Step 5: Apply changes

步骤5:应用更改

If not
--dry-run
:
  1. Use AskUserQuestion to confirm each category before applying
  2. Edit existing files for updates (preferred)
  3. Create new files only for genuinely new artifacts
  4. Remove redundant artifacts
如果未使用
--dry-run
参数:
  1. 使用AskUserQuestion在应用前确认每个分类的更改
  2. 编辑现有文件进行更新(优先选择)
  3. 仅为真正全新的工件创建新文件
  4. 删除冗余工件

Step 6: Report summary

步骤6:报告总结

Output concise summary of what was changed (rules updated, recipes added, insights skipped)
输出简洁的更改总结(更新的规则、添加的配方、跳过的见解)

Evaluation Criteria for Each Category

各分类的评估标准

Rules Worth Capturing

值得捕获的规则

Capture when...Skip when...
Pattern applies across sessionsOne-time fix
Convention that prevents mistakesObvious best practice
Project-specific constraint discoveredGeneric advice
Tool behavior that's non-obviousWell-documented behavior
捕获场景...跳过场景...
模式适用于多个会话一次性修复
可预防错误的约定显而易见的最佳实践
发现的项目特定约束通用建议
非直观的工具行为文档完善的行为

Recipes Worth Capturing

值得捕获的配方

Capture when...Skip when...
Command was run 3+ times with same flagsOne-off command
Multi-step workflow that should be atomicSingle simple command
Flags that are hard to rememberCommon well-known flags
Project-specific pipeline stepStandard
just
template recipe
捕获场景...跳过场景...
同一命令带相同参数被执行3次以上一次性命令
应原子化的多步骤工作流单个简单命令
难以记忆的参数常见且广为人知的参数
项目特定的流水线步骤标准
just
模板配方

Skill Improvements Worth Proposing

值得提出的Skill改进建议

Propose when...Skip when...
Discovered better command flagsMinor style preference
Found a pattern the skill doesn't coverEdge case unlikely to recur
Existing guidance was misleadingNiche use case
New tool version changed behaviorTemporary workaround
提出建议的场景...跳过场景...
发现更优的命令参数微小的风格偏好
发现Skill未覆盖的模式不太可能再次出现的边缘情况
现有指导内容存在误导性小众使用场景
工具新版本更改了行为临时解决方案

Agentic Optimizations

Agent优化命令

ContextCommand
Session diff summary
git log --stat --oneline --max-count=10
Recent commits
git log --oneline --max-count=20
Files changed
git log --name-only --max-count=10 --format=''
List justfile recipes
just --list
Dump justfile as JSON
just --dump --dump-format json
Dry run recipe
just --dry-run recipe-name
Find rules
find .claude/rules -name '*.md' -type f
场景命令
会话差异总结
git log --stat --oneline --max-count=10
最近提交记录
git log --oneline --max-count=20
已更改文件
git log --name-only --max-count=10 --format=''
列出justfile配方
just --list
以JSON格式导出justfile
just --dump --dump-format json
试运行配方
just --dry-run recipe-name
查找规则文件
find .claude/rules -name '*.md' -type f

Quick Reference

快速参考

FlagDescription
--rules
Scope to rules only
--skills
Scope to skills only
--recipes
Scope to justfile recipes only
--all
All categories (default)
--dry-run
Propose without applying
参数说明
--rules
仅聚焦规则
--skills
仅聚焦Skills
--recipes
仅聚焦justfile配方
--all
所有分类(默认)
--dry-run
仅提出建议,不应用更改