Skip to content

feat(threejs-network-viz): add render.py CLI and How to run section - #364

Merged
automateyournetwork merged 3 commits into
automateyournetwork:mainfrom
byrn-baker:feat/threejs-viz-cli
Nov 24, 2026
Merged

automateyournetwork merged 3 commits into
automateyournetwork:mainfrom
byrn-baker:feat/threejs-viz-cli

Conversation

@byrn-baker

@byrn-baker byrn-baker commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

threejs-network-viz had no runnable entry point. An agent got modules and natural-language examples, so it had to write its own glue code. In a delegated validation run on an iN2N member, the agent read the skill, never ran anything, and reported the skill's "executable tool" as missing.

This PR adds one command and documents it as a single exec call.

 workspace/skills/threejs-network-viz/
 ├── SKILL.md            # + "How to run" section with the exact exec commands
+├── render.py           # CLI: description or topology JSON in, file path out
 ├── sources.py
 ├── scene_builder.py
 ├── html_template.py
 └── output.py
 tests/unit/
+└── test_threejs_render_cli.py
render.py --describe TEXT | --json FILE|- [--source cml|gns3|...] [--output-dir DIR] [--open]
  snapshot = from_freeform(TEXT) or from_<source>(json)
  html     = render_html(build_scene_payload(snapshot))     # existing pipeline, unchanged
  path     = write_scene(html, snapshot_id)
  stdout: absolute path only, exit 0
  on any error: stderr "threejs-network-viz: error: <reason>", exit 1 (usage errors exit 2)

The browser opens only with --open, so headless members don't try to launch one.

Evidence

  • Before: the member's session called the generic tool-call helper twice with ids that don't exist ("Unknown tool id"), never used exec, and finished with "the executable tool corresponding to this skill was not found".
    After: the command documented in SKILL.md, run from the workspace root:

    $ python3 skills/threejs-network-viz/render.py --describe "R1 is a router, R2 is a router, R1 connects to R2"
    /…/workspace/output/threejs-network-viz/topology-20261123T010930Z-freeform-20261123T010930122600.html
    rc=0
    
  • New tests in tests/unit/test_threejs_render_cli.py (8), run together with the existing freeform, sources and scene-builder unit tests: 29 passed.

    • description in → only the path on stdout
    • a two-node JSON file → HTML contains R1, R2 and Gi0/0
    • JSON on stdin with --source gns3
    • runs from an unrelated working directory
    • invalid JSON, JSON without a devices list, and an empty description → exit 1, empty stdout, no file written
    • no arguments → exit 2
  • Not run: lint (ruff/pyflakes aren't installed in the test environment) and the Playwright browser integration test. The rendering code itself is unchanged.

Merge Danger

Door: two-way

A new file plus documentation. No existing module changes behaviour.

Blast Radius: one-skill

Agents that load this skill will now follow "How to run" and call render.py instead of improvising. Output still lands in the existing gitignored workspace/output/threejs-network-viz/.

🤖 Generated with Claude Code

Maintainer reconciliation (2026-11-24): merged current main including Spec200; regenerated the canonical skill hash and Bash catalog. The CLI/source/freeform/scene tests pass29/29 and catalog parity/metadata pass. This remains the existing Three.js visualization skill; it does not replace Google-generated Spec200 recordings. Final hosted checks gate merge.

byrn-baker and others added 3 commits November 22, 2026 18:13
The skill had no runnable entry point, only modules and natural-language
examples, so an agent had to write its own glue code. A delegated
validation task on an iN2N member failed that way: the agent never ran
anything and reported the skill's tool as missing.

render.py takes a plain-language description (--describe) or topology
JSON (--json FILE|-, --source <kind>), writes the scene through the
existing pipeline, and prints only the absolute path of the HTML file.
Failures go to stderr with a non-zero exit. SKILL.md gains a "How to run"
section with the exact exec commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@automateyournetwork
automateyournetwork merged commit 6ccc79c into automateyournetwork:main Nov 24, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants