---
name: fiscal-calendar
description: >
  Required fiscal calendar for every answer that filters, groups, compares or labels this
  app's data by time. Load this skill whenever you are about to use a date or a period,
  whether or not the user says "fiscal": "last year", "this year", "YTD", "Q1" to "Q4",
  a bare year like "2024", a month, trends over time, year-over-year comparisons, and
  charts by year, quarter or month. The fiscal year runs [start] to [end].
---

# Fiscal calendar

Every time period in this app is a fiscal period. The fiscal year runs [start] to [end]
and is named for the calendar year it [ends / starts] in. Use calendar periods only when
the user asks for them in the current message.

## The rule
- Filter on `[Date field]` only. Never use the `[Year field]` field: it is the calendar year.
- FY[n] = `[Date field]` from [start day and month] [n-1] to [end day and month] [n].
- Fiscal quarters: FQ1 = [months], FQ2 = [months], FQ3 = [months], FQ4 = [months].
- Worked example: FQ2 FY[YYYY] = [date] to [date].

## Relative periods
- [Decision] Anchor "this year", "last year" and "YTD" to [the latest `[Date field]` in
  the data / today's date]. Check that date first.
  (Latest date in the data suits historical data. Use today's date if the data holds
  forecast or future-dated rows, or loads lag behind.)
- Check the first and last date in any period before reporting it.

## Comparisons
- Compute every compared period with its own query. Never add or subtract figures by hand.

## When the user asks for something else
- "Calendar year [YYYY]": use calendar dates for that question only, then go back to fiscal.

## Ambiguous wording
- [Decision] A bare year ("2024") means [fiscal year FY2024 / calendar year 2024]. Say so.
  (Pick the reading your users mean most often.)

## Edge cases
- Partial periods: say which months the period covers. When comparing with a full
  period, also give the same months of the earlier period.
- No data: say so plainly. Don't substitute another period.

## Not covered
- Fiscal weeks and other calendars are not defined here: say so and ask.
- General questions ("what is a fiscal year?"): this skill does not apply.

## State the period in every answer
For example "FY[YYYY] ([start] to [end])".

## Check before answering
- The filter uses `[Date field]`, not `[Year field]`.
- Fiscal unless the user asked for calendar in this message.
- Relative periods anchored to the latest date. Partial periods flagged.
- The answer names the period and its dates.