Skip to content

Add repo-tree-map workflow for visualizing repository structure#1482

Merged
pelikhan merged 5 commits intomainfrom
copilot/create-repo-tree-map-workflow
Oct 10, 2025
Merged

Add repo-tree-map workflow for visualizing repository structure#1482
pelikhan merged 5 commits intomainfrom
copilot/create-repo-tree-map-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 10, 2025

This PR introduces a new agentic workflow that generates an ASCII tree map visualization of the repository file structure and publishes it as a GitHub Discussion.

Overview

The Repository Tree Map Generator workflow can be manually triggered to analyze the repository and create a comprehensive visualization showing:

  • Directory hierarchy with ASCII tree structure
  • File size distributions using visual indicators
  • File type statistics and counts
  • Largest files and directories
  • Repository metadata and statistics

How It Works

The workflow uses bash tools (find, du, ls, wc, stat, etc.) to gather repository statistics and generate an ASCII tree map visualization. The AI agent analyzes the repository structure and creates a formatted report that includes:

  1. Visual tree map using box-drawing characters (│ ├ └ ─) and size bars (█ ▓ ▒ ░)
  2. Repository statistics including total files, sizes, and file type distribution
  3. Top 10 largest files and directories for quick identification of space usage
  4. Emoji indicators for different file types (📁 directories, 📄 files, 🔧 config, 📚 docs, 🧪 tests)

Usage

Trigger the workflow manually:

  • Via GitHub UI: Actions tab → "Repository Tree Map Generator" → "Run workflow"
  • Via CLI: gh workflow run repo-tree-map.lock.yml

Output location:
The visualization is automatically published in the dev discussions category as a new discussion.

Configuration

  • Engine: GitHub Copilot
  • Trigger: workflow_dispatch (manual only)
  • Permissions: Read-only for repository analysis
  • Safe-outputs: Creates discussion in "dev" category
  • Timeout: 10 minutes

Files Added

  • .github/workflows/repo-tree-map.md - Workflow definition with AI instructions
  • .github/workflows/repo-tree-map.lock.yml - Compiled GitHub Actions YAML

This workflow provides a quick way to understand repository structure and identify areas consuming the most space, useful for repository maintenance and documentation.

Original prompt

Create an agentic workflow "repo tree map" that runs on workflow dispatch. It uses bash tools to list files, check their sizes, names, collect any other statistics such that it can render a tree map in ascii of the file structure in the repository. Publish the result in the dev discussions category.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add agentic workflow to generate repo tree map Add repo-tree-map workflow for visualizing repository structure Oct 10, 2025
Copilot AI requested a review from pelikhan October 10, 2025 19:41
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan October 10, 2025 20:08
@pelikhan pelikhan marked this pull request as ready for review October 10, 2025 20:11
@github-actions
Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request

@pelikhan pelikhan merged commit 33cb17a into main Oct 10, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/create-repo-tree-map-workflow branch October 10, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants