Fitness Copilot - đ Kiroween 2025
Source: Dev.to
Inspiration
What if you could snap a photo of your meal or workout and get instant, contextâaware feedback? Not just âthatâs 500 caloriesâ but âyouâve got 600âŻkcal left for today, and your leg workout is still pending.â
The idea originated from the desire to build something ambitious under hackathon constraintsâstitching together incompatible systems so they cooperate. With proper guardrails, specâdriven development, and tight steering docs, you can create features that would normally take weeks.
Fitness Copilot is an AIâpowered fitness tracking app that combines:
- Visionâbased logging â Snap a photo of your meal or exercise, and Google Gemini Vision analyzes it.
- Contextâaware coaching â The AI knows your training plan, todayâs progress, and recent conversation before responding.
- Validated tracking â All nutrition and exercise data is validated through Pydantic schemas before being stored in PostgreSQL.
Dual Interface
- Monitor â A typical dashboard with fitnessâapp metrics.
- Chat â An interactive chat interface for unstructured input and coaching.
The system doesnât just trackâit understands the full situation and provides personalized guidance.
Product Discovery Phase
Before the specâdriven stage, and in parallel with building guardrails, several interactions with Google Gemini AI Studio were crucial for deciding which features belong in the MVP.
- Working on a Codex/Geminiâlike UI/UX lets you focus on the frontend and conduct a product discovery stage.
- The fullâstack FastAPI template proved invaluable:
- A
README.mdhelps developers understand the project. - Steering commands from Kiro keep LLMâhuman interaction consistent.
- A polished taskârunner file (e.g.,
justfile) streamlines project workflows.
- A
Even when following SpecâDriven Development (SDD), drifts appear. After each slice, thorough testing is essential before moving on.
We used tight steering docs, inspired by Kiroâs âStop Repeating Yourselfâ blog post and the /reflect / /verify patterns popular in the SDD ecosystem. Steering documents tell Kiro not only what to build but also what not to build, encoding architectural decisions as rules:
- âCSV plans are immutable.â
- âAll calories must be validated.â
- âExercise names must come from an allowed list.â
Every major capability in the app has:
- A requirements spec in
.kiro/specs/... - Optional design notes
- A clear mapping to tests or acceptance criteria
The FastAPIâŻ+âŻReact code is consistently generated or refactored under those specs:
- Backend routes mirror spec sections.
- Frontend types are derived from OpenAPI.
- The Update DSL is treated as a firstâclass contract.
This structure ensures that before writing any code you know exactly what âdoneâ looks like. Specs become the source of truth, and Kiro generates implementations that match them.
Optional Design Notes
- Compounding Context â Agent Hooks validate the stitching between frontend types and backend models, automatically updating documentation whenever the schema changes.
- Manual vs. Automatic Hooks â Manual hooks are preferred during active development because they let you run validation when youâre ready, avoiding interruptions from automatic failures.
System Stitching Overview
AI Vision (flexible estimation)
â Pydantic Validation (enforces schema & ranges)
â PostgreSQL (stores structured data)
Natural language input
â Twoâtier parser (keyword matching + LLM fallback)
â Structured logs
Oracle Chat (adaptive, conversational) âď¸ Monitor Dashboard (rigid, mathematical)
The key innovation is context injection: before every AI request, we inject the userâs training plan, todayâs progress, and recent conversation. The AI therefore sees more than a photoâit understands the full situation.
Future Work
- Polish the initial userâsetup flow.
- Remove hardâcoded paths.
- Strengthen robustness against edge cases.
- Improve context engineering for even better responses.
- Add streaming support for video and audio responses.
- Leverage the AI assistant for any training or nutrition questions.
Key Takeaways
- SDD makes ambitious projects shippable under hackathon constraints.
- Product discovery (AI Studio) â Guardrails (templates) â Implementation (specsâŻ+âŻKiro).
- Steering docs prevent repeated mistakes by enforcing constraints.
- Manual hooks > automatic hooks during active development.
- Context injection is what makes AI feel alive and personalized.
References
- Martin Fowler: SpecâDriven Development with AI Tools
- Kiro Blog: Stop Repeating Yourself
Built for KiroweenâŻ2025
#codewithkiro #kiroween #specsnotcode