跳到正文
Skillpedia
通用编程12k · #11519

install-anti-slop

它能做什么

它指导 AI 把随附的 lint 插件复制到代码仓库中,并将其接入项目现有的 Oxlint 配置。适用于希望进行更严格代码质量检查的开发者。

适用场景

  • ✓当你想为 TypeScript 或 JavaScript 项目添加 anti-slop lint 规则时。
  • ✓当你想把现有的 anti-slop 配置迁移到新的代码仓库时。
  • ✓当你想用这些规则配置 Oxlint,同时保留当前设置时。

技能链接

https://github.com/trycompai/crm/blob/release/.agents/skills/install-anti-slop/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请在我的 TypeScript 项目中安装 anti-slop lint 规则,并保留我当前的 lint 设置。”

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

工作原理

AI 会检查项目的包管理器和现有 lint 配置,复制插件,安装兼容的包,并把规则接入其中。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Install anti-slop

Install the bundled Oxlint plugin into the current repository and integrate it with the repository's existing lint setup. Preserve unrelated work and adapt to the project's package manager and configuration style.

Procedure

  1. Inspect the repository before changing it:

    • Read its agent instructions.
    • Check git status and preserve unrelated changes.
    • Identify the package manager from packageManager and lockfiles.
    • Find Oxlint configuration (oxlint.config.*, .oxlintrc*, or a Vite+ config).
    • Check whether anti-slop files or rules already exist. Do not overwrite them without reviewing the diff.
  2. 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; only use --force after backing up and reviewing existing files.

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

    • Query npm view oxlint version and npm view @oxlint/plugins version.
    • Install the same current version of both packages with the repository's package manager.
    • 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.
  4. Register the plugin and enable all rules. For oxlint.config.ts or .oxlintrc.json, add:

    jsPlugins: [
      { name: "anti-slop", specifier: "./tools/oxlint/anti-slop/index.ts" },
    ],
    

    For Vite+, add that same entry to lint.jsPlugins. Merge it with existing entries instead of replacing them.

    Enable these rules at "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-object-parameters": "error",
      "anti-slop/no-runtime-typeof": "error",
      "anti-slop/no-shape-in-symbol-names": "error",
      "anti-slop/no-unknown-parameters": "error",
      "anti-slop/no-unknown-type-aliases": "error",
      "anti-slop/no-unsafe-dictionary-type": "error",
      "anti-slop/no-widen-then-assert": "error"
    }
    
  5. Run the repository's lint command and typecheck. If findings appear, report them and fix them only when the user asked for migration/cleanup. Do not suppress rules, weaken rule severity, add unsafe casts, or mechanically launder types to make lint pass.

  6. Review the final diff and clearly report:

    • copied path,
    • dependency versions installed,
    • configuration changed,
    • checks run and any remaining findings.

Migration guidance

When replacing an older local copy, compare its rules and diagnostics before overwriting. Keep project-specific rules in their own plugin; anti-slop is intentionally generic. Prefer inference, as const, satisfies, named owner contracts, and boundary parsing when resolving findings.

常见问题

它会覆盖我现有的文件吗?

它拒绝替换已存在的目标文件,只有在备份并经过审核之后,才会强制覆盖。

它使用哪个 linter?

它使用 Oxlint,并安装其当前兼容版本及其插件包。

它需要特定的包管理器吗?

不需要。它会根据设置文件和锁文件找出项目的包管理器,并适配使用。

详情

作者的原始描述

Install and configure the anti-slop Oxlint plugin in a local TypeScript or JavaScript repository. Use whenever a user asks to add anti-slop lint rules, copy the anti-slop plugin, configure opinionated Oxlint rules, or migrate an existing local anti-slop setup.

repo: trycompai/crm

热度

GitHub 星标
12k
排名
#11519
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能