Configure field, institution, datasets, journals, and project metadata.
Walk the user through setup. Use request_user_input only for bounded single-choice prompts that fit Codex's 2-3 option UI in Plan mode; use conversational prompts otherwise. Collect all answers, then write config files in one pass.
Before reading or writing any project files, ensure the standard scaffold exists in the current working directory.
If ./plugins/social-science-research/hooks/setup-project-dirs.sh exists, prefer running it once from the project root. If that path does not exist, create the same scaffold directly:
quality_reports/plansquality_reports/session_logsquality_reports/specsquality_reports/mergesreferences/papersmanuscriptsoutput/tablesoutput/figuresoutput/diagnosticsoutput/analysisscripts/Rscripts/pythontemplatesPROJECT_CONTEXT.md with the default placeholders if it is missingCopy references/domain-profile.md and the starter files from templates/ into the project if they are missing.
Then read PROJECT_CONTEXT.md if it exists. Also read references/domain-profile.md silently. If either file has real content (not placeholders), tell the user what's already configured and offer to confirm or update each section.
Ask both questions conversationally in one response. Do not use request_user_input here because the option sets exceed Codex's 2-3 choice limit:
Field: "What is your field or subfield?" Offer examples such as Political Science, Economics, Sociology, or Public Health, and let the user answer freely.
Institution: "What is your institution?" Offer examples such as Duke University, Harvard University, Stanford University, or UC Berkeley, and let the user answer freely.
Store field and institution for customizing later steps.
Ask conversationally:
Wait for the user's response before moving to Step 3.
Ask conversationally. Codex question UI does not support multi-select, so keep it lightweight and collect the answers in one response:
Top journals (multiSelect, header: "Top journals"): "Select your top journals (pick all that apply):" — Offer the 4 most prestigious journals for the user's selected field. Use your knowledge of the field's top venues.
Secondary journals (multiSelect, header: "Secondary"): "Select secondary or subfield journals:" — Offer 4 secondary/subfield journals appropriate to the user's field.
User can multi-select presets and add custom journals via Other.
Ask conversationally. Codex question UI does not support multi-select, so keep it lightweight and collect the answers in one response:
Common datasets (multiSelect, header: "Datasets"): "Which datasets do you commonly use?" — Offer the 4 most-used datasets for the user's field. Use your knowledge of field-standard data sources.
Additional sources (multiSelect, header: "More data"): "Any additional data sources?" — Offer 4 cross-disciplinary sources: World Bank Open Data, IPUMS, Bureau of Labor Statistics, Census Bureau.
Use request_user_input in Plan mode for this paired single-choice prompt when the choices fit Codex's 2-3 mutually exclusive option limit; otherwise ask both questions conversationally in one response:
Researchers (single select, header: "Researchers"): "Add key researchers for targeted literature searches?" — Options: "Skip for now" / "Add researchers".
Colors (single select, header: "Colors"): "Which color palette should R figures use?" — If the institution is well-known, offer up to 3 choices: "[Institution] brand colors (Recommended)" with the hex codes, "Custom colors", and "Skip for now". Otherwise offer: "Custom colors" / "Skip for now".
If the user chose "Add researchers", ask conversationally for names, institutions, and Google Scholar URLs. Do NOT guess researcher names.
If the user chose "Custom colors", ask conversationally for primary and secondary hex codes.
references/domain-profile.mdRead the existing file and update each section with the user's answers. Preserve the file's existing structure and comments. Only replace sections the user answered; leave unanswered sections unchanged. Add an "Institutional Colors" section at the end if one doesn't exist, with the user's hex codes (or defaults #012169 / #f2a900 if skipped).
IMPORTANT: Do NOT write to rules/r-code-conventions.md. Colors live in references/domain-profile.md only.
Use PROJECT_CONTEXT.md as the project metadata file for Codex installs.
Update the metadata file header placeholders:
[YOUR PROJECT NAME] → user's project title (or leave placeholder if skipped)[YOUR NAME] → user's name (or leave placeholder if skipped)[YOUR INSTITUTION] → user's institutionSetup complete:
- project scaffold ensured (`quality_reports/`, `references/`, `manuscripts/`, `output/`, `scripts/`, `templates/`)
- references/domain-profile.md — field, [N] journals, [N] datasets[, N researchers][, colors]
- project metadata file (`PROJECT_CONTEXT.md`) — project name and institution
Update anytime: references/domain-profile.md
Next step: `new-project`
Note any skipped sections and where to add them later.