dev/skills/csa-test-gen/SKILL.md
Comprehensive test design for Rust projects following Core-first TDD and test pyramid principles
npx skillsauth add ryderfreeman4logos/cli-sub-agent csa-test-genInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive test design for Rust projects following Core-first TDD and test pyramid principles.
Always test pure logic BEFORE UI:
1. Write pure logic in core/ or domain/ module
2. Write unit tests for core logic
3. Verify all tests pass
4. Only THEN implement UI layer
Target: 70% unit, 20% integration, 10% E2E
#[cfg(test)]
mod tests {
use super::*;
// Naming: test_<function>_<scenario>_<expected>
#[test]
fn test_parse_valid_input_returns_expected() {
// Arrange
let input = "valid_input";
// Act
let result = parse(input);
// Assert
assert_eq!(result, expected_value);
}
#[test]
fn test_parse_empty_input_returns_error() {
let result = parse("");
assert!(result.is_err());
}
}
| Category | Focus | Example |
|----------|-------|---------|
| Happy Path | Typical valid input | parse("valid") -> Ok(value) |
| Boundary | Empty, null, min, max, +/-1 | parse("") -> Err(...) |
| Error | Invalid input, not found, denied | parse("@#$") -> Err(...) |
| Concurrent | Race conditions, deadlock | Multiple tasks with shared state |
// Define trait abstraction
pub trait UserRepository {
fn find(&self, id: &str) -> Option<User>;
}
// Test mock
#[cfg(test)]
struct MockUserRepository {
users: HashMap<String, User>,
}
#[cfg(test)]
impl UserRepository for MockUserRepository {
fn find(&self, id: &str) -> Option<User> {
self.users.get(id).cloned()
}
}
use proptest::prelude::*;
proptest! {
#[test]
fn prop_serialize_roundtrip(value in any::<MyType>()) {
let serialized = serde_json::to_string(&value).unwrap();
let deserialized: MyType = serde_json::from_str(&serialized).unwrap();
prop_assert_eq!(value, deserialized);
}
}
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
if let Ok(input) = std::str::from_utf8(data) {
let _ = parse(input); // Should never panic
}
});
#[tokio::test]tools
--- name = "csa-setup" version = "0.1.0" description = "Install CSA, Weave, and coding workflow patterns for AI agent bots" homepage = "https://github.com/RyderFreeman4Logos/cli-sub-agent" target = "agent-bots" --- # CSA Setup > Installation guide for AI agent bots (openclaw, Moltis, etc.) to set up > CSA and Weave with optional coding workflow patterns. ## Skill Files | File | Description | |------|-------------| | **skill.md** (this file) | Installation and setup guide | | **skills/AGENTS.
testing
Use when: converting TODO plan or open GitHub issues into deterministic execution checklist
development
Use when: full dev cycle branch->plan->implement->review->PR->merge
development
Use when: running CSA-driven code review, independent model selection