Skip to content

zlsjtj/FigureCraft

scientific-figure-studio

Unverified

FigureCraft 根据科学对象、关系和数据制作科研图与语义配色。适用于机制、硬件、分层材料、定量图及整套配图,交付可编辑图源和分别记录的技术、科学与视觉审阅,保留数值、拓扑和修改范围。

FileKindSize
SKILL.mdskill md8.5 KB
agents/openai.yamlconfig601 B
assets/reference_palettes.jsonconfig11.6 KB
examples/aperture-focus-demo/README.mdmarkdown3.1 KB
examples/aperture-focus-demo/audit/label-load.jsonconfig988 B
examples/aperture-focus-demo/audit/portable-rebuild.jsonconfig1.1 KB
examples/aperture-focus-demo/audit/review-scope.jsonconfig750 B
examples/aperture-focus-demo/audit/semantic-checks.jsonconfig1.5 KB
examples/aperture-focus-demo/brief.mdmarkdown1.4 KB
examples/aperture-focus-demo/caption.mdmarkdown765 B
examples/aperture-focus-demo/exports/baseline/figure.pdfbinary41.1 KB
examples/aperture-focus-demo/exports/baseline/figure.pngbinary47.7 KB
examples/aperture-focus-demo/exports/baseline/figure.svgother3.6 KB
examples/aperture-focus-demo/exports/final/figure.pdfbinary72.4 KB
examples/aperture-focus-demo/exports/final/figure.pngbinary28.0 KB
examples/aperture-focus-demo/exports/final/figure.svgother3.8 KB
examples/aperture-focus-demo/exports/final/figure_deuteranomaly100.pngbinary29.0 KB
examples/aperture-focus-demo/exports/final/figure_grayscale.pngbinary27.4 KB
examples/aperture-focus-demo/exports/first/figure.pdfbinary72.5 KB
examples/aperture-focus-demo/exports/first/figure.pngbinary46.8 KB
examples/aperture-focus-demo/exports/first/figure.svgother4.3 KB
examples/aperture-focus-demo/figure_spec.jsonconfig2.9 KB
examples/aperture-focus-demo/manifest.sha256.jsonconfig2.6 KB
examples/aperture-focus-demo/requirements.txtmanifest61 B
examples/aperture-focus-demo/review.mdmarkdown3.2 KB
examples/aperture-focus-demo/scripts/audit.pyscript3.3 KB
examples/aperture-focus-demo/scripts/rebuild.pyscript10.8 KB
examples/aperture-focus-demo/source/baseline.jsonconfig149 B
examples/aperture-focus-demo/source/final.jsonconfig895 B
examples/aperture-focus-demo/source/first.jsonconfig1.2 KB
examples/assembled-cutaway/README.mdmarkdown3.4 KB
examples/assembled-cutaway/author_geometry.pyscript9.2 KB
examples/assembled-cutaway/author_interface.pyscript8.5 KB
examples/assembled-cutaway/build.pyscript1.7 KB
examples/assembled-cutaway/development-review.jsonconfig1.6 KB
examples/assembled-cutaway/input/implementation.mdmarkdown2.1 KB
examples/assembled-cutaway/scenes/alternative.jsonconfig24.1 KB
examples/assembled-cutaway/scenes/first.jsonconfig21.3 KB
examples/assembled-cutaway/scenes/object-view.jsonconfig25.3 KB
examples/assembled-cutaway/scenes/selected.jsonconfig38.1 KB
examples/assembled-cutaway/views/alternative/figure.pdfbinary42.5 KB
examples/assembled-cutaway/views/alternative/figure.pngbinary86.5 KB
examples/assembled-cutaway/views/alternative/figure.svgother15.1 KB
examples/assembled-cutaway/views/first/figure.pdfbinary42.3 KB
examples/assembled-cutaway/views/first/figure.pngbinary84.6 KB
examples/assembled-cutaway/views/first/figure.svgother13.0 KB
examples/assembled-cutaway/views/object-view/alt.txtmarkdown521 B
examples/assembled-cutaway/views/object-view/caption.txtmarkdown435 B
examples/assembled-cutaway/views/object-view/figure.pdfbinary42.6 KB
examples/assembled-cutaway/views/object-view/figure.pngbinary81.9 KB
examples/assembled-cutaway/views/object-view/figure.svgother14.9 KB
examples/assembled-cutaway/views/object-view/qa-deuteranopia.pngbinary107.8 KB
examples/assembled-cutaway/views/object-view/qa-grayscale.pngbinary98.4 KB
examples/assembled-cutaway/views/selected/alt.txtmarkdown635 B
examples/assembled-cutaway/views/selected/caption.txtmarkdown501 B
examples/assembled-cutaway/views/selected/figure.pdfbinary43.7 KB
examples/assembled-cutaway/views/selected/figure.pngbinary84.4 KB
examples/assembled-cutaway/views/selected/figure.svgother23.4 KB
examples/assembled-cutaway/views/selected/qa-deuteranopia.pngbinary137.8 KB
examples/assembled-cutaway/views/selected/qa-grayscale.pngbinary123.4 KB
examples/bin-latch/README.mdmarkdown2.8 KB
examples/bin-latch/alt_text.txtmarkdown574 B
examples/bin-latch/build_figure.pyscript13.7 KB
examples/bin-latch/caption.txtmarkdown654 B
examples/bin-latch/comparison/new/final/figure.pngbinary107.9 KB
examples/bin-latch/comparison/new/final/figure.svgother9.4 KB
examples/bin-latch/comparison/new/final/manuscript.mdmarkdown9.9 KB
examples/bin-latch/comparison/new/first/figure.pngbinary108.1 KB
examples/bin-latch/comparison/new/first/figure.svgother9.4 KB
examples/bin-latch/comparison/new/first/manuscript.mdmarkdown9.9 KB
examples/bin-latch/comparison/old/final/figure.pngbinary115.3 KB
examples/bin-latch/comparison/old/final/figure.svgother8.1 KB
examples/bin-latch/comparison/old/final/figure/figure.pngbinary115.3 KB
examples/bin-latch/comparison/old/final/manuscript.mdmarkdown9.4 KB
examples/bin-latch/comparison/old/first/figure.pngbinary118.9 KB
examples/bin-latch/comparison/old/first/figure.svgother8.2 KB
examples/bin-latch/comparison/old/first/figure/figure.pngbinary118.9 KB
examples/bin-latch/comparison/old/first/manuscript.mdmarkdown9.4 KB
examples/bin-latch/comparison/plain/final/figure.pngbinary149.9 KB
examples/bin-latch/comparison/plain/final/figure.svgother8.4 KB
examples/bin-latch/comparison/plain/final/manuscript.mdmarkdown10.0 KB
examples/bin-latch/comparison/plain/final/mechanism.svgother8.4 KB
examples/bin-latch/comparison/plain/first/figure.pngbinary149.8 KB
examples/bin-latch/comparison/plain/first/figure.svgother8.4 KB
examples/bin-latch/comparison/plain/first/manuscript.mdmarkdown10.0 KB
examples/bin-latch/comparison/plain/first/mechanism.svgother8.4 KB
examples/bin-latch/figure.pdfbinary126.9 KB
examples/bin-latch/figure.pngbinary112.8 KB
examples/bin-latch/figure.svgother10.7 KB
examples/bin-latch/figure_deuteranopia.pngbinary113.6 KB
examples/bin-latch/figure_grayscale.pngbinary54.4 KB
examples/bin-latch/figure_spec.jsonconfig19.4 KB
examples/bin-latch/input/draft.mdmarkdown6.4 KB
examples/bin-latch/input/implementation_notes.mdmarkdown8.7 KB
examples/bin-latch/input/results.csvother677 B
examples/bin-latch/input/sources_and_limits.mdmarkdown5.6 KB
examples/bin-latch/input/task.mdmarkdown2.8 KB
examples/bin-latch/manuscript.mdmarkdown9.9 KB
examples/bin-latch/requirements.txtmanifest46 B
examples/bin-latch/results.csvother677 B
examples/bin-latch/review-first-look.mdmarkdown7.5 KB
examples/bin-latch/review-followup.mdmarkdown2.3 KB
examples/bin-latch/review-review.mdmarkdown12.8 KB
examples/cable-window/README.mdmarkdown2.4 KB
examples/cable-window/after/figure.pdfbinary44.0 KB
examples/cable-window/after/figure.pngbinary75.1 KB
examples/cable-window/after/figure.svgother8.8 KB
examples/cable-window/before/figure.pdfbinary41.8 KB
examples/cable-window/before/figure.pngbinary100.8 KB
examples/cable-window/before/figure.svgother8.1 KB
examples/cable-window/brief.jsonconfig1.3 KB
examples/cable-window/build_cable_demo.pyscript14.7 KB
examples/cable-window/caption-and-alt.mdmarkdown826 B
examples/cable-window/method-after.mdmarkdown684 B
examples/cable-window/method-before.mdmarkdown717 B
examples/co-wound-editorial/README.mdmarkdown3.7 KB
examples/co-wound-editorial/body.txtmarkdown286 B
examples/co-wound-editorial/build_figure.pyscript7.5 KB
examples/co-wound-editorial/candidates/diagonal-first.pngbinary113.7 KB
examples/co-wound-editorial/candidates/upright.pngbinary102.5 KB
examples/co-wound-editorial/document/clean.docxbinary139.9 KB
examples/co-wound-editorial/document/clean.jsonconfig416 B
examples/co-wound-editorial/document/clean.pdfbinary115.1 KB
examples/co-wound-editorial/document/page-1.pngbinary238.6 KB
examples/co-wound-editorial/selected/alt.txtmarkdown138 B
examples/co-wound-editorial/selected/assembly-roles.pngbinary11.1 KB
examples/co-wound-editorial/selected/assembly.pngbinary125.1 KB
examples/co-wound-editorial/selected/caption.txtmarkdown390 B
examples/co-wound-editorial/selected/detail-roles.pngbinary3.2 KB
examples/co-wound-editorial/selected/detail.pngbinary21.2 KB
examples/co-wound-editorial/selected/deuteranopia-approx.pngbinary107.3 KB
examples/co-wound-editorial/selected/figure.pdfbinary236.1 KB
examples/co-wound-editorial/selected/figure.pngbinary107.4 KB
examples/co-wound-editorial/selected/figure.svgother197.3 KB
examples/co-wound-editorial/selected/grayscale.pngbinary46.8 KB
examples/co-wound-editorial/selected/record.jsonconfig149.3 KB
examples/co-wound-editorial/validation.jsonconfig1.5 KB
examples/co-wound-laminate/README.mdmarkdown3.6 KB
examples/co-wound-laminate/body.txtmarkdown286 B
examples/co-wound-laminate/build_document.pyscript2.5 KB
examples/co-wound-laminate/build_laminate.pyscript9.6 KB
examples/co-wound-laminate/build_laminate_first.pyscript9.6 KB
examples/co-wound-laminate/caption-before.txtmarkdown231 B
examples/co-wound-laminate/caption.txtmarkdown425 B
examples/co-wound-laminate/continuous-v2/assembly-roles.pngbinary9.4 KB
examples/co-wound-laminate/continuous-v2/assembly.pngbinary114.5 KB
examples/co-wound-laminate/continuous-v2/deuteranopia-approx.pngbinary68.3 KB
examples/co-wound-laminate/continuous-v2/figure.pdfbinary193.4 KB
examples/co-wound-laminate/continuous-v2/figure.pngbinary67.3 KB
examples/co-wound-laminate/continuous-v2/figure.svgother157.0 KB
examples/co-wound-laminate/continuous-v2/grayscale.pngbinary30.5 KB
examples/co-wound-laminate/continuous-v2/record.jsonconfig147.5 KB
examples/co-wound-laminate/continuous-v2/tail-detail-roles.pngbinary1022 B
examples/co-wound-laminate/continuous-v2/tail-detail.pngbinary2.2 KB
examples/co-wound-laminate/document/before.docxbinary112.5 KB
examples/co-wound-laminate/document/before.pdfbinary91.5 KB
examples/co-wound-laminate/document/clean.docxbinary102.3 KB
examples/co-wound-laminate/document/clean.pdfbinary89.2 KB
examples/co-wound-laminate/document/review.docxbinary102.3 KB
examples/co-wound-laminate/document/review.pdfbinary89.3 KB
examples/co-wound-laminate/first-continuous/assembly-roles.pngbinary9.6 KB
examples/co-wound-laminate/first-continuous/assembly.pngbinary116.2 KB
examples/co-wound-laminate/first-continuous/deuteranopia-approx.pngbinary80.4 KB
examples/co-wound-laminate/first-continuous/figure.pdfbinary219.0 KB
examples/co-wound-laminate/first-continuous/figure.pngbinary78.6 KB
examples/co-wound-laminate/first-continuous/figure.svgother187.2 KB
examples/co-wound-laminate/first-continuous/grayscale.pngbinary34.3 KB
examples/co-wound-laminate/first-continuous/record.jsonconfig148.8 KB
examples/co-wound-laminate/first-continuous/tail-detail-roles.pngbinary4.2 KB
examples/co-wound-laminate/first-continuous/tail-detail.pngbinary22.8 KB
examples/co-wound-laminate/input.mdmarkdown1.3 KB
examples/co-wound-laminate/section-v2/assembly-roles.pngbinary9.4 KB
examples/co-wound-laminate/section-v2/assembly.pngbinary114.5 KB
examples/co-wound-laminate/section-v2/deuteranopia-approx.pngbinary81.1 KB
examples/co-wound-laminate/section-v2/figure.pdfbinary203.5 KB
examples/co-wound-laminate/section-v2/figure.pngbinary80.0 KB
examples/co-wound-laminate/section-v2/figure.svgother211.4 KB
examples/co-wound-laminate/section-v2/grayscale.pngbinary37.1 KB
examples/co-wound-laminate/section-v2/record.jsonconfig75.5 KB
examples/co-wound-laminate/selected/assembly-roles.pngbinary9.4 KB
examples/co-wound-laminate/selected/assembly.pngbinary114.5 KB
examples/co-wound-laminate/selected/deuteranopia-approx.pngbinary69.2 KB
examples/co-wound-laminate/selected/figure.pdfbinary193.4 KB
examples/co-wound-laminate/selected/figure.pngbinary68.1 KB
examples/co-wound-laminate/selected/figure.svgother157.3 KB
examples/co-wound-laminate/selected/grayscale.pngbinary30.8 KB
examples/co-wound-laminate/selected/record.jsonconfig147.5 KB
examples/co-wound-laminate/selected/tail-detail-roles.pngbinary1022 B
examples/co-wound-laminate/selected/tail-detail.pngbinary2.2 KB
examples/common-reference-demo/README.mdmarkdown2.3 KB
examples/common-reference-demo/alternative/build.pyscript7.4 KB
examples/common-reference-demo/alternative/caption.txtmarkdown453 B
examples/common-reference-demo/alternative/figure.pdfbinary72.6 KB
examples/common-reference-demo/alternative/figure.pngbinary39.9 KB
examples/common-reference-demo/alternative/figure.svgother8.0 KB
examples/common-reference-demo/alternative/figure_spec.jsonconfig17.0 KB
examples/common-reference-demo/caption.txtmarkdown569 B
examples/common-reference-demo/dev/REVIEW.mdmarkdown1.8 KB
examples/common-reference-demo/dev/attempt-01/rows.jsonconfig28.2 KB
examples/common-reference-demo/dev/attempt-01/rows/caption.txtmarkdown529 B

