Skip to content

tohskcid/invisible-hands-for-economists

v2.16.0MIT

An auditable economics research workflow for empirical, theoretical, and structural work.

Invisible Hands for Economists

License: MIT Skill: econ-research-lab Version Theory Proof: Lean 4 Replication: AEA Standard Architecture: PI DAG Self-Improvement: Dream-RSI

An auditable, end-to-end Multi-Agent Research Lab for Empirical, Theoretical, and Structural Economics. One accountable PI coordinates bounded specialist agents, discovers and verifies data with cryptographic hashes, formalizes mathematical proofs with Lean 4, runs reproducible econometric pipelines, and stress-tests manuscripts via adversarial peer review.

ArchitectureTrust SurfaceCore CapabilitiesProtocol ReferenceInstallationCLI Tools


🏛 Trust Surface & Audit Rigor

Unlike generic prompt catalogs, Invisible Hands for Economists enforces deterministic, cryptographic, and mathematical verification gates. AI generation is halted whenever a gate fails:

Verification LaneStandard / TechnologyGate Rule & EnforcementPrimary Reference
Data Provenance GateSHA-256 Hashes & Public/Enclave CheckEstimation is hard-blocked until data source, schema, license, and acquisition scripts match hashes.data_acquisition.md
Methodology RouterIdentification Design ScreenRoutes from the estimand and institutional assignment mechanism—never from significance or data shape.method_router.md
Database WranglingInstitutional Cleaning ConventionsEnforces standard rules for WRDS (CRSP/Compustat CCM), TEJ, CSMAR, CFPS, Census (IPUMS), FRED, PWT, EIA, EPA, and Patents.database_cleaning_recipes.md
Modern EstimationStata / R / Python RecipesPrescribes heterogeneity-robust DiD (csdid, sunab, did_imputation), SDiD (synthdid), Bartik, bias-corrected RDD, and effective weak-IV tests.estimation_recipes.md
Text-as-Data AuditLLM Pinning & Reliability StandardsEnforces snapshot-pinned models, zero temperature, prompt hash freezes, and Cohen's $\kappa \ge 0.70$ on human gold samples.text_as_data.md
Falsification BatteryAnti-Confirmation-Bias RefutationsFormulates 3+ competing mechanisms; tests temporal placebos, permutation swaps, density discontinuities, and Oster bounds.falsification_battery.md
Formal Theory ProofLean 4 + Mathlib Kernel VerificationMathematical theorems are marked formally proved only when verified by the locked Lean 4 kernel with axiom allowlists.lean_harness.md
Structural SolverFixed Moments & Solver ContractionMonitors contraction mapping tolerances, holdout sample validation, and numerical stability bounds.structural.md
Replication AuditAEA Data & Code Availability PolicyVerifies zero machine-specific absolute paths, deterministic seeds, raw data immutability, and single master script (run_all.sh).replication_audit.md
Adversarial Peer Review3-Archetype Economics RefereesPre-delivery multi-agent review simulating the Identification Policeman, Theory/Mechanism Critic, and Data Hygiene Nitpicker.adversarial_referees.md
Dream-RSI Discovery SimulatorExact Replay Simulator & Meta-PolicyDiscovery history DAG is treated as an exact simulator, evaluating exploration/pruning policies at zero compute cost before online deployment.dream_rsi.md

🧭 Architecture

flowchart TD
    subgraph PI["1. Accountable PI & Research Contract"]
        Q["Research Question"] --> TS["Topic Survey Gate<br/>(Nearest literature · Contribution)"]
        TS --> C["Research Contract<br/>(Target outlet · Scope · Budget · Stop condition)"]
        C --> S["Shared Protocol<br/>(Definitions · Assumptions · Obligations)"]
    end

    subgraph Modes["2. Tri-Pillar Methodology Router"]
        S --> M{Research Mode}
        M -->|Empirical| E["Empirical / Causal<br/>(Estimand · Assignment mechanism)"]
        M -->|Pure Theory| T["Formal Theory<br/>(Lean 4 proof · Counterexample search)"]
        M -->|Structural| X["Structural Estimation<br/>(Moments · Solver tolerance · Holdout)"]
    end

    subgraph Harness["3. Execution & Falsification Battery"]
        E --> MR["Method Router<br/>(DiD · RDD · IV · SDiD · DML)"]
        MR --> DP["Data Provenance Gate<br/>(SHA-256 hashes · Source · License)"]
        X --> DP
        DP --> B["Reproducible Baseline<br/>(Deterministic harness)"]
        T --> B
        B --> FB["Falsification Battery<br/>(3+ Competing channels · Placebos · Oster bounds)"]
        FB --> K{Validate & Classify}
        K -->|Keep · Discard · Blocked| L[("Research Ledger & provenance graph<br/>(experiments.tsv & manifest.jsonl)")]
    end

    subgraph Delivery["4. Delivery & Review Gates"]
        L -->|Budget remains| B
        L -->|Stop reached| MC["Manuscript Coverage Matrix<br/>(Hash-bound section packets)"]
        MC --> AR["Adversarial Peer Review<br/>(Ref 1: Identification · Ref 2: Theory · Ref 3: Data)"]
        AR --> RA["AEA Replication Package Audit<br/>(Master script · Relative paths · Seed lock)"]
        RA --> EP["Verified Evidence Package<br/>(LaTeX manuscript · Figures · Tables · Code)"]
    end

    style PI fill:#1a237e,stroke:#3949ab,stroke-width:2px,color:#ffffff
    style Modes fill:#004d40,stroke:#00796b,stroke-width:2px,color:#ffffff
    style Harness fill:#263238,stroke:#455a64,stroke-width:2px,color:#ffffff
    style Delivery fill:#311b92,stroke:#512da8,stroke-width:2px,color:#ffffff

⚡ Capabilities

  • Topic Survey Gate: Maps the closest literature and establishes novelty before choosing an empirical method or claiming contribution.
  • Tri-Pillar Economics Coverage: Integrates reduced-form causal inference, formal microeconomic theory (with Lean 4 kernel verification), and dynamic structural estimation in a unified DAG.
  • Database Cleaning Recipes: Eliminates institutional data traps in standard empirical databases:
    • WRDS (CRSP & Compustat): CCM linkage (linktype in ('LU', 'LC')), negative prices (bid-ask midpoint), Fama-French June fiscal lags, and Davis-Fama-French Book Equity.
    • Taiwan TEJ: Price dividend adjustments, quarterly flow variable cumulative-to-single-quarter decomposition, and industry exclusions.
    • China CSMAR: Board filtering (ChiNext, STAR), ST/*ST and financial firm screening, reinvested dividend returns (Dretwd), and quarterly flow adjustments.
    • Micro / Survey (CFPS & US Census/IPUMS): Immutable pid vs. dynamic fid, sampling weights (pweight/PERWT), 5-digit zero-padded County FIPS (09001), and boundary harmonization crosswalks.
    • Macro (FRED & PWT 10.x): Flow/stock aggregation rules and living standards (rgdpe) vs. productive capacity/TFP (rgdpo) selection.
  • Modern Econometric Recipes: Pre-configured code patterns for Stata, R, and Python covering Staggered DiD (csdid, sunab, did_imputation), bias-corrected RDD (rdrobust), Montiel Olea & Pflueger effective weak-IV tests, Conley spatial HAC, and Double Machine Learning (DoubleML).
  • Falsification & Competing Mechanisms Battery: Rejects confirmation bias by formalizing 3+ alternative confounding stories, temporal placebos, donor swaps, and Oster selection bounds.
  • AEA-Grade Replication Audit: Enforces American Economic Association Data and Code Availability policies: zero absolute paths, pinned seeds, immutable raw data checksums, and single-click master execution.
  • Pre-Submission Adversarial Peer Review: Simulates three classic referee archetypes (Identification Policeman, Theory/Mechanism Critic, and Data Hygiene Nitpicker) to stresstest manuscripts before submission.

📚 Protocol Index

AreaReference FileFocus
Core Protocolreferences/research_protocol.mdSingle accountable PI rules, state machine, and ledger logging
Empirical Modereferences/empirical.mdReduced-form causal inference, panel FE, and validity checks
Method Routerreferences/method_router.mdIdentification screen (DiD, IV, RDD, SDiD, DML, selection)
Estimation Codereferences/estimation_recipes.mdStata/R/Python modern syntax and AER/QJE three-line tables
Database Recipesreferences/database_cleaning_recipes.mdCleaning WRDS, TEJ, CSMAR, CFPS, Census/IPUMS, FRED, PWT
Falsification Batteryreferences/falsification_battery.mdCompeting mechanisms matrix, temporal/unit placebos, Oster bounds
Theory Modereferences/theory.mdPure theory proofs, counterexamples, and formalization plans
Lean 4 Verificationreferences/lean_harness.mdFormal mathematical verification using Lean 4 + Mathlib
Structural Modereferences/structural.mdDynamic discrete choice, BLP random coefficients, and solvers
Real-World Relevancereferences/real_world_relevance.mdDecision applicability, transportability, feasibility, and monitoring
Text-as-Datareferences/text_as_data.mdLLM annotation, prompt determinism, inter-coder reliability ($\kappa \ge 0.70$)
Replication Auditreferences/replication_audit.mdAEA Data & Code Availability replication package checklist
Adversarial Refereesreferences/adversarial_referees.md3-Archetype economics referee stress tests and report generator
Manuscript Workflowreferences/manuscript.mdEvidence-driven scale, section packets, and logic reviews
Dream-RSI Discoveryreferences/dream_rsi.mdExact discovery tree replay simulator and offline policy dreaming

🌌 Dream-RSI: Recursive Self-Improvement through Evolving Worlds

Based on Dream-RSI: Recursive Self-Improvement through Evolving Worlds (Google DeepMind / UMD / UVA 2026; dream-rsi.com), the lab converts accumulated research history into an exact replay simulator:

  • History as an Exact Simulator: Every econometric specification trial, first-stage diagnostic, and proof branch is persisted into research/discovery_tree.jsonl.
  • Zero-Compute Offline Dreaming: Candidate exploration and pruning policies are evaluated by replaying historical discovery trees at zero execution cost, screening thousands of specification curve configurations in milliseconds.
  • Evolving World Pool: Each completed research run adds another world to the simulator pool, transferring evolved meta-policies and adversarial referee memories to accelerate future research projects.

Run the Dream-RSI offline simulator:

# Audit historical discovery tree integrity
python3 scripts/dream_replay_simulator.py --tree research/discovery_tree.jsonl --audit

# Dream offline specification curve across history at zero execution cost
python3 scripts/dream_replay_simulator.py --tree research/discovery_tree.jsonl --dream

📦 Install

The same release is packaged for Codex, Claude Code, and Google Antigravity. The plugin manifests are thin adapters around one shared econ-research-lab skill.

Codex

Codex plugins can be installed from this repository's marketplace:

codex plugin marketplace add Tohskcid/invisible-hands-for-economists --ref main
codex plugin add invisible-hands-for-economists@invisible-hands

# Refresh the marketplace and installed plugin later
codex plugin marketplace upgrade invisible-hands
codex plugin add invisible-hands-for-economists@invisible-hands

Claude Code

Claude Code plugins use the compatible marketplace in the same repository:

claude plugin marketplace add Tohskcid/invisible-hands-for-economists
claude plugin install invisible-hands-for-economists@invisible-hands

# Refresh the marketplace and installed plugin later
claude plugin marketplace update invisible-hands
claude plugin update invisible-hands-for-economists@invisible-hands

Google Antigravity

Antigravity CLI can import the shared Agent Skill directly from GitHub:

agy plugin install https://github.com/Tohskcid/invisible-hands-for-economists
agy plugin list

Direct git clone skill installs remain supported for existing users. Pull with git pull --ff-only to update those installations.

Direct skill installation paths

# Codex global skill
git clone https://github.com/Tohskcid/invisible-hands-for-economists.git \
  "$HOME/.agents/skills/econ-research-lab"

# Claude Code global skill
git clone https://github.com/Tohskcid/invisible-hands-for-economists.git \
  "$HOME/.claude/skills/econ-research-lab"

# Antigravity global skill
git clone https://github.com/Tohskcid/invisible-hands-for-economists.git \
  "$HOME/.gemini/config/skills/econ-research-lab"

🛠 CLI Tools

ToolPurpose
econ_data_profiler.pyPanel keys, missingness, balance, descriptive bins, LaTeX/SVG output
check_data_provenance.pyVerify source, license, acquisition, schema, and file hashes for real, restricted, or proxy data
check_literature_archive.pyCheck bibliography coverage, lawful access records, PDF signatures, names, and hashes
check_manuscript_coverage.pyBind every manuscript section and claim to code, results, exhibits, diagnostics, and appendices
check_topic_survey.pyValidate nearest-work coverage and the pre-design contribution decision
search_library.pyRetrieve candidate result cards without loading the entire library
check_lean_proof.pyLock theorem statements and audit Lean proof terms and axioms
validate_research_manifest.py / audit_claims.pyValidate provenance, proxy scope, argument DAGs, and manuscript markers
check_result_bindings.pyBind displayed manuscript numbers and a results-file hash to structured estimates
check_design_audit.pyEnforce diagnostics selected for the declared empirical design
check_structural_audit.pyEnforce convergence, identification, holdout, and counterfactual diagnostics
check_real_world_audit.pyBlock real-world recommendations without applicability evidence
check_text_audit.pyValidate LLM text-as-data annotation, inter-coder reliability, zero temperature, and prompt hashes
check_research_package.pyRun applicable manifest, manuscript, result, empirical/structural audit, and LaTeX gates for CI
check_latex.pyCompile safely, inspect logs, render every page, and bind visual review to the PDF hash
check_logic_review.pyBind a central-claim referee report to manuscript and manifest hashes
run_research_team.pyValidate and run a bounded provider-neutral specialist task DAG
run_dgp_evals.py / run_skill_evals.pyExternal-agent regression and deterministic design checks

🛡 Verification & Standards

# Validate library cards and journal database
python3 scripts/validate_library.py --json

# Run package unit tests
python3 -m unittest discover -s tests -v

# Validate agent skills specification
uvx --from skills-ref agentskills validate "$(pwd)"

MIT Licensed. Maintained by Tohskcid.