You have a working todo app that can add and display tasks. Your job: use your AI coding agent to implement three new features.
As a user, I want to delete tasks I no longer need.
- Backend (
src/lambda/handler.ts): ThedeleteTodofunction currently returns 501. Implement it using DynamoDB'sDeleteCommandto remove the item byid. - Frontend (
src/components/TodoItem.tsx): Add a delete button (trash icon) that appears on hover. - Hook (
src/hooks/useTodos.ts): ImplementdeleteTodo— callDELETE /todos/:idand remove from local state. - Wiring: Pass
deleteTodothroughTodoApp→TodoList→TodoItem.
- Clicking the delete button removes the task from the UI immediately
- The task is deleted from DynamoDB (doesn't reappear on refresh)
As a user, I want to mark tasks as done and see them visually change.
- Backend (
src/lambda/handler.ts): TheupdateTodofunction currently returns 501. Implement it using DynamoDB'sUpdateCommandwith dynamicUpdateExpressionfor the fields in the body. - Frontend (
src/components/TodoItem.tsx): Add a checkbox that toggles completion. Show strikethrough + dimmed text when completed. - Hook (
src/hooks/useTodos.ts): ImplementtoggleTodo— callPUT /todos/:idwith{ completed: !todo.completed }and update local state. - Wiring: Pass
toggleTodothroughTodoApp→TodoList→TodoItem.
- Clicking the checkbox toggles the completed state
- Completed tasks show with strikethrough text and a purple checkbox
- State persists across page refreshes
As a user, I want new tasks to be automatically categorized and prioritized by AI.
- Backend (
src/lambda/handler.ts): Thecategorizefunction currently returns 501. Implement it using theinvokeModel()helper (already in the file) to call Claude via AWS Bedrock. Prompt it to return JSON with{ category, priority }. - Types (
src/types/todo.ts): Add optionalcategoryandpriorityfields to theTodointerface. - Frontend: Create
CategoryBadgeandPriorityBadgecomponents. Display them inTodoItemwhen present. - Hook (
src/hooks/useTodos.ts): After creating a new todo, callPOST /categorizewith the text, then update the todo viaPUT /todos/:idwith the result.
work | personal | shopping | health | learning | other
high | medium | low
- New tasks automatically get a category badge and priority badge after a short delay
- Badges are color-coded (e.g., red for high priority, green for low)
- If AI categorization fails, fall back to
other/medium
- Look for
TODOcomments in the code — they mark exactly where changes are needed - The Lambda handler already imports
UpdateCommand,DeleteCommand, and the Bedrock client - The
invokeModel()helper in the Lambda is ready to use for Feature 3 - After making Lambda changes, rebuild and redeploy:
cd src/lambda && npm run build && cd ../../infra && pulumi up -y
- After making frontend changes, rebuild and redeploy:
NEXT_PUBLIC_API_URL=<your-api-url> npm run build && cd infra && pulumi up -y