{"id":"276f133e-0718-4f34-9fa6-11f6254dbc94","slug":"ds-cast","kind":"skill","name":"ds-cast","summary":"A Claude-Code-native re-implementation of DS-STAR: a plan → code → execute → verify → route data-science agent built on subagents, skills, and deterministic hooks.","owner":"willim9313","repoUrl":"https://github.com/willim9313/ds-cast","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-06-19T03:18:01.000Z","addedAt":"2026-10-22T03:07:02.269Z","logoUrl":"https://avatars.githubusercontent.com/u/65487124?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["developer-tools","data-analytics"],"tags":["agentic-ai","ai-agent","claude-code","data-analysis","ds-star","llm-agent","data-science-agent"],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-23T23:20:14.163Z","sample":false,"url":"https://conduits.dev/tools/ds-cast","language":"Python","transports":["stdio"],"install":{"pypi":"ds-cast"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"<h1 align=\"center\">DS-CAST</h1>\n<p align=\"center\"><b>Code, Analysis &amp; Structured Task</b></p>\n<p align=\"center\"><i>An automated data science framework for end-to-end analysis, modeling, and code generation — inspired by the concepts introduced in DS-STAR.</i></p>\n\n<p align=\"center\"><b>English</b> · <a href=\"README.zh-TW.md\">繁體中文</a></p>\n\n---\n\nDS-CAST turns a folder of heterogeneous data and a natural-language question into a\n**verified, reproducible answer** — by driving a Claude Code agent through the\nplan → code → execute → verify → route loop from the\n[DS-STAR paper](https://arxiv.org/abs/2509.21825) (Google Cloud / KAIST), re-implemented\non Claude Code's *native* primitives: **subagents, skills, and hooks**.\n\nIt is not a wrapper around an LLM. It is a **symbiotic operating harness**: the LLM\nmakes only semantic judgements, while every action that mutates state — how a verdict\nbecomes structured state, how results are captured, how the plan is truncated, how\n`iter`/`status` advance — is owned by deterministic Python scripts. That split is what\nmakes the loop *terminate*, *not silently ship unverified results*, and *survive a\nforgetful model*.\n\n## How it works\n\n```\n/ds-star \"<your question>\"\n   │  (main session = Controller + Coder, Opus)\n   ├─ Phase 0  Init      create run + state.json, scan data/\n   ├─ Phase 1  Analyze   parallel ds-analyzer subagents → one description per file\n   ├─ Phase 2  Init plan  ds-planner → plan.md ; Coder writes solution.py ; dsstar-run\n   └─ Phase 3  Loop\n        ├─ ds-verifier  → verdict.json  (sufficient? — LLM-as-judge, gated)\n        ├─ sufficient → Phase 4\n        └─ else ds-router → router.json (add a step | backtrack to step l)\n                 dsstar-plan truncate → ds-planner replans → Coder recodes → dsstar-run\n                 (ds-debugger on exec failure, capped by max_debug_attempts)\n        ▲ a Stop hook (loop_controller) enforces the loop deterministically\n   Phase 4  /ds-finalize → atomically promote outputs/<run>/answer.md\n```\n\nFor **open-ended** questions, `/ds-research` (DS-STAR+) decomposes the query into\nsub-questions, runs the core loop on each in isolated headless sub-runs, and writes a\ncited report.\n\n## The DS-STAR → Claude Code mapping\n\n| DS-STAR agent | Claude Code primitive | Model |\n|---|---|---|\n| Analyzer | subagent `ds-analyzer` (parallel fan-out) | Haiku |\n| Planner | subagent `ds-planner` | Sonnet |\n| Coder | **main session** | Opus |\n| Verifier | subagent `ds-verifier` + `SubagentStop` schema gate | Sonnet |\n| Router | subagent `ds-router` + `Stop` loop gate | Sonnet |\n| Debugger | subagent `ds-debugger` | Sonnet |\n| Generator (DS-STAR+) | subagent `ds-generator` | Sonnet |\n| Finalizer / Writer | skills `/ds-finalize`, `/ds-research` | main session |\n\n## Why it's robust (design invariants)\n\n- **The gate never trusts an LLM-written flag.** `loop_controller` derives whether to\n  continue purely from deterministic artifacts; it never reads the advisory `status`.\n- **Termination is guaranteed by a stall backstop**, not by `iter≥M` — counting\n  *consecutive blocks since iter last advanced*, so a model that forgets to call\n  `advance` still terminates.\n- **Results are captured deterministically.** `dsstar-run` writes the full output to\n  `result.txt`; the verifier reads the whole thing off disk while the session only sees\n  a tail.\n- **Non-`sufficient` termination is never disguised as success.** Finalize marks such\n  answers `unverified` and promotes the best `exec-ok`, highest-score, non-superseded\n  snapshot from history.\n- **One source of truth per fact:** the plan lives only in `plan.md`; `iter`/`status`/\n  `termination_reason` are written only by `dsstar-state`.\n\n## Layout\n\n```\nCLAUDE.md            protocol overview + main-session rules (read this first)\npyproject.toml       uv deps + console_scripts (dsstar-run/plan/state)\nsrc/dsstar/          deterministic helpers (pure stdlib)\n.claude/\n  settings.json      hook registration + permission allowlist\n  skills/            ds-star, ds-plan, ds-finalize, ds-research\n  agents/            ds-analyzer, ds-planner, ds-verifier, ds-router, ds-debugger, ds-generator\n  hooks/             loop_controller.py (Stop), validate_subagent.py (SubagentStop)\n.dsstar/runs/<id>/   internal state (transient, gitignored)\ndata/                read-only inputs\noutputs/<id>/        durable deliverables (answer.md / report.md / solution.py / artifacts)\n```\n\n## Quickstart\n\n```bash\nuv sync                         # set up the isolated environment\ncp your_data.csv data/          # drop inputs into data/\n# then, inside Claude Code:\n/ds-star \"What drives churn in this dataset, and quantify it.\"\n/ds-research \"Give me a full report on the sales trends and their causes.\"\n```\n\n## Setup\n\nRequires [uv](https://docs.astral.sh/uv/) and Claude Code. After `uv sync`, the helper\nCLIs are available via `uv run dsstar-run` / `uv run dsstar-plan` / `uv run dsstar-state`.\nThe `.claude/` directory wires the subagents, skills, and hooks automatically when you\nopen the project in Claude Code.\n\n## License\n\nLicensed under the [Apache License 2.0](LICENSE) © 2026 William Huang.\n\nThis is an independent, clean-room re-implementation inspired by the DS-STAR paper\n([arXiv:2509.21825](https://arxiv.org/abs/2509.21825), CC BY 4.0); it ships no code from\nthe authors and is not affiliated with or endorsed by them.\n\n---\n\n<p align=\"center\"><sub>Inspired by DS-STAR (arXiv:2509.21825). Built for Claude Code.</sub></p>\n"}