From bc6745a159dbca2a85a1590fe5b1c1edfbccb240 Mon Sep 17 00:00:00 2001 From: Ben Firestone Date: Mon, 11 May 2026 21:55:48 -0700 Subject: [PATCH] feat(code-quality): add --exclude flag to /code-quality:size Let users pass ad-hoc exclusion globs at invocation time without editing repo config. The flag augments (does not replace) the three existing exclusion sources: bundled universal defaults, repo-local .code-quality/size-review-exclude, and .gitattributes linguist-generated=true. - commands/size.md: document the new `/code-quality:size --exclude ` invocation form - skills/size-review/SKILL.md: add invocation-supplied patterns as a fourth exclusion source in the union Useful for one-off local reviews where you want to ignore a vendored or generated directory without modifying tracked config. --- claude-marketplace/plugins/code-quality/commands/size.md | 8 ++++++++ .../plugins/code-quality/skills/size-review/SKILL.md | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/claude-marketplace/plugins/code-quality/commands/size.md b/claude-marketplace/plugins/code-quality/commands/size.md index cfb8ea9..5f63bb2 100644 --- a/claude-marketplace/plugins/code-quality/commands/size.md +++ b/claude-marketplace/plugins/code-quality/commands/size.md @@ -11,6 +11,8 @@ Run the `size-review` skill against the specified target. - `/code-quality:size` -- review the current branch against its base - `/code-quality:size PR` or `/code-quality:size #123` -- review a pull request - `/code-quality:size ` -- review a specific local branch +- `/code-quality:size --exclude ` -- review the scope while + treating the pattern as a CLI-supplied exclusion for size calculations ## Instructions @@ -18,3 +20,9 @@ Invoke the `size-review` skill with the user's specified scope. If no scope is given, default to the current branch against its merge-base with the trunk (`origin/main` or whatever the project's trunk is). Pass any arguments the user provided as the scope for the review. + +If the invocation includes `--exclude `, pass the pattern to the +`size-review` skill as a CLI-supplied exclusion. CLI-supplied exclusions augment +the bundled defaults, repo-local `.code-quality/size-review-exclude`, and +`.gitattributes` generated-file exclusions. Quote patterns containing spaces in +the invocation so the pattern boundary is unambiguous. diff --git a/claude-marketplace/plugins/code-quality/skills/size-review/SKILL.md b/claude-marketplace/plugins/code-quality/skills/size-review/SKILL.md index 758f33c..87d6ef9 100644 --- a/claude-marketplace/plugins/code-quality/skills/size-review/SKILL.md +++ b/claude-marketplace/plugins/code-quality/skills/size-review/SKILL.md @@ -147,7 +147,7 @@ dependencies. Exclude them from the threshold check, the seam analysis, and the file counts. **Report them separately** so reviewers know they were considered (transparency, not silent dropping). -Build the exclusion glob list from up to three sources, in this order: +Build the exclusion glob list from these sources, in this order: 1. **Bundled universal defaults** — read `${CLAUDE_PLUGIN_ROOT}/skills/size-review/references/default-exclusions.md`. @@ -162,6 +162,10 @@ Build the exclusion glob list from up to three sources, in this order: 3. **`.gitattributes` `linguist-generated=true`** — if the repo marks files as generated via the GitHub linguist attribute, honor that. Optional convenience layer. +4. **invocation-supplied `--exclude` patterns** — include every `--exclude ` + passed to the size-review command invocation. These augment the bundled + defaults, repo-local `.code-quality/size-review-exclude`, and `.gitattributes` + generated-file exclusions. After resolving the union of globs, partition the diff file list: