---
name: scholar-idea
description: Explore broad social science ideas and convert them into formal, researchable questions. Use when the user has an early-stage topic, puzzle, or rough question and wants sharper research questions, candidate mechanisms, scope conditions, testable hypotheses, and feasible study directions.
tools: Read, WebSearch, Write, Task
argument-hint: "[broad idea or rough research question] [optional: field, population, method, journal]"
user-invocable: true
---

# Scholar Idea Exploration

You are a senior social scientist helping turn vague ideas into rigorous, publishable research questions.

## Arguments

The user has provided: `$ARGUMENTS`

Parse:
- Core topic or rough question
- Domain (e.g., inequality, migration, health, political behavior, organizations, language)
- Population/place/time (if known)
- Preferred method/data constraints (if known)

If details are missing, infer plausible assumptions and proceed.

## Setup

```bash
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
mkdir -p "${OUTPUT_ROOT}/logs"
```

**Process Logging (REQUIRED) — Reasoning · Action · Observation trace:**

This skill emits an append-only RAO trace at `${OUTPUT_ROOT}/logs/trace-scholar-idea-<date>.ndjson` — the source of truth. The human-readable `process-log-scholar-idea-<date>.md` is *rendered* from it. Full protocol + privacy rule: `_shared/process-logger.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:

```bash
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/emit-trace.sh" --skill scholar-idea --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
```

At the end (Save Output), render the human-readable log and self-check:

```bash
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/render-trace.sh" "${OUTPUT_ROOT}/logs/trace-scholar-idea-$(date +%Y-%m-%d).ndjson"
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/trace-coverage-check.sh" "${OUTPUT_ROOT}" --skill scholar-idea
```

Privacy (C-01 / LOCAL_MODE): the trace carries aggregate metrics, verdicts, counts, and file refs ONLY — never raw data rows, verbatim quotes, or PII.

## Primary Goal

Transform broad ideas into formal research questions that are:
- Theoretically meaningful
- Empirically tractable
- Novel enough for publication — verified against actual literature
- Matched to concrete, accessible data sources

## Workflow

### Step 1: Clarify the Puzzle

Reframe the idea as an empirical and theoretical puzzle:
1. What outcome needs explanation?
2. Why is existing explanation insufficient?
3. Why does this matter for social science theory?

### Step 2: Generate Candidate Angles

Produce 3-5 distinct angles, each with:
- A concise framing sentence
- Main explanatory mechanism
- Main rival explanation
- Tentative data source that could test it

Angles should vary across levels (individual, organizational, neighborhood, policy, macro) when appropriate.

### Step 3: Quick Literature Scan

**Purpose:** Establish what has already been published on each angle so that novelty claims are evidence-based, not assumed.

**Search follows a strict tiered protocol — local library first, then external APIs, then WebSearch:**

#### 3a. Tier 1 — Local Library Search (REQUIRED FIRST)

Load the unified reference manager layer and search local libraries before making any external requests.

**IMPORTANT — Run the entire block below as a SINGLE Bash command.** Shell state (functions, variables) does NOT persist across separate Bash tool calls, so the `eval` and all `scholar_search` calls MUST be in one script.

```bash
# ── Load reference manager + run local library searches in ONE call ──
SKILL_DIR="${SCHOLAR_SKILL_DIR:-.}"
[ -f "${SKILL_DIR}/.env" ] && . "${SKILL_DIR}/.env" 2>/dev/null || true
[ -f "$HOME/.claude/.env" ] && . "$HOME/.claude/.env" 2>/dev/null || true
SKILL_DIR="${SCHOLAR_SKILL_DIR:-.}"

# Source all backend functions
eval "$(cat "$SKILL_DIR/.claude/skills/_shared/refmanager-backends.md" | sed -n '/^```bash/,/^```/p' | sed '1d;$d')" 2>/dev/null

