Skip to content

feat: Add yarn workspace / yarn monorepo support (Turborepo pattern) #902

Open

Description

@Kseolis

Summary

rtk discover shows yarn workspace as the most frequent unhandled command
in my project — 194 calls in 30 days, more than find (148) or ls (179).
Currently all output goes unfiltered into Claude's context.

Environment

  • Package manager: yarn workspaces (Turborepo monorepo)
  • Project type: TypeScript + Next.js + Fastify + Drizzle ORM
  • RTK version: 0.24.0

Commands from discover output (unhandled)

Command Count Example
yarn workspace 194 yarn workspace api typecheck 2>&1
yarn install 12 yarn install 2>&1
yarn typecheck 2 yarn typecheck 2>&1
yarn test 2 yarn test 2>&1
yarn add 2 yarn add -D husky lint-staged

Why it matters

In a Turborepo monorepo, yarn workspace <name> typecheck 2>&1 produces
large TypeScript compiler traces across multiple packages. Without filtering,
every typecheck dumps full tsc output into context — same problem that
rtk tsc solves for direct npx tsc calls.

Expected savings (based on rtk tsc ~11.7K tokens / 32 calls ratio):
194 yarn calls × ~365 tokens avg = ~70K tokens/month for yarn workspace alone.

Expected behavior

RTK should intercept and filter yarn commands similarly to existing handlers:

# Typecheck — route through rtk tsc filter
yarn workspace api typecheck  →  rtk tsc (errors grouped by file)

# Tests — route through rtk test filter  
yarn workspace api test       →  rtk test (failures only)
yarn test                     →  rtk test (failures only)

# Install — strip progress bars, show only errors
yarn install                  →  rtk err yarn install

# Add packages — compact output
yarn add -D husky             →  show only final installed versions

Workaround (current)

rtk err yarn workspace api typecheck
rtk test yarn workspace api test

Works but requires manual prefix — defeats the purpose of hook-based automation.

Request

  1. Add yarn as a recognized command in rtk rewrite routing
  2. Sub-route yarn workspace <name> typecheck → tsc filter
  3. Sub-route yarn workspace <name> test / yarn test → test filter
  4. Sub-route yarn install / yarn add → err filter (progress bars stripped)

Happy to test a PR — Turborepo + yarn workspaces setup available.

Activity

  1. added
    duplicate
    effort-medium
    enhancement
    on Apr 4, 2026
  2. pszymkowiak commented on Apr 4, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    ✨ Category feature
    🟢 Priority low
    🎯 Confidence 91%

    Summary

    Request to add yarn/yarn workspaces command routing in rtk rewrite; largely addressed by PR #1128 which wires yarn and other package managers.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliduplicateeffort-mediumenhancementhelp wantedpriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions