From e2206d7a96c9489eb3425ab660b2847c8d52eb91 Mon Sep 17 00:00:00 2001 From: webdevcody Date: Sun, 4 Jan 2026 01:56:45 -0500 Subject: [PATCH] feat: add thorough verification process and enhance agent output modal - Introduced a new markdown file outlining a mandatory 3-pass verification process for code completion, focusing on correctness, edge cases, and maintainability. - Updated the AgentInfoPanel to display a todo list for non-backlog features, ensuring users can see the agent's current tasks. - Enhanced the AgentOutputModal to support a summary view, extracting and displaying summary content from raw log output. - Improved the log parser to extract summaries from various formats, enhancing the overall user experience and information accessibility. --- .claude/commands/thorough.md | 45 ++++++ .../kanban-card/agent-info-panel.tsx | 39 ++++++ .../board-view/dialogs/agent-output-modal.tsx | 48 +++++-- apps/ui/src/lib/agent-context-parser.ts | 129 +++++++++++++----- apps/ui/src/lib/log-parser.ts | 47 +++++++ 5 files changed, 264 insertions(+), 44 deletions(-) create mode 100644 .claude/commands/thorough.md diff --git a/.claude/commands/thorough.md b/.claude/commands/thorough.md new file mode 100644 index 00000000..c69ada0f --- /dev/null +++ b/.claude/commands/thorough.md @@ -0,0 +1,45 @@ +When you think you are done, you are NOT done. + +You must run a mandatory 3-pass verification before concluding: + +## Pass 1: Correctness & Functionality + +- [ ] Verify logic matches requirements and specifications +- [ ] Check type safety (TypeScript types are correct and complete) +- [ ] Ensure imports are correct and follow project conventions +- [ ] Verify all functions/classes work as intended +- [ ] Check that return values and side effects are correct +- [ ] Run relevant tests if they exist, or verify testability +- [ ] Confirm integration with existing code works properly + +## Pass 2: Edge Cases & Safety + +- [ ] Handle null/undefined inputs gracefully +- [ ] Validate all user inputs and external data +- [ ] Check error handling (try/catch, error boundaries, etc.) +- [ ] Verify security considerations (no sensitive data exposure, proper auth checks) +- [ ] Test boundary conditions (empty arrays, zero values, max lengths, etc.) +- [ ] Ensure resource cleanup (file handles, connections, timers) +- [ ] Check for potential race conditions or async issues +- [ ] Verify file path security (no directory traversal vulnerabilities) + +## Pass 3: Maintainability & Code Quality + +- [ ] Code follows project style guide and conventions +- [ ] Functions/classes are single-purpose and well-named +- [ ] Remove dead code, unused imports, and console.logs +- [ ] Extract magic numbers/strings into named constants +- [ ] Check for code duplication (DRY principle) +- [ ] Verify appropriate abstraction levels (not over/under-engineered) +- [ ] Add necessary comments for complex logic +- [ ] Ensure consistent error messages and logging +- [ ] Check that code is readable and self-documenting +- [ ] Verify proper separation of concerns + +**For each pass, explicitly report:** + +- What you checked +- Any issues found and how they were fixed +- Any remaining concerns or trade-offs + +Only after completing all three passes with explicit findings may you conclude the work is done. diff --git a/apps/ui/src/components/views/board-view/components/kanban-card/agent-info-panel.tsx b/apps/ui/src/components/views/board-view/components/kanban-card/agent-info-panel.tsx index b36dea20..1fbe6ee1 100644 --- a/apps/ui/src/components/views/board-view/components/kanban-card/agent-info-panel.tsx +++ b/apps/ui/src/components/views/board-view/components/kanban-card/agent-info-panel.tsx @@ -255,6 +255,45 @@ export function AgentInfoPanel({ ); } + // Show just the todo list for non-backlog features when showAgentInfo is false + // This ensures users always see what the agent is working on + if (!showAgentInfo && feature.status !== 'backlog' && agentInfo && agentInfo.todos.length > 0) { + return ( +
+
+ + + {agentInfo.todos.filter((t) => t.status === 'completed').length}/ + {agentInfo.todos.length} tasks + +
+
+ {agentInfo.todos.map((todo, idx) => ( +
+ {todo.status === 'completed' ? ( + + ) : todo.status === 'in_progress' ? ( + + ) : ( + + )} + + {todo.content} + +
+ ))} +
+
+ ); + } + // Always render SummaryDialog if showAgentInfo is true (even if no agentInfo yet) // This ensures the dialog can be opened from the expand button return ( diff --git a/apps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx b/apps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx index 58fe3ad6..5124f7af 100644 --- a/apps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx +++ b/apps/ui/src/components/views/board-view/dialogs/agent-output-modal.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState, useMemo } from 'react'; import { Dialog, DialogContent, @@ -6,12 +6,14 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/dialog'; -import { Loader2, List, FileText, GitBranch } from 'lucide-react'; +import { Loader2, List, FileText, GitBranch, ClipboardList } from 'lucide-react'; import { getElectronAPI } from '@/lib/electron'; import { LogViewer } from '@/components/ui/log-viewer'; import { GitDiffPanel } from '@/components/ui/git-diff-panel'; import { TaskProgressPanel } from '@/components/ui/task-progress-panel'; +import { Markdown } from '@/components/ui/markdown'; import { useAppStore } from '@/store/app-store'; +import { extractSummary } from '@/lib/log-parser'; import type { AutoModeEvent } from '@/types/electron'; interface AgentOutputModalProps { @@ -27,7 +29,7 @@ interface AgentOutputModalProps { projectPath?: string; } -type ViewMode = 'parsed' | 'raw' | 'changes'; +type ViewMode = 'summary' | 'parsed' | 'raw' | 'changes'; export function AgentOutputModal({ open, @@ -40,8 +42,14 @@ export function AgentOutputModal({ }: AgentOutputModalProps) { const [output, setOutput] = useState(''); const [isLoading, setIsLoading] = useState(true); - const [viewMode, setViewMode] = useState('parsed'); + const [viewMode, setViewMode] = useState(null); const [projectPath, setProjectPath] = useState(''); + + // Extract summary from output + const summary = useMemo(() => extractSummary(output), [output]); + + // Determine the effective view mode - default to summary if available, otherwise parsed + const effectiveViewMode = viewMode ?? (summary ? 'summary' : 'parsed'); const scrollRef = useRef(null); const autoScrollRef = useRef(true); const projectPathRef = useRef(''); @@ -299,8 +307,8 @@ export function AgentOutputModal({ className="w-[60vw] max-w-[60vw] max-h-[80vh] flex flex-col" data-testid="agent-output-modal" > - -
+ +
{featureStatus !== 'verified' && featureStatus !== 'waiting_approval' && ( @@ -308,10 +316,24 @@ export function AgentOutputModal({ Agent Output
+ {summary && ( + + )}