mcpField
A
analyze

analyze

github.com/bntvllnt生产力1762 次安装26 周前更新
代码仓库

关于 analyze

Universal Analyzer 是面向任意主题、文件、想法或决策的多角度分析技能,适用于需要提炼要点和制定改进计划的人。它提供快速、标准和深入模式,并可并行调度多个视角进行分析。

主要功能

  1. 01快速、标准和深入分析模式
  2. 02按领域选择多个分析视角
  3. 03并行调度子 Agent
  4. 04读取文件与文件夹内容
  5. 05可选的 TypeScript 结构分析

适用场景

  1. 01提炼文档或主题的关键要点
  2. 02从多角度评估决策中的风险与缺口
  3. 03为软件项目制定改进路线图
  4. 04用第一性原理检验假设

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/bntvllnt/agent-skills --skill analyze

安装后在 Claude Code 中输入/analyze确认已加载。

附带文件EXAMPLE.mdREADME.md

详细介绍

通用分析器

一个独立的技能,可从多个角度分析任何主题、文件、想法或决策。

适用于:

  • 需要从任何内容中提取关键要点
  • 希望从多个角度分析差距/风险(4-10 位专家)
  • 需要可执行计划和改进机会
  • 希望使用快速摘要或深度分析模式
  • 需要一份挑战既有假设的第一性原理简报

触发词:“analyze”“key points”“what's important”“improve this”“review”“examine”“assess”“analysis”“deep analysis”“run deep analysis”“brief”“challenge assumptions”“first principles”

Agent 能力

能力用途必需回退方案
文件读取加载目标文件/文件夹是—
子 Agent 调度并行进行多角度分析建议在主线程中依次执行
代码库智能分析(npx codebase-intelligence)对 TS/TSX 软件领域进行结构分析否仅根据文件内容进行推理

此技能无需 CLI 工具即可完整运行。代码库智能分析仅作为软件领域的可选增强功能。


目录

  1. 快速入门
  2. 分析模式
  3. 执行流程
  4. 输出格式
  5. 视角库
  6. 思考框架
  7. 第一性原理分析
  8. 示例

快速入门

# Quick analysis (fast key points)
analyze quick "our pricing strategy"
analyze brief src/api/auth.ts

# Standard analysis (default)
analyze "SaaS product for developers"
analyze "should I accept this job offer"
analyze package.json

# Deep analysis (comprehensive)
analyze deep "company rebrand strategy"
analyze thorough "migration to microservices"

分析模式

模式触发词Agent 数量耗时输出
快速“quick”“fast”“brief”“summary”0-130-60s关键要点 + 行动项
标准(默认)4-62-4min多角度分析 + 路线图
深度“deep”“thorough”“comprehensive”6-105-8min完整综合分析 + 详细计划

执行流程

阶段 0:检测
  1. 模式:根据关键词检测模式(quick/standard/deep)
  2. 领域:根据内容/关键词自动检测
  3. 目标:如果提供了路径,则加载文件/文件夹内容
  4. TypeScript 检测:如果目标是代码路径且存在 tsconfig.json:
    • 检测条件:存在 tsconfig.json + npx codebase-intelligence --help 执行成功
    • 如需完整 CLI 参考,请获取 https://raw.githubusercontent.com/bntvllnt/codebase-intelligence/main/llms.txt
    • 如果可用:在阶段 1 收集结构数据
    • 如果不可用:仅通过读取文件来收集上下文
阶段 1:收集上下文
  • 文件/文件夹路径 → 读取文件
  • 软件领域 + TypeScript + CI 可用 → 在读取文件的基础上补充:
    • npx codebase-intelligence overview --json <path> → 项目结构快照
    • npx codebase-intelligence modules --json <path> → 模块边界和跨模块依赖
    • npx codebase-intelligence groups --json <path> → 目录级汇总 将这些内容作为结构化上下文,与文件内容一并提供。如果 CI 不可用:仅读取文件。
  • 主题/想法 → 使用提供的上下文
  • 不熟悉的领域 → 可选的网络搜索
阶段 2:分析
快速模式

由主 Agent 直接分析,不使用子 Agent

标准模式
  1. 根据领域选择 4-6 个视角
  2. 并行启动所有视角(使用单个消息块)
  3. 每个 Agent 回答 7 个核心问题
深度模式
  1. 根据领域选择 6-10 个视角
  2. 并行启动所有视角(使用单个消息块)
  3. 每个 Agent 回答 12 个问题(7 个核心问题 + 5 个深度问题)
软件领域增强(提供 TypeScript + CI)

在软件领域 Agent 的提示词中包含预计算的结构化数据:

  • npx codebase-intelligence hotspots --json --metric complexity --limit 20 → 复杂度/变更热点
  • npx codebase-intelligence forces --json → 各模块的内聚/耦合张力
  • npx codebase-intelligence dead-exports --json --limit 20 → 未使用导出分析
  • npx codebase-intelligence clusters --json → 依赖社区集群

Agent 会将这些数据作为结构化上下文,与目标内容一同接收。这些数据可补充分析,但不能取代独立推理。如果 CI 不可用:Agent 仅根据文件内容进行分析。

第 3 阶段:综合

所有 Agent 完成后:

  1. 汇总失败假设 → 按 Critical→High→Med→Low 优先级排序
  2. 提取 TOP 10 个要点 → 按共识程度排序
  3. 识别缺口 → Critical/High/Medium/Low
  4. 生成包含依赖关系的可执行路线图

输出格式

快速模式
# Quick Analysis: [Target]

**Mode**: Quick | **Domain**: [Domain] | **Date**: [Date]

## The Essence
[1-2 sentences: What this ACTUALLY is at its core, stripped of complexity]

## Verified Facts
- [Fact 1] — evidence: `path/file:line` or [source]
- [Fact 2] — evidence: ...
- [Fact 3] — evidence: ...

## Key Points (Top 5-10)
1. **[Most Important]**: [Explanation]
2. **[Second]**: [Explanation]
...

## Assumptions to Challenge

| Assumption | Evidence For | Evidence Against | Verdict |
|------------|-------------|------------------|---------|
| [Assumed thing] | [If any] | [If any] | Validate/Keep/Discard |

## What You Haven't Considered

1. **[Critical Item]**: [Why this matters, what to do about it]
2. **[Hidden Risk/Opportunity]**: [Explanation]
3. **[Simpler Alternative?]**: [If exists, describe it]

## The Real Question
[Reframe what the user should actually be asking about this]

## Quick Actions (Top 3-5)
- [ ] [Action 1] - [Why/Impact]
- [ ] [Action 2] - [Why/Impact]
- [ ] [Action 3] - [Why/Impact]

## Critical Risk to Watch
[The one thing that could derail this]
标准模式
# Analysis: [Target]

**Mode**: Standard | **Domain**: [Domain] | **Perspectives**: [Count]
**Date**: [Date] | **Hypotheses**: [Count] total

## The Essence
[1-2 sentences: What this ACTUALLY is at its core, stripped of complexity]

## Executive Summary
[2-3 sentences capturing most critical findings]

## First-Principles Analysis

### Verified Facts
- [Fact 1] — evidence: `path/file:line` or [source] — confidence: High/Medium/Low
- [Fact 2] — evidence: ... — confidence: ...

### Assumptions to Challenge

| Assumption | Evidence For | Evidence Against | Verdict |
|------------|-------------|------------------|---------|
| [Assumed thing] | [If any] | [If any] | Validate/Keep/Discard |

### What You Haven't Considered

