-
Notifications
You must be signed in to change notification settings - Fork 322
[refactoring] Extract Go source code analysis tools bundle into shared component #24077
Description
Skill Overview
7+ workflows use shared/mcp/serena-go.md for Go code analysis combined with a near-identical set of bash permissions for navigating Go source files. However, every workflow independently re-declares the same find pkg, wc -l, cat pkg/**, grep -r 'func ' bash allowlist. Extracting a shared/go-source-analysis.md component that bundles serena-go.md + the standard bash permissions + standard Go source navigation instructions would reduce duplication across all Go code quality workflows.
Current Pattern
Every affected workflow independently declares:
imports:
- shared/mcp/serena-go.md
- shared/reporting.md
tools:
bash:
- "find pkg -name '*.go' ! -name '*_test.go' -type f"
- "find pkg -type f -name '*.go' ! -name '*_test.go'"
- "find pkg/ -maxdepth 1 -ls"
- "find pkg/workflow/ -maxdepth 1 -ls"
- "wc -l pkg/**/*.go"
- "head -n * pkg/**/*.go"
- "grep -r 'func ' pkg --include='*.go'"
- "cat pkg/**/*.go"Each workflow also includes similar prompt instructions: "activate_project with workspace path", "analyze .go files only, skip test files, focus on pkg/".
Current Usage
This skill appears in the following workflows:
-
daily-function-namer.md(lines 1–30) -
duplicate-code-detector.md(lines 1–20) -
semantic-function-refactor.md(lines 1–28) -
daily-file-diet.md(lines 1–35) -
daily-compiler-quality.md(lines 1–30) -
go-fan.md(partial pattern) -
daily-testify-uber-super-expert.md(partial bash perms)
Proposed Shared Component
File: .github/workflows/shared/go-source-analysis.md
---
# Go Source Code Analysis Base
# Bundles Serena Go LSP analysis + standard bash permissions for Go source navigation.
#
# Usage:
# imports:
# - shared/go-source-analysis.md
imports:
- shared/mcp/serena-go.md
- shared/reporting.md
tools:
bash:
- "find pkg -name '*.go' ! -name '*_test.go' -type f"
- "find pkg -type f -name '*.go' ! -name '*_test.go'"
- "find pkg/ -maxdepth 1 -ls"
- "find pkg/workflow/ -maxdepth 1 -ls"
- "wc -l pkg/**/*.go"
- "head -n * pkg/**/*.go"
- "grep -r 'func ' pkg --include='*.go'"
- "cat pkg/**/*.go"
---
## Go Source Code Analysis Setup
Serena Go LSP analysis is configured for this workspace. Standard bash tools for Go source navigation are available.
### Serena Activation
Before analyzing code, activate the Serena project:
```
Tool: activate_project
Args: { "path": "$\{\{ github.workspace }}" }
```
### Go Analysis Constraints
1. **Only analyze `.go` files** — Ignore all other file types
2. **Skip test files** — Never analyze files ending in `_test.go`
3. **Focus on `pkg/` directory** — Primary analysis area
4. **Use Serena for semantic analysis** — Leverage LSP capabilities for deeper insights (go to definition, find references, type inference)
5. **Use bash `find`/`grep` for quick navigation** — Supplement Serena with text-based searchesUsage Example:
# In semantic-function-refactor.md
imports:
- shared/go-source-analysis.md
# Remove previous separate imports of shared/mcp/serena-go.md and shared/reporting.mdImpact
- Workflows affected: 7+ workflows
- Lines saved: ~50–80 lines (bash permissions: ~8 lines × 7; plus de-duplicated prompt instructions)
- Maintenance benefit: When the standard Go source analysis bash permissions need updating (e.g., adding
cmd/directory, addinginternal/patterns), one file change propagates to all workflows. Currently, each workflow independently maintains its bash allowlist.
Implementation Plan
- Create shared component at
.github/workflows/shared/go-source-analysis.md - Update
duplicate-code-detector.mdto use new component (simplest case) - Update
semantic-function-refactor.md - Update
daily-function-namer.md - Update
daily-file-diet.md - Update
daily-compiler-quality.md - Update remaining workflows
- Recompile affected workflows with
make recompile - Test compilation and run smoke tests
Related Analysis
This recommendation comes from the Workflow Skill Extractor analysis run on 2026-04-02. See full analysis report in the discussions for details.
Generated by Workflow Skill Extractor · ◷
- expires on Apr 4, 2026, 11:40 AM UTC