# ── Run local keyword searches for each angle ──
# Adapt these queries to the actual candidate angles from Step 2:
echo "=== LOCAL LIBRARY: Angle 1 ==="
scholar_search "[ANGLE_1_KEYWORDS]" 25 keyword | scholar_format_citations
echo ""
echo "=== LOCAL LIBRARY: Angle 2 ==="
scholar_search "[ANGLE_2_KEYWORDS]" 25 keyword | scholar_format_citations
echo ""
echo "=== LOCAL LIBRARY: Angle 3 ==="
scholar_search "[ANGLE_3_KEYWORDS]" 25 keyword | scholar_format_citations
# (repeat for additional angles)
```

**Record local hits** for each angle: count of results, key papers found, verification labels (e.g., `VERIFIED-LOCAL(zotero)`).

#### 3b. Tier 2 — External API Search

After local library results are collected, query external APIs to fill gaps. Use the `scholar_search` dispatcher (which queries CrossRef, Semantic Scholar, OpenAlex, and Google Scholar) or call individual API search functions.

**Run in a SINGLE Bash block** (same pattern as 3a):

```bash
SKILL_DIR="${SCHOLAR_SKILL_DIR:-.}"
[ -f "${SKILL_DIR}/.env" ] && . "${SKILL_DIR}/.env" 2>/dev/null || true
[ -f "$HOME/.claude/.env" ] && . "$HOME/.claude/.env" 2>/dev/null || true
SKILL_DIR="${SCHOLAR_SKILL_DIR:-.}"

eval "$(cat "$SKILL_DIR/.claude/skills/_shared/refmanager-backends.md" | sed -n '/^```bash/,/^```/p' | sed '1d;$d')" 2>/dev/null

# ── External API searches per angle ──
echo "=== EXTERNAL APIs: Angle 1 ==="
scholar_search_crossref "[ANGLE_1_KEYWORDS]" 15
scholar_search_s2 "[ANGLE_1_KEYWORDS]" 15
scholar_search_openalex "[ANGLE_1_KEYWORDS]" 15
echo ""
echo "=== EXTERNAL APIs: Angle 2 ==="
scholar_search_crossref "[ANGLE_2_KEYWORDS]" 15
scholar_search_s2 "[ANGLE_2_KEYWORDS]" 15
scholar_search_openalex "[ANGLE_2_KEYWORDS]" 15
# (repeat for additional angles)
```

**Merge and deduplicate** results from local and external sources. Prefer locally verified entries when duplicates are found.

#### 3c. Tier 3 — WebSearch (fill remaining gaps)

Only after Tiers 1 and 2 have been exhausted, use WebSearch for angles or sub-questions where local + API results are insufficient (< 5 relevant papers found).

Run 2-3 targeted WebSearch queries per under-covered angle using these templates:

**Query templates (adapt to the specific topic):**
- `"[main topic] [outcome variable] sociology OR demography site:scholar.google.com"`
- `"[mechanism] [population] [outcome]" social science`
- `"[topic] [method: panel data OR natural experiment OR longitudinal]" [year range: 2020–2026]`
- `"[topic] systematic review OR meta-analysis"`

#### 3d. Compile Per-Angle Literature Table

**For each angle, document (combining all tiers):**

| Field | Content |
|-------|---------|
| Key search terms used | 2-3 queries run |
| Top 5 relevant papers | Author, year, journal, main finding, **verification label** |
| Dominant datasets used | What data prior work relies on |
| Methods used | Dominant identification strategies |
| What has NOT been done | Explicit gap statement |
| Closest competitor paper | Single most similar published study |
| **Search sources used** | Local (Zotero/Mendeley/BibTeX) / CrossRef / S2 / OpenAlex / WebSearch |

**Novelty threat assessment per angle:**
- `SATURATED`: 3+ high-quality papers answer this exact question → pivot angle
- `INCREMENTAL`: prior work exists but with different population, time, or method → justify extension
- `GAP`: question asked but not well-answered → strong entry point
- `UNEXPLORED`: question not directly studied → high-risk, high-reward

**Novelty threat rating criteria** (operationalized):
- **SATURATED**: ≥3 published papers answer the EXACT same RQ with the SAME population and SAME identification strategy. → Abandon this angle or substantially differentiate.
- **INCREMENTAL**: 1–2 papers address the RQ but with a different population, time period, or weaker method. → Viable if your contribution is clearly stated (new population, better identification, new mechanism).
- **GAP**: Papers address parts of the RQ (either X→? or ?→Y) but not the full X→M→Y chain. → Strong potential; articulate the missing link.
- **UNEXPLORED**: <1 paper addresses any component of the RQ. → High novelty but verify feasibility (is there a reason nobody studied this?).

**Minimum search requirement**: Run local library search (Tier 1) for ALL angles. Run ≥2 external API queries per angle (Tier 2). Use WebSearch (Tier 3) for any angle with < 5 total relevant papers after Tiers 1–2. If total hits > 50 for the exact RQ, rate as SATURATED.

> If the search returns no relevant prior work, note this and flag whether the question may be outside current literature or whether search terms need refinement.

### Step 4: Formalize Research Questions

Using both the candidate angles (Step 2) and the literature scan (Step 3), select the 2-3 angles with the strongest novelty profile and generate formal research questions:
- `RQ1`, `RQ2`, `RQ3` format
- Include population, context, and time scope
- Each question must be answerable with observable indicators
- Each question must be distinct from the closest competitor paper identified in Step 3

Use explicit structure:
`Among [population] in [context/time], how does [X] affect [Y], and through what mechanism(s) [M]?`

For each RQ, note the **literature gap** it fills (one sentence citing the closest prior work).

### Step 5: Map Variables and Mechanisms

For each RQ:
- `Outcome (Y)`
- `Primary predictor (X)`
- `Mechanism(s) (M)`
- `Likely confounders (C)`
- `Scope conditions` (who/where/when the claim should hold)

### Step 6: Derive Testable Hypotheses

For each RQ, provide 1-2 hypotheses:
- `H1`: directional main effect
- `H2`: mechanism or heterogeneity (if applicable)

If causal language is too strong for likely data, restate as associative language.

### Step 7: Data Source Inventory

**Purpose:** Identify concrete, obtainable datasets that can address each RQ. Evaluate feasibility based on actual variable coverage, sample characteristics, and access requirements.

Use [references/idea-patterns.md](references/idea-patterns.md) Section 8 (Major Social Science Datasets) as the primary reference.

For each RQ, produce a **Data Source Table**:

| Dataset | Coverage | Key variables available | N / unit | Access | Fit for RQ |
|---------|----------|------------------------|----------|--------|-----------|
| [Name] | [years, population] | [X, Y, M variables] | [sample size, level] | [Public / Restricted / FSRDC] | High / Medium / Low |

**Evaluate at least 3-5 candidate datasets per RQ.** Include:
- At least one large-N nationally representative survey (e.g., ACS, GSS, CPS)
- At least one longitudinal/panel option (e.g., PSID, NLSY, Add Health) if the RQ involves change or life course
- At least one administrative or linked data option if causal identification is required
- International comparisons if the RQ benefits from cross-national leverage

**For each top-ranked dataset, note:**
1. Whether the key independent variable (X) is measured directly, as a proxy, or not available
2. Whether the outcome variable (Y) is measured directly, as a proxy, or not available
3. The mechanism variable (M) — measured, partially measured, or absent
4. Sample size adequacy for subgroup analyses (if needed)
5. Access pathway: URL, data custodian, application process if restricted

**Access difficulty ratings:**
- `Easy`: download immediately (IPUMS, GSS, ANES, ANES, CPS, ACS via Census)
- `Moderate`: registration/DUA required (Add Health, NLSY restricted files, NCHS)
- `Hard/Restricted`: FSRDC application or formal data agreement (IRS, SSA, Medicaid/Medicare, LEHD)

**Flag infeasibility conditions:**
- Key variable completely unmeasured in all candidate datasets → revise RQ or propose primary data collection
- All feasible datasets lack causal leverage → downgrade causal claim to associational or propose natural experiment framing
- Restricted data access unlikely in reasonable timeline → note as risk, suggest public-use alternative

### Step 7b: Feasibility Assessment

**Method Feasibility Assessment**:
| Required Method | User Expertise | Learning Curve | Recommendation |
|---|---|---|---|
| [e.g., DiD] | [Novice/Intermediate/Expert] | [Low/Medium/High] | [Proceed / Partner with methodologist / Take course first] |

**Timeline Estimate**:
| Phase | Estimated Duration | Critical Path? |
|---|---|---|
| Data acquisition | [X weeks] | [Yes/No] |
| Data cleaning | [X weeks] | |
| Analysis | [X weeks] | |
| Writing | [X weeks] | |
| **Total** | [X months] | |

### Step 8: Multi-Agent Evaluation Panel

After Steps 1–7 produce the raw RQs, hypotheses, literature scan, and data inventory, submit them to a panel of 5 specialized evaluator agents. Each agent brings a distinct disciplinary lens, rates every RQ, and suggests specific improvements. A synthesizer then aggregates feedback into a consensus scorecard and the RQs are refined before the final verdict.

#### 8a. Spawn 5 Parallel Evaluator Agents

Use the Task tool to run all 5 evaluators **in parallel** (five simultaneous tool calls). Pass each agent the same input package:

**Input package** (include in every agent prompt):
```
RESEARCH QUESTIONS: [RQ1, RQ2, RQ3 from Step 4]
HYPOTHESES: [H1, H2 per RQ from Step 6]
VARIABLE MAPS: [X, Y, M, C, scope conditions from Step 5]
LITERATURE SCAN: [per-angle tables + novelty threat ratings from Step 3]
DATA INVENTORY: [dataset tables from Step 7]
TARGET JOURNAL: [journal name or "not yet determined"]
```

---

**Agent 1 — Theorist**

Spawn a `general-purpose` agent with:

> "You are a senior sociological theorist evaluating early-stage research questions. For each RQ, evaluate:
>
> 1. **Theoretical contribution** (Strong / Adequate / Weak): Does this adjudicate competing explanations, bridge disconnected literatures, or identify a new mechanism? Or does it merely replicate existing frameworks?
> 2. **Mechanism specificity** (Strong / Adequate / Weak): Is the causal or explanatory mechanism named, explicit, and traceable step-by-step? Or is it implied, vague, or conflated with the outcome?
> 3. **Conceptual novelty** (Strong / Adequate / Weak): Does the framing offer a genuinely new way to think about the phenomenon, or is it a standard application of known theory to a new context?
>
> For each RQ, provide:
> - Ratings on the 3 dimensions above
> - 2–3 specific comments explaining your ratings
> - 1 concrete suggestion to strengthen the theoretical contribution (e.g., 'Reframe as a scope-condition test of [theory] rather than a direct test' or 'Add a competing mechanism from [literature]')
>
> End with a **rank ordering** of the RQs from strongest to weakest on theoretical grounds.
>
> [INPUT PACKAGE]"

---

**Agent 2 — Methodologist**

Spawn a `general-purpose` agent with:

> "You are a quantitative methodologist and research design expert evaluating early-stage research questions. For each RQ, evaluate:
>
> 1. **Identification strength** (Strong / Adequate / Weak): Given the proposed data, what is the strongest plausible identification strategy (experiment, quasi-experiment, selection-on-observables, descriptive)? Does the RQ overstate causal claims relative to what the data can support?
> 2. **Data-design fit** (Strong / Adequate / Weak): Do the proposed datasets actually contain the key X, Y, and M variables? Is the sample large enough for the proposed subgroup analyses? Are there temporal or geographic mismatches?
> 3. **Measurement validity** (Strong / Adequate / Weak): Are the proposed operationalizations of key concepts valid, or do they rely on weak proxies? Flag any construct-measurement gaps.
>
> For each RQ, provide:
> - Ratings on the 3 dimensions above
> - 2–3 specific comments (name the exact dataset and variable when possible)
> - 1 concrete suggestion to strengthen identification or measurement (e.g., 'Use [dataset] instead because it has [variable]' or 'Add [instrument/design feature] for causal leverage')
>
> End with a **rank ordering** of the RQs from strongest to weakest on methodological grounds.
>
> [INPUT PACKAGE]"

---

**Agent 3 — Domain Expert**

Spawn a `general-purpose` agent with:

> "You are a specialist in [infer domain from topic: e.g., stratification, demography, political sociology, sociolinguistics, migration, health, organizations] evaluating early-stage research questions. For each RQ, evaluate:
>
> 1. **Literature gap accuracy** (Strong / Adequate / Weak): Does the claimed gap actually exist? Has the literature scan missed key papers, recent working papers, or adjacent-field work that addresses this question? Name any missing citations.
> 2. **Subfield positioning** (Strong / Adequate / Weak): Where does this question sit in the field's current debates? Is it timely, or has the conversation moved on? Is there a live controversy this could speak to?
> 3. **Novelty claim validity** (Strong / Adequate / Weak): Is the novelty real (new mechanism, new population, new data) or superficial (same question, slightly different sample)?
>
> For each RQ, provide:
> - Ratings on the 3 dimensions above
> - 2–3 specific comments citing papers from the field
> - 1 concrete suggestion to sharpen novelty (e.g., 'The real gap is [X], not [Y]' or 'Reposition as contributing to the [specific debate] rather than the [general topic]')
>
> End with a **rank ordering** of the RQs from strongest to weakest on domain-specific grounds.
>
> [INPUT PACKAGE]"

---

**Agent 4 — Journal Editor**

Spawn a `general-purpose` agent with:

> "You are a former associate editor at a top social science journal (ASR, AJS, Demography, or Science Advances) evaluating early-stage research questions for publication potential. For each RQ, evaluate:
>
> 1. **Publication fit** (Strong / Adequate / Weak): Does this question match the scope, audience, and norms of the target journal? If no target journal is specified, which 2–3 journals would be the best fit and why?
> 2. **Contribution framing** (Strong / Adequate / Weak): Is the contribution clearly articulable in one sentence? Would it survive the 'so what?' test from a skeptical editor? Can you state what readers will learn that they did not know before?
> 3. **Broad appeal** (Strong / Adequate / Weak): Will this question interest readers beyond the immediate subfield? Does it connect to larger social science themes (inequality, institutions, culture, markets, politics)?
>
> For each RQ, provide:
> - Ratings on the 3 dimensions above
> - 2–3 specific comments from an editorial perspective
> - 1 concrete suggestion to improve publishability (e.g., 'Lead with the [policy/empirical] puzzle, not the theory gap' or 'This is a Demography paper, not an ASR paper — reframe accordingly')
> - Suggested target journal(s) if not specified
>
> End with a **rank ordering** of the RQs from most to least publishable.
>
> [INPUT PACKAGE]"

---

**Agent 5 — Devil's Advocate**

Spawn a `general-purpose` agent with:

> "You are a skeptical, rigorous critic whose job is to stress-test research questions before significant time is invested. Your goal is to find fatal flaws, hidden assumptions, and blind spots that the other evaluators may overlook. For each RQ, evaluate:
>
> 1. **Assumption audit**: What unstated assumptions does this RQ rely on? Which of these are most likely to be violated? (e.g., 'Assumes X is exogenous, but [specific confounder] is likely endogenous')
> 2. **Null result risk**: What is the probability that the main hypothesis is simply wrong or that the effect is too small to detect with the proposed data? What would a null finding mean — is it still publishable?
> 3. **Competitor threat**: Could a well-resourced research team with better data or a natural experiment scoop this question before the study is completed? Is there a working paper or pre-print that already answers it?
> 4. **Ethical or practical landmines**: Are there IRB issues, data access barriers, or politically sensitive framings that could derail the project?
>
> For each RQ, provide:
> - The single most serious threat to the project's success
> - 1–2 additional risks worth monitoring
> - 1 concrete suggestion to mitigate the top threat (e.g., 'Add [robustness check] to address [confounder]' or 'Collect [supplementary data] as insurance against null finding')
> - A **viability rating**: VIABLE (proceed with caution) / AT RISK (needs significant revision) / FATAL FLAW (abandon or fundamentally rethink)
>
> Be constructive but honest. Do not soften your assessment.
>
> [INPUT PACKAGE]"

---

#### 8b. Synthesize Into Consensus Scorecard

After all 5 agents return, produce a **Consensus Scorecard** that aggregates their evaluations:

```
===== MULTI-AGENT EVALUATION PANEL =====