examples/cable-window/build_cable_demo.py

View on GitHub
"""Original two-core cable DEMO. Rebuilds FigureCraft-native editable scenes.

Usage: python build_cable_demo.py --skill-root PATH --font PATH --pdftoppm PATH
       --brief PATH --out NEW_DIRECTORY
All external resources are explicit; existing output is never overwritten.
"""
from pathlib import Path
import argparse, copy, hashlib, json, subprocess, sys

INK = '#23343D'
MUTED = '#465965'

def sha(p):
    return hashlib.sha256(Path(p).read_bytes()).hexdigest()

def save(p, obj):
    p.write_text(json.dumps(obj, ensure_ascii=False, indent=2), encoding='utf-8')

def add(s, ident, kind, **kw):
    s['items'].append(dict(id=ident, type=kind, **kw))

def bind(entity, logical, part='decoration'):
    return dict(entity=entity, logical_id=logical, object_part=part)

def text(s, ident, label, x, y, size=20, align='left'):
    add(s, ident, 'text', text=label, x=x, y=y, size=size,
        align=align, fill=INK, background='#FFFFFF')

def line(s, ident, points, **kw):
    add(s, ident, 'line', points=points, fill='none', stroke=MUTED,
        stroke_width=1.6, **kw)

def gradient(role, y0, y1):
    return dict(kind='linear', x1=0, y1=y0, x2=0, y2=y1,
                stops=[[0, f'@{role}.shadow'], [.19, f'@{role}.highlight'],
                       [.45, f'@{role}.base'], [1, f'@{role}.shadow']])

