rtk-ai/rtk

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

Open

#902 aberto em 28 de mar. de 2026

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Rust (2.914 forks)batch import
area:cliduplicateeffort-mediumenhancementhelp wantedpriority:low

Métricas do repositório

Stars
 (48.085 stars)
Métricas de merge de PR
 (Mesclagem média 11d 1h) (45 fundiu PRs em 30d)

Description

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.

Guia do colaborador