analyze-code

SKILL开发
开发 未标注权限 许可证不明确

Intelligence-first code analysis for bugs, architecture, performance, and security. Use proactively when investigating code issues, tracing dependencies, or understanding system behavior. MUST query project-intel.mjs before reading files.

一句话选型结论

按资料字段整理

analyze-code是开发类的 Agent Skill,安装方式:GitHub 仓库,权限级别未标注,许可证不明确,没有现成安装命令,需按说明手动放置 SKILL.md。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类开发 安装方式GitHub 仓库 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 0 仓库 nextjs-intelligence-toolkit
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

GitHub 仓库
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    按安装说明或仓库 README,把 SKILL.md 放到客户端的 skills 目录(一般一个技能一个文件夹)。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

开发
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方yangsi7仓库 nextjs-intelligence-toolkit · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式GitHub 仓库安装包 yangsi7/nextjs-intelligence-toolkit
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 未标注
正文体量13.9 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
写代码与改 bug

按需求补代码、定位并修掉报错。

读仓库与生成改动

让模型读懂项目结构,再给出可落地的改动。

跑测试与排查故障

按现象排查问题,补测试用例并复跑。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 基础信息齐全,可以先按说明装一个试试。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有现成安装命令,要按安装说明或仓库 README 手动放置。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在开发场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
analyze-code当前 未标注权限 GitHub 仓库 未标注 未标注 无
技能审查员 浏览器控制 ClawHub 市场 877.9 万 OpenClaw 有
Vercel React 最佳实践 浏览器控制 GitHub 仓库 849.1 万 Codex、Claude、Cursor 有
GitHub 代码协作 联网访问 ClawHub 市场 763.3 万 OpenClaw 有
网页设计指南 联网访问 GitHub 仓库 668.6 万 Codex、Claude、Cursor 有
本体论 只读 ClawHub 市场 663.7 万 OpenClaw 有

SKILL.md 全文

13.9 KB
模型实际读到的说明书原文,来自技能仓库

Code Analysis Skill

Overview

This skill performs comprehensive code analysis using an intel-first approach - always querying project-intel.mjs before reading full files, achieving 80-95% token savings.

Core principle: Query intel → Verify with MCP → Report with evidence

Announce at start: "I'm using the analyze-code skill to investigate this issue."


Quick Reference

Phase Key Activities Token Budget Output
1. Scope Define objective, bounds, success criteria ~200 tokens analysis-spec.md
2. Intel Queries Search, symbols, dependencies via project-intel.mjs ~500 tokens /tmp/intel_*.json
3. MCP Verification Verify findings with authoritative sources ~300 tokens Evidence block
4. Report Generate CoD^Σ trace report ~1000 tokens report.md

Total: ~2000 tokens vs 20000+ for direct file reading


Workflow Files

Detailed Workflows:
- @.claude/skills/analyze-code/workflows/analysis-workflow.md - Complete Phases 1-4 (scope, intel queries, MCP verification, report generation)

Reference Materials:
- @.claude/skills/analyze-code/references/decision-trees.md - 3 analysis type decision trees (bug diagnosis, architecture, performance)
- @.claude/skills/analyze-code/references/enforcement-rules.md - 3 non-negotiable rules (no naked claims, intel before reading, MCP for authority)
- @.claude/skills/analyze-code/references/failure-modes.md - 5 common failures with solutions


Templates You Will Use

  • @.claude/templates/analysis-spec.md - Scope definition (Phase 1)
  • @.claude/templates/report.md - Final analysis report (Phase 4)
  • @.claude/templates/mcp-query.md - Optional MCP queries (Phase 3)

Intelligence Tool Guide

  • @.claude/shared-imports/project-intel-mjs-guide.md - Complete project-intel.mjs usage

The Process (Overview)

See: @.claude/skills/analyze-code/workflows/analysis-workflow.md for complete details

Copy this checklist to track progress:

Analysis Progress:
- [ ] Phase 1: Scope (analysis-spec.md created)
- [ ] Phase 2: Intel Queries (4 query types executed)
- [ ] Phase 3: MCP Verification (findings verified)
- [ ] Phase 4: Report (CoD^Σ trace complete)

