Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sample-cni-documents

БесплатноБез исполняемых скриптовНе проверен

Sample documents from the CNI document store for annotation, prompt experimentation, or golden eval set seeding. Supports filtering by keywords, length…

Recidivizот Recidiviz★ 48 звёзд на GitHub

Об этом скилле

Skill: Sample CNI Documents

Overview

This skill pulls a structured sample of documents from the CNI document store. The document store holds the cleaned, normalized text the extraction LLM actually sees — not the raw source data. The output is a private Google Sheet keyed by document_contents_id that you can hand directly to an annotator or feed into a prompt experiment.

Two independent decisions shape how you sample:

  1. Starting pool — document store (Step 3) or extraction results (Step 3.7). Use the document store when you have no constraint on what the extractor has already produced. Use the extraction results table when you want to target documents where the extractor already yielded a specific field value — particularly useful when investigating a suspected error pattern (e.g., "find notes where the model tagged search_status = 'searching' but the text is about job search").

  2. Selection within the pool — SQL filters alone, or SQL filters followed by sample-then-read (Step 3.5). Apply SQL first to narrow cheaply; add sample-then-read on top when the remaining criterion is semantic and can't be expressed in a WHERE clause.

These decisions are independent and composable: SQL-filter the document store, SQL-filter the extraction results, sample-then-read from the document store, or SQL-filter the extraction results and then sample-then-read to confirm errors — whatever combination fits the task.

Caveats:

  • Never query US_ME or US_CA data — see CLAUDE.md.
  • Document text contains PII. Keep the output CSV on a local machine or in an approved storage location; do not paste document text into Slack, GitHub, or Notion.

Step 1: Gather inputs

Ask the user (in one message) for the following. State the defaults inline and tell the user they can override any of them.

  1. State code — e.g., US_TN. Never US_ME or US_CA.

  2. Extractor collection — which extractor to sample from (e.g., case_note_employment_info). If the user isn't sure, list the directories in recidiviz/documents/config/extractor_collections/ filtered by state.

  3. Sample size — how many documents. Default: 50.

  4. What you're looking for — describe the target documents in plain language. From this, determine the two decisions above:

    • Does the criterion involve a specific extractor output value (e.g., "notes where the model said search_status = 'searching'")? → extraction results as starting pool (Step 3.7); otherwise use the document store (Step 3).
    • Can the full criterion be expressed in a WHERE clause? → SQL filters alone; otherwise layer sample-then-read on top (Step 3.5).
  5. Filter criteria — keywords, contact types, date range, length range, extracted field values, or semantic description.

  6. Project — default recidiviz-staging.


Step 2: Look up the collection config

Read the extractor config YAML at:

recidiviz/documents/config/extractor_collections/{extractor_collection}/{state_code_lower}/extractor.yaml

Extract:

  • input_document_collection_name — the doc store collection name in SCREAMING_SNAKE_CASE (e.g., SUPERVISION_CASE_NOTES). Convert to lowercase for BQ table names.
  • document_metadata_filter_query_template — the SQL template the extractor uses to determine which documents it processes. This must be incorporated into the sampling query (Step 3) so you only sample from documents the extractor can actually read from.
  • state_code (from the directory path) — confirm it matches the user's input.

The doc store BQ tables for this collection are:

Role Dataset Table
Metadata {state_code_lower}_document_store_metadata {collection_name_lower}
Text {state_code_lower}_document_contents {collection_name_lower}_document_contents

Example for US_IX + SUPERVISION_CASE_NOTES:

  • Metadata: us_ix_document_store_metadata.supervision_case_notes
  • Contents: us_ix_document_contents.supervision_case_notes_document_contents

Render the filter template: substitute {input_document_collection_metadata_address} with the fully-qualified metadata table address: {project}.{state_code_lower}_document_store_metadata.{collection_name_lower}

So for the US_CO housing extractor the rendered filter becomes:

SELECT DISTINCT document_contents_id
FROM `recidiviz-staging.us_co_document_store_metadata.supervision_contact_notes`
WHERE document_contents_id IS NOT NULL
  AND contact_date >= DATE_SUB(CURRENT_DATE('US/Eastern'), INTERVAL 90 DAY)
  AND contact_type NOT IN ('AT', 'AET', 'RA1', 'HRF', 'TCJ', 'TCK', 'PRO')

Inspect the metadata table schema to see exactly which columns are present — not all collections have the same s

Полный SKILL.md на GitHub

Установить sample-cni-documents в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл sample-cni-documents?

Sample documents from the CNI document store for annotation, prompt experimentation, or golden eval set seeding. Supports filtering by keywords, length, metadata columns, semantic content, or extracted field values. Outputs a private Google Sheet with person_id, document_contents_id, and document text. Use when you need a structured dataset of case notes matching specific criteria — for annotation, prompt tuning, or eval sampling. Distinct from find_case_note_anecdotes, which produces a narrative .md report; this skill produces a structured sheet.

Как установить скилл sample-cni-documents?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sample-cni-documents запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить sample-cni-documents с