Context
From the Scout analysis of issue #25311, this workflow addresses Problem 1: Spaghetti Codebase from Vibe Coding.
"The codebase was complete spaghetti. Functions were scattered in random files, and a few files had grown to several thousand lines." — Lalit Maganti
The author lost a month of work and had to do a full rewrite because AI-generated code accumulated without structural discipline.
Objective
Create a new gh-aw agentic workflow called architecture-guardian that runs on every pull request and push to main to enforce code structure discipline.
Workflow Prompt
Create a GitHub Actions agentic workflow called "architecture-guardian" that runs
on every pull request and push to main.
The workflow must:
1. Scan all source files and detect:
- Files exceeding 500 lines of code (configurable threshold)
- Functions/methods exceeding 80 lines
- Files with more than 10 public exports (suggesting scattered responsibility)
- Circular imports or dependency cycles between modules
2. For each violation, generate a refactoring suggestion using an AI agent
(Claude or similar) explaining: what the violation is, why it's a problem,
and a concrete plan to fix it (e.g., "Extract X into a dedicated module Y")
3. Post a structured PR review comment that groups violations by severity:
- BLOCKER: Circular dependencies or files >1000 lines
- WARNING: Files >500 lines or functions >80 lines
- INFO: High export count
4. Fail the PR check if any BLOCKER is found; warn but allow merge for lower levels
Use tree-sitter or language-specific AST tools for analysis. Support Python
and Rust as primary languages. Store thresholds in a .architecture.yml config file.
Files to Create
.github/workflows/architecture-guardian.md — the workflow markdown file
Acceptance Criteria
Generated by Plan Command for issue #25311 · ● 394.6K · ◷
Context
From the Scout analysis of issue #25311, this workflow addresses Problem 1: Spaghetti Codebase from Vibe Coding.
The author lost a month of work and had to do a full rewrite because AI-generated code accumulated without structural discipline.
Objective
Create a new gh-aw agentic workflow called
architecture-guardianthat runs on every pull request and push to main to enforce code structure discipline.Workflow Prompt
Files to Create
.github/workflows/architecture-guardian.md— the workflow markdown fileAcceptance Criteria
.architecture.yml.lock.ymlis generated viamake recompileRelated to Blog analysis #25311