一键导入
statico-plugin
Build, test, or debug a statico plugin. Use when the user wants to write a project-specific rule, scaffold a plugin, or investigate plugin behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build, test, or debug a statico plugin. Use when the user wants to write a project-specific rule, scaffold a plugin, or investigate plugin behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | statico-plugin |
| description | Build, test, or debug a statico plugin. Use when the user wants to write a project-specific rule, scaffold a plugin, or investigate plugin behavior. |
.statico/plugins/Get the current protocol — don't write it from memory. The plugin protocol can change between minor releases:
statico plugin docs # full human-readable reference
statico plugin schema --format json # JSON schema (paste into prompts)
Scaffold a new plugin. The CLI writes a working skeleton with the right SDK wiring for the language:
statico plugin init my-rule --lang typescript # default
statico plugin init my-rule --lang rust
statico plugin init my-rule --lang python
Output lands in .statico/plugins/my-rule/.
Implement the detection logic in the scaffolded entry file
(index.ts / src/main.rs / plugin.py). Look for the TODO
comments. Use the SDK's hook callbacks — never hand-roll JSON-RPC
unless you know what you're doing.
Iterate against a fixture:
statico plugin run my-rule --file fixtures/sample.ts
The output is the JSON-RPC result so you can see exactly what
statico will receive.
Verify the runtime is ready before reporting failures:
statico plugin doctor # checks bun (TS) / cargo (Rust) / python3
Build (Rust only):
statico plugin build --name my-rule
TypeScript and Python don't need a build step.
analyze_file (mode add) — most plugins. Per-file detection, contributes
alongside built-in checks.post_analysis (mode add) — cross-file rules that need the whole project
state (e.g. "every exported function should have a test").discover_entries, resolve_import, format_output — override only.
Replaces the built-in stage. Use sparingly.override the same hook — fatal at startup.pluginSettings (from [plugin.settings] in .statico.toml) is capped at
64 KB serialized JSON.statico analyze run, so
expensive setup goes in init, not analyze_file.statico plugin docs — protocol, hooks, message shapesstatico plugin schema --format json — wire-format JSON schemaexamples/plugins/coverage-gap (in the statico repo) — multi-hook reference pluginReclaim disk space by cleaning build artifacts, dependency caches, and benchmark repos. Auto-invokes before merges, releases, and after big branch switches — or whenever the user asks to clean up, free space, or trim the repo.
Keep statico's user-facing documentation in lockstep with code changes. Auto-invoke proactively whenever the user adds, removes, or modifies CLI flags, subcommands, config keys (`.statico.toml` / `StaticoConfig`), output formats, plugin hooks, plugin protocol fields, the public Rust API (`src/lib.rs` re-exports), template content (`templates/`), or framework profiles. Also invoke when bumping `Cargo.toml` `version`, `rust-version`, or dependency versions that change behavior, and when the user mentions "ship", "release", "publish", or "the docs are stale". Verifies README.md, CHANGELOG.md, the files under `docs/`, the templates under `templates/`, and the example plugin under `examples/plugins/`. Default action is to AUDIT and report drift; only edit when the user confirms or the drift is mechanically obvious (e.g., the README CLI table is missing a flag we just merged).
Run a statico code health analysis on the current project. Presents a human-readable summary of dead code, unused exports, circular dependencies, and overall health score. Use when asked to check code health, find dead code, or review code quality.
Interactive dead code cleanup using statico analysis. Identifies dead files, presents them with context, and helps safely remove them one by one. Use when asked to clean up dead code, remove unused files, or reduce codebase size.
Measure the impact of refactoring using statico before/after analysis. Snapshots code health before changes and compares after. Use when planning or completing a refactoring, measuring code quality improvements, or verifying cleanup effectiveness.
Develop, test, and debug statico plugins. Use when creating plugins, modifying plugin code, or running the plugin development workflow (init, build, run, doctor).