JasonColapietro/suede-creator-skills / skills/suede-graph-flo-xr
suede-graph-flo-xr
VerifiedUse when a consequential multi-file task needs serious compute and independent testing. Run competing design, adversarial review, and QA lanes against one implementation; use Light, Standard, or Deep and return reproducible evidence. Try “Pressure-test two fixes for duplicate bookings.” Compare designs when there is more than one plausible fix; build only one in an isolated worktree. NOT FOR: bulk worker work, existing-diff review, CI setup, or copy-only work.
workflows/helpers/gate-sandbox.cjs
View on GitHub// Auto-extracted from suede-graph-flo-xr.js inline node -e scripts. The splice keeps the
// original -e argv convention: process.argv[1] is the first user argument.
process.argv.splice(1,1);
const {sanitizeGateEnvironment}=require("./gate-environment.cjs");const gateEnvironment=sanitizeGateEnvironment(process.env);for(const name of Object.keys(process.env)){if(!Object.hasOwn(gateEnvironment,name))delete process.env[name]}
const {execFileSync}=require("node:child_process");const fs=require("node:fs"),path=require("node:path"),inputRoot=process.argv[1],inputTemp=process.argv[2],payload=process.argv[3],encodedExtraWrites=process.argv[4],fail=message=>{process.stderr.write(String(message)+"\n");process.exit(1)},root=fs.realpathSync(inputRoot),tempRoot=fs.realpathSync(inputTemp),insideRoot=value=>value===root||value.startsWith(root+path.sep);if(root!==path.resolve(inputRoot)||tempRoot!==path.resolve(inputTemp)||!fs.statSync(root).isDirectory()||!fs.statSync(tempRoot).isDirectory())fail("Gate roots failed realpath validation");let extraWrites;try{extraWrites=JSON.parse(Buffer.from(encodedExtraWrites,"base64").toString("utf8"))}catch{fail("Gate extra-write manifest is invalid")};const safeExtraWrite=value=>{if(typeof value!=="string"||path.resolve(value)!==value||!value.startsWith(root+path.sep)||path.basename(value)!=="build")return false;let parent;try{parent=fs.realpathSync(path.dirname(value))}catch{return false}if(!insideRoot(parent))return false;if(!fs.existsSync(value))return true;const stat=fs.lstatSync(value);return !stat.isSymbolicLink()&&stat.isDirectory()&&insideRoot(fs.realpathSync(value))};if(!Array.isArray(extraWrites)||extraWrites.some(value=>!safeExtraWrite(value)))fail("Gate extra-write roots failed validation");const git=args=>{try{return execFileSync("git",["-C",root,...args],{encoding:"utf8",maxBuffer:8*1024*1024}).trim()}catch(error){fail(error.stderr||error||"git metadata lookup failed")}},top=fs.realpathSync(git(["rev-parse","--show-toplevel"])),commonDir=fs.realpathSync(git(["rev-parse","--path-format=absolute","--git-common-dir"]));if(top!==root||path.basename(commonDir)!==".git"||!fs.statSync(commonDir).isDirectory())fail("Gate Git roots failed validation");const getconf=name=>{try{return execFileSync("/usr/bin/getconf",[name],{encoding:"utf8"}).trim()}catch{return null}};const darwinDirs=["DARWIN_USER_CACHE_DIR","DARWIN_USER_TEMP_DIR"].map(getconf).filter(Boolean).map(value=>{try{return fs.realpathSync(value)}catch{return null}}).filter(Boolean);const psShimLines=["#!/usr/bin/env python3","# suid /bin/ps cannot exec under sandbox-exec; AMFI kills relocated copies too.","# so this shim serves the one invocation shape the pack uses (ps -p PID -o lstart=)","# with real kernel process start times via sysctl. Anything else fails loudly.","import ctypes, struct, sys, time","a = sys.argv[1:]","if len(a) != 4 or a[0] != \"-p\" or a[2] != \"-o\" or a[3] != \"lstart=\":"," sys.exit(1)","try:"," pid = int(a[1])","except ValueError:"," sys.exit(1)","libc = ctypes.CDLL(None, use_errno=True)","mib = (ctypes.c_int * 4)(1, 14, 1, pid)","size = ctypes.c_size_t(0)","if libc.sysctl(mib, 4, None, ctypes.byref(size), None, 0) != 0 or size.value == 0:"," sys.exit(1)","buf = ctypes.create_string_buffer(size.value)","if libc.sysctl(mib, 4, buf, ctypes.byref(size), None, 0) != 0 or size.value == 0:"," sys.exit(1)","tv_sec = struct.unpack_from(\"<q\", buf.raw, 0)[0]","if tv_sec <= 0:"," sys.exit(1)","print(time.strftime(\"%a %b %e %H:%M:%S %Y\", time.localtime(tv_sec)))"];const shimDir=fs.mkdtempSync(path.join(tempRoot,"gate-bin-"));fs.writeFileSync(path.join(shimDir,"ps"),psShimLines.join("\n")+"\n",{mode:0o755,flag:"wx"});const reads=[root,commonDir,"/System","/usr","/usr/local","/bin","/sbin","/Library","/opt/homebrew","/var/select","/private/var/select","/etc","/private/etc","/Applications/Xcode.app",tempRoot].concat(darwinDirs),writes=["node_modules",".next","dist","build",".build","coverage",".cache",".gradle",".swiftpm",".turbo","target",".pytest_cache",".mypy_cache",".ruff_cache","tmp",".tmp","tests/fixtures"].map(name=>path.join(root,name)).concat(extraWrites,[tempRoot],darwinDirs),subpaths=values=>values.map(value=>" (subpath "+JSON.stringify(value)+")").join("\n"),profile="(version 1)\n(deny default)\n(import \"system.sb\")\n(allow process*)\n(allow file-read-metadata)\n(allow sysctl-read)\n(allow file-read*\n"+subpaths(reads)+"\n (literal \"/dev/null\")\n (literal \"/dev/urandom\"))\n(allow file-write*\n"+subpaths(writes)+"\n)\n(deny network*)";try{execFileSync("/usr/bin/sandbox-exec",["-p",profile,"/bin/sh","-c",payload],{stdio:"inherit",env:{...process.env,TMPDIR:tempRoot,TMP:tempRoot,TEMP:tempRoot,HOME:tempRoot,npm_config_cache:tempRoot+"/npm-cache",PATH:shimDir+":"+(process.env.PATH||"/usr/bin:/bin:/usr/sbin:/sbin")}});process.exit(0)}catch(error){if(Number.isInteger(error.status))process.exit(error.status||1);fail(error)}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |