Skip to content

ThomasMoreAI/legal-skills-open / br/litigation/skills/juriscan-brunobracaioli

juriscan-brunobracaioli

Verified

Análise forense de processos judiciais brasileiros. Extrai, classifica e cruza peças processuais, detecta contradições, calcula prazos CPC e gera relatórios de risco com exportação para Obsidian. Use quando mencionar: processo judicial, petição, sentença, acórdão, contradições, prazos, timeline, análise forense, Obsidian.

FileKindSize
.claude/agents/juriscan-advogado-autor.mdmarkdown4.3 KB
.claude/agents/juriscan-advogado-reu.mdmarkdown3.6 KB
.claude/agents/juriscan-auditor-processual.mdmarkdown7.0 KB
.claude/agents/juriscan-echo.mdmarkdown2.0 KB
.claude/agents/juriscan-parser.mdmarkdown4.7 KB
.claude/agents/juriscan-segmenter.mdmarkdown4.9 KB
.claude/agents/juriscan-sintetizador.mdmarkdown3.1 KB
.claude/agents/juriscan-verificador.mdmarkdown4.8 KB
.github/FUNDING.ymlconfig77 B
.github/workflows/ci.ymlconfig1.0 KB
.gitignoreother121 B
CHANGELOG.mdmarkdown20.6 KB
CLAUDE.mdmarkdown10.6 KB
LICENSEother1.0 KB
README.mdmarkdown16.9 KB
SKILL.mdskill md26.3 KB
assets/banner.svgother4.7 KB
docs/architecture.mdmarkdown10.3 KB
docs/index.htmlother4.3 KB
docs/operations.mdmarkdown6.7 KB
docs/subagent_contract.mdmarkdown6.0 KB
docs/subagents.mdmarkdown5.5 KB
install.shscript3.2 KB
pyproject.tomlmanifest272 B
references/agent_schemas/advogado_output.jsonconfig2.7 KB
references/agent_schemas/auditor_output.jsonconfig4.8 KB
references/agent_schemas/echo_output.jsonconfig666 B
references/agent_schemas/parser_output.jsonconfig4.4 KB
references/agent_schemas/recommendations_output.jsonconfig2.5 KB
references/agent_schemas/segmenter_output.jsonconfig2.9 KB
references/agent_schemas/sintetizador_output.jsonconfig2.7 KB
references/agent_schemas/verificador_output.jsonconfig2.3 KB
references/appellate_structure.mdmarkdown2.0 KB
references/binding_precedents.mdmarkdown2.2 KB
references/brazilian_legal_entities.mdmarkdown3.2 KB
references/chunk_analysis_schema.jsonconfig6.7 KB
references/cpc_prazos.jsonconfig4.4 KB
references/feriados_forenses.jsonconfig2.1 KB
references/output_schema.jsonconfig11.0 KB
references/output_schema_v2.jsonconfig11.0 KB
references/output_schema_v3.jsonconfig5.3 KB
references/piece_type_taxonomy.jsonconfig7.5 KB
references/prompt_templates.mdmarkdown11.8 KB
references/risk_scoring_rubric.mdmarkdown2.4 KB
references/whitelist_fontes.jsonconfig1.8 KB
requirements.txtmanifest250 B
scripts/__init__.pyscript0 B
scripts/agent_io.pyscript12.2 KB
scripts/analyzed_init.pyscript3.3 KB
scripts/audit.pyscript4.8 KB
scripts/cleanup_audit.pyscript2.0 KB
scripts/confidence_rules.pyscript6.4 KB
scripts/content_quality_check.pyscript11.1 KB
scripts/enrich_deterministic.pyscript10.3 KB
scripts/extract_and_chunk.pyscript14.3 KB
scripts/finalize.pyscript10.2 KB
scripts/finalize_legacy.pyscript7.4 KB
scripts/generate_report.pyscript29.8 KB
scripts/instance_tracker.pyscript6.7 KB
scripts/integrity_check.pyscript11.0 KB
scripts/integrity_gate.pyscript4.6 KB
scripts/legacy/__init__.pyscript0 B
scripts/legacy/contradiction_report.pyscript11.9 KB
scripts/legacy/risk_scorer.pyscript10.2 KB
scripts/merge_chunk_analysis.pyscript14.8 KB
scripts/migrate_v2_to_v3.pyscript3.1 KB
scripts/obsidian_export.pyscript28.0 KB
scripts/persist_chunks.pyscript6.2 KB
scripts/prazo_calculator.pyscript14.2 KB
scripts/report_metrics.pyscript8.4 KB
scripts/schema_validator.pyscript5.2 KB
scripts/utils/__init__.pyscript0 B
scripts/utils/cnj.pyscript4.4 KB
scripts/utils/dates.pyscript7.8 KB
scripts/utils/filenames.pyscript2.6 KB
scripts/utils/monetary.pyscript5.2 KB
tests/__init__.pyscript0 B
tests/conftest.pyscript1.1 KB
tests/fixtures/agent_io/echo_invalid_missing_field.jsonconfig45 B
tests/fixtures/agent_io/echo_invalid_wrong_const.jsonconfig70 B
tests/fixtures/agent_io/echo_valid.jsonconfig103 B
tests/fixtures/agent_io/segmenter_valid.jsonconfig359 B
tests/fixtures/sample_analyzed.jsonconfig10.0 KB
tests/fixtures/sample_analyzed_with_prazos.jsonconfig470 B
tests/fixtures/sample_chunk_acordao.txtmarkdown3.4 KB
tests/fixtures/sample_chunk_peticao.txtmarkdown3.4 KB
tests/fixtures/sample_chunk_sentenca.txtmarkdown2.9 KB
tests/fixtures/sample_index.jsonconfig1.6 KB
tests/golden/_pdf_builder.pyscript6.1 KB
tests/golden/processo_01_sintetico_simples/expected_invariants.jsonconfig993 B
tests/golden/processo_01_sintetico_simples/source.txtmarkdown3.3 KB
tests/golden/processo_02_sintetico_art942/expected_art_942.jsonconfig898 B
tests/golden/processo_02_sintetico_art942/expected_invariants.jsonconfig1.3 KB
tests/golden/processo_02_sintetico_art942/source.txtmarkdown7.8 KB
tests/test_agent_io.pyscript4.4 KB
tests/test_analyzed_init.pyscript5.6 KB
tests/test_audit.pyscript4.4 KB
tests/test_cnj.pyscript2.9 KB
tests/test_confidence_rules.pyscript4.8 KB
tests/test_content_quality_check.pyscript14.5 KB
tests/test_contradiction_report.pyscript3.5 KB
tests/test_dates.pyscript5.0 KB
tests/test_enrich_deterministic.pyscript6.3 KB
tests/test_filenames.pyscript2.1 KB
tests/test_finalize.pyscript5.8 KB
tests/test_finalize_legacy.pyscript6.5 KB
tests/test_generate_report.pyscript24.0 KB
tests/test_golden_regression.pyscript6.3 KB
tests/test_instance_tracker.pyscript4.2 KB
tests/test_integrity_check.pyscript4.8 KB
tests/test_integrity_gate.pyscript3.6 KB
tests/test_merge_chunk_analysis.pyscript20.9 KB
tests/test_migrate_v2_to_v3.pyscript4.3 KB
tests/test_monetary.pyscript3.4 KB
tests/test_obsidian_export_v3.pyscript6.9 KB
tests/test_persist_chunks.pyscript6.1 KB
tests/test_prazo_calculator.pyscript14.1 KB
tests/test_report_metrics.pyscript5.3 KB
tests/test_risk_scorer.pyscript5.7 KB
tests/test_whitelist_enforcement.pyscript6.1 KB

