Separate developer and user agent skills#927
Conversation
Move user-facing skills (designing-experiments, loading-datasets, performing-causal-analysis, running-placebo-analysis) out of .github/skills/ into causalpy/skills/ so they ship with the pip wheel and are version-locked to the library API. Developer skills remain in .github/skills/ and are auto-discovered via existing symlinks. User skills require explicit installation via the new `causalpy skills install` CLI. Co-authored-by: Cursor <cursoragent@cursor.com>
Add `causalpy skills install` CLI that copies user skills from the installed package into platform-specific locations (Cursor, Claude Code, GitHub Copilot, Windsurf, or generic llms.txt). Includes version stamping, uninstall support, and version-check command. Update AGENTS.md, README, Makefile, pyproject.toml, Sphinx conf, and Cursor commands to reflect the new skills architecture. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR restructures “AI agent skills” so end-user skills ship inside the causalpy Python package (version-locked to the installed API), while maintainer/developer skills remain in .github/skills/. It also introduces a causalpy skills ... CLI to install those bundled skills into different AI-assistant platform configuration formats and adds a docs llms.txt generator.
Changes:
- Move 4 user-facing skills into
causalpy/skills/as packaged Markdown data. - Add
causalpy skills install|uninstall|list|checkCLI plus platform adapters (Cursor/Claude/Copilot/Windsurf/Generic). - Add
make llms-txtto generatedocs/source/llms.txtand expose it via Sphinxhtml_extra_path.
Reviewed changes
Copilot reviewed 21 out of 30 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Document new “AI Agent Skills” and CLI usage. |
| pyproject.toml | Package causalpy.skills Markdown data and add causalpy console script entrypoint. |
| Makefile | Add llms-txt generator target for docs. |
| docs/source/conf.py | Include llms.txt in html_extra_path for static publishing. |
| causalpy/skills/init.py | Expose installer functions from the new causalpy.skills package. |
| causalpy/skills/_cli.py | Implement causalpy skills ... CLI subcommands. |
| causalpy/skills/_installer.py | Implement bundled-skill discovery, platform detection, install/uninstall, and version checking. |
| causalpy/skills/_generate_llms_txt.py | Generate concatenated llms.txt from bundled skills for docs hosting. |
| causalpy/skills/_platforms/_base.py | Define base adapter contract, version stamping, and removal helpers. |
| causalpy/skills/_platforms/cursor.py | Cursor adapter writes skills under .cursor/skills/causalpy-*/. |
| causalpy/skills/_platforms/claude.py | Claude Code adapter writes skills under .claude/skills/causalpy-*/. |
| causalpy/skills/_platforms/windsurf.py | Windsurf adapter writes skills under .windsurf/skills/causalpy-*/. |
| causalpy/skills/_platforms/copilot.py | Copilot adapter appends/removes a marked section in .github/copilot-instructions.md. |
| causalpy/skills/_platforms/generic.py | Generic adapter writes llms-causalpy.txt and provides build_llms_txt(). |
| causalpy/skills/_platforms/init.py | Add platform adapters package marker/docs. |
| causalpy/skills/designing-experiments/SKILL.md | New bundled user skill content. |
| causalpy/skills/loading-datasets/SKILL.md | New bundled user skill content. |
| causalpy/skills/performing-causal-analysis/SKILL.md | New bundled user skill content. |
| causalpy/skills/performing-causal-analysis/reference/diff_in_diff.md | New user-facing reference doc for DiD. |
| causalpy/skills/performing-causal-analysis/reference/interrupted_time_series.md | New user-facing reference doc for ITS. |
| causalpy/skills/performing-causal-analysis/reference/synthetic_control.md | New user-facing reference doc for Synthetic Control. |
| causalpy/skills/running-placebo-analysis/SKILL.md | New bundled user skill content. |
| causalpy/skills/running-placebo-analysis/reference/placebo_in_time.md | New user-facing reference doc for Placebo-in-time. |
| AGENTS.md | Explain the new split between developer vs user skills and installation flow. |
| .gitignore | Ignore generated docs/source/llms.txt. |
| .cursor/commands/causalpy_research.md | Update command pointers to new causalpy/skills/ paths. |
| .cursor/commands/causalpy_methods.md | Update command pointers to new causalpy/skills/ paths. |
| .cursor/commands/causalpy_extras.md | Update command pointers to new causalpy/skills/ paths. |
| .cursor/commands/causalpy_estimators.md | Update command pointers to new causalpy/skills/ paths. |
| .cursor/commands/causalpy_demos.md | Update command pointers to new causalpy/skills/ paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Insert version stamp after YAML frontmatter instead of before it so tools that expect frontmatter at byte 0 are not broken - Make _rmtree_if_exists() symlink-safe: unlink symlinks without following, refuse to remove paths outside the project directory - Make html Makefile target depend on llms-txt so docs builds include the generated llms.txt automatically - Add pytest suite for install/uninstall/check_version/platform detection and symlink safety Co-authored-by: Cursor <cursoragent@cursor.com>
The remote updated copilot detection to require copilot-instructions.md rather than just a .github/ directory. Update and expand the test. Co-authored-by: Cursor <cursoragent@cursor.com>
drbenvincent
left a comment
There was a problem hiding this comment.
For the record: I’m gpt-5.5 acting on behalf of @drbenvincent.
Findings
-
Must fix
causalpy/skills/_platforms/_base.py: installed skill files get a version comment before YAML frontmatter. My targeted install check produced<!-- causalpy-skills v0.8.0 -->as line 1 and---as line 2. Cursor/Claude/Windsurf-style skills commonly require frontmatter at byte 0, so this risks making the shipped user skills invisible to the agents they target. Put the stamp inside frontmatter, after the closing frontmatter block, or in a separate managed metadata file. -
Must fix
causalpy/skills/_installer.py: platform auto-detection treats any.github/directory as Copilot. That meanscausalpy skills installin most GitHub repos can silently create or rewrite.github/copilot-instructions.md, even when the user is only using Cursor/Claude/etc. For developer repos this is especially risky because.githubusually means CI, not Copilot. Detect only an existing Copilot-specific file, or require--platform copilot. -
Must fix
docs/source/conf.py,Makefile,.readthedocs.yaml:html_extra_pathincludesllms.txt, but the file is gitignored and RTD invokes Sphinx directly, notmake llms-txt. The advertised stable hostedllms.txtURL therefore depends on an unrun generation step. Generate it during the docs build, commit it intentionally, or wire RTD/build config to create it before Sphinx readshtml_extra_path. -
Must fix
causalpy/skills/_installer.pyand platform adapters: the new public CLI writes files, uninstalls files, mutates Copilot instructions, checks versions, and auto-detects platforms, but there are no tests undercausalpy/tests/for this surface. Addtmp_pathpytest coverage for install/uninstall/check/list, frontmatter preservation, Copilot detection, and multi-platform behavior. -
Should fix
causalpy/skills/_installer.py:check_version()returns the first installed version it finds. In a multi-platform repo, it can report “up to date” while another installed platform is stale. Since version-locking is the main value proposition for agent users, the check should report per-platform status. -
Should fix
causalpy/skills/loading-datasets/SKILL.mdandcausalpy/skills/performing-causal-analysis/SKILL.md: moving these into the wheel makes them user-facing product docs for agents. The dataset skill omits many public datasets, and the analysis skill advertises RD but only links DiD/ITS/SC references. Before release, audit the skill content against the current API so agents don’t teach stale or partial workflows.
Merge Readiness
Verdict: request changes while draft.
Branch status: GitHub reports mergeable, draft, and blocked. CI was still pending when checked; prek and pre-commit were passing, several tests/docs jobs were pending.
PR Summary
The design direction is good: separating maintainer/developer skills from packaged user skills should reduce agent-context pollution for CausalPy contributors while giving end users version-matched agent guidance. The implementation needs tightening around the actual user-agent install path, especially frontmatter preservation, non-surprising platform detection, docs generation, and tests.
Test Evidence
I ran targeted checks in the CausalPy conda env for list_skills(), Cursor install/check/uninstall, and .github-only auto-detection. Those confirmed the frontmatter stamp problem and the broad Copilot detection behavior. Full local tests were not run; remote CI was still pending.
… audit - Generate llms.txt in conf.py when missing so RTD builds include it without requiring `make llms-txt` - check_version() now returns per-platform dict instead of first match, so stale installs on individual platforms are visible - CLI `check` command displays per-platform version status - Add regression_discontinuity.md reference to performing-causal-analysis - Complete the loading-datasets skill with all 21 datasets (synthetic + CSV) - Update test assertions for new file count and check_version signature Co-authored-by: Cursor <cursoragent@cursor.com>
Addressing GPT 5.5 review (219ed95)
|
The load_data() docstring already documents all available datasets. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #927 +/- ##
=======================================
Coverage 95.07% 95.07%
=======================================
Files 87 87
Lines 13701 13701
Branches 812 812
=======================================
Hits 13026 13026
Misses 479 479
Partials 196 196 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Delete the entire CLI installer stack (_cli.py, _installer.py, _platforms/, _generate_llms_txt.py, tests) and revert the pyproject.toml console-script entry, Makefile llms-txt target, and Sphinx conf.py hook. User-facing skills remain in causalpy/skills/ as the source of truth; distribution to end users will happen via https://hub.decision.ai. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
.github/skills/intocausalpy/skills/so they live with the source tree and can be distributed as user-facing guidance via Decision AI Hub..github/skills/, with.cursor/skills,.claude/skills, and.agents/skillscontinuing to symlink there for in-repo agent workflows.causalpy/skills/README.mdand updateAGENTS.md,README.md, and Cursor command pointers to document the split between developer skills and user-facing skills.Changed Skill Layout
.github/skills/now contains developer workflow skills only: environment setup, PR workflows, issue handling, review, and marimo workflows.causalpy/skills/now contains user-facing CausalPy usage skills:designing-experiments,performing-causal-analysis, andrunning-placebo-analysis.performing-causal-analysisincludes method references for difference-in-differences, interrupted time series, synthetic control, and regression discontinuity.loading-datasetsuser skill was removed becausecausalpy.load_data()already documents available datasets directly.Review Notes
causalpy/skills/, the folder has a standard skill structure: each skill has aSKILL.mdwith YAML frontmatter and local reference links resolve.Test Plan
.github/skills/andcausalpy/skills/.causalpy/skills/*/SKILL.mdfiles have frontmatter withnameanddescription.SKILL.mdfiles resolve.prekpasses in CI.Made with Cursor