# Skill: Build an Edge Assist content index

You are generating a JSON retrieval index for Edge Assist (https://edge.network/assist).
Assist fetches this file on a schedule, indexes the chunks for full-text search, and uses
them as the only source material when answering visitors' questions. Follow this spec
exactly — the ingester validates the payload and rejects malformed indexes.

## Output

A single JSON file, served at a stable public URL (e.g. `/assist-index.json`):

```json
{
  "hash": "9f2b41c07d3a58e6",
  "chunks": [
    {
      "url": "/pricing",
      "title": "Pricing",
      "section": "docs",
      "text": "One clean passage of plain text from the page..."
    }
  ]
}
```

Extra top-level fields are ignored, so you may add `generatedAt`, `pages`, etc. for
your own debugging.

## Field rules

- `hash` (required): a deterministic digest of the content. Compute it over the
  serialized chunks, e.g. `sha256(JSON.stringify(chunks))` truncated to 16 hex chars.
  It must change when content changes and must NOT change otherwise — do not include
  timestamps or random values in it. Assist re-indexes only when the hash differs
  from the last ingest, and every re-index automatically invalidates cached answers.
- `chunks[].url` (required): the page the text came from. Site-relative paths
  (`/pricing`) or absolute URLs both work; be consistent. Distinct URLs count as
  "pages" against the plan limit. Chunks missing `url` or `text` are silently dropped.
- `chunks[].title` (required in practice): the page title, shown in search results
  and citations. Keep it human-readable.
- `chunks[].section` (optional): a short grouping label, e.g. `docs`, `blog`,
  `product`. Use the nearest heading or site section.
- `chunks[].text` (required): clean plain text. No HTML, no markdown syntax, no
  navigation/header/footer/cookie-banner boilerplate, no code line numbers.

## Chunking

- Target at most ~1,400 characters per chunk; split on sentence boundaries so
  retrieved passages read cleanly. Drop fragments under ~80 characters.
- One page produces many chunks — emit them in reading order.
- A page's one-sentence meta description is often the best single summary; include
  it as that page's first chunk if it isn't already in the body text.
- Skip pages that add noise rather than answers: 404s, legal boilerplate,
  pagination archives, thin landing-page variants.

## Limits

- 50,000 chunks per index (hard limit — ingest fails above it).
- 500 distinct page URLs on the free tier; 10,000 on paid.
- The index must respond within 30 seconds with HTTP 200 and `Content-Type`
  parseable as JSON. The fetcher identifies as `EdgeAssist-Ingest/1.0`.

## Publishing and verifying

1. Generate the file as part of the site's build, so content changes ship a new
   hash automatically.
2. Register the URL in Edge Control → Assist → your site → Ingestion.
3. Assist re-fetches hourly. Ingest status, page/chunk counts, and any validation
   errors appear on the same Ingestion tab; a manual "Reingest now" button is there
   for immediate runs.
4. To sanity-check before registering: `curl -s <your-index-url> | head -c 500`
   should show `{"hash":"...","chunks":[{"url":...`.

## Reference

The index for edge.network itself is public and follows this spec:
https://edge.network/assist-index.json
