Skip to content

Centralize AI config and reorganize skills#837

Closed
cetagostini wants to merge 11 commits into
mainfrom
cetagostini/organizing_skill_folder
Closed

Centralize AI config and reorganize skills#837
cetagostini wants to merge 11 commits into
mainfrom
cetagostini/organizing_skill_folder

Conversation

@cetagostini

@cetagostini cetagostini commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #640 [EDIT BY BEN]

Summary

  • Centralize all AI assistant config in .github/ — agents, rules, commands, and skills now live in .github/ as the single source of truth. Both .cursor/ and .claude/ consume them via symlinks. One edit propagates to both tools.
  • Unify CausalPy domain skills — consolidate 4 fragmented skills (designing-experiments, loading-datasets, performing-causal-analysis, running-placebo-analysis) and 6 thin command stubs into one comprehensive causalpy-analysis skill covering all 9 experiments, 7 models, and 11 checks.
  • Add causal-detective skill — structured falsification investigation process inspired by the Causal Mindset Framework (Gallea, 2026). Guides through 5 phases: frame claim, hunt alternatives, run falsification tests, evaluate evidence, assess generalizability. Includes 3 specialized agents (threat-assessor, falsification-runner, evidence-synthesizer).

Changes

Infrastructure (Commit 1)

  • Move agents from .cursor/agents/ to .github/agents/
  • Move commands from .cursor/commands/ to .github/commands/
  • Create 4 scoped rules in .github/rules/ (core-code, testing, documentation, marimo)
  • Replace .cursor/{agents,rules,commands} directories with symlinks to .github/
  • Create .claude/{agents,rules,commands} symlinks to .github/
  • Create CLAUDE.md as symlink to AGENTS.md
  • Remove 6 redundant causalpy_* command stubs and basic.mdc

Skills (Commits 2-4)

  • causalpy-analysis/ — unified analysis workflow with 9 reference files
  • example-datasets/ — standalone skill for demo datasets (separated from analysis)
  • feature-exploration/ — skill for exploring APIs through minimal reproducible examples
  • causal-detective/ — falsification investigation skill with threat catalog, counterfactual analysis, and falsification test references

Agents (Commits 1, 4)

  • ci-failure-investigator and merge-conflict-analyst (moved to .github/agents/)
  • threat-assessor, falsification-runner, evidence-synthesizer (new)

Test plan

  • Verify symlinks resolve: ls -la .claude/agents/ .cursor/agents/
  • Verify CLAUDE.md loads in Claude Code sessions
  • Verify rules activate when editing files in scoped paths
  • Test causal-detective skill triggers on falsification questions
  • Confirm skills list shows new skills in both Cursor and Claude Code

🤖 Generated with Claude Code

cetagostini and others added 11 commits April 6, 2026 10:37
These directories contain exploratory/demo scripts that are not part
of the main package and should not count toward docstring coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…TimeSeries

Sensitivity checks like PlaceboInTime and OutcomeFalsification need
to create fresh, unfitted copies of models. These _clone methods
preserve all configuration (components, sample_kwargs, mode) while
resetting fitted state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Time

Adds a "random" selection_method that randomly samples eligible placebo
windows from the pre-intervention period, with constraints on minimum
training fraction, minimum gap between folds, and optional period
exclusion. Also fixes the assurance simulation to correctly model the
alternative hypothesis as null baseline noise + expected treatment
effect (theta_new + expected_effect), matching the paper's formulation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduces outcome falsification, which re-fits the experiment with
alternative outcome formulas and reports their estimated effect sizes
with HDI intervals. This is an informational check (no pass/fail)
that lets researchers assess whether the pattern of effects across
outcomes is consistent with their causal story. Inspired by the
"causal detective" approach in Gallea (2026).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a developer notebook documenting the placebo-in-time and
outcome falsification sensitivity check methodology with worked
examples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move agents, commands, and rules from .cursor/ to .github/ as the single
source of truth. Both .cursor/ and .claude/ now consume these via symlinks.
Add 4 scoped rules (core-code, testing, documentation, marimo) extracted
from AGENTS.md and basic.mdc. Create CLAUDE.md as symlink to AGENTS.md.
Remove 6 redundant causalpy_* command stubs replaced by the unified skill.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consolidate designing-experiments, performing-causal-analysis, and
running-placebo-analysis into one causalpy-analysis skill that covers
the full analysis workflow: method selection, model choice, fitting,
results, sensitivity checks, and pipelines. All 9 experiment classes,
7 models, and 11 checks are documented with real API signatures.
Reference files cover each method family in depth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract demo datasets from causalpy-analysis into standalone
example-datasets skill — datasets are a learning/testing tool, not
part of a real analysis workflow. Add feature-exploration skill for
systematically exploring APIs through minimal reproducible examples.
Remove old loading-datasets skill (replaced by example-datasets).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New skill for structured falsification of causal claims, inspired by
the Causal Mindset Framework (Gallea, 2026). Guides users through a
5-phase investigation: frame the claim, hunt alternative explanations,
design falsification tests, evaluate evidence, assess generalizability.

