Deliver Step 9: agent-card.json, SKILL.md, USDA lookup, integrations dynamic config, Welcome/Integrations/MealPlan pages, API methods, README, routes

This commit is contained in:
Claude 2026-06-15 14:40:34 +00:00
parent 6fb5d759ef
commit c133a463ec
10 changed files with 751 additions and 33 deletions

View file

@ -0,0 +1,102 @@
{
"name": "Diligence Fitness Rewards",
"description": "Self-hosted fitness rewards platform with points-based behavioral economy. Your fitness data stays on your hardware. AI agents can log activities, query progress, manage meal plans, and configure device integrations via MCP.",
"url": "{BASE_URL}/mcp",
"provider": {
"organization": "DiligenceWorks Pte. Ltd.",
"url": "https://diligenceworks.online"
},
"version": "1.0.0",
"documentationUrl": "https://github.com/diligenceworks/diligence",
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": false
},
"authentication": {
"schemes": ["apiKey"],
"credentials": null
},
"defaultInputModes": ["text/plain", "application/json"],
"defaultOutputModes": ["application/json"],
"skills": [
{
"id": "context-status",
"name": "Context & Status",
"description": "Get full user profile with motivation type (BREQ-2), active program, points status, rewards, and integration connections. Includes get_context (full brief), get_today (daily points/gate), and get_week (weekly summary).",
"tags": ["fitness", "status", "profile", "motivation"],
"examples": [
"How am I doing today?",
"What's my weekly progress?",
"Show me my fitness dashboard"
]
},
{
"id": "activity-logging",
"name": "Activity Logging",
"description": "Record workouts, runs, walks, cycling, yoga, or any physical activity. Awards points based on activity type and duration. Supports structured program workouts via program_day parameter.",
"tags": ["fitness", "tracking", "points", "workout"],
"examples": [
"I just did a 30-minute run",
"Log my StrongLifts Workout B today",
"I did 45 minutes of yoga this morning"
]
},
{
"id": "nutrition-tracking",
"name": "Food & Nutrition",
"description": "Log food intake with calorie and macro tracking. Search Open Food Facts (4M+ products) and USDA FoodData Central (400K+ research-grade items). Awards points for consistent food logging.",
"tags": ["nutrition", "food", "tracking", "barcode", "search"],
"examples": [
"I had 2 eggs and toast for breakfast",
"Search for chicken breast nutrition",
"Log a salad for lunch, about 400 calories"
]
},
{
"id": "program-schedule",
"name": "Program Schedule",
"description": "View today's scheduled workout from the active program including exercises, sets, reps, and weight progression. Shows upcoming workouts and overall program completion percentage.",
"tags": ["program", "schedule", "workout", "planning"],
"examples": [
"What's my workout today?",
"Show me this week's program schedule",
"How far through my program am I?"
]
},
{
"id": "rewards",
"name": "Rewards",
"description": "View available rewards with point costs and spend earned points. Rewards are user-configurable (gaming time, screen time, treats, etc.). Points gate must be passed before redemption.",
"tags": ["rewards", "points", "spending", "gamification"],
"examples": [
"What rewards can I unlock?",
"Spend points on 30 minutes of gaming",
"Do I have enough points for a movie?"
]
},
{
"id": "meal-planning",
"name": "Meal Planning",
"description": "Create, view, and track AI-generated meal plans. The agent generates plan content; the app stores and tracks compliance. Includes load_meal_plan, get_meal_plan, update_meal_compliance, and get_plan_progress.",
"tags": ["nutrition", "meal-plan", "diet", "compliance"],
"examples": [
"Create a 7-day keto meal plan",
"What am I supposed to eat today?",
"I followed my breakfast plan",
"How's my meal plan compliance?"
]
},
{
"id": "device-integration",
"name": "Device Integration",
"description": "Configure connections to fitness devices and services (Strava, Polar, Garmin, Fitbit, WHOOP, Oura, Withings). Write-only credential storage — agent can set but never read credentials back.",
"tags": ["integration", "strava", "garmin", "fitbit", "sync"],
"examples": [
"Connect my Strava account",
"What integrations are available?",
"I want to set up my Garmin"
]
}
]
}

View file

@ -0,0 +1,50 @@
# Diligence — Agent Skill Definition
## What Is Diligence?
Diligence is a self-hosted fitness rewards platform. Users earn points through fitness activities (workouts, food logging, step goals) and spend them on configurable rewards (gaming time, screen time, etc.). A daily gate keeps rewards locked until enough points are earned. Points reset weekly.
## Architecture
- **Backend:** FastAPI (Python 3.12) + PostgreSQL 16
- **Frontend:** React 18 + Vite, served by nginx
- **MCP Connector:** FastMCP (Streamable HTTP/SSE) on port 3001, proxied via nginx at `/mcp`
- **Deployment:** Docker Compose (4 services: frontend, backend, mcp-connector, fitness-db)
## Connecting
Point your MCP client to:
- **Development:** `http://localhost:3001/sse`
- **Production:** `https://your-domain/mcp`
## Available Tools (14)
| Tool | Category | Description |
|------|----------|-------------|
| `get_context()` | Status | Full profile, motivation, program, rules, rewards |
| `get_today(date?)` | Status | Daily points, gate status, activities |
| `get_week(start_date?)` | Status | Weekly summary, active days |
| `log_activity(category, title, duration_minutes, ...)` | Activity | Log workout, earn points |
| `log_food(meal_type, food_name, ...)` | Food | Log food with macros |
| `search_food(query)` | Food | Search Open Food Facts + USDA |
| `get_program_schedule(date?)` | Programs | Today's workout from active program |
| `redeem_reward(reward_name)` | Rewards | Spend points on a reward |
| `load_meal_plan(name, duration_days, meals, ...)` | Meal Plans | Create a full meal plan |
| `get_meal_plan(date?)` | Meal Plans | View today's planned meals |
| `update_meal_compliance(plan_item_id, status, ...)` | Meal Plans | Mark meal followed/skipped |
| `get_plan_progress(plan_id?)` | Meal Plans | Compliance statistics |
| `configure_integration(provider, credentials)` | Integrations | Store encrypted credentials (write-only) |
| `get_integration_status()` | Integrations | Check provider connection status |
## Key Design Decisions
- The **agent generates meal plans** — the app only stores and tracks them. Zero AI API cost.
- Integration credentials are **write-only through MCP** — agents can set but never read them back.
- The app collects **BREQ-2 motivation data** during onboarding. Use `get_context()` to read the user's motivation profile and calibrate tone accordingly.
- Points reset weekly. Each week is a fresh start. No guilt carry-over.
## Source
- **Repository:** https://github.com/diligenceworks/diligence
- **License:** MIT
- **Built by:** DiligenceWorks Pte. Ltd. (https://diligenceworks.online)