|
| 1 | +# 🗺️ Weekly Repository Map |
| 2 | + |
| 3 | +> For an overview of all available workflows, see the [main README](../README.md). |
| 4 | +
|
| 5 | +**Visualize your repository's file structure and size distribution with a weekly ASCII tree map** |
| 6 | + |
| 7 | +The [Weekly Repository Map workflow](../workflows/weekly-repo-map.md?plain=1) analyzes your repository's structure every week using standard bash tools, then creates a GitHub issue containing an ASCII tree map visualization showing directory hierarchy, file sizes, and key statistics. |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +Add the workflow to your repository: |
| 12 | + |
| 13 | +```bash |
| 14 | +gh aw add https://github.com/githubnext/agentics/blob/main/workflows/weekly-repo-map.md |
| 15 | +``` |
| 16 | + |
| 17 | +Then compile: |
| 18 | + |
| 19 | +```bash |
| 20 | +gh aw compile |
| 21 | +``` |
| 22 | + |
| 23 | +> **Note**: This workflow creates GitHub Issues with the `documentation` label. |
| 24 | +
|
| 25 | +## What It Does |
| 26 | + |
| 27 | +The Weekly Repository Map runs every Monday and: |
| 28 | + |
| 29 | +1. **Collects Repository Statistics** — Counts files, measures sizes, and maps the directory structure using standard bash tools |
| 30 | +2. **Generates ASCII Tree Map** — Creates a visual representation of the repository hierarchy with proportional size bars |
| 31 | +3. **Summarizes Key Metrics** — Reports file type distribution, largest files, and directory sizes |
| 32 | +4. **Creates an Issue** — Posts the complete visualization as a GitHub issue, closing the previous week's issue |
| 33 | + |
| 34 | +## How It Works |
| 35 | + |
| 36 | +````mermaid |
| 37 | +graph LR |
| 38 | + A[Collect File Statistics] --> B[Compute Sizes & Counts] |
| 39 | + B --> C[Generate ASCII Tree Map] |
| 40 | + C --> D[Compute Key Statistics] |
| 41 | + D --> E[Create Issue Report] |
| 42 | +```` |
| 43 | + |
| 44 | +### Output: GitHub Issues |
| 45 | + |
| 46 | +Each run produces one issue containing: |
| 47 | + |
| 48 | +- **Repository Overview** — Brief summary of the repository's structure and size |
| 49 | +- **ASCII Tree Map** — Visual directory hierarchy with size bars using box-drawing characters |
| 50 | +- **File Type Breakdown** — Count of files by extension |
| 51 | +- **Largest Files** — Top 10 files by size |
| 52 | +- **Directory Sizes** — Top directories ranked by total size |
| 53 | + |
| 54 | +Example excerpt from an issue: |
| 55 | + |
| 56 | +``` |
| 57 | +Repository Tree Map |
| 58 | +=================== |
| 59 | +
|
| 60 | +/ [1234 files, 45.2 MB] |
| 61 | +│ |
| 62 | +├─ src/ [456 files, 28.5 MB] ██████████████████░░ |
| 63 | +│ ├─ core/ [78 files, 5.2 MB] ████░░ |
| 64 | +│ └─ utils/ [34 files, 3.1 MB] ███░░ |
| 65 | +│ |
| 66 | +├─ docs/ [234 files, 8.7 MB] ██████░░ |
| 67 | +│ |
| 68 | +└─ tests/ [78 files, 3.5 MB] ███░░ |
| 69 | +``` |
| 70 | + |
| 71 | +## Configuration |
| 72 | + |
| 73 | +The workflow uses these default settings: |
| 74 | + |
| 75 | +| Setting | Default | Description | |
| 76 | +|---------|---------|-------------| |
| 77 | +| Schedule | Weekly on Monday | When to run the analysis | |
| 78 | +| Issue label | `documentation` | Label applied to created issues | |
| 79 | +| Max issues per run | 1 | Prevents duplicate reports | |
| 80 | +| Issue expiry | 7 days | Older issues are closed when a new one is posted | |
| 81 | +| Timeout | 10 minutes | Per-run time limit | |
| 82 | + |
| 83 | +## Customization |
| 84 | + |
| 85 | +```bash |
| 86 | +gh aw edit weekly-repo-map |
| 87 | +``` |
| 88 | + |
| 89 | +Common customizations: |
| 90 | +- **Change issue labels** — Set the `labels` field in `safe-outputs.create-issue` to labels that exist in your repository |
| 91 | +- **Adjust the schedule** — Change to run more or less frequently (e.g., daily or monthly) |
| 92 | +- **Customize exclusions** — Update the bash commands to exclude additional directories (e.g., `vendor/`, `dist/`) |
| 93 | +- **Adjust tree depth** — Edit the prompt to change how deep the tree visualization goes (default max is 3–4 levels) |
| 94 | + |
| 95 | +## Related Workflows |
| 96 | + |
| 97 | +- [Repository Quality Improver](repository-quality-improver.md) — Daily analysis of quality dimensions across your repository |
| 98 | +- [Daily File Diet](daily-file-diet.md) — Monitor for oversized source files and create targeted refactoring issues |
| 99 | +- [Weekly Issue Summary](weekly-issue-summary.md) — Weekly issue activity report with trend charts |
0 commit comments