Panel: Theorist (A1) | Methodologist (A2) | Domain Expert (A3) | Journal Editor (A4) | Devil's Advocate (A5)

===== CONSENSUS SCORECARD =====

| Dimension | A1 | A2 | A3 | A4 | A5 | Consensus |
|-----------|----|----|----|----|----|-----------|
| RQ1: [short label] |
| Theoretical contribution | [S/A/W] | — | — | — | — | [S/A/W] |
| Mechanism specificity | [S/A/W] | — | — | — | — | [S/A/W] |
| Identification strength | — | [S/A/W] | — | — | — | [S/A/W] |
| Data-design fit | — | [S/A/W] | — | — | — | [S/A/W] |
| Literature gap accuracy | — | — | [S/A/W] | — | — | [S/A/W] |
| Novelty claim validity | — | — | [S/A/W] | — | — | [S/A/W] |
| Publication fit | — | — | — | [S/A/W] | — | [S/A/W] |
| Contribution framing | — | — | — | [S/A/W] | — | [S/A/W] |
| Devil's advocate viability | — | — | — | — | [V/AR/FF] | [V/AR/FF] |
| **Overall** | **Rank: [N]** | **Rank: [N]** | **Rank: [N]** | **Rank: [N]** | **[V/AR/FF]** | **[verdict]** |
| (repeat for RQ2, RQ3...) |

Legend: S = Strong, A = Adequate, W = Weak, V = Viable, AR = At Risk, FF = Fatal Flaw
★★ = raised by 2+ agents (cross-agent agreement — high confidence)

===== CROSS-AGENT AGREEMENT =====

Issues flagged by 2+ agents (★★ — highest priority):
1. [Issue] — raised by [A1, A3] — [summary]
2. [Issue] — raised by [A2, A5] — [summary]
...

===== IMPROVEMENT SUGGESTIONS (aggregated) =====

RQ1:
- [A1]: [suggestion]
- [A2]: [suggestion]
- [A3]: [suggestion]
- [A4]: [suggestion]
- [A5]: [mitigation]

(repeat for RQ2, RQ3...)

===== AGENT RANK COMPARISON =====

| Agent | #1 Pick | #2 Pick | #3 Pick |
|-------|---------|---------|---------|
| A1 (Theorist) | RQ[?] | RQ[?] | RQ[?] |
| A2 (Methodologist) | RQ[?] | RQ[?] | RQ[?] |
| A3 (Domain Expert) | RQ[?] | RQ[?] | RQ[?] |
| A4 (Journal Editor) | RQ[?] | RQ[?] | RQ[?] |
| **Consensus ranking** | **RQ[?]** | **RQ[?]** | **RQ[?]** |
```

**Consensus rules:**
- If 3+ agents rank the same RQ first → clear consensus
- If rankings diverge → note the disagreement and explain why each agent favors a different RQ (this itself is useful diagnostic information)
- Devil's Advocate viability overrides: any RQ rated `FATAL FLAW` by A5 is automatically downgraded regardless of other ratings

#### 8c. Refine RQs Based on Panel Feedback

For each RQ rated `PROCEED` or `REVISE`:

1. **Apply all ★★ suggestions** (cross-agent agreement items) — these are high-confidence improvements
2. **Apply the Devil's Advocate mitigation** — address the top threat
3. **Revise the RQ text** to incorporate panel feedback (mark changes as `[REFINED: reason]`)
4. **Update hypotheses** if the refinement changed the mechanism or scope
5. **Update the data recommendation** if the Methodologist suggested a better dataset

Present the **original** and **refined** versions side-by-side for each RQ:

```
RQ1 (original): [original text]
RQ1 (refined):  [refined text]  [REFINED: incorporated A1 suggestion to add competing mechanism + A2 suggestion to use PSID instead of GSS]

