Agent skill

Plankton Code Quality

by affaan-m in affaan-m/ECC

使用Plankton进行编写时代码质量强制执行——通过钩子在每次文件编辑时自动格式化、代码检查和Claude驱动的修复。

MITAuto-check passedDevelopment

Install Plankton Code Quality

skills CLI
$ npx skills add affaan-m/ECC --skill plankton-code-quality -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC plankton-code-quality --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/docs/zh-CN/skills/plankton-code-quality .claude/skills/plankton-code-quality && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
plankton-code-quality
GitHub stars
276k
Used in
2 other repos
Token cost
~1.3k tokens
SKILL.md length
338 words
Files
1
Skills in repo
673
Repo updated
First seen
Licence
MIT

At a glance

使用Plankton进行编写时代码质量强制执行——通过钩子在每次文件编辑时自动格式化、代码检查和Claude驱动的修复。

  • Works in 3 steps: PreToolUse 钩子 —… → Stop 钩子 — stop_config_guardian.sh… → 受保护文件列表 — .ruff.toml, biome.json,…
  • Tasks that involve Code quality
  • SKILL.md covers 何时使用, 工作原理, 设置 and 与 ECC 配对使用, plus 4 more sections
  • Calls npm, git and brew; reaches github.com

What it does

Plankton Code Quality is an agent skill from affaan-m/ECC. 使用Plankton进行编写时代码质量强制执行——通过钩子在每次文件编辑时自动格式化、代码检查和Claude驱动的修复。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Code quality and Linting and formatting. It works with Ruff, npm, Python and TypeScript. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

When your agent uses it

  • Tasks that involve Code quality
  • Tasks that involve Linting and formatting

Example prompts

  • “/plankton-code-quality”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. PreToolUse 钩子 — protect_linter_configs.sh 在编辑发生前阻止对所有 linter 配置的修改
  2. Stop 钩子 — stop_config_guardian.sh 在会话结束时通过 git diff 检测配置更改
  3. 受保护文件列表 — .ruff.toml, biome.json, .shellcheckrc, .yamllint, .hadolint.yaml 等

What it can do on your machine

Read from SKILL.md and the folder at commit ef648e0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • git
    • brew
    • uv
    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Plankton Code Quality loads about 1.3k tokens when it runs. Until then it costs about 21 tokens; SKILL.md has 338 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~21
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit ef648e0, republished under its MIT licence (© affaan-m). 338 words, ~1,316 tokens.

