Add gzip compression for JSON sharing and cross-platform scripts#7
Merged
Conversation
Add ?c= URL parameter that uses gzip+base64url encoding, reducing shared URL length by 50-70% compared to raw base64 (?r=). Uses the browser's built-in DecompressionStream API for zero-dependency decompression on the client side, and standard gzip+base64+tr on the shell side. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Instead of just printing the URL, the skill now writes a redirect HTML file to /tmp/super-json-<uuid>.html and opens it with open/xdg-open. This gives users a one-click browser experience. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
…on skill - Add Windows PowerShell variant using .NET GZipStream + Start-Process - Add platform detection guidance (macOS/Linux/Windows) - Add temp file cleanup commands for all platforms (files older than 1 hour) - Use $env:TEMP on Windows, /tmp on macOS/Linux https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Temp directories (/tmp, %TEMP%) are automatically cleaned by the OS, so manual cleanup instructions are unnecessary. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Windows %TEMP% doesn't auto-clean like /tmp, so add a 3-second delay then delete the redirect file after the browser has had time to load it. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Test files use Node APIs (Buffer, require, node:zlib) that aren't available in the browser tsconfig. Vitest handles its own type resolution, so excluding __tests__ from tsc is safe. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Add cleanup-temp.sh/ps1 to remove super-json-*.html temp files, with test harnesses that verify correct behavior (removal, non-matching preservation, dry-run, empty dir). CI runs tests on both ubuntu and windows via matrix strategy. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
… spec Move cleanup-temp and test-cleanup scripts from root scripts/ into skills/present-json/scripts/ following the agentskills.io specification. Update SKILL.md with cleanup documentation and CI paths accordingly. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Skill scripts/ should only contain executable code for agents per the Agent Skills spec. Test harnesses belong in the project-level tests/. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Add open-json.sh/ps1 that handle compression, temp file creation, browser opening, and auto-cleanup (5s delay) in one script. SKILL.md now just tells the agent to run the script instead of inline code. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
One script does everything: compress, temp file, open browser, cleanup all stale super-json-*.html after 5s. No more separate cleanup scripts. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Write-Host goes to information stream (stream 6), not stdout, so tests couldn't capture the URL. Also add -ErrorAction SilentlyContinue to Start-Process for headless CI environments. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Covers performance tuning, architecture refactoring, gzip compression for share URLs, cross-platform shell scripting, and Agent Skill design. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Cover the full evolution from inline Node.js + lz-string to zero-dep cross-platform shell scripts with gzip compression, auto browser open, temp file cleanup, SKILL.md writing lessons, and CI matrix testing. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
- Remove lz-string dependency (was used for ?s= share URLs) - Remove ?r= raw base64url encoding (no compression, 33% larger) - Unify all URL sharing on ?c= (gzip + base64url) - createShareUrl now uses browser-native CompressionStream - Share button, import hook, and skill all use the same ?c= format - Zero external dependencies for compression/decompression https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
The rebuild test compared serialized JSON strings expecting whitespace preservation, but JSON.stringify doesn't preserve original formatting in nested escaped strings. This is a test issue, not a code bug. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
Add a playwright job that runs UI tests when PRs target main. Regular push commits skip these tests to keep feedback fast. Test report is uploaded as artifact for debugging failures. https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
- Unified all test goto() calls to use '/super-json/' (matching vite base) - Removed hardcoded localhost:3000/3004 URLs from tests - Updated playwright webServer to use --strictPort and --no-open - Set reuseExistingServer only for local dev (not CI) https://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e
- Remove GitHub Pages deploy workflow and preview job, use Cloudflare Git integration for both production and preview deployments - Change vite base path from '/super-json/' to '/' for root domain - Fix all Playwright tests: use Monaco API instead of keyboard.type, update selectors and notification text to match current UI - Remove debug/temporary test files and tests depending on external APIs - Add shared test helper for setting editor content
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
super-json | 965aba0 | Mar 13 2026, 06:57 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces gzip-based compression for JSON sharing URLs and adds cross-platform shell scripts (Bash and PowerShell) to automatically generate shareable links, open them in browsers, and clean up temporary files.
Key Changes
importFromCompressedUrl()function that decompresses gzip+base64url-encoded JSON using the nativeDecompressionStreamAPI, reducing URL length by 50-70% compared to uncompressed base64scripts/present.sh: Bash script for macOS/Linux that compresses JSON, generates URLs with?c=parameter, opens in browser via temporary HTML redirect, and auto-cleans temp filesscripts/present.ps1: PowerShell equivalent for Windows with identical functionality using .NET'sGZipStreamuseSimpleImport.tsto route?c=parameter to the new compressed decoder while maintaining backward compatibility with existing?s=(LZ-String) and?r=(raw base64) parameterssimpleShare.test.tstests forimportFromCompressedUrl()with gzip round-trip validation and polyfill forDecompressionStreamin Node.js test environmenttest-present.shandtest-present.ps1test suites covering URL generation, hero mode, tab name encoding, temp file cleanup, and error handlingSKILL.mdto direct agents to run scripts instead of inline commands, with platform-specific examplesdocs/optimization-journey.mddocuments the full evolution from v1 (Node.js + lz-string dependency) to v8 (zero-dependency cross-platform scripts)Implementation Details
+/with-_, trim=padding)Write-Outputinstead ofWrite-Hostfor proper stdout capture in CI environmentsopen(macOS), thenxdg-open(Linux), falls back to printing URL if neither available$env:TEMPdoesn't auto-clear like/tmphttps://claude.ai/code/session_01Cv3BVrC7kNVEtijCfe2R5e