docs/operations.md

View on GitHub
# Juriscan — Operations

Troubleshooting, recovery, and routine tasks for the juriscan skill.

## Quick health check

In a fresh Claude Code session, from a project directory:

```
/juriscan --selftest
```

Expected: `"Selftest OK — subagent echo respondeu e foi validado. run_id=<uuid>"`.
Failure usually means one of:

1. `./install.sh` was not run, or was run from the wrong directory →
   `.claude/agents/juriscan-*.md` not symlinked into `~/.claude/agents/`.
2. `jsonschema` not installed → `pip install -r requirements.txt`.
3. `references/agent_schemas/echo_output.json` edited incorrectly →
   `git status` + revert.

## Running a real analysis

```
/juriscan --pipeline=legacy   /abs/path/to/processo.pdf   # default while agents pipeline is in beta
/juriscan --pipeline=agents   /abs/path/to/processo.pdf   # new hybrid pipeline
/juriscan                      /abs/path/to/processo.pdf   # same as --pipeline=legacy (flip pending)
```

Output is written to `<pdf_dir>/juriscan-output/`:

```
juriscan-output/
├── manifest.json         run_id, pipeline_mode, timestamps
├── raw_text.txt
├── index.json            chunk catalog
├── chunks/               physical chunk files (legacy or via persist_chunks.py)
├── analyzed.json         final structured analysis (v2 or v3)
├── contradictions.json   (legacy only)
├── risk.json             (legacy only)
├── prazos.json
├── obsidian/             Obsidian vault with views
└── .juriscan/audit/<run_id>.jsonl    (agents only)
```

## Audit trail

Every Task invocation in the agents pipeline is logged:

```
python3 scripts/report_metrics.py --run-id <uuid> --root juriscan-output/.juriscan/audit
python3 scripts/report_metrics.py --all-runs --root juriscan-output/.juriscan/audit
python3 scripts/report_metrics.py --run-id <uuid> --json | jq
```

Sample human-readable output:

