Refactor large workflows into modular shared components#8849
Merged
Conversation
- Extract chart generation to shared/session-analysis-charts.md - Extract analysis strategies to shared/session-analysis-strategies.md - Remove 345 lines of redundant content (46% reduction) - Workflow compiles successfully Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Extract CI data analysis to shared/ci-data-analysis.md - Extract optimization strategies to shared/ci-optimization-strategies.md - Remove 445 lines of redundant content (61% reduction) - Workflow compiles successfully Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Document refactoring principles and patterns - Provide examples from copilot-session-insights and ci-coach - Define shared module structure patterns - Include anti-patterns to avoid - Create refactoring checklist Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Add concrete examples to anti-patterns section - Document shell requirement for RANDOM variable - Clarify YAML context in CI optimization example Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor agentic workflows for complexity reduction
Refactor large workflows into modular shared components
Jan 4, 2026
pelikhan
approved these changes
Jan 4, 2026
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.
Five workflows grew to 600-748 lines with mixed concerns, impeding maintenance and reuse. This refactors two high-priority workflows by extracting common patterns into shared modules.
Refactored Workflows
copilot-session-insights.md: 748 → 403 lines (-46%)
shared/session-analysis-charts.md(118 lines)shared/session-analysis-strategies.md(242 lines)ci-coach.md: 725 → 281 lines (-61%)
shared/ci-data-analysis.md(173 lines)shared/ci-optimization-strategies.md(193 lines)Pattern
Main workflows now compose via imports:
Shared modules handle single concerns: data collection, analysis strategies, visualization, or reporting.
Additional Modules
Created
shared/token-cost-analysis.md(317 lines) with reusable token aggregation and cost tracking patterns for token reporting workflows.Documentation
Added
specs/workflow-refactoring-patterns.mdcovering:Remaining Work
Three workflows identified for future refactoring:
daily-copilot-token-report.md(680 lines)prompt-clustering-analysis.md(639 lines)developer-docs-consolidator.md(623 lines)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.