@teakit/month
Use this skill when writing code for @teakit/month.
@teakit/month exports Month, an immutable year-month calculation API for ESM
and browser environments.
Core Rules
- Import with
import { Month } from "@teakit/month". - Do not use default imports from
@teakit/month. - Create values with
Month.from(...); do not usenew Month(...)or callMonth(...). - Prefer canonical
YYYY-MMstrings for normal years, such as"2025-01". - Use
add(months)andsub(months)for month offsets. - Use
diff(other)orMonth.diff(left, right)for signed month differences. - Use Month methods instead of JavaScript
Datearithmetic. - Treat
Monthinstances as immutable. Do not mutateyear,month, orindex. - Use
toString()or JSON serialization for canonical string output.
Workflow
- Identify the operation: creation, month offsets, differences, comparison, ranges, or conversion.
- Load only the relevant method reference file from
references/. - In that file, read the intro, examples,
API Reference,Agent Contract, andAgent Notes. - Prefer
Month.from(...), exact strings, and Month instance methods in generated code. - For repository changes, run the local verification commands when relevant:
bun run check,bun run typecheck,bun run test, andbun run build. - For documentation site changes, also run
bun run docs:build.
Quick Example
Reference Selection
Read the smallest method file that answers the current task.