def capsule(x0, x1, y0, y1, rx):
    return [['M', x0, y0], ['L', x1, y0],
            ['C', x1+rx, y0, x1+rx, y1, x1, y1], ['L', x0, y1],
            ['C', x0-rx, y1, x0-rx, y0, x0, y0], ['Z']]

def make_base(name, briefpath):
    return dict(schema_version=1, figure_id='two_core_cable_DEMO_'+name,
      mode='new_schematic', demo=True,
      evidence_status='Original constructed DEMO; no measured cable or experiment',
      scientific_message='Opening only the outer sheath reveals two intact individual insulation layers.',
      source_refs=[dict(path=str(briefpath.resolve()),sha256=sha(briefpath),
                       kind='User-provided facts frozen for this original DEMO')],
      forbidden_implications=['No third core, shield, twist, current or load',
        'No leakage, thermal, safety, efficiency, performance or innovation evidence',
        'The end section repeats the same cable, not an additional cable',
        'No physical proportions or material properties encoded'],
      entities=[
        dict(id='cable', semantic_role='assembly', description='One two-core cable assembly'),
        dict(id='sheath', semantic_role='sheath', description='One common outer sheath with one local opening'),
        dict(id='insulation', semantic_role='polymer_insulation', description='Two separate intact polymer insulation layers'),
        dict(id='conductors', semantic_role='copper', description='Exactly two copper conductors, hidden in the window'),
        dict(id='section_view', semantic_role='repeated_view', description='End-section diagram of the same cable')],
      relations=[
        dict(id='contains_pair', **{'from':'sheath','to':'insulation'}, kind='containment',
             meaning='The same common sheath surrounds both individual insulation layers'),
        dict(id='individual_wrap', **{'from':'insulation','to':'conductors'}, kind='containment',
             meaning='Each copper conductor has its own separate polymer insulation layer'),
        dict(id='same_cable_view', **{'from':'cable','to':'section_view'}, kind='detail',
             meaning='The end section repeats the same cable; it is not the window or a second specimen',
             arrow_required=False)],
      exact_labels=[],
      locked_values=dict(cables=1, copper_conductors=2, individual_polymer_layers=2,
        common_outer_sheaths=1, local_windows=1, copper_visible_in_window=False,
        insulation_cut_in_window=False, sheath_only_removed=True,
        shield=False, twist=False, third_core=False, current_or_load=False,
        dimensions_and_colors='schematic, not physical measurements'),
      count_constraints=[
        dict(name='outer_sheath', expected=1, scope=dict(entity='sheath'), expected_logical_ids=['S']),
        dict(name='individual_insulation', expected=2, scope=dict(entity='insulation'), expected_logical_ids=['I1','I2']),
        dict(name='copper_conductors', expected=2, scope=dict(entity='conductors'), expected_logical_ids=['C1','C2'])],
      reference_palette='blue_teal_peach',
      role_map=dict(sheath=dict(base='#657985'), cut_edge=dict(base='#B8C4CA'),
        insulation_1=dict(swatch='sky_blue'), insulation_2=dict(swatch='cream'),
        copper=dict(base='#B87443')),
      layout=dict(archetype='window_and_same_object_end_section',
        reading_order='window_then_individual_layers_then_common_sheath' if name=='after' else 'layer_inventory_then_window'),
      depth=dict(mode='D1_shallow_2_5d' if name=='after' else 'D0', affects_quantitative_encoding=False),
      edit_scope=dict(allowed=['Original construction, layout, wording and schematic shades'],
        protected=['Frozen user facts, counts and evidence boundaries']),
      publication=dict(target_journal=None, eligibility='unverified'),
      output=dict(width_mm=160, placement_width_mm=160, view_width=900,
        view_height=380, font_profile='Arial; 10.08 pt main labels; 9.07 pt section qualifier'),
      items=[dict(id='canvas', type='rect', x=0,y=0,w=900,h=380,fill='#FFFFFF')],
      caption='Original DEMO of one two-core cable. The local window removes only the common outer sheath; both polymer insulation layers and both copper conductors remain uncut there. The end-section diagram repeats this same cable to show one copper conductor inside each separate insulation layer, with both enclosed by the common sheath. It is not the opened window. Colors, shapes and proportions are schematic, not measurements. No shield, twist, third core, load or current direction is represented.',
      alt_text='A local opening in one common cable sheath reveals two parallel, smooth insulation surfaces. Copper is not exposed in the window. A separately identified end section of the same cable shows exactly two copper circles, each nested within its own insulation, together inside one sheath.')

