ISO 8601 Millisecond Precision
Goal
When a temporal value must be represented textually, use ISO 8601.
This skill governs textual formatting and parsing only. It does not require temporal values to be stored internally as strings when the stack provides built-in or standard-library temporal types.
When the textual representation includes a time component, use millisecond precision exactly. For example, use 2026-03-20T14:35:12.123Z, not a seconds-only form and not a microsecond or nanosecond form.
For date-only values, use the ISO 8601 calendar date form such as 2026-03-20. Millisecond precision applies to temporal strings that include a time component.
What Counts as In Scope
Apply this skill to code that does one or more of these things:
- formats temporal values into strings
- parses textual date, time, datetime, or timestamp values
- defines API, event, message, or persistence contracts that use textual temporal representations
- documents expected textual date or time formats
- compares or validates temporal values represented as strings
- stores temporal values in text-oriented boundaries
ISO 8601 Rule
Use ISO 8601 whenever a temporal value is represented as text.
- Prefer extended ISO 8601 forms with explicit separators.
- Do not use locale-dependent, ad hoc, or ambiguous textual date formats.
Require millisecond precision for any textual representation that includes a time component.
- Use exactly three fractional second digits.
- Do not omit fractional seconds when this rule applies.
- Do not emit more or fewer than three fractional second digits.
Keep timezone or offset markers explicit when the textual value is timezone-aware.
- Preserve the timezone or offset semantics required by the surrounding code or contract.
- This skill governs the textual format, not the choice of timezone policy.
Keep textual formatting at the boundary.
- Prefer built-in or standard-library temporal types inside the system when available.
- Format to ISO 8601 text at APIs, persistence text columns, event payloads, configuration surfaces, logs, or other string-based boundaries.
Detection Workflow
Identify the textual boundary.
- Find where temporal values are turned into strings or read from strings.
- Identify whether the boundary expects date-only or time-bearing values.
Determine the exact temporal shape.
- Use date-only ISO 8601 for pure calendar dates.
- Use time-bearing ISO 8601 with millisecond precision for datetimes, timestamps, and time values that include seconds or subsecond precision.
Trace formatting and parsing consistency.
- Verify that the same textual format is used for both serialization and parsing.
- Verify that contract documentation and validation logic match the actual emitted format.
Writing or Changing Textual Temporal Representations
Emit ISO 8601 strings explicitly.
- Use formatting helpers or library routines that produce ISO 8601 output.
- Make the expected textual shape obvious in serializers, validators, and contract definitions.
Enforce exactly three fractional digits when time is present.
- Normalize formatter settings so textual output always uses millisecond precision.
- Reject or normalize incoming textual values that do not match the required precision when the contract is under your control.
Keep parsing and formatting symmetrical.
- Ensure emitted strings can be parsed by the same format rules.
- Avoid silent drift between serializer output and parser expectations.
Preserve timezone markers when applicable.
- Keep
Z, offsets, or other required timezone designators in the emitted ISO 8601 text when the value is timezone-aware.
- Do not drop timezone information from a timezone-aware textual representation.
Review Questions
When reading or reviewing code, ask:
- Is this temporal value being represented as text?
- Is the textual form ISO 8601?
- If the string includes a time component, does it use exactly millisecond precision?
- Do parsing, validation, documentation, and serialization all expect the same textual format?
- Would changing this code risk drifting into a non-ISO or non-millisecond textual representation?
If the answer is yes, apply this skill.
Report the Outcome
When finishing the task:
- state which textual temporal representations were identified or changed
- state whether the representation is date-only or time-bearing
- state how ISO 8601 formatting and millisecond precision were implemented or preserved
1---2name: iso8601-millisecond-precision3description: Require ISO 8601 textual representations for temporal values. Use when an agent needs to format, serialize, parse, document, review, or define textual date, time, datetime, or timestamp representations in APIs, events, persistence, logs, configuration, or other string-based boundaries. When the textual representation includes a time component, require millisecond precision.4---56# ISO 8601 Millisecond Precision78## Goal910When a temporal value must be represented textually, use ISO 8601.1112This skill governs textual formatting and parsing only. It does not require temporal values to be stored internally as strings when the stack provides built-in or standard-library temporal types.1314When the textual representation includes a time component, use millisecond precision exactly. For example, use `2026-03-20T14:35:12.123Z`, not a seconds-only form and not a microsecond or nanosecond form.1516For date-only values, use the ISO 8601 calendar date form such as `2026-03-20`. Millisecond precision applies to temporal strings that include a time component.1718## What Counts as In Scope1920Apply this skill to code that does one or more of these things:2122- formats temporal values into strings23- parses textual date, time, datetime, or timestamp values24- defines API, event, message, or persistence contracts that use textual temporal representations25- documents expected textual date or time formats26- compares or validates temporal values represented as strings27- stores temporal values in text-oriented boundaries2829## ISO 8601 Rule30311. Use ISO 8601 whenever a temporal value is represented as text.32 - Prefer extended ISO 8601 forms with explicit separators.33 - Do not use locale-dependent, ad hoc, or ambiguous textual date formats.34352. Require millisecond precision for any textual representation that includes a time component.36 - Use exactly three fractional second digits.37 - Do not omit fractional seconds when this rule applies.38 - Do not emit more or fewer than three fractional second digits.39403. Keep timezone or offset markers explicit when the textual value is timezone-aware.41 - Preserve the timezone or offset semantics required by the surrounding code or contract.42 - This skill governs the textual format, not the choice of timezone policy.43444. Keep textual formatting at the boundary.45 - Prefer built-in or standard-library temporal types inside the system when available.46 - Format to ISO 8601 text at APIs, persistence text columns, event payloads, configuration surfaces, logs, or other string-based boundaries.4748## Detection Workflow49501. Identify the textual boundary.51 - Find where temporal values are turned into strings or read from strings.52 - Identify whether the boundary expects date-only or time-bearing values.53542. Determine the exact temporal shape.55 - Use date-only ISO 8601 for pure calendar dates.56 - Use time-bearing ISO 8601 with millisecond precision for datetimes, timestamps, and time values that include seconds or subsecond precision.57583. Trace formatting and parsing consistency.59 - Verify that the same textual format is used for both serialization and parsing.60 - Verify that contract documentation and validation logic match the actual emitted format.6162## Writing or Changing Textual Temporal Representations63641. Emit ISO 8601 strings explicitly.65 - Use formatting helpers or library routines that produce ISO 8601 output.66 - Make the expected textual shape obvious in serializers, validators, and contract definitions.67682. Enforce exactly three fractional digits when time is present.69 - Normalize formatter settings so textual output always uses millisecond precision.70 - Reject or normalize incoming textual values that do not match the required precision when the contract is under your control.71723. Keep parsing and formatting symmetrical.73 - Ensure emitted strings can be parsed by the same format rules.74 - Avoid silent drift between serializer output and parser expectations.75764. Preserve timezone markers when applicable.77 - Keep `Z`, offsets, or other required timezone designators in the emitted ISO 8601 text when the value is timezone-aware.78 - Do not drop timezone information from a timezone-aware textual representation.7980## Review Questions8182When reading or reviewing code, ask:8384- Is this temporal value being represented as text?85- Is the textual form ISO 8601?86- If the string includes a time component, does it use exactly millisecond precision?87- Do parsing, validation, documentation, and serialization all expect the same textual format?88- Would changing this code risk drifting into a non-ISO or non-millisecond textual representation?8990If the answer is yes, apply this skill.9192## Report the Outcome9394When finishing the task:9596- state which textual temporal representations were identified or changed97- state whether the representation is date-only or time-bearing98- state how ISO 8601 formatting and millisecond precision were implemented or preserved