/affected
Detect which packages in a monorepo are affected by recent changes.
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/affected
Context preview
What this command does when you run it.
Detect which packages in a monorepo are affected by recent changes.
Command definition
affected.mdDetect 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
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).
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.
Repo: rohitg00/awesome-claude-code-toolkit
Other commands on rohitg00-claude-code-toolkit.
- /adr
Write an Architecture Decision Record documenting a significant technical decision.
Open command - /design-review
Conduct a structured design review of a module, feature, or system component.
Open command - /diagram
Generate Mermaid diagrams from codebase analysis or description.
Open command - /migrate
Plan and execute a framework or library migration incrementally.
Open command - /plan
Create a structured implementation plan for the requested feature or change.
Open command - /refactor
Perform a systematic refactoring of the specified code area.
Open command

