reflect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Reflect Skill

Reflect Skill

Analyze the current session and propose improvements to skills based on what worked, what didn't, and edge cases discovered.
分析当前会话,基于有效内容、无效内容以及发现的边缘情况,提出技能改进建议。

Trigger

触发方式

Run
/reflect
or
/reflect [skill-name]
after a session where you used a skill.
Additional commands:
  • /reflect on
    - Enable automatic end-of-session reflection
  • /reflect off
    - Disable automatic reflection
  • /reflect status
    - Check if auto-reflect is enabled
在使用技能的会话结束后,运行
/reflect
/reflect [skill-name]
额外命令:
  • /reflect on
    - 启用会话结束时自动反思
  • /reflect off
    - 禁用自动反思
  • /reflect status
    - 检查自动反思是否启用

Workflow

工作流程

Step 1: Identify the Skill

步骤1:确定技能

If skill name not provided, ask:
Which skill should I analyze this session for?
- frontend-design
- code-reviewer
- [other]
如果未提供技能名称,请询问:
我应该分析本次会话中的哪个技能?
- frontend-design
- code-reviewer
- [其他]

Step 2: Analyze the Conversation

步骤2:分析对话

Look for these signals in the current conversation:
在当前对话中寻找以下信号:

Corrections (HIGH confidence):

纠正信息(高置信度):

  • User said "no", "not like that", "I meant..."
  • User explicitly corrected output
  • User asked for changes immediately after generation
  • 用户说“不”、“不是那样”、“我指的是...”
  • 用户明确纠正输出内容
  • 用户在生成内容后立即要求修改

Successes (MEDIUM confidence):

成功信号(中置信度):

  • User said "perfect", "great", "yes", "exactly"
  • User accepted output without modification
  • User built on top of the output
  • 用户说“完美”、“很棒”、“是的”、“正是如此”
  • 用户未做修改就接受了输出内容
  • 用户基于输出内容进行拓展

Edge Cases (MEDIUM confidence):

边缘情况(中置信度):

  • Questions the skill didn't anticipate
  • Scenarios requiring workarounds
  • Features user asked for that weren't covered
  • 技能未预料到的问题
  • 需要变通方案的场景
  • 用户要求但技能未覆盖的功能

Preferences (accumulate over sessions):

偏好信息(跨会话积累):

  • Repeated patterns in user choices
  • Style preferences shown implicitly
  • Tool/framework preferences
  • 用户选择中的重复模式
  • 隐含的风格偏好
  • 工具/框架偏好

Step 3: Propose Changes

步骤3:提出修改建议

Present findings using accessible colors (WCAG AA 4.5:1 contrast ratio):
┌─ Skill Reflection: [skill-name] ───────────────────┐
│                                                    │
│ Signals: X corrections, Y successes                │
│                                                    │
│ Proposed changes:                                  │
│                                                    │
│ 🔴 [HIGH] + Add constraint: "[specific constraint]"│
│ 🟡 [MED]  + Add preference: "[specific preference]"│
│ 🔵 [LOW]  ~ Note for review: "[observation]"       │
│                                                    │
│ Commit: "[skill]: [summary of changes]"            │
│                                                    │
└────────────────────────────────────────────────────┘

Apply these changes? [Y/n] or describe tweaks
使用符合WCAG AA 4.5:1对比度的易读颜色展示发现的内容:
┌─ 技能反思: [skill-name] ───────────────────┐
│                                            │
│ 信号: X 条纠正信息, Y 个成功案例            │
│                                            │
│ 建议修改:                                  │
│                                            │
│ 🔴 [高优先级] + 添加约束: "[具体约束内容]"   │
│ 🟡 [中优先级] + 添加偏好: "[具体偏好内容]"   │
│ 🔵 [低优先级] ~ 待评审备注: "[观察内容]"     │
│                                            │
│ 提交信息: "[skill]: [修改摘要]"             │
│                                            │
└────────────────────────────────────────────┘

是否应用这些修改?[Y/n] 或描述调整内容

Accessible Color Palette (use ANSI codes in terminal output):