1. **[Critical Item]**: [Why this matters, what to do about it]
2. **[Hidden Risk/Opportunity]**: [Explanation]
3. **[Simpler Alternative?]**: [If exists, describe it]
4. **[Downstream Impact]**: [What this affects that wasn't mentioned]

### The Real Question
[Reframe what the user should actually be asking about this]

## Failure Hypotheses (Aggregated)

| ID | Type | IF (Trigger) | THEN (Failure) | BECAUSE | Sev | Mitigation |
|----|------|--------------|----------------|---------|-----|------------|
| S001 | Security | ... | ... | ... | Crit | ... |
| M001 | Misuse | ... | ... | ... | High | ... |

### Critical Mitigations Required
- [ ] {mitigation} ← Addresses: S001, M001

## Key Points (Ranked by Importance)

### Consensus Points (Flagged by 3+ perspectives)
1. **[Point]** - [Why important] (Flagged by: [Perspectives])

### Important Points
2. **[Point]** - [Explanation]

### Divergent Views
- **[Topic]**: [Perspective A] sees X, [Perspective B] sees Y
  - *Implication*: [What this tension means]

## Gap Analysis

### Critical Gaps (Action Required)
| Gap | Flagged By | Impact | Suggested Action |
|-----|------------|--------|------------------|
| ... | ... | High | ... |

### High Priority Gaps
[Grouped by theme]

## Improvement Opportunities

### Top 5 Improvements
1. **[Improvement]**: [Details] - Expected Impact: [High/Medium/Low]

## Action Plan & Roadmap

### Immediate Actions (This Week)
| Action | Owner | Dependencies | Success Criteria |
|--------|-------|--------------|------------------|
| ... | [TBD] | None | ... |

### Short-term (1-2 Weeks)
| Action | Dependencies | Resources Needed | Outcome |
|--------|--------------|------------------|---------|
| ... | Immediate #1 | ... | ... |

## Cross-cutting Concerns
[Issues flagged by 3+ perspectives]
深度模式

深度模式在标准格式基础上增加:

  • 每个 Agent 额外提出 5 个问题(共 12 个)
  • 中期(1 个月)和长期(3 个月以上)路线图部分
  • 依赖关系图可视化
  • 风险缓解表
  • 更详细的失败假设

视角库

领域检测

分析内容/关键词,自动检测领域:

领域触发关键词示例目标
business初创公司、商业、市场、收入"coffee subscription", business-plan.md
product产品、功能、用户、MVP"habit tracking app", roadmap.md
softwareAPI、代码、函数、类、技术src/auth, package.json
process工作流、流程、SOP、运营"hiring workflow", "incident response"
document文档、文章、提案、报告"resume", proposal.docx
research研究、调查、假设、数据"hypothesis: remote work"
creative设计、艺术、品牌、视觉"rebrand", logo-designs/
personal决策、"我是否应该"、职业、生涯"moving to Austin", "career change"
legal合同、法律、政策、条款"employment contract"
financial预算、投资、成本、ROI"Q4 budget", "pricing strategy"
marketing活动、营销、销售、品牌"email campaign", "launch strategy"
event活动、会议、发布"product launch", "conference plan"
education课程、课程体系、教学"bootcamp curriculum"
general(未匹配任何领域时的回退项)任何一般主题
各领域的视角角色
商业领域
  1. 初创公司创始人 - 可行性、增长、可扩展性
  2. 投资者 - ROI、风险、市场规模
  3. CFO - 单位经济效益、资金消耗率、利润率
  4. 客户 - 价值主张、付费意愿
  5. 竞争对手 - 差异化、竞争壁垒
  6. 市场分析师 - TAM、趋势、时机
产品领域
  1. 产品经理 - 用户需求、路线图、优先级排序
  2. 设计师(UX) - 易用性、用户流程、无障碍性
  3. 客户 - 实际用例、痛点
  4. QA 工程师 - 边界情况、错误状态
  5. 数据分析师 - 指标、成功标准
  6. 支持负责人 - 维护负担、用户困惑
软件领域
  1. 安全工程师 - 漏洞、攻击向量
  2. DevOps - 部署、监控、可靠性
  3. 架构师 - 设计模式、可扩展性、技术债务
  4. QA 工程师 - 测试覆盖率、边界情况
  5. 性能工程师 - 瓶颈、资源使用情况
  6. 技术负责人 - 可维护性、团队交付速度
流程领域
  1. 运营人员 - 日常执行、摩擦点
  2. 经理 - 效率、瓶颈、指标
  3. 员工 - 体验、清晰度、痛点
  4. 审计员 - 合规性、文档、风险
  5. 改进专家 - 浪费、优化
个人领域
  1. 未来的你(1 年后) - 长期影响
  2. 未来的你(5 年后) - 职业发展轨迹
  3. 怀疑者 - 风险、缺点、失败模式
  4. 支持者 - 优势、机遇
  5. 财务顾问 - 财务影响
  6. 人生教练 - 价值观契合度、满足感
通用领域(备用)
  1. 分析师 - 事实、数据、模式
  2. 批评者 - 弱点、风险、差距
  3. 倡导者 - 优势、机遇
  4. 务实者 - 可行性、资源、时间安排
  5. 战略家 - 长期影响、替代方案
  6. 唱反调者 - 未考虑到的缺点
每个 Agent 的提示词模板

标准模式(7 个问题):

You are a [Role]. Analyze:
TARGET: [content]

Answer these 7 questions:
1. KEY POINTS: 3-5 most important elements?
2. CORE INSIGHT: Single most critical thing?
3. GAPS: What's missing or incomplete?
4. RISKS: What could go wrong?
5. ASSUMPTIONS: What needs validation?
6. IMPROVEMENTS: Top 3 ways to improve?
7. BLIND SPOTS: What isn't being considered?

FAILURE HYPOTHESES: For each risk/gap:
| ID | IF (Trigger) | THEN (Failure) | BECAUSE | Severity | Mitigation |

Include MISUSE + ADVERSARIAL hypotheses.
Rate findings: Critical/High/Medium/Low

深度模式(12 个问题 = 7 个核心问题 + 5 个附加问题):

  1. 依赖项:成功取决于什么?
  2. 替代方案:还应考虑哪些其他方法?
  3. 时间安排风险:什么可能导致延误或失败?
  4. 资源缺口:要顺利执行,还缺少什么?
  5. 成功指标:如何衡量成功?

思考框架

UltraThink 循环
THINK → CHECKLIST → PLAN → EXECUTE → VALIDATE → LEARN
阶段 0:思考

根据任务类型选择思考模型:

模型适用场景模式
CoT(思维链)线性、顺序任务逐步推理
ToT(思维树)存在多条有效路径、需要做决策评估各分支,选出最佳方案
Reflexion从失败中学习、重试逻辑分析错误 → 调整 → 重试
Decomposition(分解)复杂任务、并行工作拆分为多个子问题

**用于分析:**标准/深度模式使用 ToT(多视角评估),快速模式使用 CoT

阶段 1:检查清单
  • 已检测模式(快速/标准/深度)[阻塞项]
  • 已识别领域 [阻塞项]
  • 可以访问目标内容 [阻塞项]
  • 已选择视角 [阻塞项]
  • 已并行分派 Agent [阻塞项]
  • 所有 Agent 均已完成 [阻塞项]
  • 综合分析已完成 [建议项]
阶段 2:规划

用于标准/深度模式:

1. Detect mode from keywords
2. Detect domain from content
3. Select N perspectives (4-6 for standard, 6-10 for deep)
4. Launch all agents in ONE message block
5. Wait for completion
6. Synthesize findings
7. Generate output
阶段 3:执行

执行计划并跟踪进度。失败时 → 触发 Reflexion(最多重试 2 次)

阶段 4:验证
  • 所有 Agent 都返回了发现结果?✓
  • 是否识别出跨领域问题?✓
  • 是否生成了可执行的路线图?✓
阶段 5:学习

记录模式,以便持续改进

自我纠正指南
问题检查项修复方法升级条件
分析肤浅是否自动检测了领域?添加具体视角重试 2 次后仍然肤浅
模式不匹配用户关键词?请求澄清Agent 数量不匹配
综合分析薄弱所有 Agent 是否已完成?重新运行失败的 Agent少于 3 个视角有用
领域错误关键词是否含糊?明确询问用户多个领域同样合理

最大迭代次数:2 | 升级方式:请用户指定领域/视角


第一性原理分析

理念:不要只做总结——应拆解至基本原理,揭示哪些是真实情况、哪些只是假设,并指出用户尚未考虑的事项。用户必须始终获得数据,以便自行决策。

A. 已验证事实(与假设分开)
  • 只报告能够通过证据验证的内容
  • 包含来源:path/file:line 或 [URL]
  • 标注置信度:高(已验证)/ 中(推断得出)/ 低(已陈述但未经验证)
B. 第一性原理拆解

对找到的所有内容提出以下问题:

1. 质疑假设
  • 有哪些假设尚未验证?
  • 这项约束是真实存在的,还是沿袭了过去的决策?
  • 如果 [assumption] 不成立,会有什么变化?
2. 拆解至基本原理
  • 要让这项工作奏效,必须满足什么条件?
  • 实际依赖项是什么(而不只是声称的依赖项)?
  • 不可再简化的核心是什么?
3. 系统思维
  • 这还会影响什么?(上游/下游)
  • 如果失败,影响范围有多大?
  • 有哪些事项在争夺相同的资源?
4. 根因与症状
  • 当前状态是在解决根因,还是在掩盖症状?
  • 为什么它会以当前形式存在?
  • 它最初要解决什么问题?
C. 需要质疑的假设(必需)

每次分析都必须包含此表:

假设支持证据反对证据结论
[假定的事项][如有][如有]验证/保留/舍弃
D. 你尚未考虑的方面(必需,2-4 项)

指出用户可能尚未考虑的事项:

类别需要关注的方面
未经验证的假设未经证据支持却被视为事实的事项
隐藏依赖此方案所依赖的不明显因素
下游影响如果此方案发生变化,哪些内容会出问题
更简单的替代方案有没有简单 10 倍的方案?
边缘情况哪些输入/状态会导致问题?
技术债务日后会造成成本的权宜之计
缺失内容明显缺少的内容是什么?
E. 真正的问题

重新梳理用户实际应该提出的问题。用户表面上提出的问题往往并非正确的问题。


示例

示例 1:快速模式
Input: analyze quick "our pricing strategy"

Output:
# Quick Analysis: Pricing Strategy

**Mode**: Quick | **Domain**: Business | **Date**: 2026-01-28

## The Essence
A business decision about how to extract value from customers, constrained by market dynamics and competitive positioning.

## Verified Facts
- (Would include actual facts from provided content)

## Key Points
1. **Pricing = value capture, not cost recovery**: Price based on customer willingness to pay, not internal costs
2. **Anchor matters**: First price seen shapes all subsequent evaluations
...

## Assumptions to Challenge
| Assumption | Evidence For | Evidence Against | Verdict |
|------------|-------------|------------------|---------|
| "Customers will pay more if we add features" | Common belief | Often false - bloat reduces WTP | Validate with tests |

## What You Haven't Considered
1. **Price as a signal**: Low price may signal low quality, harming conversion
2. **Competitive response**: Price changes trigger competitor reactions
3. **Simplicity premium**: Simpler pricing often outperforms complex tiers

## The Real Question
Not "what price should we charge" but "what's the maximum value customers perceive, and how do we capture 30-50% of it?"

## Quick Actions
- [ ] Survey 20 target customers on WTP before changing price
- [ ] A/B test 2-3 price points on landing page
- [ ] Model competitor response scenarios

## Critical Risk to Watch
Pricing too low initially makes raising prices later extremely difficult (customer backlash + anchoring effect)
示例 2:标准模式
Input: analyze "SaaS product for developers"

Flow:
1. Detect mode: standard (no quick/deep keywords)
2. Detect domain: product + software
3. Select 6 perspectives:
   - Product Manager
   - Developer (user persona)
   - Security Engineer
   - DevOps
   - Support Lead
   - Investor
4. Launch all 6 agents in parallel
5. Synthesize findings into standard format
6. Generate actionable roadmap

Output: [Standard format with all sections filled]
示例 3:深度模式
Input: analyze deep "migration to microservices"

Flow:
1. Detect mode: deep
2. Detect domain: software
3. Select 10 perspectives:
   - Architect
   - DevOps
   - Security Engineer
   - Database Engineer
   - Frontend Developer
   - QA Engineer
   - Performance Engineer
   - SRE
   - Tech Lead
   - CTO
4. Launch all 10 agents in parallel
5. Each answers 12 questions (7 core + 5 deep)
6. Synthesize into deep format with dependency map
7. Generate comprehensive roadmap (immediate/short/medium/long)

Output: [Deep format with extended sections]

常见失败模式

失败根本原因Reflexion 的应对方式
检测到错误的领域关键词含糊不清明确询问用户,或使用通用领域
视角太少对复杂主题使用了快速模式升级到标准模式
综合分析薄弱Agent 的输出不一致使用明确的约束重新运行
遗漏盲点选择的视角过于显而易见添加反方视角
路线图缺乏可执行性行动项过于笼统将每项行动拆解为原子级事项:负责人、截止日期、指标
分析耗时超过 2 分钟Agent 太多(深度模式过度)切换到标准模式

集成说明

此技能为独立技能,包含所有必要的框架:

  • UltraThink 认知框架(内嵌)
  • 第一性原理分析(内嵌)
  • 视角库(内嵌)
  • 输出格式(内嵌)

无需外部依赖。

可选增强: 对 TypeScript 代码库进行软件领域分析时,codebase-intelligence CLI(npx codebase-intelligence --json)可提供结构数据——热点、耦合度、未使用的导出、模块边界、影响范围。检测条件:必须存在 tsconfig.json。如需完整 CLI 参考,请获取 https://raw.githubusercontent.com/bntvllnt/codebase-intelligence/main/llms-full.txt。没有它,技能的运行方式完全相同——数据仅作为视角 Agent 的补充上下文。


许可证

MIT 许可证 - 可免费使用、修改和分发。


版本

v1.0.0 - 2026-01-28 - bntvllnt 首次公开发布

评论

支持 Markdown