Audit this Go codebase and aggressively simplify AI-generated, defensive, overly abstract, or unnecessarily generic code.
The goal is to make the code look like it was written by an experienced Go engineer:
- simple
- explicit
- strongly typed
- boring
Audit this Go codebase and aggressively simplify AI-generated, defensive, overly abstract, or unnecessarily generic code.
The goal is to make the code look like it was written by an experienced Go engineer:
| name | anti-slop-typescript |
|---|---|
| description | Simplify TypeScript code by removing defensive over-engineering, fake type safety, unnecessary helpers, redundant runtime checks, and abstraction noise. |
Apply these rules whenever modifying TypeScript or JavaScript code.
The goal is simple, readable, strongly typed code that trusts the type system and validates only at real boundaries.
Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:
project-root/
├── cmd/
│ ├── your-app-name/
│ │ ├── main.go # Application entry point
│ │ └── ... # Other application-specific files| import 'dart:ffi'; | |
| import 'dart:io'; | |
| import 'dart:typed_data'; | |
| import 'package:sqlite3/sqlite3.dart'; | |
| import 'package:sqlite3/src/ffi/implementation.dart'; | |
| void main() { | |
| final lib = DynamicLibrary.open('cr-sqlite/core/dist/sqlite3'); | |
| final sqlite3 = FfiSqlite3(lib); |
| # This script also runs on the VPS. | |
| # It handles the bits that require | |
| # root access. | |
| set -e | |
| if [ $(id -u) != 0 ]; then | |
| echo "You're not root" | |
| exit 1 | |
| fi |
| import { useCallback } from "react"; | |
| import { useQueryClient } from "@tanstack/react-query"; | |
| export default function useOptimisticUpdate() { | |
| const queryClient = useQueryClient(); | |
| return useCallback( | |
| async (queryKey, updater) => { | |
| await queryClient.cancelQueries({ queryKey }); |