Skip to content

[plan] Implement code organization improvements from semantic analysis #5677

@github-actions

Description

@github-actions

Overview

This tracking issue covers implementation of the refactoring recommendations identified in the semantic function clustering analysis.

Source: Issue #5506 - Semantic Function Clustering Analysis

Goals

  1. Eliminate duplicate functions across the codebase
  2. Consolidate small single-purpose files for better discoverability
  3. Ensure consistent validation logic across packages

Planned Sub-Tasks

This work is broken down into focused, sequential tasks:

  1. Consolidate extractErrorMessage() duplicate implementations - Unify two nearly identical functions with different performance characteristics
  2. Unify isMCPType() validation logic - Fix critical inconsistency where different files validate different type sets
  3. Consolidate prompt template files - Merge 5+ small prompt files into a single prompts.go file
  4. Review parseRunURL() wrapper necessity - Assess if the CLI wrapper adds value or just indirection
  5. Consolidate small utility files - Group related single-function utilities into coherent modules

Success Criteria

  • ✅ Zero duplicate implementations of core functions
  • ✅ Consistent validation logic across all packages
  • ✅ Reduced file count through logical consolidation
  • ✅ All tests passing (no functionality changes)
  • ✅ Maintained or improved code discoverability

Non-Goals

  • No changes to public APIs
  • No new features or functionality
  • No changes to validation rules (only consolidation)

Estimated Effort

Total: 11-16 hours across 5 focused tasks
Related to #5506

AI generated by Plan Command for #5506

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions