You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original analysis: 2026-05-20. This reuse run confirms zero refactoring progress: 35 source files still exceed 800 lines (up from 28 in May), with the top file at 1866 lines. The largest contributors remain in pkg/workflow/ and pkg/parser/.
Each oversized file bundles distinct logical concerns, inflating review surface and complicating unit testing. The handler registry alone in safe_outputs_config.go is 924 lines and can be split with zero API changes. Five concrete split tasks are provided below — all are within-package moves requiring no import changes.
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Task 1: Extract handler registry from safe_outputs_config.go
Priority: High | Effort: Small | Region: pkg/workflow/safe_outputs_config.go lines 781–1704
Description: Move handlerRegistry var, handlerBuilder type, and all handler builder closures (~924 lines) into a new file pkg/workflow/safe_outputs_handlers.go (package workflow). Also move buildMentionsHandlerConfig if only referenced by the registry. Pure move, no signature changes.
Acceptance Criteria:
safe_outputs_handlers.go created with package workflow
safe_outputs_config.go drops below 950 lines
go build ./... and go test ./pkg/workflow/... pass
Priority: High | Effort: Small | Region: pkg/parser/remote_fetch.go lines 699–823
Description: Move checkRemoteSymlink, resolveRemoteSymlinks, resolveRemoteSymlinkComponent, resolveAndValidateRemoteSymlinkBase into pkg/parser/remote_symlinks.go. Preserve the //go:build !js && !wasm constraint. remoteLog stays in remote_fetch.go and is accessible package-wide.
Acceptance Criteria:
remote_symlinks.go created with package parser and correct build tag
Priority: Medium | Effort: Small | Region: pkg/workflow/domains.go lines 26–236
Description: Move all per-engine var declarations (CopilotDefaultDomains, CodexDefaultDomains, ClaudeDefaultDomains, AntigravityDefaultDomains, GeminiDefaultDomains, Pi/Crush/OpenCode variants, provider maps) into pkg/workflow/domains_engine_defaults.go. The init() function and all lookup functions stay in domains.go.
Acceptance Criteria:
domains_engine_defaults.go created with package workflow
domains.go drops below 850 lines
go build ./... and go test ./pkg/workflow/... pass
Priority: Medium | Effort: Small | Region: pkg/workflow/compiler_yaml.go lines 463–800
Description: Extract generatePrompt and its five helpers (writePromptBashStep, generatePreSteps, generatePostSteps, generatePreAgentSteps, writeStepsSection) into pkg/workflow/compiler_yaml_prompt.go. All are *Compiler methods or package helpers; no import changes needed.
Acceptance Criteria:
compiler_yaml_prompt.go created with package workflow
compiler_yaml.go drops below 780 lines
go build ./... and go test ./pkg/workflow/... pass
Task 5: Split import_field_extractor.go — extract activation field group
Priority: Low | Effort: Small | Region: pkg/parser/import_field_extractor.go lines 419–529
Description: Move extractActivationFields, extractActivationSkipMatchFields, extractActivationGitHubToken, extractActivationGitHubAppFields, and extractCheckoutField into pkg/parser/import_field_extractor_activation.go. All are *importAccumulator methods; receiver type stays in original file.
Acceptance Criteria:
import_field_extractor_activation.go created with package parser
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report — Large File Refactoring & Maintainability
Analysis Date: 2026-06-05 | Strategy Type: Reuse (random=91, 10% tier) | Custom Area: No
Executive Summary
Original analysis: 2026-05-20. This reuse run confirms zero refactoring progress: 35 source files still exceed 800 lines (up from 28 in May), with the top file at 1866 lines. The largest contributors remain in
pkg/workflow/andpkg/parser/.Each oversized file bundles distinct logical concerns, inflating review surface and complicating unit testing. The handler registry alone in
safe_outputs_config.gois 924 lines and can be split with zero API changes. Five concrete split tasks are provided below — all are within-package moves requiring no import changes.Full Analysis Report
Current State Assessment
safe_outputs_config.go)Top 10 oversized files:
pkg/workflow/safe_outputs_config.gopkg/parser/remote_fetch.gopkg/parser/import_field_extractor.gopkg/workflow/frontmatter_extraction_yaml.gopkg/workflow/compiler_jobs.gopkg/cli/audit.gopkg/workflow/compiler_yaml_main_job.gopkg/workflow/cache.gopkg/workflow/compiler_yaml.gopkg/cli/logs_orchestrator.goFindings
Strengths
Areas for Improvement
safe_outputs_config.golines 781–1704 (~924 lines): thehandlerRegistrymap literal is the single largest contiguous block in the codebase.remote_fetch.golines 699–823 (~125 lines): symlink group (checkRemoteSymlink,resolveRemoteSymlinks, family) is fully self-contained.domains.golines 26–236 (~210 lines): per-engine domainvardeclarations are pure data before any function definitions.compiler_yaml.golines 463–757 (~295 lines):generatePromptand five helpers have no dependency on surrounding YAML generation.import_field_extractor.golines 419–529 (~110 lines): contiguous activation-field extraction group.🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Task 1: Extract handler registry from
safe_outputs_config.goPriority: High | Effort: Small | Region:
pkg/workflow/safe_outputs_config.golines 781–1704Description: Move
handlerRegistryvar,handlerBuildertype, and all handler builder closures (~924 lines) into a new filepkg/workflow/safe_outputs_handlers.go(package workflow). Also movebuildMentionsHandlerConfigif only referenced by the registry. Pure move, no signature changes.Acceptance Criteria:
safe_outputs_handlers.gocreated withpackage workflowsafe_outputs_config.godrops below 950 linesgo build ./...andgo test ./pkg/workflow/...passTask 2: Split
remote_fetch.go— extract symlink resolutionPriority: High | Effort: Small | Region:
pkg/parser/remote_fetch.golines 699–823Description: Move
checkRemoteSymlink,resolveRemoteSymlinks,resolveRemoteSymlinkComponent,resolveAndValidateRemoteSymlinkBaseintopkg/parser/remote_symlinks.go. Preserve the//go:build !js && !wasmconstraint.remoteLogstays inremote_fetch.goand is accessible package-wide.Acceptance Criteria:
remote_symlinks.gocreated withpackage parserand correct build tagremote_fetch.godrops below 1220 linesgo build ./...andgo test ./pkg/parser/...passTask 3: Split
domains.go— extract engine-specific domain declarationsPriority: Medium | Effort: Small | Region:
pkg/workflow/domains.golines 26–236Description: Move all per-engine
vardeclarations (CopilotDefaultDomains,CodexDefaultDomains,ClaudeDefaultDomains,AntigravityDefaultDomains,GeminiDefaultDomains, Pi/Crush/OpenCode variants, provider maps) intopkg/workflow/domains_engine_defaults.go. Theinit()function and all lookup functions stay indomains.go.Acceptance Criteria:
domains_engine_defaults.gocreated withpackage workflowdomains.godrops below 850 linesgo build ./...andgo test ./pkg/workflow/...passTask 4: Split
compiler_yaml.go— extract prompt generationPriority: Medium | Effort: Small | Region:
pkg/workflow/compiler_yaml.golines 463–800Description: Extract
generatePromptand its five helpers (writePromptBashStep,generatePreSteps,generatePostSteps,generatePreAgentSteps,writeStepsSection) intopkg/workflow/compiler_yaml_prompt.go. All are*Compilermethods or package helpers; no import changes needed.Acceptance Criteria:
compiler_yaml_prompt.gocreated withpackage workflowcompiler_yaml.godrops below 780 linesgo build ./...andgo test ./pkg/workflow/...passTask 5: Split
import_field_extractor.go— extract activation field groupPriority: Low | Effort: Small | Region:
pkg/parser/import_field_extractor.golines 419–529Description: Move
extractActivationFields,extractActivationSkipMatchFields,extractActivationGitHubToken,extractActivationGitHubAppFields, andextractCheckoutFieldintopkg/parser/import_field_extractor_activation.go. All are*importAccumulatormethods; receiver type stays in original file.Acceptance Criteria:
import_field_extractor_activation.gocreated withpackage parserimport_field_extractor.godrops below 1200 linesgo build ./...andgo test ./pkg/parser/...pass📊 Historical Context
Previous Focus Areas (last 12 runs)
📈 Success Metrics
safe_outputs_config.go: 1866 → target ≤ 950remote_fetch.go: 1342 → target ≤ 1220compiler_yaml.go: 1071 → target ≤ 780References: run 27018555217
Beta Was this translation helpful? Give feedback.
All reactions