Skip to content

[refactoring] Extract Go source code analysis tools bundle into shared component #24077

@github-actions

Description

@github-actions

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 searches

Usage 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.md

Impact

  • 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, adding internal/ patterns), one file change propagates to all workflows. Currently, each workflow independently maintains its bash allowlist.

Implementation Plan

  1. Create shared component at .github/workflows/shared/go-source-analysis.md
  2. Update duplicate-code-detector.md to use new component (simplest case)
  3. Update semantic-function-refactor.md
  4. Update daily-function-namer.md
  5. Update daily-file-diet.md
  6. Update daily-compiler-quality.md
  7. Update remaining workflows
  8. Recompile affected workflows with make recompile
  9. 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

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions