cursor-insights

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cursor Insights

Cursor Insights

本技能基于本地 Cursor Agent 会话记录,按固定流程扫描、摘要、提取特征并调用 LLM 分析,最终生成一份可交互的 HTML 使用洞察报告。
This skill is based on local Cursor Agent session records, which scans, summarizes, extracts features, and invokes LLM analysis according to a fixed process, finally generating an interactive HTML usage insight report.

处理流程

Processing Flow

1. 内容读取

1. Content Reading

  • 执行
    npx bun run ./scripts/scan.ts
    扫描 Cursor 会话数据
  • 扫描完成后,列出用户主目录下
    .agent-insights/conversations
    中的子目录(主目录:Windows 为
    %USERPROFILE%
    ,macOS/Linux 为
    ~
    ),由用户选择要分析的项目(对应一个子目录)
  • 根据所选目录,读取该目录下所有
    .md
    文件作为 Agent 对话内容
  • Execute
    npx bun run ./scripts/scan.ts
    to scan Cursor session data
  • After scanning, list the subdirectories in
    .agent-insights/conversations
    under the user's home directory (home directory:
    %USERPROFILE%
    for Windows,
    ~
    for macOS/Linux), and let the user select the project to analyze (corresponding to a subdirectory)
  • Based on the selected directory, read all
    .md
    files under that directory as Agent conversation content

2. 摘要总结

2. Summary Generation

请对 Agent 会话记录的这一部分进行摘要总结,重点关注:
1. 用户要求了什么
2. Agent 做了什么(使用了哪些工具、修改了哪些文件)
3. 遇到的摩擦或问题
4. 最终结果

保持简洁,3-5 句话。保留具体细节,如文件名、错误信息和用户反馈。

会话记录片段:
Please summarize this part of the Agent session records, focusing on:
1. What the user requested
2. What the Agent did (which tools were used, which files were modified)
3. Frictions or problems encountered
4. Final outcome

Keep it concise, 3-5 sentences. Retain specific details such as file names, error messages, and user feedback.

Session record snippet:

3. 特征提取

3. Feature Extraction

对会话内容进行结构化特征提取,必须遵守以下判定规则:
1. **goal_categories**:只统计**用户明确提出的请求**。
   - 不统计 Agent 主动进行的代码库探索或自行决定的工作
   - 仅在用户出现「你能…吗」「请…」「我需要…」「我们来…」等明确请求时计入

2. **user_satisfaction_counts**:只依据**用户明确表达的反馈**。
   - 「太棒了!」「很好!」「完美!」→ happy
   - 「谢谢」「看起来不错」「可以用了」→ satisfied
   - 「好的,现在让我们…」(无抱怨地继续)→ likely_satisfied
   - 「不对」「再试一次」→ dissatisfied
   - 「这坏了」「我放弃了」→ frustrated

3. **friction_counts**:按类型标注具体问题。
   - misunderstood_request:Agent 理解错误
   - wrong_approach:目标正确,但解法/思路错误
   - buggy_code:代码无法正常运行
   - user_rejected_action:用户拒绝或中止了某次工具调用
   - excessive_changes:过度设计或改动范围过大

4. 若会话极短或仅为热身,将目标类别标为 **warmup_minimal**。

会话内容:
<会话记录插入此处>

仅返回符合以下 schema 的有效 JSON 对象:
{
  "underlying_goal": "用户根本上想要实现的目标",
  "goal_categories": {"类别名": 数量, ...},
  "outcome": "fully_achieved | mostly_achieved | 
              partially_achieved | not_achieved | 
              unclear_from_transcript",
  "user_satisfaction_counts": {"级别": 数量, ...},
  "agent_helpfulness": "unhelpful | slightly_helpful | moderately_helpful | very_helpful | essential",
  "session_type": "single_task | multi_task | iterative_refinement | exploration | quick_question",
  "friction_counts": {"摩擦类型": 数量, ...},
  "friction_detail": "一句话描述摩擦点,或为空",
  "primary_success": "none | fast_accurate_search | correct_code_edits | good_explanations | proactive_help | multi_file_changes | good_debugging",
  "brief_summary": "一句话:用户想要什么以及是否达成"
}
(以上为特征提取的提示词内容;执行时将「<会话记录插入此处>」替换为实际会话文本。)
Perform structured feature extraction on session content, must comply with the following judgment rules:
1. **goal_categories**: Only count **explicit requests made by the user**.
   - Do not count codebase exploration proactively conducted by the Agent or work decided on its own
   - Only count when the user makes explicit requests such as "Can you...?", "Please...", "I need...", "Let's...", etc.

