Skip to content

docs(check): document --rule, and summary-then-rule for large repos - #724

Merged
aibex-agent[bot] merged 2 commits into
mainfrom
aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-check-rule-docs
Nov 30, 2026
Merged

aibex-agent[bot] merged 2 commits into
mainfrom
aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-check-rule-docs

Conversation

@aibex-agent

@aibex-agent aibex-agent Bot commented Nov 29, 2026

Copy link
Copy Markdown

What

The check agent recipe now covers --rule <id>, which has existed since 0.11.3 but was never mentioned. It's topic v12 now.

  • Flags: --rule <id> runs only the named rule (its directory name), can be repeated, and works with --json and --summary.
  • Step 3: the large-repository advice now gives an order: check --json --summary to see which rules fired, then check --json --rule <id> for one rule's findings. This replaces the separate --summary paragraph and keeps its warnings (don't count results, and don't read an absent results as clean).

Default output is unchanged. Docs only. The behavior is already specified in cli-check ("Check restricts the run to named rules with --rule"), so this has no OpenSpec change.

Size

The recipe's default output is held to 8 KiB by recipe-sections.test.ts, and check was already near the limit with every situational section on demand. Merging the new advice into the existing paragraph keeps it under. The next addition to check's Steps or Flags will probably need a section moved to on demand.

Checks

test/check-recipe.test.ts pins topic v12, the --rule flag entry, and the summary-then-rule order. pnpm typecheck, pnpm lint and pnpm test (3419 passed) all pass.

Fixes #716

@aibex-agent

aibex-agent Bot commented Nov 29, 2026

Copy link
Copy Markdown
Author

@claude /review

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @aibex-agent[bot]'s task in 1m 46s —— View job


Review complete

Review mode: incremental — read 0 prior review thread(s) before reviewing. .prior-review.json contained no reviews, review threads, or comments other than the triggering @claude /review itself, so there is nothing to carry forward; this is the first review of this PR.

  • Read prior review data (none found — first review)
  • Fetch PR diff and changed files
  • Review packages/cli/src/agent/check.md changes
  • Review new test packages/cli/test/check-recipe.test.ts
  • Review changeset
  • Post final review

Summary

This is a narrowly-scoped docs change (topic v11 → v12) that adds --rule <id> to the check agent recipe's Flags list and replaces the old --summary-only paragraph in Step 3 with a summary-then-rule workflow for large repositories. I verified the documented behavior against the implementation (packages/cli/src/rules/rule-filter.ts, packages/cli/src/commands/check.ts) and the governing spec (openspec/specs/cli-check/spec.md, "Check restricts the run to named rules with --rule") — the claims in the new text (directory-name id, repeatable, works with --json/--summary, the summary-then-rule ordering, the --summary + --json behavior of omitting results) are all accurate. The size-budget concern raised in the PR description checks out: the default-output portion of check.md is ~7.2 KiB against the 8 KiB budget enforced by recipe-sections.test.ts, so it still fits even with the new flag line and the (slightly) longer Step 3 paragraph. The new test file correctly pins the topic version, the flag's presence in the ## Flags block, and the summary-before-rule ordering.

[New] One gap, posted inline on packages/cli/src/agent/check.md:25: the recipe documents --rule <id>'s happy path but not its refusal path. Per the spec, an unresolved --rule id makes check exit 1 and (under --json) emit error code RULE_NOT_FOUND — but neither the ## Errors table nor the ## Exit codes list in this file mentions it, even though this PR is the first time --rule is documented here at all. Every other agent recipe that can raise RULE_NOT_FOUND (delete-rule.md, improve-rule.md, recover-rule.md) lists it in its own Errors table, so this is an inconsistency with established convention rather than a new problem introduced by this diff. Not blocking — the CLI's own error message is self-explanatory — but worth a follow-up row if the byte budget allows it.

No other correctness, security, or test-adequacy issues found in the diff.

- `--summary`: per-rule counts instead of every finding. With `--json`
it omits `results` and keeps `summary`, so the output stays small on
any repository. Use it when the question is "how many", not "where".
- `--rule <id>`: run only the named rule (its directory name);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[New] This flag entry documents the happy path for --rule <id> but not the refusal: per openspec/specs/cli-check/spec.md ("Requirement: Check restricts the run to named rules with --rule"), an id that names no rule directory under any engine is refused — check exits 1 and, under --json, reports the standardized error envelope with code RULE_NOT_FOUND naming the id (confirmed in packages/cli/src/rules/rule-filter.ts and wired through packages/cli/src/commands/check.ts).

That refusal isn't reflected anywhere else in this file either — the ## Errors table (lines 155-158) only lists SCAN_FAILED and INVALID_INPUT, and the ## Exit codes section's list of reasons for exit 1 (line 146) doesn't mention an unresolved --rule id. Every sibling recipe that can raise RULE_NOT_FOUND (delete-rule.md, improve-rule.md, recover-rule.md) lists it in its own Errors table, so this is the one place introducing --rule to the check recipe without the matching error row.

Given the 8 KiB default-output budget this file is already close to, a one-row addition to the Errors table (RULE_NOT_FOUND | unknown `--rule` id | re-check the directory name) would likely fit and bring this recipe in line with the others. Not blocking since the error message itself is self-explanatory, but worth considering before this ships as the only place --rule is documented.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 02bb444: a RULE_NOT_FOUND row in the Errors table, and an unknown --rule id in the exit-1 list. To stay under the 8 KiB default-output budget I tightened two Step 2 sentences without changing what they say. A test pins the new row.

@aibex-agent
aibex-agent Bot merged commit 422600b into main Nov 30, 2026
5 checks passed
@aibex-agent
aibex-agent Bot deleted the aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-check-rule-docs branch November 30, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check recipe: document --rule, and the summary-then-rule order for large repos

1 participant