Collaboration agreement with bensz-collect-bugs
- When a bug caused by a design flaw in this skill occurs in the user's environment, prioritize using
bensz-collect-bugsto record it according to the specification in~/.bensz-skills/bugs/. It is strictly forbidden to directly modify the source code of the skill already installed in the user's local Claude Code / Codex. - If the AI can still complete the user's task via a workaround, it should first record the bug, then continue completing the current task.
- When the user explicitly requests a public reporting action such as "report bensz skills bugs", call the local
ghandbensz-collect-bugs, and upload only the newly added bug tohuangwb8/bensz-bugs; do not pull / clone the entire bug repository.
Positioning
- Draw mechanism chains, algorithm architectures, module relationships, or experimental loops as editable, embeddable scientific figures.
- By default use
drawioto generatedrawio/pdf/svg/png; only when the user explicitly requests the Nano Banana image model is switching to PNG-only allowed. - For scientific writing and expression optimization only; it does not represent review criteria.
Input
Provide at least one of the following:
spec_file: Structured diagram specification file, preferred.proposal_file: A single proposal file.proposal_path: A proposal directory.
Optional:
roundsrendereroutput_dirconfigstyle_ref_imagescontext: Natural language mechanism description, used by planning mode to generate a drafttemplate_ref
Output
Default deliverables:
schematic.drawioschematic.pdfschematic.svgschematic.png
Hidden intermediate artifacts are written to output_dir/.nsfc-schematic/:
optimization_report.mdspec_latest.yamlconfig_used_best.yamlevaluation_best.jsonruns/run_*/round_*ai/:stop_strategy=ai_criticworkspacelegacy/: storage area for historical remnants
Nano Banana mode delivers only:
schematic.pngschematic_compacted.png
Hard rules
- Before starting, mandatorily read
config.yaml, withrenderer、layout、color_scheme、evaluation、planning、outputas the single source of truth. - By default, only process files or directories explicitly provided by the user; do not fetch materials online.
- By default keep the
drawioworkflow; when the user has not specified it, do not switch to an image model. - For crowding, prioritize changing
spec, do not prioritize reducing font size; only reduce font size when there is an overflow risk. - For color issues, prioritize changing
kindallocation or structure; do not use a black-and-white scheme to cover up structural errors.
Main workflow
1. Planning
- It is recommended to first use "planning → review → generation" on first use.
- By default
planning_mode=ai:plan_schematic.pygenerate a planning request- The host AI produces
schematic-plan.mdandspec_draft.yaml - rerun the script for validity checking
- If the user only provides a natural language description, planning can also be started directly with
--context.
2. Generation
python3 nsfc-schematic/scripts/generate_schematic.py \
--spec-file ./schematic_plan/spec_draft.yaml \
--output-dir ./schematic_output \
--rounds 5
- The process includes: parsing the spec, generating draw.io XML, XML pre-check, rendering, main evaluation, multi-dimensional self-check, and exporting the best round.
- If an explicit
edgesis provided, the renderer must prioritize reproducing it; otherwise automatically connect according tolayout.auto_edges.
3. Evaluation and optimization
- By default, at most 5 rounds; thresholds and stopping strategy only look at
config.yaml:evaluation。 - Each round outputs at least:
evaluation.jsonlayout_debug.jsonedge_debug.jsonmeasurements.jsondimension_measurements.jsoncritique_structure.jsoncritique_visual.jsoncritique_readability.json
4. Optional: AI autonomous closed loop
- Enable when the host AI needs to decide the next round based on the evidence package:
evaluation.stop_strategy: ai_critic。 - The protocol file is located at
.nsfc-schematic/ai/, and mainly includes:ai_critic_request.mdai_critic_response.yamlai_pack_round_XX/
5. Optional: Nano Banana PNG-only (Gemini / OpenAI gpt-image-2)
- Enable only when the user explicitly requests it.
- First perform a connectivity check:
python3 nsfc-schematic/scripts/nano_banana_check.py
-
.envcan switch to OpenAI viaIMAGE_PROVIDER=openai; when not explicitly specified, by default the existingGEMINI_*configuration is preferentially used. -
Then execute PNG-only generation:
python3 nsfc-schematic/scripts/generate_schematic.py \
--renderer nano_banana \
--spec-file ./schematic_plan/spec_draft.yaml \
--output-dir ./schematic_output \
--rounds 5
Common commands
# 规划
python3 nsfc-schematic/scripts/plan_schematic.py --proposal /path/to/proposal --output ./schematic_plan
# 生成
python3 nsfc-schematic/scripts/generate_schematic.py --spec-file ./schematic_plan/spec_draft.yaml --output-dir ./schematic_output --rounds 5
# 连通性检查
python3 nsfc-schematic/scripts/nano_banana_check.py
Reference materials
config.yamlreferences/plan_template.mdreferences/design_principles.mdreferences/models/templates.yamlreferences/spec_examples/