Generate plugin dependency resolution logic with topological sorting.
Generates topological sorting logic to resolve plugin dependencies and detect cycles.
npx claudepluginhub a5c-ai/babysitterThis skill is limited to using the following tools:
README.mdGenerate plugin dependency resolution logic.
interface PluginNode {
name: string;
dependencies: string[];
}
export function resolveDependencies(plugins: PluginNode[]): string[] {
const graph = new Map<string, string[]>();
const inDegree = new Map<string, number>();
for (const plugin of plugins) {
graph.set(plugin.name, plugin.dependencies);
inDegree.set(plugin.name, 0);
}
for (const [, deps] of graph) {
for (const dep of deps) {
inDegree.set(dep, (inDegree.get(dep) || 0) + 1);
}
}
const queue = [...inDegree.entries()].filter(([, d]) => d === 0).map(([n]) => n);
const result: string[] = [];
while (queue.length > 0) {
const node = queue.shift()!;
result.push(node);
for (const dep of graph.get(node) || []) {
inDegree.set(dep, inDegree.get(dep)! - 1);
if (inDegree.get(dep) === 0) queue.push(dep);
}
}
if (result.length !== plugins.length) {
throw new Error('Circular dependency detected');
}
return result.reverse();
}
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
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.