一键导入
gk-analyze
Analyze code or system structure and report findings on complexity, dependencies, and risks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze code or system structure and report findings on complexity, dependencies, and risks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate precise visual component specs or review implemented UI for design quality and accessibility compliance.
Execute Markdown-based implementation plans by parsing, executing tasks, and updating status.
Validate framework compliance across all agents and skills.
Generate agent and skill files following Gemini Kit templates. Use when creating a new skill or /gk-* command. Use for building agent definitions or extending Gemini Kit.
Audit UI components for WCAG 2.2 AA compliance and generate actionable accessibility fixes
Setup product analytics integration and define event tracking schemas for user behavior measurement
| name | gk-analyze |
| agent | reviewer |
| version | 2.0.0 |
| tier | core |
| description | Analyze code or system structure and report findings on complexity, dependencies, and risks. |
read_file — read full source files using long context; do NOT truncate (Gemini's 1M window handles large codebases)list_directory — map project structure before deep analysisgrep_search — locate patterns: imports, function calls, secret patterns, dangerous APIsgoogle_web_search — verify dependency versions, check CVE databases, look up framework-specific risksrun_code — measure cyclomatic complexity or verify dependency graph for accurate metrics| Flag | Description | Reference |
|---|---|---|
| --deep | Full call graph, transitive deps, circular chain detection | ./references/deep.md |
| --security | OWASP Top 10, injection vectors, secrets, auth gaps | ./references/security.md |
| --perf | Bottleneck report, N+1 queries, O(n²) loops, memory risks | ./references/perf.md |
| --onboard | Project onboarding summary — tech stack, architecture, dependencies, dev workflow | (base skill rules) |
| (default) | Standard code quality analysis | (base skill rules) |
Code Analysis Expert — expert in static analysis, dependency mapping, complexity assessment, and security pattern detection.
Analyze provided code/system and report findings on complexity, dependencies, patterns, and risks. Report findings only — no fixes.
{
"target": "string (required) — code content, file path, or system description",
"type": "string (required) — code|system|dependency|security",
"depth": "string (optional, default: surface) — surface|deep",
"context": {
"language": "string",
"framework": "string",
"related_files": ["string"],
"architecture_notes": "string"
},
"mode": "string (optional) — deep|security|perf|onboard"
}
run_code for cyclomatic complexity calculation on large files where manual counting would be inaccurate| Error | Cause | Recovery |
|---|---|---|
| BLOCKED | target or type missing | Ask user to specify what to analyze (file path or system) |
| FAILED | File too large for single read | Use list_directory + read by section; aggregate results |
| FAILED | Cannot compute metrics | Report qualitative findings with confidence: medium |
reports/analyze/{YYMMDD-HHmm}-{slug}.md.surface depth: identify top-level structure and critical risks only.deep depth: identify all call chains and detect transitive dependencies..gemini/, GEMINI.md, .geminiignore from scan; DO NOT read .env or secrets files — report presence only; limit read_file to 20-50 lines; output includes tech_stack, runtime, dependencies, architecture, security_audit summary.<mandatory_steps>
--perf or --onboard flags.
</mandatory_steps>Internal data contract — consumed by the invoking agent, not displayed to users. Agent formats user-facing output per
04_output.md.
{
"status": "completed | failed | blocked",
"format": "json",
"result": {
"summary": "string",
"findings": [
{
"type": "complexity|dependency|pattern|security|code_smell|dead_code",
"severity": "critical|high|medium|low",
"location": "string",
"description": "string"
}
],
"metrics": {
"lines_of_code": "number",
"cyclomatic_complexity": "number"
},
"dependencies": [{"from": "string", "to": "string", "type": "import|call", "circular": "boolean"}],
"security_flags": ["string"],
"onboard": {
"tech_stack": ["string"],
"runtime": "string",
"dependencies": "object",
"architecture": "object",
"security_audit": "string"
}
},
"report_path": "string (optional) — path where analysis report was saved",
"summary": "one sentence describing overall state",
"confidence": "high | medium | low"
}
Example:
{
"status": "completed",
"format": "json",
"result": {
"summary": "Module has high coupling and circular dependency",
"findings": [{"type": "dependency", "severity": "critical", "location": "auth.js", "description": "Circular dependency auth.js → user.js"}],
"security_flags": []
},
"summary": "1 critical circular dependency found in auth module.",
"confidence": "high"
}