跳到正文
Skillpedia
通用编程5.9k · #14547

install-anti-slop

它能做什么

这项技能添加或更新一组 Oxlint 规则插件,用于发现 AI 写成的代码中常见的问题。适合希望代码检查能标出草率写法、并保持插件更新的开发者。

适用场景

  • ✓当你想为项目添加 anti-slop 代码检查规则时。
  • ✓当你想获取上游规则的更新或修复时。
  • ✓当你需要迁移现有的 anti-slop 设置,同时不丢失本地自定义内容的时候。

技能链接

https://github.com/dmmulroy/anti-slop/blob/main/skills/install-anti-slop/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/dmmulroy/anti-slop/blob/main/skills/install-anti-slop/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在我的仓库中安装 anti-slop Oxlint 插件,并保留我现有的代码检查自定义设置。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查仓库的包管理器和代码检查配置,把随附的插件复制到工具文件夹中,并在不替换现有自定义内容的前提下完成接入。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Install or update anti-slop

Anti-slop is vendored code: the target repository owns its rules, diagnostics, tests, and configuration. Preserve those choices when bringing in upstream changes.

Choose the path

Read the repository's agent instructions and git status. Identify its package manager, Oxlint/Vite+ configuration, and any existing anti-slop entry points, including renamed or relocated copies referenced by jsPlugins.

  • Existing installation — update, upgrade, migrate, or reconfigure: read Update a vendored installation and follow that procedure instead of the fresh-install steps below.
  • No installation — fresh install: follow the procedure below. If the user requested an update but no installation can be found, confirm the target before installing.

Complete when the operation and target path are established and pre-existing work is identified.

Fresh install

  1. Copy the bundled plugin from this skill. Run from the target repository:

    node <skill-directory>/scripts/install.mjs
    

    This creates tools/oxlint/anti-slop/. Pass another relative destination as the first argument when the repository has an established tooling layout. The script refuses to replace an existing destination; route existing copies through the update procedure rather than --force.

    Preserve the nested vendor/eslint-stylistic/LICENSE and UPSTREAM.md; they travel with the copied rule. Readability enforcement is self-contained and requires no Stylistic plugin dependency.

    Complete when the files, including vendored license and provenance, exist at the agreed destination without replacing an existing copy.

  2. Install current compatible dependencies rather than trusting versions remembered by the agent:

    • If the repository already depends on oxlint, read its installed version from the package manager or lockfile and install @oxlint/plugins at exactly that version. Pin it exactly rather than by range so future upgrades move both packages together.
    • Only when the repository has no oxlint dependency, query npm view oxlint version and npm view @oxlint/plugins version, then install the same current version of both packages.
    • oxlint is a development dependency. The copied source imports @oxlint/plugins, so install it as a development dependency for a local-only plugin.
    • Do not replace the package manager or rewrite unrelated dependency ranges.

    Complete when matching compatible versions are installed and unrelated dependency ranges are preserved.

  3. Register the generic plugin, configure ignores, and enable all generic rules. For oxlint.config.ts or .oxlintrc.json, merge these fields with the existing configuration:

    ignorePatterns: [
      ".agent/**",
      ".agents/**",
      ".claude/**",
      ".codex/**",
      ".continue/**",
      ".cursor/**",
      ".gemini/**",
      ".opencode/**",
      ".pi/**",
      ".roo/**",
      ".windsurf/**",
      "tools/oxlint/anti-slop/**",
    ],
    jsPlugins: [
      { name: "anti-slop", specifier: "./tools/oxlint/anti-slop/index.ts" },
    ],
    

    Keep every existing ignore. Adjust the final pattern when the plugin was copied elsewhere. Inspect the repository for other project-local agent tooling directories and add them rather than linting installed skills, hooks, or generated agent configuration as application source. Do not broadly ignore all dot-directories, because some repositories keep owned source or checks in them.

    For Vite+, add these fields to lint.ignorePatterns and lint.jsPlugins. Also merge the same patterns into fmt.ignorePatterns so vp check does not reformat installed agent assets or the vendored plugin. Merge existing entries instead of replacing them.

    Enable these rules at "error", including the native Oxlint companion rule:

    {
      "oxc/no-accumulating-spread": "error",
      "anti-slop/no-array-filter-map": "error",
      "anti-slop/no-reduce-accumulator-copy": "error",
      "anti-slop/no-chained-type-assertions": "error",
      "anti-slop/no-conditional-empty-object-spread": "error",
      "anti-slop/no-known-value-widening": "error",
      "anti-slop/no-module-mocking": "error",
      "anti-slop/no-object-parameters": "error",
      "anti-slop/no-reflect-apply": "error",
      "anti-slop/no-reflect-get": "error",
      "anti-slop/no-runtime-typeof": "error",
      "anti-slop/no-shape-in-symbol-names": "error",
      "anti-slop/no-unknown-par
    
常见问题

它会覆盖我的代码检查设置吗?

这项技能的设计会保留本地自定义内容,不会在没有谨慎更新的情况下替换现有副本。

插件会放在哪里?

默认会在仓库中创建一个工具文件夹,除非你指定了其他位置。

项目需要什么条件?

项目应使用 Oxlint,智能体会在安装前检查其代码检查设置。

详情

作者的原始描述

Install, configure, update, or upgrade vendored anti-slop Oxlint plugins. Use when adding anti-slop, picking up upstream rules or fixes, or migrating an existing installation while preserving local customizations.

repo: dmmulroy/anti-slop

热度

GitHub 星标
5.9k
排名
#14547
许可证
MIT
更新时间
2026/10/13

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

相似技能