Loading...
Loading...
Compare original and translation side by side
multi_linter.shPhase 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) — 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)multi_linter.shPhase 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) — 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)| Scenario | Agent sees | Hook exit |
|---|---|---|
| No violations | Nothing | 0 |
| All fixed by subprocess | Nothing | 0 |
| Violations remain after subprocess | | 2 |
| Advisory (duplicates, old tooling) | | 0 |
| 场景 | Agent可见内容 | 钩子退出码 |
|---|---|---|
| 无违规问题 | 无 | 0 |
| 所有问题都被子进程修复 | 无 | 0 |
| 子进程处理后仍有违规问题 | | 2 |
| 建议通知(重复项、旧工具等) | | 0 |
.ruff.tomlbiome.jsonprotect_linter_configs.shstop_config_guardian.shgit diff.ruff.tomlbiome.json.shellcheckrc.yamllint.hadolint.yaml.ruff.tomlbiome.jsonprotect_linter_configs.shstop_config_guardian.shgit diff.ruff.tomlbiome.json.shellcheckrc.yamllint.hadolint.yamlpippip3poetrypipenvuvnpmyarnpnpmbunnpm auditnpm viewnpm publishpippip3poetrypipenvuvnpmyarnpnpmbunnpm auditnpm viewnpm publishundefinedundefined
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.
无需安装命令,无需插件配置。当你在Plankton目录下运行Claude Code时,`.claude/settings.json`中的钩子会被自动加载。.claude/hooks/.claude/settings.json.ruff.tomlbiome.json.claude/hooks/.claude/settings.json.ruff.tomlbiome.json| Language | Required | Optional |
|---|---|---|
| Python | | |
| TypeScript/JS | | |
| Shell | | — |
| YAML | | — |
| Markdown | | — |
| Dockerfile | | — |
| TOML | | — |
| JSON | | — |
| 语言 | 必须依赖 | 可选依赖 |
|---|---|---|
| Python | | |
| TypeScript/JS | | |
| Shell | | — |
| YAML | | — |
| Markdown | | — |
| Dockerfile | | — |
| TOML | | — |
| JSON | | — |
| 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) |
| Config protection | — | PreToolUse blocks + Stop hook detection |
| Package manager | Detection + setup | Enforcement (blocks legacy PMs) |
| CI integration | — | Pre-commit hooks for git |
| Model routing | Manual ( | Automatic (violation complexity → tier) |
| 功能 | ECC | Plankton |
|---|---|---|
| 代码质量管控 | PostToolUse钩子(Prettier、tsc) | PostToolUse钩子(20+ linters + 子进程修复) |
| 安全扫描 | AgentShield、安全审查Agent | Bandit(Python)、Semgrep(TypeScript) |
| 配置保护 | — | PreToolUse拦截 + Stop钩子检测 |
| 包管理器 | 检测 + 配置 | 强制管控(阻止旧版包管理器) |
| CI集成 | — | Git预提交钩子 |
| 模型路由 | 手动( | 自动(根据违规复杂度分配等级) |
.claude/hooks/config.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_thresholdsubprocess_delegation: false.claude/hooks/config.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_thresholdsubprocess_delegation: false| Variable | Purpose |
|---|---|
| Skip Phase 3, report violations directly |
| Override tier timeout |
| Log model selection decisions |
| Bypass package manager enforcement |
| 变量 | 用途 |
|---|---|
| 跳过第三阶段,直接上报违规问题 |
| 覆写模型等级超时时间 |
| 打印模型选择决策日志 |
| 绕过包管理器强制管控 |