```
=== run 9c96db50-... ===
total invocations : 18
unique agents     : 6
errors            : 0
schema_invalid    : 0
latency p50       : 3200 ms
latency p95       : 18500 ms
latency max       : 22400 ms
elapsed wall      : 142000 ms
per agent:
  segmenter     n=  1  p50=12400 p95=12400 max=12400 errors=0
  parser        n=  6  p50=2800  p95=4200  max=4800  errors=0
  advogado_autor n=1   p50=18500 p95=18500 max=18500 errors=0
  ...
```

**Budget gate** (CI-friendly):

```
python3 scripts/report_metrics.py --run-id <uuid> --enforce \
    --max-p95-ms 600000 --max-invocations 30
```

Exit code 1 if p95 latency > 10 min or total invocations > 30.

## Audit trail retention

Stale audit logs (> 90 days) can be removed:

```
python3 scripts/cleanup_audit.py --root juriscan-output/.juriscan/audit --dry-run
python3 scripts/cleanup_audit.py --root juriscan-output/.juriscan/audit --days 90
```

## Migrating an existing v2 analyzed.json to v3

```
python3 scripts/migrate_v2_to_v3.py --input analyzed.json --output analyzed_v3.json
# or in place:
python3 scripts/migrate_v2_to_v3.py --input analyzed.json --in-place
# or preview:
python3 scripts/migrate_v2_to_v3.py --input analyzed.json --dry-run
```

Migration is additive-only — v2 fields are never modified. Keys introduced
by v3 (`perspectives`, `auditor_findings`, `verifications`, etc.) are
added with empty defaults for legacy documents. The migrated document
validates against `references/output_schema_v3.json`.

## Re-running a single pipeline step

When a subagent fails mid-pipeline, the audit trail records the failed
invocation with `schema_valid=false` and `error=<msg>`. To re-run just
that step in a new Claude Code session:

1. `grep '"agent": "<role>"' juriscan-output/.juriscan/audit/<run_id>.jsonl`
   to find the failing call and the output path.
2. Re-invoke the subagent manually via the Task tool with the same
   `prompt` + the previous error message appended as `feedback`.
3. Re-run `agent_io.py validate --agent <role> --input <path>` + log.
4. Resume from the next pipeline step.

The pipeline is idempotent by design: downstream steps only read the
validated JSON files on disk, not session state.

## Common issues

### `persist_chunks.py` fails with "gap/overlap between chunk ..."

The segmenter produced `end_char[i-1] != start_char[i]`. SKILL.md should
have re-invoked it once already — if the second attempt also failed,
inspect the segmenter output in `/tmp/<run_id>-segmenter.json` and the
raw text to diagnose. Usually the prompt needs more few-shot examples of
the specific document layout.

### `enrich_deterministic.py` raises `monetary mismatch rate X% exceeds threshold 10%`

The parser is hallucinating monetary values. Inspect
`pieces[i]._enriched.mismatches` in the pre-abort output. If the parser
output says `R$ 27.000.000` but the chunk text says `R$ 27.000,00`, the
parser prompt needs a tighter few-shot for BRL format.

### `confidence_rules.py` raises `preservation invariant violated`

The sintetizador dropped auditor findings. Re-invoke it with a feedback
message that includes the full list of auditor findings and the rule:
"You may organize but not remove; minimum `len(auditor_findings)` is N".

### Verificador output is rejected with `source_url host ... is NOT in references/whitelist_fontes.json`

The subagent tried to fetch a non-authoritative source. Either:
- The citation can only be verified on a non-whitelisted site → mark
  `NAO_ENCONTRADO` instead of inventing a URL.
- The whitelist needs a new entry → propose a PR editing
  `references/whitelist_fontes.json`, justified in the commit message.

### Golden suite fails the art. 942 gate

The auditor failed to produce a finding for the fixture
`processo_02_sintetico_art942`. Check
`auditor_findings[i].descricao` for the literal tokens `ampliação`,
`colegiado`, `maioria`. If any token is missing, the gate still fires
even if the logic is correct — the wording must be explicit.

## Install / update

```
git pull
./install.sh
```

The installer symlinks `~/.claude/skills/juriscan` to the repo and
symlinks each `.claude/agents/juriscan-*.md` file into
`~/.claude/agents/`. Run `/juriscan --selftest` in a fresh session to
confirm.

## Directory cleanup between runs

Agents pipeline intentionally wipes `chunks/*.txt` at the start of
`persist_chunks.py` to prevent orphan files from previous runs. The
integrity gate would catch stale orphans otherwise. `index.json`,
`analyzed.json`, and `obsidian/` are overwritten in place.

Audit trails accumulate across runs — use `cleanup_audit.py` or
manual `rm` if disk space matters.

## Rolling back

- `git revert <commit>` always works — no migrations are destructive.
- Schema v2 outputs continue to validate against `output_schema_v2.json`
  indefinitely.
- `scripts/legacy/` stays in place for 3 releases after the Phase 6.4
  default flip.
- To force legacy mode after the flip: `/juriscan --pipeline=legacy <pdf>`.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall