From 8a651fd2428f82f93cc1256cfa09dcf34e79ed92 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sat, 2 Aug 2025 09:59:52 -0700 Subject: [PATCH] feat: include goal in task list output --- README.md | 4 ++++ internal/planning/manager.go | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d115dc36024f1cf8b263b9fc0b7447b585bb14aa..a64a863c4ff3bd23e16e2c6af0c2bfb644794578 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,8 @@ Response: `Tasks added successfully! Get started on your first one once you're r Response: ``` +**Goal:** Create a comprehensive MCP server for task planning and management + Legend: ☐ pending ⟳ in progress ☑ completed ☐ Set up project structure [a1b2c3d4] Create Go module, directories, and basic files @@ -149,6 +151,8 @@ Legend: ☐ pending ⟳ in progress ☑ completed Response: ``` +**Goal:** Create a comprehensive MCP server for task planning and management + Legend: ☐ pending ⟳ in progress ☑ completed ☑ Set up project structure [a1b2c3d4] Create Go module, directories, and basic files diff --git a/internal/planning/manager.go b/internal/planning/manager.go index 78e0e24a313d9739a37d347603627b5d89b55231..bda09b0e70ce033ec8ef9e675bfa2954ef5a767b 100644 --- a/internal/planning/manager.go +++ b/internal/planning/manager.go @@ -100,12 +100,23 @@ func (m *Manager) GetTasks() string { m.mu.RLock() defer m.mu.RUnlock() + var lines []string + + // Add goal if it exists + if m.goal != nil && m.goal.Text != "" { + lines = append(lines, fmt.Sprintf("**Goal:** %s", m.goal.Text)) + lines = append(lines, "") + } + if len(m.tasks) == 0 { + if len(lines) > 0 { + // We have a goal but no tasks + lines = append(lines, "No tasks defined yet.") + return strings.Join(lines, "\n") + } return "No tasks defined yet." } - var lines []string - // Sort tasks by creation time for consistent output taskList := make([]*Task, 0, len(m.tasks)) for _, task := range m.tasks {