Skip to content

[Feature] Code cleanup sweep: dead files, unused deps, stale upstream specs #349

@Astro-Han

Description

@Astro-Han

What task are you trying to do?

Drop accumulated dead code, unused npm dependencies, stale upstream specs, and unused asset files from the repo so the working surface stays small and the install footprint shrinks. None of these block users today, but each adds noise during code search, lengthens bun install, and makes the repo feel "patched" during refactors. Findings come from a knip sweep run on dev branch 2026-04-30; counts and references verified file by file before listing.

What do you do today?

Right now these dead artifacts sit in the repo and cause low-grade friction:

  • packages/app/src/components/dialog-settings.tsx exists with zero references in the codebase. It's dead but typecheck still walks it.
  • Three unused PNGs at packages/ui/src/assets/images/social-share-black.png (32KB, 0 refs), social-share-zen.png (21KB, 0 refs), and social-share.png (14KB, only referenced by og:image / twitter:image meta tags in 4 HTML files which serve no purpose for a desktop Electron renderer that never gets shared as a URL).
  • Two stale upstream spec docs left from the original opencode fork: packages/app/create-effect-simplification-spec.md (19KB, talks about createEffect reactive misuse from the SolidJS migration era, 0 references) and packages/opencode/BUN_SHELL_MIGRATION_PLAN.md (3.6KB, 0 references).
  • Two placeholder npm scripts in root package.json that came from the initial template: random: echo 'Random script' and hello: echo 'Hello World!'.
  • Around 16 unused npm dependencies across packages, including @aws-sdk/client-s3 and heap-snapshot-toolkit at root, @shikijs/transformers / marked / marked-shiki / shiki (an entire markdown-highlight stack) / @solid-primitives/active-element / audio / scroll / websocket / solid-list / diff / virtua in packages/app, @opentelemetry/sdk-trace-node / semver in packages/core, and effect in packages/desktop-electron. Note: tailwindcss looks unused but is a peer of @tailwindcss/vite, do not remove.
  • Three unused catalog entries in root package.json: dompurify, @playwright/test, @solidjs/start.
  • One duplicate export layer | defaultLayer in packages/opencode/src/env/index.ts.
  • @opencode-ai/function package has zero in-repo references and no wrangler.toml / sst.config exists, so deployment status is unclear (active external Cloudflare Worker / dead / placeholder).

What would a good result look like?

Each cleanup is independently shippable as its own commit/PR. After the sweep:

  • bun install finishes faster (fewer unused deps in the lockfile).
  • Code search returns less noise from spec docs and dead files.
  • knip rerun shows substantially fewer findings.
  • @opencode-ai/function package status is documented or the package is removed.

Note: virtua removal is a deliberate non-goal because it is the existing virtualization library that issue #348 (Session view performance) needs, and removing it now means re-installing it during that work.

What would count as done?

Six independent commits / PRs landed:

  1. Drop stale upstream spec docs (create-effect-simplification-spec.md + BUN_SHELL_MIGRATION_PLAN.md).
  2. Drop unused root npm scripts (random + hello).
  3. Drop unused social-share images (3 PNGs + 2 symlinks) and remove the 4 og:image / twitter:image meta tags from packages/app/index.html + packages/desktop-electron/src/renderer/index.html + packages/desktop-electron/src/renderer/loading.html.
  4. Drop unused dialog-settings.tsx.
  5. Remove unused npm dependencies (15 packages across root / app / core / desktop-electron, EXCLUDING virtua which stays for [Feature] UI rewrite v2: replace packages/app + packages/ui with kit-based design #348). May further split per package if the PR feels too wide.
  6. Remove unused catalog entries (dompurify + @playwright/test + @solidjs/start) and consolidate the duplicate layer | defaultLayer export.

After all six land, rerun bunx knip and bun install --frozen-lockfile to verify no regressions.

What should stay out of scope?

Extra context

This sweep was scoped while evaluating the UI rewrite v2 idea (issue #348). The rewrite was deferred for ROI reasons, and this cleanup surfaced as the higher-leverage holiday work because it is small, low-risk, and individually reversible. The @opencode-ai/function question is the only remaining unknown that requires the maintainer's input before action.

Tooling notes for the worker picking this up: run bunx --bun knip --max-issues 500 from the repo root to regenerate the inventory at any point. depcheck is largely a subset of knip output and is not required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priorityappApplication behavior and product flowsenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions