lean-project-structure

Organizes codebases into layered file structures with single-responsibility modules and size limits.

1|Updated Jun 3, 2026
One-click install
npx skills add https://github.com/tanveerriaz/Skillz --skill lean-project-structure-tanveerriaz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: lean-project-structure
Source: https://github.com/tanveerriaz/Skillz/tree/main/skills/lean-project-structure
Command: npx skills add https://github.com/tanveerriaz/Skillz --skill lean-project-structure-tanveerriaz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases rot when routes hold business logic, files sprawl past thousands of lines, and helpers multiply without purpose. This Skill establishes a lean, layered project structure so the code stays navigable as it grows. ## Core Features & Use Cases - Layer Separation: Enforces clear boundaries between entry/routing, business logic, data access, and presentation layers. - File Discipline Rules: Applies one-responsibility-per-file naming, function size limits (~40 lines), and a "no unnecessary files" policy. - Use Case: When scaffolding a new Flask API or refactoring a 2,000-line app.py that mixes routes, OCR logic, and Excel generation, use this Skill to split the code into thin route handlers, dedicated service modules, and clean templates. ## Quick Start Restructure my project so routes, business logic, data access, and templates live in separate single-responsibility files.

Frequently Asked Questions about lean-project-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a new software project for maintainability?▼

Separate the codebase into layers: thin entry/routing files, dedicated business logic modules, isolated data access, and logic-free presentation. Give each file one responsibility, cap function size around 40 lines, and document the layout for future contributors.

How to refactor a large monolithic file into modules?▼

Refactor incrementally rather than rewriting everything at once. Extract business logic out of route handlers into named service modules, move data access into its own layer, and keep the entry file thin. Split functions that exceed the size limit.

Should I follow framework conventions or custom project structure?▼

Follow the framework's expected layout rather than fighting it. Apply the same layering principles within the framework's conventions, keeping routes thin and business logic in dedicated modules.

When is a single-file script acceptable instead of layered structure?▼

A single file is fine for tiny scripts, prototypes, and throwaway code. Over-structuring small utilities adds overhead without benefit; apply layered structure only when the project is expected to grow or be maintained.

How do I handle project structure in a monorepo?▼

Apply the same layer boundaries per package within the monorepo. Keep shared code in a clearly named shared module rather than duplicating it, and maintain single-responsibility files inside each package.