/open-scholar-skill:scholar-auto-research [research idea OR data/codebook paths | resume <project-dir> | verify <project-dir>]from open-scholar-skill
Stable, deterministic pipeline for producing a publishable social-science research paper from idea or data, including manuscript, citations, replication package, and final outputs in md/docx/tex/pdf.
Ships in open-scholar-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Stable default pipeline for one defensible social-science paper. This skill is intentionally smaller than scholar-full-paper: no grants, presentations, resubmission, teaching, monitoring, or auto-improve in the default route.
The main goal of scholar-auto-research is to produce a publishable, high-quality paper for the target journal. Passing contracts, phases, manifests, and hashes is required, but those are means rather than the end.
Therefore:
scholar-write must remain the primary prose engine. If the workflow needs helpers, they must prepare governed inputs or package outputs, not substitute for real drafting.scholar-citation must remain the primary citation and claim-support engine. If the workflow needs helpers, they must package inventories or manifests, not substitute for source verification, claim checking, or bibliography judgment.scholar-lit-review-hypothesis must run its local-library-first search protocol, maintain its search and process logs, and carry forward its source-integrity checks. Do not substitute ad hoc prior-project bibliographies, generic web-only searching, or hand-assembled citation pools for that workflow.System-level publication-quality gates:
Use the phase contract as the source of truth:
references/phase-contract.jsonreferences/phase-contract.mdreferences/artifact-contract.mdreferences/state-contract.mdreferences/skill-routing-contract.mdreferences/research-question-contract.mdreferences/literature-theory-contract.mdreferences/design-contract.mdreferences/data-measurement-contract.mdreferences/analysis-plan-contract.mdreferences/pre-execution-review-contract.mdreferences/analysis-premortem-contract.mdreferences/execution-contract.mdreferences/post-execution-review-contract.mdreferences/runtime-sanity-contract.mdreferences/results-lock-contract.mdreferences/manuscript-drafting-contract.mdreferences/verification-contract.mdreferences/citation-claim-contract.mdreferences/ethics-open-science-contract.mdreferences/replication-contract.mdreferences/quality-gate.mdreferences/final-assembly-contract.mdreferences/submission-hygiene-contract.mdDo not infer completion from prose headings. A phase completes only when its required outputs exist, its structured verdict passes, and state is updated.
A full run spans 21 phases and accumulates many manifests, registries, reviewer reports, and locked artifacts. Because every decision is persisted to disk (state.json, manifests, locks), the conversation context can be cleared between phases without losing project state. After clearing, resume cold with bash "${_AR_SKILL}/scripts/auto-research-state.sh" next "$PROJ" or /scholar-resume <slug>.
The state machine emits an advisory when the most recently completed phase is a context-rot seam. After running next, look for these lines in addition to NEXT_PHASE:
CONTEXT_CLEAR_RECOMMENDED=1
CONTEXT_CLEAR_REASON=<seam-specific reason>
Recommended /clear seams (5 total across 21 phases):
Do not clear inside Phase 6 or 7 fix-rereview loops, inside Phase 13 drafting passes, or during an active route-back rerun: those work best with continuity. Subagent reviewers in Phases 6, 7, 9, 14, and 18 already isolate their own context, so their dispatch does not by itself require a clear.
The default route ends at Phase 20. Optional products must be requested explicitly and should use other scholar skills.
Phase 0 initializes or resumes the project, verifies local data-safety status, and records whether the run is autonomous or human-in-the-loop. Do not begin Phase 1 until Phase 0 verification passes.
Before every Bash tool call in this workflow, set _AR_SKILL in that same call to the absolute directory containing this loaded SKILL.md. The skill host already resolved that file in order to load these instructions; use that resolved directory. Never infer it from the current working directory, $HOME, a marketplace symlink, or a parent plugin tree. The command examples below use ${_AR_SKILL} only after this absolute, same-call assignment.
output/<slug>/.If the project was initialized by scholar-init, import its safety sidecar:
bash "${_AR_SKILL}/scripts/auto-research-state.sh" import-init "$PROJ"
This reads $PROJ/.claude/safety-status.json, writes $PROJ/safety/safety-status.json, and initializes .auto-research/state.json if needed. If any file still has NEEDS_REVIEW or HALTED, stop and run scholar-init review before completing Phase 0.
Bare OVERRIDE does not pass. Overrides must retain the scholar-init rationale, e.g. OVERRIDE: public synthetic demo file. If no files were scanned, the safety artifact must explicitly declare no_data_declared: true.
If the project was not initialized by scholar-init, initialize state:
bash "${_AR_SKILL}/scripts/auto-research-state.sh" init "$PROJ"
Then scan any input data before Phase 0 — do NOT hand-author safety/safety-status.json. Run /scholar-init (its ingestion scans each file under data/raw/** with scripts/gates/safety-scan.sh, writes .claude/safety-status.json, and arms the PreToolUse data guard), then import-init exactly as in the scholar-init branch above. If the project genuinely has no input data, create safety/safety-status.json with files_scanned: 0, no_data_declared: true, status_by_file: {}. Either way, Phase 0 verification now enumerates data-like files by filename under data/raw/, data/interim/, data/processed/, materials/, transcripts/, interviews/, corpus/, subjects/, participants/, respondents/, and field-notes/ and RED-fails if any exist but are absent from status_by_file — a hand-authored "no data" (or partial) artifact will not pass when data files are present on disk (F5, audit 2026-07-07).
Run scholar-auto-research in autonomous mode or human-in-the-loop step-by-step mode?Use autonomous mode when the user asks to proceed, continue, or finish without step-by-step review:
bash "${_AR_SKILL}/scripts/auto-research-state.sh" set-mode "$PROJ" autonomous "user requested autonomous run"
Use human-in-the-loop mode when the user asks for step-by-step review, explicit approval, or decisions between phases:
bash "${_AR_SKILL}/scripts/auto-research-state.sh" set-mode "$PROJ" human-in-loop "user requested phase-by-phase approval"
If next returns NEXT_PHASE=MODE_SELECTION, stop and get this choice before completing any phase. Do not infer autonomous mode from silence.
bash "${_AR_SKILL}/scripts/setup-project-claudemd.sh" "$PROJ"
This writes (or refreshes) the workflow-contract block — principles (quality, no-fabrication, no-sycophancy) plus auto-research-specific operational rules (run mode persistence, self-contained vendoring, portable review evidence, Phase 15 cross-check, prereq-chain integrity, and JSON-shape strictness) — inside the marker block <!-- scholar-auto-research:BEGIN/END auto-rules v1 -->. User content OUTSIDE the markers is preserved verbatim. The setup is idempotent — running twice produces a byte-identical file.
The target filename is chosen by the vendored detect-host-agent.sh helper (added 2026-05-28): Claude Code → CLAUDE.md; Codex → AGENTS.md (agents.md cross-tool standard); unknown host → both files. Existing projects refresh whichever file is already present and do not backfill the other.
The script prints a one-time user-facing notice on CREATE / APPEND (full banner with the file path, a summary of what's in it, the auto-managed content for review, and a reminder that the operator can add content outside the markers) and a short banner on REFRESH / MIGRATE. NO-OP runs are silent. Do not redirect this script's stdout to /dev/null — the notice is intended for the operator to see on first invocation.
5b. Run the host-neutral runtime preflight. This verifies the copied skill's declared command and packaged-file closure for every host; it is not part of an optional Codex installer.
python3 "${_AR_SKILL}/scripts/runtime-preflight.py" --skill-dir "${_AR_SKILL}"
Then install the Codex data-safety hook only when the host is confirmed as Codex. The
data guard (pretooluse-data-guard.sh) uses different host hook mechanisms;
when the detected host is codex, register the guard in
<proj>/.codex/config.toml. This host adapter is safety integration, not the
review-evidence authority.
_HOST="$(bash "${_AR_SKILL}/scripts/detect-host-agent.sh" 2>/dev/null || echo unknown)"
if [ "$_HOST" = "codex" ]; then
bash "${_AR_SKILL}/scripts/setup-codex-hooks.sh" "$PROJ"
fi
unset _AR_SKILL _HOST
Surface the installer's output verbatim when the confirmed Codex branch runs
(denied nothing to relay on NO-OP; on CREATE it prints the trust-onboarding
reminder). A nonzero installer result blocks that Codex branch. unknown and
other hosts continue with the host-neutral packaged preflight and their own
safety integration; they never receive a speculative .codex/config.toml.
If the project later opts into lockdown via /scholar-safety level lockdown,
the OS-sandbox wall is generated then (not here).
bash "${_AR_SKILL}/scripts/auto-research-state.sh" next "$PROJ"
If next returns APPROVAL_REQUIRED=1, the project is in human-in-the-loop mode. Summarize the completed phase, name the proposed next phase, and ask the user for a decision before doing next-phase work. Valid decisions are approve, revise, pause, or switch-autonomous:
bash "${_AR_SKILL}/scripts/auto-research-state.sh" decision "$PROJ" <next_phase> approve "user approved next phase"
Only approve or switch-autonomous clears the gate. revise and pause are recorded but keep the transition blocked.
bash "${_AR_SKILL}/scripts/auto-research-state.sh" complete "$PROJ" <phase_id>
Every state command holds the same project lock. complete snapshots the contract, verifier, exact contract-derived outputs, and dynamic inputs; invokes the vendored verifier internally; requires the post-semantic descriptor to match that entry generation; and rechecks all generations before and after atomic publication with rollback. Optional artifact paths are equality assertions only. Project-local verify stamps are post-commit audit receipts and never completion authority. If transactional verification or state publication fails, stop and report the blocker. Do not continue. In human-in-the-loop mode, successful completion of a phase creates a pending transition; do not start the next phase until decision ... approve has been recorded.
Phases 6, 7, 9, 14, 18, and 20 require registered review evidence. The layer
exists because names and task IDs typed into phase JSON do not prove that any
reviewer was dispatched. Before dispatch, call review-begin for the phase's
declared round; it returns a host-neutral launch envelope with reserved roles,
opaque dispatch IDs, exact reviewed-input hashes, and fixed report/trace paths.
After a host terminally succeeds and those files exist, call review-complete
for the role. Bind the selected session and evidence paths into the canonical
phase JSON before verification. Abort failed/cancelled/timed-out work instead
of recording completion.
The default normal profile provides process_recorded: state-registered
assignment, driver-observed success, and byte binding. It does not authenticate
the host or prove review quality. strict requires claim-scoped host
verification and blocks when the adapter cannot provide it. Claude, Codex, and
generic hosts all use the same lifecycle; provider-specific IDs and model names
are optional metadata with structured unavailability. Read
references/review-evidence-contract.md for commands, assurance boundaries,
migration, and host mappings.
Claim-level evidence is a separate contract from reviewer evidence and is not
satisfied by it. Phases that attach a citation to a claim must record the anchor
per _shared/evidence-ledger.md (schema claim-anchor/v1), including the
retrieval tier actually reached. Recording that a citation was attached is not
recording that a source was read: a ledger of metadata_only anchors at tier
none produces the appearance of evidence discipline while leaving the
load-bearing question unasked, which is how four reversed-attribution defects
reached a locked manuscript in the 2026-08 premarital-cohab run.
If a phase emits a structured FAIL report with route_back_phase, apply it to state before continuing:
bash "${_AR_SKILL}/scripts/auto-research-state.sh" route-back "$PROJ" <fail-report-json>
bash "${_AR_SKILL}/scripts/auto-research-state.sh" next "$PROJ"
Do not manually skip invalidated downstream phases. Rerun forward from the route-back target.
Phase 1 formalizes the project question and target journal calibration. Read references/research-question-contract.md before running it.
Workflow:
idea, data, materials, or paper.scholar-idea when the user provided a broad topic, puzzle, rough question, or theoretical interest.scholar-brainstorm when the user provided data, codebooks, questionnaires, data dictionaries, a paper, an abstract, or other materials without a clear research question.scholar-journal at Phase 1 for journal calibration. idea/journal-fit.json must preserve a journal_profile_resolution record stating whether the profile is built-in, imported from a web-fetched custom journal, or an explicit fallback.ASR / American Sociological Review, not a generic article shell.
Use scripts/emit-journal-profile-resolution.py or references/journal-profile-resolution-templates.json for fallback metadata; do not hand-write fallback ASR journal_structure or display_architecture objects.idea/candidate-rqs.json, idea/rq-evaluation-panel.json, idea/journal-fit.json, idea/rq-selection-rationale.md, idea/research-question.json, and idea/research-question.md.auto-research-verify.sh 1 "$PROJ". Phase 2 may start only after the selected RQ, target journal, journal-profile resolution, and selection rationale pass.Phase 1 must not perform the full literature review. Its job is to avoid choosing a bad question; Phase 2 builds the full literature and theory base.
Phase 2 builds the journal-calibrated literature, theory, mechanism, and hypotheses for the selected Phase 1 question. Read references/literature-theory-contract.md before running it.
Workflow:
idea/research-question.json plus idea/journal-fit.json.scholar-lit-review-hypothesis as the primary integrated engine. It must produce the literature landscape, gap statement, theory selection, mechanism chain, hypotheses, must-cite coverage, and target-journal calibration.literature/search-log.md, write literature/review-protocol.json, and keep the process/source-integrity traces needed to prove the local-library-first workflow actually ran.literature/literature-coverage-matrix.json with engine_handoff, coverage categories, must-cite coverage, mechanism chain, hypotheses, journal calibration, and ready_for_phase_3: true. Treat the Phase 2 hypotheses array as the ex ante canonical hypothesis set for all downstream design, analysis, drafting, and interpretation.literature/references.bib with more than 30 verified BibTeX entries. Every must-cite work must be represented and marked covered.scholar-write to draft or revise the formal literature/lit-theory.md section from the integrated review output. The writing pass must preserve verified citations, Phase 1 claim strength, mechanism, hypotheses, and target-journal expectations.literature/lit-theory-manifest.json with scholar-lit-review-hypothesis and scholar-write engine metadata, protocol artifact paths, source hashes, output hashes, ready_for_phase_3: true, and the evidence-ledger assertion "evidence_ledger": {"path": "evidence/claim-anchors.ndjson", "records": <N>} — the delegated skills capture the anchors under their own evidence protocol; this packaged verifier uses the assertion to enforce that capture actually happened (path must exist, actual line count ≥ records).auto-research-verify.sh 2 "$PROJ". Phase 3 may start only after the integrated review, protocol proof, writing handoff, coverage matrix, and bibliography pass.Do not hand-author a generic literature memo. Phase 2 must be both review-driven and write-polished. If the literature package cannot prove the named specialist workflow was followed, Phase 2 fails even if the prose and bibliography look plausible.
Phase 3 turns the selected question and integrated literature/theory into a design that Phase 4 can operationalize. Read references/design-contract.md before running it.
Workflow:
idea/research-question.json, idea/journal-fit.json, literature/lit-theory.md, literature/lit-theory-manifest.json, and literature/literature-coverage-matrix.json.scholar-design as the primary engine. The design must inherit the Phase 1 target journal, paper type, method bar, and claim strength, plus the Phase 2 mechanism chain and hypotheses.scholar-compute; qualitative projects must invoke scholar-qual; linguistic projects must invoke scholar-ling; mixed-methods projects must record a primary execution skill plus supporting specialist skills. Quantitative observational/demographic projects may stay on the default scholar-analyze route.scholar-causal before finalizing the design.design/design-blueprint.md, including a literal outcome_mechanism_alignment: <class> line where the class is entry-process, prevalence-stock, dissolution, or multi-state.design/identification-strategy.json with claim strength, estimand, identification strategy, assumptions, X/Y measures, journal method bar, hypothesis-model coverage, feasibility or power assessment, causal gate, method-specialist routing, threats, and robustness plan.design/model-specs.json. Every Phase 2 hypothesis must appear in at least one model's hypothesis_ids, unless the design records an accepted unmodeled limitation.design/design-manifest.json with scholar-design metadata, conditional scholar-causal metadata, method-specialist engine metadata, source hashes, output hashes, target journal, claim strength, design-to-writing continuity matrices (claim_continuity, mechanism_result_matrix, robustness_claim_matrix, limitation_scope_matrix), and ready_for_phase_4: true.auto-research-verify.sh 3 "$PROJ". Phase 4 may start only after the design, evaluation, revision log, routing plan, and manifest pass.Do not let a generic methods memo pass as a design. Phase 3 must prove that the design is journal-calibrated, hypothesis-linked, feasible, and strong enough for the claim.
Phase 4 turns the hardened design into a data and measurement plan. Read references/data-measurement-contract.md before running it.
Workflow:
safety/safety-status.json, design/design-blueprint.md, design/design-manifest.json, design/identification-strategy.json, and design/model-specs.json.scholar-data as the data and measurement engine. Use it to verify dataset fit, access path, IRB implications, variable availability, sample feasibility, data security, and sharing constraints.data/data-status.json with data status, access status, IRB status, source type, concrete file/provenance entries, and dataset fit.data/variable-dictionary.csv. It must cover every Phase 3 X/Y measure and every outcome, predictor, and covariate used in design/model-specs.json; each row must state design source, missing-value handling, post-treatment status, measurement quality, and reader-facing translation fields (display_label, table_stub_label, manuscript_term, levels_display).data/measurement-plan.md with measurement validity, missing data handling, sample restrictions, data provenance, access/IRB implications, security, sharing constraints, dataset fit, model-variable coverage, and post-treatment-control review.data/data-measurement-manifest.json with scholar-data metadata, Phase 3 and safety source hashes, output hashes, dataset-fit verdict, variable coverage, safety provenance, post-treatment review, and ready_for_phase_5: true.auto-research-verify.sh 4 "$PROJ". Phase 5 may start only after data status, variable coverage, measurement plan, safety provenance, and the manifest pass.Do not let Phase 4 pass with vague dataset promises. If data access, IRB, key variables, sample feasibility, or post-treatment-control status are unresolved, keep the project in Phase 4 or route back to Phase 3 if the design must change.
Phase 5 turns the design and measurement plan into an executable analysis plan without executing it. Read references/analysis-plan-contract.md before running it.
Workflow:
design/design-manifest.json, design/identification-strategy.json, design/model-specs.json, data/variable-dictionary.csv, data/data-measurement-manifest.json, and data/measurement-plan.md.scholar-auto-research's internal analysis_plan_compiler. Do not invoke scholar-analyze, load raw data, estimate models, generate tables, or produce figures in Phase 5.analysis/spec-registry.csv. Every Phase 3 model and every Phase 3 hypothesis must have at least one planned spec_id; every spec variable must appear in the Phase 4 variable dictionary.analysis/scripts-inventory.json with planned scripts, script order, dependency graph, expected inputs/outputs, and planned tests. Every script and test must remain planned.analysis/analysis-plan.md explaining model sequence, hypothesis/spec mapping, robustness checks, missing-data strategy, variable-construction plan, script/test inventory, no-execution boundary, and Phase 6 pre-execution review handoff.analysis/analysis-plan-manifest.json with scholar-auto-research / analysis_plan_compiler metadata, source hashes, output hashes, model/spec/hypothesis coverage, variable coverage, robustness coverage, missing-data alignment, script DAG validation, test coverage, and ready_for_phase_6: true.method_specialist_routing.primary_execution_skill. Layer 1 (in auto-research-verify.sh): every spec-registry row's required columns must be non-empty, but the covariates column is skipped when the resolver helper (scripts/gates/_phase5-skill-resolver.sh) reports primary_execution_skill ∈ {scholar-compute, scholar-qual, scholar-ling}. Layer 2 (scripts/gates/control-variables-check.sh): non-regression families return GREEN N/A; regression family (scholar-analyze) requires ≥1 spec with controls, with RCT/DAG refinements via free-form design_type pattern match. Opt out per-phase by adding [EXCUSED:control-variables: <reason>] to analysis/analysis-plan.md (suppresses Layer 2 only — Layer 1 still applies).auto-research-verify.sh 5 "$PROJ". Phase 6 may start only after planned specs, scripts, tests, coverage, hashes, control-variable enforcement, and the no-execution boundary pass.Do not allow generic script lists. Phase 5 must make the planned analysis reviewable enough that Phase 6 can audit exact scripts, exact specs, exact tests, and exact design promises before execution.
Phase 6 is an active review-fix-rereview loop, not a passive report. Read references/pre-execution-review-contract.md before running it.
Workflow:
analysis/analysis-plan.md, analysis/analysis-plan-manifest.json, analysis/scripts-inventory.json, analysis/spec-registry.csv, design/identification-strategy.json, design/model-specs.json, data/variable-dictionary.csv, and data/data-measurement-manifest.json.scholar-code-review in pre_execution_planned mode.review-begin "$PROJ" 6 initial_panel <host-backend>, then dispatch the reserved roles correctness, robustness, statistical, reproducibility, style_ai_patterns, and data_handling. Each reviewer must inspect every planned script, every planned test, every planned spec, the script DAG, Phase 5 coverage fields, and the upstream design/data artifacts.review-complete after driver-observed success, and bind the resulting report path and opaque dispatch/task identity into review/pre-execution-review.json.review/pre-execution-fix-log.json and review/pre-execution-fix-log.md.fix_rereview round and run the reserved independent fix_verifier role. It must produce separate registered evidence and review/pre-execution-rereview.json.review/pre-execution-review.json only after blockers are resolved. Its final verdict must be PASS, degraded: false, review_engine.skill: scholar-code-review, review_engine.mode: pre_execution_planned, blocking_findings: [], and ready_for_phase_7: true.SCHOLAR_CODEX_REVIEW=1, run the packaged Codex cross-model gate and supply
its artifacts or documented excuse. Merely installing Codex or placing it on
PATH never changes Phase 6 correctness.auto-research-verify.sh 6 "$PROJ". Complete Phase 6 only if verification passes.If fixes require changing analysis/scripts-inventory.json, recompute and record the new inventory hash after the changes. If fixes change the research design, data plan, or analysis plan rather than just the planned scripts/tests, route back to the earliest affected phase instead of papering over the mismatch in Phase 6.
Phase 7 is the last design-risk gate before execution. Read references/analysis-premortem-contract.md before running it.
Workflow:
ready_for_phase_7 is true.method_specialist_routing. Default quantitative projects use scholar-analyze; computational projects use scholar-compute; qualitative projects use scholar-qual; linguistic projects use scholar-ling. Record the selected skill in premortem_engine.skill, mode: premortem, auto_research_contract: phase_7, and skip_premortem_ignored: true.premortem_panel evidence round, then dispatch the reserved roles identification, measurement_missingness, model_robustness, and interpretation_claims. Persist each reserved report/trace and register completion. Provider task/model identity may be opaque or structurally unavailable.analysis/analysis-plan.md, analysis/spec-registry.csv, analysis/scripts-inventory.json, and Phase 6 review artifacts.analysis/spec-registry.csv; every hypothesis needs an observable null pattern, precommitment status, and planned interpretation rule.review/analysis-premortem-fix-log.json, review/analysis-premortem.json, and review/analysis-premortem.md.auto-research-verify.sh 7 "$PROJ". Phase 8 may start only when the Phase 7 decision is GO.Phase 8 executes only the approved Phase 7 handoff. Read references/execution-contract.md before running it.
Workflow:
go_no_go.decision is GO, and ready_for_phase_8 is true.method_specialist_routing. Default quantitative projects use scholar-analyze; computational projects use scholar-compute; qualitative projects use scholar-qual; linguistic projects use scholar-ling. Record the selected skill in execution_engine.skill, mode: execute_analysis, auto_research_contract: phase_8, and phase7_handoff_only: true.
For scholar-analyze-routed quantitative work, inherit the stronger full-paper defaults unless the execution report records a justified exception: use R as the primary execution language, modelsummary for regression-table export, ggplot2 for figures, and marginaleffects when nonlinear probability models are central to the paper. Before execution, copy this skill's bundled canonical references/viz_setting.R into the project as analysis/scripts/viz_setting.R; do not author a local replacement or simplified style file. Use that copied file plus theme_Publication() for shared ggplot styling, and record analysis_stack.viz_style_source: analysis/scripts/viz_setting.R, analysis_stack.viz_style_reference: references/viz_setting.R, and the canonical analysis_stack.viz_style_sha256 in analysis/execution-report.json. Use the Phase 4 variable dictionary as the authoritative source for reader-facing labels in tables, figures, captions, and manuscript prose.review/analysis-premortem.json.phase8_handoff.script_order.analysis/execution-report.json.tables/results-registry.csv with one row for every planned spec_id in analysis/spec-registry.csv.tables/ and register it as main_regression_table or regression_table. The table must preserve the original regression-table shape with model columns and predictor rows; a result registry, model ladder, or focal-coefficient extract is not a publication table.figures/figure-registry.csv for every produced figure or an explicit no-figure row if none are planned.artifact_manifest in analysis/execution-report.json covering every produced Phase 8 table, figure, model output, diagnostic, and intermediate output with path, role, producer, registration status, and hash.auto-research-verify.sh 8 "$PROJ". Phase 9 may start only after the execution report and registries pass.Phase 9 evaluates the executed outputs before any result is treated as lockable evidence. Read references/post-execution-review-contract.md before running it.
Workflow:
ready_for_phase_9 is true.scholar-verify in Stage 1 pre-draft mode (stage1_no_manuscript) to compare raw tables/figures against tables/results-registry.csv and figures/figure-registry.csv.post_execution_panel evidence round, then dispatch the reserved roles statistical_results, robustness_consistency, sample_data_integrity, and interpretation_claims; persist their reserved reports/traces and register each successful completion.spec_id, every result row, every figure registry row, execution warnings/errors, Phase 7 decision rules, Phase 7 null-falsification rules, and Phase 7 reporting-depth checklist.review/post-execution-review.json, review/post-execution-review.md, and review/post-execution-fix-log.json.auto-research-verify.sh 9 "$PROJ". Phase 10 may start only if there are no unresolved critical issues and no route-back phase.Phase 10 is the final anti-drift and anti-nonsense gate before results are locked. Read references/runtime-sanity-contract.md before running it.
Workflow:
decision: PROCEED_TO_RUNTIME_SANITY.runtime_engine.skill: scholar-auto-research, mode: runtime_sanity, auto_research_contract: phase_10, and deterministic_gate: true.verify/runtime-sanity.json and verify/runtime-sanity.md.auto-research-verify.sh 10 "$PROJ". Phase 11 may lock results only if Phase 10 passes.Phase 11 freezes the verified analysis artifacts for drafting. Read references/results-lock-contract.md before running it.
Workflow:
auto-research-verify.sh 10 "$PROJ" and confirm Phase 10 passed with decision: PROCEED_TO_RESULTS_LOCK.tables//figures/ folders; it must exactly match Phase 10 artifact_inventory.results-locked/<lock_id>/ and record it in results-locked/manifest.json.results-locked/LATEST.txt with exactly the active lock_id.lock_engine, latest_matches: true, stage1_verdict: PASS, and each locked artifact with source path, locked path, SHA-256, artifact role, and lock_status: copied.results-locked/<lock_id>/ and fail if it contains any file not listed in the manifest.verify/stage1-verify.json to prove every lock artifact matches the source artifact reviewed by Phase 10; Stage 1 scanner provenance must identify the Phase 11 contract.auto-research-verify.sh 11 "$PROJ". Phase 12 blueprint construction may use only locked artifacts.Phase 12 converts the active results lock and upstream research plan into a single whole-paper governance artifact. Read references/manuscript-blueprint-contract.md before running it.
Workflow:
auto-research-verify.sh 11 "$PROJ"; do not build a blueprint if the active lock fails.results-locked/manifest.json, verify/stage1-verify.json, research question, journal fit, literature/theory, design blueprint, identification strategy, analysis plan, post-execution review, results registry, and figure registry.journal_profile_resolution explicitly. Imported custom profiles must survive unchanged into the blueprint, and an ASR fallback must remain explicit rather than silently becoming a generic structure.display_architecture must say whether tables are embedded or end-matter, whether figures are embedded or separate-file style, whether editable text tables are required, whether a descriptive Table 1 is mandatory, how table titles and notes are handled, and how displays are numbered and called out in prose.discussion_mode in the blueprint from the venue-specific structure. Default to a combined Discussion only when the target journal supports it; use a separate Conclusion when the journal or paper type clearly requires one.manuscript/manuscript-blueprint.json as the authoritative paper-level control artifact. It must include publication_readiness with a contribution sentence, journal-specific novelty claim, mechanism/rival matrix, evidence-to-claim map, reviewer-risk register, and ready_for_drafting: true.manuscript/manuscript-blueprint.md as a readable summary of the final paper claim, contributions, result hierarchy, venue-specific structure, display policy, and section obligations.auto-research-verify.sh 12 "$PROJ". Phase 13 may start only after the blueprint and publication-readiness gate pass.Phase 13 drafts from the active results lock and the approved manuscript blueprint using scholar-journal for journal preparation and scholar-write as the drafting engine. Read references/manuscript-drafting-contract.md before running it.
Workflow:
auto-research-verify.sh 12 "$PROJ"; do not draft if the blueprint is stale or invalid.manuscript/manuscript-blueprint.json as the single source of truth for headline claim, contribution stack, result hierarchy, section obligations, and discussion mode.scholar-journal in prepare mode for the Phase 1 target journal and paper type. Save manuscript/journal-spec.json with total word range, abstract cap, section-level word budgets, a numeric reporting policy, and the carried-forward journal_profile_resolution. If the journal gives no clear rule, default to 3 decimals for inferential statistics and 2 decimals for descriptive statistics, with p < .001 below the reporting floor.scholar-write in draft full paper mode as the prose engine. Load its writing protocol and style rules, but override any conflicting output-path or live-output behavior with this Phase 13 contract.scholar-write only the blueprint, active lock, Stage 1 verification, verified references.bib, journal spec, the Phase 4 variable dictionary, and upstream planning/review artifacts. It must not read live tables/ or figures/ except through locked paths under results-locked/<lock_id>/.manuscript/drafting-plan.json before prose. It must include section briefs, paragraph purpose map, source-use plan, results interpretation plan, and revision workflow.manuscript/manuscript-draft.md from the journal-specific structure rather than from a generic sociology shell. Use the blueprint's theory placement and methods label directly: some journals need Background, some need Theory, some embed theory in Introduction, and multidisciplinary journals may require Methods or Materials and Methods after Discussion. A separate Conclusion is allowed only if the blueprint sets discussion_mode: split. The draft must be section-rich rather than template-rich: Introduction and the methods section require at least two substantive prose paragraphs, a standalone theory/background section if present requires at least three substantive prose paragraphs with synthesis rather than citation stacking and subheadings for full quantitative articles, Results requires at least three substantive prose paragraphs in addition to displayed evidence, and Discussion requires at least two substantive prose paragraphs. Front matter must include a real title, an empirical abstract, and required keywords. Empirical abstracts must state the research purpose or theoretical importance, data, method, headline findings, and contribution/implication without Table 1 / Figure 1 callouts. The Introduction must perform the ASR/JMF-style article-opening moves: puzzle/importance, literature gap, theory/contribution, data/case preview, method preview, headline findings preview, and article roadmap. Quantitative Methods must expose Data/Sample, Variables/Measures, and Analytic Strategy structure; Variables/Measures must visibly distinguish dependent variables/outcomes, independent variables/predictors, and controls/covariates when present. Explicit H1/H2/H3 displays are allowed for ASR/JMF-style theory-and-hypotheses manuscripts, but each displayed hypothesis must be preceded by short theoretical motivation; bare proposal-style hypothesis checklists remain forbidden. The Theory/Hypotheses block must preserve the Phase 2 canonical hypotheses and remain pre-results: do not revise opening expectations, insert positive/negative estimate language, mention models/tables/figures, or let drafting-plan.json theory briefs import locked-result facts. The Discussion must adjudicate theory, hypotheses, rivals, limitations, scope, and contribution rather than restating coefficients; a separate Conclusion, when required, must synthesize the contribution and future scope without reopening table/model reporting.manuscript/draft-self-critique.json after prose and before verification. It must identify the strongest plausible rejection reason, unsupported leaps, missing rivals, claim-strength risks, workflow-language leakage, revision actions, and ready_for_verification: true.scholar-polish in full mode on manuscript/manuscript-draft.md before verification. It may remove generic AI writing patterns, hedging stacks, formulaic transitions, over-enumeration, em-dash overuse, and flat prose, but it must not alter citations, statistics, table/figure references, locked trace anchors, or argument structure.manuscript/polish-report.json with polish engine metadata, patterns checked, before/after manuscript hashes, factual-anchor preservation checks, generic marker counts, and ready_for_verification: true.Table 1 shows... and Figure 2 presents..., keep reader-facing numerics rounded to the journal policy rather than raw registry precision, use scientific notation only when numeric_reporting_policy.allow_scientific_notation is true, and honor the journal's actual table/figure rendering mode rather than flattening all venues into the same display style. For ASR/JMF-style quantitative manuscripts, Table 1 should normally be descriptive statistics for all modeled variables, with regression tables split by outcome or model family rather than collapsed into a sparse omnibus matrix.
For quantitative empirical work, the main Results table must be a canonical regression table with model columns and predictor rows. Do not present results-registry.csv, a model ladder, or a focal-coefficient extract as the original regression table.manuscript/draft-manifest.json with drafting engine metadata, blueprint metadata, drafting-plan metadata, self-critique metadata, polish report metadata, journal spec metadata, manuscript hash, source hashes, blueprint execution checks, display evidence, row-level locked result claims, citation plan, claim discipline, content alignment, and ready_for_phase_14: true.auto-research-verify.sh 13 "$PROJ". Phase 14 may start only after the journal-calibrated polished draft manifest and manuscript pass.Phase 14 uses scholar-verify as the verification engine. Read references/verification-contract.md before running it.
Workflow:
auto-research-verify.sh 13 "$PROJ"; do not verify a stale or invalid draft.scholar-verify in full mode against manuscript/manuscript-draft.md, manuscript/manuscript-blueprint.json, and the active lock from results-locked/LATEST.txt.verification_panel evidence round and run four independent reserved roles with unique evidence paths and role-specific scopes: verify-numerics, verify-figures, verify-logic, and verify-completeness. Register each successful completion; task/model identities may be opaque or structurally unavailable.verify/agents/.FAIL report with findings[], owner_phase, route_back_phase, affected artifacts, and required fixes. Stop and rerun from the earliest affected phase.verify/manuscript-verification.json and verify/manuscript-verification.md with ready_for_phase_15: true only if no critical, stale, partial, unverified, or live-read issue remains.SCHOLAR_CODEX_REVIEW=1 explicitly enables
the packaged Codex cross-model gate. Ambient PATH never changes Phase 14's
portable evidence requirement.auto-research-verify.sh 14 "$PROJ". Phase 15 may start only after the four-agent verification passes.Phase 15 uses scholar-citation as the citation and claim-support engine. Read references/citation-claim-contract.md before running it.
Workflow:
auto-research-verify.sh 14 "$PROJ"; do not audit citations on an unverified manuscript.scholar-citation in verify mode against manuscript/manuscript-draft.md, manuscript/draft-manifest.json, literature/references.bib, and verify/manuscript-verification.json.citation/references.bib, and no fabricated or unresolved reference is present. The vendored gates receive the exact canonical bibliography and manuscript/manuscript-draft.md; legacy/newer discovery under citations/ cannot override them. Rendered-reference reconciliation must be GREEN, and every cited key needs keyed coverage from CrossRef or the local library. Provider unavailability is explicit, but all-authority-unavailable or partially covered citation sets cannot pass. There is no production skip flag. Record bibliography provenance explicitly: the active source bibliography must be the project literature/references.bib, and any cross-project imports or hand-added entries must be declared and justified.citation/claim-source-map.json for cite-bearing claims. Each claim must list manuscript location, manuscript anchor, claim type, cited keys, source locator, support verdict, and contradiction status.citation/citation-audit.json, citation/claim-source-map.json, and citation/references.bib.FAIL report with findings[], owner_phase, route_back_phase, affected artifacts, and required fixes. Stop and rerun from the earliest affected phase.ready_for_phase_16: true only when all references are verified, all claims are supported, no locator is missing, no cited work is retracted, and all source hashes are current.auto-research-verify.sh 15 "$PROJ". Phase 16 may start only after citation and claim support passes.Phase 16 uses scholar-ethics and scholar-open as the ethics/open-science engines. Read references/ethics-open-science-contract.md before running it.
Workflow:
auto-research-verify.sh 15 "$PROJ"; do not write ethics or open-science declarations for an unverified manuscript or unresolved citation audit.scholar-ethics in full mode against the manuscript, safety status, data status, citation audit, and project context.scholar-open in full-package mode against the same project context.ethics/ethics-open-science.json and ethics/ethics-open-science.md.safety/safety-status.json, data/data-status.json, manuscript/manuscript-draft.md, manuscript/draft-manifest.json, and citation/citation-audit.json.FAIL report with findings[], owner_phase, route_back_phase, affected artifacts, and required fixes. Stop and rerun from the earliest affected phase.ready_for_phase_17: true only when all declarations are submission-ready, critical flags are empty, and the replication package plan is coherent with the data status.auto-research-verify.sh 16 "$PROJ". Phase 17 may start only after ethics and open science passes.Phase 17 uses scholar-replication as the package construction and validation engine. Read references/replication-contract.md before running it.
Workflow:
auto-research-verify.sh 16 "$PROJ"; do not assemble a replication package when ethics/open-science declarations are unresolved.scholar-replication in FULL mode against the active results lock, execution report, data status, and ethics/open-science report.replication-package/ with README, manifest, code/docs/data stubs as appropriate, locked outputs, test report, and paper-to-code verification report.replication_mode from Phase 16 data_availability.sharing_mode: public-data-full, restricted-data-code-only, synthetic-demo, or no-data-conceptual.public-data-full, run or record a clean-room test and compare reproduced outputs to the active results lock.replication-package/replication-report.json with package inventory, source hashes, locked artifact coverage, Phase 8 script coverage with source hashes, data handling, path safety, environment, test result, verification result, and route-back fields.FAIL report and route back to the earliest affected phase.ready_for_phase_18: true only when the package mode is coherent with Phase 16, all required package files exist, all locked artifacts are accounted for, and the test/verification status is acceptable for the declared mode.auto-research-verify.sh 17 "$PROJ". Phase 18 may start only after the replication package passes.Phase 18 uses scholar-respond in simulate mode as the journal-calibrated quality review engine. Read references/quality-gate.md before running it.
Workflow:
auto-research-verify.sh 17 "$PROJ"; do not evaluate quality until verification, citation support, ethics, and replication have all passed.scholar-respond simulate against manuscript/manuscript-draft.md, using the active results lock, Phase 14 verification, Phase 15 citation/claim map, Phase 16 ethics/open-science report, and Phase 17 replication report as locked context.idea/research-question.json.method_orientation, then begin the adversarial_panel evidence round and dispatch the reserved roles methods-evidence, theory-contribution, senior-editor, and interpretive-skeptic. Add the family-matched optional specialist role when required: computational-methods, qualitative-methods, linguistic-methods, mixed-methods, demographic-family-methods, survey-methods/quantitative-family-methods for structured secondary data, or domain-methods for other explicitly journal-specialized work. Record the same derived family in method_specialist_review.method_family. The research-question file is a required reviewed input, so later metadata cannot suppress or substitute this fifth-reviewer condition. Persist and register every reserved report/trace.contribution_locator with full verbatim visible-prose sentences, the exact manuscript section, the paragraph's one-based line_start, and clarity/specificity scores. References, comments, tables, captions, metadata, and reviewer prose cannot establish membership; Unicode/whitespace/typographic normalization is the only permitted equivalence. rival_adjudication records rivals named and adjudicated. Reviewers produce locators independently; cross-reviewer Jaccard consensus remains a secondary agreement check after exact manuscript membership.scholar-polish in scan mode as a final prose-pattern audit. Phase 18 must not rewrite the manuscript. If the scan finds unresolved high-severity AI writing patterns, route back to Phase 13 for polish/reverification.quality/manuscript-quality.json.regression_table_audit must confirm that the main empirical display is a canonical regression table, not a registry/model-ladder extract, and that reader-facing labels and design notes are present.quality/manuscript-quality.json and quality/manuscript-quality.md with source hashes, reviewer reports, polish audit, regression table audit when applicable, dimension scores, threshold policy, severity-confidence matrix, decision, findings, fix checklist, route-back fields, and ready_for_phase_19.FAIL report and route back to the earliest affected phase. Use Phase 12 for manuscript blueprint or whole-paper claim revisions, Phase 13 for manuscript prose/structure/polish revisions, Phase 14 for verification gaps, Phase 15 for citation/claim gaps, Phase 16 for ethics/open-science disclosure gaps, Phase 17 for replication/package gaps, and earlier phases only when design, data, or analysis defects are the true source.scholar-write revise, scholar-polish full, or the relevant upstream skill, then rerun downstream gates.ready_for_phase_19: true only when all dimensions meet threshold, no non-overridable blocker remains, every reviewer report is represented, any required regression table audit passes, polish audit passes, and the markdown summary matches the JSON decision.auto-research-verify.sh 18 "$PROJ". Phase 19 may start only after the quality gate passes.Phase 19 turns the verified, quality-approved manuscript into the canonical four-format final output set. Read references/final-assembly-contract.md before running it.
Workflow:
auto-research-verify.sh 18 "$PROJ"; do not assemble final outputs from an unapproved quality report.manuscript/manuscript-draft.md as the only prose source. Do not assemble from live tables, live figures, old drafts, reviewer memos, or manually edited final files.final/manuscript-final.md, adding only final front matter, references, declarations, and formatting metadata that are already supported by Phase 15-18 artifacts.
## Abstract, abstract text, Keywords: ..., then ## Introduction. Do not carry a draft prefix where Keywords: sits above ## Abstract.final/manuscript-final.docx, final/manuscript-final.tex, and final/manuscript-final.pdf from the same final/manuscript-final.md source. Prefer Pandoc for conversion. Verification independently parses DOCX OPC/body text, parses TeX while rejecting shell escape and outside-tree inputs, and runs Poppler PDF metadata/text/raster checks; each format must contain substantive sections and materially correspond bidirectionally to the immediate Markdown source. Missing tooling blocks Phase 19 rather than allowing signatures, caller-authored commands, or placeholders to pass.2026-04-30T153012Z-v001. Save immutable versioned copies under final/versions/<version_id>/ using filenames that include the version id, and write final/LATEST.txt containing exactly the active version id.final/final-manifest.json with version_id, created_at_utc, canonical paths, versioned paths, source hashes, output hashes, generation commands/status, same-source proof, section/declaration checks, citation/bibliography checks, and route-back fields.final/manuscript-final.{md,docx,tex,pdf} for Phase 20 automation. The versioned copies are for audit/history and must have byte-identical hashes to the canonical files.final/manuscript-final.{md,docx,tex,pdf}. Missing formats, missing versioned copies, separate stems, dummy binaries, placeholder text, stale hashes, or failed conversion logs are blockers.ready_for_phase_20: true only after all four same-source canonical formats exist, all versioned copies exist, hashes match, manifest checks pass, and no assembly finding remains open.auto-research-verify.sh 19 "$PROJ". Phase 20 may start only after final assembly passes.Phase 20 creates the reviewer-facing submission manuscript and final package manifest. Read references/submission-hygiene-contract.md before running it.
Phase 20 is a two-stage hygiene gate. Stage A is deterministic and catches known machinery-prose leaks. Stage B is a mandatory semantic body-prose read by an independent subagent after Stage A is clean. Both stages must pass before the default route is complete.
Workflow:
auto-research-verify.sh 19 "$PROJ"; do not build submission files from an invalid final assembly.final/manuscript-final.md as the only source of substantive content, but do not treat submission assembly as a scrub-only pass. Assemble submission/manuscript-submission.md as a reviewer-facing product with an explicit section allowlist and product policy: preserve title, abstract, keywords, introduction, theory, methods, results, discussion, and references; exclude internal workflow appendices, trace anchors, lock metadata, and pipeline scaffolding by construction.
## Abstract, abstract text, Keywords: ..., then ## Introduction.submission/manuscript-submission.docx, submission/manuscript-submission.tex, and submission/manuscript-submission.pdf from submission/manuscript-submission.md. The submission package must therefore include all four reviewer-facing formats: md, docx, tex, and pdf.[VERIFIED-*] citation markers, pipeline-jargon headers such as Robustness Ladder or BH Correction Summary, "we carry N accepted limitations" / "pre-registered families" enumeration prose, 3+ consecutive bulleted spec-ID lines, and proposal-style hypothesis bullet/list blocks.semantic_body_reader evidence round and dispatch its reserved semantic_body_prose_reader role. It must read submission/manuscript-submission.md top-to-bottom for novel structural prose that reads as pipeline output rather than social-science article prose, including leftover H1/H2 hypothesis lists that read like a proposal or PAP rather than a journal article. Persist/register the reserved report and bind semantic_body_prose_read to its evidence path and dispatch identity. Its substantive report remains submission/semantic-body-prose-read.md-compatible in content: STATUS: GREEN, current manuscript hash, zero blocking issues, and zero structural patterns. The verifier reads the evidence-bound report itself and requires those decision-bearing fields to match the stable package report; a locally authored stable GREEN file cannot override registered YELLOW/RED reviewer evidence. Missing, stale, YELLOW, or RED evidence blocks Phase 20.SOURCE NEEDED, or UNVERIFIED text remains.submission/submission-hygiene.json with final-version binding, source hashes, Stage A checks, Stage B semantic-body-prose metadata, citation rendering checks, placeholder scan, internal metadata scan, format-generation checks, findings, route-back fields, and pipeline_complete.submission/submission-package-manifest.json with canonical submission outputs in all four formats, the semantic body-prose report, timestamped versioned copies, hashes, final version id, package inventory, and completion status.submission/LATEST.txt and immutable copies under submission/versions/<submission_version_id>/, including the semantic body-prose report.FAIL report and route back to the earliest affected phase: Phase 13 for body-prose machinery introduced during drafting, Phase 19 for final assembly/source defects, Phase 15 for citation/reference defects, Phase 16 for declaration defects, Phase 17 for replication disclosure contradictions, and Phase 20 for scrub/manifest/versioning/format-generation defects.pipeline_complete: true only when the reviewer-facing manuscript is clean, Stage A is GREEN, Stage B is GREEN and current-hash-bound, all four submission formats exist, manifests are complete, canonical and versioned hashes match, and no open finding remains.auto-research-verify.sh 20 "$PROJ". The auto-research default route is complete only after this gate passes.results-registry.csv, a model ladder, or a focal-coefficient extract as the main empirical table. Quantitative empirical papers need a canonical regression table with model columns and predictor rows.scholar-write with a local template assembler or builder that authors the substantive manuscript by itself. Helper code may package governed inputs or outputs, but publishable prose quality remains the binding requirement.scholar-citation with a local key scanner or manifest writer that skips real source verification, claim support checks, or bibliography judgment.public-data-full, restricted-data-code-only, synthetic-demo, or no-data-conceptual.md, docx, tex, and pdf, unless the user explicitly requests a narrower package.Before using or modifying this skill, run:
bash "${_AR_SKILL}/scripts/auto-research-contract-lint.sh"
bash "${_AR_SKILL}/scripts/auto-research-system-gate-smoke.sh"
bash "${_AR_SKILL}/scripts/auto-research-fixture-test.sh"
These tests validate the contract shape, default route, state behavior, positive fixture, and selected negative fixtures. The repo-level tests/smoke/run-all.sh sweep also exercises the skill's own checks through the tests/smoke/test-auto-research-suite.sh forwarder, including the portable review-evidence, migration, and isolated-runtime suites; the full 21-phase (0–20) auto-research-fixture-test.sh runs behind SCHOLAR_SMOKE_HEAVY=1.
This skill is self-contained — every helper it invokes is vendored under scripts/, so it never reaches into the parent plugin at runtime. Top-level helpers:
auto-research-state.sh — project state machine (init / import-init / set-mode / decision / next / complete / route-back / hash-check / status); enforces run-mode, contract drift, safety inventory freshness, transactional verification/completion, and cap-3 route-back escalation.review_evidence.py — packaged host-neutral reservation/completion ledger,
exact input/report/trace binding, assurance evaluation, and replay defense.runtime-preflight.py — validates the declared commands and packaged runtime
closure for every host before optional host-specific setup.auto-research-verify.sh — per-phase exit gate; runs each phase's structural checks plus the bundled scripts/gates/ panel. Its disk receipt is audit-only; complete obtains authority from an internal verifier process while holding the project lock.safety_inventory.py — approved local helper that normalizes copy-mode identities and emits only inventory/content digests, never research-data contents.auto-research-contract-lint.sh / auto-research-system-gate-smoke.sh — contract-shape lint and the packaging/gate-coverage smoke (asserts every bundled external gate the verifier names exists, is executable, and is git-tracked).auto-research-fixture-test.sh / auto-research-publication-quality-fixture-test.sh — end-to-end and publication-quality fixtures.setup-project-claudemd.sh — writes the host-aware workflow-contract memory block (CLAUDE.md / AGENTS.md).setup-codex-hooks.sh — installs the vendored Codex data-safety hook without a parent bootstrap.detect-host-agent.sh — host detection (Claude Code / Codex / unknown) for the memory-file and Codex-hook decisions.emit-journal-profile-resolution.py — journal-profile resolution templater.references/runtime-dependencies.json — versioned boundary manifest for required packaged safety files, optional packaged run-view files, commands, and explicit external providers.references/review-evidence-contract.md — purpose, authority boundary,
lifecycle, assurance levels, host mappings, locking, and migration.The scripts/gates/ directory bundles the phase-specific quality gates the verifier's external-gate panels call — including the Phase 15 citation-verification trio: verify-citation-metadata.sh (bib ↔ CrossRef), verify-citation-local-library.sh (bib ↔ local Zotero), and verify-rendered-references-against-bib.sh (manuscript ↔ bib) — plus the phase-aware effect-size-narrative-check.sh and the _phase5-skill-resolver.sh / _section-role-helper.py helpers. It also contains the complete safety-hook chain, RAO trace helpers, and run-view renderer used by this skill. Their protocols live locally at references/process-logger.md and references/agent-trace-contract.md. auto-research-system-gate-smoke.sh asserts the panel-named gates and helpers are all present, executable, and tracked; tests/smoke/test-self-contained-runtime.sh exercises the recursive helper boundary in an isolated copy.
Process Logging (REQUIRED) — Reasoning · Action · Observation trace:
This skill emits an append-only RAO trace at ${OUTPUT_ROOT}/logs/trace-scholar-auto-research-<date>.ndjson — the source of truth. The human-readable process-log-scholar-auto-research-<date>.md is rendered from it. Full protocol + privacy rule: references/process-logger.md; dispatched-agent sidecar requirements: references/agent-trace-contract.md.
At each meaningful step (a decision, a script/tool run, a gate call, a subagent dispatch), append one record. emit-trace.sh derives seq from the file, so no state is tracked across the stateless Bash blocks:
_AR_GATES="${_AR_SKILL}/scripts/gates"
bash "${_AR_GATES}/emit-trace.sh" --skill scholar-auto-research --step "<label>" \
--reasoning "<the WHY — stated rationale, 1–2 lines>" \
--action "<the WHAT — tool/script/gate call + key args>" \
--observation "<the RESULT — verdict/metric/count/error/file ref>" --status ok # ok|fail|skipped
unset _AR_GATES
At the end (Save Output), render the human-readable log and self-check:
_AR_GATES="${_AR_SKILL}/scripts/gates"
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
bash "${_AR_GATES}/render-trace.sh" "${OUTPUT_ROOT}/logs/trace-scholar-auto-research-$(date +%Y-%m-%d).ndjson"
bash "${_AR_GATES}/trace-coverage-check.sh" "${OUTPUT_ROOT}" --skill scholar-auto-research
unset _AR_GATES
Privacy (C-01 / LOCAL_MODE): the trace carries aggregate metrics, verdicts, counts, and file refs ONLY — never raw data rows, verbatim quotes, or PII.
This skill is an autonomous orchestrator: it does not write output files directly — every
phase persists through its vendored state machine (auto-research-state.sh) and per-phase
verifier (auto-research-verify.sh), with transactional completion records and audit-only receipts. The project lives at
$PROJ (== output/[slug]/):
| Artifact | Path |
|---|---|
| Run state machine (phase pointer, mode, decisions, transactional output/input hashes) | $PROJ/.auto-research/state.json |
| Safety provenance | $PROJ/safety/safety-status.json |
| Review artifacts (Phases 6, 7, and 9) | $PROJ/review/ |
| Manuscript verification artifacts (Phase 14) | $PROJ/verify/ |
| Manuscript quality-review artifacts (Phase 18) | $PROJ/quality/ |
| Other per-phase artifacts (design, analysis, locks, manifests, registries) | $PROJ/{design,analysis,logs,verify,...}/ |
| Results lock (Phase 11) | $PROJ/results-locked/ + lock manifest |
| Canonical final manuscript, all four formats (Phase 19) | $PROJ/final/manuscript-final.{md,docx,tex,pdf} |
| Canonical submission manuscript, all four formats (Phase 20) | $PROJ/submission/manuscript-submission.{md,docx,tex,pdf} |
| Replication package (Phase 17) | $PROJ/replication-package/ |
| Process logs | $PROJ/logs/ |
Required artifact paths are derived from phase-contract.json, verified internally, and recorded in state.json with nonempty digests. Any paths supplied to complete are exact-set assertions only.
The default route is complete only when auto-research-verify.sh 20 "$PROJ" passes. Before
declaring pipeline_complete: true, confirm:
auto-research-verify.sh <phase> gate — no file-exists-only passes for phases 11–20.md, docx, tex, pdf) exist from the same source, and canonical vs. versioned hashes match./scholar-citation) — no fabricated, unverified, or unsupported references overridden.public-data-full / restricted-data-code-only / synthetic-demo / no-data-conceptual) with clean-room reproduction (or an explicit justification when full reproduction is impossible).references/agent-trace-contract.md (opens in a new tab)references/analysis-plan-contract.md (opens in a new tab)references/analysis-premortem-contract.md (opens in a new tab)references/artifact-contract.md (opens in a new tab)references/citation-claim-contract.md (opens in a new tab)references/contract-migrations.json (opens in a new tab)references/data-measurement-contract.md (opens in a new tab)references/data-safety-runtime.md (opens in a new tab)references/design-contract.md (opens in a new tab)references/documentation-registry.json (opens in a new tab)references/ethics-open-science-contract.md (opens in a new tab)references/execution-contract.md (opens in a new tab)references/final-assembly-contract.md (opens in a new tab)references/journal-profile-resolution-templates.json (opens in a new tab)references/literature-theory-contract.md (opens in a new tab)references/manuscript-blueprint-contract.md (opens in a new tab)references/manuscript-drafting-contract.md (opens in a new tab)references/phase-contract.json (opens in a new tab)references/phase-contract.md (opens in a new tab)references/post-execution-review-contract.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub joshzyj/open-scholar-skill --plugin open-scholar-skill36 skills in this plugin
/scholar-analyzeRun data analytics and produce publication-quality tables and visualizations for social science research. Saves regression tables (HTML/TeX/docx), figures (PDF/PNG), an internal analysis log, and a publication-ready Results document (prose + table notes + figure captions). Accepts file paths, inline/pasted data, or fetches from online sources (NHANES, IPUMS, GSS, World Bank, etc.). Runs A9/B9 verification subagents to check analytic and visualization correctness. For causal designs, invokes /scholar-causal first. Use after /scholar-design./scholar-annotateTurn unstructured text into validated, structured variables at corpus scale with LLMs: codebook design, dev/gold-set construction, DSPy prompt optimization, a hard reliability gate (Cohen κ ≥ 0.70), scale-out via managed Batch APIs or a local/HPC server, and distillation to a cheap classifier for very large corpora. Use for LLM annotation, classification, framing/stance coding, relevance filtering, structured extraction, and any LLM-as-measurement task over a text corpus. Ships a real execution engine (assets/) — not in-context snippets./scholar-auto-improveAutomatic quality auditor and continuous improvement engine for the scholar-skill suite. Four modes: (1) OBSERVE — post-skill output audit (run after any skill); (2) AUDIT — skill-suite structural health check; (3) IMPROVE — propose and apply fixes to skill definitions; (4) EVOLVE — cross-session pattern analysis and systemic improvements. Designed to run automatically at the end of any scholar-skill invocation.
/scholar-brainstormGenerate research questions from existing materials — codebooks, survey questionnaires, datasets, or published papers/abstracts. Three modes: DATA (data files with safety scan + empirical signal tests), MATERIALS (codebook/questionnaire only with theory-driven ranking), PAPER (published paper/abstract → follow-up research ideas via SciThinker-30B + multi-agent evaluation). Auto-detects mode from file extensions. Explores the data landscape and proposes a ranked Top 10 list of publishable research questions using multi-agent evaluation. PAPER mode optionally uses SciThinker-30B (OpenMOSS-Team/SciThinker-30B on HuggingFace) for scientific ideation generation./scholar-causalComprehensive causal inference toolkit for social science research. Covers DAG construction, method selection, and thirteen identification strategies (OLS, DiD, RD, IV, FE, matching/reweighting, synthetic control, causal mediation, staggered DiD, DML/causal forests, bunching estimation, shift-share/Bartik instruments, distributional/quantile methods) — each with assumptions, diagnostics, R code, Stata code, and a write-up template. Use when the user needs to select and justify a causal identification strategy, build a causal DAG, or write the identification argument in their Methods section. Works between /scholar-hypothesis and /scholar-design./scholar-citationFull citation management for social science manuscripts. Eight modes: (1) INSERT — add in-text citations to uncited claims; (2) AUDIT — find orphans, missing refs, year/author mismatches, duplicates; (3) CONVERT-STYLE — convert between styles (ASA, APA, numbered, author-date); (4) FULL-REBUILD — inventory claims → search Zotero + CrossRef → insert → assemble → audit; (5) VERIFY — verify each ref against local library (Zotero/Mendeley/BibTeX/EndNote), CrossRef, WebSearch; VERIFIED/UNVERIFIED/CORRECTED; (6) EXPORT — generate BibTeX .bib for LaTeX with cite keys, DOIs, enriched metadata; (7) RETRACTION-CHECK — cross-reference Retraction Watch; flag and suggest replacements; (8) REPORTING-SUMMARY — pre-filled NHB/NCS Reporting Summary (design, statistics, data availability) for Nature Human Behaviour and NCS. ABSOLUTE RULE: never fabricate — every reference verified against ≥1 authoritative database; local library searched first. Flags unsupported claims SOURCE NEEDED. Saves complete draft + audit log.
Other plugins' skills for the same job