Files
orangecat/scripts/docs-slop-scan.js
CatoandClaude Opus 5.5 24c3d140ae docs: archive point-in-time records, fix live docs against the tree (#1349)
* docs: archive point-in-time records, drop broken guide symlinks

Status reports, progress trackers, audits, session summaries, completed
migration plans and the 2025 roadmap move to docs/archive/ (same relative
path), with a README saying they describe the day they were written.
.ai-guides/ held only symlinks into a docs/guides/ai/ that no longer
exists, tests/unit/docs/ held a stray copy of an old getting-started page,
and docs/operations/PORT_MANAGEMENT_README.md duplicated port-management.md;
all three are deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

* docs: correct drifted paths, links and versions in current docs

Fix in place the reference docs agents use: point paths at where the code
lives now (src/stores/auth.ts, src/lib/supabase/*, scripts/dev/*,
docs/reference/api/CONVENTIONS.md, the squashed baseline migration),
rewrite the development, features, operations and API index pages to list
documents that exist, say plainly where something is gone (/api/metrics,
the CSP report route, .envrc in the repo, Loki's `migrate` script), and
correct the Next.js major. docs-truth findings: 468 -> 2 (both "Next 30/90
Days" headings in the legal overview, a checker false positive).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJkbo18cRNXtgPWZN2S9cD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:09:06 +02:00

76 lines
2.2 KiB
JavaScript

#!/usr/bin/env node
/*
docs-slop-scan.js
Scans production code (src/, app/) for sloppy placeholder phrases.
Why src/ + app/ only: docs/ legitimately contains "TODO" (in
archived roadmap status markers, TASK_QUEUE.md, etc.) and
"TBD" (sprint planning), which are intentional authoring, not slop.
This script's job is to catch slop that would ship to a USER —
lorem-ipsum copy, lazy "TBD" labels, half-written feature stubs.
Why these specific phrases (and not others):
- "lorem ipsum" — never legitimately shipped
- "tbd" / "todo" / "wip" / "work in progress" — productionised
laziness when in src code
- "beta only" — usually a planning artifact, shouldn't ship
Phrases deliberately NOT scanned:
- "placeholder" — matches React `placeholder` attrs, type
fields, and Tailwind `placeholder:` variant
classes everywhere. Way too coarse.
- "coming soon" — OrangeCat literally has a /coming-soon page
and a COMING_SOON config constant. The phrase
is a feature name in this codebase, not slop.
*/
const { glob } = require('glob');
const fs = require('fs');
const PHRASES = [
/tbd/i,
/\btodo\b/i,
/\bwip\b/i,
/work in progress/i,
/lorem ipsum/i,
/beta only/i,
];
async function main() {
const patterns = ['src/**/*.{ts,tsx,md}', 'app/**/*.{ts,tsx,md}'];
const files = (
await Promise.all(
patterns.map(p =>
glob(p, { ignore: ['**/node_modules/**', '**/.next/**', '**/__tests__/**', '.claude/**'] })
)
)
).flat();
let violations = [];
for (const file of files) {
const text = fs.readFileSync(file, 'utf8');
const lines = text.split(/\r?\n/);
lines.forEach((line, idx) => {
PHRASES.forEach(rx => {
if (rx.test(line)) {
violations.push({ file, line: idx + 1, text: line.trim() });
}
});
});
}
if (violations.length) {
console.log('Slop phrases found:');
violations.slice(0, 100).forEach(v => console.log(`- ${v.file}:${v.line} ${v.text}`));
process.exitCode = 1;
} else {
console.log('No slop phrases found.');
}
}
main().catch(err => {
console.error(err);
process.exitCode = 1;
});