Download SKILL.mdSave it as .claude/skills/plankton-code-quality/SKILL.md (or your agent's skills folder).
name
plankton-code-quality
description
使用Plankton进行编写时代码质量强制执行——通过钩子在每次文件编辑时自动格式化、代码检查和Claude驱动的修复。
origin
community

Plankton 代码质量技能

Plankton(作者:@alxfazio)的集成参考,这是一个用于 Claude Code 的编写时代码质量强制执行系统。Plankton 通过 PostToolUse 钩子在每次文件编辑时运行格式化程序和 linter,然后生成 Claude 子进程来修复代理未捕获的违规。

何时使用

  • 你希望每次文件编辑时都自动格式化和检查(不仅仅是提交时)
  • 你需要防御代理修改 linter 配置以通过检查,而不是修复代码
  • 你想要针对修复的分层模型路由(简单样式用 Haiku,逻辑用 Sonnet,类型用 Opus)
  • 你使用多种语言(Python、TypeScript、Shell、YAML、JSON、TOML、Markdown、Dockerfile)

工作原理

三阶段架构

每次 Claude Code 编辑或写入文件时,Plankton 的 multi_linter.sh PostToolUse 钩子都会运行:

阶段 1:自动格式化(静默)
├─ 运行格式化工具(ruff format、biome、shfmt、taplo、markdownlint)
├─ 静默修复 40-50% 的问题
└─ 无输出至主代理

阶段 2:收集违规项(JSON)
├─ 运行 linter 并收集无法修复的违规项
├─ 返回结构化 JSON:{line, column, code, message, linter}
└─ 仍无输出至主代理

阶段 3:委托 + 验证
├─ 生成带有违规项 JSON 的 claude -p 子进程
├─ 根据违规项复杂度路由至模型层级:
│   ├─ Haiku:格式化、导入、样式(E/W/F 代码)—— 120 秒超时
│   ├─ Sonnet:复杂度、重构(C901、PLR 代码)—— 300 秒超时
│   └─ Opus:类型系统、深度推理(unresolved-attribute)—— 600 秒超时
├─ 重新运行阶段 1+2 以验证修复
└─ 若清理完毕则退出码 0,若违规项仍存在则退出码 2(报告至主代理)
主代理看到的内容
场景代理看到钩子退出码
无违规无0
全部由子进程修复无0
子进程后仍存在违规[hook] N violation(s) remain2
建议性警告(重复项、旧工具)[hook:advisory] ...0

主代理只看到子进程无法修复的问题。大多数质量问题都是透明解决的。

配置保护(防御规则博弈)

LLM 会修改 .ruff.toml 或 biome.json 来禁用规则,而不是修复代码。Plankton 通过三层防御阻止这种行为:

  1. PreToolUse 钩子 — protect_linter_configs.sh 在编辑发生前阻止对所有 linter 配置的修改
  2. Stop 钩子 — stop_config_guardian.sh 在会话结束时通过 git diff 检测配置更改
  3. 受保护文件列表 — .ruff.toml, biome.json, .shellcheckrc, .yamllint, .hadolint.yaml 等
包管理器强制执行

Bash 上的 PreToolUse 钩子会阻止遗留包管理器:

  • pip, pip3, poetry, pipenv → 被阻止(使用 uv)
  • npm, yarn, pnpm → 被阻止(使用 bun)
  • 允许的例外:npm audit, npm view, npm publish

设置

快速开始
bash
# Clone Plankton into your project (or a shared location)
# Note: Plankton is by @alxfazio
git clone https://github.com/alexfazio/plankton.git
cd plankton

# Install core dependencies
brew install jaq ruff uv

# Install Python linters
uv sync --all-extras

# Start Claude Code — hooks activate automatically
claude

无需安装命令,无需插件配置。当你运行 Claude Code 时,.claude/settings.json 中的钩子会在 Plankton 目录中被自动拾取。

按项目集成

要在你自己的项目中使用 Plankton 钩子:

  1. 将 .claude/hooks/ 目录复制到你的项目
  2. 复制 .claude/settings.json 钩子配置
  3. 复制 linter 配置文件(.ruff.toml, biome.json 等)
  4. 为你使用的语言安装 linter
语言特定依赖
语言必需可选
Pythonruff, uvty(类型), vulture(死代码), bandit(安全)
TypeScript/JSbiomeoxlint, semgrep, knip(死导出)
Shellshellcheck, shfmt—
YAMLyamllint—
Markdownmarkdownlint-cli2—
Dockerfilehadolint (>= 2.12.0)—
TOMLtaplo—
JSONjaq—

与 ECC 配对使用

互补而非重叠
关注点ECCPlankton
代码质量强制执行PostToolUse 钩子 (Prettier, tsc)PostToolUse 钩子 (20+ linter + 子进程修复)
安全扫描AgentShield, security-reviewer 代理Bandit (Python), Semgrep (TypeScript)
配置保护—PreToolUse 阻止 + Stop 钩子检测
包管理器检测 + 设置强制执行(阻止遗留包管理器)
CI 集成—用于 git 的 pre-commit 钩子
模型路由手动 (/model opus)自动(违规复杂度 → 层级)
推荐组合
  1. 将 ECC 安装为你的插件(代理、技能、命令、规则)
  2. 添加 Plankton 钩子以实现编写时质量强制执行
  3. 使用 AgentShield 进行安全审计
  4. 在 PR 之前使用 ECC 的 verification-loop 作为最后一道关卡
避免钩子冲突

如果同时运行 ECC 和 Plankton 钩子:

  • ECC 的 Prettier 钩子和 Plankton 的 biome 格式化程序可能在 JS/TS 文件上冲突
  • 解决方案:使用 Plankton 时禁用 ECC 的 Prettier PostToolUse 钩子(Plankton 的 biome 更全面)
  • 两者可以在不同的文件类型上共存(ECC 处理 Plankton 未覆盖的内容)

配置参考

Plankton 的 .claude/hooks/config.json 控制所有行为:

json
{
  "languages": {
    "python": true,
    "shell": true,
    "yaml": true,
    "json": true,
    "toml": true,
    "dockerfile": true,
    "markdown": true,
    "typescript": {
      "enabled": true,
      "js_runtime": "auto",
      "biome_nursery": "warn",
      "semgrep": true
    }
  },
  "phases": {
    "auto_format": true,
    "subprocess_delegation": true
  },
  "subprocess": {
    "tiers": {
      "haiku":  { "timeout": 120, "max_turns": 10 },
      "sonnet": { "timeout": 300, "max_turns": 10 },
      "opus":   { "timeout": 600, "max_turns": 15 }
    },
    "volume_threshold": 5
  }
}

关键设置:

  • 禁用你不使用的语言以加速钩子
  • volume_threshold — 违规数量超过此值自动升级到更高的模型层级
  • subprocess_delegation: false — 完全跳过第 3 阶段(仅报告违规)

环境变量覆盖

变量目的
HOOK_SKIP_SUBPROCESS=1跳过第 3 阶段,直接报告违规
HOOK_SUBPROCESS_TIMEOUT=N覆盖层级超时时间
HOOK_DEBUG_MODEL=1记录模型选择决策
HOOK_SKIP_PM=1绕过包管理器强制执行

参考

  • Plankton(作者:@alxfazio)
  • Plankton REFERENCE.md — 完整的架构文档(作者:@alxfazio)
  • Plankton SETUP.md — 详细的安装指南(作者:@alxfazio)

ECC v1.8 新增内容

可复制的钩子配置文件

设置严格的质量行为:

bash
export ECC_HOOK_PROFILE=strict
export ECC_QUALITY_GATE_FIX=true
export ECC_QUALITY_GATE_STRICT=true
语言关卡表
  • TypeScript/JavaScript:首选 Biome,Prettier 作为后备
  • Python:Ruff 格式/检查
  • Go:gofmt
配置篡改防护

在质量强制执行期间,标记同一迭代中对配置文件的更改:

  • biome.json, .eslintrc*, prettier.config*, tsconfig.json, pyproject.toml

如果配置被更改以抑制违规,则要求在合并前进行明确审查。

CI 集成模式

在 CI 中使用与本地钩子相同的命令:

  1. 运行格式化程序检查
  2. 运行 lint/类型检查
  3. 严格模式下快速失败
  4. 发布修复摘要
健康指标

跟踪:

  • 被关卡标记的编辑
  • 平均修复时间
  • 按类别重复违规
  • 因关卡失败导致的合并阻塞

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in docs/zh-CN/skills/plankton-code-quality of affaan-m/ECC.

Open the folder on GitHubat commit ef648e0

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in affaan-m/ECC, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Plankton Code Quality next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Plankton Code Quality compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Plankton Code Quality this skillaffaan-m/ECC276k2 repos~1.3kAutomated safety check: PassMIT
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.3k—~2.2kAutomated safety check: PassMIT
Align Recipe pyproject.tomlgoogle/adk-recipes10k—~4.6kAutomated safety check: PassApache-2.0
Cb Code QualityBlkLeg/CircuitBreaker201—~1.9kAutomated safety check: PassMIT
Megatron-LM Linting and FormattingNVIDIA/Megatron-LM18k—~316Automated safety check: PassApache-2.0
Code Qualitynotque/vexjoy-agent439—~1.5kAutomated safety check: NotesMIT

Similar skills

  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.3k GitHub stars~2.2k tokensUpdated 29 days ago
    DevelopmentAuto-check passed
  • Align Recipe pyproject.toml

    google/adk-recipes

    Official

    Brings a Python recipe's pyproject.toml in line with the repo's CI rules, either as a read-only dry run or by rewriting the file while keeping comments.

    10k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Cb Code Quality

    BlkLeg/CircuitBreaker

    Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers.

    201 GitHub stars~1.9k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Official

    Runs the Megatron-LM autoformat script and its linting tools before a pull request, and keeps Python imports in order with isort.

    18k GitHub stars~316 tokensUpdated today
    DevelopmentAuto-check passed
  • Code Quality

    notque/vexjoy-agent

    Code quality: cleanup, linting, formatting, quality gates. An agent skill from notque/vexjoy-agent.

    439 GitHub stars~1.5k tokensUpdated 6 days ago
    DevelopmentAuto-check: notes
  • ONNX Runtime Lint

    microsoft/onnxruntime

    Official

    Lints and formats C++ and Python code in the ONNX Runtime repository with lintrunner, clang-format and ruff, preferring a pass over only the changed files.

    22k GitHub stars~392 tokensUpdated today
    DevelopmentAuto-check passed

More from affaan-m/ECC

All 673 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    276k GitHub starsUsed in 5 repos~1.9k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    276k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    276k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    276k GitHub stars~2.9k tokensUpdated 4 days ago
    Auto-check passed
  • Measures whether agents actually follow a skill, rule or agent definition by generating scenarios at three strictness levels and scoring tool-call traces.

    276k GitHub starsUsed in 1 repo~623 tokens
    Auto-check passed
  • Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

    276k GitHub stars~3.5k tokensUpdated 4 days ago
    Auto-check passed

Categories

Questions about Plankton Code Quality

What does Plankton Code Quality do?

使用Plankton进行编写时代码质量强制执行——通过钩子在每次文件编辑时自动格式化、代码检查和Claude驱动的修复。. Plankton Code Quality is an agent skill from affaan-m/ECC.

When should I use Plankton Code Quality?

Plankton Code Quality fits situations like: tasks that involve Code quality; tasks that involve Linting and formatting.

How do I install Plankton Code Quality in Claude Code?

Run `npx skills add affaan-m/ECC --skill plankton-code-quality -a claude-code`. Or copy the skill folder (docs/zh-CN/skills/plankton-code-quality in affaan-m/ECC) into .claude/skills/plankton-code-quality in your project. Claude Code loads it when a task matches its description.

How do I install Plankton Code Quality in Codex?

Run `npx skills add affaan-m/ECC --skill plankton-code-quality -a codex`. Or copy the skill folder (docs/zh-CN/skills/plankton-code-quality in affaan-m/ECC) into .agents/skills/plankton-code-quality in your project. Codex loads it when a task matches its description.

Can I use Plankton Code Quality in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill plankton-code-quality -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/plankton-code-quality, .gemini/skills/plankton-code-quality, .github/skills/plankton-code-quality and .opencode/skills/plankton-code-quality in your project.

What does Plankton Code Quality need to run?

Going by SKILL.md and its folder, Plankton Code Quality needs the command-line tools its instructions call (npm, git, brew, uv and claude). Our summary lists: Python 3.

Does Plankton Code Quality access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Plankton Code Quality safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Plankton Code Quality use?

Plankton Code Quality is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Plankton Code Quality use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Plankton Code Quality?

Skills that share tags, products or a category with Plankton Code Quality: Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.3k stars), Align Recipe pyproject.toml (google/adk-recipes, 10k stars), Cb Code Quality (BlkLeg/CircuitBreaker, 201 stars) and Megatron-LM Linting and Formatting (NVIDIA/Megatron-LM, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Plankton Code Quality?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 275,546 GitHub stars. The repository holds 673 skills in this directory. The repository was last updated on October 5, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.