Skip to content

Commit b7822a6

Browse files
committed
add comprehensive post content styling and expand better-prs plan with AI code quality warnings
1 parent e52f59c commit b7822a6

File tree

2 files changed

+135
-35
lines changed

2 files changed

+135
-35
lines changed

apps/frontendsupport/src/rehype.css

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,4 +346,111 @@ pre[class*="language-"] > code[class*="language-"] {
346346

347347
.post blockquote, .post blockquote p, .post blockquote span {
348348
color: #ffffff !important;
349+
}
350+
351+
.post-content {
352+
font-family: n8dl580, sans-serif;
353+
font-size: 19px;
354+
font-weight: 300;
355+
line-height: 1.6;
356+
color: rgb(169, 173, 193);
357+
}
358+
359+
@media (min-width: 740px) {
360+
.post-content {
361+
font-size: 25px;
362+
line-height: 30.85px;
363+
}
364+
}
365+
366+
.post-content p {
367+
margin-bottom: 1.5em;
368+
}
369+
370+
.post-content h2 {
371+
font-size: 26px;
372+
line-height: 1.3;
373+
color: #ffffff;
374+
margin-top: 2em;
375+
margin-bottom: 0.75em;
376+
}
377+
378+
.post-content h3 {
379+
font-size: 22px;
380+
line-height: 1.3;
381+
color: #ffffff;
382+
margin-top: 1.75em;
383+
margin-bottom: 0.5em;
384+
}
385+
386+
.post-content h4 {
387+
font-size: 20px;
388+
line-height: 1.3;
389+
color: #ffffff;
390+
margin-top: 1.5em;
391+
margin-bottom: 0.5em;
392+
}
393+
394+
.post-content a {
395+
color: #ffffff;
396+
text-decoration: underline;
397+
}
398+
399+
.post-content a:hover {
400+
color: #fbbf24;
401+
}
402+
403+
.post-content ul,
404+
.post-content ol {
405+
margin-bottom: 1.5em;
406+
padding-left: 1.5em;
407+
}
408+
409+
.post-content li {
410+
margin-bottom: 0.5em;
411+
}
412+
413+
.post-content ul {
414+
list-style-type: disc;
415+
}
416+
417+
.post-content ol {
418+
list-style-type: decimal;
419+
}
420+
421+
.post-content table {
422+
width: 100%;
423+
margin-bottom: 1.5em;
424+
border-collapse: collapse;
425+
}
426+
427+
.post-content th,
428+
.post-content td {
429+
padding: 0.75em 1em;
430+
text-align: left;
431+
border-bottom: 1px solid #374151;
432+
}
433+
434+
.post-content th {
435+
color: #ffffff;
436+
font-weight: 500;
437+
border-bottom: 2px solid #4b5563;
438+
}
439+
440+
.post-content tr:hover {
441+
background-color: rgba(255, 255, 255, 0.05);
442+
}
443+
444+
@media (min-width: 740px) {
445+
.post-content h2 {
446+
font-size: 38px;
447+
}
448+
449+
.post-content h3 {
450+
font-size: 28px;
451+
}
452+
453+
.post-content h4 {
454+
font-size: 24px;
455+
}
349456
}

plans/better-prs.md

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,40 @@
11
# Ground Rules for Better PRs
22

3-
- Instruct the AI to prefer battle-tested open source over creating from scratch
4-
- If not open source, then have we got anything existing in our packages (@intact/component-library, @intact/core, @harbour/core etc.)
5-
- Avoid duplication - reuse existing helpers
6-
- Maintain ownership of the code
7-
- Small focused PRs (max files length) that must be deployable and show something working
3+
- Prefer battle-tested open source over building from scratch
4+
- If no open source, check our packages first (@intact/component-library, @intact/core, @harbour/core)
5+
- Reuse existing helpers. Don't duplicate.
6+
- Don't copy logic to work around complexity. Fix or extend the original.
7+
- Own your code. Be able to explain every line.
8+
- Small focused PRs that deploy and show something working
89

910
## Hold AI to the Same Standards
1011

11-
- AI favours volume over precision and ownership
12-
- You wouldn't accept a 100-file PR from a new dev - don't accept it from AI
13-
- Don't reverse decades of hard-won practices (DRY, small PRs, code ownership) just because AI makes it easy to generate code, these came about because things when wrong
14-
<<<<<<< HEAD
15-
- PR reviews now take forever - too much volume for the eye to take in
16-
=======
17-
- PR reviews could take forever or just ignored - too much volume for the eye to take in
18-
>>>>>>> 3448a362 (add scope to performance scout)
19-
- Open source/existing code has tests, is battle-hardened from real use, and edge cases are already solved - AI code has none of that
12+
- You wouldn't accept a 100-file PR from a new dev. Don't accept it from AI.
13+
- AI favours volume over precision. Reviewers rubber-stamp because they can't review 100 files.
14+
- DRY, small PRs, code ownership exist because we learned what happens without them.
15+
- Open source is tested and battle-hardened. AI code has none of that.
16+
17+
## AI Doesn't Extend, It Recreates
18+
19+
- **Copy-and-diverge**: AI hits complex code, doesn't understand why it's complex, copies what it needs with looser types. Now you have two versions—one tested, one not. They'll drift.
20+
- Recent PR: 800-line duplicated file. GitHub hides large files by default. I missed it first time.
21+
- **NIH on steroids**: AI sees "table with editing" and builds one. It doesn't know material-react-table exists with years of bug fixes already solved.
2022

2123
## Practical Steps
2224

23-
- Write tests first based on acceptance criteria from JIRA stories - gives AI better context
24-
- Use Sonar quality gates to fail PRs that introduce duplication or don't meet standards (analyzes new code only)
25-
- stricter eslint rules
26-
- Use Danger.js to highlight (not block) when basic libraries are used instead of preferred alternatives (e.g. @mui/material table vs material-react-table)
27-
- Sonar/jscpd can detect duplicated functions within the same PR
28-
- Fail/warn on large new files (Danger.js or CI script to flag any new file over X lines)
29-
- Fail/warn if a PR grows an existing file by more than Y lines
30-
<<<<<<< HEAD
31-
- Manually viewing the PR is the last step but still important
32-
=======
33-
- Manually reviewing the PR is the last step but still important
34-
>>>>>>> 3448a362 (add scope to performance scout)
25+
- Tests first, based on JIRA acceptance criteria
26+
- Sonar quality gates: fail PRs that introduce duplication (new code only)
27+
- Danger.js: warn when using basic libraries over preferred alternatives
28+
- Flag new files over X lines, or PRs that grow files by Y+ lines
29+
- Manual review is last step, still essential
3530

36-
## AI Doesn't Extend, It Recreates
31+
## What Happens If We Don't
3732

38-
- When adding to complex existing code, AI errs on the side of caution and recreates everything instead of extending
39-
- Example: DSL-to-react-json-schema-form transformer - adding a new feature resulted in an 800+ line file that recreated all types (weaker), all functions (worse), instead of extending what was there
40-
- Funny side effect: GitHub hides large files by default - I missed the 800 page monster in the PR review initially :)
41-
<<<<<<< HEAD
42-
=======
33+
- You fix a bug in the original. The copy still has it. You don't know the copy exists.
34+
- "AI will know" — AI has no memory between sessions. If you need AI to understand your own code, you've lost.
35+
- Bugs ship that open source fixed years ago
36+
- 2am incident, no one knows where to look
4337

44-
## citations
38+
## Citations
4539

46-
- [SonarSource blog on poor code quality growth in AI-accelerated codebases](https://www.sonarsource.com/blog/the-inevitable-rise-of-poor-code-quality-in-ai-accelerated-codebases)
47-
>>>>>>> 3448a362 (add scope to performance scout)
40+
- [SonarSource: Poor code quality in AI-accelerated codebases](https://www.sonarsource.com/blog/the-inevitable-rise-of-poor-code-quality-in-ai-accelerated-codebases)

0 commit comments

Comments
 (0)