In short.
Generate Codebook is an assistant skill for researchers and developers creating data dictionaries, but its output needs human review before becoming an authoritative reference. The supplied Python source profiles tables locally with pandas and leaves labels and units unset. Important limits include heuristic role assignment, truncated category listings and a dictionary-warning count that excludes unresolved units and date meanings. Runtime correctness, performance and assistant-host compatibility have not been assessed; neither the profiler nor its tests were executed.
Researched and written by an AI model and checked by a second AI model. How it works
Covers all five supplied files in skills/generate-codebook: SKILL.md, skill.yml, references/codebook_schema.md, scripts/generate_codebook.py and tests/test_generate_codebook.sh, together with root LICENSE and THIRD-PARTY-NOTICES.md at commit e0ea3b0be3bf529aa0b94ee5fd8450e78848932c. Other skills and wider-package implementations are excluded. No code was executed. File-format compatibility, runtime correctness, performance, assistant integration, downstream behavior and real-data privacy outcomes remain unassessed.
The overview
Resource identity
Generate Codebook belongs to Aperivue's medsci-skills collection. The selected folder contains assistant instructions, a Python profiling script, a codebook schema reference, skill metadata and a shell regression test. Its original location is [https://github.com/Aperivue/medsci-skills/tree/main/skills/generate-codebook].
The assistant instructions describe a dictionary-first workflow: measure what the table contains, then obtain variable meanings from an authoritative dictionary rather than guessing them.
Practical assessment
The resource offers a useful starting point for documenting a dataset's structure. Its strongest feature is the separation between observable properties, such as missingness and value frequencies, and meanings that require a researcher or source dictionary.
Treat the generated files as drafts. A role assignment can be wrong, and a zero needs_dictionary_count does not establish that every variable is understood. Actual execution reliability and integration with a particular assistant remain unknown.
Who it suits
Researchers, analysts and data managers can use the Markdown table to review variables before analysis. Developers can consume codebook.json in a documentation or quality-control pipeline. Someone familiar with the dataset must still confirm roles, units and coded values.
The resource does not provide clinical interpretation, invent variable descriptions or clean the data. Its documented downstream uses include variable definition and dictionary-based quality control, whose implementations are outside the supplied folder.
Inputs and outputs
The reader includes CSV/TXT, TSV, Excel, Parquet, Stata .dta and SAS .sas7bdat paths, with some formats requiring separate reader engines. Each column record includes its name, inferred role, pandas dtype, missing count and percentage, distinct-value count and up to three non-null examples.
Continuous columns receive range, quartiles, median, mean and standard deviation. Categorical and binary columns receive frequency listings; date columns receive date ranges. The default outputs are codebook.json and codebook.md. Options include --max-levels, --json-only and --md-only.
Using it
Requirements
The profiler requires Python 3 and pandas. Excel readers may require openpyxl or xlrd; Parquet requires an engine such as pyarrow or fastparquet. The regression-test script also checks for NumPy. Minimum supported versions and a pinned environment are not supplied.
The profiler itself needs no language model or API credential. The assistant invocation assumes a CLAUDE_SKILL_DIR environment variable, but these files do not establish host installation, skill discovery or compatibility across assistants.
How it works
The script loads the table into a pandas DataFrame and profiles each column. Role inference considers dates first, then columns with exactly two distinct values, then numeric and string rules. The categorical cutoff defaults to 20 distinct values. Numeric identifier candidates require an identifier-like name, integer-valued data and cardinality above that cutoff.
String date detection examines the first 50 non-null values and requires more than 80 percent to parse; numeric columns bypass this detection. Bare numeric or short-token categories receive needs_dictionary warnings. Labels and units remain null, and the script has no language-model step that fills in meanings.
Getting started
Obtain the skill folder with its script and reference files, install pandas and any necessary reader engine, then invoke the profiler. From the repository root, an example command is python skills/generate-codebook/scripts/generate_codebook.py data.csv --out-dir codebook-output.
Choose the output directory deliberately: the default is the current directory, and existing files with the generated filenames are overwritten. Review role assignments against the schema reference before interpreting the results. Host-specific installation instructions are not established by the supplied files.
Illustrative use
The documented cohort example contains sex values 1/2 and fatty_liver_grade values 0 through 4. These are intended to receive dictionary warnings without assigning meanings to the numbers. A smoking_status column containing never, former and current is intended to remain unflagged because its values are readable.
A researcher would supply meanings from the actual dictionary and cite the relevant file, sheet and row. If no authoritative meaning is available, the warning remains unresolved. These examples describe intended behavior, not executed results.
Assessment & evidence
Limits and cautions
Role inference can miss coded variables. Integer codes with more than --max-levels distinct values can become continuous, and longer nonnumeric codes can escape dictionary warnings. High-cardinality text containing numeric strings can also remain unflagged. Human role review is therefore essential.
needs_dictionary_count excludes continuous-unit and date-meaning requests because those appear in notes without setting the Boolean flag. The Markdown table omits these notes, labels and units. JSON category listings stop at 15 levels, while the Markdown summary shows at most six, so neither provides an exhaustive category listing in every case.
The script loads the table into memory, and large-data performance is unassessed. Outputs retain the input path and example values, which may expose sensitive information. The profiler has no network calls, but that does not establish how an assistant host handles data or generated files.
Why the design matters
Deterministic profiling makes the observable part of documentation inspectable, while leaving unknown meanings explicit reduces opportunities for an assistant to invent definitions. This is useful when an incorrect interpretation of a code would change an analysis.
The approval gates exist in the assistant instructions, not as enforced checks in the Python program. The script writes draft artifacts immediately and does not verify researcher approval or dictionary provenance. Automated consumers must not equate successful file creation with semantic completeness.
Other approaches
The bundled Python script can be used directly when an assistant-led workflow is unnecessary. An existing authoritative data dictionary remains the source for meanings; this profiler complements it by describing observed data.
The metadata directs data cleaning to clean-data and dataset versioning to version-dataset. Their implementations are not supplied, so their capabilities and comparative quality are unassessed. The evidence does not support a comparison with external profiling products.
Evidence and confidence
The implementation supports the described profiling logic, and the regression-test source defines synthetic cases for role inference, unresolved-code flags, null labels and units, mixed coded categories, integer years and text measurements. No execution logs or performance measurements are supplied. Neither the profiler nor the tests were executed.
Static inspection also identifies limits in the test harness: it exits successfully when pandas or NumPy is unavailable, and failures in Python checks read through process substitutions are not explicitly propagated. A successful shell exit alone would therefore be insufficient evidence that every intended assertion ran.
Access & freshness
Costs
The MIT licence permits use without a licence fee. The profiler contains no model API call or hosted-service dependency. Assistant subscriptions, local computing costs, memory requirements and runtime costs are not specified, so total operating cost is unknown.
Licence and reuse
The root MIT licence permits use, modification, commercial distribution and sublicensing, provided the copyright and permission notices accompany copies or substantial portions. It disclaims warranties.
THIRD-PARTY-NOTICES.md identifies separate licences for guideline materials, templates and citation styles elsewhere in the repository; it identifies no exception within skills/generate-codebook. Those wider-package exceptions should not be applied indiscriminately to this folder or ignored when obtaining other folders. Rights in users' datasets are not established by the software notices.
Source snapshot
The supplied files are pinned to commit e0ea3b0be3bf529aa0b94ee5fd8450e78848932c, captured on 2026-11-17 at 09:01:36.420 UTC. The corresponding folder is [https://github.com/Aperivue/medsci-skills/tree/e0ea3b0be3bf529aa0b94ee5fd8450e78848932c/skills/generate-codebook].
skill.yml declares metadata schema version 2, while generated codebooks declare schema version 1. These are separate schema identifiers, not an established product release version. Later changes and compatibility with current dependency releases are unknown.
Recommended next steps
Acquire the pinned folder and licence notices, then check it with a non-sensitive table in the intended environment. Confirm inferred roles and inspect both JSON and Markdown, including units and date notes that are absent from the warning count.
Resolve coded meanings only against an authoritative dictionary and retain unresolved warnings when that source is unavailable. Before downstream analysis, check high-cardinality coded columns separately. Before external sharing, deidentify the source data and inspect retained examples and paths; the referenced deidentify implementation is outside this folder.
