amanpal3/Dr-SKILLs / .agent/skills/archify
archify
UnverifiedCreate validated architecture, workflow, sequence, data-flow, lifecycle/state, ERD, class, tree, timeline, and waterfall diagrams as explorable standalone HTML with dark/light themes, motion and image/SVG/WebM export. Accept requirements or Mermaid; inspect repository evidence for code-backed diagrams. Use when visualizing systems, API calls, pipelines, schemas, histories, timings, or everyday steps, parts, relationships and states. Also turn an answer into a one-page explainer, with the conclusion first, structured panels, native diagrams and charts, when the user asks for a page, an explainer or an answer to share (做成一页, 用页面讲), or proactively when the user's rules opt in with an [archify explainer: ...] line. Not for dashboards.
renderers/tree/README.md
View on GitHub# Hierarchy and Tree Renderer
Render `diagram_type: "tree"` JSON files into the standard Archify HTML template.
```bash
node archify/renderers/tree/render-tree.mjs input.tree.json output.html
```
The renderer validates input against `archify/schemas/tree.schema.json` with the
bundled standalone validator. If `output.html` is omitted, it uses
`meta.output` or falls back to `tree.html`. `--layout-json` prints the placed
nodes and links instead of writing HTML.
## Input
```json
{
"schema_version": 1,
"diagram_type": "tree",
"meta": { "title": "Payment platform capabilities" },
"nodes": [
{ "id": "platform", "label": "Payment platform" },
{ "id": "orders", "label": "Orders", "parent": "platform" }
]
}
```
A node has `id`, `label`, and optional `parent`, `sublabel`, `collapsed`, and
`sources`. Children are read in declaration order. Links are containment only;
the first slice has no cross-branch relationships.
## Structure checks
The hierarchy is exactly what the author declared; nothing is attached or
inferred.
| Code | Refused input |
| --- | --- |
| `tree/missing-parent` | `parent` names an undeclared node |
| `tree/root-count` | zero or more than one node without `parent` |
| `tree/cycle` | a parent chain that loops; every node beneath the loop is unreachable, so this one diagnostic covers them |
| `tree/duplicate-id` | an id declared twice |
## Layout
Each generation shares one band: a row for `layout.direction: "down"` (the
default) and a column for `"right"`. Along the other axis every subtree owns a
contiguous span, so unequal branch widths and depths never overlap. A parent is
centred over its first and last child (exactly over a middle child that sits
within a few pixels of that midpoint, so the stem never jogs; edge drawing also snaps stems aligned within 2px after rounding); going right,
nodes are left-aligned in their column.
Going down, a run of three or more consecutive leaf siblings is stacked as an
indented list under its parent, sharing one width and reached along a spine,
instead of fanning out across the row. This keeps a real hierarchy such as a
repository readable at one screen's scale; shorter runs and every branch keep
the row layout. Leaves are quiet cards; the root and branches carry the tone.
Nodes size to their label between `layout.nodeW` (140) and `layout.nodeMaxW`
(220 down, 200 right). Labels and sublabels wrap between words (CJK at any
character), at the narrowest width that keeps the same number of lines, so a
long label becomes a balanced box; a single word may widen a node to 1.5 × `nodeMaxW` before it is
split, so nothing is truncated. `gapX`/`gapY` set the sibling and generation
gaps.
An automatic canvas declares `data-reader-fit="intrinsic-height"` and a 7.5px
reader text floor, so a deep rightward tree scrolls instead of shrinking.
## Expand and collapse
Every node with children gets a toggle on its outgoing side, a separate
focusable button after the node, with `aria-expanded` and a localized label
that states how many descendants it hides. The Viewer module
`viewer/tree-branches.js` owns the state:
- Collapsing hides descendants and their links only. Positions are computed
once for the complete tree, so nothing visible moves and the reader keeps
their place. A collapsed node shows a stacked card and its hidden count.
- Keyboard: Enter/Space on a toggle; ArrowLeft collapses and ArrowRight expands
the focused branch node. Focus stays on the control that was used.
- **Expand all** appears at the top-left while any branch is collapsed and
restores the authored hierarchy.
- Selecting a hidden node through Finder, Node Outline, guided views, or a
shared link expands its ancestors first.
- `collapsed: true` only sets the initial Viewer state. The SVG always contains
the complete tree.
Export scope is explicit: every SVG/PNG/JPEG/WebP export is the complete tree,
whatever is collapsed on screen. Export Cleanup removes the collapsed state from
the clone and leaves the live view unchanged.
## Tested size
`examples/archify-repository.tree.json` (31 nodes, depth 4, unbalanced, four
stacked lists) renders in about 0.2s and passes the showcase gates;
a toggle updates the DOM in under a few milliseconds.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |