agentleFS
zwjbendnzwjbendn/weight-loss-skill/weight-tracking/SKILL.md

weight-tracking

Skill1 starsChanged 9 months agoMITView on GitHub

Track body weight with full CRUD operations, unit conversion, and trend analysis. Trigger when user reports weight, asks about weight trend, wants to correct a weight entry, or change their unit preference. Trigger phrases: 'I weigh...', '体重...', '称了一下...', 'my weight is...', 'change to pounds', '改成斤', 'weight trend', '体重趋势'.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All display/output uses this preference, with values rounded to 1 decimal place

    line 48
  2. Distinctive:

    Auto-detect new vs correction: if the last entry is ≤ 30 minutes ago, overwrite it (treat as correction).

    line 65
  3. Very specific:

    Read timezone.json to get tz_offset (seconds)

    line 122
  4. Very specific:

    Read health-profile.md > Body > Unit Preference for display unit

    line 130
  5. Very specific:

    Call save with the reported value, unit, and timezone offset

    line 131
  6. Very specific:

    Check the response action field:

    line 132
  7. Very specific:

    Call load with appropriate filters and --display-unit

    line 140
  8. Very specific:

    If user says "that was wrong" / "刚才称错了" after a recent save → call save with --correct and the new value

    line 145
  9. Very specific:

    If user references a specific date → call update with the matching --key

    line 146
  10. Very specific:

    Call set-unit with the new unit

    line 150
  11. Very specific:

    Fasting tag: if the user mentions they haven't eaten yet, or it's a morning weigh-in before breakfast, note fasting: true in the response …

    line 158

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Weight Tracking

⚠️ SILENT OPERATION: Never narrate internal actions, skill transitions, or tool calls to the user. No "Let me check...", "Now I'll transition to...", "Reading your profile...". Just do it silently and respond with the result.

Manage body weight records with full CRUD operations. All data lives in a single JSON file; display always uses the user's preferred unit.

Data Storage

File: {workspaceDir}/data/weight.json

Format: JSON object keyed by ISO-8601 datetime (with timezone offset):

{
  "2026-03-01T08:30:00+08:00": { "value": 80, "unit": "kg" },
  "2026-03-04T07:45:00+08:00": { "value": 79.5, "unit": "kg" },
  "2026-03-04T21:00:00+08:00": { "value": 79.8, "unit": "kg" }
}
  • Each entry stores the original value and original unit as reported by the user
  • Multiple entries per day are supported (e.g., morning and evening weigh-ins)
  • Keys are sorted chronologically

Unit Preference

Stored in: health-profile.md > Body > Unit Preference

## Body
- **Unit Preference:** kg
  • Set during onboarding (inferred from user input: "80kg" → kg, "165 lbs" → lb, "130斤" → kg)
  • User can change at any time via set-unit command
  • All display/output uses this preference, with values rounded to 1 decimal place

Scripts

Script path: python3 {baseDir}/scripts/weight-tracker.py

1. Save — save

python3 {baseDir}/scripts/weight-tracker.py save \
  --data-dir {workspaceDir}/data \
  --value 79.5 --unit kg \
  --tz-offset 28800 \
  [--correct]
  • Reads timezone.json offset to generate local datetime key
  • Auto-detect new vs correction: if the last entry is ≤ 30 minutes ago, overwrite it (treat as correction). Otherwise, create a new entry.
  • --correct flag: force overwrite the most recent entry regardless of time gap (for when user explicitly says "that was wrong" / "刚才称错了")
  • Returns: { "action": "created" | "updated", "key": "<datetime>", "value": <n>, "unit": "<u>" }

2. Load — load

python3 {baseDir}/scripts/weight-tracker.py load \
  --data-dir {workspaceDir}/data \
  --display-unit kg \
  [--last 7] \
  [--from 2026-02-01 --to 2026-03-06]
  • Returns all matching entries converted to --display-unit, rounded to 1 decimal place
  • --last N: return the N most recent entries
  • --from / --to: filter by date range (inclusive)
  • Without filters: returns all entries

3. Delete — delete

python3 {baseDir}/scripts/weight-tracker.py delete \
  --data-dir {workspaceDir}/data \
  --key "2026-03-06T08:30:00+08:00"
  • Removes the entry with the exact datetime key
  • Returns confirmation or error if key not found

4. Update — update

python3 {baseDir}/scripts/weight-tracker.py update \
  --data-dir {workspaceDir}/data \
  --key "2026-03-06T08:30:00+08:00" \
  --value 75.0 --unit kg
  • Updates the value and unit for an existing entry
  • Returns confirmation or error if key not found

5. Set Unit Preference — set-unit

python3 {baseDir}/scripts/weight-tracker.py set-unit \
  --health-profile {workspaceDir}/health-profile.md \
  --unit lb
  • Updates health-profile.md > Body > Unit Preference
  • Returns confirmation with the new unit

Timezone Handling

The server runs in UTC. To record the correct local datetime:

  1. Read timezone.json to get tz_offset (seconds)
  2. Pass --tz-offset <seconds> to the save command
  3. The script calculates the user's local time and formats the key as ISO-8601 with offset (e.g., 2026-03-06T08:30:00+08:00)

Workflow

User Reports Weight

  1. Read health-profile.md > Body > Unit Preference for display unit
  2. Call save with the reported value, unit, and timezone offset
  3. Check the response action field:
    • "created" → confirm: "Logged ✓"
    • "updated" → confirm: "Updated ✓"
  4. Display the saved value in the user's preferred unit

User Asks for Trend / History

  1. Read health-profile.md > Body > Unit Preference
  2. Call load with appropriate filters and --display-unit
  3. Present the data (table, summary, or trend description depending on context)

User Wants to Correct an Entry

  1. If user says "that was wrong" / "刚才称错了" after a recent save → call save with --correct and the new value
  2. If user references a specific date → call update with the matching --key

User Changes Unit Preference

  1. Call set-unit with the new unit
  2. Confirm the change to the user

Interaction Guidelines

  • Never comment on weight changes unprompted. Just log and confirm. Emotional reactions to weight (positive or negative) are handled by the emotional-support skill.
  • Always display in preferred unit, rounded to 1 decimal place.
  • Accept any common unit in user input: kg, lb, lbs, 斤 (catty = 0.5 kg), 公斤. Convert to standard kg or lb for storage.
  • Fasting tag: if the user mentions they haven't eaten yet, or it's a morning weigh-in before breakfast, note fasting: true in the response context (for notification-composer to use). If they've already eaten, note fasting: false.

Used By Other Skills

This skill's script is called by other skills for weight data access:

SkillUsage
notification-composersave when user replies to weight reminder; load --last 1 to check if already weighed today
weekly-reportload --from --to for weekly weight trend
emotional-supportload --last N for recent weight context
habit-builderload for weight trend analysis
user-onboarding-profilesave to record initial weight during onboarding
weight-loss-plannerload --last 1 to get current weight for calculations

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.