AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Cnj Parser

skill-autodevx-legal-skills-cnj-parser · by autodevx

>

No reviews yet
0 installs
43 views
0.0% view→install

Install

$ agentstack add skill-autodevx-legal-skills-cnj-parser

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-autodevx-legal-skills-cnj-parser)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Cnj Parser? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Parser de Número CNJ

Formato oficial

O número unificado de processos judiciais segue a Resolução CNJ nº 65/2008:

NNNNNNN-DD.AAAA.J.TT.OOOO
│         │     │ │  └── Órgão julgador (4 dígitos)
│         │     │ └───── Tribunal (2 dígitos)
│         │     └─────── Justiça (1 dígito)
│         └───────────── Ano de distribuição (4 dígitos)
│         └───────────── Dígitos verificadores (2 dígitos)
└─────────────────────── Número sequencial (7 dígitos)

Comportamento esperado

Input aceito

  • Número com máscara: 0002150-34.2023.8.13.0024
  • Número sem máscara: 00021503420238130024
  • Número com espaços ou caracteres extras: 0002150-34.2023.8.13.0024 (TJMG)
  • Lote de números (lista, planilha, texto livre com múltiplos processos)

Passos de processamento

  1. Normalizar: remover tudo que não é dígito
  2. Validar tamanho: deve resultar em exatamente 20 dígitos
  3. Segmentar: separar nos campos NNNNNNN, DD, AAAA, J, TT, OOOO
  4. Validar dígito verificador: algoritmo módulo 97 (Resolução CNJ 65/2008)
  5. Enriquecer: identificar segmento de justiça, tribunal e formatar

Algoritmo de validação (módulo 97)

# Dois passos conforme Resolução CNJ 65/2008
r1 = int(nnnnnnn) % 97
r2 = int(f"{r1:02d}{aaaa}{j}{tt}") % 97
dv_calculado = 98 - (int(f"{r2:02d}{oooo}") % 97)
valido = (dv_calculado == int(dd))

Mapa de segmentos de justiça (campo J)

| J | Segmento | |---|----------| | 1 | Supremo Tribunal Federal | | 2 | Conselho Nacional de Justiça | | 3 | Superior Tribunal de Justiça | | 4 | Justiça Federal (TRFs 1-6) | | 5 | Justiça do Trabalho (TRTs 1-24) | | 6 | Justiça Eleitoral (TREs) | | 7 | Justiça Militar da União | | 8 | Justiça dos Estados e DF (TJs) | | 9 | Justiça Militar Estadual |

Mapa de tribunais (campo TT para J=8 — Justiça Estadual)

| TT | Tribunal | |----|----------| | 01 | TJAC | 02 | TJAL | 03 | TJAP | 04 | TJAM | | 05 | TJBA | 06 | TJCE | 07 | TJDF | 08 | TJES | | 09 | TJGO | 10 | TJMA | 11 | TJMT | 12 | TJMS | | 13 | TJMG | 14 | TJPA | 15 | TJPB | 16 | TJPR | | 17 | TJPE | 18 | TJPI | 19 | TJRJ | 20 | TJRN | | 21 | TJRS | 22 | TJRO | 23 | TJRR | 24 | TJSC | | 25 | TJSE | 26 | TJSP | 27 | TJTO |

Output padrão (processo único)

{
  "input_original": "0002150-34.2023.8.13.0024",
  "valido": true,
  "numero_formatado": "0002150-34.2023.8.13.0024",
  "componentes": {
    "sequencial": "0002150",
    "digito_verificador": "34",
    "ano": "2023",
    "justica_codigo": "8",
    "justica_nome": "Justiça dos Estados e DF",
    "tribunal_codigo": "13",
    "tribunal_sigla": "TJMG",
    "orgao_julgador": "0024"
  },
  "erro": null
}

Output para lote

Ao receber múltiplos números:

  1. Extrair todos os padrões de 20 dígitos do texto (com ou sem máscara)
  2. Validar cada um individualmente
  3. Retornar tabela consolidada com status de cada número
  4. Destacar inválidos com causa específica do erro

Formato tabela:

| # | Número CNJ | Válido | Tribunal | Ano | Erro |

Limites

  • Não consulta APIs externas (DataJud, PJe, eSAJ) — apenas parse local
  • Não infere dados além do que o número contém
  • Mapa de tribunais pode não cobrir novos TRFs (ex: TRF-6 criado em 2022)

Script auxiliar

Ver scripts/cnj_validator.py para implementação Python completa com suporte a batch processing e output JSON/CSV.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.