Project Skeleton Template: A Five-Layer Directory Structure (v1)

    This article presents a project skeleton template built around a five-layer directory structure and a one-way data flow constraint. It explains why engineering structure, rather than feature complexity, is often what slows a project down, then walks through the directory layout, four required documents, four hard rules, and the steps for putting the skeleton in place. Readers will learn how to reduce long-term cognitive overhead and locate the entry point, data, parameters, and last run results in about a minute.

    1. The Real Cost Is Not Writing Code

    Many projects move fast at the start, then slow down noticeably after two or three months. The cause is usually not feature complexity but loss of control over engineering structure: source files scattered across output directories, raw data read directly in multiple places, parameters hard-coded, no record of each run, and no way to tell which version is usable. At that point, the largest cost shifts from “implementing a feature” to “relocating information.”

    So the goal of this template is not faster one-off coding. It is lower cognitive cost during long-term maintenance. It provides only a skeleton, with no strategy, parameters, code, or data sources. Those must be filled in by the user based on the business at hand.

    2. Overall Design: Five Layers and a One-Way Data Flow

    The directories are organized along the direction of data flow, and each layer carries one type of responsibility:

    1. your_project/
    2. ├── 00_boundary/ # location, entry point, pass criteria
    3. ├── 01_data/ # raw data goes in only
    4. ├── 02_process/ # cleaning, computation, result generation
    5. ├── 03_output/ # reports, charts, signals; out only
    6. ├── 04_config/ # parameters, secrets, environment variables
    7. └── 05_logs/ # a record of every run

    The key constraint is one-way flow: raw data is read only by the processing layer, the output layer never writes back to code, the configuration layer carries no business logic, and the log layer is append-only. This way, any anomaly can be traced back along the data flow.

    3. Four Documents: Making Tacit Knowledge Explicit

    1. Boundary document: state the project location, the single entry point, and the pass criteria. The criteria must be automatically verifiable, for example “after running the entry point, the exit code is 0 and a file dated today appears in the output directory.”
    2. Context template: keep only three fields — code location, entry point, and pass criteria. Fewer fields make it maintainable over time and let AI coding tools establish context quickly.
    3. Requirements framework: use five sections — background, goals, scope boundaries, acceptance criteria, and risks plus rollback. The core is rewriting “what I want” into an executable, verifiable description.
    4. First-week checklist: split by day, one to two hours per day, delivering one shippable item each day, so the first week does not introduce too many variables.

    When more than two parties are involved (one person plus multiple AI coding tools, or multi-party collaboration), add a task ownership document that states who owns input, who owns processing, and who owns acceptance, to avoid overlapping responsibilities.

    4. Four Hard Rules

    • The output directory never holds source code, because it is usually created first and is writable, making it the easiest place to pollute “in passing.”
    • Raw data is read-only; any correction produces a new file through the processing layer.
    • No parameters are hard-coded; all are externalized to the configuration layer, and secrets are injected through the environment.
    • Every run leaves a log containing the time, entry point, parameter summary, and result path.

    5. Rollout Steps and Expected Benefits

    Step 1: create empty directories and copy the five-layer structure. Step 2: complete the boundary document and fill in absolute paths. Step 3: write only the simplest single requirement into the requirements document. Step 4: proceed day by day following the first-week checklist. Step 5: in collaboration scenarios, add the task ownership table.

    Stick with this skeleton and the biggest benefit is modifiability: three months later, you can still locate the entry point, data, parameters, and last run results within a minute. To be clear, this is a skeleton, not a guarantee. It cannot eliminate all problems; it only reduces structural rework. Combined with common capabilities such as cloud object storage, log services, and monitoring alerts, data and run records can be further persisted and made observable.