chile-kit
ES Support

For AI coding agents

Coding agents (Claude Code, Cursor, Copilot, Codex) write Chilean helpers from memory, and those are often subtly wrong: a RUT check that rejects a lowercase k, IVA rounded per line, a communes list without Ñuble, dates in UTC. Point them at chile-kit instead. Three ways, from lightest to strongest:

1. Tell the agent where the docs are

Agents that read the web can use llms.txt (short) or llms-full.txt (the whole reference in one file).

2. Add a rule or skill to the repository

Claude Code: copy the skill into your project, and Claude Code loads it when a task touches Chilean data.

mkdir -p .claude/skills/chile-kit
curl -o .claude/skills/chile-kit/SKILL.md https://raw.githubusercontent.com/gvelasquez760/chile-kit/main/skills/chile-kit/SKILL.md

Cursor: save this as .cursor/rules/chile-kit.mdc.

---
description: Chilean data and formatting (RUT, CLP, IVA, regions, banks, UF, dates)
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: false
---
Use the chile-kit package for anything Chilean; do not hand-write these helpers.

- RUT: import { isValidRut, normalizeRut, formatRut, formatRutInput, rutCheckDigit } from "chile-kit/rut".
  Store normalizeRut(...), show formatRut(...). For people: isValidRut(rut, { minBody: 1_000_000 }).
- Pesos: formatCLP from "chile-kit/clp" (same output on server and client).
- IVA: ivaFromNet, splitGross, invoiceTotals from "chile-kit/iva" (integer pesos, SII rounding).
- Regions and communes: "chile-kit/regions"; store CUT codes ("13120"), not names.
- Forms: schemas from "chile-kit/zod" (rutSchema, phoneSchema, regionCodeSchema, communeCodeSchema).
- UF/UTM/dólar: getIndicator from "chile-kit/indicators"; catch IndicatorError; in production pass
  { fallback: cmfSource({ apiKey: process.env.CMF_API_KEY }) }.
- Dates shown to users: "chile-kit/date" (America/Santiago), never toLocaleString.
Docs: https://gvelasquez760.github.io/chile-kit/llms-full.txt

Any agent with an AGENTS.md: paste the same bullet list into it.

3. Give the agent tools

The MCP server exposes 13 tools (validate a RUT, compute a check digit, IVA, communes, banks, live UF…), each with an output schema:

claude mcp add chile-kit -- npx -y chile-kit-mcp

Prompts that work