text-classification
Design and validate LLM-based text classification. Use for codebooks, prompts, validation samples, agreement statistics, and reporting model-coded data.
npx skills add majiayu000/claude-skill-registry --skill text-classification --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Design and validate LLM-based text classification. Used for codebooks, prompts, validation samples, agreement statistics, and reporting model-coded data.
How it works
- Provides structured instructions across multiple phases:
- Codebook Design: specify population, sampling frame, treatment, and build codes with Label, Definition, Clarification, Negative clarification, and Examples. Keep codes small (3-6), allow multi-labels if needed, include a residual category, and iterate via pilot testing.
- Choosing a Learning Regime: outlines zero-shot, few-shot, fine-tuning, instruction-tuning, and encoder-only fine-tuning; recommends testing multiple regimes and selecting by empirical performance.
- Model Selection and Reproducibility: favors open-weight models, requires exact model identifiers for proprietary models, sets temperature to 0 for classification, and suggests reliability checks like repeated runs and per-language validation.
- Prompt Construction: place the codebook in the system prompt, specify exact output format (labels only, comma-separated if multi-label), use JSON for inputs/outputs, and separate response text with a consistent delimiter.
- Pilot Testing and Validation: tasks include Halterman & Keith stage tests, hand-coding 50–100 responses, inter-coder reliability, self-coding diagnostics, per-category precision/recall/F1 reporting, and diagnostic prompts for misclassified cases.
- Hybrid Human-LLM Workflows: implement classification with human adjudication, flag uncertain cases, and plan for 10–15% human review, with ensemble design guidance and NA handling.
- Analysis and Interpretation: report prevalence, co-occurrence, measurement-error considerations, and design corrections; treat LLM outputs as one instrument, not ground truth.
- Reporting: document model names/versions, parameters, prompts, codebook, and classification runs; report metrics and archive prompts/code.
When to use it
- Use when designing or validating LLM-based text classification workflows for social science research, especially where formal codebooks, multi-step prompting, and rigorous validation are required. Triggered when you need a repeatable, auditable pipeline with explicit coding schemas, reliability testing, and hybrid human-in-the-loop adjudication.
What it can touch
- Tools: claude-code is listed as a declared tool
Caveats
- License: MIT
- Notes: The skill emphasizes open-weight models for reproducibility, explicit versioning for proprietary models, and careful handling of multi-language validation, data privacy, and potential model refusals on sensitive content. It prescribes no guaranteed outcomes and relies on validation metrics (precision, recall, F1, Cohen's Kappa) and pilot testing thresholds as house defaults rather than universal guarantees.
# LLM-Based Text Classification for Social Science Research ## Instructions ### 1. Codebook Design - Before drafting the codebook, specify the population, sampling frame, and (for experimental data) the treatment condition each response is drawn from. These constrain which categories can plausibly exist and which demographic subgroups any bias assessment must cover. LLM classification extends, rather than replaces, the longer open-ended coding tradition in survey methodology (Geer 1988; Lupia 2018). - Treat codebook design as the most consequential decision in the classification pipeline. LLMs struggle with loose instructions and revert to general-purpose definitions rather than following researcher-specific operationalizations (Halterman & Keith 2025). - Structure each code with the following components (adapted from Halterman & Keith 2025): - **Label**: The exact output string the model should return - **Definition**: A single-sentence operationalization of the construct - **Clarification**: What IS included — boundary cases that belong in this category - **Negative clarification**: What is NOT included — common confusions and adjacent categories - **Examples**: 2-3 positive exam
- Instructions
- 1. Codebook Design
- 2. Choosing a Learning Regime
- 3. Model Selection and Reproducibility
- 4. Prompt Construction
- 5. Pilot Testing and Validation
- 6. Hybrid Human-LLM Workflows
- 7. Analysis and Interpretation
- 8. Reporting
- Quality Checks
What does the text-classification skill do?
Design and validate LLM-based text classification. Use for codebooks, prompts, validation samples, agreement statistics, and reporting model-coded data.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill text-classification --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
