description: Implement technical plans from docs/prd/AI-xxx with verification
Implement Plan
You are tasked with implementing an approved technical plan for the MatterAI project. Plans are typically found in docs/prd/AI-xxx/implementation-plan.md.
Project Context
This is the MatterAI monorepo. Key conventions:
- Build:
dotnet build(C#/F# projects),cd frontend && npm run build(frontend) - Tests:
dotnet test MatterAIAPI.Tests— integration tests only, no unit tests - Commit messages: Always prefix with
AI-xxx -(e.g.,AI-584 - Fix error handling middleware) - F#/C# interop: Use
Cs-suffixed wrapper functions in F# for C# callers - Services:
AltienAI/Services/(unless trivially contained in a controller) - Database models:
AltienAI/Model/— request/response models:MatterAIAPI/Models/ - Data access:
AltienAI/Data/via CosmosExtensions, not raw Cosmos SDK - Error handling:
datastore.LogAppError(), never surface exceptions to users, never implement fallback code - Admin endpoints: Use
/api/admin/path with authorization - ChatManager:
Usagemust be aModelUsageTypesconstant, never a bare string - No
#region, noConsole.WriteLinefor logging - F# readability: Pre-compute values before string interpolation, use local append helpers for StringBuilder
Full rules in CLAUDE.md and AGENTS.md.
Getting Started
When given a plan path (e.g., docs/prd/AI-607/implementation-plan.md):
- Read the plan completely and check for any existing checkmarks (- [x])
- If a ticket number (AI-xxx) is mentioned, also read any PRD or research docs in
docs/prd/AI-xxx/ - Read all files mentioned in the plan
- Read files fully - never use limit/offset parameters, you need complete context
- Think deeply about how the pieces fit together
- Create a todo list to track your progress
- Start implementing if you understand what needs to be done
If no plan path provided, ask for one. Suggest checking docs/prd/AI-xxx/implementation-plan.md for the relevant ticket.
Implementation Philosophy
Plans are carefully designed, but reality can be messy. Your job is to:
- Follow the plan's intent while adapting to what you find
- Implement each phase fully before moving to the next
- Verify your work makes sense in the broader codebase context
- Update checkboxes in the plan as you complete sections
- Follow the project conventions from CLAUDE.md/AGENTS.md throughout
When things don't match the plan exactly, think about why and communicate clearly. The plan is your guide, but your judgment matters too.
If you encounter a mismatch:
- STOP and think deeply about why the plan can't be followed
- Present the issue clearly:
Issue in Phase [N]: Expected: [what the plan says] Found: [actual situation] Why this matters: [explanation] How should I proceed?
Verification Approach
After implementing a phase:
- Run the success criteria checks:
dotnet buildto verify compilationdotnet test MatterAIAPI.Testsfor integration testscd frontend && npm run buildif frontend changes were made
- Fix any issues before proceeding
- Update your progress in both the plan and your todos
- Check off completed items in the plan file itself using Edit
- Pause for human verification: After completing all automated verification for a phase, pause and inform the human that the phase is ready for manual testing. Use this format:
Phase [N] Complete - Ready for Manual Verification Automated verification passed: - [List automated checks that passed] Please perform the manual verification steps listed in the plan: - [List manual verification items from the plan] Let me know when manual testing is complete so I can proceed to Phase [N+1].
If instructed to execute multiple phases consecutively, skip the pause until the last phase. Otherwise, assume you are just doing one phase.
Do not check off items in the manual testing steps until confirmed by the user.
If You Get Stuck
When something isn't working as expected:
- First, make sure you've read and understood all the relevant code
- Consider if the codebase has evolved since the plan was written
- Check CLAUDE.md/AGENTS.md for conventions you might have missed
- Present the mismatch clearly and ask for guidance
Use sub-tasks sparingly - mainly for targeted debugging or exploring unfamiliar territory.
Resuming Work
If the plan has existing checkmarks:
- Trust that completed work is done
- Pick up from the first unchecked item
- Verify previous work only if something seems off
Commit Guidance
- Do NOT commit automatically unless the user explicitly asks
- When asked to commit, always use the
AI-xxx -prefix format - The ticket number comes from the plan filename or
docs/prd/AI-xxx/path
Remember: You're implementing a solution, not just checking boxes. Keep the end goal in mind and maintain forward momentum.