Monorepo Folder Cleanup and Environment Organization

Problem

Development environment accumulated multiple organizational structures (flat ap-apps/ alongside cc/ monorepo), duplicated project directories, and unclear boundaries between active development, experiments, and tooling.

Solution

A “Three-Bucket Strategy” that separates concerns by lifecycle stage and governance level.

Architecture

Zone-Based Organization

ZonePurposeGovernance
apps/Active, compliant applicationsMust pass compliance checks
lab/Research and experimentsUnrestricted
staging/New repos under evaluationEntry point for all new work
library/Knowledge bases and documentationAppend encouraged
infra/Infrastructure and toolingCaution required

Key Principles

  1. New repos start in staging — Graduate to apps/ only after passing compliance
  2. No duplication — Single source of truth per project; eliminate shadow copies
  3. Universal file structure — Every repo follows the same .management/ pattern
  4. Cross-device sync — Use Syncthing or similar for development artifacts
  5. DevContainers — Standardize development environments

Adopting External Projects

When bringing in codebases developed elsewhere:

  1. Clone into staging/
  2. Audit structure against organizational standards
  3. Add required .management/ files
  4. Run compliance checks
  5. Graduate to apps/ only when passing

Cleanup Protocol

  1. Map current state — find . -maxdepth 3 -type d to audit directory trees
  2. Identify duplicates — Flag directories that appear in multiple locations
  3. Consolidate — Merge into canonical locations
  4. Archive — Move deprecated code to archive/ rather than deleting
  5. Verify — Confirm all tools and scripts reference new paths