SHALINS428/Codex-drawio-skill / skill/drawio
drawio
VerifiedUse when the user asks to create, edit, rebuild, or refine editable diagrams in `.drawio` / diagrams.net format, especially for academic figures such as system architecture diagrams, technical roadmaps, workflow diagrams, method pipelines, module relationship diagrams, and experiment flowcharts. Use this skill when the user wants publication-ready outputs with both an editable source file and a PNG export, or when an existing figure image needs to be rebuilt into a clean editable academic-style diagram.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.8 KB |
| agents/openai.yaml | config | 319 B |
| references/academic-diagram-style.md | markdown | 4.0 KB |
| references/figure-types.md | markdown | 1.7 KB |
| scripts/export-drawio-png.ps1 | script | 3.8 KB |
| scripts/new-drawio-figure.ps1 | script | 3.6 KB |
scripts/export-drawio-png.ps1
View on GitHubparam(
[Parameter(Mandatory = $true)]
[string]$InputPath,
[string]$OutputPath,
[int]$Scale = 2
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
function Resolve-ExistingFile {
param(
[Parameter(Mandatory = $true)]
[string]$Path
)
$resolved = Resolve-Path -LiteralPath $Path -ErrorAction Stop
return $resolved.Path
}
function Get-DefaultOutputPath {
param(
[Parameter(Mandatory = $true)]
[string]$SourcePath
)
$directory = Split-Path -Parent $SourcePath
$basename = [System.IO.Path]::GetFileNameWithoutExtension($SourcePath)
return Join-Path $directory ($basename + '.png')
}
function Get-DrawioExecutable {
$envCandidates = @(
$env:DRAWIO_EXECUTABLE,
$env:DIAGRAMS_NET_EXECUTABLE
) | Where-Object { $_ }
foreach ($candidate in $envCandidates) {
if (Test-Path -LiteralPath $candidate) {
return (Resolve-Path -LiteralPath $candidate).Path
}
}
$commandCandidates = @(
'draw.io',
'drawio',
'diagrams.net'
)
foreach ($commandName in $commandCandidates) {
$command = Get-Command $commandName -ErrorAction SilentlyContinue
if ($command) {
return $command.Source
}
}
$pathCandidates = @(
'C:\Program Files\draw.io\draw.io.exe',
'C:\Program Files\draw.io\draw.io',
'C:\Program Files\diagrams.net\draw.io.exe',
'C:\Program Files\diagrams.net\draw.io',
'C:\Program Files\diagrams.net\diagrams.net.exe',
'C:\Program Files (x86)\draw.io\draw.io.exe',
'C:\Program Files (x86)\diagrams.net\draw.io.exe',
'C:\Users\' + $env:USERNAME + '\AppData\Local\Programs\draw.io\draw.io.exe',
'C:\Users\' + $env:USERNAME + '\AppData\Local\Programs\diagrams.net\draw.io.exe',
'C:\Users\' + $env:USERNAME + '\AppData\Local\Programs\diagrams.net\diagrams.net.exe'
)
foreach ($candidate in $pathCandidates) {
if (Test-Path -LiteralPath $candidate) {
return (Resolve-Path -LiteralPath $candidate).Path
}
}
throw @"
Could not find a draw.io / diagrams.net desktop executable.
Install diagrams.net desktop, or set one of these environment variables:
- DRAWIO_EXECUTABLE
- DIAGRAMS_NET_EXECUTABLE
Example:
`$env:DRAWIO_EXECUTABLE = 'C:\Program Files\draw.io\draw.io.exe'
"@
}
function Invoke-DrawioExport {
param(
[Parameter(Mandatory = $true)]
[string]$Executable,
[Parameter(Mandatory = $true)]
[string[]]$Arguments
)
& $Executable @Arguments
if ($LASTEXITCODE -ne 0) {
throw "draw.io export failed with exit code $LASTEXITCODE."
}
}
$inputFile = Resolve-ExistingFile -Path $InputPath
$outputFile = if ($OutputPath) { $OutputPath } else { Get-DefaultOutputPath -SourcePath $inputFile }
$outputDirectory = Split-Path -Parent $outputFile
if ($outputDirectory -and -not (Test-Path -LiteralPath $outputDirectory)) {
New-Item -ItemType Directory -Path $outputDirectory -Force | Out-Null
}
$outputFile = [System.IO.Path]::GetFullPath($outputFile)
$exe = Get-DrawioExecutable
$attempts = @(
@('--export', '--format', 'png', '--scale', $Scale.ToString(), '--output', $outputFile, $inputFile),
@('-x', '-f', 'png', '-s', $Scale.ToString(), '-o', $outputFile, $inputFile)
)
$lastError = $null
foreach ($attempt in $attempts) {
try {
Invoke-DrawioExport -Executable $exe -Arguments $attempt
if (-not (Test-Path -LiteralPath $outputFile)) {
throw "draw.io reported success, but the PNG was not created: $outputFile"
}
Write-Output $outputFile
exit 0
} catch {
$lastError = $_
}
}
throw "Unable to export PNG from '$inputFile'. Last error: $($lastError.Exception.Message)"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |