weight-track-database

marcopeg's avatarfrom marcopeg

Describes the structure of the weight tracker database that allows to store and read weight records for the user

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 2, 2025

When & Why to Use This Skill

This Claude skill provides a robust framework for managing a personal weight tracking database. It enables the agent to perform structured CRUD operations (Create, Read, Update, Delete) on a JSON-based storage system, ensuring persistent health data tracking with a hierarchical time-based indexing (Year > Month > Day).

Use Cases

  • Daily Health Logging: Seamlessly record daily weight entries into a structured database with automatic handling of updates for existing dates.
  • Historical Data Retrieval: Access and review past weight records to monitor long-term fitness progress and health trends.
  • Data Aggregation and Analysis: Perform calculations and aggregations on stored weight data to provide users with weekly or monthly insights.
  • Automated Data Maintenance: Use the skill's logic to patch or rewrite the JSON database, ensuring data integrity and unit-agnostic storage.
nameWeight Track Database
descriptionDescribes the structure of the weight tracker database that allows to store and read weight records for the user
version1.0.0

Overview

The Weight Tracker database uses a JSON file to store weight entries provided by the user.

File Location

The data file is available at {root}/db/weight-tracker.json

Writing to the db

  1. Before writing into the db, identify which is the best approach:
  • in-memory change: load the entire file in-memory, apply the change, serialize it back
  • text-based change: scan the file in text mode and apply the change as a patch
  1. Isolate the atomical change you want to apply

  2. Read existing data to understand which kind of operation is needed

  • insert
  • update
  • delete
  1. Apply the change with the identified approach.

ALWAYS: explain the execution plan to the user as output in the chat

Reading from the DB

  1. Identify the best approach to the read request:
  • in-memory change: load the entire file in-memory, evaluate logic to perform the read
  • text-based change: scan the file in text mode and calculate the expected information as context
  1. Perform the read of the pertinent information

  2. Perform aggregations if needed

ALWAYS: explain the execution plan to the user as output in the chat

Data Structure

Always ensure the database keeps a data structure like this:

{
  "2025": {
    "11": {
      "10": 99.0,
      "12": 99.5
    }
  }
}

More info:

  • the indexing of the data is: year -> month -> day
  • the value of a day is a number, the database is unit agnostic
  • if a new writing request targets an existing day, override the value for the day