def window(s, x0, x1, y0, y1, cut0, cut1, deep):
    """A local SHEATH opening, not a cut through the insulated cores.
    Two uninterrupted side surfaces traverse the window and disappear beneath
    the unremoved jacket. No conductor face is drawn in this function.
    """
    common=bind('sheath','S','primary')
    add(s, 'sheath-body','path',commands=capsule(x0,x1,y0,y1,22),
        fill='@sheath.base',stroke='@sheath.stroke',stroke_width=1.7,
        **({'fill_gradient':gradient('sheath',y0,y1)} if deep else {}), **common)
    wy0=y0+15;wy1=y1-15
    add(s,'window-interior','rect',x=cut0,y=wy0,w=cut1-cut0,h=wy1-wy0,
        radius=6,fill='#253840', **bind('sheath','S'))
    r=(wy1-wy0-20)/4
    centers=[wy0+4+r,wy1-4-r]
    for i,cy in enumerate(centers,1):
        role=f'insulation_{i}'
        add(s,f'window-insulation-{i}','rect',x=cut0,y=cy-r,w=cut1-cut0,h=2*r,
            fill=f'@{role}.base',stroke=f'@{role}.stroke',stroke_width=1,
            **({'fill_gradient':gradient(role,cy-r,cy+r)} if deep else {}),
            **bind('insulation',f'I{i}','primary'))
    # Cut-edge rim is sheath material; it overlays rod ends to communicate
    # that the intact insulated cores continue under the remaining jacket.
    for edge,x in [('left',cut0),('right',cut1-5)]:
        add(s,'window-rim-'+edge,'rect',x=x,y=wy0,w=5,h=wy1-wy0,
            fill='@cut_edge.base',stroke='@sheath.stroke',stroke_width=.7,
            **bind('sheath','S'))
    line(s,'window-rim-top',[[cut0,wy0],[cut1,wy0]],**bind('sheath','S'))
    add(s,'window-rim-bottom','line',points=[[cut0,wy1],[cut1,wy1]],
        stroke='@cut_edge.highlight',stroke_width=3,**bind('sheath','S'))
    if deep:
        add(s,'sheath-high-edge','path',commands=[['M',x0,y0+5],['L',x1,y0+5]],
            fill='none',stroke='@sheath.highlight',stroke_width=1.2,**bind('sheath','S'))
    return centers,wy0,wy1