Three specialized agents support the workflow:
- threat-assessor: identifies confounders, reverse causation, bias
- falsification-runner: maps threats to CausalPy checks and executes
- evidence-synthesizer: weighs all evidence into a final verdict

Reference files cover counterfactual analysis, a threat catalog, and
mapping of all 10 CausalPy check classes to alternative explanations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@cetagostini

Copy link
Copy Markdown
Collaborator Author

@codecov

codecov Bot commented Apr 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.31%. Comparing base (1ee7322) to head (ab915eb).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
causalpy/checks/placebo_in_time.py 92.15% 2 Missing and 2 partials ⚠️
causalpy/checks/outcome_falsification.py 96.20% 1 Missing and 2 partials ⚠️
causalpy/pymc_models.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #837      +/-   ##
==========================================
+ Coverage   93.77%   94.31%   +0.53%     
==========================================
  Files          77       80       +3     
  Lines       11881    12265     +384     
  Branches      696      721      +25     
==========================================
+ Hits        11142    11568     +426     
+ Misses        546      501      -45     
- Partials      193      196       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 causalpy | 🛠️ Build #32217753 | 📁 Comparing ab915eb against latest (711970c)

  🔍 Preview build  

Show files changed (62 files in total): 📝 49 modified | ➕ 13 added | ➖ 0 deleted
File Status
404.html 📝 modified
genindex.html 📝 modified
py-modindex.html 📝 modified
_modules/index.html 📝 modified
notebooks/its_place_in_time_analysis.html ➕ added
_modules/causalpy/pymc_models.html 📝 modified
api/generated/causalpy.checks.html 📝 modified
api/generated/causalpy.checks.outcome_falsification.FalsificationResult.init.html ➕ added
api/generated/causalpy.checks.outcome_falsification.FalsificationResult.html ➕ added
api/generated/causalpy.checks.outcome_falsification.OutcomeFalsification.init.html ➕ added
api/generated/causalpy.checks.outcome_falsification.OutcomeFalsification.html ➕ added
api/generated/causalpy.checks.outcome_falsification.OutcomeFalsification.run.html ➕ added
api/generated/causalpy.checks.outcome_falsification.OutcomeFalsification.validate.html ➕ added
api/generated/causalpy.checks.outcome_falsification.html ➕ added
api/generated/causalpy.checks.placebo_in_time.PlaceboInTime.init.html 📝 modified
api/generated/causalpy.checks.placebo_in_time.PlaceboInTime.html 📝 modified
api/generated/causalpy.checks.placebo_in_time.html 📝 modified
api/generated/causalpy.data.datasets.load_data.html 📝 modified
api/generated/causalpy.data.simulate_data.create_series.html ➕ added
api/generated/causalpy.data.simulate_data.generate_ancova_data.html 📝 modified
api/generated/causalpy.data.simulate_data.generate_did.html 📝 modified
api/generated/causalpy.data.simulate_data.generate_multicell_geolift_data.html 📝 modified
api/generated/causalpy.data.simulate_data.generate_regression_discontinuity_data.html 📝 modified
api/generated/causalpy.data.simulate_data.generate_seasonality.html ➕ added
api/generated/causalpy.data.simulate_data.generate_synthetic_control_data.html 📝 modified
api/generated/causalpy.data.simulate_data.generate_time_series_data.html ➕ added
api/generated/causalpy.data.simulate_data.generate_time_series_data_seasonal.html 📝 modified
api/generated/causalpy.data.simulate_data.generate_time_series_data_simple.html 📝 modified
api/generated/causalpy.data.simulate_data.html 📝 modified
api/generated/causalpy.data.simulate_data.periodic_kernel.html ➕ added
api/generated/causalpy.experiments.diff_in_diff.DifferenceInDifferences.init.html 📝 modified
api/generated/causalpy.experiments.diff_in_diff.DifferenceInDifferences.html 📝 modified
api/generated/causalpy.experiments.diff_in_diff.DifferenceInDifferences.input_validation.html 📝 modified
api/generated/causalpy.experiments.instrumental_variable.InstrumentalVariable.init.html 📝 modified
api/generated/causalpy.experiments.instrumental_variable.InstrumentalVariable.html 📝 modified
api/generated/causalpy.experiments.interrupted_time_series.InterruptedTimeSeries.init.html 📝 modified
api/generated/causalpy.experiments.interrupted_time_series.InterruptedTimeSeries.html 📝 modified
api/generated/causalpy.experiments.piecewise_its.PiecewiseITS.init.html 📝 modified
api/generated/causalpy.experiments.piecewise_its.PiecewiseITS.html 📝 modified
api/generated/causalpy.experiments.prepostnegd.PrePostNEGD.init.html 📝 modified
api/generated/causalpy.experiments.prepostnegd.PrePostNEGD.html 📝 modified
api/generated/causalpy.experiments.regression_discontinuity.RegressionDiscontinuity.init.html 📝 modified
api/generated/causalpy.experiments.regression_discontinuity.RegressionDiscontinuity.html 📝 modified
api/generated/causalpy.experiments.regression_kink.RegressionKink.init.html 📝 modified
api/generated/causalpy.experiments.regression_kink.RegressionKink.html 📝 modified
api/generated/causalpy.experiments.staggered_did.StaggeredDifferenceInDifferences.init.html 📝 modified
api/generated/causalpy.experiments.staggered_did.StaggeredDifferenceInDifferences.html 📝 modified
api/generated/causalpy.experiments.synthetic_control.SyntheticControl.init.html 📝 modified
api/generated/causalpy.experiments.synthetic_control.SyntheticControl.html 📝 modified
_modules/causalpy/checks/outcome_falsification.html ➕ added
_modules/causalpy/checks/placebo_in_time.html 📝 modified
_modules/causalpy/data/datasets.html 📝 modified
_modules/causalpy/data/simulate_data.html 📝 modified
_modules/causalpy/experiments/diff_in_diff.html 📝 modified
_modules/causalpy/experiments/instrumental_variable.html 📝 modified
_modules/causalpy/experiments/interrupted_time_series.html 📝 modified
_modules/causalpy/experiments/piecewise_its.html 📝 modified
_modules/causalpy/experiments/prepostnegd.html 📝 modified
_modules/causalpy/experiments/regression_discontinuity.html 📝 modified
_modules/causalpy/experiments/regression_kink.html 📝 modified
_modules/causalpy/experiments/staggered_did.html 📝 modified
_modules/causalpy/experiments/synthetic_control.html 📝 modified

@drbenvincent drbenvincent added the agents Agent related issues specifically for use by developers label Apr 13, 2026
@github-actions github-actions Bot added the devops DevOps related label Apr 15, 2026
@drbenvincent

Copy link
Copy Markdown
Collaborator

Closing this PR — the agent infrastructure work (centralising config in .github/, symlinks, skill reorganisation, causal-detective skill) has been extracted into #925, which is a clean, conflict-free PR against current main.

The remaining non-agentic changes (OutcomeFalsification check, random placebo fold selection, _clone methods, tests, sensitivity checks notebook, pyproject.toml interrogate tweak) should come in as separate, focused PRs — ideally one per feature. Keeping PRs modular makes them easier to review, less likely to conflict, and avoids blocking unrelated work on each other.

Thanks for the work here @cetagostini — the skill consolidation in particular is a big improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent related issues specifically for use by developers devops DevOps related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify skills/commands/rules etc for smoother/tidier dev experience

2 participants