-
Notifications
You must be signed in to change notification settings - Fork 1
Add Prompt field to Result struct combining rules and task content #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the prompt output mechanism by adding a Prompt field to the Result struct that pre-combines all rules and task content. This simplifies the output logic in main.go from manually iterating through rules and task to a single print statement.
Key Changes:
- Added
Promptfield toResultstruct containing pre-assembled rules and task content - Simplified main output logic from multiple loops to a single print statement
- Added unit tests for the new
Promptfield
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/codingcontext/result.go | Added Prompt string field to store combined rules and task content |
| pkg/codingcontext/context.go | Implemented prompt building logic that concatenates all rule contents with newlines and appends task content |
| main.go | Replaced manual iteration over rules and task with single fmt.Println(result.Prompt) call |
| pkg/codingcontext/result_test.go | Added table-driven test cases for the Prompt field |
The test now creates temporary files and calls Context.Run() to verify that the Prompt field is correctly populated by the context assembly logic, instead of manually setting the Prompt field and checking it equals itself. Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Plan: Add Prompt field to Result struct
Promptfield to theResultstruct inresult.gocontext.goto populate thePromptfield when creating the Resultmain.goto use theresult.Promptfield instead of manually combining rules and taskPromptfield inresult_test.goSummary
Successfully added a
Promptfield to theResultstruct that combines all rules and task content. The implementation:Original prompt
💡 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.