Skip to content

Add AI agent onboarding with returning athlete flow - #377

Open
cancelei wants to merge 4 commits into
nopara73:masterfrom
cancelei:master
Open

Add AI agent onboarding with returning athlete flow#377
cancelei wants to merge 4 commits into
nopara73:masterfrom
cancelei:master

Conversation

@cancelei

@cancelei cancelei commented Feb 19, 2026

Copy link
Copy Markdown

Summary

  • AI Agent onboarding skill (/lwc-apply) -- conversational application flow via Claude Code / OpenClaw that walks users through biomarker entry, PhenoAge calculation, profile creation, image handling, and API submission
  • Returning athlete confirmation flow -- existing athletes can confirm, update profiles, or submit new biomarker results via GET /api/agent/athlete/{slug} and POST /api/agent/confirm
  • Lab report vision extraction -- reads lab report images (21 international labs tested) and extracts biomarker values with unit conversion, supporting English, Czech, Spanish, German, Portuguese, Russian, and more
  • Participation tracking -- CycleParticipationDataService tracks per-season engagement (new applications, confirmations, updates, new results)
  • Agent application management -- token-based application tracking with AgentController endpoints and AgentApplicationDataService

New files

File Purpose
Controllers/AgentController.cs API endpoints for agent apply, confirm, status, athlete lookup, cycle stats
Business/ApplicationService.cs Extracted application processing logic (email, ZIP, image optimization)
Business/AgentApplicationDataService.cs Token-based agent application storage (SQLite)
Business/CycleParticipationDataService.cs Season participation tracking
Business/AgentApplicantData.cs Agent-specific applicant data model
Business/AthleteConfirmationData.cs Returning athlete confirmation request model
wwwroot/onboarding/agent-apply.html Web page linking to the AI agent skill
skills/longevity-world-cup/SKILL.md OpenClaw skill definition (v3.0-v3.6)
.claude/commands/lwc-apply.md Claude Code slash command version
CLAUDE.md Project guide for AI-assisted development

Modified files

  • Program.cs -- DI registration for new services
  • DailyJob.cs -- token cleanup + season backfill
  • join-game.html -- added "Apply via AI Agent" button
  • ApplicationReviewer/Program.cs -- enhanced review tooling
  • Config.cs, SeasonFinalizerService.cs -- minor supporting changes

Lab report extraction accuracy

Tested across 21 international labs (US, AU, CZ, DE, BR, SG, IN, IS, LV, RU, UAE), 10 athletes, ~167 biomarkers: ~97% extraction rate, ~98% match rate.


How to Test the AI Skill

The skill can be tested through three clients. Each uses the same backend API but loads the skill instructions differently.

Prerequisites (all clients)

  1. Clone this branch and run the server locally:

    dotnet run --project LongevityWorldCup.Website

    The server starts at https://localhost:5001 (or http://localhost:5000).

  2. Verify the API endpoints are working:

    # Should return list of athletes
    curl -s https://localhost:5001/api/data/athletes | head -c 200
    
    # Should return athlete profile with PhenoAge
    curl -s https://localhost:5001/api/agent/athlete/nopara73
    
    # Should return cycle stats
    curl -s https://localhost:5001/api/agent/cycle-stats

Client 1: Claude Code (slash command)

What it uses: .claude/commands/lwc-apply.md

Setup:

  1. Install Claude Code if not already installed
  2. cd into the project directory (where .claude/commands/ lives)
  3. The slash command is auto-discovered -- no additional installation needed

Test steps:

