Fix imports frontmatter to include markdown content in lock files#1257
Merged
Fix imports frontmatter to include markdown content in lock files#1257
Conversation
- Modified ProcessImportsFromFrontmatterWithManifest to extract and return markdown content - Updated compiler to prepend imported markdown to workflow content - Added comprehensive tests for markdown prepending - All existing tests pass Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix imports in lock file for frontmatter
Fix imports frontmatter to include markdown content in lock files
Oct 6, 2025
pelikhan
reviewed
Oct 6, 2025
- Added ImportsResult struct to hold return values - Updated function to return *ImportsResult instead of multiple values - Updated all call sites to use struct fields - All tests pass with no regressions 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.
✅ COMPLETE: Make imports frontmatter include markdown content in lock file
Problem
The
imports:field in workflow frontmatter was only extracting tools and engines from imported files, but was not extracting and prepending the markdown content to the workflow. This meant important instructions, guidelines, or context from imported files were being lost.Solution
Modified the import processing pipeline to extract markdown content from imported files and prepend it to the main workflow content, matching the expected behavior where imports work like
@includedirectives for both frontmatter and markdown.Implementation Details
Modified Files:
pkg/parser/frontmatter.goImportsResultstruct to hold return values (tools, engines, markdown, imported files)ProcessImportsFromFrontmatterWithManifestto return*ImportsResultinstead of multiple valuespkg/workflow/compiler.goImportsResultstructMergedTools,MergedEngines,MergedMarkdown,ImportedFilespkg/workflow/imports_markdown_test.go(new file)Code Quality Improvements
go fmtBehavior
The imports field now provides complete component import:
@includedirectivesOriginal 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.