skills/go-function-analysis/SKILL.md
Analyze Go function lengths within a workspace and generate statistics (p50, p90, p99). Use when you need to audit function complexity, identify long functions, or generate code metrics for Go projects. Only analyzes files matching **/*.go within the current workspace, excluding dependencies.
npx skillsauth add bizshuk/llm_plugin go-function-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill analyzes all Go functions in a workspace and generates:
Use this skill when:
Find all .go files in the workspace, excluding common dependency directories:
find . -name "*.go" -type f ! -path "./vendor/*" ! -path "./.git/*" ! -path "*_test.go"
For each .go file, use the helper script to extract function information:
./scripts/analyze_functions.sh <workspace_path>
Or manually parse using this approach for each file:
func declaration to matching closing braceGiven all function lengths sorted ascending:
count * 0.50count * 0.90count * 0.99Create README.function.md in the workspace root with this format:
# Go Function Analysis
Generated: YYYY-MM-DD
## Summary Statistics
| File Path | Function Name | Function Lines | Depth Level | Percentile |
| --------- | ------------- | -------------- | ----------- | ---------- |
| path/to/f | funcName | X | Y | p50 |
| ... | ... | ... | ... | ... |
**Total functions:** N
**Average length:** X lines
## All Functions (sorted by length, descending)
| File Path | Function Name | Function Lines | Depth Level |
| --------- | ------------- | -------------- | ----------- |
| path/to/f | funcName | X | Y |
| ... | ... | ... | ... |
If the script is not available, follow these steps:
Go functions are declared with:
func FunctionName(params) returnType {
// body
}
func (receiver Type) MethodName(params) returnType {
// body
}
For each function:
func keyword line}func and } lines in the countfunc example() { // Line 1
fmt.Println() // Line 2
if true { // Line 3
doSomething()// Line 4
} // Line 5
} // Line 6
This function has 6 lines.
[!NOTE] Only analyze
.gofiles within the workspace. Exclude/vendor/,/.git/, and external dependencies.
[!TIP] Functions over 50 lines may be candidates for refactoring. p90+ functions often warrant closer review.
tools
運用 codebase MCP 審查 Merge Request,包含邏輯重複、潛在問題、測試覆蓋率與命名一致性檢查
tools
Explore niche markets, generate viral content ideas, write scripts, plan 30-day calendars, monetization, and automation.
development
Scan workspace for potential security risks including exposed passwords, API keys, tokens, and other sensitive data
data-ai
Project metadata update