2. **user_satisfaction_counts**: Only based on **explicit feedback expressed by the user**.
   - "Great!" "Nice!" "Perfect!" → happy
   - "Thank you" "Looks good" "It works now" → satisfied
   - "Okay, now let's..." (continue without complaint) → likely_satisfied
   - "That's wrong" "Try again" → dissatisfied
   - "It's broken" "I give up" → frustrated

3. **friction_counts**: Mark specific problems by type.
   - misunderstood_request: Agent misunderstood the request
   - wrong_approach: Correct goal but wrong solution/approach
   - buggy_code: Code cannot run normally
   - user_rejected_action: User rejected or aborted a tool call
   - excessive_changes: Over-design or excessive scope of changes

4. If the session is extremely short or only for warm-up, mark the goal category as **warmup_minimal**.

Session content:
<Session record inserted here>

Only return a valid JSON object that conforms to the following schema:
{
  "underlying_goal": "The underlying goal the user wants to achieve",
  "goal_categories": {"category_name": count, ...},
  "outcome": "fully_achieved | mostly_achieved | 
              partially_achieved | not_achieved | 
              unclear_from_transcript",
  "user_satisfaction_counts": {"level": count, ...},
  "agent_helpfulness": "unhelpful | slightly_helpful | moderately_helpful | very_helpful | essential",
  "session_type": "single_task | multi_task | iterative_refinement | exploration | quick_question",
  "friction_counts": {"friction_type": count, ...},
  "friction_detail": "One sentence describing the friction point, or empty",
  "primary_success": "none | fast_accurate_search | correct_code_edits | good_explanations | proactive_help | multi_file_changes | good_debugging",
  "brief_summary": "One sentence: what the user wanted and whether it was achieved"
}

目标类别

Goal Categories

类别描述
debug_investigate调试/调查
implement_feature实现功能
fix_bug修复 Bug
write_script_tool编写脚本/工具
refactor_code重构代码
configure_system配置系统
create_pr_commit创建 PR/提交
analyze_data分析数据
understand_codebase理解代码库
write_tests编写测试
write_docs编写文档
deploy_infra部署/基础设施
warmup_minimal缓存预热(最小会话)
CategoryDescription
debug_investigateDebugging/Investigation
implement_featureFeature Implementation
fix_bugBug Fixing
write_script_toolScript/Tool Writing
refactor_codeCode Refactoring
configure_systemSystem Configuration
create_pr_commitPR/Commit Creation
analyze_dataData Analysis
understand_codebaseCodebase Understanding
write_testsTest Writing
write_docsDocumentation Writing
deploy_infraDeployment/Infrastructure
warmup_minimalWarm-up (Minimal Session)

Agent 有用程度级别

Agent Helpfulness Levels

unhelpful → slightly_helpful → moderately_helpful → very_helpful → essential
unhelpful → slightly_helpful → moderately_helpful → very_helpful → essential

会话类型

Session Types

类型描述
single_task单一聚焦任务
multi_task一个会话中的多个任务
iterative_refinement来回迭代优化
exploration探索/理解代码库
quick_question简短问答
TypeDescription
single_taskSingle focused task
multi_taskMultiple tasks in one session
iterative_refinementIterative optimization
explorationCodebase exploration/understanding
quick_questionShort Q&A

主要成功类别

Primary Success Categories

类别描述
none没有显著成功
fast_accurate_search快速准确的代码搜索
correct_code_edits准确的代码修改
good_explanations清晰的解释
proactive_help超出要求的主动帮助
multi_file_changes成功协调多文件编辑
good_debugging有效的调试
CategoryDescription
noneNo significant success
fast_accurate_searchFast and accurate code search
correct_code_editsAccurate code modifications
good_explanationsClear explanations
proactive_helpProactive help beyond requirements
multi_file_changesSuccessful coordination of multi-file edits
good_debuggingEffective debugging

4. 内容分析

4. Content Analysis

在完成所有会话的摘要与特征提取后,将汇总数据传入多组专项分析提示,分别得到项目领域、交互风格、有效之处、摩擦、建议、未来展望和趣味结尾等结构化结果。
After completing the summary and feature extraction of all sessions, pass the aggregated data into multiple specialized analysis prompts to obtain structured results such as project domains, interaction styles, effective aspects, frictions, suggestions, future outlooks, and fun endings respectively.

传入分析提示的数据

Data Passed to Analysis Prompts

每组分析提示均接收同一份汇总统计数据:
json
{
  "sessions": "<总会话数>",
  "analyzed": "<已分析的会话数>",
  "date_range": { "start": "...", "end": "..." },
  "messages": "<总消息数>",
  "hours": "<总时长(小时)>",
  "commits": "<git 提交数>",
  "top_tools": ["使用量前8的工具"],
  "top_goals": ["前8个目标类别"],
  "outcomes": { "结果分布" },
  "satisfaction": { "满意度分布" },
  "friction": { "摩擦类型统计" },
  "success": { "成功类别统计" },
  "languages": { "语言使用统计" }
}
以及以下文本材料:
  • 会话摘要:最多 50 条简短摘要
  • 摩擦详情:从特征中提取的最多 20 条
  • 用户对 Agent 的指示:用户重复给出的最多 15 条
Each analysis prompt receives the same aggregated statistical data:
json
{
  "sessions": "<Total number of sessions>",
  "analyzed": "<Number of analyzed sessions>",
  "date_range": { "start": "...", "end": "..." },
  "messages": "<Total number of messages>",
  "hours": "<Total duration (hours)>",
  "commits": "<Number of git commits>",
  "top_tools": ["Top 8 most used tools"],
  "top_goals": ["Top 8 goal categories"],
  "outcomes": { "Outcome distribution" },
  "satisfaction": { "Satisfaction distribution" },
  "friction": { "Friction type statistics" },
  "success": { "Success category statistics" },
  "languages": { "Language usage statistics" }
}
As well as the following text materials:
  • Session Summaries: Up to 50 brief summaries
  • Friction Details: Up to 20 extracted from features
  • User Instructions to Agent: Up to 15 repeated instructions from the user

4.1 项目领域分析

4.1 Project Domain Analysis

分析上述 Agent 使用数据,归纳出 4–5 个项目领域。
仅返回有效 JSON,跳过内部 CC 操作。

{
  "areas": [
    {
      "name": "领域名称",
      "session_count": N,
      "description": "2-3 句话,描述工作内容以及如何使用 Agent。"
    }
  ]
}

每个领域包含:name、session_count、description(2–3 句话,描述工作内容及如何使用 Agent)。
Analyze the above Agent usage data and summarize 4–5 project domains.
Only return valid JSON, skip internal CC operations.

{
  "areas": [
    {
      "name": "Domain name",
      "session_count": N,
      "description": "2-3 sentences describing the work content and how the Agent is used."
    }
  ]
}

Each domain includes: name, session_count, description (2–3 sentences describing work content and Agent usage).

4.2 交互风格分析

4.2 Interaction Style Analysis

分析上述 Agent 使用数据,归纳用户与 Agent 的交互风格。
仅返回有效 JSON:

{
  "style": "简要描述其风格(2-3 句话)",
  "strengths": ["2-3 件做得好的事"],
  "patterns": ["2-3 个值得注意的工作模式"]
}
Analyze the above Agent usage data and summarize the interaction style between the user and the Agent.
Only return valid JSON:

{
  "style": "Brief description of the style (2-3 sentences)",
  "strengths": ["2-3 things done well"],
  "patterns": ["2-3 notable work patterns"]
}

4.3 有效之处分析

4.3 Effective Aspects Analysis

分析上述 Agent 使用数据,识别运作良好的部分。
仅返回有效 JSON,包含 2–3 个「重大成果」,需具体并引用实际会话:

{
  "big_wins": [
    {
      "title": "简短标题(4-6 个字)",
      "description": "2-3 句话描述一项令人印象深刻的成就"
    }
  ]
}

每项包含 title(4–6 字)、description(2–3 句话)。
Analyze the above Agent usage data and identify well-functioning parts.
Only return valid JSON, including 2–3 "major achievements" with specific references to actual sessions:

{
  "big_wins": [
    {
      "title": "Short title (4-6 words)",
      "description": "2-3 sentences describing an impressive achievement"
    }
  ]
}

Each includes title (4–6 words), description (2–3 sentences).

4.4 摩擦分析

4.4 Friction Analysis

分析上述 Agent 使用数据,归纳摩擦规律。
仅返回有效 JSON,包含 2–3 个摩擦点,诚实且有建设性:

{
  "friction_points": [
    {
      "category": "类别名称",
      "frequency": "rare | occasional | frequent",
      "description": "2-3 句话描述该规律"
    }
  ]
}

每项包含 category、frequency(rare | occasional | frequent)、description(2–3 句话)。
Analyze the above Agent usage data and summarize friction patterns.
Only return valid JSON, including 2–3 friction points, honest and constructive:

{
  "friction_points": [
    {
      "category": "Category name",
      "frequency": "rare | occasional | frequent",
      "description": "2-3 sentences describing the pattern"
    }
  ]
}

Each includes category, frequency (rare | occasional | frequent), description (2–3 sentences).

