Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)280k Β· #381

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.md

Salin 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

Gunakan skill ini untuk membantu saya: https://github.com/affaan-m/ECC/blob/main/skills/plankton-code-quality/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

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:

  1. PreToolUse hook β€” protect_linter_configs.sh blocks edits to all linter configs before they happen
  2. Stop hook β€” stop_config_guardian.sh detects config changes via git diff at session end
  3. 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 (use uv)
  • npm, yarn, pnpm β†’ Blocked (use bun)
  • 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:

  1. Copy .claude/hooks/ directory to your project
  2. Copy .claude/settings.json hook configuration
  3. Copy linter config files (.ruff.toml, biome.json, etc.)
  4. 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

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa