一键导入
pre-commit
Run all pre-commit checks before committing. Run all quality checks including format check, clippy, tests, and verify no secrets or TODOs are staged.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run all pre-commit checks before committing. Run all quality checks including format check, clippy, tests, and verify no secrets or TODOs are staged.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run clippy with auto-fix and report issues. Automatically fix issues that clippy knows how to fix safely, then report remaining warnings that need manual attention.
Step-by-step checklist for adding a new agent type to Panoptes. Follow the checklist to add the enum variant, create the adapter implementation, and update the factory method.
Step-by-step checklist for adding a new input mode to Panoptes. Follow the checklist to add the enum variant, create the handler in the appropriate module, and update the dispatcher.
Generate test scaffolding for untested modules. Analyze public functions, identify test cases, and create comprehensive test coverage.
Step-by-step checklist for adding a new view to Panoptes. Follow the checklist to create the view enum variant, render function, input handler, and update all dispatch points.
Guide for creating a new selectable list menu with consistent styling and behavior. Provides step-by-step instructions for adding state management, view rendering, input handling, and consistent selection styling across all menus.
| name | pre-commit |
| description | Run all pre-commit checks before committing. Run all quality checks including format check, clippy, tests, and verify no secrets or TODOs are staged. |
Run all quality checks before committing code changes.
cargo fmt --check
Verify code is properly formatted. If this fails, run cargo fmt to fix.
cargo lint
Ensure no clippy warnings. Fix any issues before committing.
cargo test
Verify all tests pass. Do not commit if tests fail.
git diff --cached | grep -E '^\+.*TODO|^\+.*FIXME' || true
Review any new TODO/FIXME comments. These should have associated issues.
# Check for potentially sensitive files
git diff --cached --name-only | grep -E '\.env|credentials|secret|key\.json' || true
# Check for API key patterns
git diff --cached | grep -E 'api[_-]?key|password|secret' || true
Never commit secrets. Use environment variables instead.
git status --short
Review what's being committed. Avoid committing:
.env filesRun all checks in sequence:
cargo fmt --check && \
cargo lint && \
cargo test && \
echo "All checks passed!"
| Check | Fix |
|---|---|
| Format failed | Run cargo fmt |
| Clippy warning | Fix the warning or #[allow(...)] with justification |
| Test failed | Fix the test or the code |
| Secret detected | Remove and use env var |
Pre-Commit Checks:
[1/5] Format check... OK
[2/5] Clippy... OK (0 warnings)
[3/5] Tests... OK (261 passed)
[4/5] TODO/FIXME check... 0 new comments
[5/5] Secrets check... OK
All checks passed! Ready to commit.
--no-verify to skip checksAfter passing all checks, create a descriptive commit: