code-analyzer by oimiragieo/agent-studio
npx skills add https://github.com/oimiragieo/agent-studio --skill code-analyzer无需单独下载:该技能运行仓库内工具 .claude/tools/analysis/project-analyzer/analyzer.mjs。
winget install OpenJS.NodeJS.LTS (Windows),brew install node (macOS)。指标: 关注圈复杂度(决策路径)、代码行数、可维护性指数和重复代码块。对于 JS/TS,使用 ESLint 的 complexity 规则(例如 "complexity": ["error", 15]);可选链和默认参数会增加分支。
流程: 重构前进行分析;先运行项目范围分析,再深入热点。跟踪随时间变化的趋势(而非一次性)。将 max-depth、max-lines、、、 与复杂度结合使用。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
max-nested-callbacksmax-paramsmax-statements技巧: 从 project-analyzer 的输出开始;按文件类型和阈值过滤。优先处理高复杂度且频繁变更的文件。仅在无法设置合理限制时禁用复杂度规则;优先降低阈值而非禁用规则。
无单一认证; 与静态分析和 ESLint 复杂度规则保持一致。ESLint: 复杂度规则、最大深度、最大行数、最大参数数。技能数据: 圈复杂度、代码行数、可维护性、重复代码;重构前分析;跟踪热点和趋势。
建议的钩子: 提交前或 CI:运行 project-analyzer/doctor 进行健康检查;可选的复杂度门禁。与 developer(次要)、qa(次要)、code-reviewer(主要)一起使用。
工作流: 与 code-reviewer(主要)、developer / qa(次要)、c4-code(主要)一起使用。流程:运行分析器 → 过滤热点 → 重构或添加测试。参见 code-review-workflow.md。
静态代码分析和指标。节省 90% 以上的上下文。
| 工具 | 描述 |
|---|---|
| analyze-file | 分析单个文件 |
| analyze-project | 分析整个项目 |
| complexity | 计算复杂度指标 |
| 工具 | 描述 |
|---|---|
| loc | 代码行数 |
| cyclomatic | 圈复杂度 |
| maintainability | 可维护性指数 |
| duplicates | 查找重复代码 |
| 工具 | 描述 |
|---|---|
| summary | 获取分析摘要 |
| hotspots | 查找复杂度热点 |
| trends | 分析指标趋势 |
| 反模式 | 失败原因 | 正确方法 |
|---|---|---|
| 仅分析已更改的文件 | 错过跨文件复杂度累积 | 运行项目范围分析,然后过滤出已更改的热点 |
| 长期忽视高复杂度文件 | 在时间点分析中,逐渐恶化的情况不可见 | 跟踪每周趋势;对任何增长发出警报 |
| 复杂度阈值 >20 | 研究表明缺陷率在 20 以上急剧上升 | 将 ESLint 复杂度规则设置为 ≤15 以强制执行 |
| 报告指标而无行动项 | 没有补救措施的指标无法降低复杂度 | 为每个热点附加具体的重构建议 |
| 运行一次分析并忽略结果 | 技术债务悄然累积 | 安排自动化的每周分析并生成趋势报告 |
开始前: 阅读 .claude/context/memory/learnings.md
完成后:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.md假设中断:如果不在记忆中,就表示没有发生。
每周安装数
94
代码仓库
GitHub 星标数
18
首次出现
2026年1月27日
安全审计
安装于
github-copilot90
gemini-cli89
codex89
opencode89
kimi-cli88
cursor88
No separate download: the skill runs the in-repo tool .claude/tools/analysis/project-analyzer/analyzer.mjs.
winget install OpenJS.NodeJS.LTS (Windows), brew install node (macOS).Metrics: Focus on cyclomatic complexity (decision paths), LOC, maintainability index, and duplicate blocks. Use ESLint complexity rule (e.g. "complexity": ["error", 15]) for JS/TS; optional chaining and default params add branches.
Process: Analyze before refactoring; run project-wide then drill into hotspots. Track trends over time (not one-off). Use max-depth, max-lines, max-nested-callbacks, max-params, max-statements alongside complexity.
Hacks: Start with project-analyzer output; filter by file type and threshold. Prioritize files with high complexity and high churn. Disable complexity rule only if you cannot set a sensible limit; prefer lowering the threshold over disabling.
No single cert; aligns with static analysis and ESLint complexity. ESLint: complexity rule, max-depth, max-lines, max-params. Skill data: Cyclomatic complexity, LOC, maintainability, duplicates; analyze before refactor; track hotspots and trends.
Suggested hooks: Pre-commit or CI: run project-analyzer/doctor for health; optional complexity gate. Use with developer (secondary), qa (secondary), code-reviewer (primary).
Workflows: Use with code-reviewer (primary), developer / qa (secondary), c4-code (primary). Flow: run analyzer → filter hotspots → refactor or add tests. See code-review-workflow.md.
Static code analysis and metrics. 90%+ context savings.
| Tool | Description |
|---|---|
| analyze-file | Analyze single file |
| analyze-project | Analyze entire project |
| complexity | Calculate complexity metrics |
| Tool | Description |
|---|---|
| loc | Lines of code |
| cyclomatic | Cyclomatic complexity |
| maintainability | Maintainability index |
| duplicates | Find duplicate code |
| Tool | Description |
|---|---|
| summary | Get analysis summary |
| hotspots | Find complexity hotspots |
| trends | Analyze metric trends |
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Analyzing only changed files | Misses cross-file complexity accumulation | Run project-wide then filter to changed hot spots |
| Ignoring high-complexity files over time | Gradual degradation invisible in point-in-time analysis | Track weekly trends; alert on any increase |
| Complexity threshold >20 | Research shows defect rate spikes sharply above 20 | Set ESLint complexity rule to ≤15 for enforcement |
| Reporting metrics without action items | Metrics without remediation don't reduce complexity | Attach specific refactoring suggestion per hotspot |
| Running analysis once and ignoring results | Technical debt silently accumulates | Schedule automated weekly analysis with trend reports |
Before starting: Read .claude/context/memory/learnings.md
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.
Weekly Installs
94
Repository
GitHub Stars
18
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
github-copilot90
gemini-cli89
codex89
opencode89
kimi-cli88
cursor88
Node.js 环境配置指南:多环境管理、类型安全与最佳实践
10,500 周安装
canghe-url-to-markdown:使用Chrome CDP将网页URL转换为干净Markdown的工具
117 周安装
Next.js动态路由与路径参数详解:创建、访问与优化指南
143 周安装
Markdown文档管理技能:自动化更新项目文档,确保代码与文档一致性
220 周安装
Gitea 工作流编排器:自动化敏捷开发流程,提升 Git 仓库管理效率
146 周安装
TranscriptAPI:YouTube 字幕、搜索、频道数据 API,免费积分,无需信用卡
138 周安装
原始视频处理工具:使用FFmpeg和Python自动移除静音片段并加速屏幕录制视频
239 周安装