Skip to content

OffchainLabs/arbitrum-docs / .claude/skills/arbitrum-brand-svg-diagrams

arbitrum-brand-svg-diagrams

Verified

Create or improve lightweight, brand-consistent SVG concept diagrams for the Arbitrum docs, using the official Google Drive infographic asset kit as the palette/style source. Use when asked to "make a diagram more efficient", replace a bloated haw-*.svg (draw.io PNG-in-SVG exports), replace an ASCII / box-drawing diagram in an MDX page with a real image, author a new concept diagram for content/docs/how-arbitrum-works or similar, or build a diagram from the Arbitrum brand assets. Hand-authored lean vector SVG — not Mermaid, not a full Excalidraw/draw.io pipeline.

FileKindSize
SKILL.mdskill md42.6 KB
assets/background.min.svgother44.1 KB
assets/background.svgother78.8 KB
assets/bg-frag.svgother44.0 KB
tools/check_contrast.pyscript4.5 KB
tools/excalidraw_bridge.pyscript8.9 KB
tools/round_arrows.pyscript1.4 KB
tools/test_security.pyscript5.8 KB

tools/test_security.py

View on GitHub
"""Run with python3 test_security.py; all fixtures stay in private temporary directories."""
import contextlib
import io
import math
import os
from pathlib import Path
import tempfile
import types
import unittest
from unittest.mock import patch
import xml.etree.ElementTree as ET


def load(path):
    # Avoid writing __pycache__ into the skills directory.
    module = types.ModuleType(path.stem)
    module.__file__ = str(path)
    exec(compile(path.read_text(), str(path), 'exec'), module.__dict__)
    return module


HERE = Path(__file__).resolve().parent
bridge = load(HERE / 'excalidraw_bridge.py')
contrast = load(HERE / 'check_contrast.py')
video = load(HERE.parents[1] / 'arbitrum-brand-video-explainers/examples/pga-rounds/build.py')


class HelperSecurityTests(unittest.TestCase):
    def element(self, kind='rectangle', **properties):
        return dict(type=kind, x=0, y=0, width=100, height=30, **properties)

    def test_rejects_attribute_and_resource_injection_in_colors(self):
        for kind, field in [('rectangle', 'backgroundColor'), ('arrow', 'strokeColor'), ('text', 'strokeColor')]:
            for payload in ['#fff" data-proof="injected', 'url(https://example.invalid/paint)', '<script/>']:
                with self.subTest(kind=kind, payload=payload), self.assertRaises(ValueError):
                    bridge.excalidraw_to_svg({'elements': [self.element(kind, **{field: payload})]})

    def test_rejects_invalid_numeric_scene_properties(self):
        for field, value in [('x', math.inf), ('y', math.nan), ('width', -1), ('height', '12'), ('fontSize', '16" data-proof="injected')]:
            element = self.element('text')
            element[field] = value
            with self.subTest(field=field), self.assertRaises(ValueError):
                bridge.excalidraw_to_svg({'elements': [element]})
        with self.assertRaises(ValueError):
            bridge.excalidraw_to_svg({'elements': [self.element('arrow', points=[[0, 0], [0, math.inf]])]})

    def test_valid_text_round_trips_without_markup_injection(self):
        label = '<script>& "quoted"'
        svg = bridge.excalidraw_to_svg({'elements': [self.element('text', text=label, strokeColor='#fff')]})
        root = ET.fromstring(svg)
        self.assertEqual(root.find('{http://www.w3.org/2000/svg}text').text, label)
        self.assertIsNone(root.find('{http://www.w3.org/2000/svg}script'))

    def test_contrast_intermediates_are_unique_and_cleaned(self):
        with tempfile.TemporaryDirectory() as work:
            source = Path(work) / 'input.svg'
            source.write_text('<svg/>')
            outputs = []
            def render(svg, png):
                outputs.append(Path(png))
                self.assertEqual(Path(svg).parent, Path(png).parent)
                self.assertEqual(Path(svg).parent.stat().st_mode & 0o077, 0)
            with patch.object(contrast, 'render', render), patch.object(contrast, 'read_ppm', return_value=(1, 1, bytes([255, 255, 255]))), contextlib.redirect_stdout(io.StringIO()):
                self.assertEqual(contrast.main(str(source)), 0)
                self.assertEqual(contrast.main(str(source)), 0)
            self.assertNotEqual(outputs[0].parent, outputs[1].parent)
            self.assertFalse(outputs[0].parent.exists())
            self.assertFalse(outputs[1].parent.exists())

    def test_video_default_directories_are_unique(self):
        with tempfile.TemporaryDirectory() as work, patch.object(video.tempfile, 'tempdir', work), patch.object(video.sys, 'argv', ['build.py']):
            first, second = video._work_dir(), video._work_dir()
            self.assertNotEqual(first, second)
            video._safe_dir(first)
            video._safe_dir(second)

    def test_video_refuses_symlink_and_hardlink_outputs_without_overwrite(self):
        with tempfile.TemporaryDirectory() as work:
            root = Path(work).resolve()
            victim = root / 'sentinel.svg'
            victim.write_text('sentinel')
            link = root / 'probe.svg'
            link.symlink_to(victim)
            with self.assertRaises(OSError):
                video._write_svg(link, '<svg/>')
            hardlink = root / 'hardlink.svg'
            os.link(victim, hardlink)
            with self.assertRaises(ValueError):
                video._write_svg(hardlink, '<svg/>')
            self.assertEqual(victim.read_text(), 'sentinel')
            redirected = root / 'f'
            redirected.symlink_to(root, target_is_directory=True)
            with self.assertRaises(ValueError):
                video._safe_dir(redirected)

    def test_video_cleanup_refuses_redirected_frames_and_preserves_sentinel(self):
        with tempfile.TemporaryDirectory() as work:
            root = Path(work).resolve()
            out = root / 'out'
            out.mkdir()
            victim = root / 'victim'
            victim.mkdir()
            sentinel = victim / 'old.svg'
            sentinel.write_text('sentinel')
            (out / 'f').symlink_to(victim, target_is_directory=True)
            with patch.object(video, '_work_dir', return_value=out), patch.object(video, 'build'), patch.object(video, 'KEYS', []), patch.object(video.sys, 'argv', ['build.py']), contextlib.redirect_stdout(io.StringIO()):
                with self.assertRaises(ValueError):
                    video.main()
            self.assertEqual(sentinel.read_text(), 'sentinel')

    def test_explicit_output_supports_safe_macos_temp_alias(self):
        if not Path('/tmp').is_symlink() or Path('/tmp').resolve() != Path('/private/tmp'):
            self.skipTest('macOS /tmp alias is not present')
        with tempfile.TemporaryDirectory(dir='/tmp') as work:
            aliased = Path('/tmp') / Path(work).name / 'frames'
            self.assertEqual(video._safe_dir(aliased), Path('/private/tmp') / Path(work).name / 'frames')


if __name__ == '__main__':
    unittest.main()
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall