Add semantic function refactoring workflow for Go code analysis#2109
Merged
Add semantic function refactoring workflow for Go code analysis#2109
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
reviewed
Oct 22, 2025
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 9 * * 1" # Weekly on Monday at 9 AM UTC |
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
Copilot
AI
changed the title
[WIP] Cluster and refactor Go functions by semantic similarity
Add semantic function refactoring workflow for Go code analysis
Oct 22, 2025
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new agentic workflow that performs semantic analysis of Go source files to identify refactoring opportunities through function clustering and duplicate detection.
Overview
The workflow analyzes all non-test Go files in the
pkg/directory to:Implementation Details
Workflow Configuration:
shared/mcp/serena.md)[refactor]prefix containing detailed findingsAnalysis Steps:
.gofiles (excluding*_test.go)get_symbols_overviewto catalog functionsSerena Tools Utilized:
activate_project- Initialize analysis environmentget_symbols_overview- Extract function signaturesfind_symbol- Locate similarly named functionssearch_for_pattern- Find duplicate code patternsfind_referencing_symbols- Understand usage patternsread_file- Examine implementationsExpected Output
The workflow creates a GitHub issue containing:
Benefits
This workflow helps maintain code quality by:
Testing
The workflow is ready to be executed and will provide valuable insights into code organization and refactoring opportunities in the Go codebase.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.