Repository navigation
docs(check): document --rule, and summary-then-rule for large repos #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aibex-agent
merged 2 commits into
main
from
aibex/t_VnQ8sMaJAwaCmnVJkT2HRRAF-check-rule-docs
Nov 30, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@taskless/cli": patch | ||
| --- | ||
|
|
||
| The `check` agent recipe (topic v12) now documents `--rule <id>`, which has existed since 0.11.3: it runs only the named rule, repeats (`--rule a --rule b`), and works with `--json` and `--summary`. For a large repository the recipe gives the order to use: `check --json --summary` to see which rules fired and how often, then `check --json --rule <id>` for one rule's findings, so an agent never has to read or filter every finding to see where one rule fired. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| import { getRecipe } from "../src/prompts/recipes"; | ||
|
|
||
| const check = getRecipe("check"); | ||
| if (check === undefined) throw new Error("no recipe for check"); | ||
|
|
||
| describe("the check recipe", () => { | ||
| it("is topic v12", () => { | ||
| expect(check).toMatch(/^# Topic: check {5}\(CLI v.+ \/ topic v12\)/m); | ||
| }); | ||
|
|
||
| it("lists --rule among its flags", () => { | ||
| const flags = check.slice( | ||
| check.indexOf("## Flags"), | ||
| check.indexOf("## Steps") | ||
| ); | ||
| expect(flags).toContain("- `--rule <id>`:"); | ||
| expect(flags).toContain("repeatable"); | ||
| }); | ||
|
|
||
| it("orders a large repository as summary first, then one rule", () => { | ||
| const summary = check.indexOf("run `check --json --summary` first"); | ||
| const rule = check.indexOf("`check --json --rule <id>`"); | ||
| expect(summary).toBeGreaterThan(-1); | ||
| expect(rule).toBeGreaterThan(summary); | ||
| }); | ||
|
|
||
| it("lists RULE_NOT_FOUND for an unknown --rule id", () => { | ||
| const errors = check.slice(check.indexOf("## Errors")); | ||
| expect(errors).toContain( | ||
| "| `RULE_NOT_FOUND` | a `--rule` id names no rule" | ||
| ); | ||
| }); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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: peropenspec/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 —checkexits 1 and, under--json, reports the standardized error envelope with codeRULE_NOT_FOUNDnaming the id (confirmed inpackages/cli/src/rules/rule-filter.tsand wired throughpackages/cli/src/commands/check.ts).That refusal isn't reflected anywhere else in this file either — the
## Errorstable (lines 155-158) only listsSCAN_FAILEDandINVALID_INPUT, and the## Exit codessection's list of reasons for exit 1 (line 146) doesn't mention an unresolved--ruleid. Every sibling recipe that can raiseRULE_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--ruleto thecheckrecipe 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--ruleis documented.There was a problem hiding this comment.
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_FOUNDrow in the Errors table, and an unknown--ruleid 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.