From claude-flow
Generate interactive multi-diagram feature briefs as self-contained HTML files, viewable in the browser. Each brief contains tabbed diagrams (architecture, logic flow, optional state machine) with expand/collapse nodes, Catppuccin Mocha theming, and dagre auto-layout. Use this skill whenever the user asks to visualize a feature, generate a flow diagram, show architecture, diagram a codebase, create a feature brief, or says things like "show me how this works", "map out the flow", or "visualize this". Works from plain-language descriptions or existing code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-flow:claude-flowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate interactive multi-diagram feature briefs as self-contained HTML files, viewable in the browser. Each brief contains tabbed diagrams (architecture, logic flow, optional state) with expand/collapse nodes and Catppuccin Mocha theming.
Generate interactive multi-diagram feature briefs as self-contained HTML files, viewable in the browser. Each brief contains tabbed diagrams (architecture, logic flow, optional state) with expand/collapse nodes and Catppuccin Mocha theming.
/claude-flow:claude-flowWrites to: ~/github/claude-notes/claude-tools/previews/{slug}-flow.html
{slug} is derived from the feature field: lowercased, non-alphanumeric chars replaced by hyphens, consecutive hyphens collapsed. Example: "User OAuth Login!" → user-oauth-login.
Generate a FeatureBrief object conforming to this schema:
interface FeatureBrief {
version: "1"
feature: string // short feature name, used for slug
diagrams: DiagramView[]
}
interface DiagramView {
type: "architecture" | "flow" | "state"
title: string
description?: string
layout?: "TB" | "LR" // default TB; use LR for architecture
nodes: FlowNode[]
edges: FlowEdge[]
}
interface FlowNode {
id: string
type: "feature" | "action" | "decision" | "state" | "external" | "user" | "component"
label: string
description?: string
sublabel?: string // file path or tech detail (monospace)
status?: "planned" | "in-progress" | "done" | "blocked"
collapsed?: boolean // false = start expanded; omit or true = start collapsed
children?: FlowNode[] // child nodes shown on expand
}
interface FlowEdge {
id: string
source: string
target: string
label?: string
type?: "default" | "conditional" | "async" | "error"
}
architecture diagram and one flow diagramDiagramView. For features with major subsystems (e.g. frontend + backend, auth + data layer), add one tab per subsystem showing its internal architecture. The first tab is always the high-level overview showing only module-to-module connections; subsequent tabs drill into each module.state diagram tab only when the feature introduces meaningful new stateful behavior (new entity lifecycle, UI state machine, session/connection states)layout: "LR" (left-to-right); shows components, services, external systemslayout: "TB" (top-to-bottom, default); shows request/logic flow with decision brancheslayout: "LR"; shows states and transitionsDiagramView must have 3–20 top-level nodes (nodes without parents, visible before expand)decision nodes must have exactly 2 outbound edges, each with type: "conditional" and a non-empty labelFlowEdge source and target IDs must reference valid node IDs within the same DiagramViewchildren render as inline sub-cards inside the parent card — use them for implementation detail (file paths, tech notes, sub-steps). They are never edge endpoints; all FlowEdge source/target IDs must be top-level nodes only[+N] expand button) unless collapsed: false; sub-cards within children have their own local expand togglefeature — the primary feature being builtaction — a processing step, handler, or functiondecision — a branch point (exactly 2 outbound edges)state — a named state in a state machineexternal — external system, third-party service, or outside boundaryuser — a human actorcomponent — a reusable component, module, or infrastructure pieceTEMPLATE="$(dirname "$0")/references/template.html"
if [ ! -f "$TEMPLATE" ]; then
echo "ERROR: Template not found. Rebuild with: cd ~/github/claude-tools/claude-flow/app && bun run build:template"
exit 1
fi
Derive the output slug and path, then inject via Python:
FEATURE_JSON='<the generated FeatureBrief JSON>'
SLUG=$(echo "$FEATURE_JSON" | uv run python -c "
import sys, re, json
d = json.load(sys.stdin)
name = d['feature'].lower()
slug = re.sub(r'-+', '-', re.sub(r'[^a-z0-9]+', '-', name)).strip('-')
print(slug)
")
OUTDIR="$HOME/github/claude-notes/claude-tools/previews"
mkdir -p "$OUTDIR"
OUTFILE="$OUTDIR/${SLUG}-flow.html"
uv run python -c "
import sys, json
template = open('$TEMPLATE').read()
raw = sys.stdin.read()
escaped = raw.replace('</script>', r'<\/script>')
out = template.replace('__FLOW_DATA_JSON__', escaped)
open('$OUTFILE', 'w').write(out)
print(f'Written: $OUTFILE')
" <<< "$FEATURE_JSON"
powershell.exe -c "Start-Process '$(wslpath -w "$OUTFILE")'"
After opening, report:
Opened: {feature name}
Diagrams: architecture ({N} nodes), flow ({N} nodes)[, state ({N} nodes)]
Output: ~/github/claude-notes/claude-tools/previews/{slug}-flow.html
Then use AskUserQuestion to ask:
If user approves: End the loop. Output final path.
If user requests changes:
$OUTFILELoop continues until the user explicitly approves or abandons.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub drklee3/claude-tools --plugin claude-flow