Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/piratta/gymApp/llms.txt

Use this file to discover all available pages before exploring further.

Plicometría is FocusFlow’s integrated body composition measurement module. It lets coaches (and optionally athletes) record skinfold caliper readings in millimetres and receive instant, protocol-correct calculations of body density, body fat percentage, fat mass, and lean mass — all without leaving the platform. Measurements are plotted on interactive trend charts over time, making it easy to track body recomposition progress session-to-session. The module is built on four validated scientific protocols and is backed by the computePlicometriaValues() function in src/lib/plicometria.ts.

Enabling Plicometría

Plicometría is disabled by default for all athletes. To activate it:
1

Open the athlete's profile

Navigate to the athlete in your client list and select their profile.
2

Go to the Details sub-tab

Open the Ficha del Atleta (Details) sub-tab and click Editar Ficha to enter edit mode.
3

Enable the toggle

Turn on the isPlicometriaEnabled toggle on the ClientProfile. A plicometriaProtocolId selector will appear — choose the protocol to use for this athlete.
4

Set biological sex and birth date

Plicometría formulas require Sexo Biológico (biologicalSex: "MALE" or "FEMALE") and Fecha de Nacimiento (birthDate) to compute age-adjusted body density. If either is missing, a configuration warning banner is shown and form submission is blocked.
If biologicalSex or birthDate is not set on the athlete’s profile, FocusFlow will display a Falta Configuración del Perfil warning and disable the measurement entry form entirely. Always complete these fields before scheduling a plicometría session.

Supported Protocols

FocusFlow supports four evidence-based skinfold protocols. The protocol is selected per-athlete via ClientProfile.plicometriaProtocolId and controls which skinfold fields are shown in the entry form.
The classic 3-site Jackson-Pollock protocol. Site selection is sex-specific.
SexSites
MalePectoral + Abdominal + Muslo anterior
FemaleTríceps + Suprailíaco + Muslo anterior
Formula (body density):
  • Male: D = 1.10938 − 0.0008267×S + 0.0000016×S² − 0.0002574×age
  • Female: D = 1.0994921 − 0.0009929×S + 0.0000023×S² − 0.0001392×age
Where S = sum of the three skinfolds in mm. Body fat percentage is then derived using the Siri formula: %fat = (4.95 / D − 4.5) × 100.
The 4-site Durnin-Womersley protocol. Applies to all genders with the same four sites.Sites (all): Tríceps + Bíceps + Subescapular + SuprailíacoFormula: D = c − m × log₁₀(S)The coefficients c and m are selected from age group × sex lookup tables:
SexAgecm
Male< 201.1620.063
Male20–291.16310.0632
Male30–391.14220.0544
Male40–491.1620.0700
Male≥ 501.17150.0779
Female< 201.15490.0678
Female20–291.15990.0717
Female30–391.14230.0632
Female40–491.13330.0612
Female≥ 501.13390.0645
Age is calculated at the date of each measurement via calculateAgeAtDate(birthDate, logDate). Body fat % is then computed with the Siri formula.
The comprehensive 7-site Jackson-Pollock protocol. Uses the same sites for all genders but applies sex-specific polynomial formulas.Sites (all): Pectoral + Axilar medio + Tríceps + Subescapular + Abdominal + Suprailíaco + Muslo anteriorFormula (body density):
  • Male: D = 1.112 − 0.00043499×S + 0.00000055×S² − 0.00028826×age
  • Female: D = 1.097 − 0.00046971×S + 0.00000056×S² − 0.00012828×age
Where S = sum of all seven skinfolds. Body fat % from the Siri formula.
The Yuhasz protocol uses a direct %fat formula — it bypasses body density entirely.Sites (all): Pectoral + Subescapular + Tríceps + Abdominal + Suprailíaco + Muslo anteriorFormula (%fat direct):
  • Male: %fat = 0.1051 × S + 2.585
  • Female: %fat = 0.1548 × S + 3.58
Where S = sum of all six skinfolds in mm. Because there is no intermediate density step, densidadCorporal is stored as the default value 1.0 for Yuhasz logs.

The PlicometriaLog Type

Each measurement session is persisted as a PlicometriaLog document in Firestore:
export interface PlicometriaLog {
  id: string;
  clientId: string;
  date: string; // YYYY-MM-DD
  weight: number; // kg
  protocolId: "3-fold" | "4-fold" | "7-fold" | "yuhasz";

  // Skinfolds in mm (only those required by the active protocol are populated)
  pectoral?: number;
  abdominal?: number;
  musloAnterior?: number;
  triceps?: number;
  suprailiaco?: number;
  biceps?: number;
  subescapular?: number;
  axilarMedio?: number;

  // Calculated results (computed at save time by computePlicometriaValues())
  sumaPliegues: number;
  densidadCorporal: number;
  porcentajeGrasa: number;
  masaGrasa: number; // kg
  masaMagra: number; // kg

  createdBy: "coach" | "client";
  createdAt: string; // ISO 8601
}
Optional skinfold fields not required by the selected protocol are stored as undefined and excluded from the sum.

The computePlicometriaValues() Function

All body composition arithmetic is centralised in a single pure function:
import { computePlicometriaValues } from "@/lib/plicometria";

const result = computePlicometriaValues({
  weight: 78.5,
  protocolId: "3-fold",
  biologicalSex: "MALE",
  age: 28,
  pectoral: 12,
  abdominal: 18,
  musloAnterior: 14,
});
// → { sumaPliegues, densidadCorporal, porcentajeGrasa, masaGrasa, masaMagra }
For the full formula derivations, coefficient tables, and edge-case handling, see the Plicometría Formulas Reference.

Displayed Results

After all skinfold values are entered, FocusFlow computes and shows results in real time (before saving) and stores them on the log record:

Suma de Pliegues

sumaPliegues — total of all active skinfold sites, in mm. Displayed as an integer.

Densidad Corporal

densidadCorporal — intermediate body density value (g/mL), displayed to 4 decimal places. Always 1.0 for Yuhasz.

Porcentaje Graso

porcentajeGrasa — body fat percentage (%), displayed to 1 decimal place. Colour-coded amber in the UI.

Masa Grasa

masaGrasa — fat mass in kg (weight × porcentajeGrasa / 100). Displayed in red.

Masa Magra

masaMagra — lean mass in kg (weight − masaGrasa). Displayed in emerald.
All five values are plotted on two interactive Recharts line charts:
  1. Evolución de Composición Corporal — overlays Grasa %, Masa Magra (kg), and Masa Grasa (kg) on dual Y-axes over time.
  2. Historial de Pliegues Cutáneos — plots each individual skinfold site in mm over time, one coloured line per site.

Data Validation

When entering a new measurement, FocusFlow compares each entered value against the most recent log. If any individual field deviates by ≥ 25% from the previous reading, a validation warning is triggered:
“Algún valor introducido varía mucho respecto a la última medición. Confirma que es correcto.”
The coach must check an acknowledgement checkbox before the Guardar Medición submit button becomes active. This guards against accidental unit errors (e.g., entering centimetres instead of millimetres).
%fat clamping: After formula evaluation, porcentajeGrasa is always clamped between 2% and 60% with Math.max(2, Math.min(60, porcentajeGrasa)). This prevents physiologically impossible outputs caused by extreme skinfold combinations or data-entry errors from propagating into the stored log or trend charts.
Who can enter measurements? Both coaches and athletes can submit plicometría records — the createdBy field records "coach" or "client" accordingly. Coach-entered records are the authoritative measurement for progress reporting. Athlete-entered records are useful for self-tracking between scheduled sessions.

Build docs developers (and LLMs) love