architecture-topology-report

Generate an interactive HTML report of a workspace's package dependency topology and tier violations.

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/nseng-ai/ns --skill architecture-topology-report-nseng-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-topology-report
Source: https://github.com/nseng-ai/ns/tree/main/skills/internal/review-system/architecture-topology-report
Command: npx skills add https://github.com/nseng-ai/ns --skill architecture-topology-report-nseng-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Monorepo teams struggle to see whether their actual package dependency graph matches the architecture they intended. This Skill extracts the real runtime dependency graph from workspace manifests and renders it as a self-contained HTML report, either as a raw topology inventory or as a scorecard measured against a named target architecture. ## Core Features & Use Cases - Deterministic graph extraction: Scans workspace package.json files for runtime dependencies and peerDependencies, computing cycles (SCCs), fan-in/fan-out rankings, declared-tier violations, /api seam exposure, kit consumers, orphans, and per-package LOC. - Two report modes: A no-agent raw inventory mode that synthesizes the report spec automatically, and a target scorecard mode where the agent maps measured facts to target architecture invariants (holds/partial/open) with cited evidence. - Interactive HTML output: Renders a single self-contained HTML file with a D3 force/DAG graph (node area proportional to LOC, cycle edges in red, tier filtering, package and subpackage-circle views), Mermaid before/after diagrams, a verdict strip, scorecard table, finding cards, and a keystone recommendation. - Use Case: Run the topology launcher in a pnpm monorepo to get an instant dependency-graph audit showing cycles and layering violations, or name an architecture objective to produce a scorecard tracking migration distance versus architectural drift. ## Quick Start Run the bundled topology script from the workspace root to extract the dependency graph and open a rendered HTML topology report.

Frequently Asked Questions about architecture-topology-report

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a dependency graph report for a monorepo?

Run the bundled topology launcher script from the workspace root. It extracts the runtime dependency graph from package.json manifests and renders a complete HTML report with an interactive D3 graph, scorecard, and findings, then prints the output path.

How do I check a workspace for dependency cycles and layering violations?

The extract-graph script computes strongly-connected components over runtime edges to find cycles and validates each edge against declared package tiers. Violations are tagged as hard or debt severity and rendered as red cycle edges and scorecard rows in the report.

What package managers or workspace layouts does the topology extraction support?

It targets pnpm/npm workspaces, scanning a configurable root directory (default ts/packages) for package.json files. Flags like --root, --kit, --api-needle, and --src-dir adapt it to different workspace layouts and conventions.

Does the topology report require running tests or building the project?

No. The report reads only package manifests and static TypeScript imports, never executing the test suite or build. Evidence comes from the extracted graph JSON plus at most a couple of targeted greps for subpath or non-manifest facts.

When should I use target scorecard mode instead of raw inventory mode?

Use raw inventory mode when you only want the graph as-is: cycles, fan-in/out, tier violations, and orphans. Use target scorecard mode when you have a named target architecture document whose invariants should be mapped to measured facts with holds, partial, or open statuses.