# Shared Context — tinqs-git

Rules shared across all agents working in this repo.

## Go module identity

The Go module path is `code.gitea.io/gitea`. **Never rename this.** It is the canonical import path for the entire Gitea ecosystem. Renaming it would break every internal import and make upstream rebase impossible.

## Build tags

The canonical build tags for our fork:

```
bindata                ← embed frontend assets into binary
sqlite                 ← compile SQLite via CGo (required)
sqlite_unlock_notify   ← SQLite performance optimization
```

Add `gogit` if using the pure-Go Git implementation instead of system `git`. Not needed for Linux builds.

## Branch discipline

- `main` = upstream tracking. Never commit directly. Only `git pull origin main` + `git rebase`.
- `tinqs/main` = our fork. All customizations live here. Rebase onto `main` quarterly.
- Feature branches: `tinqs/phase-N` → merge into `tinqs/main` when done.

## What never changes

1. `models/` — DB schema. Upstream owns this. We ride their migrations.
2. `go.mod` module path — stays `code.gitea.io/gitea`.
3. `main.go` entry point — stays as-is.
4. `modules/setting/` config keys — add new keys, never remove or rename existing ones.

## What we can change

1. `modules/` — add new packages (lfs/, auth/, billing/)
2. `routers/` — add new routes, modify templates
3. `templates/` — branding, landing page
4. `web_src/` — CSS theme, JS components
5. `public/` — logo, favicon, static assets
6. `options/locale/` — translation strings
7. `Makefile` — binary name, LDFLAGS
8. `.gitea/workflows/` — CI pipelines

## Test before push

```bash
make test-sqlite          # SQLite integration tests (our DB)
make test-backend         # Go unit tests
make lint                 # all linters
```

## Commit style

- Prefix: `feat:`, `fix:`, `chore:`, `docs:`, `ci:`, `branding:`
- Reference epic phase when relevant: `feat(lfs): auto-track game asset patterns (phase 2)`
- Never commit `gitea.db` or `node_modules/`
