Loading...
Loading...
Pre/post-operation validation to detect missing components and prevent future issues
npx skill4agent add bejranonda/llm-autonomous-agent-plugin-for-claude integrity-validation# 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)/workspace:improve/dev:releaseasync 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", ...]
}
}
}
}