易读调色板(终端输出中使用ANSI代码):

  • HIGH:
    \033[1;31m
    (bold red #FF6B6B - 4.5:1 on dark)
  • MED:
    \033[1;33m
    (bold yellow #FFE066 - 4.8:1 on dark)
  • LOW:
    \033[1;36m
    (bold cyan #6BC5FF - 4.6:1 on dark)
  • Reset:
    \033[0m
Avoid: pure red (#FF0000) on black, green on red (colorblind users)
  • 高优先级:
    \033[1;31m
    (粗体红色 #FF6B6B - 在深色背景上对比度4.5:1)
  • 中优先级:
    \033[1;33m
    (粗体黄色 #FFE066 - 在深色背景上对比度4.8:1)
  • 低优先级:
    \033[1;36m
    (粗体青色 #6BC5FF - 在深色背景上对比度4.6:1)
  • 重置:
    \033[0m
避免:深色背景上的纯红色(#FF0000)、红色背景上的绿色(色盲用户友好性差)

User Response Options:

用户响应选项:

  • Y
    – Apply changes, commit, and push
  • n
    – Skip this update
  • Or describe any tweaks to the proposed changes
  • Y
    – 应用修改、提交并推送
  • n
    – 跳过本次更新
  • 或描述对建议修改的调整内容

Step 4: If Approved

步骤4:如果获得批准

  1. Read the current skill file from
    .claude/skills/[skill-name]/SKILL.md
  2. Apply the changes using the Edit tool
  3. Run git commands:
    bash
    cd .claude/skills
    git add [skill-name]/SKILL.md
    git commit -m "[skill]: [change summary]"
    git push origin main
  4. Confirm: "Skill updated and pushed to GitHub"
  1. .claude/skills/[skill-name]/SKILL.md
    读取当前技能文件
  2. 使用编辑工具应用修改
  3. 运行git命令:
    bash
    cd .claude/skills
    git add [skill-name]/SKILL.md
    git commit -m "[skill]: [修改摘要]"
    git push origin main
  4. 确认:"技能已更新并推送至GitHub"

Step 5: If Declined

步骤5:如果被拒绝

Ask: "Would you like to save these observations for later review?"
If yes, append to
.claude/skills/[skill-name]/OBSERVATIONS.md
询问:"你是否希望保存这些观察结果供以后评审?"
如果是,将内容追加到
.claude/skills/[skill-name]/OBSERVATIONS.md

Toggle Commands

切换命令

/reflect on

/reflect on

Enable automatic end-of-session reflection:
  1. Create/update
    ~/.claude/reflect-skill-state.json
    with
    {"enabled": true, "updatedAt": "[timestamp]"}
  2. Confirm: "Auto-reflect enabled. Sessions will be analyzed automatically when you stop."
启用会话结束时自动反思:
  1. 创建/更新
    ~/.claude/reflect-skill-state.json
    ,内容为
    {"enabled": true, "updatedAt": "[时间戳]"}
  2. 确认:"自动反思已启用。当你结束会话时,系统将自动分析会话内容。"

/reflect off

/reflect off

Disable automatic reflection:
  1. Update
    ~/.claude/reflect-skill-state.json
    with
    {"enabled": false, "updatedAt": "[timestamp]"}
  2. Confirm: "Auto-reflect disabled. Use /reflect manually to analyze sessions."
禁用自动反思:
  1. 更新
    ~/.claude/reflect-skill-state.json
    ,内容为
    {"enabled": false, "updatedAt": "[时间戳]"}
  2. 确认:"自动反思已禁用。请手动使用/reflect命令分析会话。"

/reflect status

/reflect status

Check current status:
  1. Read
    ~/.claude/reflect-skill-state.json
  2. Report: "Auto-reflect is [enabled/disabled]" with last updated timestamp
Note: The state file is saved in the global Claude user directory (
~/.claude/
) so it persists across plugin upgrades.
检查当前状态:
  1. 读取
    ~/.claude/reflect-skill-state.json
  2. 报告:"自动反思当前[已启用/已禁用]",并显示最后更新时间戳
注意: 状态文件保存在全局Claude用户目录(
~/.claude/
)中,因此在插件升级后仍会保留。

Example Session

示例会话

User runs
/reflect frontend-design
after a UI session:
┌─ Skill Reflection: frontend-design ───────────────┐
│                                                   │
│ Signals: 2 corrections, 3 successes               │
│                                                   │
│ Proposed changes:                                 │
│                                                   │
│ 🔴 [HIGH] + Constraints/NEVER:                    │
│    "Use gradients unless explicitly requested"    │
│                                                   │
│ 🔴 [HIGH] + Color & Theme:                        │
│    "Dark backgrounds: use #000, not #1a1a1a"      │
│                                                   │
│ 🟡 [MED] + Layout:                                │
│    "Prefer CSS Grid for card layouts"             │
│                                                   │
│ Commit: "frontend-design: no gradients, #000 dark"│
│                                                   │
└───────────────────────────────────────────────────┘

Apply these changes? [Y/n] or describe tweaks
用户在UI会话结束后运行
/reflect frontend-design
┌─ 技能反思: frontend-design ───────────────┐
│                                           │
│ 信号: 2 条纠正信息, 3 个成功案例           │
│                                           │
│ 建议修改:                                 │
│                                           │
│ 🔴 [高优先级] + 约束/禁止:                 │
│    "除非明确要求,否则不要使用渐变效果"     │
│                                           │
│ 🔴 [高优先级] + 颜色与主题:                │
│    "深色背景使用#000,而非#1a1a1a"         │
│                                           │
│ 🟡 [中优先级] + 布局:                      │
│    "卡片布局优先使用CSS Grid"               │
│                                           │
│ 提交信息: "frontend-design: 禁用渐变,深色用#000"│
│                                           │
└───────────────────────────────────────────┘

是否应用这些修改?[Y/n] 或描述调整内容

Git Integration

Git集成

This skill has permission to:
  • Read skill files from
    .claude/skills/
  • Edit skill files (with user approval)
  • Run
    git add
    ,
    git commit
    ,
    git push
    in the skills directory
The skills repo should be initialized at
.claude/skills
with a remote origin.
此技能拥有以下权限:
  • .claude/skills/
    读取技能文件
  • (经用户批准后)编辑技能文件
  • 在技能目录中运行
    git add
    git commit
    git push
    命令
技能仓库应在
.claude/skills
初始化,并配置远程origin。

Important Notes

重要说明

  • Always show the exact changes before applying
  • Never modify skills without explicit user approval
  • Commit messages should be concise and descriptive
  • Push only after successful commit
  • 应用修改前务必展示具体的变更内容
  • 未经用户明确批准,不得修改技能
  • 提交信息应简洁明了
  • 仅在提交成功后推送代码