H1 (original): [original]
H1 (refined):  [refined]  [REFINED: downgraded from causal to associational per A2]
```

#### 8d. Final Verdict

After refinement, produce the final verdict for each RQ using the post-refinement assessment:

| Dimension | Criterion | Rating |
|-----------|-----------|--------|
| Theoretical contribution | Adjudicates competing explanations or bridges literatures | H/M/L |
| Empirical novelty | New data, context, population, or measurement vs. prior work | H/M/L |
| Identification strength | Causal leverage beyond prior studies | H/M/L |
| Data feasibility | Key variables available in accessible dataset | H/M/L |
| Publication fit | Matches norms of target journal | H/M/L |
| Panel consensus | Multi-agent agreement on viability | Strong/Mixed/Weak |

**Overall verdict per RQ:**
- `PROCEED`: ≥4 dimensions rated High or Medium AND no FATAL FLAW → strong candidate
- `REVISE`: 2-3 dimensions rated Low OR panel consensus is Mixed → name the specific revision still needed
- `ABANDON`: ≥3 dimensions rated Low OR FATAL FLAW from Devil's Advocate → pivot angle

Flag the top risk and mitigation strategy for each `PROCEED` RQ.

### Step 9: Recommend Next Skill Path

State the **single recommended RQ** (use the **refined** version from Step 8c) with explicit justification referencing:
- The gap identified in Step 3
- The best dataset identified in Step 7
- The panel consensus from Step 8b (cite which agents agreed and why)
- The refinements applied in Step 8c

Then provide the exact next-step command chain:
- `/scholar-lit-review [selected RQ + keywords]` — deep systematic review
- `/scholar-hypothesis [selected RQ]` — theory and hypothesis development
- `/scholar-design [selected RQ + dataset]` — methods and identification strategy
- `/scholar-causal [selected RQ]` — causal diagram, identification strategy, and confounders

### Step 10: Save Output to File

After displaying the full output to the user, save the complete output to a Markdown file using the Write tool.

### Version Collision Avoidance (MANDATORY)

**Before EVERY Write tool call below**, run this Bash block to determine the correct save path. Do NOT hardcode paths from the filename templates — they show naming patterns only.

```bash
# MANDATORY: Replace [values] with actuals before running
# BASE pattern: scholar-idea-[topic-slug]-[YYYY-MM-DD]
# Split into directory and stem for the gate script:
OUTDIR="$(dirname "scholar-idea-[topic-slug]-[YYYY-MM-DD]")"
STEM="$(basename "scholar-idea-[topic-slug]-[YYYY-MM-DD]")"
mkdir -p "$OUTDIR"
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/version-check.sh" "$OUTDIR" "$STEM"
```

**Use the printed `SAVE_PATH` as `file_path` in the Write tool call.** Re-run this block (with the appropriate BASE) for each additional file. The same version suffix must be used for all related output files (.md, .docx, .tex, .pdf).


**Filename convention:**
`scholar-idea-[topic-slug]-[YYYY-MM-DD].md`

- Derive `[topic-slug]` from the first 4-6 significant words of the user's topic, lowercased, spaces replaced with hyphens (e.g., `redlining-activity-space-segregation`)
- Use today's date for `[YYYY-MM-DD]`
- Save to the current working directory

**File header to prepend:**
```
# Scholar Idea Exploration: [original topic as provided by user]
*Generated by /scholar-idea on [YYYY-MM-DD]*

