Afip Facturacion logo

Afip Facturacion

Community
alandaitch
afip-facturacion

Emitir facturas electrónicas de Argentina (AFIP/ARCA) para monotributistas — Factura C con CAE, PDF con QR según RG 4291/2018, vía web services WSAA/WSFE. Usar este skill cuando el usuario quiera facturar, emitir una factura, generar un comprobante electrónico AFIP/ARCA, obtener CAE, hacer un PDF de factura, o configurar facturación electrónica en Argentina. También aplica si mencionan "Factura C", "monotributo", "ARCA", "AFIP web services", punto de venta, o cualquier flujo que involucre emitir comprobantes fiscales argentinos.

Overview

Publisheralandaitch
Repositoryafip-facturacion
Skill nameafip-facturacion
Stars
50
Forks
11
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by alandaitch on GitHub. Read the source before you install it.

Installation

Install the Afip Facturacion AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/alandaitch/afip-facturacion/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/alandaitch/afip-facturacion.git \
  .claude/skills/afip-facturacion
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Afip Facturacion in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Afip Facturacion on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Afip Facturacion is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Facturación Electrónica AFIP/ARCA (Argentina)

Emite Factura C (monotributo) a Consumidor Final u otro receptor, obtiene el CAE vía WSFEv1 y genera el PDF oficial con QR code.

Arquitectura

skill/
├── SKILL.md               (este archivo)
├── scripts/
│   ├── config.py          (lee emisor_config.json + cert paths)
│   ├── ssl_fix.py         (fix DH_KEY_TOO_SMALL)
│   ├── wsaa.py            (autenticación: TRA firmado → token/sign)
│   ├── facturar.py        (CLI: emite factura y genera PDF)
│   ├── generar_pdf.py     (PDF con QR, formato ARCA oficial)
│   └── generar_certificado.sh (genera clave privada + CSR)
└── references/
    ├── setup.md           (pasos completos de configuración inicial)
    └── troubleshooting.md (errores comunes)

Datos del usuario (NO viven dentro del skill): se guardan en un directorio de trabajo que el usuario elige, típicamente ~/afip/:

~/afip/
├── emisor_config.json     (CUIT, razón social, domicilio, etc.)
├── certs/
│   ├── private_key.key    (RSA 2048, generada una vez)
│   ├── certificate.crt    (descargada de AFIP luego del CSR)
│   └── token_cache.json   (cache del token WSAA, auto-generado)
└── facturas_log.json      (log de facturas emitidas)

La variable de entorno AFIP_HOME apunta a este directorio; por defecto es ~/afip.

Cuándo usar este skill

Activá este skill cuando el usuario pida cualquiera de:

  • "facturar", "emitir factura", "hacer una factura"
  • "generá una factura C por $X"
  • "necesito una factura de AFIP"
  • "configurar facturación electrónica"
  • "sacar CAE para una factura"
  • "regenerar el PDF de una factura"

Flujo de trabajo

1. Detectar si ya está configurado

Verificá si existe $AFIP_HOME/emisor_config.json y $AFIP_HOME/certs/certificate.crt. Si falta alguno, dirigí al usuario a la configuración inicial (ver references/setup.md).

2. Emitir factura

Desde el directorio de scripts del skill, con AFIP_HOME exportado:

bash
export AFIP_HOME=~/afip
python3 scripts/facturar.py --monto 5000 --descripcion "Consultoría"

Parámetros importantes:

  • --monto N — monto total (default 1.0)
  • --concepto 1|2|3 — 1=Productos, 2=Servicios, 3=Ambos (default 1)
  • --desde YYYY-MM-DD --hasta YYYY-MM-DD — período facturado (requerido para concepto 2 o 3)
  • --descripcion "..." — texto del renglón de detalle
  • --condicion-venta "Contado|Cuenta corriente|..." — default Contado
  • --punto-venta N — override del punto de venta (default: el de emisor_config.json)

Al aprobarse, el script:

  1. Imprime número + CAE + vencimiento.
  2. Genera factura_NNNN_NNNNNNNN.pdf en el directorio actual.
  3. Append a $AFIP_HOME/facturas_log.json.

3. Regenerar PDF de una factura pasada

bash
python3 scripts/generar_pdf.py   # usa la última del log

Antes de emitir: verificar con el usuario

Emitir una factura es una acción irreversible con consecuencias fiscales. Antes de invocar facturar.py, mostrá al usuario monto, concepto, descripción y receptor, y pedí confirmación explícita en el chat. Una factura emitida queda registrada en AFIP y solo se puede anular emitiendo una nota de crédito.

Edición de datos del emisor

emisor_config.json debe tener esta forma:

json
{
  "cuit": "20XXXXXXXXX",
  "punto_venta": 3,
  "razon_social": "APELLIDO NOMBRE",
  "condicion_iva": "Responsable Monotributo",
  "domicilio": "Calle 123 - Ciudad",
  "ingresos_brutos": "Exento" o número de inscripción,
  "inicio_actividades": "01/05/2014"
}

Estos datos los ingresa el usuario una sola vez en el setup. AFIP bloquea los servicios de padrón (ws_sr_padron_*) para monotributistas, por eso no se pueden autocompletar.

Ambiente: producción vs homologación

Por default el skill apunta a producción (servicios1.afip.gov.ar). Para pruebas, exportá AFIP_ENV=homo antes de correr los scripts — apunta a wsaahomo/wswhomo.

Setup inicial

Ver references/setup.md para la guía completa: generar clave privada + CSR, subir al portal de AFIP, asociar el certificado al servicio "Facturación Electrónica", dar de alta el punto de venta por web services.

Errores comunes

Ver references/troubleshooting.md — incluye DH_KEY_TOO_SMALL, "Computador no autorizado", tokens expirados, rechazos de CAE.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Afip Facturacion AI skill do?

Emitir facturas electrónicas de Argentina (AFIP/ARCA) para monotributistas — Factura C con CAE, PDF con QR según RG 4291/2018, vía web services WSAA/WSFE. Usar este skill cuando el usuario quiera facturar, emitir una factura, generar un comprobante electrónico AFIP/ARCA, obtener CAE, hacer un PDF de factura, o configurar facturación electrónica en Argentina. También aplica si mencionan "Factura C", "monotributo", "ARCA", "AFIP web services", punto de venta, o cualquier flujo que involucre emitir comprobantes fiscales argentinos.

Why use Afip Facturacion on TypingMind?

Because you install it once and use it with any model. Afip Facturacion is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Afip Facturacion in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/alandaitch/afip-facturacion/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Afip Facturacion?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Afip Facturacion?

As many as you like. As long as a model supports skills, you can use Afip Facturacion with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Afip Facturacion AI skill free?

Yes. It is published on GitHub by alandaitch under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