Skip to content

chore(checks): reject new comments, casts and AI-sounding docs - #7652

Merged
benjaminshafii merged 1 commit into
devfrom
chore/habit-lint-rules
Nov 21, 2026
Merged

benjaminshafii merged 1 commit into
devfrom
chore/habit-lint-rules

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

What is this about?

pnpm check and the quick check now reject new comments, any, casts, non-null assertions, suppressions and console.log in TypeScript, and AI-sounding phrasing in markdown.

What problem does it solve?

Agents keep adding narrating comments, casts and slop wording faster than review catches them. Prose rules in AGENTS.md did not stop it; a failing check does.

What was the situation before?

The comment rule only covered apps/app/src. Casts, any and suppressions were discouraged in AGENTS.md but never checked, and docs had no check at all.

How is this implemented?

  • scripts/check-code-habits.mjs: the comment rule covers apps, packages, ee/apps, ee/packages (tests, .d.ts, generated files excluded; directives, #__PURE__, licenses, issue links and exported package API docs kept). New rules: no-new-any, no-new-cast (as const allowed), no-new-non-null, no-new-suppression, no-new-console-log (CLI entry points exempt).
  • scripts/check-prose-habits.mjs: new check on added markdown lines for dashes, AI vocabulary, "serves as", "not just X but Y", chatbot and wordy phrases, curly quotes and filler words. Code blocks, inline code and links are skipped.
  • Both fail only on lines added against the base, so existing code is untouched. Wired into scripts/check.mjs and quick-check.yml.

What else changed?

  • AGENTS.md drops the any/cast line the check now enforces; ARCHITECTURE.md describes the wider rule.
  • The git diff buffer in check-code-habits is raised to 512 MB; a 100-commit diff overflowed 32 MB.

Release note

none

Evidence

No E2E; node --test scripts/check*.test.mjs (51 tests) and pnpm check. Replaying the last 100 dev commits flags about 1,000 comments, 32 TypeScript findings and 40 markdown lines.

Turn pstack's /no-comments, TypeScript and /unslop guidance into checks
that fail only on lines a change adds against origin/dev.

- code-habits: the comment rule now covers TypeScript in apps, packages
  and ee, and new rules reject any, as casts (as const is fine), non-null
  assertions, ts/eslint/biome suppressions and console.log outside
  command-line entry points.
- prose-habits: markdown lines may not add dashes, AI vocabulary,
  "serves as", "not just X but Y", chatbot phrases, wordy phrases, curly
  quotes or filler words. Code, inline code and links are skipped.
- Both run in pnpm check and the quick check workflow. AGENTS.md drops
  the any/cast line the check now enforces.
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Nov 21, 2026 12:47am UTC
openwork-den Ready Ready Preview Nov 21, 2026 12:47am UTC
openwork-landing Ready Ready Preview, v0 Nov 21, 2026 12:47am UTC

Request Review

This branch was successfully deployed

3 active deployments
Preview – openwork-app — b08c0b17 Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-den — b08c0b17 Deployed Nov 21, 2026 by vercel[bot]
Preview – openwork-landing — b08c0b17 Deployed Nov 21, 2026 by vercel[bot]
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.

1 participant