# Nepal Dev Verse Docs (/docs) Nepal Dev Verse holds the documentation for packages and projects by Nepalese developers all over the world, as part of [nepal-dev.com](https://nepal-dev.com). It documents itself the same way, as the project `docs`. ## How every package and project is organised [#how-every-package-and-project-is-organised] Each one lives at its own address, `/`, and has the same shape: | Address | What it holds | |---|---| | `/` | The overview: what it is, its versions and where to go next | | `//use/…` | **Use**: docs for people using it, one set per release | | `//use/dev/…` | Work in progress on the default branch, not released yet | | `//use/latest/…` | Always the latest release | | `//maintain/…` | **Maintain**: docs for the people who look after it | Every page states the version it documents. Add `.md` to any page's address for its Markdown, or read [`/llms.txt`](/llms.txt) for an index of every page. ## This site [#this-site] Nepal Dev Verse Docs has no Use track yet. Its **Maintain** track holds the decisions and design documents behind it: start at the [maintainer documentation map](./maintain/index.mdx). # ADR-NNNN — (/docs/maintain/_templates/adr) - **Status:** Proposed - **Date:** YYYY-MM-DD - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** — - **Approved on:** — - **Supersedes:** — - **Superseded by:** — - **Design documents:** `content/docs/maintain/app-flow/.mdx` (when the UI changes, ADR-0008), `content/docs/maintain/prd/.mdx`, `content/docs/maintain/architecture/system.mdx`, … (the living docs this decision creates or changes — see ADR-0002) ## Context [#context] What problem are we solving? What forces, constraints and facts about the current codebase make this decision necessary *now*? State only what is true and verifiable. ## Decision [#decision] The decision, stated plainly and in the present tense ("We use X", "Y lives in Z"). Include the concrete shape of the change: directories, file names, contracts, commands. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — `` | | | Chosen / Rejected | | B — `` | | | Chosen / Rejected | ## Consequences [#consequences] **Positive** - … **Negative / accepted trade-offs** - … ## Content invariants [#content-invariants] Which invariants in `AGENTS.md` §6 this touches, and how it keeps them. If it departs from one, say so explicitly. That departure is part of what the owner approves. ## Security considerations [#security-considerations] Mandatory — never omit this section (ADR-0005). For a change with no security surface, "None — this change touches no data, no endpoint and no secret" is a valid answer; an omitted section is indistinguishable from not having thought about it. Where there is a surface, state: what content or data it handles and its classification, whether anything private can reach a public surface, what authorization applies and where it is enforced, what leaves the system (search provider, host, analytics), and what residual risk is accepted. Link `content/docs/maintain/security/.mdx` when the feature warrants its own analysis. ## Implementation notes [#implementation-notes] What actually changes in the repo once this is approved. Keep this list checkable — it is the scope of the implementation that follows the approval. - [ ] … - [ ] Tests — the happy path **and** the obvious failure paths (ADR-0007). If some part cannot be unit-tested, say which, and say what was verified instead. - [ ] `bun run lint`, `bun run types:check` and `bunx next build` pass. ## Docs to update on implementation [#docs-to-update-on-implementation] Living design documents are snapshots of the system as it stands — edit them in place, never as a log of what changed (ADR-0002). Delete anything in them that is no longer true. - [ ] `content/docs/maintain/app-flow/.mdx` — if the UI changed - [ ] `content/docs/maintain/prd/.mdx` — requirements + user stories - [ ] `content/docs/maintain/erd/system.mdx` — if persisted data changed - [ ] `content/docs/maintain/architecture/system.mdx` · `content/docs/maintain/dfd/` · `content/docs/maintain/state/` · `content/docs/maintain/sequence/` · `content/docs/maintain/api/` · `content/docs/maintain/rbac/` — whichever the change requires (ADR-0002) - [ ] `content/docs/maintain/security/` — `secrets.mdx` if a secret is introduced; `threat-model.mdx` if the attack surface changed; `.mdx` if the feature warrants its own analysis - [ ] `AGENTS.md` — \ - [ ] `README.md` — \ - [ ] `content/docs/maintain/adr/index.mdx` — index row + status # API — (/docs/maintain/_templates/api) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Endpoints [#endpoints] | Method | Path | Purpose | Auth | |---|---|---|---| --- ### `METHOD /path` [#method-path] **Purpose.** One line. **Authorisation.** Who may call it, and which content it may return — cross-reference `content/docs/maintain/rbac/.mdx`. If it is public, say what keeps private content out of it. **Request** ```json {} ``` | Field | Type | Required | Notes | |---|---|---|---| **Responses** | Status | Meaning | Body | |---|---|---| | 200 | | | | 400 | Validation failed | `{ "error": { "code": "...", "message": "..." } }` | | 401 | Not authenticated | | | 403 | Authenticated but not permitted | | | 404 | Not found, or hidden by permission | | **Notes.** Caching and revalidation, content type, pagination, rate limits, side effects. # App flow — (/docs/maintain/_templates/app-flow) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. What a person sees and how they move through it. Sample values are invented (ADR-0008). Phone width first; note where desktop differs. ## Entry points [#entry-points] - Where a person reaches it from (home page, sidebar, search, a package badge or README link, a direct URL, the Markdown version), and what access it needs. - Who does not see it, and what they get at its URL. ## Flow [#flow] Draw this diagram with Archify too. In a copy, wrap the fence in `` … ``, with nothing else inside: the page shows the Archify view and its Markdown the Mermaid. Outside the templates, a bare Mermaid fence fails the build (ADR-0022). ```mermaid flowchart LR A[Screen A] -->|action| B[Screen B] B -->|back| A B -->|search| S[Search dialog] ``` ## Screens [#screens] ### 1. `` — `/route` [#1-screen-name--route] The wireframe gets its own Archify view too, one per screen: an `architecture` diagram drawn from this Mermaid, its boxes placed as the rows, inside a labelled phone-screen region. Wrap the fence in its `` the same way. ```mermaid block-beta columns 4 menu["☰"] title["Site name"]:2 search["⌕"] crumb["Packages › npm › example-pkg"]:4 h1["example-pkg"]:3 version["v1.2.0 ▾"] block:body:4 columns 4 install["npm install example-pkg"]:4 para["Short description of what it does."]:4 end nav["‹ Previous · Next ›"]:4 ``` **States** - Empty: … - Loading: … - Not found: … - Refused (private, no access): … - Error: … - Degraded (an external service such as search is unavailable): … - Success: … # Architecture — (/docs/maintain/_templates/architecture) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Context [#context] What this is, and the boundary between it and everything else. ## Components [#components] | Component | Responsibility | Depends on | |---|---|---| | | | | ## Diagram [#diagram] Draw this diagram with Archify too. In a copy, wrap the fence in `` … ``, with nothing else inside: the page shows the Archify view and its Markdown the Mermaid. Outside the templates, a bare Mermaid fence fails the build (ADR-0022). ```mermaid flowchart TB subgraph Site["puncoz-packages-docs"] CONTENT["content/
MDX"] APP["Next.js + Fumadocs"] end Reader["Reader"] --> APP CONTENT --> APP ``` ## Key decisions in force [#key-decisions-in-force] Links to the ADRs that govern this, one line each on what they mandate. ## Constraints [#constraints] Performance, security, privacy and operational constraints this must respect. # DFD — (/docs/maintain/_templates/dfd) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. > Conventions: `content/docs/maintain/dfd/index.mdx`. Levels balance — a child's flows match its parent's. ## Scope [#scope] Which process this decomposes, and its parent diagram. ## Diagram [#diagram] Draw this diagram with Archify too. In a copy, wrap the fence in `` … ``, with nothing else inside: the page shows the Archify view and its Markdown the Mermaid. Outside the templates, a bare Mermaid fence fails the build (ADR-0022). ```mermaid flowchart LR Ext["External Entity"] subgraph Trust["Trust boundary — puncoz-packages-docs"] P1(("1.0
Process name")) D1[("D1 · Data store")] end Ext -->|"data that moves"| P1 P1 -->|"record written"| D1 D1 -->|"record read"| P1 P1 -->|"result returned"| Ext ``` ## External entities [#external-entities] | Entity | Role | |---|---| ## Processes [#processes] | # | Process | Input → Output | |---|---|---| ## Data stores [#data-stores] | ID | Store | Contents | Classification | |---|---|---|---| | D1 | | | Public / Internal / Confidential / Restricted — see [`../security/data-classification.mdx`](../security/data-classification.mdx) | ## Trust boundary crossings [#trust-boundary-crossings] Every flow that crosses a boundary, with how it is authorised and whether private content can travel on it. | Flow | Direction | Authorisation | Private content? | |---|---|---|---| # ERD — (/docs/maintain/_templates/erd) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Diagram [#diagram] Draw this diagram with Archify too. In a copy, wrap the fence in `` … ``, with nothing else inside: the page shows the Archify view and its Markdown the Mermaid. Outside the templates, a bare Mermaid fence fails the build (ADR-0022). ```mermaid erDiagram PROJECT ||--o{ VERSION : "has" PROJECT { text slug PK text visibility "public | private" } VERSION { text project_slug FK text version "semver" } ``` ## Entities [#entities] ### `` [#entity] | Column | Type | Null | Notes | |---|---|---|---| **Indexes:** … **Invariants:** rules the store or application guarantees (uniqueness, required references, allowed values). ## Relationships [#relationships] | From | To | Cardinality | On delete | |---|---|---|---| ## Sensitive fields [#sensitive-fields] Classification per [`../security/data-classification.mdx`](../security/data-classification.mdx). | Field | Classification | Protection | |---|---|---| # Templates (/docs/maintain/_templates) A starting point for each document type. Copy the file into its directory, fill it in, and delete what does not apply. Each one is a Markdown page with a frontmatter `title` ([ADR-0002](../adr/ADR-0002-living-design-documentation.mdx)) and `description`, a required line ([ADR-0035](../adr/ADR-0035-every-page-is-ready-for-search-and-sharing.mdx)) whose placeholder the build can't tell from your own, so replace it. | Template | Copy to | |---|---| | [ADR](./adr.mdx) | `adr/ADR-NNNN-kebab-title.mdx` | | [App flow](./app-flow.mdx) | `app-flow/.mdx` | | [PRD](./prd.mdx) | `prd/.mdx` | | [Architecture](./architecture.mdx) | `architecture/.mdx` | | [API](./api.mdx) | `api/.mdx` | | [DFD](./dfd.mdx) | `dfd/.mdx` | | [Sequence](./sequence.mdx) | `sequence/.mdx` | | [State machine](./state.mdx) | `state/.mdx` | | [ERD](./erd.mdx) | `erd/system.mdx` | | [RBAC](./rbac.mdx) | `rbac/.mdx` | | [Security](./security.mdx) | `security/.mdx` | # PRD — (/docs/maintain/_templates/prd) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Problem [#problem] Whose problem is this, and what does it cost them today? Observable facts, not aspirations. ## Goal [#goal] What is true once this ships, stated so it can be checked. ## Non-goals [#non-goals] What this deliberately does not do, and where that need is met instead. ## User stories [#user-stories] | # | Story | Acceptance criteria | |---|---|---| | US-1 | As a **``**, I want **``**, so that **``**. | - Given … when … then …
- … | | US-2 | | | ## Rules and edge cases [#rules-and-edge-cases] Behaviour that the stories imply but do not spell out: validation, empty states, versions, private versus public content, what happens to existing pages and their URLs. ## Out of scope for now [#out-of-scope-for-now] Deferred, with the reason. ## Open questions [#open-questions] Decisions still needed, each with options (ADR-0004). Remove once answered. # RBAC — (/docs/maintain/_templates/rbac) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Roles in scope [#roles-in-scope] | Role | Definition | |---|---| ## Scope [#scope] How a role's reach is bounded: public content only · one private project · every project. ## Action matrix [#action-matrix] Legend: ✅ allowed · 🔶 allowed within scope · ❌ denied | Action | Role A | Role B | Role C | |---|---|---|---| | Read page | | | | | Read Markdown / `llms.txt` | | | | | Search | | | | | Edit content | | | | | Publish | | | | ## Surface-level visibility [#surface-level-visibility] Surfaces where visibility differs from the page's own (search index, `llms-full.txt`, Open Graph images, sitemap). | Surface | Public content | Private content | Enforced where | |---|---|---|---| ## Denial behaviour [#denial-behaviour] Whether a denied page is hidden (404) or visible-but-locked (403), and why. # Security — (/docs/maintain/_templates/security) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Attack surface introduced [#attack-surface-introduced] What this feature adds that did not exist before: routes, inputs, published surfaces, stored data, secrets, integrations, build steps. ## Data handled [#data-handled] | Data | Classification | Stored where | Sent where | |---|---|---|---| Classification per [`data-classification.mdx`](../security/data-classification.mdx). If a level is unclear, **ask** — never assign one by assumption (ADR-0004). ## Threats and controls [#threats-and-controls] | # | Threat | How it would be exploited | Control | |---|---|---|---| | T1 | | | | ## Authorization [#authorization] Who may do what, and **where the check happens server-side**. Cross-reference `content/docs/maintain/rbac/.mdx` rather than restating it. ## What is logged [#what-is-logged] Which actions produce a log or audit record, and confirmation that none carries a secret or private content. ## Residual risk [#residual-risk] What is knowingly not defended against, and why that is acceptable. Accepted by whom. # Sequence — (/docs/maintain/_templates/sequence) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Trigger [#trigger] What starts this flow, and the preconditions that must hold. ## Diagram [#diagram] Draw this diagram with Archify too. In a copy, wrap the fence in `` … ``, with nothing else inside: the page shows the Archify view and its Markdown the Mermaid. Outside the templates, a bare Mermaid fence fails the build (ADR-0022). ```mermaid sequenceDiagram autonumber actor R as Reader participant B as Browser participant S as Site participant X as External service R->>B: action B->>S: request S->>X: call X-->>S: result S-->>B: response B-->>R: outcome ``` ## Failure paths [#failure-paths] | Step | Failure | Behaviour | Recovery | |---|---|---|---| ## Post-conditions [#post-conditions] What is true once the flow completes, including what was written or published. # State machine — (/docs/maintain/_templates/state) - **Status:** Draft - **Last updated:** YYYY-MM-DD - **Related ADRs:** ADR-NNNN > Snapshot of the system as it stands today. Edit in place; never record what changed. ## Diagram [#diagram] Draw this diagram with Archify too. In a copy, wrap the fence in `` … ``, with nothing else inside: the page shows the Archify view and its Markdown the Mermaid. Outside the templates, a bare Mermaid fence fails the build (ADR-0022). ```mermaid stateDiagram-v2 [*] --> Draft Draft --> Published: publish Published --> Deprecated: deprecate Deprecated --> [*] ``` ## States [#states] | State | Meaning | Who can see it | |---|---|---| ## Transitions [#transitions] | From | To | Trigger | Guard | Side effects | |---|---|---|---|---| ## Terminal states [#terminal-states] Which states are final, and what remains possible from them (read, redirect, archive). # ADR-0001 — Every change starts with an approved ADR (/docs/maintain/adr/ADR-0001-adr-driven-development-workflow) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `AGENTS.md` §2–§3, `content/docs/maintain/adr/index.mdx`, `content/docs/maintain/_templates/adr.mdx` ## Context [#context] puncoz-packages-docs is greenfield: a Fumadocs scaffold that will document every package, library and project its owner builds — npm, Composer and other ecosystems, public and private projects. The owner builds it change by change, largely with AI agents. Two forces make an explicit gate necessary: - **The expensive mistakes are structural and early.** How content is laid out per ecosystem and package, how versions are handled, and how private project documentation is kept off the public site are cheap to get right on paper and expensive to change once many pages and inbound links depend on them. A private page that was published cannot be unpublished. - **Agents produce plausible work fast.** Without a gate, a decision is made implicitly in code and found late. ## Decision [#decision] 1. **Every feature and functional change starts with an ADR** in `content/docs/maintain/adr/`, written from `content/docs/maintain/_templates/adr.mdx`, with `Status: Proposed` and an index row in `content/docs/maintain/adr/index.mdx`. 2. **No application code is written until the owner explicitly approves it.** Approval sets `Status: Approved`, `Approved by`, `Approved on`. 3. **Once approved, the whole scope is implemented in one pass**, with tests and every affected document, without stopping for per-step review. 4. **Agents never commit, push, rebase or switch branches.** The owner reviews the working tree and commits. 5. **An approved ADR's Decision is never edited**; it is superseded by a new ADR. 6. **Content within approved conventions needs no ADR.** Writing or updating a package's or project's pages is the site's normal work; deciding the conventions themselves is not. What needs an ADR is the table in `AGENTS.md` §2. Anything that decides how private project documentation is stored, built, served or searched always does. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — ADR gate for every functional change | Decisions are explicit, reviewable and recorded; structural mistakes are caught before code | Ceremony on small features | Chosen | | B — Code first, document after | Fast | Decisions are implicit; privacy and structure errors are found late | Rejected | | C — ADRs only for "big" changes | Less ceremony | "Big" is judged by whoever wants to skip it | Rejected | ## Consequences [#consequences] **Positive** - Every decision has a record of why, which an agent in a later session can read. - The owner controls scope change by change. **Negative / accepted trade-offs** - Small features carry an ADR's overhead. Accepted: the template keeps a small ADR small. ## Content invariants [#content-invariants] Establishes the gate through which any departure from `AGENTS.md` §6 must pass. ## Security considerations [#security-considerations] None directly — this is a process decision. It does make every later security decision pass through the mandatory security section of an ADR (ADR-0005). ## Implementation notes [#implementation-notes] - [x] `AGENTS.md` §2–§3 describe the gate and execution rules. - [x] `content/docs/maintain/adr/index.mdx` holds the index and the next free number. - [x] `content/docs/maintain/_templates/adr.mdx` exists. - Tests: not applicable (process only). > Written together with the documents it governs, at the owner's direct request, so the > implementation notes above are already done. If the owner rejects or changes this ADR, the > documents are changed to match. ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `content/docs/maintain/adr/index.mdx` — status on approval. # ADR-0002 — Design documents are living snapshots, published as this site's Maintain track (/docs/maintain/adr/ADR-0002-living-design-documentation) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** [ADR-0012](./ADR-0012-every-page-is-mdx.mdx) (decision 4: every page is MDX); [ADR-0011](./ADR-0011-archify-diagrams-are-embedded-from-sandboxed-html.mdx) (decision 5, in part: Archify diagrams are embedded from sandboxed HTML, with the Mermaid version kept) - **Design documents:** `content/docs/maintain/index.mdx`, `content/docs/maintain/meta.json`, every directory `index.mdx`, `content/docs/maintain/_templates/` ## Context [#context] This repository is a documentation site, so "documentation" means two different things here: - **Package and project documentation**: the pages readers come for. It is the product. - **Documentation about the site**: why it is built the way it is, and how it works. The second kind serves two further jobs: - **Decisions** need a permanent, ordered record of why. - **Design documents** (flows, data flows, access rules, the threat model) must match the code at all times. A document that describes an old version is worse than none, because it is believed. The owner decided on 2026-10-31 that the site's own documentation is published on the site, rather than kept in a separate `docs/` folder outside the content. ADR-0015 then made the site a catalogued project like any other, slug `docs`, so this documentation is that project's Maintain track. ## Decision [#decision] 1. **The site's own documentation is the Maintain track of the project `docs`**, `content/docs/maintain/`, published at `/docs/maintain` (ADR-0015). 2. **Three kinds of document:** - `content//`, except `content/docs/maintain/` — **package and project documentation**, written and updated within the approved content conventions and the invariants in `AGENTS.md` §6. - `content/docs/maintain/adr/` — **immutable once approved**; superseded, never rewritten. - Everything else under `content/docs/maintain/` — **living snapshots** of the site as it stands, edited in place. No revision tables, no "previously X, now Y", no strikethrough. What is no longer true is deleted. Git and ADRs hold the history. 3. **Typed directories**: `app-flow/`, `prd/`, `architecture/`, `erd/`, `dfd/`, `state/`, `sequence/`, `api/`, `rbac/`, `security/`, each with an `index.mdx` of its conventions, and `_templates/` with a starting point for each. Which ones a change requires is the table in `AGENTS.md` §8. 4. **Pages are Markdown (`.md`)** with a frontmatter `title` and no `#` heading; links between them are relative file paths. 5. **Diagrams are Mermaid** in fenced blocks: flows, sequences, state machines, ERDs and screen wireframes. No binary or externally hosted images. Rendering them as diagrams on the site is a separate decision (a new dependency). 6. **An implementation is not complete while a design document contradicts it.** 7. **Skill-generated specs and plans** go into these directories (usually the ADR and its design documents), not into a skill's own folder layout. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Published with the site, now `content/docs/maintain/` | The site documents itself with its own tooling; one content tree; search, Markdown and `llms.txt` cover the design docs too | Design documents, including the threat model, are public | Chosen by the owner | | B — A separate `docs/` folder outside the content | Internal notes stay off the site | Two folders called "docs"; the design docs get none of the site's features | Rejected by the owner | | C — Changelog-style design docs | History visible inline | Readers must reconstruct the current state | Rejected | ## Consequences [#consequences] **Positive** - A reader finds the current system in the design docs, the reasons in ADRs, and the packages in the rest of the site — all in one place, searchable. **Negative / accepted trade-offs** - Everything here is public: the threat model, the audit checklist and the secrets inventory (variable names, never values). Accepted with this decision. - Mermaid shows as code on the site until a renderer is adopted. ## Content invariants [#content-invariants] §6.1 applies here as everywhere: nothing about a private project goes into these pages. ## Security considerations [#security-considerations] These pages are published on every surface (`AGENTS.md` §6.1), so they must never hold a secret value, a private project's details, or an unfixed vulnerability's exploit path. A finding that is not yet fixed is reported to the owner, not written here, until it is fixed. `content/docs/maintain/security/` follows the living-snapshot rule, so the threat model and secrets inventory are kept accurate rather than historical. ## Implementation notes [#implementation-notes] - [x] `content/docs/maintain/` with `meta.json`, `index.mdx` and each directory `index.mdx`; `content/docs/meta.json` catalogues the site as project `docs` (ADR-0015). - [x] `content/docs/maintain/_templates/` holds the templates. - [x] `AGENTS.md` §8 states the three kinds, the page format and the "write before building" table. - Tests: none — verified by `bunx next build` compiling every page. > Approved as written on 2026-11-01, by the owner's choice. Decision 4 was already superseded by > ADR-0012 and decision 5 in part by ADR-0011; diagrams are made with Archify, with their > Mermaid version kept, by the owner's standing choice in `AGENTS.md` §8. ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `content/docs/maintain/adr/index.mdx` — status on approval. # ADR-0003 — Comments explain why; every branch takes a block (/docs/maintain/adr/ADR-0003-code-comment-policy) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `AGENTS.md` §7 ## Context [#context] AI-written code tends to over-comment: restating the code, adding banners and section headers. Those comments rot as the code changes, and they hide the few comments that matter — the non-obvious constraints (framework quirks, third-party API limits, build-environment differences). Separately, an unbraced `if` body reads as guarded when a second line is added under it, and the diff looks right. In a filter that decides which pages are published, that is a silent leak. ## Decision [#decision] 1. **Comments explain *why*; the code explains *what*.** Default to no comment. Write one only for reasoning, trade-offs, edge cases or external constraints that cannot be recovered from the code. Prefer a reference to an ADR over prose. One or two lines, directly above what they explain. No banners, no `=====` headers. 2. **Configuration files may describe what a key does** (`next.config.mjs`, `eslint.config.mjs`, `tsconfig.json`, `.env.example`, CI and deployment manifests), still briefly, still linking the governing ADR. `.env.example` documents every variable and never its value. 3. **Tooling-consumed documentation stays**: JSDoc/TSDoc on exported public APIs, `@ts-expect-error` reasons, pragmas, directives. 4. **Every control-flow branch takes a block**: `if`, `else`, `for`, `while`, `do` bodies are braced even for one statement, enforced by ESLint `curly: ["error", "all"]`. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Why-only comments + mandatory braces (lint-enforced) | Comments stay meaningful; brace rule is mechanical and cheap | Requires discipline from agents | Chosen | | B — Comment liberally | Feels explanatory | Comments rot and drown the important ones | Rejected | | C — Braces by convention only | No lint change | Unenforced conventions drift | Rejected | ## Consequences [#consequences] **Positive** - The comments that exist are worth reading. - A class of control-flow bugs is ruled out by lint. **Negative / accepted trade-offs** - Slightly more verbose one-line conditionals. ## Content invariants [#content-invariants] None directly. ## Security considerations [#security-considerations] None — this change touches no data, no endpoint and no secret. (Comments must still never contain secrets; see ADR-0005.) ## Implementation notes [#implementation-notes] - [ ] Add `curly: ["error", "all"]` to `eslint.config.mjs`, with a one-line comment linking this ADR. **Deferred by the owner's choice (2026-11-01)** to the ADR that makes `bun run lint` run again: typescript-eslint does not support TypeScript 7, so the rule could not be checked. The policy is followed by hand until then. - [ ] Run `bun run lint` and fix any violations, with that ADR. - [ ] Tests: none meaningful for a lint rule; verified by `bun run lint` failing on an unbraced branch and passing after. ## Docs to update on implementation [#docs-to-update-on-implementation] - [ ] `AGENTS.md` §7 — say the brace rule is enforced (drop "once it is approved"). - [x] `content/docs/maintain/adr/index.mdx` — status. # ADR-0004 — Resolve ambiguity by asking, never by guessing (/docs/maintain/adr/ADR-0004-ask-never-guess) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `AGENTS.md` §4 ## Context [#context] The cheapest failure for an agent is to pick something plausible and move on. The assumption looks finished, gives no signal it was made, and is found late. On a documentation site the damage is public: a plausible guess about an install command, a function signature, a default option or a supported runtime is published as fact and copied into other people's code. A guess about whether a project is private publishes it. The owner prefers to be questioned with **selectable options**, not open-ended prompts. ## Decision [#decision] 1. **Classify the question first.** - *Verifiable* (framework API, library behaviour, existing code, config, what a documented package exports or requires): **check it** in `node_modules/next/dist/docs/`, the installed Fumadocs source and types, the config, or the documented package's own source and manifest. Don't assert from memory and don't ask the owner. - *Undetermined* (product behaviour, scope, priority, naming, content structure, public versus private, trade-offs): **ask**. 2. **Every question carries** the decision in one line and why it can't be settled from the code or documents; two to four concrete options with their consequences; a recommendation listed first and marked; and what each option builds, costs and forecloses. Use a selectable options tool where available. 3. **No silent assumptions.** Work that proceeds on an assumption states it in the response and in the ADR or design document it shapes. 4. **Ask at ADR time**, in *Options considered*. Mid-implementation: finish what doesn't depend on the answer, then ask. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Ask with options + recommendation; check what is checkable | Owner answers by picking; decisions recorded; no noise for verifiable facts | Some interruptions | Chosen | | B — Agent decides and documents | Fewer interruptions | Wrong guesses look like right ones, and get published | Rejected | | C — Ask everything open-ended | Maximum control | Slow; owner asked for options | Rejected | ## Consequences [#consequences] **Positive** - Content, structure and privacy decisions stay with the owner and are written down. - Published facts about packages are read from their source, not recalled. **Negative / accepted trade-offs** - More questions at ADR time. Accepted: that is the cheapest moment for them. ## Content invariants [#content-invariants] Protects all of `AGENTS.md` §6 by routing any ambiguity about them to the owner; directly enforces §6.2 (documentation is checked against the code). ## Security considerations [#security-considerations] Security, privacy and visibility questions are always *undetermined* and always asked (ADR-0005). ## Implementation notes [#implementation-notes] - [x] `AGENTS.md` §4 states the rule. - Tests: not applicable (process only). ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `content/docs/maintain/adr/index.mdx` — status. # ADR-0005 — Security and privacy are a standing practice (/docs/maintain/adr/ADR-0005-security-as-a-standing-practice) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `AGENTS.md` §9, `content/docs/maintain/security/index.mdx`, `threat-model.mdx`, `data-classification.mdx`, `secrets.mdx`, `checklist.mdx`, `content/docs/maintain/_templates/security.mdx` ## Context [#context] The site documents public packages and will also document **private projects**. Today every page in `content/` is published on several surfaces at once: the rendered page, its Markdown version, `llms.txt` / `llms-full.txt`, the `static.json` record list, an Open Graph image, and the Algolia index, which anyone holding the public search-only key can read in full. A private page placed there is public the moment the site is built. The build also holds a write key to the search index, and documentation examples are a natural place for a real token or internal hostname to slip in. Security added before launch, as a one-off review, misses the decisions made along the way. ## Decision [#decision] 1. **Security is a property of every change.** Every ADR has a mandatory *Security considerations* section. "None" is a valid answer; an omitted section is not. 2. **The owner decides security and privacy questions** — which projects are private, who may read them, what is sent to a third party, what an example may contain — and they are recorded (ADR-0004). 3. **A per-change checklist** (`AGENTS.md` §9) is run for the rows a change touches. 4. **Full audits** (`content/docs/maintain/security/checklist.mdx`) run before the first internet-reachable deployment and before each release. 5. **Living security documents** in `content/docs/maintain/security/`: threat model, data classification, secrets inventory, audit checklist, and per-feature analyses when warranted. 6. **Tool-specific rules arrive with the tool.** The ADR adopting a host, analytics, CI or an authentication provider adds its checks to `checklist.mdx`. 7. **Principles that hold regardless of stack**: no secret literals; anything in the browser or the search index is public; authorization server-side; published is permanent; no secrets or personal data in logs or responses; generic client errors; a publishing build refuses to run without its secrets. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Standing practice, per-change checks, gated audits | Decisions are made deliberately when they are cheapest | Overhead on each ADR | Chosen | | B — Pre-launch security review only | Less overhead | Misses design-time decisions; a published private page cannot be recalled | Rejected | ## Consequences [#consequences] **Positive** - How private documentation is kept and served is designed in, not patched on. **Negative / accepted trade-offs** - Every ADR is longer. Accepted. ## Content invariants [#content-invariants] Directly supports §6.1 (private stays private) and §6.4 (examples carry no real credentials or data). ## Security considerations [#security-considerations] This ADR is the security policy. The data classification levels in `content/docs/maintain/security/data-classification.mdx` are **proposed** with it and become binding on approval. ## Implementation notes [#implementation-notes] - [x] `content/docs/maintain/security/` files exist and describe the current surface. - [x] `AGENTS.md` §9 holds the per-change checklist. - [x] `content/docs/maintain/_templates/security.mdx` exists. - [x] Add `.env.example` with the three Algolia variables, names only. - Tests: not applicable (process only). ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `content/docs/maintain/security/data-classification.mdx` — mark the levels approved. - [x] `content/docs/maintain/adr/index.mdx` — status. # ADR-0006 — Agent skills are advisory; this repository's documentation is binding (/docs/maintain/adr/ADR-0006-agent-skills-are-advisory) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `AGENTS.md` §12 ## Context [#context] Contributors have a library of installed skills (brainstorming, debugging, planning, TDD, technical writing, security review, UI design…). Used, they make work consistent. But they are written for generic projects, and several carry process opinions that contradict this repository: a brainstorming skill that writes specs to its own folder and commits them, a planning skill that proceeds straight to implementation, skills that add dependencies or deploy freely. ## Decision [#decision] 1. **Use skills**: invoke any skill that fits, and name it. Process skills come before implementation skills. 2. **Precedence**: `AGENTS.md` and `content/docs/maintain/` are binding; skills are advisory; default behaviour comes last. 3. **No skill grants a permission this repository withholds**: code before approval, commits, new dependencies or tooling, a different docs layout, *what*-comments, security or privacy decisions, `NEXT_PUBLIC_` variables or integrations, publishing (a production build, a deploy, a search-index write), and framework claims from recall. 4. **Skills stop at the gate**: a workflow that ends in "implement" ends here at `Status: Proposed`. 5. **Report what was dropped**: when a rule cuts a skill short, say which skill, which step, and which rule. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Skills advisory, repo docs binding | Method from skills, authority from the repo | Agents must reconcile the two | Chosen | | B — Skills binding | Simple | Skills would bypass the ADR gate and commit rule | Rejected | | C — No skills | No conflicts | Loses consistent method | Rejected | ## Consequences [#consequences] **Positive** - Consistent method without giving up the gate. **Negative / accepted trade-offs** - Some skill steps are routinely dropped (spec folders, commits) and must be reported. ## Content invariants [#content-invariants] None directly. ## Security considerations [#security-considerations] Prevents skills from making security or privacy decisions, adding integrations or publishing on the owner's behalf. ## Implementation notes [#implementation-notes] - [x] `AGENTS.md` §12 holds the precedence and the "no skill authorises" table. - Tests: not applicable (process only). ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `content/docs/maintain/adr/index.mdx` — status. # ADR-0007 — Tests are part of every change (/docs/maintain/adr/ADR-0007-tests-are-part-of-every-change) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `AGENTS.md` §3, §5, §11 ## Context [#context] Most of this site is content, but the code around it decides what is published and where: the content loader, the Markdown and `llms.txt` routes, the search records and their sync, and — once private documentation exists — whatever keeps private pages off public surfaces. Errors there are silent: a page goes missing from search, or a private page appears in it. No test runner is installed. Bun is the package manager and has a built-in test runner; the choice of runner is left to its own ADR so it can be weighed against what the site's code needs. ## Decision [#decision] 1. **Every change ships tests** for its happy path and its obvious failure paths — empty or missing input, the boundary and the first value past it, the wrong shape or an unknown value, and **the rejection the code exists to perform** (a private page refused, a malformed frontmatter rejected). Part of being done, not a follow-up. 2. **A bug fix starts with a test that fails for the bug's reason.** 3. **A test must have been seen to fail** (written first, or checked by breaking the code) before it counts. 4. **The runner is chosen by its own ADR**, before the first code change that needs tests. Until then, a change is verified with `bun run lint`, `bun run types:check` and `bunx next build`, and the ADR's implementation notes say what was verified instead. 5. **Unit tests are pure**: no live search index, network or real private content. Fixtures are invented. 6. **Content is verified by the build.** `bunx next build` fails on invalid MDX or frontmatter; link and example checks, if wanted, are decided by their own ADR. 7. **Exempt from unit tests**: config modules, pure layout and styling. Anything that needs a browser says so in the ADR's implementation notes, with what was verified instead. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Tests with every change; runner chosen by its own ADR | The rule holds from now; the runner is a deliberate choice | No runner until that ADR lands | Chosen | | B — Pick a runner in this ADR | Tests can start immediately | Decides tooling before there is code that needs it | Rejected | | C — Tests optional for small changes | Faster small changes | Publishing bugs hide in small changes | Rejected | ## Consequences [#consequences] **Positive** - The code that decides what is published has a safety net from its first line. **Negative / accepted trade-offs** - Every change takes longer. Accepted. ## Content invariants [#content-invariants] Guards §6.1 (private stays private) and §6.5 (every page readable as Markdown) through tests on the code that serves them. ## Security considerations [#security-considerations] Tests must never contain a real secret, a real search key, or private project content. Visibility code is tested for refusals, not only for success. ## Implementation notes [#implementation-notes] - [ ] A test-runner ADR before the first code change that needs tests: [ADR-0021](./ADR-0021-tests-run-with-bun-test.mdx), proposed 2026-11-01. ADR-0018 and ADR-0019 shipped with hand checks only; their checks become the first tests once ADR-0021 is approved. - Tests: not applicable (process only). ## Docs to update on implementation [#docs-to-update-on-implementation] - [ ] `AGENTS.md` §5 — the runner and its command, once its ADR is approved. - [ ] `README.md` scripts — the test command. - [x] `content/docs/maintain/adr/index.mdx` — status. # ADR-0008 — A UI change ships an app flow, drawn in Mermaid (/docs/maintain/adr/ADR-0008-a-ui-change-ships-an-app-flow) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `content/docs/maintain/app-flow/index.mdx`, `content/docs/maintain/_templates/app-flow.mdx`, `AGENTS.md` §2 ## Context [#context] An ADR's text says what is decided. It rarely shows what a reader will see, and UI mistakes (a missing state, a confusing navigation, a buried install command) are cheapest to catch before code. A documentation site lives or dies on how fast a reader gets from a search or a package name to the snippet they need. The owner wants diagrams, flows and screens drawn in **Mermaid**: flowcharts for flows and `block-beta` diagrams for wireframes. ## Decision [#decision] 1. **Any ADR that adds or changes something a person sees ships `content/docs/maintain/app-flow/.mdx`**, reviewed together with the ADR. 2. It contains: - **entry points**, and who does not see the feature; - **the flow** as a Mermaid flowchart; - **one wireframe per screen** as a Mermaid `block-beta` diagram, phone width first, with invented sample values; - **each screen's states**: empty, loading, not found, refused, error, degraded, success. 3. **One file per feature, living** (ADR-0002): later ADRs that change the feature's UI edit it in place. 4. Not required for bug fixes, for content within the approved conventions, or for ADRs that change nothing visible. If unsure, write it. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Mermaid flow + `block-beta` wireframes | Matches the owner's instruction; renders on GitHub; diffs as text | `block-beta` is coarse for detailed layout | Chosen | | B — Plain-text ASCII mockups | Precise layout; no renderer needed | Doesn't match the owner's instruction | Rejected | | C — Design tool images | High fidelity | Binary, external, don't diff, drift | Rejected | ## Consequences [#consequences] **Positive** - The owner reviews what readers will see, not just what will be built. **Negative / accepted trade-offs** - Wireframes are approximate; visual design is decided in its own ADR(s). ## Content invariants [#content-invariants] Supports §6.5 (every page readable as Markdown) by putting each page type's Markdown entry points up for review with the screens. ## Security considerations [#security-considerations] Wireframes use invented values only — never a private project's name or details. ## Implementation notes [#implementation-notes] - [x] `content/docs/maintain/app-flow/index.mdx` and `content/docs/maintain/_templates/app-flow.mdx` exist. - [x] `AGENTS.md` §2 describes the requirement. - Tests: not applicable (process only). > Approved as written on 2026-11-01, by the owner's choice. `AGENTS.md` §2 and §8 add, by the > owner's standing choice, that the flow is made with Archify with its Mermaid version kept in > the page; HTML prototypes are not made. ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `content/docs/maintain/adr/index.mdx` — status. # ADR-0009 — Trusted agent skills are vendored in .claude/agent-skills/, routed by an index (/docs/maintain/adr/ADR-0009-trusted-agent-skills-are-vendored) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** — - **Design documents:** `.claude/agent-skills/INDEX.md`, `.claude/agent-skills/SOURCES.md`, `AGENTS.md` §12, [`../index.mdx`](../index.mdx) ## Context [#context] ADR-0006 makes skills advisory and this repository binding. Two problems remain: - **Trust.** Skills are instructions an agent follows. Registries hold hundreds of thousands of them, most from unknown authors, some without a licence. A malicious or careless skill is a supply-chain risk: it can tell an agent to run commands, exfiltrate data, or quietly bypass this repository's rules. - **Context cost.** Loading many skills at once wastes the model's context and blurs which guidance applies. The owner wants agents to load only what a task needs. Only trusted skills may be used: ones trusted by many, ones from the owner of the package, library or service they cover, or ones from another source of high trust. Untrusted ones must be put to the owner with better alternatives. `AGENTS.md` always ranks above skills. The skills are tooling for contributors, not documentation for readers, so they do not belong in `content/`, where every file is published (ADR-0002). ## Decision [#decision] 1. **Trusted skills are vendored** — copied into `.claude/agent-skills/-/` at a pinned upstream commit, with the upstream licence and unmodified files. Upstream paths are kept so a skill's relative links resolve. JavaScript/TypeScript files are omitted so lint and the build ignore the folder; omissions are listed. 2. **A skill is trusted** when at least one holds: it comes from the owner of what it covers (the maintainer of a package, library or service this site uses); it is trusted by many (wide, visible adoption from a recognised maintainer); or its source has otherwise high trust (an established security or engineering reputation, the agent's own vendor). It must also be licensed for copying, scanned, and pinned. 3. **`.claude/agent-skills/SOURCES.md`** records the trust policy, every source (repository, commit, date, licence, trust basis), what was read in full and what was scanned, omissions, rejected candidates, and how to update. 4. **`.claude/agent-skills/INDEX.md` is the router.** Agents read it, then load only the one or two `SKILL.md` files their task needs. Its *Overrides* state how each conflicting skill instruction is handled here, generally and per skill. 5. **Not `.claude/skills/`.** Claude Code auto-loads skills from `.claude/skills/`; these are read through the index instead, so the overrides are applied every time and nothing loads unasked. 6. **In-house skills**, when the owner wants one, live in `.claude/agent-skills/local/` and are reviewed like any design document. 7. **Untrusted skills are not used.** Anything not in this folder, including skills installed as plugins, needs the owner's approval first. The request names the trusted alternatives. Where an installed plugin has a skill of the same name, the pinned copy wins. 8. **The set grows as work needs it, with the owner's yes first.** An agent that finds a task better served by a skill that is not vendored proposes trusted candidates, with a recommendation. Nothing is cloned, downloaded or added until the owner approves (`SOURCES.md` § Adding a skill). 9. **Owner-approved installed skills are the exception to vendoring.** The owner approved skill sets that they install themselves: impeccable, ui-ux-pro-max, the taste skills, hallmark and Archify. They are listed in `SOURCES.md` and routed, with overrides, in `INDEX.md`. They are not pinned, so they are re-reviewed after an update. 10. **Remote instructions are pinned.** A skill that fetches its rules at run time uses a pinned local snapshot instead. 11. **Precedence is unchanged:** `AGENTS.md` > ADRs and `content/docs/maintain/` > skills > default behaviour. ## Options considered [#options-considered] | Option | Pros | Cons | Verdict | |---|---|---|---| | A — Vendor pinned copies in `.claude/agent-skills/` + index router | Reviewed content; immune to upstream changes; minimal context via routing; works for any agent; not published | Manual updates; repository size grows (~1 MB) | Chosen | | B — Vendor into `.claude/skills/` for auto-loading | Skills appear in the agent's skill list | Every skill's description loads into every session; the overrides can be skipped | Rejected | | C — Vendor into `content/docs/maintain/agent-skills/` | Visible on the site | Published to the site, search index and `llms.txt`; third-party text presented as this site's documentation | Rejected | | D — Install from registries (`npx skills add`) per machine | Always current | Unpinned; content can change under us; differs by machine; harder to review | Rejected | | E — Link to upstream only | No copying | Agents fetch live, unreviewed instructions | Rejected | ## Consequences [#consequences] **Positive** - Every instruction an agent follows from a skill has been read or scanned, pinned and attributed. - Agents load a small, task-specific slice of guidance. **Negative / accepted trade-offs** - Vendored skills go stale; updates are a deliberate review (`SOURCES.md` § Updating). - Some skills duplicate installed plugins; the index states the pinned copy wins. - The approved installed UI/UX skills are not pinned: an update can change what an agent follows before anyone re-reviews it. - An agent that does not read `AGENTS.md` will not find the skills; `AGENTS.md` §12 points to the index. ## Content invariants [#content-invariants] None directly. The overrides protect the process rules (no commits, ADR gate, no unapproved dependencies, secrets or publishing). ## Security considerations [#security-considerations] This decision is a supply-chain control. Vendored content is scanned for command execution, network calls, credential handling and instruction-override text before copying. Findings are neutralised by the overrides in `INDEX.md`. Bundled scripts are never run without approval: the supply-chain auditor's scripts call registry, advisory and GitHub APIs and read `gh auth token`. Licences with attribution or share-alike terms (CC-BY-SA-4.0 for the Trail of Bits skill) apply to the files they cover. `.claude/` is not under `content/`, so none of it is published. ## Implementation notes [#implementation-notes] - [x] `.claude/agent-skills/INDEX.md` and `SOURCES.md` exist, with the trust policy and overrides. - [x] The first sources are vendored, scanned, recorded in `SOURCES.md` and routed in `INDEX.md`: obra/superpowers, addyosmani/agent-skills, vercel-labs/agent-skills (with the writing and web-interface guideline snapshots), vercel/next.js, anthropics/skills, mattpocock/skills, trailofbits/skills, algolia/skills. - [x] The owner reviewed the selection and accepted vercel-labs/agent-skills, which states MIT in its README but has no `LICENSE` file (2026-11-01). - [x] ESLint ignores `.claude/**` (`eslint.config.mjs`), by the owner's decision: installed skills (hallmark, design-taste-frontend v2) ship `.mjs` scripts and `.tsx` fixtures there. - Tests: not applicable (documentation). Verified that no `.js`, `.cjs`, `.mjs`, `.ts`, `.tsx` or `.jsx` file is vendored, and that `bunx next build` is unaffected. ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `AGENTS.md` §10, §11, §12 - [x] `README.md` — project structure, skills, decisions table - [x] [`../index.mdx`](../index.mdx) — directory map - [x] [`./index.mdx`](./index.mdx) — title - [x] [`./index.mdx`](./index.mdx) — status on approval # ADR-0010 — Projects document themselves here through a git submodule, one folder each (/docs/maintain/adr/ADR-0010-projects-document-themselves-through-a-submodule) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** — - **Superseded by:** [ADR-0024](./ADR-0024-a-project-can-span-several-repositories.mdx) (in part: decision 2 for a project with several repositories: each edits its own folders, the primary the shared files) - **Design documents:** `PROJECT_AGENTS.md`, [`../app-flow/package-navigation.mdx`](../app-flow/package-navigation.mdx), [`../app-flow/site-pages.mdx`](../app-flow/site-pages.mdx), `AGENTS.md` §1, §8 ## Context [#context] The owner's project and package repositories will include this repository as a git submodule and maintain their own documentation in it. Their agents then work inside this repository without having read its working agreement, from a repository whose rules differ. Three things are undecided without this ADR: where a project's pages go (the per-project content layout is open, `AGENTS.md` §1), how changes made in a submodule come back, and what a private project may put here. Every file under `content/` is published (ADR-0002, §6.1), and a consuming repository may be private. ## Decision [#decision] 1. **One folder per project or package**: `content//`, published at `/`, in the shape of ADR-0013 and ADR-0015. Readers reach it from the home page, search and the header. The slug is agreed with the owner when the folder is first created. 2. **Consuming repositories edit only their own folder.** Any other change, such as another project's pages, `src/`, configuration, dependencies or this site's documents, is a change to the site and goes through ADR-0001. 3. **Edit only; a human commits.** An agent in a consuming repository never commits, pushes, rebases or switches branches inside the submodule, and never moves the submodule pointer. It lists its changes and hands the human the commands. 4. **Public only until private documentation is decided.** A private project keeps its documentation in its own repository and adds nothing here, until an ADR decides how private documentation is stored, served and searched. 5. **`PROJECT_AGENTS.md`** at the repository root is the guide for consuming repositories, with a block each one pastes into its own `AGENTS.md` / `CLAUDE.md`. It changes in the same change as anything that alters how they work here, and so does `AGENTS.md`. 6. **Writing pages inside a project's folder needs no ADR**, within this guide and the content invariants. ## Options considered [#options-considered] | Concern | Option | Pros | Cons | Verdict | |---|---|---|---|---| | Layout | A — `content//` folder per project | Self-contained; a consumer touches one folder; this site is one too (`docs`) | Every slug shares the root with the site's routes, so some are reserved (ADR-0015) | Chosen | | Layout | B — grouped: `projects//`, `packages///` | Browsable by kind and ecosystem | Deeper paths; the grouping itself needs deciding | Rejected | | Layout | C — a separate content-layout ADR first | Decides everything at once | Consumers wait | Rejected | | Git flow | A — edit only, a human commits | Same rule as this repository; a person reviews every change before it is published | Manual steps for every update | Chosen | | Git flow | B — the agent commits on a branch and opens a pull request | Reviewable and traceable | Agents commit, against `AGENTS.md` §3 | Rejected | | Git flow | C — the agent commits and pushes to `main` | Fastest | No review before publishing | Rejected | | Private | A — not yet; private projects keep docs locally | Nothing private can leak | Private projects get no site yet | Chosen | | Private | B — draft the private-documentation ADR now | Starts the design | Private consumers still wait for it | Deferred | | Private | C — this site stays public only, permanently | Simplest | Contradicts the site's purpose (`AGENTS.md` §1) | Rejected | | Guide | `PROJECT_AGENTS.md` + a paste-in block | Short and separate; consumers' agents find it from their own instructions | A second file to keep in step with `AGENTS.md` | Chosen | ## Consequences [#consequences] **Positive** - Each project's documentation lives next to its code and is published in one place. - A person reviews every change before it reaches a public surface. **Negative / accepted trade-offs** - Every update needs a manual commit in the submodule and a pointer bump in the project. - Private projects have no documentation here until a later ADR. - Projects are found from the home page and search, not a sidebar switcher; a large number may need grouping later (a new ADR). ## Content invariants [#content-invariants] All five apply to every consuming repository's pages; `PROJECT_AGENTS.md` §4 restates them. Invariant 1 is the reason for decision 4. ## Security considerations [#security-considerations] - **Trust boundary.** Content moves from consuming repositories, some of them private, into this public site. The controls are: private repositories add nothing (decision 4); public pages carry no secrets, internal hostnames, client names, personal data or copied private code (`PROJECT_AGENTS.md` §2); and a human reviews and commits every change (decision 3). - **Scope.** Consuming agents may only edit their own folder (decision 2), so a consuming repository cannot change routes, the search sync or another project's pages. - **Publishing.** Consumers verify with `bunx next build` and never run `bun run build`, which writes to the live search index. ## Implementation notes [#implementation-notes] - [x] `PROJECT_AGENTS.md` written with the paste-in block. - [x] App flow: [`../app-flow/package-navigation.mdx`](../app-flow/package-navigation.mdx) and [`../app-flow/site-pages.mdx`](../app-flow/site-pages.mdx). - [ ] On approval: the first consuming project's folder, with the slug agreed with the owner. - [x] On approval: `../dfd/system.mdx` gains consuming repositories as a source, across the trust boundary. - Tests: the catalogue build checks (ADR-0015 decision 5) fail on a folder without a `catalog`; automated tests belong with the test runner chosen under ADR-0007. ## Docs to update on implementation [#docs-to-update-on-implementation] - [x] `AGENTS.md` §1, §8, §10 - [x] `README.md` — project structure, decisions table - [x] [`./index.mdx`](./index.mdx) — index row, next free number - [x] [`./index.mdx`](./index.mdx) — status on approval # ADR-0011 — Archify diagrams are embedded in pages from sandboxed HTML files (/docs/maintain/adr/ADR-0011-archify-diagrams-are-embedded-from-sandboxed-html) - **Status:** Approved - **Date:** 2026-10-31 - **Deciders:** [@puncoz](https://github.com/puncoz) - **Approved by:** [@puncoz](https://github.com/puncoz) - **Approved on:** 2026-11-01 - **Supersedes:** [ADR-0002](./ADR-0002-living-design-documentation.mdx) decision 5 (in part: rendering diagrams on the site) - **Superseded by:** [ADR-0022](./ADR-0022-diagrams-show-archify-on-the-page-and-mermaid-in-markdown.mdx) decisions 1 to 3 - **Design documents:** [`../app-flow/diagrams.mdx`](../app-flow/diagrams.mdx), [`../architecture/system.mdx`](../architecture/system.mdx), [`../api/content-routes.mdx`](../api/content-routes.mdx), [`../security/threat-model.mdx`](../security/threat-model.mdx), `AGENTS.md` §8, `PROJECT_AGENTS.md` §3, §4 ## Context [#context] Diagrams and flows for this site's pages are always made with Archify (`AGENTS.md` §8), which writes one standalone HTML file per diagram. Every page keeps a Mermaid version of each diagram and screen wireframe, so it stays readable as Markdown. Until this ADR is decided, the HTML stays out of `content/` and `public/`. HTML prototypes of an app flow's screens are not made: by the owner's decision (2026-11-01), an app flow's screens are Mermaid `block-beta` wireframes only. Facts this decision rests on, checked against the installed packages and tools: - **Archify 3.2.0 output.** `deliver` writes `.html` and a receipt, `.delivery.json`, holding absolute local paths (`/Users/…/candidate.json`). The HTML holds none. It loads no external script, stylesheet or image, and calls no network API (`fetch`, `XMLHttpRequest`, `WebSocket`, `sendBeacon`). It keeps only the reader's theme and motion choice in `localStorage`, inside `try`/`catch`, written for sandboxed frames. The seven-node workflow made for this ADR is 819 KB. On narrow screens Archify gives "containment only" (`references/viewer-runtime.md`). - **Pages are MDX** (ADR-0012), so a page can use a component registered in `src/components/mdx.tsx`. In the Markdown surfaces a component stays as its JSX tag with its props (checked in the built `llms.mdx` output for ``). - **Serving.** Files in `public/` are served from `/`. `headers()` in `next.config.mjs` applies to them ("Headers are checked before the filesystem which includes pages and `/public` files"). Pages live at the root, `//…`, and `src/proxy.ts` acts only on paths whose first segment is a catalogued slug (ADR-0015). ## Decision [#decision] 1. **Where the files live.** The Archify candidate is the committed source, `diagrams//.json` (not published); the published file is `public/diagrams//.html`. This site's own files use its slug, `docs`. On approval, `diagrams` joins the reserved slugs of ADR-0015 decision 2, so no entry's pages share a first segment with these files and the Markdown rewrites in `src/proxy.ts` never apply. 2. **Archify is delivered and checked outside the published folders**, with `deliver` and `check --require-provenance` into `.archify/` (gitignored), as `AGENTS.md` §8 sets out. Only the HTML is copied, byte for byte. Receipts, pending journals and lock files never are: they carry local paths. 3. **Pages embed them with one MDX component**, ``, registered in `src/components/mdx.tsx`: ```mdx ``` - An `