一键导入
add-tests
Generate test scaffolding for untested modules. Analyze public functions, identify test cases, and create comprehensive test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate test scaffolding for untested modules. Analyze public functions, identify test cases, and create comprehensive test coverage.
用 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.
Run all pre-commit checks before committing. Run all quality checks including format check, clippy, tests, and verify no secrets or TODOs are staged.
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.
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 | add-tests |
| description | Generate test scaffolding for untested modules. Analyze public functions, identify test cases, and create comprehensive test coverage. |
Generate test scaffolding for untested modules in Panoptes.
Analyze the target module
Determine testable components
Generate test scaffolding
Add a #[cfg(test)] block at the end of the module:
#[cfg(test)]
mod tests {
use super::*;
// Helper functions for creating test fixtures
fn create_test_item() -> ItemType {
// ...
}
#[test]
fn test_function_name_basic() {
// Arrange
let input = create_test_item();
// Act
let result = function_name(input);
// Assert
assert_eq!(result, expected);
}
#[test]
fn test_function_name_edge_case() {
// Test edge cases
}
}
Test categories to include
#[test]
fn test_navigate_to_project() {
let mut state = AppState::default();
let project_id = uuid::Uuid::new_v4();
state.navigate_to_project(project_id);
assert_eq!(state.view, View::ProjectDetail(project_id));
assert_eq!(state.selected_branch_index, 0);
}
#[test]
fn test_filter_empty_query() {
let items = create_test_items();
let filtered = filter_items(&items, "");
assert_eq!(filtered.len(), items.len());
}
#[test]
fn test_filter_case_insensitive() {
let items = create_test_items();
let filtered = filter_items(&items, "MAIN");
assert!(filtered.iter().any(|i| i.name == "main"));
}
#[test]
fn test_event_type_roundtrip() {
for event_type in [EventType::A, EventType::B, EventType::C] {
let str_repr = event_type.as_str();
let parsed: EventType = str_repr.into();
assert_eq!(parsed, event_type);
}
}
Tests often need:
use tempfile::TempDir; // For filesystem tests
use uuid::Uuid; // For ID generation
After running this skill, you should have:
#[cfg(test)] module with testsassert!(true))