Skip to main content

Git Structure Rules

Purpose: Standard git hygiene for the multi-tenant tree. Read BEFORE git init, gh repo create, or any commit decision.

1. Repo placement matrix

Repo typeCanonical homeGitHub org/ownerVisibility default
ALAI product (Bilko, Drop, Tok)~/business/ALAI-Holding-AS/products/<product>/johnatbasicas/<product>private until launch
ALAI internal CLI / SDK / library~/projects/<repo-name>/johnatbasicas/<repo>public if open-source
ALAI infra workspace~/aisystem/n/an/a
ALAI Tech DOO (RS subsidiary)~/business/ALAI-Tech-DOO/alai-tech-doo/<repo>private
Client-owned repo~/clients-external/<client>/client's GitHub orgclient's choice
Personal scholarly project~/personal/scholarly/<topic>/johnatbasicas/<topic>public (transparency)
System orchestration~/system/johnatbasicas/alai-systemprivate

2. Required files per repo type

FileWhen required
README.mdAlways
CLAUDE.mdEvery repo where agents will be dispatched
BUILD-BLUEPRINT.mdRepos that build/deploy (per ZAKON PI2)
DEPLOY-MAP.mdRepos with live deploys (CF Pages, Cloud Run, App Runner, etc.)
.gitignoreAlways — see Section 4
.github/workflows/deploy*.ymlRepos with CI/CD
LICENSEPublic repos (default MIT for ALAI products)

3. Commit conventions — Conventional Commits (mandatory)

<type>(<scope>): <subject> (MC #<id>)

<body — what changed and why>

Co-Authored-By: <persona-name> <[email protected]>

typefeat | fix | chore | docs | style | refactor | perf | test | ci | build

4. .gitignore standards

Universal (every repo)

# OS
.DS_Store
Thumbs.db

# Editor / IDE
.vscode/
.idea/
*.swp
.aider*
.claude-scratch/

# Secrets — NEVER COMMIT
.env
.env.*
!.env.example
*.pem
*.key
id_rsa*
*.p12
.bw-session

# Logs
*.log
logs/

# Build outputs
dist/
build/
out/
target/
.next/
.nuxt/
.output/
.turbo/

Node-specific

node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

Terraform / IaC (CRITICAL after Parisa finding)

*.tfstate
*.tfstate.*
*.tfplan
.terraform/
.terraform.lock.hcl
crash.log

5. Anti-patterns — explicitly forbidden

Anti-patternWhy it's badCorrect alternative
git add . without reviewing diffCommits unwanted files (.env, tfstate, secrets, IDE configs)git add -p or explicit paths
Committing .env "for now"Secrets in git history foreverBitwarden / .env.example pattern
Force-push to shared/masterDestroys teammates' workPRs only; force-push only on private feat branches
Cross-tenant reposTenant contamination, IP confusionSplit into 2 repos, separate orgs ideally
Tags pushed before work is verified liveTag points to broken stateTag AFTER curl 200 + Playwright pass

6. References

  • ADR-023: ~/system/architecture/decisions/ADR-023-anvil-tenant-restructure-2026-05-07.md
  • Tree blueprint: ~/system/specs/anvil-tree-blueprint-2026-05-07.md
  • Canonical registry: ~/system/specs/canonical-registry.md
  • ZAKON PI2 (deploy verification): ~/system/rules/zakon-pi2-deploy-verification.md
  • Conventional Commits spec: https://www.conventionalcommits.org/en/v1.0.0/