Skip to content

feat: add daily-function-namer agentic workflow#20732

Merged
pelikhan merged 3 commits intomainfrom
copilot/create-agentic-workflow-analyze-go-files
Mar 13, 2026
Merged

feat: add daily-function-namer agentic workflow#20732
pelikhan merged 3 commits intomainfrom
copilot/create-agentic-workflow-analyze-go-files

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Go function names optimized for human readability often fail agent discoverability — generic verbs like process(), handle(), run() give agents no signal when searching for relevant code. This adds a daily workflow that systematically renames functions to improve agent-findability across the codebase.

New workflow: daily-function-namer

  • Round-robin via cache-memory: Persists a last_index cursor in /tmp/gh-aw/cache-memory/function-namer-state.json; each run processes 3 non-test .go files from pkg/, wrapping with modulo across the full file list
  • Serena-powered analysis: Uses shared/mcp/serena-go.md (LSP-backed) to extract symbols and resolve call sites via get_symbols_overview + find_referencing_symbols
  • Rename heuristics: Flags generic names (process, handle, run, mkCfg, genSO) and proposes specific verb+noun replacements (e.g. mkCfgbuildMCPServerConfig)
  • Agentic issue output: Creates a [function-namer] issue with a rename table per file, full function inventory, and a ready-to-assign implementation plan (search commands, commit conventions, validation checklist); stale issues are automatically closed via close-older-issues: true
tools:
  cache-memory: true          # round-robin state across runs
  github:
    toolsets: [default, issues]
  bash:
    - "find pkg -name '*.go' ! -name '*_test.go' -type f | sort"

safe-outputs:
  create-issue:
    expires: 7d
    title-prefix: "[function-namer] "
    labels: [refactoring, code-quality, automated-analysis, cookie]
    max: 1
    close-older-issues: true
Original prompt

We’re going to create an agentic workflow that runs daily and analyzes up to three Go files at a time. It will extract the function names from these files, analyze the functions, and potentially rename them so that their names better match their behavior and intent, making them more intuitive for an agent.

The goal is to increase the likelihood that, when an agentic task is created and an agent searches for relevant functions, it can find them more reliably because the functions use clearer, more logical names.

Use Serena to extract function file names and use cache-memory to perform a round-robin across all files. Write the results as an issue that includes an agentic plan for an agent, so we can assign the issue to an agent and implement the plan as code.

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…e suggestions

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add agentic workflow for analyzing Go functions feat: add daily-function-namer agentic workflow Mar 13, 2026
Copilot AI requested a review from pelikhan March 13, 2026 00:19
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use the SafeOutputClosedissue. Instead, use the CreateIssue.CloseOlderIssues field, which provides a built-in way to close older issues.@copilot

…er-issues field

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

Do not use the SafeOutputClosedissue. Instead, use the CreateIssue.CloseOlderIssues field, which provides a built-in way to close older issues.@copilot

Done in 7c54dbe. Replaced the close-issue safe output with close-older-issues: true on the create-issue block, and removed the manual close-issue Step 1 from the prompt body.

Copilot AI requested a review from pelikhan March 13, 2026 00:25
@pelikhan pelikhan marked this pull request as ready for review March 13, 2026 00:28
Copilot AI review requested due to automatic review settings March 13, 2026 00:28
@pelikhan pelikhan merged commit 1a8c728 into main Mar 13, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/create-agentic-workflow-analyze-go-files branch March 13, 2026 00:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new daily gh-aw workflow that uses Serena + cache-memory to rotate through Go files in pkg/ and open a refactoring issue with function rename recommendations to improve agent discoverability.

Changes:

  • Introduces daily-function-namer workflow prompt defining the round-robin selection + rename heuristics + issue template.
  • Adds the compiled workflow manifest (.lock.yml) generated from the .md definition.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/daily-function-namer.md Defines the daily agentic analysis steps, caching strategy, and issue output format for rename suggestions.
.github/workflows/daily-function-namer.lock.yml Compiled GitHub Actions workflow generated by gh-aw to execute the new workflow.
Comments suppressed due to low confidence (1)

.github/workflows/daily-function-namer.md:129

  • Section 5.2 references “functions identified in 6.1”, but there is no 6.1 (and the relevant symbol extraction step is 5.1). Please fix the step reference so the agent can follow the intended sequence reliably.
For each function identified in 6.1, read enough of the implementation to understand its behavior:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.


```
Tool: find_referencing_symbols
Args: { "symbol_name": "<currentName>", "file_path": "pkg/..." }
Read the current rotation position from cache:

```bash
cat /tmp/gh-aw/cache-memory/function-namer-state.json
```

All file paths are relative to the repository root (e.g., `pkg/workflow/compiler.go`),
matching the output of the `find pkg` command in Step 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants