Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/codingcontext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ func (cc *Context) Run(ctx context.Context, taskName string) (*Result, error) {

// Build and return the result
result := &Result{
Name: taskName,
Rules: cc.rules,
Task: cc.task,
Skills: cc.skills,
Expand Down
1 change: 1 addition & 0 deletions pkg/codingcontext/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

// Result holds the assembled context from running a task
type Result struct {
Name string // Name of the task
Rules []markdown.Markdown[markdown.RuleFrontMatter] // List of included rule files
Task markdown.Markdown[markdown.TaskFrontMatter] // Task file with frontmatter and content
Skills skills.AvailableSkills // List of discovered skills (metadata only)
Expand Down
8 changes: 8 additions & 0 deletions pkg/codingcontext/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func TestResult_Prompt(t *testing.T) {
t.Fatalf("Run() error = %v", err)
}

if result.Name != tt.taskName {
t.Errorf("Result.Name = %q, want %q", result.Name, tt.taskName)
}

if result.Prompt != tt.want {
t.Errorf("Result.Prompt = %q, want %q", result.Prompt, tt.want)
}
Expand All @@ -77,6 +81,7 @@ func TestResult_MCPServers(t *testing.T) {
{
name: "no MCP servers",
result: Result{
Name: "test-task",
Rules: []markdown.Markdown[markdown.RuleFrontMatter]{},
Task: markdown.Markdown[markdown.TaskFrontMatter]{
FrontMatter: markdown.TaskFrontMatter{},
Expand All @@ -87,6 +92,7 @@ func TestResult_MCPServers(t *testing.T) {
{
name: "MCP servers from rules only",
result: Result{
Name: "test-task",
Rules: []markdown.Markdown[markdown.RuleFrontMatter]{
{
FrontMatter: markdown.RuleFrontMatter{
Expand All @@ -111,6 +117,7 @@ func TestResult_MCPServers(t *testing.T) {
{
name: "multiple rules with MCP servers and empty rule",
result: Result{
Name: "test-task",
Rules: []markdown.Markdown[markdown.RuleFrontMatter]{
{
FrontMatter: markdown.RuleFrontMatter{
Expand Down Expand Up @@ -139,6 +146,7 @@ func TestResult_MCPServers(t *testing.T) {
{
name: "rule without MCP server",
result: Result{
Name: "test-task",
Rules: []markdown.Markdown[markdown.RuleFrontMatter]{
{
FrontMatter: markdown.RuleFrontMatter{},
Expand Down