본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)280k · #381

plankton-code-quality

하는 일

Plankton은 코드를 입력하는 동안 코드 품질을 자동으로 검사하고 고치는 시스템입니다. 코드 서식을 맞추고, 오류를 찾고, AI를 사용해 고쳐서 코드가 항상 깔끔하고 잘 작동하도록 합니다.

사용하는 경우

  • ✓자동 코드 서식을 설정할 때.
  • ✓코드 오류를 즉시 고치고 싶을 때.
  • ✓AI가 코드를 '고친다'며 품질 규칙을 끄지 않도록 할 때.

스킬 링크

https://github.com/affaan-m/ECC/blob/main/skills/plankton-code-quality/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/skills/plankton-code-quality/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Plankton을 설정해서 제 Python과 TypeScript 코드를 자동으로 정리하고 고쳐 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

파일을 편집하면 Plankton은 먼저 코드 자체를 정리하려고 시도합니다. 그래도 문제가 남으면 오류를 찾아 AI(Claude)에게 고치도록 요청하고, 고쳐졌는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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)

…

자주 묻는 질문

'hooks'는 무엇인가요?

파일을 저장할 때처럼 특정 시점에 Plankton 같은 프로그램이 작업을 자동으로 실행할 수 있게 하는 연결 지점입니다.

Plankton은 AI가 품질 규칙을 '속이는 것'을 어떻게 막나요?

AI가 코드 검사 규칙을 바꾸지 못하도록 막는 장치가 있습니다. 그래서 코드가 실제로 고쳐지지 않았는데도 올바르게 보이는 일을 막습니다.

Plankton을 쓰려면 무엇인가 설치해야 하나요?

네. Plankton은 컴퓨터에 직접 설치해야 합니다. 설치 후에는 Claude Code와 함께 자동으로 작동합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
280k
순위
#381
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