diff --git a/AGENT.md b/AGENT.md new file mode 100644 index 0000000..547a70f --- /dev/null +++ b/AGENT.md @@ -0,0 +1,79 @@ +# AGENT.md — MyDay + +> Operating instructions for AI agents working in this repository. +> **Status:** M0 + M0.1 implemented (SPEC-002…009); next milestone **M1 — org structure**. + +--- + +## 1. What MyDay is + +**MyDay** is Sechpoint's **self-hosted, single-tenant** employee app (a **PWA** for mobile and +desktop): **time & absence**, **reporting**, and the **company org structure** those depend on. + +It is **one Go binary** — a small **core** (`MyDay.auth`) plus drop-in **modules**. + +--- + +## 2. The source of truth + +| Artefact | Role | +|---|---| +| **`PROJECT_PLAN.md`** | the **decision log of record** — read it first. If a decision changes, update it **in the same change**. | +| **`docs/specs/`** | implementation specs. **Specs precede code.** | +| **`README.md`** | the human quickstart. | +| **`.opencode/git.env`** | the agent **git-workflow contract** (gitignored; see `.opencode/git.env.example`). | + +--- + +## 3. Doctrine — the rules that must not be broken + +1. **The path is the request.** Identity lives in the path; the query carries only transient state. +2. **The rule of the door.** The door *resolves*; the handler *authenticates*. A module **never + parses a raw path**. +3. **Identification ≠ authorisation.** The GUID is a *username*; the **session cookie is the + credential**. A bookmark is never a login. +4. **Two doors, one destination.** ROUTER (path) and HANDLER (`do`/`action`) both resolve to + `(module, function, params)` (D-039). +5. **Modules are independent.** A module depends only on **core interfaces** and **owns its own + tables** — never reach into another module's data. +6. **Delete, don't redirect.** Reserved names come from one source. +7. **Every page renders inside the shell.** The core layout owns the document, the header and the + nav (`Registry.Nav()`); a module supplies **content** only. The CSP is `script-src 'self'`: + **no inline `