def section(s,x,y,rx,ry,r):
    """Flat end section; decorative shading is deliberately absent on cut faces."""
    add(s,'same-cable-sheath-section','ellipse',x=x,y=y,rx=rx,ry=ry,
        fill='@sheath.base',stroke='@sheath.stroke',stroke_width=1.6,
        **bind('sheath','S','detail'))
    add(s,'same-cable-interior-section','ellipse',x=x,y=y,rx=rx-9,ry=ry-10,
        fill='#FFFFFF',stroke='@sheath.stroke',stroke_width=1,
        **bind('sheath','S','detail'))
    cy=[y-r-3,y+r+3]
    for i,yy in enumerate(cy,1):
        role=f'insulation_{i}'
        add(s,f'same-cable-insulation-section-{i}','circle',x=x,y=yy,r=r,
            fill=f'@{role}.base',stroke=f'@{role}.stroke',stroke_width=1.3,
            **bind('insulation',f'I{i}','detail'))
        add(s,f'copper-section-{i}','circle',x=x,y=yy,r=r*.49,
            fill='@copper.base',stroke='@copper.stroke',stroke_width=1.4,
            **bind('conductors',f'C{i}','primary'))
    return cy

def before(brief):
    s=make_base('before',brief)
    text(s,'title','Two-core cable structure',26,33,22)
    section(s,136,151,49,83,29)
    text(s,'same-view','Same cable: end section',30,258,18)
    line(s,'sheath-label-line',[[168,89],[231,76],[259,76]])
    text(s,'sheath-label','Common outer sheath',269,83)
    line(s,'ins-label-line',[[162,118],[233,118],[259,123]])
    line(s,'ins-label-line-2',[[162,186],[225,186],[259,123]])
    text(s,'ins-label','Two separate polymer insulation layers',269,130)
    line(s,'copper-label-line',[[148,119],[206,159],[259,171]])
    line(s,'copper-label-line-2',[[148,183],[206,192],[259,171]])
    text(s,'copper-label','Two copper conductors',269,178)
    centers,y0,y1=window(s,349,813,237,346,478,707,False)
    text(s,'window-title','Local window: outer sheath removed',340,220)
    line(s,'window-top-label-line',[[618,224],[618,y0]])
    text(s,'intact-label','Both inner layers remain intact',343,374)
    text(s,'demo','DEMO',26,370,18)
    s['exact_labels']=[x['text'] for x in s['items'] if x['type']=='text']
    return s

