Skip to content

refactor(skills): replace curl/unzip subprocesses with fetch + fflate - #809

Merged
gewenyu99 merged 1 commit into
mainfrom
posthog-code/skill-install-fflate
Jul 7, 2026
Merged

gewenyu99 merged 1 commit into
mainfrom
posthog-code/skill-install-fflate

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Jul 6, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #808.

Skill installs used curl and unzip from the shell. Some machines don't have them, so installs failed. Now we use Node's built-in fetch and the fflate library. No shell tools needed.

Changes:

  • Download the skill zip with fetch instead of curl.
  • Unzip in-process with fflate instead of unzip, tar, or PowerShell.
  • Reject zip entries that point outside the skill folder (zip-slip).
  • Remove the temp file and skillTmpPath. No temp file needed now.
  • downloadSkill is now async. Callers updated.
  • New tests for extraction and zip-slip.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci mcp-analytics
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/cicd-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-nested-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-single-stage-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-gitlab-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-monorepo-pnpm-node-react
  • /wizard-ci error-tracking-upload-source-maps/cicd-monorepo-raw-node-react
  • /wizard-ci error-tracking-upload-source-maps/cicd-ssh-vps-node-raw
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

Base automatically changed from posthog-code/skill-install-windows-fallback to main July 6, 2026 21:39
Skill install no longer depends on platform binaries at all: download via
built-in fetch (30s abort), extract in-process with fflate. Entries are
checked against the destination root (zip-slip) — the containment the shell
tools provided for free. No temp file anymore, so skillTmpPath and the
extraction fallback chain from the previous commits are gone; downloadSkill
becomes async (callers updated).

Generated-By: PostHog Code
Task-Id: bcb96bcb-e37f-421d-841d-738647c73b8e
@gewenyu99
gewenyu99 force-pushed the posthog-code/skill-install-fflate branch from bcb8c6a to 55b29d0 Compare July 7, 2026 13:40
@gewenyu99
gewenyu99 marked this pull request as ready for review July 7, 2026 13:40
@gewenyu99
gewenyu99 enabled auto-merge (squash) July 7, 2026 13:41
@gewenyu99
gewenyu99 merged commit 9be4031 into main Jul 7, 2026
16 checks passed
@gewenyu99
gewenyu99 deleted the posthog-code/skill-install-fflate branch July 7, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace subprocess curl/unzip in skill install with a Node library

2 participants