# Action Expected result
1 Run /lwc-apply http://localhost:5000 Agent greets you with the Longevity World Cup intro and asks for biomarkers
2 Say: "I want to apply" Agent starts Step 1 (Introduction), explains what's needed
3 Provide 9 biomarkers: Albumin 45 g/L, Creatinine 80 umol/L, Glucose 5.2 mmol/L, CRP 0.5 mg/L, WBC 5.5, Lymphocytes 35%, MCV 88 fL, RDW 12.5%, ALP 65 U/L. Test date: 2025-06-15 Agent acknowledges values, checks ranges, asks for DOB
4 Provide DOB: 1985-03-20 Agent calculates PhenoAge using Levine 2018 algorithm, shows result card with tier commentary
5 Say: "skip" (sharing prompt) Agent moves to profile info collection
6 Provide: Name: Test Athlete, Division: Men's, Flag: United States, Email: test@test.com Agent validates against API (/api/data/divisions, /api/data/flags), confirms
7 Provide a profile pic and proof pic file path Agent base64-encodes the images
8 Confirm the review summary Agent POSTs to /api/agent/apply, returns tracking token
9 Say: "check my status" + paste the token Agent calls /api/agent/status/{token}, shows "pending"

Test returning athlete flow:

# Action Expected result
1 Run /lwc-apply http://localhost:5000 Agent greets you
2 Say: "I'm nopara73, I competed last season" Agent calls GET /api/data/athletes, finds match, calls GET /api/agent/athlete/nopara73
3 (automatic) Agent displays the RETURNING ATHLETE confirmation card with biomarkers, PhenoAge, rank, any warnings/suggestions
4 Say: "confirm" Agent asks for account email, then POSTs to /api/agent/confirm with action: "confirm"

Test lab report reading:

# Action Expected result
1 Start /lwc-apply and reach Step 2 (biomarkers) Agent asks for biomarkers
2 Provide a file path to a lab report image: /path/to/lab-report.jpg Agent reads the image with the Read tool, identifies the lab provider, extracts biomarker values with units, assigns a confidence level (HIGH/MEDIUM/LOW), presents a confirmation table
3 Confirm the extracted values Agent proceeds with unit conversion and PhenoAge calculation

Client 2: OpenClaw (skill)

What it uses: skills/longevity-world-cup/SKILL.md

Setup:

  1. Install OpenClaw if not already installed
  2. Either:
    • Option A (local workspace): Run OpenClaw from the project root directory. It auto-discovers skills/longevity-world-cup/SKILL.md from the skills/ folder.
    • Option B (ClawHub install): Once published, users will install via clawhub install longevity-world-cup
    • Option C (manual): Copy skills/longevity-world-cup/ to ~/.openclaw/skills/

Verify skill is loaded:

openclaw skills list
# Should show: longevity-world-cup - Apply to the Longevity World Cup via conversational AI

Test steps (via any connected channel -- Discord, Telegram, Slack, WhatsApp, or CLI):

# Action Expected result
1 Send: "I want to apply to the Longevity World Cup" OpenClaw loads the longevity-world-cup skill, agent greets with intro
2 Provide biomarkers (same as Claude Code test above) Agent validates, detects units, asks for DOB
3 Provide DOB PhenoAge calculated and revealed with tier commentary
4 Complete profile info + images Agent builds review summary
5 Confirm Agent submits via curl to the API, returns tracking token
6 Send: "I'm back for the new season" with a name that matches an existing athlete Agent routes to Step 12 (Returning Athlete), shows confirmation card

Note: OpenClaw's skill uses curl for API calls (declared in requires.bins), while Claude Code's slash command uses the Bash tool. The conversation flow and validation logic are identical.


Client 3: Web Page (manual + link to AI agents)

What it uses: wwwroot/onboarding/agent-apply.html

Test steps:

# Action Expected result
1 Navigate to http://localhost:5000/onboarding/join-game.html Page shows Amateur/Professional track cards + "Apply via AI Agent" button at the bottom
2 Click "Apply via AI Agent" Navigates to /onboarding/agent-apply.html
3 Verify page shows 3 options: Claude Code (/lwc-apply), OpenClaw (clawhub install), Manual Application All three sections visible with correct commands
4 Paste a valid tracking token into "Track Your Application" input, click "Check Status" Calls /api/agent/status/{token}, displays result (pending/approved/rejected)
5 Paste an invalid token, click "Check Status" Shows "No application found for this token" error

API Endpoint Verification (all clients)

These endpoints should all work regardless of which client is used:

# New application
curl -s -X POST http://localhost:5000/api/agent/apply \
  -H "Content-Type: application/json" \
  -d '{"Name":"Test","Division":"Open","Flag":"United States","AccountEmail":"test@test.com","DateOfBirth":{"Year":1990,"Month":1,"Day":1},"Biomarkers":[{"Date":"2025-06-15","AlbGL":45,"CreatUmolL":80,"GluMmolL":5.2,"CrpMgL":0.5,"Wbc1000cellsuL":5.5,"LymPc":35,"McvFL":88,"RdwPc":12.5,"AlpUL":65}],"ProfilePic":"data:image/png;base64,iVBORw0KGgo=","ProofPics":["data:image/png;base64,iVBORw0KGgo="]}'
# Expected: 200 with {"token":"...","name":"Test"}

# Check status
curl -s http://localhost:5000/api/agent/status/{token}
# Expected: 200 with {"token":"...","name":"Test","status":"pending"}

# Athlete lookup (returning athlete)
curl -s http://localhost:5000/api/agent/athlete/nopara73
# Expected: 200 with full profile, PhenoAge, biomarkers, suggestions, warnings

# Confirm participation
curl -s -X POST http://localhost:5000/api/agent/confirm \
  -H "Content-Type: application/json" \
  -d '{"athleteSlug":"nopara73","action":"confirm","accountEmail":"test@test.com"}'
# Expected: 200 with confirmation message

# Cycle stats
curl -s http://localhost:5000/api/agent/cycle-stats
# Expected: 200 with season participation breakdown

Test plan

  • dotnet build compiles with 0 errors, 0 warnings
  • GET /api/agent/athlete/nopara73 returns full profile with PhenoAge
  • POST /api/agent/apply creates application with tracking token
  • GET /api/agent/status/{token} returns application status
  • POST /api/agent/confirm with action "confirm" records participation
  • GET /api/agent/cycle-stats returns season statistics
  • "Apply via AI Agent" button visible on join-game page
  • Claude Code: /lwc-apply triggers the full application flow
  • OpenClaw: skill loads from skills/ folder and handles new + returning athletes
  • Web: agent-apply.html shows all 3 options and status checker works

🤖 Generated with Claude Code

Glauber Bannwart and others added 4 commits February 17, 2026 21:12
Introduce infrastructure for existing athletes to re-engage through the
AI agent: confirm their data, update profiles, or submit new biomarker
results. Adds per-season participation tracking with cycle stats.

New files:
- CycleParticipationDataService: SQLite table + service for tracking
  participation per season (confirm/update/new_results)
- AthleteConfirmationData: request model for confirm endpoint
- AgentController, ApplicationService, AgentApplicationDataService:
  agent API with apply, confirm, status, and cycle-stats endpoints
- lwc-apply.md skill with returning athlete confirmation flow,
  lab file reading, and auto-detection of existing athletes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Skill updates (SKILL.md + lwc-apply.md):
- v3.1: effectiveDisplayName, suggestions[], sanitized errors
- v3.2: Biomarker range warnings, incomplete set detection
- v3.3: Lab report vision extraction (unit conversions, aliases, confidence)
- v3.4: International lab coverage (PT/BR, Indian, German, app-based)
- v3.5: Expanded aliases (German, Spanish, British, Australian)
- v3.6: Russian lab support (Cyrillic aliases, INVITRO provider,
  "Previous result" column trap, CRP detection-limit rule fix)

Backend: Enhanced AgentController endpoints (warnings, suggestions,
effectiveDisplayName), CycleParticipationDataService improvements,
ApplicationReviewer updates, DailyJob backfill integration.

Tested across 21 international labs, 10 athletes, ~167 biomarkers
with ~97% extraction rate and ~98% match rate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts:
#	LongevityWorldCup.Website/Controllers/ApplicationController.cs
#	LongevityWorldCup.Website/wwwroot/onboarding/join-game.html
The Notify endpoint uses fire-and-forget Task.Run for webhooks
but never awaits directly. Changed signature from async to
synchronous with Task.FromResult returns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nopara73

nopara73 commented Feb 20, 2026

Copy link
Copy Markdown
Owner

concept review of the skills

AI Agent onboarding skill (/lwc-apply) -- conversational application flow via Claude Code / OpenClaw that walks users through biomarker entry, PhenoAge calculation, profile creation, image handling, and API submission

This should be useful and the main point in the skill, but the same question stands I asked in dm: aren't we too early for this? i mean how do you imagine people applying to LWC through AI agents? Not the workflow, but the very first step: them thinking of doing that in the first place? How do you get LWC to people who have an agent?

Returning athlete confirmation flow -- existing athletes can confirm, update profiles, or submit new biomarker results via GET /api/agent/athlete/{slug} and POST /api/agent/confirm

This comes after an AI agent user have applied already, so this is for completeness. It relies upon the first question.

Lab report vision extraction -- reads lab report images (21 international labs tested) and extracts biomarker values with unit conversion, supporting English, Czech, Spanish, German, Portuguese, Russian, and more

This is inevitable as it's good UX, but very problematic at this point. I'm already using an AI to check people's labs and it's making mistakes. However since the labs must be filled manually I can always check the diff between what the user typed and the AI extracted and that way I only have to check the mistakes manually. This feature would take out the human in the loop in a critical part where mistakes aren't allowed, so I don't see a way to go forward with this.

Participation tracking -- CycleParticipationDataService tracks per-season engagement (new applications, confirmations, updates, new results)

Again, this is good, but assumes agent user athletes, so the fundamental original question still stands.

Agent application management -- token-based application tracking with AgentController endpoints and AgentApplicationDataService

Same comment. Good, but presupposes agent users.

@cancelei

Copy link
Copy Markdown
Author

When it comes to questions that lean more toward business strategy:

Aren’t we too early for this?

Being early can be an advantage. And in this case, we’re definitely not first. It takes one prompt to discover companies already integrating AI agents into user workflows. This shift is already happening.

How do you imagine people applying to LWC through AI agents? Not the workflow — but the very first step: why would they even think of doing that?

It starts with competitive, performance-driven individuals — the kind of people who want to stand out. These users already rely on AI agents for daily tasks: morning briefings, email management, research summaries, scheduling. LWC can teach existing users about the new way of applying(or even new ways of managing longevity increasing habits via the AI based LWC UX), and ask for feedback that counts toward product-feature validation. It will be good because they could mention LWC to friends when they spread the word about using AI agents connected to their personal computer or the dedicated mac mini that is quite popular these days.

Research shows email is one of the primary use cases for AI agents today. That matters. Anyone who sends emails is already a potential integration point.

LWC becomes a “skill” or capability inside the agent ecosystem. If users are delegating communication, research, and administrative tasks to their AI, applying to LWC fits naturally into that behavior. It’s not a new habit — it’s an extension of an existing one.

Over time, this becomes normal. Instead of manually handling paperwork, people will instruct their AI to:

  • Respond to architects with structured project feedback
  • Fill out government forms using stored personal data
  • Apply to programs like LWC
  • Prepare documents and submissions

The shift isn’t whether this happens — it’s how quickly.

So the real question isn’t “Are we too early?”
It’s:

How do we make LWC discoverable and accessible inside the AI agent layer?

That means:

  • Making LWC machine-readable
  • Providing structured APIs
  • Designing prompts/templates agents can use
  • Positioning LWC as an action, not just a website
  • If users are moving toward agent-mediated internet usage, LWC has to exist where agents operate, not only where humans browse.

That’s how you get LWC to people who have an agent, and also reducing the friction (if the person trusts AI) when applying. So maybe in certain countries the skill will be used more often than in others. That would be my hint when looking at the usage data, and feedbacks are super appreciated too, specially if there are users rejoining LWC but they don't want to bother to manually type a whole form out. "A prompt away" just seams better and data will prove that in the context of LWC 2026.

Potential partnerships: apps that use AI to store/manage health data. With a skill, the application to LWC can start from within other platforms, if there is a good strategic partnership development going on. Examples: https://www.longevity-ai.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants