sketch-code
Operate SketchCode legacy wireframe-to-HTML workflows: conversion, training data preparation, BLEU evaluation, assets, and TensorFlow/Keras troubleshooting.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- sketch-code
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Operate SketchCode legacy wireframe-to-HTML workflows: conversion, training data preparation, BLEU evaluation, assets, and TensorFlow/Keras troubleshooting.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/environment-and-assets.md4.2 KB
- 参考文档references/repo-provenance.md2.2 KB
- 参考文档references/repo-routing-metadata.json324 B
- 参考文档references/troubleshooting.md3.9 KB
- 脚本scripts/check_sketch_code_environment.py4.6 KB
- 脚本scripts/sketch_code_assets.py3.1 KB
03 SKILL.md 正文
SketchCode
Use this repo skill when the user is working with SketchCode, the legacy proof-of-concept that converts hand-drawn web wireframe PNGs into GUI DSL and compiled HTML using a CNN encoder plus recurrent decoder. It is most useful for task prompts about SketchCode conversion commands, pretrained model assets, paired .png/.gui training data, model training/fine-tuning, and BLEU evaluation.
First checks
- Confirm the task is about SketchCode's historical TensorFlow/Keras code path, not a modern general-purpose vision-language model.
- Check whether the user has a SketchCode runtime checkout/source root or an environment where the
classespackage is importable. The bundled wrappers accept--sketchcode-rootso they do not depend on this skill's source-generation checkout. - Read references/environment-and-assets.md before downloading data/model files or diagnosing install errors.
- Run scripts/check_sketch_code_environment.py when importability, model files, or image preprocessing are in doubt.
- Run scripts/sketch_code_assets.py to print/check expected dataset and pretrained model asset locations without downloading anything.
Route by task
- Use conversion-inference for converting one PNG or a folder of PNGs to
.gui/.html, checking model JSON/weights prerequisites, selectingdefault/facebook/airbnbstyle, or debugging GUI DSL compilation. - Use training-data for validating paired
.png/.guitraining folders, understandingvocabulary.vocab, image preprocessing, destructive train/validation split behavior, model architecture, or guarded training/fine-tuning commands. - Use evaluation for single or batch BLEU scoring of
.guifiles, button-color normalization, prediction trimming, folder pairing behavior, and NLTK/BLEU caveats. - Use references/troubleshooting.md for cross-cutting install/import, external asset, legacy Python, OpenCV/TensorFlow/Keras, network, and source-layout issues.
- Use references/repo-provenance.md before deciding whether this skill is current for another checkout or should be refreshed.
Legacy constraints to preserve
- The repository is script-style and targets old dependencies: Keras
2.1.2, TensorFlow1.4.0, OpenCV3.3.0.10, NumPy1.13.1, and related packages. - There is no packaged console-entry-point metadata; operating workflows historically ran from source scripts. This skill therefore bundles guarded wrappers and validators instead of linking to original source scripts.
- External assets are optional and network-backed: the full synthetic dataset archive is large, and pretrained
model_json.jsonplusweights.h5are required for actual conversion. - Full training can be long-running and deletes/recreates sibling
training_setandvalidation_setfolders under the parent of the raw data directory. Always dry-run or validate before training.
Minimal safe commands
python scripts/sketch_code_assets.py --root "$SKETCHCODE_ROOT"
python scripts/check_sketch_code_environment.py --sketchcode-root "$SKETCHCODE_ROOT"
python sub-skills/training-data/scripts/validate_training_dataset.py "$DATASET_DIR"
python sub-skills/conversion-inference/scripts/compile_tiny_dsl.py --style default
python sub-skills/evaluation/scripts/evaluate_tiny_gui_bleu.py
These helpers are safe by default. They do not download assets, start training, or run model inference unless the user supplies the required runtime paths and explicit command options documented in the sub-skills.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).