[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NT7AKNCFWA7RF926REGWYF":3,"skill-same:01M6NT7AKNCFWA7RF926REGWYF":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":14,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6NT7AKNCFWA7RF926REGWYF","ai-slop-cleaner",null,"Post-implementation cleanup that removes AI-generated bloat while preserving functionality. Runs pass-by-pass with test verification after each pass. Activate after kraken\u002Fspark complete a feature, or when a codebase needs hygiene work.","rubicanjr\u002FFinCognis","rubicanjr","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F234912519?v=4","01M6NT156NND8J474G34SB3923","Rubi","01M6NT15B70RWXE1N3YV0BZY8A",0,"MIT","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fai-slop-cleaner\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"slop","ai slop cleaner","feature","codebase","bloat","with","post","complete","hygiene","test","kraken","activate","implementation","generated","work","verification","cleanup","spark","2026-11-10 10:12:30",false,"---\nname: ai-slop-cleaner\ndescription: Post-implementation cleanup that removes AI-generated bloat while preserving functionality. Runs pass-by-pass with test verification after each pass. Activate after kraken\u002Fspark complete a feature, or when a codebase needs hygiene work.\n---\n\n# AI Slop Cleaner\n\nAI code generation produces working code. It also produces unnecessary code alongside it. This skill removes the unnecessary parts while keeping everything that matters.\n\n## What Is \"AI Slop\"?\n\nAI slop is code that:\n- Works, but shouldn't exist\n- Adds complexity without adding value\n- Was clearly generated to pad a response rather than solve a problem\n- Suggests the author wasn't thinking, just generating\n\nCommon slop categories and their signals:\n\n| Category | Signal |\n|----------|--------|\n| Dead imports | Imported but never referenced in the file |\n| Unused variables | Declared, never read |\n| Commented-out code | Blocks of `\u002F\u002F old code` or `\u002F* removed *\u002F` |\n| Debug remnants | `console.log`, `print()`, `debugger`, `fmt.Println` |\n| Obvious comments | `\u002F\u002F increment counter` above `count++` |\n| Redundant JSDoc | `@param name - the name` above `name: string` |\n| Premature abstractions | A factory that creates exactly one thing |\n| One-use helpers | Private function called exactly once, trivially inlinable |\n| Overly generic types | `\u003CT extends object>` when `T` is always `User` |\n| Over-parameterized | `fn(a, b, c, d, e)` where 4 params never vary |\n| Unreachable branches | `if (false)` or `if (isLoggedIn && !isLoggedIn)` |\n| Speculative features | Code paths for requirements that don't exist |\n| Copy-paste duplication | Two blocks identical except one variable name |\n| Placeholder remnants | `TODO: implement`, lorem ipsum, example data in prod |\n\n## The Prime Directive\n\n**Tests are sacred. Never clean test files.**\n\nTests exist to protect behavior. Any cleanup that breaks a test reveals that the \"slop\" was actually load-bearing. That is good information. The test wins.\n\n## Regression-Safe Workflow (Non-Negotiable)\n\n```\nBEFORE ANYTHING: Run full test suite → all tests must pass (baseline)\n\nFOR EACH PASS:\n  1. Identify targets for this pass category\n  2. Apply cleanup\n  3. Run tests\n  4. If tests pass: keep cleanup, continue\n  5. If tests fail: git checkout -- . (revert), skip this pass category\n  6. Log what was reverted and why\n\nAFTER ALL PASSES: Run full test suite → confirm all tests still pass\nReport: lines removed, files touched, passes skipped, reason for each skip\n```\n\nNever batch multiple pass categories together. If combined changes break a test, you cannot know which change caused it.\n\n## The 7 Cleaning Passes\n\n### Pass 1: Dead Imports and Unused Variables\n\n**Risk: Very Low**\n\nWhat to remove:\n- Import statements where the imported name never appears in the file body\n- Variables declared with `let`\u002F`const`\u002F`var` that are never read after assignment\n- Function parameters that are never referenced inside the function body (TypeScript: prefix with `_`)\n\nBefore:\n```typescript\nimport { useState, useEffect, useCallback, useMemo } from 'react'\nimport { formatDate } from '@\u002Flib\u002Futils'\nimport { ApiClient } from '@\u002Flib\u002Fapi'\n\nexport function UserCard({ user }) {\n  const [count, setCount] = useState(0)\n  const formatted = formatDate(user.createdAt)\n\n  return \u003Cdiv>{user.name}\u003C\u002Fdiv>\n}\n```\n\nAfter:\n```typescript\nimport { useState } from 'react'\nimport { formatDate } from '@\u002Flib\u002Futils'\n\nexport function UserCard({ user }) {\n  const [count, setCount] = useState(0)\n  const formatted = formatDate(user.createdAt)\n\n  return \u003Cdiv>{user.name}\u003C\u002Fdiv>\n}\n```\n\nNote: `count`, `setCount`, and `formatted` are still present because they may be used elsewhere in a larger component. Pass 1 only removes imports.\n\n### Pass 2: Commented-Out Code and Debug Statements\n\n**Risk: Very Low**\n\nWhat to remove:\n- Any block of commented-out code that is not an active TODO or architectural note\n- `console.log`, `console.debug`, `console.warn` (unless it is a legitimate error logger)\n- `debugger` statements\n- `print()` in Python when not serving as actual program output\n- `fmt.Println` in Go debug instrumentation\n\nBefore:\n```typescript\nasync function processOrder(orderId: string) {\n  console.log('processing order', orderId)\n  const order = await db.orders.findById(orderId)\n  \u002F\u002F const cached = await cache.get(orderId)\n  \u002F\u002F if (cached) return cached\n  console.log('order fetched:', order)\n\n  const result = await payments.charge(order)\n  \u002F\u002F TODO: add retry logic here\n  \u002F\u002F console.log('charge result', result)\n\n  return result\n}\n```\n\nAfter:\n```typescript\nasync function processOrder(orderId: string) {\n  const order = await db.orders.findById(orderId)\n\n  const result = await payments.charge(order)\n  \u002F\u002F TODO: add retry logic here\n\n  return result\n}\n```\n\nRule: `\u002F\u002F TODO:` comments are preserved. They are documentation of known gaps, not slop.\n\n### Pass 3: Obvious Comments and Redundant Documentation\n\n**Risk: Low**\n\nWhat to remove:\n- Comments that restate the code in plain English without adding context\n- JSDoc `@param` blocks that just repeat the parameter name and type (TypeScript already says this)\n- Section dividers that add no structure (`\u002F\u002F ===== COMPONENT =====`)\n- End-of-block comments (`} \u002F\u002F end if`, `} \u002F\u002F end for`)\n\nBefore:\n```typescript\n\u002F**\n * Gets a user by ID.\n * @param id - the user ID\n * @param db - the database instance\n * @returns the user object\n *\u002F\nasync function getUserById(id: string, db: Database): Promise\u003CUser> {\n  \u002F\u002F Query the database for the user\n  const user = await db.users.findById(id)\n\n  \u002F\u002F Return the user\n  return user\n} \u002F\u002F end getUserById\n```\n\nAfter:\n```typescript\nasync function getUserById(id: string, db: Database): Promise\u003CUser> {\n  return db.users.findById(id)\n}\n```\n\nKeep comments that explain WHY (business rules, performance choices, known gotchas). Remove comments that explain WHAT (the code already says what).\n\n### Pass 4: Dead Code (Unreachable Branches)\n\n**Risk: Medium — Run tests immediately after**\n\nWhat to remove:\n- Conditions that are always true or always false\n- Code after unconditional `return`, `throw`, or `break`\n- Else branches of conditions that always throw in the if block\n\nBefore:\n```typescript\nfunction getStatus(user: User): string {\n  if (user.role === 'admin' || user.role === 'admin') {\n    return 'ADMIN'\n  }\n\n  if (user.isActive) {\n    return 'ACTIVE'\n  } else {\n    return 'INACTIVE'\n  }\n\n  \u002F\u002F This never runs\n  return 'UNKNOWN'\n}\n```\n\nAfter:\n```typescript\nfunction getStatus(user: User): string {\n  if (user.role === 'admin') {\n    return 'ADMIN'\n  }\n\n  return user.isActive ? 'ACTIVE' : 'INACTIVE'\n}\n```\n\nDo not remove branches that look unreachable but depend on runtime data you cannot verify statically. When uncertain, leave it.\n\n### Pass 5: Premature Abstractions (Inline One-Use Helpers)\n\n**Risk: Medium — Run tests immediately after**\n\nWhat to inline:\n- Private\u002Finternal functions called exactly once\n- Wrapper functions that add no logic (just forward all arguments)\n- Intermediate variables assigned once and used once on the next line\n\nBefore:\n```typescript\nfunction formatUserDisplayName(user: User): string {\n  return `${user.firstName} ${user.lastName}`.trim()\n}\n\nfunction renderUserCard(user: User) {\n  const displayName = formatUserDisplayName(user)\n  return `\u003Cdiv class=\"card\">${displayName}\u003C\u002Fdiv>`\n}\n```\n\nAfter (if `formatUserDisplayName` is only called from `renderUserCard`):\n```typescript\nfunction renderUserCard(user: User) {\n  const displayName = `${user.firstName} ${user.lastName}`.trim()\n  return `\u003Cdiv class=\"card\">${displayName}\u003C\u002Fdiv>`\n}\n```\n\nDo NOT inline if:\n- The function is exported (public API)\n- The function is called from more than one place\n- The function name serves as meaningful documentation of intent\n- The function contains error handling that would add visual noise when inlined\n\n### Pass 6: Duplication Consolidation\n\n**Risk: Medium-High — Run tests immediately after each consolidation**\n\nWhat to consolidate:\n- Two or more blocks with identical structure and only one variable difference\n- Repeated conditional checks that could be extracted to a guard function\n- Multiple switch\u002Fif-else blocks with the same cases in different files\n\nBefore:\n```typescript\n\u002F\u002F In UserService\nasync function getActiveUsers() {\n  const users = await db.query(\n    'SELECT * FROM users WHERE status = $1 AND deleted_at IS NULL',\n    ['active']\n  )\n  return users.rows\n}\n\n\u002F\u002F In AdminService (same file or different file)\nasync function getActiveAdmins() {\n  const admins = await db.query(\n    'SELECT * FROM users WHERE status = $1 AND deleted_at IS NULL AND role = $2',\n    ['active', 'admin']\n  )\n  return admins.rows\n}\n```\n\nAfter:\n```typescript\nasync function getActiveUsers(role?: string) {\n  const params: unknown[] = ['active']\n  let sql = 'SELECT * FROM users WHERE status = $1 AND deleted_at IS NULL'\n\n  if (role) {\n    sql += ' AND role = $2'\n    params.push(role)\n  }\n\n  const result = await db.query(sql, params)\n  return result.rows\n}\n```\n\nBe careful: consolidation that requires complex parameterization may make code harder to understand. If the consolidated version is more complex than the two originals, leave them separate.\n\n### Pass 7: Over-Engineering Simplification\n\n**Risk: High — High scrutiny, run tests after every individual change**\n\nWhat to simplify:\n- Factory pattern used to create exactly one concrete type\n- Strategy pattern with exactly one strategy\n- Abstract base class with exactly one implementation\n- Generic type parameter constrained so tightly it could be a concrete type\n\nBefore:\n```typescript\ninterface DataProcessor\u003CT extends BaseData> {\n  process(data: T): ProcessedData\u003CT>\n  validate(data: T): ValidationResult\n}\n\nclass UserDataProcessorFactory {\n  create(): DataProcessor\u003CUserData> {\n    return new UserDataProcessor()\n  }\n}\n\nclass UserDataProcessor implements DataProcessor\u003CUserData> {\n  process(data: UserData): ProcessedData\u003CUserData> {\n    return { ...data, processed: true }\n  }\n\n  validate(data: UserData): ValidationResult {\n    return { valid: !!data.id }\n  }\n}\n```\n\nAfter (if only UserData ever flows through this):\n```typescript\nfunction processUserData(data: UserData) {\n  if (!data.id) throw new Error('Invalid user data: missing id')\n  return { ...data, processed: true }\n}\n```\n\nRule for Pass 7: If you need more than 2 minutes to understand why an abstraction exists, and there is only one concrete case, remove the abstraction. If you find yourself unsure whether it is load-bearing, leave it. Pass 7 is optional.\n\n## What Is Never Cleaned\n\n| Target | Reason |\n|--------|--------|\n| Test files (`*.test.*`, `*.spec.*`, `__tests__\u002F`) | Tests are sacred |\n| Public API signatures | Breaks callers |\n| Error handling at system boundaries (API routes, top-level handlers) | Defense-in-depth |\n| Comments explaining regulatory\u002Fcompliance requirements | Legal context |\n| Feature flags | May be toggled at runtime |\n| Anything marked `\u002F\u002F KEEP` or `\u002F\u002F intentional` | Explicit author decision |\n\n## .slopignore File\n\nPlace at project root to exclude paths:\n\n```\n# .slopignore\nsrc\u002Flegacy\u002F         # Old code being migrated, don't touch\nsrc\u002Fgenerated\u002F      # Auto-generated, cleaned by generator\nvendor\u002F             # Third-party code\n```\n\n## Metrics Report\n\nAfter all passes complete, output:\n\n```\nAI Slop Cleaner Report\n======================\nFiles touched:          12\nLines removed:          147\nLines remaining:        1,843\nReduction:              7.4%\n\nPass results:\n  Pass 1 (Dead imports):       DONE — 23 lines removed\n  Pass 2 (Debug code):         DONE — 18 lines removed\n  Pass 3 (Obvious comments):   DONE — 41 lines removed\n  Pass 4 (Dead code):          DONE — 12 lines removed\n  Pass 5 (One-use helpers):    DONE — 31 lines removed\n  Pass 6 (Duplication):        SKIPPED — test failed after consolidation (UserService)\n  Pass 7 (Over-engineering):   DONE — 22 lines removed\n\nSkipped details:\n  Pass 6 reverted: UserService query consolidation broke getUsersByStatus test.\n  Root cause: test was asserting on the exact SQL string. Left original.\n\nTest status: ALL PASSING (127\u002F127)\n```\n\n## Integration with refactor-cleaner Agent\n\nAI slop cleaner runs at the code level (syntactic cleanup). The refactor-cleaner agent runs at the architecture level (structural refactoring). Run this skill first, then refactor-cleaner if structural improvement is needed.\n\nOrder:\n```\n1. ai-slop-cleaner (remove the noise)\n2. code-reviewer (verify quality after cleanup)\n3. refactor-cleaner (structural improvements if needed)\n4. verifier (final gate)\n```\n\n## Automatic Trigger\n\nThis skill is automatically triggered after:\n- kraken agent completes a feature implementation\n- spark agent completes a fix\n- Any agent produces more than 200 new lines of code\n\nThe trigger runs Pass 1 and Pass 2 only by default (very low risk). Passes 3-7 require explicit activation or a `\u002Fclean` command.\n\n---\n\n**Remember**: The goal is not minimum lines of code. The goal is maximum clarity per line. If removing something makes the code harder to understand, put it back.\n","# AI Slop Cleaner\n\nAI code generation produces working code. It also produces unnecessary code alongside it. This skill removes the unnecessary parts while keeping everything that matters.\n\n## What Is \"AI Slop\"?\n\nAI slop is code that:\n- Works, but shouldn't exist\n- Adds complexity without adding value\n- Was clearly generated to pad a response rather than solve a problem\n- Suggests the author wasn't thinking, just generating\n\nCommon slop categories and their signals:\n\n| Category | Signal |\n|----------|--------|\n| Dead imports | Imported but never referenced in the file |\n| Unused variables | Declared, never read |\n| Commented-out code | Blocks of `\u002F\u002F old code` or `\u002F* removed *\u002F` |\n| Debug remnants | `console.log`, `print()`, `debugger`, `fmt.Println` |\n| Obvious comments | `\u002F\u002F increment counter` above `count++` |\n| Redundant JSDoc | `@param name - the name` above `name: string` |\n| Premature abstractions | A factory that creates exactly one thing |\n| One-use helpers | Private function called exactly once, trivially inlinable |\n| Overly generic types | `\u003CT extends object>` when `T` is always `User` |\n| Over-parameterized | `fn(a, b, c, d, e)` where 4 params never vary |\n| Unreachable branches | `if (false)` or `if (isLoggedIn && !isLoggedIn)` |\n| Speculative features | Code paths for requirements that don't exist |\n| Copy-paste duplication | Two blocks identical except one variable name |\n| Placeholder remnants | `TODO: implement`, lorem ipsum, example data in prod |\n\n## The Prime Directive\n\n**Tests are sacred. Never clean test files.**\n\nTests exist to protect behavior. Any cleanup that breaks a test reveals that the \"slop\" was actually load-bearing. That is good information. The test wins.\n\n## Regression-Safe Workflow (Non-Negotiable)\n\n```\nBEFORE ANYTHING: Run full test suite → all tests must pass (baseline)\n\nFOR EACH PASS:\n  1. Identify targets for this pass category\n  2. Apply cleanup\n  3. Run tests\n  4. If tests pass: keep cleanup, continue\n  5. If tests fail: git checkout -- . (revert), skip this pass category\n  6. Log what was reverted and why\n\nAFTER ALL PASSES: Run full test suite → confirm all tests still pass\nReport: lines removed, files touched, passes skipped, reason for each skip\n```\n\nNever batch multiple pass categories together. If combined changes break a test, you cannot know which change caused it.\n\n## The 7 Cleaning Passes\n\n### Pass 1: Dead Imports and Unused Variables\n\n**Risk: Very Low**\n\nWhat to remove:\n- Import statements where the imported name never appears in the file body\n- Variables declared with `let`\u002F`const`\u002F`var` that are never read after assignment\n- Function parameters that are never referenced inside the function body (TypeScript: prefix with `_`)\n\nBefore:\n```typescript\nimport { useState, useEffect, useCallback, useMemo } from 'react'\nimport { formatDate } from '@\u002Flib\u002Futils'\nimport { ApiClient } from '@\u002Flib\u002Fapi'\n\nexport function UserCard({ user }) {\n  const [count, setCount] = useState(0)\n  const formatted = formatDate(user.createdAt)\n\n  return \u003Cdiv>{user.name}\u003C\u002Fdiv>\n}\n```\n\nAfter:\n```typescript\nimport { useState } from 'react'\nimport { formatDate } from '@\u002Flib\u002Futils'\n\nexport function UserCard({ user }) {\n  const [count, setCount] = useState(0)\n  const formatted = formatDate(user.createdAt)\n\n  return \u003Cdiv>{user.name}\u003C\u002Fdiv>\n}\n```\n\nNote: `count`, `setCount`, and `formatted` are still present because they may be used elsewhere in a larger component. Pass 1 only removes imports.\n\n### Pass 2: Commented-Out Code and Debug Statements\n\n**Risk: Very Low**\n\nWhat to remove:\n- Any block of commented-out code that is not an active TODO or architectural note\n- `console.log`, `console.debug`, `console.warn` (unless it is a legitimate error logger)\n- `debugger` statements\n- `print()` in Python when not serving as actual program output\n- `fmt.Println` in Go debug instrumentation\n\nBefore:\n```typescript\nasync function processOrder(orderId: string) {\n  console.log('processing order', orderId)\n  const order = await db.orders.findById(orderId)\n  \u002F\u002F const cached = await cache.get(orderId)\n  \u002F\u002F if (cached) return cached\n  console.log('order fetched:', order)\n\n  const result = await payments.charge(order)\n  \u002F\u002F TODO: add retry logic here\n  \u002F\u002F console.log('charge result', result)\n\n  return result\n}\n```\n\nAfter:\n```typescript\nasync function processOrder(orderId: string) {\n  const order = await db.orders.findById(orderId)\n\n  const result = await payments.charge(order)\n  \u002F\u002F TODO: add retry logic here\n\n  return result\n}\n```\n\nRule: `\u002F\u002F TODO:` comments are preserved. They are documentation of known gaps, not slop.\n\n### Pass 3: Obvious Comments and Redundant Documentation\n\n**Risk: Low**\n\nWhat to remove:\n- Comments that restate the code in plain English without adding context\n- JSDoc `@param` blocks that just repeat the parameter name and type (TypeScript already says this)\n- Section dividers that add no structure (`\u002F\u002F ===== COMPONENT =====`)\n- End-of-block comments (`} \u002F\u002F end if`, `} \u002F\u002F end for`)\n\nBefore:\n```typescript\n\u002F**\n * Gets a user by ID.\n * @param id - the user ID\n * @param db - the database instance\n * @returns the user object\n *\u002F\nasync function getUserById(id: string, db: Database): Promise\u003CUser> {\n  \u002F\u002F Query the database for the user\n  const user = await db.users.findById(id)\n\n  \u002F\u002F Return the user\n  return user\n} \u002F\u002F end getUserById\n```\n\nAfter:\n```typescript\nasync function getUserById(id: string, db: Database): Promise\u003CUser> {\n  return db.users.findById(id)\n}\n```\n\nKeep comments that explain WHY (business rules, performance choices, known gotchas). Remove comments that explain WHAT (the code already says what).\n\n### Pass 4: Dead Code (Unreachable Branches)\n\n**Risk: Medium — Run tests immediately after**\n\nWhat to remove:\n- Conditions that are always true or always false\n- Code after unconditional `return`, `throw`, or `break`\n- Else branches of conditions that always throw in the if block\n\nBefore:\n```typescript\nfunction getStatus(user: User): string {\n  if (user.role === 'admin' || user.role === 'admin') {\n    return 'ADMIN'\n  }\n\n  if (user.isActive) {\n    return 'ACTIVE'\n  } else {\n    return 'INACTIVE'\n  }\n\n  \u002F\u002F This never runs\n  return 'UNKNOWN'\n}\n```\n\nAfter:\n```typescript\nfunction getStatus(user: User): string {\n  if (user.role === 'admin') {\n    return 'ADMIN'\n  }\n\n  return user.isActive ? 'ACTIVE' : 'INACTIVE'\n}\n```\n\nDo not remove branches that look unreachable but depend on runtime data you cannot verify statically. When uncertain, leave it.\n\n### Pass 5: Premature Abstractions (Inline One-Use Helpers)\n\n**Risk: Medium — Run tests immediately after**\n\nWhat to inline:\n- Private\u002Finternal functions called exactly once\n- Wrapper functions that add no logic (just forward all arguments)\n- Intermediate variables assigned once and used once on the next line\n\nBefore:\n```typescript\nfunction formatUserDisplayName(user: User): string {\n  return `${user.firstName} ${user.lastName}`.trim()\n}\n\nfunction renderUserCard(user: User) {\n  const displayName = formatUserDisplayName(user)\n  return `\u003Cdiv class=\"card\">${displayName}\u003C\u002Fdiv>`\n}\n```\n\nAfter (if `formatUserDisplayName` is only called from `renderUserCard`):\n```typescript\nfunction renderUserCard(user: User) {\n  const displayName = `${user.firstName} ${user.lastName}`.trim()\n  return `\u003Cdiv class=\"card\">${displayName}\u003C\u002Fdiv>`\n}\n```\n\nDo NOT inline if:\n- The function is exported (public API)\n- The function is called from more than one place\n- The function name serves as meaningful documentation of intent\n- The function contains error handling that would add visual noise when inlined\n\n### Pass 6: Duplication Consolidation\n\n**Risk: Medium-High — Run tests immediately after each consolidation**\n\nWhat to consolidate:\n- Two or more blocks with identical structure and only one variable difference\n- Repeated conditional checks that could be extracted to a guard function\n- Multiple switch\u002Fif-else blocks with the same cases in different files\n\nBefore:\n```typescript\n\u002F\u002F In UserService\nasync function getActiveUsers() {\n  const users = await db.query(\n    'SELECT * FROM users WHERE status = $1 AND deleted_at IS NULL',\n    ['active']\n  )\n  return users.rows\n}\n\n\u002F\u002F In AdminService (same file or different file)\nasync function getActiveAdmins() {\n  const admins = await db.query(\n    'SELECT * FROM users WHERE status = $1 AND deleted_at IS NULL AND role = $2',\n    ['active', 'admin']\n  )\n  return admins.rows\n}\n```\n\nAfter:\n```typescript\nasync function getActiveUsers(role?: string) {\n  const params: unknown[] = ['active']\n  let sql = 'SELECT * FROM users WHERE status = $1 AND deleted_at IS NULL'\n\n  if (role) {\n    sql += ' AND role = $2'\n    params.push(role)\n  }\n\n  const result = await db.query(sql, params)\n  return result.rows\n}\n```\n\nBe careful: consolidation that requires complex parameterization may make code harder to understand. If the consolidated version is more complex than the two originals, leave them separate.\n\n### Pass 7: Over-Engineering Simplification\n\n**Risk: High — High scrutiny, run tests after every individual change**\n\nWhat to simplify:\n- Factory pattern used to create exactly one concrete type\n- Strategy pattern with exactly one strategy\n- Abstract base class with exactly one implementation\n- Generic type parameter constrained so tightly it could be a concrete type\n\nBefore:\n```typescript\ninterface DataProcessor\u003CT extends BaseData> {\n  process(data: T): ProcessedData\u003CT>\n  validate(data: T): ValidationResult\n}\n\nclass UserDataProcessorFactory {\n  create(): DataProcessor\u003CUserData> {\n    return new UserDataProcessor()\n  }\n}\n\nclass UserDataProcessor implements DataProcessor\u003CUserData> {\n  process(data: UserData): ProcessedData\u003CUserData> {\n    return { ...data, processed: true }\n  }\n\n  validate(data: UserData): ValidationResult {\n    return { valid: !!data.id }\n  }\n}\n```\n\nAfter (if only UserData ever flows through this):\n```typescript\nfunction processUserData(data: UserData) {\n  if (!data.id) throw new Error('Invalid user data: missing id')\n  return { ...data, processed: true }\n}\n```\n\nRule for Pass 7: If you need more than 2 minutes to understand why an abstraction exists, and there is only one concrete case, remove the abstraction. If you find yourself unsure whether it is load-bearing, leave it. Pass 7 is optional.\n\n## What Is Never Cleaned\n\n| Target | Reason |\n|--------|--------|\n| Test files (`*.test.*`, `*.spec.*`, `__tests__\u002F`) | Tests are sacred |\n| Public API signatures | Breaks callers |\n| Error handling at system boundaries (API routes, top-level handlers) | Defense-in-depth |\n| Comments explaining regulatory\u002Fcompliance requirements | Legal context |\n| Feature flags | May be toggled at runtime |\n| Anything marked `\u002F\u002F KEEP` or `\u002F\u002F intentional` | Explicit author decision |\n\n## .slopignore File\n\nPlace at project root to exclude paths:\n\n```\n# .slopignore\nsrc\u002Flegacy\u002F         # Old code being migrated, don't touch\nsrc\u002Fgenerated\u002F      # Auto-generated, cleaned by generator\nvendor\u002F             # Third-party code\n```\n\n## Metrics Report\n\nAfter all passes complete, output:\n\n```\nAI Slop Cleaner Report\n======================\nFiles touched:          12\nLines removed:          147\nLines remaining:        1,843\nReduction:              7.4%\n\nPass results:\n  Pass 1 (Dead imports):       DONE — 23 lines removed\n  Pass 2 (Debug code):         DONE — 18 lines removed\n  Pass 3 (Obvious comments):   DONE — 41 lines removed\n  Pass 4 (Dead code):          DONE — 12 lines removed\n  Pass 5 (One-use helpers):    DONE — 31 lines removed\n  Pass 6 (Duplication):        SKIPPED — test failed after consolidation (UserService)\n  Pass 7 (Over-engineering):   DONE — 22 lines removed\n\nSkipped details:\n  Pass 6 reverted: UserService query consolidation broke getUsersByStatus test.\n  Root cause: test was asserting on the exact SQL string. Left original.\n\nTest status: ALL PASSING (127\u002F127)\n```\n\n## Integration with refactor-cleaner Agent\n\nAI slop cleaner runs at the code level (syntactic cleanup). The refactor-cleaner agent runs at the architecture level (structural refactoring). Run this skill first, then refactor-cleaner if structural improvement is needed.\n\nOrder:\n```\n1. ai-slop-cleaner (remove the noise)\n2. code-reviewer (verify quality after cleanup)\n3. refactor-cleaner (structural improvements if needed)\n4. verifier (final gate)\n```\n\n## Automatic Trigger\n\nThis skill is automatically triggered after:\n- kraken agent completes a feature implementation\n- spark agent completes a fix\n- Any agent produces more than 200 new lines of code\n\nThe trigger runs Pass 1 and Pass 2 only by default (very low risk). Passes 3-7 require explicit activation or a `\u002Fclean` command.\n\n---\n\n**Remember**: The goal is not minimum lines of code. The goal is maximum clarity per line. If removing something makes the code harder to understand, put it back.\n",{"name":5,"description":7},"main","70e1c350500ee750987420bbae48837afa906b7e","skills\u002Fai-slop-cleaner","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis","https:\u002F\u002Fgithub.com\u002Frubicanjr","linktr.ee\u002Ffinanskodu","Industrial Engineer & CIO @FinansKodu. Architecting AI-driven financial agents and autonomous workflows. 🏗️ Building systems, not just prompts.","2026-06-09 13:50:15",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add rubicanjr\u002FFinCognis --skill ai-slop-cleaner",{"tool":56,"command":57},"bunx","bunx skills add rubicanjr\u002FFinCognis --skill ai-slop-cleaner",{"tool":59,"command":60},"pnpm","pnpm dlx skills add rubicanjr\u002FFinCognis --skill ai-slop-cleaner","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fai-slop-cleaner\u002FSKILL.md",true,[],[65,86,94,114,144,163],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":76,"publishedAt":37},"01M6NWS9DAXJTADT4T5MB49X8W","workflow-router","Goal-based workflow orchestration - routes tasks to specialist agents based on user goals","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-router\u002FSKILL.md",[71],{"categoryNo":72,"categoryName":73,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[77,78,79,80,81,82,83,84,85],"workflow router","workflow","router","orchestration","goals","goal","user","workflow orchestration","tasks",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":37},"01M6NWS3RETSC0SHP16HP66E14","wiring","Wiring Verification","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwiring\u002FSKILL.md",[],[88,34,93],"false",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":103,"publishedAt":37},"01M6NWS0XW9CVQZBDA1EGW0TWC","websocket-patterns","Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwebsocket-patterns\u002Fskill.md",[100],{"categoryNo":101,"categoryName":102,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000015","视觉设计",[104,105,106,107,108,109,110,111,112,113],"websocket","patterns","websocket patterns","design","protocol","management","message","strategies","binary","connection",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":124,"publishedAt":37},"01M6NWRDQDX9ZNETAWRRMQWV52","visual-verdict","Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS\u002FREVISE\u002FFAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-verdict\u002FSKILL.md",[120,123],{"categoryNo":121,"categoryName":122,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":72,"categoryName":73,"taxonomyType":74,"taxonomyTypeDesc":75},[125,126,127,128,129,130,131,132,133,134,135,136,137,107,138,139,140,141,142,143],"visual","verdict","visual verdict","ui","across","revise","comparison","correctness","implementing","for","fixes","dimensions","frontend","development","qa","screenshot","returns","use","frontend development",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":37},"01M6NWR8HSNRS7MNDK2J02QYMN","verification-loop","Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[151,152,34,153,154,155,156,157,158,159,160,161,162],"verification loop","loop","lint","review","security","pr","system","diff","build","tests","diff review","types",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":37},"01M6NWR4HHSFR0VR5EXFRWA747","vector-db-patterns","Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvector-db-patterns\u002Fskill.md",[],[170,171,172,173,105,174,175,176,177,111,178,179,180,181,182,134,183,184],"vector db patterns","vector db","db","vector","semantic search","search","embedding strategies","algorithms","chunking","semantic","retrieval","embedding","Hybrid Search","hybrid","rag"]