Skip to content
Development
Command

/affected

Detect which packages in a monorepo are affected by recent changes.

From plugin
rohitg00-claude-code-toolkit
2.8k199 skills138 agents199 commands
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

Command definition

affected.md

Detect which packages in a monorepo are affected by recent changes.

Steps

1. Detect the monorepo tool in use (Turborepo, Nx, Lerna, pnpm workspaces, Cargo workspace). 2. Get the list of changed files since the comparison point:

  • Default: `git diff --name-only origin/main...HEAD`.
  • Or since a specific commit/tag if provided.

3. Map changed files to packages:

  • Read workspace configuration to map directories to packages.
  • For each changed file, determine which package it belongs to.

4. Build the dependency graph:

  • Parse `package.json` (or equivalent) for each package.
  • Map inter-package dependencies.

5. Calculate the full affected set:

  • Direct: packages with changed files.
  • Transitive: packages that depend on directly affected packages.

6. Determine which tasks need to run:

  • Build: affected packages and their dependents.
  • Test: affected packages.
  • Lint: only directly changed packages.

7. Output the affected package list with recommended actions.

Format

Affected Packages (since <comparison>)

Changed files: <N>

Directly affected:
  - @scope/pkg-a (3 files changed)
  - @scope/pkg-b (1 file changed)

Transitively affected:
  - @scope/pkg-c (depends on pkg-a)

Recommended:
  build: @scope/pkg-a @scope/pkg-b @scope/pkg-c
  test:  @scope/pkg-a @scope/pkg-b
  lint:  @scope/pkg-a @scope/pkg-b

Rules

  • Always include transitive dependents in the build affected set.
  • Changes to shared config files (tsconfig, eslint) affect all packages.
  • Changes to root `package.json` or lock files affect all packages.
  • Use the native monorepo tool's affected detection if available.
  • Support filtering by task type (build, test, lint, deploy).
Read more
@rohitg00
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

2.8k40 skills138 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
2.8k
Star history of rohitg00/awesome-claude-code-toolkit on GitHub, a chart by star-history.com

Other commands on rohitg00-claude-code-toolkit.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command