Pre/post-operation validation to detect missing components and prevent future issues
The Integrity Validation System prevents future component loss by:
# Before any major operation (restructuring, refactoring, migration)
pre_operation_inventory = {
"agents": list_all_agents(),
"commands": list_all_commands(),
"skills": list_all_skills(),
"patterns": list_all_patterns(),
"critical_files": identify_critical_files()
}
# Store snapshot
store_validation_snapshot("pre_operation", pre_operation_inventory)
# After operation completes
post_operation_inventory = {
"agents": list_all_agents(),
"commands": list_all_commands(),
"skills": list_all_skills(),
"patterns": list_all_patterns(),
"critical_files": identify_critical_files()
}
# Compare and report discrepancies
differences = compare_inventories(pre_operation_inventory, post_operation_inventory)
if differences.missing_components:
alert_missing_components(differences)
suggest_recovery_options(differences)
Critical Components (must exist):
Warning Components (should exist):
Optional Components (nice to have):
/workspace:improve - Plugin modifications/dev:release - Release preparationasync def validate_operation_integrity(operation_type):
# 1. Pre-operation snapshot
pre_snapshot = await create_inventory_snapshot()
# 2. Execute operation
await execute_operation(operation_type)
# 3. Post-operation validation
post_snapshot = await create_inventory_snapshot()
# 4. Compare and analyze
issues = compare_snapshots(pre_snapshot, post_snapshot)
# 5. Handle issues
if issues.critical:
await handle_critical_issues(issues)
elif issues.warnings:
await suggest_improvements(issues)
return issues
{
"validation_snapshot": {
"operation": "command_restructure",
"timestamp": "2025-01-27T10:30:00Z",
"pre_inventory": {
"commands": {
"count": 23,
"files": ["commands/dev/auto.md", "commands/analyze/project.md", ...]
},
"agents": {
"count": 19,
"files": ["agents/orchestrator.md", "agents/code-analyzer.md", ...]
}
},
"post_inventory": {
"commands": {
"count": 22,
"files": ["commands/dev/auto.md", "commands/analyze/project.md", ...]
},
"agents": {
"count": 19,
"files": ["agents/orchestrator.md", "agents/code-analyzer.md", ...]
}
}
}
}
Always Apply:
Recommended:
This system specifically prevents:
npx skills add bejranonda/integrity-validation下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer