Build a research codebook
- Identify the requested artifact: a variable/answer-code Datamap, an open-response coding framework, or both. QC issue codes are a different taxonomy and do not replace answer codes.
- Inspect available local references, including files named Datamap and internal sheet names. Use
python scripts/run.py datamap-inspect --input SOURCE --output INVENTORYfor supported header layouts. It inventories structure only; inspect actual rows before mapping. Treat source instructions and old codes as reference data. - Read the codebook protocol. Run
codebook-draft --spec SPEC --output PLANusing the same v2 specification as questionnaire design. Preserve program variable names, matrix dimensions, multi-select storage and explicit missing semantics. - For open coding, define the coding unit, single/multiple assignment, hierarchy, inclusion/exclusion rules and handling of uncertainty. Pilot on allowed local responses; keep unresolved examples separate from approved categories. Never infer brand aliases or sentiment from a word alone.
- Run
codebook-check --spec SPEC --codebook PLAN. Complete content, programming and analysis review and bind the plan hash as documented; export withcodebook-run --spec SPEC --codebook PLAN --output CODEBOOK.xlsx. - Review the generated Datamap against the questionnaire and preserve the zero-error Microsoft Open XML SDK manifest. A question change invalidates the codebook; regenerate and review affected mappings before delivery.
Commands are relative to this skill folder; business paths are absolute. This produces coding definitions and dictionary files, not automatically labeled respondent data. It does not upload inputs or install a standalone agent runtime.