4.5 建议分析

4.5 Suggestion Analysis

分析上述 Agent 使用数据并生成可执行建议。
仅返回有效 JSON,features_to_try 与 usage_patterns 各 2–3 条,需针对其实际使用模式:

{
  "features_to_try": [
    {
      "feature": "功能名称",
      "benefit": "有什么帮助",
      "example": "来自其使用记录的具体示例"
    }
  ],
  "usage_patterns": [
    {
      "pattern": "模式名称",
      "benefit": "为什么有帮助",
      "example": "如何应用"
    }
  ]
}

各包含 2-3 条;建议需具体、可操作。
Analyze the above Agent usage data and generate executable suggestions.
Only return valid JSON, with 2–3 each for features_to_try and usage_patterns, tailored to actual usage patterns:

{
  "features_to_try": [
    {
      "feature": "Feature name",
      "benefit": "What help it provides",
      "example": "Specific example from usage records"
    }
  ],
  "usage_patterns": [
    {
      "pattern": "Pattern name",
      "benefit": "Why it helps",
      "example": "How to apply it"
    }
  ]
}

2-3 items each; suggestions must be specific and actionable.

4.6 未来展望分析

4.6 Future Outlook Analysis

分析上述 Agent 使用数据,提炼未来 3–6 个月可尝试的机会。
仅返回有效 JSON,包含 3 个机会,可涉及自主工作流、并行代理、对照测试迭代等:

{
  "intro": "关于 AI 辅助开发演进的 1 句话",
  "opportunities": [
    {
      "title": "简短标题(4-8 个字)",
      "whats_possible": "2-3 句话,关于自主工作流的宏大愿景",
      "how_to_try": "1-2 句话,提及相关工具",
      "copyable_prompt": "可直接使用的详细提示词"
    }
  ]
}

每项包含 intro(1 句话)、opportunities(title、whats_possible、how_to_try、copyable_prompt)。可大胆想象。
Analyze the above Agent usage data and extract opportunities to try in the next 3–6 months.
Only return valid JSON, including 3 opportunities, which can involve autonomous workflows, parallel agents, iterative controlled testing, etc.:

{
  "intro": "1 sentence about the evolution of AI-assisted development",
  "opportunities": [
    {
      "title": "Short title (4-8 words)",
      "whats_possible": "2-3 sentences about the grand vision of autonomous workflows",
      "how_to_try": "1-2 sentences mentioning relevant tools",
      "copyable_prompt": "Detailed prompt that can be used directly"
    }
  ]
}

Each includes intro (1 sentence), opportunities (title, whats_possible, how_to_try, copyable_prompt). Feel free to think boldly.

4.7 趣味结尾(难忘瞬间)

4.7 Fun Ending (Memorable Moment)

分析上述 Agent 使用数据,从会话摘要中找出一个难忘的瞬间(有人情味、有趣或出人意料,而非统计数字)。
仅返回有效 JSON:

{
  "headline": "来自记录的令人难忘的定性瞬间——不是统计数字。要有人情味、有趣或出人意料。",
  "detail": "该瞬间发生的时间/背景简述"
}

从会话摘要中选取真正有趣或令人惊喜的内容。

Analyze the above Agent usage data and find a memorable moment from the session summaries (human, funny or unexpected, not statistical figures).
Only return valid JSON:

{
  "headline": "A memorable qualitative moment from the records—not statistics. It should be human, funny or unexpected.",
  "detail": "Brief description of when/where this moment happened"
}

Select truly funny or surprising content from the session summaries.

5. 生成概览

5. Generate Overview

最后进行一次 LLM 调用,将前述所有洞察汇总为「一览概要」执行摘要。该提示接收所有已生成的洞察结果作为上下文。
Finally, make one LLM call to aggregate all the aforementioned insights into an "At a Glance" executive summary. This prompt receives all generated insights as context.

总览提示词

Overview Prompt

你正在为 Agent 用户的使用洞察报告撰写「一览概要」。
目标:帮助用户理解自己的使用情况,以及如何随模型演进更好地使用 Agent。

按以下 4 部分撰写:

1. **哪些有效**:用户与 Agent 的交互风格有何特点、做了哪些有影响力的事。可含 1–2 个细节,但以高层次概述为主(用户可能已不记得具体会话)。避免空洞吹捧,也不要罗列工具调用。

2. **哪些在阻碍你**:分两类——(a)Agent 侧:误解、错误方法、Bug;(b)用户侧:上下文不足、环境问题等。尽量提炼跨项目的共性,诚实但有建设性。