Phase 1: Define Scope

Create analysis-spec.md using template to define:

  1. Objective: What question are we answering?
    - "Why does LoginForm re-render infinitely?"
    - "What causes 500 error on checkout?"
    - "Is there circular dependency in auth module?"

  2. Scope: What's in/out of scope?
    - In-Scope: Specific components, files, functions
    - Out-of-Scope: Backend, database, third-party APIs

  3. Success Criteria: How do we know when done?
    - "Root cause identified with file:line reference"
    - "Complete dependency graph generated"
    - "Performance bottleneck located"

Enforcement Checklist:
- [ ] Objective is clear and answerable
- [ ] In-scope/out-of-scope explicitly defined
- [ ] Success criteria are testable


Phase 2: Execute Intel Queries

CRITICAL: Execute ALL intel queries BEFORE reading any files.

4 Required Query Types:

  1. Project Overview (if first analysis in session):
    bash project-intel.mjs --overview --json > /tmp/analysis_overview.json
    Purpose: Understand project structure, entry points, file counts
    Tokens: ~50

  2. Search for Relevant Files:
    bash project-intel.mjs --search "<pattern>" --type <filetype> --json > /tmp/analysis_search.json
    Purpose: Locate files related to objective
    Tokens: ~100

  3. Symbol Analysis (for each relevant file):
    bash project-intel.mjs --symbols <filepath> --json > /tmp/analysis_symbols_<filename>.json
    Purpose: Understand functions/classes without reading full file
    Tokens: ~150 per file

  4. Dependency Tracing:
    ```bash
    # What does this file import?
    project-intel.mjs --dependencies <filepath> --direction upstream --json > /tmp/analysis_deps_up.json

# What imports this file?
project-intel.mjs --dependencies <filepath> --direction downstream --json > /tmp/analysis_deps_down.json
```
Purpose: Understand dependencies and impact
Tokens: ~200 total

Token Comparison:
- Reading full LoginForm.tsx (1000 lines): ~3000 tokens
- Intel queries + targeted read (30 lines): ~300 tokens
- Savings: 90%

Enforcement Checklist:
- [ ] All 4 query types executed
- [ ] Intel results saved to /tmp/ for evidence
- [ ] No files read before intel queries complete

See: @.claude/skills/analyze-code/workflows/analysis-workflow.md for complete query examples


Phase 3: MCP Verification

Verify findings with authoritative sources:

When to Use Each MCP:

MCP Tool Use For Example
Ref Library/framework behavior React hooks, Next.js routing, TypeScript
Supabase Database schema, RLS policies Table structure, column types
Shadcn Component design patterns shadcn/ui component usage
Chrome Runtime behavior validation E2E testing, browser behavior

MCP Verification Pattern:

## Intel Finding
[What intelligence queries revealed]

## MCP Verification
**Tool:** [Which MCP tool]
**Query:** [Exact query executed]
**Result:** [What authoritative source says]

## Comparison
- **Intel shows:** [From project-intel.mjs]
- **Docs require:** [From MCP verification]
- **Conclusion:** [Agreement or discrepancy]

Enforcement Checklist:
- [ ] At least 1 MCP verification for non-trivial findings
- [ ] MCP results documented in Evidence section
- [ ] Discrepancies between intel and MCP flagged

See: @.claude/skills/analyze-code/workflows/analysis-workflow.md for complete verification examples


Phase 4: Generate Report

Create comprehensive report using @.claude/templates/report.md

Required: CoD^Σ Trace

Every report MUST include complete reasoning chain with symbolic operators:

## CoD^Σ Trace

**Claim:** [Your conclusion with file:line reference]

**Trace:**

Step 1: → IntelQuery("search <pattern>")
↳ Source: project-intel.mjs --search "<pattern>" --type <type>
↳ Data: [What was found]
↳ Tokens: [Token count]

Step 2: ⇄ IntelQuery("analyze symbols")
↳ Source: project-intel.mjs --symbols <file>
↳ Data: [Functions/classes found with line numbers]
↳ Tokens: [Token count]

