Skip to content

Add folder size check workflow to prevent oversized directories#161

Merged
Miyamura80 merged 1 commit intomainfrom
add-folder-size-check
Apr 23, 2026
Merged

Add folder size check workflow to prevent oversized directories#161
Miyamura80 merged 1 commit intomainfrom
add-folder-size-check

Conversation

@Miyamura80
Copy link
Copy Markdown
Owner

Summary

  • Folder-size CI workflow (.github/workflows/folder-size.yaml): runs on PRs touching .py files, checks that no single directory has too many flat Python siblings (warn at 20, error at 35).
  • Large-file CI workflow (.github/workflows/large-files.yaml): runs on PRs touching .py files, checks that no source file exceeds the line-count threshold (warn at 500, error at 800).
  • Shared bash scripts (scripts/check_folder_sizes.sh, scripts/check_large_files.sh): reusable scripts consumed by both GitHub Actions and local prek hooks. Support --all mode and per-file mode, produce GitHub step summaries, and respect grandfathered/excluded paths.
  • Prek hooks (prek.toml): added check-large-files and check-folder-sizes hooks so the same checks run locally on every commit.
  • Folder-refactor-advisor subagent (.claude/agents/folder-refactor-advisor.md, .codex/agents/folder-refactor-advisor.toml): advisory-only agent that diagnoses oversized folders and proposes three concrete subfolder restructurings when the CI check fails.
  • CLAUDE.md updates: added prek install instructions at the top and a pointer to the folder-refactor-advisor subagent.

Test plan

  • Push a PR with a folder containing >35 .py files and verify the folder-size workflow fails
  • Push a PR with a .py file >800 lines and verify the large-files workflow fails
  • Run scripts/check_folder_sizes.sh --all and scripts/check_large_files.sh --all locally and confirm clean output
  • Verify prek hooks fire on git commit for staged .py files

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Miyamura80 Miyamura80 merged commit aa6ab65 into main Apr 23, 2026
12 checks passed
@github-actions github-actions Bot deleted the add-folder-size-check branch April 23, 2026 21:18
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.

1 participant