Pre/post-operation validation to detect missing components and prevent future issues
Automatically validates system integrity before and after operations by taking snapshots of all components. Triggers during major operations like restructuring, refactoring, or release preparation to detect missing agents, commands, or skills within 5 seconds.
/plugin marketplace add bejranonda/LLM-Autonomous-Agent-Plugin-for-Claude/plugin install bejranonda-autonomous-agent@bejranonda/LLM-Autonomous-Agent-Plugin-for-ClaudeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
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:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.