$ show ShuxinYang111/oysterworkflow
OysterWorkflow is an open-core desktop application (Electron + React) that records a user's computer activity via Screenpipe (screen, audio, UI events), then uses multi-stage LLM calls to extract reusable, structured 'skills' (workflow graphs) that AI agents (Codex, Claude, Hermes) can execute. The system provides a full lifecycle: capture → ingest → normalize → segment → LLM-based workflow discovery → skill extraction → workflow graph generation → quality evaluation → installation into agent skill directories → execution via MCP or Hermes CLI. It also includes a cloud sync layer (Supabase), a marketplace (ClawHub), and a local runtime HTTP server for the UI. Architecturally, it is a hybrid monolith with clear module boundaries: a desktop shell (Electron main process), a local runtime server (Express), a CLI (commander), a React UI (Vite + React Flow), and a product state layer (SQLite-backed with cloud sync). The codebase is TypeScript-first, ESM-only, and heavily tested (200+ test files). It demonstrates strong engineering practices: atomic file I/O, bounded child process management, immutable revision control for workflow graphs, and a sophisticated prompt registry with versioned inheritance. While primarily an application, it contains a significant data pipeline component (ingest → normalize → segment → LLM extraction) that could be considered a research-grade feature engineering system. The repo is actively maintained with frequent commits, CI, and issue triage. Notable risks include heavy sidecar bundling (Screenpipe, Hermes, ffmpeg), rapid prompt set version churn, and a mixed licensing model (Apache 2.0 open core + PolyForm Noncommercial for product code).
The LLM identified 5 files worth highlighting for reuse:
Provides atomic JSON file writes using a temporary file, rename, and fsync, with optional schema validation and automatic backup fallback on read. This is a self-contained utility that can be extracted into any Node.js project requiring safe, crash-resistant JSON persistence.
Implements a bounded output tail for child process stdout/stderr, capping accumulated output at 1 MiB and discarding older lines. It uses a ring-buffer-like approach with line-level tracking. Reusable for any application that needs to monitor long-running subprocess output without unbounded memory growth.
Wraps fetch with a configurable deadline and merges an external AbortSignal, ensuring the request is cancelled if either the deadline expires or the caller aborts. Includes a 'settle within' helper for graceful shutdown. A clean, reusable pattern for any Node.js service needing robust HTTP calls with timeout and cancellation.
Provides a cross-platform child process spawner with timeout, SIGTERM escalation to SIGKILL, and Windows tree-kill fallback using taskkill. It also includes force-settle logic to prevent zombie processes. This is a production-grade process lifecycle manager that can be extracted for any Node.js application managing subprocesses.
Implements a polling mechanism that ensures non-overlapping executions: a new poll cycle starts only after the previous one completes, and an invalidation token prevents stale callbacks from updating state. This is a reusable React hook pattern for any UI that needs to poll a backend without race conditions.