test-driven-development
OBobra/superpowers298k2,631 new stars in the last 7 days
Validates data against common and custom rules (required fields, formats, ranges). Use when checking data quality, input validation, or enforcing schemas and constraints.
Validate data against specified rules. This skill provides a flexible validation framework supporting common validation patterns like email format, required fields, and custom rules.
None
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| data | Map<String, Any> | Yes | - | The data to validate |
| rules | List | Yes | - | List of validation rules to apply |
Returns a SkillResult with the following data structure on success:
{
"validationResults": {
"rule1": true,
"rule2": true
}
}
On failure, returns:
{
"validationResults": {
"rule1": true,
"rule2": false
},
"errors": ["error message 1", "error message 2"]
}
| Rule | Description | Example |
|---|---|---|
| Validates email format | "[email protected]" | |
| required | Checks all fields are non-null and non-blank | All values must be present |
val result = registry.execute(
skillId = "data-validation",
context = context,
params = mapOf(
"data" to mapOf("email" to "[email protected]"),
"rules" to listOf("email")
)
)
val result = registry.execute(
skillId = "data-validation",
context = context,
params = mapOf(
"data" to mapOf(
"email" to "[email protected]",
"name" to "John Doe",
"age" to "25"
),
"rules" to listOf("email", "required")
)
)
The skill returns a failure result in the following cases:
datarulesrules listTo add custom validation rules, extend the skill and override the execute method to handle additional rule types:
class ExtendedDataValidationSkill : DataValidationSkill() {
override suspend fun execute(context: SkillContext, params: Map<String, Any>): SkillResult {
// Handle custom rules first
val rules = params["rules"] as? List<String> ?: emptyList()
if (rules.contains("custom-rule")) {
// Implement custom validation
}
// Delegate to parent for standard rules
return super.execute(context, params)
}
}
OBobra/superpowers298k2,631 new stars in the last 7 days
MAmattpocock/skills288k10,178 new stars in the last 7 days
AFaffaan-m/ECC278k4,046 new stars in the last 7 days
Audit accessibility on Web, iOS, and Android to meet WCAG 2.2, with keyboard navigation and screen-reader support.
AFaffaan-m/ECC278k4,046 new stars in the last 7 days
AFaffaan-m/ECC278k4,046 new stars in the last 7 days
FIfirecrawl/firecrawl191k2,010 new stars in the last 7 days