agentleFS
jordanl17jordanl17/claude-skill-decision-tree/CLAUDE.md

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.

The file

Files
CLAUDE.md

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's assets/widget-bundled.html. Not shipped directly.
  • skill-src/ - skill source content. Holds the SKILL.md template (with a {{SCHEMA}} placeholder), the JSON schema at skill-src/assets/schema.json, the runtime scripts at skill-src/scripts/ (render.py plus vendored chevron under _vendor/), and the reference docs at skill-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 from widget-src/ and skill-src/. Contains SKILL.md (with the schema injected), assets/widget-bundled.html, assets/schema.json, scripts/render.py, scripts/_vendor/, references/, and LICENSE. Gitignored - regenerated by pnpm build locally and by CI before zipping the release asset. The directory name is derived from package.json (strip the claude-skill- prefix).
  • tests/ - testing docs and eval scaffolding (manual checklists at the top, programmatic suite under tests/evals/)
  • vite.config.ts - Vite + vite-plugin-singlefile config. Reads package.json to derive the skill name, bundles widget-src/* into skill/<skill-name>/assets/widget-bundled.html, and via the assembleSkill plugin assembles the rest: injects the schema into SKILL.md, copies schema.json, recursive-copies skill-src/scripts/ (including vendored chevron) with render.py chmodded executable, copies the references/ folder, and copies LICENSE. Uses terser for JS, lightningcss for CSS. Run with pnpm build.
  • scripts/build-zip.sh - runs pnpm build, then zips the skill/<skill-name>/ folder from within skill/ 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.