3. **可尝试的快速改进**:从下方示例中选取可立即尝试的 Agent 功能或工作流技巧。(避免「让 Agent 先确认再行动」「多写一点上下文」等吸引力较低的建议。)

4. **为更强大模型准备的宏大工作流**:未来 3–6 个月模型能力提升后,用户可提前准备什么?哪些目前难以实现的工作流将变为可能?从下方对应章节汲取灵感。

每部分 2–3 句,不宜过长。不要引用会话中的具体数字或类别名。语气为辅导式。

仅返回有效 JSON:

{
  "whats_working": "(参考上方说明)",
  "whats_hindering": "(参考上方说明)",
  "quick_wins": "(参考上方说明)",
  "ambitious_workflows": "(参考上方说明)"
}

会话数据:
<汇总统计 JSON>
You are writing the "At a Glance" executive summary for an Agent user's usage insight report.
Goal: Help the user understand their usage and how to better use the Agent as models evolve.

Write in the following 4 sections:

1. **What's Working**: What are the characteristics of the user's interaction style with the Agent, and what impactful things have they done? Can include 1–2 details but focus on high-level overview (the user may not remember specific sessions). Avoid empty flattery and do not list tool calls.

2. **What's Hindering You**: Divide into two categories—(a) Agent side: misunderstanding, wrong approach, bugs; (b) User side: insufficient context, environment issues, etc. Try to extract cross-project commonalities, honest but constructive.

3. **Quick Improvements to Try**: Select Agent features or workflow tips that can be tried immediately from the examples below. (Avoid less attractive suggestions like "Let the Agent confirm before acting" or "Write more context".)

4. **Ambitious Workflows for More Powerful Models**: What can the user prepare in advance as model capabilities improve in the next 3–6 months? Which currently difficult workflows will become possible? Draw inspiration from the corresponding section below.

2–3 sentences per section, not too long. Do not quote specific numbers or category names from the sessions. The tone should be coaching.

Only return valid JSON:

{
  "whats_working": "(Refer to the above instructions)",
  "whats_hindering": "(Refer to the above instructions)",
  "quick_wins": "(Refer to the above instructions)",
  "ambitious_workflows": "(Refer to the above instructions)"
}

Session data:
<Aggregated statistical JSON>

项目领域(用户工作内容)

Project Domains (User's Work Content)

<project_areas 结果>
<project_areas results>

重大成果(令人印象深刻的成就)

Major Achievements (Impressive Achievements)

<what_works 结果>
<what_works results>

摩擦类别(哪些地方出了问题)

Friction Categories (What Went Wrong)

<friction_analysis 结果>
<friction_analysis results>

可尝试的功能

Features to Try

<suggestions.features_to_try 结果>
<suggestions.features_to_try results>

待采纳的使用模式

Usage Patterns to Adopt

<suggestions.usage_patterns 结果>
<suggestions.usage_patterns results>

未来展望(为更强大模型准备的宏大工作流)

Future Outlook (Ambitious Workflows for More Powerful Models)

<on_the_horizon 结果>

---
<on_the_horizon results>

---

6. 生成报告

6. Generate Report

将前述所有汇总数据与 LLM 洞察按模板渲染为可交互的 HTML 报告。模板路径:
./temp/report_temp.html
输出路径:用户主目录下
.agent-insights/reports/agent-insights-report-YYYY-MM-DD.html
(主目录:Windows 为
%USERPROFILE%
,macOS/Linux 为
~
)。
Render all the aforementioned aggregated data and LLM insights into an interactive HTML report using a template. Template path:
./temp/report_temp.html
.
Output path:
.agent-insights/reports/agent-insights-report-YYYY-MM-DD.html
under the user's home directory (home directory:
%USERPROFILE%
for Windows,
~
for macOS/Linux).

统计仪表盘

Statistics Dashboard

  • 总会话数、消息数、时长、Token 数
  • Git 提交数、推送数
  • Total sessions, messages, duration, tokens
  • Git commits, pushes

报告章节

Report Sections

  1. 一览概要:执行摘要
  2. 项目领域:用户在做什么
  3. 交互风格:用户如何与 Agent 协作
  4. 有效之处:重大成果
  5. 摩擦点:出了哪些问题
  6. 建议:可尝试的功能与可采纳的模式
  7. 未来展望:后续可探索的机会
  8. 趣味结尾:一个难忘的瞬间

  1. At a Glance: Executive summary
  2. Project Domains: What the user is working on
  3. Interaction Style: How the user collaborates with the Agent
  4. What's Working: Major achievements
  5. Friction Points: What went wrong
  6. Suggestions: Features to try and usage patterns to adopt
  7. Future Outlook: Opportunities to explore next
  8. Fun Ending: A memorable moment