def after(brief):
    s=make_base('after',brief)
    s['layout']['archetype']='integrated_window_and_same_cable_end_section'
    s['caption']='Original DEMO of one two-core cable. The local window removes only the common outer sheath; both polymer insulation layers and both copper conductors remain uncut there. The end-section representation at the right shows the same cable: one copper conductor inside each separate insulation layer, with both enclosed by the common sheath. Copper is shown at this sectional end, not at the local window. Colors, shapes and proportions are schematic, not measurements. No shield, twist, third core, load or current direction is represented.'
    text(s,'opening-title','Sheath-only window',350,52,22,align='center')
    text(s,'demo','DEMO',26,28,18)
    centers,y0,y1=window(s,55,713,110,290,170,557,True)
    line(s,'opening-leader',[[350,64],[350,y0]])
    text(s,'outer-label','Common outer sheath',137,331,20,align='center')
    line(s,'outer-leader',[[137,313],[137,292]])
    text(s,'intact-label','Intact polymer insulation',428,331,20,align='center')
    # The repeated section is integrated into the cable end. All faces retain
    # the exact logical IDs of this cable, with flat (not rounded) copper faces.
    text(s,'section-name','End section',719,52,20,align='center')
    text(s,'same-cable','same cable',719,78,18,align='center')
    add(s,'same-cable-sheath-section','ellipse',x=713,y=200,rx=44,ry=90,
        fill='@sheath.base',stroke='@sheath.stroke',stroke_width=1.6,
        **bind('sheath','S','detail'))
    add(s,'same-cable-interior-section','ellipse',x=713,y=200,rx=37,ry=80,
        fill='#FFFFFF',stroke='@sheath.stroke',stroke_width=1,
        **bind('sheath','S','detail'))
    for i,yy in enumerate(centers,1):
        role=f'insulation_{i}'
        add(s,f'same-cable-insulation-section-{i}','ellipse',x=713,y=yy,rx=18,ry=32.5,
            fill=f'@{role}.base',stroke=f'@{role}.stroke',stroke_width=1.3,
            **bind('insulation',f'I{i}','detail'))
        add(s,f'copper-section-{i}','ellipse',x=713,y=yy,rx=8.82,ry=15.925,
            fill='@copper.base',stroke='@copper.stroke',stroke_width=1.3,
            **bind('conductors',f'C{i}','primary'))
    text(s,'copper-label','Copper',818,207,20,align='center')
    line(s,'copper-leader-1',[[790,182],[771,centers[0]],[721,centers[0]]])
    line(s,'copper-leader-2',[[790,218],[771,centers[1]],[721,centers[1]]])
    text(s,'pair-label','Two conductors',716,331,20,align='center')
    s['exact_labels']=[x['text'] for x in s['items'] if x['type']=='text']
    return s

