claude-skill-decision-tree
CLAUDE.md0 starsChanged 6 months agoMITView on GitHub
This repo is the decision-tree Claude skill - a SKILL.md + interactive widget that renders a bounded decision tree (3 levels, 2-4 branches per level) and sends the committed path, annotations, and abandoned siblings back to chat as input for a final artifact. At skill runtime, Claude reads SKILL.md (which embeds the schema), constructs a JSON payload matching that schema, pipes it to python3 ${CLAUDE_SKILL_DIR}/scripts/render.py via stdin (heredoc - never via a temp file or argv), and passes the script's…
In this repositoryOne other file it gives its agents.
- decision-treeSkill
The file
Files
Project notes for Claude Code
This repo is the decision-tree Claude skill - a SKILL.md + interactive widget that renders a bounded decision tree (3 levels, 2-4 branches per level) and sends the committed path, annotations, and abandoned siblings back to chat as input for a final artifact.
Layout
widget-src/- editable widget sources (widget.html,widget.css,widget.ts,globals.d.ts). Bundled by Vite into the built skill'sassets/widget-bundled.html. Not shipped directly.skill-src/- skill source content. Holds theSKILL.mdtemplate (with a{{SCHEMA}}placeholder), the JSON schema atskill-src/assets/schema.json, the runtime scripts atskill-src/scripts/(render.pyplus vendored chevron under_vendor/), and the reference docs atskill-src/references/(EXAMPLES.md,REFERENCE.md,mustache-syntax.md,schema-authoring.md).skill/<skill-name>/- the built skill directory, fully generated by the build pipeline fromwidget-src/andskill-src/. ContainsSKILL.md(with the schema injected),assets/widget-bundled.html,assets/schema.json,scripts/render.py,scripts/_vendor/,references/, andLICENSE. Gitignored - regenerated bypnpm buildlocally and by CI before zipping the release asset. The directory name is derived frompackage.json(strip theclaude-skill-prefix).tests/- testing docs and eval scaffolding (manual checklists at the top, programmatic suite undertests/evals/)vite.config.ts- Vite + vite-plugin-singlefile config. Readspackage.jsonto derive the skill name, bundleswidget-src/*intoskill/<skill-name>/assets/widget-bundled.html, and via theassembleSkillplugin assembles the rest: injects the schema intoSKILL.md, copiesschema.json, recursive-copiesskill-src/scripts/(including vendored chevron) withrender.pychmodded executable, copies thereferences/folder, and copiesLICENSE. Uses terser for JS, lightningcss for CSS. Run withpnpm build.scripts/build-zip.sh- runspnpm build, then zips theskill/<skill-name>/folder from withinskill/so the archive root matches the skill name.package.json/tsconfig.json/pnpm-lock.yaml- Node toolchain (requires Node 20+ and pnpm 10+). Widget JS is authored as strict TypeScript and stripped to JS at build time.
At skill runtime, Claude reads SKILL.md (which embeds the schema), constructs a JSON payload matching that schema, pipes it to python3 ${CLAUDE_SKILL_DIR}/scripts/render.py via stdin (heredoc - never via a temp file or argv), and passes the script's stdout to visualize:show_widget. render.py validates the payload against assets/schema.json, auto-derives <key>_json variants for every top-level key (so the widget can use {{topic}} for HTML and {{{topic_json}}} for JS-string context), and chevron-renders assets/widget-bundled.html. The bundled widget's inline <script id="navigator-data" type="application/json"> tag contains the rendered JSON; widget.ts reads its textContent and JSON.parses it at load.
Before changing the skill, read the testing docs
tests/EVALS.md is the entry point. It explains the test surfaces (Vitest unit/integration, manual trigger walkthrough, programmatic eval suite, description tuning) and which to run based on what you're changing. Do not skip it. Changes to widget-src/ should be backed by Surface 1 (Vitest, runs on every PR). Changes to SKILL.md or parsing rules should be backed by Surface 2 or Surface 3.
Release pipeline
Release Please opens a release PR whenever a feat: or fix: commit lands on main. Merging the PR cuts a tag and uploads decision-tree.zip to the GitHub release. Conventional commit prefixes (feat:, fix:, docs:, chore:) determine the bump.
Widget rendering caveat
The widget renders in claude.ai (web) and Claude Desktop. Claude Code, claude -p (headless CLI), and the Anthropic API cannot invoke visualize:show_widget, which the skill depends on. Any evaluation harness that depends on actual rendering needs to account for this - see tests/EVALS.md for details.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

