Reusable validation pattern for scanning, comparing, reporting, and fixing plugin integrity issues. Implements the Scan-Compare-Report-Apply workflow for checking agents, routing, output styles, and hooks against their schemas. Use when validating plugin structure, debugging configuration issues, or building custom validators. Do NOT use for runtime validation or user input checking - this is specifically for popkit plugin component integrity.
/plugin marketplace add jrc1883/popkit-claude/plugin install popkit@popkit-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
The validation engine provides a reusable pattern for validating any component of the popkit plugin. It follows the Scan → Compare → Report → Recommend/Apply workflow.
Invoke this skill when:
Collect current state from the filesystem:
interface ScanResult {
component: string;
files: FileInfo[];
metadata: Record<string, any>;
}
interface FileInfo {
path: string;
exists: boolean;
content?: string;
frontmatter?: Record<string, any>;
schema?: object;
}
Implementation:
Check current state against expected schema:
interface CompareResult {
file: string;
checks: Check[];
}
interface Check {
name: string;
passed: boolean;
expected: any;
actual: any;
severity: 'error' | 'warning' | 'info';
}
Common Checks:
Generate structured findings:
interface ValidationReport {
timestamp: string;
summary: {
total_files: number;
passed: number;
warnings: number;
errors: number;
};
issues: Issue[];
}
interface Issue {
id: string;
severity: 'error' | 'warning' | 'info';
component: string;
file: string;
line?: number;
message: string;
suggestion?: string;
autoFixable: boolean;
}
Report Format:
Suggest or apply fixes:
interface Fix {
issue_id: string;
action: 'add' | 'modify' | 'delete';
file: string;
change: string;
safe: boolean;
}
Safe Auto-Fixes:
Requires Human Decision:
const agentSchema = {
required: ['name', 'description', 'tools'],
optional: ['output_style', 'color'],
checks: [
'name matches filename',
'tools are valid Claude tools',
'output_style references existing style',
'agent registered in config.json'
]
};
const routingSchema = {
required: ['keywords', 'filePatterns'],
checks: [
'keyword agents exist',
'file patterns are valid globs',
'no duplicate keywords',
'all agents have routing paths'
]
};
const outputStyleSchema = {
required: ['name', 'description'],
optional: ['used_by'],
checks: [
'schema file exists if referenced',
'example section present',
'TypeScript interface matches schema'
]
};
const hookSchema = {
checks: [
'file exists at hooks.json path',
'Python syntax valid',
'main() function present',
'JSON stdin/stdout protocol used',
'error handling with sys.exit(0)'
]
};
## Running Validation
1. Invoke this skill
2. Specify components to validate:
- "all" for complete validation
- "agents" for agent files only
- "routing" for config.json
- "hooks" for hook scripts
3. Review the report
4. Decide on fixes:
- "apply safe" for auto-fixable issues
- "apply all" with caution
- Manual fixes for complex issues
## Example Session
User: Run validation on agents
Claude: [Uses Glob to find agent files]
Claude: [Uses Read to check frontmatter]
Claude: [Compares against schema]
Claude:
### Agent Validation Report
**Files Checked:** 29
**Passed:** 27
**Issues:** 2
#### Issues Found
1. **WARNING** `agents/tier-2-on-demand/new-agent.md`
- Missing `output_style` field
- Suggestion: Add `output_style: agent-handoff`
- Auto-fixable: Yes
2. **ERROR** `agents/tier-2-on-demand/test-agent.md`
- Agent not registered in config.json
- Suggestion: Add to tier-2-on-demand array
- Auto-fixable: Yes
Would you like me to apply the safe fixes?
This skill integrates with:
/popkit:sync command (invokes this skill)/popkit:plugin-test (uses validators)pre-commit hooks (optional validation)If validation encounters errors:
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 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 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.