Skip to content

fix: add mandatory mechanical pre-scan to typeset and layout commands#160

Closed
kaushalrog wants to merge 2 commits into
pbakaus:mainfrom
kaushalrog:main
Closed

fix: add mandatory mechanical pre-scan to typeset and layout commands#160
kaushalrog wants to merge 2 commits into
pbakaus:mainfrom
kaushalrog:main

Conversation

@kaushalrog

@kaushalrog kaushalrog commented May 18, 2026

Copy link
Copy Markdown

Resolves #149. Agents running /typeset or /layout now grep for
off-spec values (orphan px font sizes, ad-hoc leading, hard-coded
hex colors, arbitrary spacing) before visual review. This catches
values like 12.5px that slip past LLM visual passes.

Surfaces all hits in the response so the user can decide which to
fix vs. accept as scoped exceptions.


Note

Low Risk
Low risk documentation-only change that adds required pre-review grep checks; the main risk is minor confusion if the regexes or the stray trailing \ in layout.md are incorrect.

Overview
Adds a mandatory “Mechanical Pre-Scan” step to the layout and typeset reference guides, requiring reviewers to run predefined grep commands before visual analysis.

The new pre-scan checks surface off-spec values (e.g., Tailwind arbitrary spacing/typography, orphan opacity/leading, hard-coded px spacing/font sizes, hex colors, and extreme z-index values) and instructs agents to report all matches so users can choose fixes vs. scoped exceptions.

Reviewed by Cursor Bugbot for commit 6e4f27c. Bugbot is set up for automated code reviews on this repo. Configure here.

@kaushalrog kaushalrog requested a review from pbakaus as a code owner May 18, 2026 15:39

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6e4f27c. Configure here.

Comment thread skill/reference/typeset.md
Comment thread skill/reference/typeset.md
Comment thread skill/reference/layout.md
@kaushalrog kaushalrog marked this pull request as draft May 18, 2026 15:58
@kaushalrog kaushalrog marked this pull request as ready for review May 18, 2026 15:58
@pbakaus

pbakaus commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Thanks for this. I agree with the intent: /typeset and /layout need a mechanical preflight so we catch obvious value-level issues before asking the model to do a higher-level design pass.

I don’t think this particular implementation is the right shape to merge, though. The grep commands are brittle, currently have a few regex/shell issues, and are mostly Tailwind-arbitrary-value specific, so they’d miss a lot of the ways these problems show up in real projects.

I think this should move into the detector instead: add a typography-scoped preflight, reuse/extend the existing typography-related detector rules, and have /typeset run that first before doing the full LLM typography review. That also lines up better with #149 and should compose cleanly with the hook work in #170.

I’m going to close this PR in favor of that detector-backed approach, but the underlying idea is definitely valid.

@pbakaus pbakaus closed this Jun 8, 2026
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.

[Bug] Typeset and Layout often need to be run mutliple times to catch basic things

3 participants