Skip to content

Add structkit graph command to visualize structure dependencies #138

@httpdss

Description

@httpdss

Summary

Add a structkit graph command that shows dependency relationships between structure definitions.

Motivation

StructKit structures can compose other structures through folders[].struct. As templates grow, users need a way to understand dependencies, detect cycles, and document how structures are composed.

Proposed behavior

  • Accept a structure name, local YAML file, or --all.
  • Traverse nested structure references from folders[].struct.
  • Detect and report missing references and cycles.
  • Support output formats such as text tree, JSON, and Mermaid.
  • Support custom structures through --structures-path.

Example usage

  • structkit graph project/python
  • structkit graph terraform/apps/generic --format mermaid
  • structkit graph --all --format json

Acceptance criteria

  • Command is registered in the CLI.
  • Includes tests for single dependencies, multiple dependencies, nested dependencies, missing dependencies, and cycles.
  • Mermaid output can be pasted into documentation.
  • Documentation includes examples for text, JSON, and Mermaid output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions