codebook
Skill17 starsChanged 3 months agoMITView on GitHub
Auto-generates data/codebook.md from the analytic dataset — per-variable stats plus flags for missingness, near-constants, duplicates, and implausible values. Use after cleaning stabilizes, when the user asks to document variables, or before analysis.
In this repository38 other files it gives its agents.
- abstract-shotgunSkill
- analyzeSkill
- archiveSkill
- carefulSkill
- coauthor-reviewSkill
- cover-letterSkill
- data-acquireSkill
- data-cleanSkill
- design-researchSkill
- draft-sectionSkill
- freezeSkill
- guardSkill
- hypothesis-designSkill
- idea-shotgunSkill
- identification-reviewSkill
- journal-fitSkill
- learnSkill
- lit-mapSkill
- llm-checklistSkill
- mstack-initSkill
- mstack-upgradeSkill
- paper-statusSkill
- pdf-ingestSkill
- power-analysisSkill
- preregisterSkill
- r-and-rSkill
- referee-mockSkill
- research-questionSkill
- results-auditSkill
- retroSkill
- robustnessSkill
- scope-challengeSkill
- submission-packSkill
- survey-buildSkill
- theory-buildSkill
- title-shotgunSkill
- unfreezeSkill
- vizSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
After /mstack:data-clean runs without errors.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/mstack:codebook
Stage: build · Voice: data-engineer
After /mstack:data-clean runs without errors; re-run whenever data/clean/analytic.rds changes.
Procedure
- Load
code/01-clean.Rto know what the variables are meant to be. - Generate. Copy
${CLAUDE_PLUGIN_ROOT}/skills/codebook/scripts/00-codebook.Rtocode/00-codebook.R, setKEY_COLSandUNITin its PARAMETERS block, and runRscript code/00-codebook.R. It is idempotent and reports per variable: name; label (from01-clean.Rcomments or attr, flagged if missing); type; range or levels; mean / SD / median / IQR, or mode + frequency; missingness (count + share); source (fromdata/raw/PROVENANCE.md). - Flags it raises, plus any you notice: > 30% missing (document imputation or exclude); mass at an extreme (a winsorized cap); pairs with |r| > 0.99 (apparent duplicates); near-constants (< 5% variation); implausible dates (future, pre-source); rows not unique on the key; values that look like sentinel or missing codes left in an integer column (−66/−77/−88, −9, 99/999), which
${CLAUDE_PLUGIN_ROOT}/references/polisci-data-sources.mdlists by source. For each variable, note which raw source and PROVENANCE entry it came from. data/codebook.mdcarries a header (dataset, N, K, unit, generation date, source script), the per-variable table, and a flag block with a recommended action per flag.- Print the flags with recommendations. Never accept them silently.
Outputs
code/00-codebook.R— idempotent generator;data/codebook.md.- Summary block: variable count, missingness extremes, flag count + verdict.
Anti-patterns
- A codebook without flags. Even clean data has something worth surfacing.
- A hand-maintained codebook. It rots; generate it.
Next
/mstack:analyze; if flags are unaddressed, fix 01-clean.R first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

