360 Secure SkillHub
360 安全技能中心

PRD Visualization Skill

读取 PRD 文本或层级 JSON 数据,生成基于 D3.js 的交互式层级可视化网页,提供列表、力导向和径向聚类视图,并支持折叠展开、状态筛选、主题切换与 JSON 自动刷新,需通过本地 HTTP 服务在浏览器中打开。

foyri
foyri
热度 68.69
最近更新 2026-05-17 13:48:08
分类:数据依赖:代码执行 / 读写文件 / 联网浏览搜索应用场景:报告撰写 / 工作流 / 模板

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add prd-visualization-skill
Metadata
name
hierarchy-visualizer
description
Creates interactive D3.js hierarchy visualizations with multiple view modes (List, Force-Directed, Radial Cluster, with Fractal Tree coming soon). Use when user wants to visualize tree structures, hierarchical data, PRDs, requirements, features, specifications, org charts, file structures, or says "visualize hierarchy", "tree view", "show structure", "render tree", "hierarchy diagram", "prd", "requirement", "feature", "specification". Always use this skill when user wants to visualize their PRD (project requirements), project requirements, or any hierarchical data.

Hierarchy Visualizer v1.0.0

Interactive multi-view visualization for hierarchical data using D3.js.

When to Use This Skill

Use when the user wants to visualize their PRD, project requirements, or any hierarchical data. The visualizer reads from a JSON file and renders it as an interactive diagram.

Agent Instructions

Step 1: Find or create the PRD JSON file

If user has a PRD in Markdown/text format: Convert it to hierarchical JSON format. Read the PRD file and create a JSON structure with:

  • Root node = Project/PRD title
  • Children = Sections, features, requirements
  • Status = todo/processing/problem/done (infer from context or default to "todo")

If user already has a JSON file: Use that file directly (check for prd.json, requirements.json, hierarchy.json)

Step 2: Copy visualizer to project folder

# Copy visualizer files to user's project
cp hierarchy-visualizer.html d3.min.js /path/to/user/project/

# Save the JSON as requirements-hierarchy.json
cat > /path/to/user/project/requirements-hierarchy.json << 'EOF'
{paste the JSON here}
EOF

# Start server from their project folder
cd /path/to/user/project && python3 -m http.server 8080

Step 3: Open in browser

http://localhost:8080/hierarchy-visualizer.html

Maintenance (IMPORTANT)

Always keep the prd json file updated in the whole project development process, everytime a requirement/specification/feature is added, updated, status changed, or deleted, update the json file accordingly.

Data Format

Convert PRD content to this JSON structure:

{
  "id": "root",
  "title": "Product Requirements",
  "status": "processing",
  "children": [
    {
      "id": "auth",
      "title": "Authentication",
      "status": "done",
      "children": []
    }
  ]
}

Required fields:

  • id — unique identifier (string)
  • title — display name (string)
  • status — one of: todo, processing, problem, done
  • children — array of child nodes (empty array for leaves)

Optional fields: type, domain, stage, owning_sig, granularity, complexity, source_url, goals

View Modes

  • List — Collapsible hierarchical list (default)
  • Force-Directed — Draggable node-link diagram
  • Radial Cluster — Circular dendrogram

Note: Fractal Tree view is currently under development and will be available in a future release. Stay tuned for updates!

Controls

  • View switcher — Top-left dropdown
  • Zoom/Pan — Scroll wheel, click-drag
  • Collapse/Expand — Click nodes or L1/L2/L3 buttons
  • Status filter — Click Todo/Proc/Prob/Done labels
  • Theme toggle — Sun/moon icon (top-right)
  • Auto-sync — JSON updates every 5 seconds

Status Colors

  • Todo: Gray #8b949e
  • Processing: Yellow #e3b341
  • Problem: Orange #ffa657
  • Done: Green #238636

Troubleshooting

Blank visualization? → Use local HTTP server, not file://

JSON not loading? → Check that requirements-hierarchy.json exists in the same folder as the HTML file

Need custom styling? → Edit CSS variables in hierarchy-visualizer.html (~line 78)