anti-slop · diff
git:20260911.4e0e4b5 to git:20260911.16cf003
75 added, 265 removed. Audit A to A.
---
name: anti-slop
- description: "Comprehensive Anti-AI Slop enforcement guide. Eliminates conversational pleasantries, placeholder code, truncated implementations, hallucinated packages, speculative over-engineering, and decorative comments / Panduan penegakan anti-AI slop komprehensif. Menghapus basa-basi AI, placeholder code, implementasi terpotong, paket halusinasi, dan komentar dekoratif."
+ description: "Comprehensive Anti-AI Slop enforcement guide. Updated to include token efficiency and code gardening / Panduan penegakan anti-AI slop komprehensif. Diperbarui dengan efisiensi token dan perawatan kode."
author: "Roedy Rustam"
---
- # Anti-Slop Protocol & Quality Gate (2026 Edition)
+ # Anti-Slop, Token Efficiency & Code Gardening Protocol (2026 Edition)
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
---
<a name="english"></a>
## English
- ### Description
- The absolute zero-tolerance standard against AI slop in code generation, conversational interaction, architectural design, and documentation. AI slop manifests as lazy code truncation, filler pleasantries, speculative over-engineering, decorative comments narrating syntax, and vague buzzword-bloated documents. This skill enforces rigorous, deterministic anti-slop rules across the entire engineering lifecycle.
-
- ### Trigger Conditions
- - Any code generation or modification task.
- - Automated code reviews, PR audits, and pre-commit checks.
- - Codebase exhibiting "AI smell" — placeholder comments, unnecessary abstraction layers, duplicate guards, or syntax narration.
- - When configuring AI coding assistants to operate in strict, token-efficient, production-grade mode.
+ ### Description & Trigger Conditions
+ The absolute zero-tolerance standard against AI slop, bloated context, and architectural decay. AI slop manifests as conversational pleasantries, lazy placeholders, speculative over-engineering, decorative comments, and vague buzzwords. This skill enforces rigorous anti-slop rules, token-saving compression, and code gardening across the engineering lifecycle.
+ Triggers: Any code generation/modification, automated reviews, long-running sessions, explicit "be concise/minimal" requests, or when a codebase exhibits "AI smell" (inconsistencies, duplication, dead code).
---
## The 5 Pillars of AI Slop Elimination
- ```
- ┌───────────────────────────────────────┐
- │ THE ANTI-SLOP STANDARD │
- │ Zero Tolerance Engineering (2026) │
- └──────────────────┬────────────────────┘
- │
- ┌────────────────┬───────────────────┼───────────────────┬────────────────┐
- ▼ ▼ ▼ ▼ ▼
- [Pillar 1] [Pillar 2] [Pillar 3] [Pillar 4] [Pillar 5]
- Conversational Placeholder / Speculative Decorative Buzzword &
- Sycophancy Slop Truncation Slop Over-Engineering Comment Slop Artifact Slop
- - No pleasantries- No // TODO - No fake factories - No syntax logs - No empty PRDs
- - Direct & terse - Full runnable code- Trust types - Explain "why" - Concrete specs
- ```
-
- ---
-
### Pillar 1: Conversational & Sycophancy Slop
-
- AI models frequently default to conversational filler that wastes context tokens, slows down developer velocity, and adds zero technical value.
-
- #### 🔴 The Slop Patterns (Strictly Forbidden):
- - **Sycophantic Preambles**: *"Certainly! I'd be more than happy to help you with that problem!"*, *"That is an excellent architectural question!"*
- - **Prompt Echoing / Restatement**: Repeating the user's prompt verbatim before starting the work.
- - **Apology Loops**: *"I deeply apologize for the previous confusion, let me try again..."*
- - **Trailing Motivational Fluff**: *"In conclusion, this solution creates a robust, cutting-edge foundation for your revolutionary application. I hope this helps! Feel free to ask if you have any questions!"*
-
- #### ✅ The Anti-Slop Standard:
- - **Imperative & Direct**: Begin immediately with the solution, code diff, or architectural answer.
- - **Code-First Communication**: When code is requested, present the code or diff first, followed by concise technical rationale if necessary.
- - **Zero Filler**: No apologies, no cheerleading, no conversational framing.
-
- ---
-
- ### Pillar 2: Placeholder & Truncation Slop ("Lazy LLM" Syndrome)
-
- The most destructive form of AI slop is incomplete code containing placeholders, which forces the human developer to manually finish or debug broken snippets.
-
- #### 🔴 The Slop Patterns (Strictly Forbidden):
- ```typescript
- // 🔴 SLOP 1: The Truncation Placeholder
- export function processOrder(order: Order) {
- validateOrder(order);
- // ... rest of the implementation remains the same ...
- // TODO: Add database persistence here
- return { status: 'success' };
- }
-
- // 🔴 SLOP 2: Mock Arrays Masquerading as Production Features
- export async function getTeamMembers(orgId: string): Promise<User[]> {
- // Mock data for now — replace with real DB query later
- return [
- { id: '1', name: 'Alice', role: 'Admin' },
- { id: '2', name: 'Bob', role: 'Member' },
- ];
- }
-
- // 🔴 SLOP 3: Stubbed Error Handlers
- catch (error) {
- // Handle error here
- console.log(error);
- }
- ```
-
- #### ✅ The Anti-Slop Standard:
- Every code output must be **100% complete, functional, and production-ready**:
- ```typescript
- // ✅ CLEAN: Fully implemented with real ORM query, transactions, and error propagation
- import { db } from '@/lib/db';
- import { orders, orderItems } from '@/lib/db/schema';
- import { eq } from 'drizzle-orm';
-
- export async function processOrder(order: Order): Promise<ProcessOrderResult> {
- validateOrder(order);
-
- return await db.transaction(async (tx) => {
- const [created] = await tx.insert(orders).values({
- userId: order.userId,
- totalAmount: order.totalAmount,
- status: 'confirmed',
- createdAt: new Date(),
- }).returning();
-
- await tx.insert(orderItems).values(
- order.items.map((item) => ({
- orderId: created.id,
- productId: item.productId,
- quantity: item.quantity,
- unitPrice: item.unitPrice,
- }))
- );
-
- return { orderId: created.id, status: 'confirmed' };
- });
- }
- ```
+ - **🔴 Forbidden**: Preambles ("Certainly! I'd be happy to help"), prompt echoing, apology loops, trailing motivational fluff.
+ - **✅ Standard**: Imperative, code-first communication. Zero filler.
- ---
+ ### Pillar 2: Placeholder & Truncation Slop ("Lazy LLM")
+ - **🔴 Forbidden**: `// TODO: implement`, `// ... rest of code`, or returning mock arrays when production features are requested.
+ - **✅ Standard**: Output must be 100% complete, functional, and production-ready.
### Pillar 3: Speculative & Decorative Over-Engineering Slop
-
- AI models frequently invent unnecessary abstractions, creating 4 interfaces, 2 abstract classes, and a factory pattern for a utility that only has one single implementation.
-
- #### 🔴 The Slop Patterns (Strictly Forbidden):
- - Creating `IUserServiceFactoryProvider` for a standard Supabase query.
- - Defensive validation overload: triple-checking `if (id !== undefined && id !== null && typeof id === 'string' && id.length > 0)` when TypeScript strict mode and Zod already guarantee type safety.
- - Hallucinated npm packages or obsolete APIs from earlier major versions.
-
- #### ✅ The Anti-Slop Standard:
- - **YAGNI (You Aren't Gonna Need It)**: Write the simplest direct implementation that solves the current requirement.
- - **Trust The Types**: Leverage TypeScript 5.8+ strict types and Zod schemas instead of cluttering runtime code with redundant defensive assertions.
-
- ---
+ - **🔴 Forbidden**: Creating factory patterns (`IUserServiceFactoryProvider`) for single implementations, triple-validated defensive code when TypeScript/Zod guarantee type safety.
+ - **✅ Standard**: YAGNI (You Aren't Gonna Need It). Write the simplest direct implementation. Trust the types.
### Pillar 4: Obvious & Decorative Comment Slop
+ - **🔴 Forbidden**: Narrating syntax line-by-line (e.g., `// Increment count by 1 \n setCount(count + 1);`).
+ - **✅ Standard**: Comments explain WHY (architectural decisions, business constraints), never WHAT.
- AI models love to narrate the obvious syntax of code rather than documenting architectural decisions, edge-case constraints, or non-obvious business rules.
+ ### Pillar 5: Buzzword & Artifact Slop
+ - **🔴 Forbidden**: Documents filled with generic marketing jargon ("seamless integration", "robust synergy") with zero technical density.
+ - **✅ Standard**: High technical density with explicit schemas, route tables, column types, and verifiable NFR latency budgets.
- #### 🔴 The Slop Patterns (Strictly Forbidden):
- ```typescript
- // 🔴 SLOP: Narrating syntax line-by-line
- // Import React from react
- import React from 'react';
+ ---
- // Create a state variable for count initialized to 0
- const [count, setCount] = useState<number>(0);
+ ## Token Efficiency & Compression Protocol
- // Function to handle increment
- const handleIncrement = () => {
- // Increment count by 1
- setCount(count + 1);
- };
+ ### 1. Response Compression Rules
+ - **No preamble/restatement/summaries**: Show code immediately, explain briefly after.
+ - **Diff format**: For file edits, show only changed lines.
+ - **Bullet > prose**: Use 1-sentence rationales over paragraphs.
- // Return the button component
- return <button onClick={handleIncrement}>Increment</button>;
+ ### 2. Context Window Budget Awareness (200K Context)
+ ```text
+ System prompt + skills: ~15K | Conversation history: ~50K | File reads: ~100K | Response: ~35K
```
-
- #### ✅ The Anti-Slop Standard:
- Comments should **only explain WHY, never WHAT**:
- ```typescript
- // ✅ CLEAN: Code is self-explanatory; comment only explains the subtle timing quirk
- const [count, setCount] = useState<number>(0);
-
- const handleIncrement = () => {
- // Functional update prevents stale closure when triggered rapidly in batch events
- setCount((prev) => prev + 1);
- };
+ - Summarize large files mentally; `view_file` only specific sections. Create a checkpoint with `session-memory-manager` when near full.
- return <button onClick={handleIncrement}>Increment</button>;
- ```
+ ### 3. Tool Call Minimization & First Draft Quality
+ - Read multiple files in parallel.
+ - Use `grep_search` over full reads.
+ - Generate correct, production-ready code with inline error handling on the first try. Avoid edit-retry cycles.
---
- ### Pillar 5: Buzzword & Artifact Slop
-
- Documentation generated by AI often contains hundreds of words of synthetic marketing jargon ("seamless integration", "cutting-edge paradigm", "robust synergy") with zero technical density.
+ ## Legacy Code Gardening Protocol
- #### 🔴 The Slop Patterns:
- - PRDs filled with generic goals: *"Build a cutting-edge, scalable AI-powered platform to empower users worldwide."*
- - API specs missing request/response schemas, status codes, and error models.
- - Empty template sections left untouched.
+ ### 1. Context Drift Analysis & Code Smells
+ - **Inconsistent Styles**: Mixed `async/await` vs `.then()`, variable namings (`userId` vs `user_id`). Fix with Prettier/ESLint rules.
+ - **Bloated Components**: 5+ states, 10+ props, 20+ imports. Apply Single Responsibility and split them.
+ - **Dependency Creep**: Use `npx depcheck` for unused dependencies and `npx bundle-phobia-cli` for sizing.
+ - **Graveyard of Dead Utilities**: Use semantic search/grep to find and remove 0-usage exported functions.
- #### ✅ The Anti-Slop Standard:
- - **High Technical Density**: Every document must contain explicit entity schemas, concrete HTTP route tables, exact database column types, and verifiable NFR latency budgets.
+ ### 2. 4-Phase Gardening Protocol
+ 1. **Discovery**: Map file tree, find bloated files, duplicated logic, unused exports, and style drift.
+ 2. **Triage**: Categorize into Critical (bugs/data loss), High (diverging duplicates), Medium (smells), Low (style).
+ 3. **Systematic Refactoring**: Start smallest first. Remove dead code, extract duplicates, simplify abstractions, standardize names, add tests.
+ 4. **Prevention**: Add strict ESLint rules, `depcheck` in CI, and architecture tests.
---
- ## Anti-Slop Automated Detection Heuristics (RegEx)
-
- Use these regex patterns in your linting pipelines, pre-commit hooks, or `grep_search` to catch AI slop before it enters source control:
-
- | Slop Category | Detection RegEx Pattern | Target |
- | :--- | :--- | :--- |
- | **Lazy Truncation** | `(?i)(rest of the code|implementation goes here|logic here|todo:?\s*implement)` | Source code |
- | **Placeholder Dots** | `\/\/\s*\.\.\.\s*(code|implementation|rest)` | Source code |
- | **Mock Remnants** | `(?i)(mock data for now|hardcoded for testing|stub implementation)` | Production code |
- | **Conversational Slop** | `(?i)^(certainly!|sure,|as an ai language model|in conclusion,)` | Agent responses / Markdown |
- | **Syntax Narration** | `(?i)\/\/\s*(import\s+\w+|return\s+\w+|increment\s+\w+|set\s+state)` | Source code |
- | **Buzzword Density** | `(?i)\b(seamlessly integrated|cutting-edge paradigm|game-changer|delve into)\b` | Documentation |
+ ## Automated Anti-Slop Audit Script
+ Run `scripts/check-anti-slop.js` in CI to detect placeholders (`// ...`), unfinished stubs (`TODO:`), mock data in prod, and syntax narration (`// increment`). Fail builds if AI slop is detected.
---
- ## Automated Anti-Slop Audit Script (`scripts/check-anti-slop.js`)
-
- Run this script in CI to enforce the Zero-Slop Standard across your repository:
-
- ```javascript
- #!/usr/bin/env node
- // scripts/check-anti-slop.js - Zero Tolerance AI Slop Linter
- const fs = require('fs');
- const path = require('path');
-
- const SLOP_PATTERNS = [
- { name: 'Lazy Truncation', regex: /\/\/\s*\.\.\.\s*(rest|code|implement)/i },
- { name: 'Unfinished TODO Stub', regex: /\/\/\s*TODO:\s*(implement|add logic|fill in)/i },
- { name: 'Mock Data in Prod', regex: /\/\/\s*mock data for now/i },
- { name: 'Syntax Narration', regex: /\/\/\s*(increment\s+\w+|return\s+(the\s+)?\w+|import\s+\w+\s+from)/i },
- ];
-
- const IGNORE_DIRS = ['node_modules', '.git', '.next', 'dist', 'build'];
-
- let hasSlop = false;
-
- function scanDir(dir) {
- const files = fs.readdirSync(dir);
- for (const file of files) {
- if (IGNORE_DIRS.includes(file)) continue;
- const fullPath = path.join(dir, file);
- const stat = fs.statSync(fullPath);
- if (stat.isDirectory()) {
- scanDir(fullPath);
- } else if (/\.(ts|tsx|js|jsx|py|go|rs)$/.test(file)) {
- const content = fs.readFileSync(fullPath, 'utf8');
- const lines = content.split('\n');
- lines.forEach((line, index) => {
- SLOP_PATTERNS.forEach(({ name, regex }) => {
- if (regex.test(line)) {
- console.error(`🚨 [AI SLOP DETECTED] ${fullPath}:${index + 1} (${name}) -> ${line.trim()}`);
- hasSlop = true;
- }
- });
- });
- }
- }
- }
-
- scanDir(process.cwd());
+ <a name="bahasa-indonesia"></a>
+ ## Bahasa Indonesia
- if (hasSlop) {
- console.error('\n❌ Repository failed Anti-Slop Audit. Remove all placeholder stubs and syntax narration.');
- process.exit(1);
- } else {
- console.log('✅ Anti-Slop Audit Passed: Zero AI Slop detected.');
- }
- ```
+ ### Deskripsi & Kondisi Pemicu
+ Standar nol-toleransi terhadap AI slop, pemborosan token, dan pembusukan arsitektur. AI slop muncul sebagai basa-basi, placeholder, over-engineering spekulatif, dan komentar dekoratif. Skill ini menegakkan anti-slop, kompresi respons, dan perawatan kode (code gardening).
+ Pemicu: Pembuatan/modifikasi kode, review otomatis, sesi panjang, permintaan respons ringkas, atau saat codebase menunjukkan "AI smell" (inkonsistensi, duplikasi, kode mati).
---
- ## Orchestration & Integration
+ ### 5 Pilar Utama Pembasmian AI Slop
- - **`vibe-code-gardener`**: Detects and purges existing dead code, bloated components, and duplicate guards in legacy projects.
- - **`token-saver`**: Minimizes context consumption and forces concise, direct response styles.
- - **`scalability-clean-code`**: Enforces SOLID, DRY, and clean architecture boundaries against speculative over-engineering.
- - **`autonomous-tdd-debugger`**: Validates that all implemented code passes real execution tests without stubbing.
- - **`zero-to-prod-orchestrator`**: Incorporates anti-slop checks at Phase 1, Phase 2, Phase 5, and Phase 6.
- - **`production-ready-hardener`**: Gates pre-deployment audit with zero-placeholder enforcement.
+ 1. **Pilar 1: Eliminasi Basa-Basi Percakapan** - Dilarang menggunakan pengantar atau pengulangan instruksi. Harus *code-first* dan tanpa basa-basi.
+ 2. **Pilar 2: Larangan Placeholder & Truncation ("Lazy LLM")** - Dilarang keras menggunakan `// TODO` atau memotong kode. Wajib 100% lengkap dan siap produksi.
+ 3. **Pilar 3: Anti Over-Engineering Spekulatif** - Hindari *factory pattern* atau layer ekstra tanpa alasan. Jangan validasi ganda jika Zod/TypeScript sudah menanganinya. Terapkan YAGNI.
+ 4. **Pilar 4: Eliminasi Komentar Sintaksis** - Jangan menarasikan baris kode (mis. `// tambah satu`). Komentar hanya untuk menjelaskan MENGAPA (alasan bisnis/arsitektur).
+ 5. **Pilar 5: Eliminasi Slop Dokumen & Buzzword** - Hindari kata-kata marketing kosong. Gunakan densitas teknis tinggi dengan skema pasti dan metrik konkret.
---
- <a name="bahasa-indonesia"></a>
- ## Bahasa Indonesia
-
- ### Deskripsi
- Standar ketat nol-toleransi terhadap AI slop pada pembuatan kode sumber, interaksi percakapan, desain arsitektur, dan dokumentasi. AI slop muncul dalam bentuk kode terpotong dengan placeholder malas, basa-basi percakapan, *over-engineering* spekulatif, komentar dekoratif yang hanya menarasikan sintaksis, serta dokumen penuh istilah klise (*buzzwords*). Skill ini menegakkan standar anti-slop deterministik di seluruh siklus hidup pengembangan.
+ ### Protokol Efisiensi & Kompresi Token
- ### Kondisi Pemicu
- - Setiap tugas pembuatan atau modifikasi kode sumber.
- - Audit review kode otomatis, validasi PR, dan verifikasi pre-commit git.
- - Codebase menunjukkan tanda "AI smell" — komentar placeholder, layer abstraksi berlebihan, validasi berlapis ganda yang sia-sia, atau komentar sintaksis.
- - Konfigurasi asisten AI agar beroperasi dalam mode hemat token, ringkas, dan berstandar produksi.
+ - **Kompresi Respons**: Gunakan format diff untuk kode. Penjelasan menggunakan poin 1-kalimat daripada paragraf. Tanpa basa-basi.
+ - **Budget 200K Konteks**: Batasi baca file penuh; gunakan `grep_search`. Buat checkpoint dengan `session-memory-manager` jika token menipis.
+ - **Efisiensi Tool**: Baca file paralel, temukan konten spesifik dengan grep. Hasilkan draf pertama yang siap produksi tanpa siklus edit berulang.
---
- ### 5 Pilar Utama Pembasmian AI Slop
-
- 1. **Pilar 1: Eliminasi Basa-Basi & Sycophancy Percakapan**
- - **Dilarang**: *"Tentu saja! Saya akan dengan senang hati membantu Anda!"*, mengulang pertanyaan pengguna sebelum bekerja, dan kesimpulan panjang penuh pujian.
- - **Standar**: Langsung pada solusi teknis, kode-terlebih-dahulu (*code-first*), tanpa pengantar basa-basi.
-
- 2. **Pilar 2: Larangan Keras Kode Terpotong / Placeholder ("Lazy LLM")**
- - **Dilarang**: `// TODO: implementasi nanti`, `// ... sisa kode tidak berubah ...`, atau mengembalikan array data tiruan (*mock*) saat implementasi produksi diminta.
- - **Standar**: Setiap potongan kode yang dihasilkan **WAJIB 100% lengkap, dapat dijalankan, dan siap produksi**. Tidak ada bagian yang diabaikan.
-
- 3. **Pilar 3: Anti Over-Engineering Spekulatif**
- - **Dilarang**: Membuat factory pattern atau 5 layer abstraksi untuk satu fungsi sederhana yang tidak akan pernah bercabang. Validasi ganda berlebihan saat tipe data sudah dijamin oleh TypeScript dan Zod.
- - **Standar**: Terapkan prinsip YAGNI (You Aren't Gonna Need It). Percayai sistem tipe.
-
- 4. **Pilar 4: Eliminasi Komentar Dekoratif Sintaksis**
- - **Dilarang**: Mengomentari apa yang sudah jelas tertulis pada sintaksis (contoh: `// import React`, `// tambah count dengan 1`, `// kembalikan hasil user`).
- - **Standar**: Komentar hanya boleh menjelaskan **MENGAPA (alasan bisnis, pertimbangan arsitektur, batasan non-obvious)**, bukan **APA** yang dilakukan sintaksis.
+ ### Protokol Berkebun Kode Warisan (Code Gardening)
- 5. **Pilar 5: Eliminasi Slop Dokumen & Buzzword Kosong**
- - **Dilarang**: PRD atau dokumen arsitektur yang penuh istilah umum tanpa spesifikasi teknis (seperti "solusi sinergis revolusioner").
- - **Standar**: Densitas teknis tinggi dengan skema tabel database konkret, route API eksplisit, dan metrik NFR yang terukur.
+ 1. **Analisis Context Drift**: Perbaiki inkonsistensi gaya (contoh: `async` vs `then`, `userId` vs `user_id`) dengan ESLint/Prettier.
+ 2. **Komponen Membengkak**: Pecah komponen yang memiliki >5 state, >10 prop, atau >20 impor berdasarkan Tanggung Jawab Tunggal.
+ 3. **Utilitas Mati & Dependensi**: Hapus fungsi tanpa penggunaan. Gunakan `npx depcheck` untuk package tidak terpakai dan `bundle-phobia-cli` untuk ukuran.
+ 4. **Protokol 4 Fase**:
+ - *Discovery*: Petakan duplikasi dan kode mati.
+ - *Triage*: Kategorikan Kritis hingga Rendah.
+ - *Refactoring*: Hapus kode mati, ekstrak duplikat, sederhanakan abstraksi, tambah test.
+ - *Prevention*: Tambahkan ESLint strict, depcheck CI, dan uji arsitektur.
---
- ## Integrasi Orkestrasi
-
- - **`vibe-code-gardener`**: Membersihkan kode mati dan komponen membengkak pada proyek yang terlanjur terkotori vibe-coding.
- - **`token-saver`**: Mengoptimalkan anggaran token dan memaksa gaya interaksi ringkas.
- - **`scalability-clean-code`**: Menjaga prinsip SOLID dan Clean Architecture agar terhindar dari abstraksi spekulatif.
- - **`autonomous-tdd-debugger`**: Memastikan setiap fitur memiliki test nyata yang lolos tanpa fungsi palsu (*stubs*).
- - **`zero-to-prod-orchestrator`**: Mengintegrasikan gerbang anti-slop pada Fase 1, 2, 5, dan 6.
- - **`production-ready-hardener`**: Mengunci rilis produksi dengan audit nol-placeholder.
+ ## Orchestration & Integration
+ - `zero-to-prod-orchestrator`: Anti-slop checks at architectural and deployment phases.
+ - `session-memory-manager`: Context resets when token budgets approach limits.
+ - `scalability-clean-code`: Enforces SOLID boundaries against speculative over-engineering.
+ - `autonomous-tdd-debugger`: Validates execution completeness over mock/stub code.
+ - `coderabbit` & `brainstorming`: Clean PR reviews and dense documentation.
+ - `dependency-upgrade-migrator`: Integrates with dependency audits (`depcheck`).