Imported from njoylab/docs.echovalue.dev (
AGENTS.md). Install upstream withnpx skills add njoylab/docs.echovalue.dev. Copyright stays with the author.
AGENTS.md
This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
Project Overview
This is an Astro + Starlight documentation site for the echoValue API - a lightweight key-value database service designed for freelancers and small projects. Deployed to https://docs.echovalue.dev.
Migration note: The
content/directory andconfig.tomlare legacy Hugo files kept for reference. The active Starlight site lives undersrc/.
Key Commands
# Start dev server with live reload
npm run dev
# Build the site (outputs to ./dist)
npm run build
# Preview the production build
npm run preview
Architecture
Content Structure
All documentation lives in src/content/docs/ as .mdx files:
index.mdx(order: 1) — Introduction and overviewauthentication.mdx(order: 2) — Authentication withx-tokenheadertoken.mdx(order: 3) — Token management overviewtoken/— Token endpoint reference pageskey-value/— Key-value overview and endpoint reference pagesguides/— Product guides and use-case pageswebhook/— Webhook overview and endpoint reference pageslogs.mdx(order: 6) — Logs retrieval APIresponse-headers.mdx(order: 7) — Response headers documentationerrors.mdx(order: 8) — HTTP error codesopenapi.mdx(order: 9) — OpenAPI specification
Sidebar order is controlled via sidebar.order in frontmatter.
Configuration
astro.config.mjs— Main Astro + Starlight configuration (sidebar, logo, social links)src/content.config.ts— Content collection schema (Astro 6 location)static/— Static assets served as-is (configured viapublicDir: './static')- Includes favicons, generated
openapi.yaml,robots.txt,logo.png
- Includes favicons, generated
src/assets/logo.png— Logo for Starlight header (processed by Astro)
OpenAPI Source
static/openapi.yaml is generated from /Users/emln/dev/njoylab.com/echovalue.dev/functions/openapi.yaml. Do not edit static/openapi.yaml directly unless explicitly regenerating or synchronizing the generated copy. Make public API contract changes in the source file first, then update the generated static copy.
API Documentation Patterns
-
Callouts — Use Starlight directives:
:::note Notice text here ::: :::caution Warning text here ::: -
Multi-language code examples — Use
<Tabs syncKey="lang">so language selection persists across pages:import { Tabs, TabItem } from '@astrojs/starlight/components'; <Tabs syncKey="lang"> <TabItem label="cURL"> ```sh curl ... -
Cost information — Document credit costs in
:::noteblocks after each endpoint -
API Endpoints — Base URLs:
- Key-Value API:
https://api.echovalue.dev/kv/<group>/<key> - Token management:
https://api.echovalue.dev/token - Webhook API:
https://api.echovalue.dev/webhook
- Key-Value API:
File Organization
docs/
├── astro.config.mjs # Astro + Starlight config
├── package.json # Dependencies (astro, @astrojs/starlight)
├── tsconfig.json # TypeScript config
├── src/
│ ├── assets/ # Processed assets (logo)
│ ├── content.config.ts # Content collection schema (Astro 6)
│ └── content/
│ └── docs/ # MDX documentation files
├── static/ # Static assets (served as publicDir)
│ ├── openapi.yaml
│ ├── logo.png
│ └── favicon*.png / *.ico
├── dist/ # Generated site (git-ignored)
└── node_modules/ # npm dependencies (git-ignored)
Content Guidelines
When editing documentation:
- Sidebar order: Use
sidebar.orderin frontmatter (lower = first in sidebar) - Language tabs: Always wrap multi-language examples in
<Tabs syncKey="lang">with labels:cURL,JavaScript,Python,PHP,Go - Credit costs: Always document operation costs in
:::noteblocks - Constraints: Document length/size/time limits (30 char key/group limits, TTL ranges, etc.)
- Auth header: Use
x-tokenfor authentication; documentx-costandx-balanceresponse headers - Endpoint sync is mandatory: Whenever an endpoint is added, removed, or changed in
static/openapi.yaml, update the human docs insrc/content/docs/and the agent-facing docs (skill/,agent-config/, and install/setup docs if they summarize capabilities) in the same change. - Use a Utilities section for cross-cutting endpoints: Endpoints that do not fit primary product areas like token management, key-value, or webhook (for example
GET /myip) should live under a dedicated sidebar group such asUtilities. - Use fixed page archetypes:
- Overview pages: intro, endpoints, pricing, limits, related pages when relevant
- Endpoint pages: request, response, status codes, examples
- Integration or guide pages: prerequisites, setup, configuration, output, notes
- Keep guides out of endpoint sections: Tutorial or use-case content such as agent workflows should live under a dedicated
Guidessection rather than inside API reference groups. - Terminology and style:
- Use
credits, nottokens, for billing language - Use trailing slashes in internal doc links
- Avoid decorative
---separators in page bodies - Use
Pricingonly on overview pages and:::notecost callouts on endpoint pages
Documentation Maintenance Principles
Use these rules when adding or revising pages so the documentation stays coherent over time:
- Document the public contract, not the implementation: Describe the endpoint, request, response, limits, costs, status codes, and user-visible behavior. Do not expose internal architecture, routing, queues, workers, vendors, cloud providers, or service boundaries unless they are part of the public API contract.
- Never mention upstream hops for API-backed APIs: If an echoValue endpoint calls another API or service internally, do not say that the request is proxied, forwarded upstream, delegated to another API, or handled by an upstream provider. Phrase it as echoValue behavior instead, for example "returns URL metadata", "runs DNS lookup", or "delivers the webhook payload".
- Never document internal endpoints: Do not mention, link, or describe endpoints that are not exposed to users, even when explaining limits or payload formats. State the public behavior instead, for example "inbound email payloads are limited to 1 MiB after parsing."
- Never name infrastructure vendors: Do not mention Cloudflare, cloud services, provider dashboards, provider logs, workers, routing products, queues, storage services, or any other infrastructure vendor used by echoValue. Use vendor-neutral wording such as "inbound email delivery" or "echoValue processing."
- Keep source-of-truth files synchronized: For every API change, update the source OpenAPI file at
/Users/emln/dev/njoylab.com/echovalue.dev/functions/openapi.yaml, regenerate or synchronizestatic/openapi.yaml, update the matching page insrc/content/docs/, sidebar entries inastro.config.mjsif navigation changes, and agent-facing docs that summarize the same capability. - Prefer stable examples over exhaustive examples: Show the smallest complete request and a representative successful response. Avoid documenting incidental fields unless they are stable enough for users to rely on.
- Separate guarantees from best-effort behavior: Use direct language for guaranteed fields, limits, and costs. Mark inferred, optional, source-dependent, or best-effort results clearly so users do not build against unstable behavior.
- Keep naming consistent across surfaces: Endpoint names, field names, sidebar labels, OpenAPI operation summaries, page titles, and guide terminology should use the same wording unless there is a clear user-facing reason to differ.
- Write from the user's perspective: Favor action-oriented descriptions such as "Create a webhook" or "Get the current balance". Avoid implementation phrasing such as "the backend stores", "the worker processes", or "the service forwards to another internal endpoint".
- Maintain page archetypes: Endpoint pages should include request, response, status codes, examples, and a cost note. Overview pages should include purpose, endpoints, pricing, limits, and related pages. Guides should include prerequisites, setup, configuration, output, and notes.
- Preserve cross-link hygiene: Add related links when they reduce navigation friction, use trailing slashes, and avoid orphan pages by adding new docs to the sidebar when they are meant for users.
- Verify docs as docs: After meaningful documentation changes, run
npm run buildto catch MDX, Starlight, sidebar, and generatedllms.txtissues.
Important Notes
- Documentation-only repository (no API source code)
- Maximum key/group name length: 30 characters
- Maximum value length: 1000 characters (~1 KB)
- Maximum TTL: 2592000 seconds (30 days)
- Unused tokens expire after 2 years with data deletion
- Logs have 7-day TTL, deleted within 24 hours post-expiration
- Search powered by Pagefind (built automatically with
npm run build)