Step 3: → TargetedRead(lines X-Y)
↳ Source: Read <file> (lines X-Y only)
↳ Data: [Relevant code excerpt]
↳ Tokens: [Token count]

Step 4: ⊕ MCPVerify("<tool>")
↳ Tool: <MCP tool> - "<query>"
↳ Data: [What authoritative source says]
↳ Tokens: [Token count]

Step 5: ∘ Conclusion
↳ Logic: [Reasoning from data to conclusion]
↳ Root Cause: <file>:<line> - [What's wrong]
↳ Fix: [How to resolve]

**Total Tokens:** [Sum] (vs [baseline] for reading full files)
**Savings:** [Percentage]

**Report Sections:**

1. **Summary** (max 200 tokens): Key finding, root cause with file:line, recommended fix
2. **CoD^Σ Trace** (as shown above): Complete reasoning chain, token counts, savings
3. **Evidence**: All intel query results, MCP verification, targeted file excerpts
4. **Recommendations**: Specific fixes, implementation guidance, testing approach

**File Naming:** `YYYYMMDD-HHMM-report-&lt;id&gt;.md`

**Enforcement Checklist:**
- [ ] Report uses template structure
- [ ] CoD^Σ trace complete
- [ ] Every claim has file:line or MCP evidence
- [ ] Recommendations are specific
- [ ] Total report ≤ 1000 tokens when populated

**See:** @.claude/skills/analyze-code/workflows/analysis-workflow.md for complete report examples

---

## Decision Trees for Different Analysis Types

**See:** @.claude/skills/analyze-code/references/decision-trees.md

**Summary:**

- **Tree 1: Bug Diagnosis** - Search error → Locate function → Trace dependencies → Find discrepancy → Verify with MCP → Report
- **Tree 2: Architecture Analysis** - Get overview → Identify entry points → Trace dependencies → Build graph → Analyze patterns → Report
- **Tree 3: Performance Analysis** - Search slow operations → Trace data flow → Identify bottlenecks → Measure impact → Verify best practices → Report

Choose based on user&#x27;s request type. Can combine multiple trees for complex analyses.

---

## Enforcement Rules

**See:** @.claude/skills/analyze-code/references/enforcement-rules.md

**Summary:**

### Rule 1: No Naked Claims
Every claim MUST have file:line reference and evidence from intelligence queries or MCP verification.

### Rule 2: Intel Before Reading
Query project-intel.mjs BEFORE reading any files. Achieve 90-97% token savings.

### Rule 3: MCP for Authority
Verify library/framework behavior with authoritative MCP sources, not memory or assumptions.

**These rules are non-negotiable. Violations invalidate the analysis.**

---

## Common Pitfalls

| Pitfall | Impact | Solution |
|---------|--------|----------|
| Skipping intel queries | 10-100x token waste | Enforce Phase 2 before any reads |
| Vague conclusions | Not actionable | Always include file:line references |
| No MCP verification | Incorrect assumptions | Verify library behavior with Ref MCP |
| Incomplete CoD^Σ trace | Can&#x27;t verify reasoning | Document every reasoning step |

---

## Success Metrics

**Token Efficiency:**
- Intel-first: 500-2000 tokens per analysis
- Direct reading: 5000-20000 tokens
- **Target: 80%+ savings** ✓

**Accuracy:**
- Root cause identified: 95%+
- MCP verified: 100% for library issues

**Completeness:**
- All claims evidenced: 100%
- CoD^Σ trace complete: 100%

---

## When to Use This Skill

**Use analyze-code when:**
- User reports a bug or error
- User asks &quot;why does X happen?&quot;
- User wants to understand system architecture
- User suspects performance issues
- User needs dependency analysis

**Don&#x27;t use when:**
- Simple syntax questions (no analysis needed)
- User wants to write new code (use planning skill)
- User wants to implement a fix (use execution skill)

---

## Prerequisites

Before using this skill:
- ✅ PROJECT_INDEX.json exists (run `/index` if missing)
- ✅ project-intel.mjs is executable
- ✅ Code to analyze exists in repository
- ⚠️ For external library analysis: MCP tools configured (Ref, Context7)

---

## Dependencies

**Depends On**:
- None (this skill is standalone and doesn&#x27;t require other skills to run first)

**Integrates With**:
- **debug-issues skill**: Use after this skill if analysis reveals bugs
- **create-implementation-plan skill**: Use after this skill to plan fixes/enhancements

**Tool Dependencies**:
- project-intel.mjs (intelligence queries)
- MCP Ref tool (library documentation)
- MCP Context7 tool (external docs)

---

## Next Steps

After analysis completes, typical next steps:

**If bugs found**:

analyze-code → debug-issues skill → create-implementation-plan skill → implement-and-verify skill


**If performance issues found**:

analyze-code → create-implementation-plan skill (optimization) → implement-and-verify skill


**If architecture review**:

analyze-code → create-implementation-plan skill (refactoring) → implement-and-verify skill


**Commands to invoke**:
- `/bug` - If analysis reveals specific bugs
- `/plan` - To create implementation plan for fixes
- `/implement` - After plan exists, to execute changes

---

## Failure Modes

**See:** @.claude/skills/analyze-code/references/failure-modes.md

**Summary of 5 Common Failures:**

1. **PROJECT_INDEX.json Missing** - Solution: Run `/index`
2. **Intelligence Queries Return No Results** - Solution: Regenerate index, broaden search
3. **MCP Tools Not Available** - Solution: Configure .mcp.json, use workaround
4. **Analysis Scope Too Broad** - Solution: Define narrow scope in analysis-spec.md
5. **CoD^Σ Evidence Missing** - Solution: Save intel results, complete CoD^Σ trace

**Diagnostic Workflow**: Check index → Check queries → Check MCP → Check scope → Check evidence

---

## Related Skills &amp; Commands

**Direct Integration**:
- **debug-issues skill** - Use after this skill when bugs are identified
- **create-implementation-plan skill** - Use after analysis to plan changes
- **/analyze command** - User-facing command that invokes this skill
- **code-analyzer subagent** - Subagent that routes to this skill

**Workflow Context**:
- Position: Can be used at any time (analysis is standalone)
- Triggers: User mentions &quot;analyze&quot;, &quot;review&quot;, &quot;understand&quot;, &quot;architecture&quot;
- Output: report.md or analysis-spec.md using templates

---

## Agent Integration

**Subagent Usage**:

When the code-analyzer subagent delegates work to this skill, it provides:
- Initial problem statement
- Suspected file locations (if known)
- Context from user conversation

This skill then:
1. Creates analysis-spec.md from provided context
2. Executes intelligence queries
3. Generates report with CoD^Σ trace
4. Returns findings to subagent

**Task Tool Example**:
```python
# From code-analyzer subagent
Task(
    subagent_type=&quot;code-analyzer&quot;,
    description=&quot;Analyze infinite render bug&quot;,
    prompt=&quot;&quot;&quot;
    @.claude/skills/analyze-code/SKILL.md

    User reports: LoginForm component re-renders infinitely

    Use intelligence-first approach:
    1. Query project-intel.mjs for LoginForm location
    2. Analyze symbols to find hooks
    3. Verify React patterns with MCP Ref
    4. Generate report with CoD^Σ trace

    Output: Complete report.md with root cause and fix
    &quot;&quot;&quot;
)

Version

Version: 1.1.0
Last Updated: 2025-10-23
Change Log:
- v1.1.0 (2025-10-23): Refactored to progressive disclosure pattern (<500 lines)
- v1.0.0 (2025-10-19): Initial version

Owner: Claude Code Intelligence Toolkit

```

常见问题

5 问
答案由本站依据条目字段整理
analyze-code怎么安装?

没有现成安装命令:按安装说明或仓库 README,把 SKILL.md 放进客户端的 skills 目录(一般一个技能一个文件夹)。

analyze-code支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

analyze-code权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

analyze-code收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

analyze-code用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。