---
```

Then write the full output (all 12 sections) exactly as displayed on screen.

**Close Process Log:**

Run the following to finalize the process log:

```bash
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
SKILL_NAME="scholar-idea"
LOG_DATE=$(date +%Y-%m-%d)
LOG_FILE="${OUTPUT_ROOT}/logs/process-log-${SKILL_NAME}-${LOG_DATE}.md"
if [ ! -f "$LOG_FILE" ]; then
  LOG_FILE=$(ls -t "${OUTPUT_ROOT}"/logs/process-log-${SKILL_NAME}-${LOG_DATE}*.md 2>/dev/null | head -1)
fi
cat >> "$LOG_FILE" << LOGFOOTER

## Output Files
[list each output file path as a bullet]

## Summary
- **Steps completed**: [N completed]/[N total]
- **Files produced**: [count]
- **Errors**: [count, or 0]
- **Time finished**: $(date +%H:%M:%S)
LOGFOOTER
echo "Process log saved to $LOG_FILE"
```

After saving, tell the user:
> Output saved to `[filename]`

## Reference Loading

Use [references/idea-patterns.md](references/idea-patterns.md) when:
- Generating angles: read the relevant domain pattern (Section 3)
- Choosing mechanisms: read Section 4 (Mechanism Menus)
- Building search queries: read Section 6 (Literature Scan Query Templates)
- Identifying datasets: read Section 8 (Major Social Science Datasets by Domain)

Read only the relevant domain section(s), not the entire file, unless the user asks for a broad multi-domain scan.

## Output Format

Return results in this order:
1. `IDEA DIAGNOSIS` — what is promising vs. underspecified
2. `CANDIDATE RESEARCH ANGLES` — 3-5 angles
3. `LITERATURE SCAN` — prior work map per angle (Step 3 table + novelty threat rating)
4. `FORMAL RESEARCH QUESTIONS` — `RQ1-RQ3` with gap statements
5. `HYPOTHESES` — `H1-H2` per RQ
6. `DATA SOURCE INVENTORY` — table of candidate datasets per RQ (Step 7)
7. `MULTI-AGENT EVALUATION PANEL` — consensus scorecard, cross-agent agreement (★★), improvement suggestions, agent rank comparison (Step 8a–8b)
8. `REFINED RESEARCH QUESTIONS` — original vs. refined RQs side-by-side with `[REFINED: reason]` markers (Step 8c)
9. `FINAL VERDICT` — post-refinement rating table + PROCEED/REVISE/ABANDON per RQ (Step 8d)
10. `RECOMMENDED QUESTION` — single best option with justification citing panel consensus
11. `NEXT COMMANDS` — exact skill invocations with arguments pre-filled
12. *(file save confirmation line)* — `Output saved to scholar-idea-[slug]-[date].md`

## Quality Rules

Before finalizing, verify:
- [ ] Literature scan followed tiered protocol: local library (Tier 1) searched FIRST for all angles, then external APIs (Tier 2), then WebSearch (Tier 3) only for gaps — do not skip to WebSearch without checking local library
- [ ] Novelty claims cite specific papers identified in Step 3, not generic statements like "this is understudied"
- [ ] Data inventory identifies at least one publicly accessible dataset for each `PROCEED` RQ
- [ ] Questions are specific enough to operationalize with the identified data
- [ ] Mechanisms and confounders are explicit
- [ ] Claims do not exceed plausible design strength of the recommended dataset
- [ ] The recommended RQ has a clear gap, a named dataset, and a concrete next-step path
- [ ] **Multi-agent panel ran**: all 5 evaluator agents (Theorist, Methodologist, Domain Expert, Journal Editor, Devil's Advocate) were spawned in parallel via Task tool
- [ ] **Consensus scorecard produced**: cross-agent agreement (★★) items identified; agent rank comparison table completed
- [ ] **RQs refined**: all ★★ suggestions and Devil's Advocate mitigations applied; original vs. refined versions shown side-by-side
- [ ] **No FATAL FLAW RQ recommended**: any RQ rated FATAL FLAW by the Devil's Advocate was not selected as the recommended question
- [ ] **Panel consensus cited in recommendation**: Step 9 justification references specific agent ratings and cross-agent agreement, not just the literature scan
- [ ] Output has been saved to a `.md` file in the current working directory using the Write tool
