plankton-code-quality
Fungsinya
Plankton adalah sistem yang secara otomatis memeriksa dan memperbaiki kualitas kode Anda saat Anda mengetik. Sistem ini memformat kode, menemukan error, dan memakai AI untuk memperbaikinya, sehingga kode Anda selalu rapi dan berjalan dengan baik.
Kapan dipakai
- βSaat menyiapkan format kode otomatis.
- βSaat Anda ingin error kode langsung diperbaiki di tempat.
- βUntuk memastikan AI tidak menonaktifkan aturan kualitas demi 'memperbaiki' kode.
Link skill
https://github.com/affaan-m/ECC/blob/main/skills/plankton-code-quality/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βSiapkan Plankton untuk memformat dan memperbaiki kode Python dan TypeScript saya secara otomatis.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Saat Anda mengedit sebuah file, Plankton lebih dulu mencoba memformat kodenya sendiri. Jika masih ada masalah, Plankton mengidentifikasi error-nya lalu meminta AI (Claude) untuk memperbaikinya, kemudian memeriksa apakah perbaikannya berhasil.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Plankton Code Quality Skill
Integration reference for Plankton (credit: @alxfazio), a write-time code quality enforcement system for Claude Code. Plankton runs formatters and linters on every file edit via PostToolUse hooks, then spawns Claude subprocesses to fix violations the agent didn't catch.
When to Use
- You want automatic formatting and linting on every file edit (not just at commit time)
- You need defense against agents modifying linter configs to pass instead of fixing code
- You want tiered model routing for fixes (Haiku for simple style, Sonnet for logic, Opus for types)
- You work with multiple languages (Python, TypeScript, Shell, YAML, JSON, TOML, Markdown, Dockerfile)
How It Works
Three-Phase Architecture
Every time Claude Code edits or writes a file, Plankton's multi_linter.sh PostToolUse hook runs:
Phase 1: Auto-Format (Silent)
ββ Runs formatters (ruff format, biome, shfmt, taplo, markdownlint)
ββ Fixes 40-50% of issues silently
ββ No output to main agent
Phase 2: Collect Violations (JSON)
ββ Runs linters and collects unfixable violations
ββ Returns structured JSON: {line, column, code, message, linter}
ββ Still no output to main agent
Phase 3: Delegate + Verify
ββ Spawns claude -p subprocess with violations JSON
ββ Routes to model tier based on violation complexity:
β ββ Haiku: formatting, imports, style (E/W/F codes) β 120s timeout
β ββ Sonnet: complexity, refactoring (C901, PLR codes, oxlint complexity) β 300s timeout
β ββ Opus: type system, deep reasoning (unresolved-attribute) β 600s timeout
ββ Re-runs Phase 1+2 to verify fixes
ββ Exit 0 if clean, Exit 2 if violations remain (reported to main agent)
What the Main Agent Sees
| Scenario | Agent sees | Hook exit |
|---|---|---|
| No violations | Nothing | 0 |
| All fixed by subprocess | Nothing | 0 |
| Violations remain after subprocess | [hook] N violation(s) remain |
2 |
| Advisory (duplicates, old tooling) | [hook:advisory] ... |
0 |
The main agent only sees issues the subprocess couldn't fix. Most quality problems are resolved transparently.
Config Protection (Defense Against Rule-Gaming)
LLMs will modify .ruff.toml or biome.json to disable rules rather than fix code. Plankton blocks this with three layers:
- PreToolUse hook β
protect_linter_configs.shblocks edits to all linter configs before they happen - Stop hook β
stop_config_guardian.shdetects config changes viagit diffat session end - Protected files list β
.ruff.toml,biome.json,.shellcheckrc,.yamllint,.hadolint.yaml, and more
Package Manager Enforcement
A PreToolUse hook on Bash blocks legacy package managers:
pip,pip3,poetry,pipenvβ Blocked (useuv)npm,yarn,pnpmβ Blocked (usebun)- Allowed exceptions:
npm audit,npm view,npm publish
Setup
Quick Start
Note: Plankton requires manual installation from its repository. Review the code before installing.
# Install core dependencies
brew install jaq ruff uv
# Install Python linters
uv sync --all-extras
# Start Claude Code β hooks activate automatically
claude
No install command, no plugin config. The hooks in .claude/settings.json are picked up automatically when you run Claude Code in the Plankton directory.
Per-Project Integration
To use Plankton hooks in your own project:
- Copy
.claude/hooks/directory to your project - Copy
.claude/settings.jsonhook configuration - Copy linter config files (
.ruff.toml,biome.json, etc.) - Install the linters for your languages
Language-Specific Dependencies
| Language | Required | Optional |
|---|---|---|
| Python | ruff, uv |
ty (types), vulture (dead code), bandit (security) |
| TypeScript/JS | biome; oxlint (>= 1.37.0) when using complexity |
semgrep, knip (dead exports) |
| Shell | shellcheck, shfmt |
β |
| YAML | yamllint |
β |
| Markdown | markdownlint-cli2 |
β |
| Dockerfile | hadolint (>= 2.12.0) |
β |
| TOML | taplo |
β |
| JSON | jaq |
β |
Pairing with ECC
Complementary, Not Overlapping
| Concern | ECC | Plankton |
|---|---|---|
| Code quality enforcement | PostToolUse hooks (Prettier, tsc) | PostToolUse hooks (20+ linters + subprocess fixes) |
| Security scanning | AgentShield, security-reviewer agent | Bandit (Python), Semgrep (TypeScript) |
β¦
Pertanyaan umum
Apa itu 'hooks'?
Itu adalah titik sambung yang memungkinkan sebuah program (seperti Plankton) menjalankan tugas secara otomatis pada waktu tertentu, misalnya saat sebuah file disimpan.
Bagaimana Plankton mencegah AI 'curang' pada aturan kualitas?
Plankton memiliki mekanisme yang memblokir AI agar tidak mengubah aturan pemeriksaan kode, sehingga kode tidak terlihat benar padahal belum benar-benar diperbaiki.
Apakah saya perlu menginstal sesuatu untuk memakai Plankton?
Ya, Plankton perlu diinstal secara manual di komputer Anda. Setelah itu, Plankton bekerja secara otomatis bersama Claude Code.
Detail
Deskripsi asli dari pembuat
Write-time code quality enforcement using Plankton β auto-formatting, linting, and Claude-powered fixes on every file edit via hooks. Use when setting up write-time formatting, linting, or auto-fix hooks on file edits.
repo: affaan-m/ECC
Popularitas
- Bintang GitHub
- 280k
- Peringkat
- #381
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
accessibility
280kMembantu agent Anda membuat antarmuka yang ramah untuk semua orang. Memastikan website dan aplikasi tetap bisa dipakai penyandang disabilitas, seperti tunanetra.
agent-architecture-audit
280kMembuat agent Anda memeriksa apakah semuanya berjalan dengan benar. Agent akan menemukan dan memperbaiki masalah pada sistem AI agar bekerja sesuai harapan.
agent-eval
280kMembantu agent Anda membandingkan berbagai alat coding AI. Mengukur mana yang lebih cepat, lebih murah, dan lebih andal untuk tugas tertentu.
agent-harness-construction
280kMembuat agent Anda lebih memahami cara menyelesaikan tugas. Agent mengoptimalkan alat dan instruksi yang digunakan agar peluang berhasilnya lebih besar.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.