def run(cmd, receipt):
    p=subprocess.run([str(x) for x in cmd],capture_output=True,text=True,
                     encoding='utf-8',errors='replace')
    receipt.append(dict(command=[str(x) for x in cmd],exit_code=p.returncode,
                        stdout=p.stdout,stderr=p.stderr))
    return p.returncode

def main():
    ap=argparse.ArgumentParser(description=__doc__)
    for arg in ['skill-root','font','pdftoppm','brief','out']:
        ap.add_argument('--'+arg,type=Path,required=True)
    a=ap.parse_args()
    if a.out.exists():
        ap.error('Output exists; choose a new directory')
    for p in [a.skill_root/'scripts/render_figure.py',a.font,a.pdftoppm,a.brief]:
        if not p.is_file():ap.error('Missing dependency: '+str(p))
    a.out.mkdir(parents=True)
    receipt=[]
    for name,fn in [('before',before),('after',after)]:
        spec=fn(a.brief)
        save(a.out/(name+'.json'),spec)
        code=run([sys.executable,a.skill_root/'scripts/render_figure.py',
            a.out/(name+'.json'),'--out',a.out/name,'--font',a.font,
            '--pdftoppm',a.pdftoppm,'--placement-width-mm','160','--qa-views'],receipt)
        if code:print(f'{name} render/check exit {code}; retained for review')
    run([sys.executable,a.skill_root/'scripts/compare_designs.py',
         '--baseline',a.out/'before/figure.svg','--candidate',a.out/'after/figure.svg',
         '--placement-width-mm','160','--out',a.out/'comparison'],receipt)
    run([sys.executable,a.skill_root/'scripts/measure_label_load.py',
         a.out/'before/figure.svg','--width-mm','160','--out',a.out/'before/label-load.json'],receipt)
    run([sys.executable,a.skill_root/'scripts/measure_label_load.py',
         a.out/'after/figure.svg','--width-mm','160','--out',a.out/'after/label-load.json'],receipt)
    save(a.out/'commands.json',receipt)
    save(a.out/'build_inputs.json',dict(script_sha256=sha(Path(__file__)),
        skill_root=str(a.skill_root.resolve()),font=dict(path=str(a.font),sha256=sha(a.font)),
        pdftoppm=dict(path=str(a.pdftoppm),sha256=sha(a.pdftoppm)),
        brief=dict(path=str(a.brief.resolve()),sha256=sha(a.brief)),
        dimensions_mm=[160,380/900*160]))
    print(json.dumps(dict(out=str(a.out),commands=len(receipt)),ensure_ascii=False))
    return 0 if all(item['exit_code']==0 for item in receipt) else 1

if __name__=='__main__':raise SystemExit(main())
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall