|
| 1 | +--- |
| 2 | +description: Expand a minimal human-provided answer into a schema-compliant assistant knowledge base page |
| 3 | +agent: agent |
| 4 | +--- |
| 5 | + |
| 6 | +<!-- @format --> |
| 7 | + |
| 8 | +# Expand Minimal Answer into Assistant Knowledge Base Page |
| 9 | + |
| 10 | +The user has provided a stub file path or slug and a minimal answer. Your job is to expand that answer into a complete, schema-compliant `docs/assistant/` knowledge base page. Follow every step in order. Do not skip or combine steps. |
| 11 | + |
| 12 | +## Inputs |
| 13 | + |
| 14 | +The user's message will contain: |
| 15 | + |
| 16 | +1. **Path or slug** — the unique slug or absolute or repo-relative path to the stub file in `docs/assistant/`, e.g. `docs/assistant/os-connect/how-do-i-report-an-error-in-os-connect-data.md`. |
| 17 | +2. **Minimal answer** — the human-provided seed content. This may be a few sentences, a list, or rough notes. Treat it as authoritative fact; do not contradict or discard it. |
| 18 | + |
| 19 | +If either input is missing, ask the user before proceeding. |
| 20 | + |
| 21 | +## Step 1 — Read the stub and the schema |
| 22 | + |
| 23 | +Read the stub file at the path given. Note all existing frontmatter fields; they take precedence over anything you infer. |
| 24 | + |
| 25 | +Then read the schema from `docs/assistant/schema.md`. Do not rely on your training data or cache for schema details — read it fresh, every time. |
| 26 | + |
| 27 | +## Step 2 — Infer frontmatter values |
| 28 | + |
| 29 | +Using the stub's existing frontmatter as the starting point, fill in or confirm every required field. Rules: |
| 30 | + |
| 31 | +- `title` — derive from the file name if not set: convert the kebab-case stem to title case, e.g. `how-do-i-report-an-error-in-os-connect-data` → `"How Do I Report an Error in OS-CONNECT Data?"`. |
| 32 | +- `slug` — use the file stem (kebab-case), unchanged. |
| 33 | +- `doc_type` — infer from directory or filename: |
| 34 | + - Files in `questions/` subdirectories or whose names begin with interrogative words (`what`, `how`, `why`, `when`, `who`, `can`, `is`, `does`, `do`, `which`, `where`) → `question`. |
| 35 | + - Files in `concepts/` or whose names name a system component → `concept`. |
| 36 | + - Files in `workflows/` → `workflow`. |
| 37 | + - Files in `policies/` → `policy`. |
| 38 | + - Files in `glossary/` → `glossary`. |
| 39 | +- `products` — infer from the directory (`os-connect/` → `OS-CONNECT`, `workspaces/` → `Workspaces`, `accessmap/` → `AccessMap`, `walksheds/` → `Walksheds`, `tdei/` → `TDEI`, `support/` → all relevant products). Use the controlled list from the schema. |
| 40 | +- `audiences` — list several relevant audiences (`planner`, `jurisdiction`, `advocate`, `public`, `developer`, etc.) unless the content is clearly specialist-only. |
| 41 | +- `topics` — select from the controlled vocabulary in the schema. Add no more than five tags. Choose the most specific applicable tags. |
| 42 | +- `risk_level` — `low` by default. Use `medium` if the page touches ADA compliance, legal authority, data accuracy claims, or correction workflows. Use `high` only for pages with direct legal or safety consequences. |
| 43 | +- `authority_level` — `explanatory` by default. Use `draft` while content is in progress. |
| 44 | +- `review_status` — always set to `draft` for new pages. |
| 45 | +- `last_reviewed` — set to today's date in `YYYY-MM-DD` format. |
| 46 | +- `retrieval_priority` — `high` for the most important pages in a section, `medium` for most pages, `low` for supporting or supplementary content. |
| 47 | +- `assistant_behavior`: |
| 48 | + - `allow_inference: false` for all pages (default). |
| 49 | + - `requires_citation: true` for all pages (default). |
| 50 | + - `abstain_if_missing_context: true` for pages where the correct answer depends on the user's jurisdiction, dataset version, or other context not provided; `false` otherwise. |
| 51 | + - `do_not_claim` — list approximately one to five specific false or over-reaching claims an assistant might make that this page corrects. Phrase each as a complete declarative sentence. Leave empty (`[]`) if no obvious over-claims apply. |
| 52 | +- `related_pages` — list approximately two to five paths relative to `docs/` for closely related pages. Always include the section `index.md` (e.g. `assistant/os-connect/index.md`). Check `docs/assistant/dispatch.md` for available paths. |
| 53 | + |
| 54 | +## Step 3 — Write the nine body sections |
| 55 | + |
| 56 | +Write the full Markdown body in this exact order. Every heading must appear, spelled exactly as shown. |
| 57 | + |
| 58 | +### `# [Page Title]` |
| 59 | +The H1 must match the `title` frontmatter value exactly. |
| 60 | + |
| 61 | +### `## Short Answer` |
| 62 | +One to three short paragraphs. This is the text an assistant will surface directly in a reply. It must: |
| 63 | +- State the answer to the question (or define the concept/policy) clearly and completely. |
| 64 | +- Be self-contained — a reader with no other context should understand the answer. |
| 65 | +- Incorporate the user's provided minimal answer as its factual core. Do not paraphrase in ways that change meaning. |
| 66 | +- Stay under ~200 words. |
| 67 | +- Not contain "Yes" or "No" alone; provide a substantive statement. |
| 68 | + |
| 69 | +### `## Significance` |
| 70 | +One paragraph (2–4 sentences) explaining why this topic matters to planners, jurisdictions, advocates, the public, or other identified audiences. Focus on operational or civic importance. Do not use the heading "Why This Matters". |
| 71 | + |
| 72 | +### `## What This Means` |
| 73 | +Two to five bullet points (or a short paragraph) that unpack the answer in practical terms. If the page is a question, resolve the question definitively. If it is a concept, define it precisely. If it is a policy, state what follows from it. |
| 74 | + |
| 75 | +### `## What This Does Not Mean` |
| 76 | +Two to four bullet points of explicit boundaries, non-claims, and common misinterpretations. Each bullet corrects a plausible wrong conclusion a reader might draw. These become `do_not_claim` candidates — if a bullet is strong enough, add it to the frontmatter field too. |
| 77 | + |
| 78 | +### `## How To Use This` |
| 79 | +Audience-segmented guidance in one of these forms: |
| 80 | +- A short paragraph per audience (planners, jurisdictions, advocates, public, integrators) — only include audiences that actually apply. |
| 81 | +- A bulleted list of use cases, prefixed by the audience role in bold. |
| 82 | + |
| 83 | +### `## Example` |
| 84 | +One concrete, specific scenario. Name a real-sounding actor (a city planner, a transit agency GIS analyst, a disability advocate, a Safe Routes coordinator), pose the situation in one sentence, and show how this page's content resolves or addresses it. |
| 85 | + |
| 86 | +### `## Assistant Guidance` |
| 87 | +Two to five sentences of explicit behavioral instructions for chatbots consuming this page. Address: |
| 88 | +- When to cite this page. |
| 89 | +- Whether to abstain if context is missing. |
| 90 | +- Any `do_not_claim` items to watch for. |
| 91 | +- Whether to recommend the user consult a professional for legal, engineering, or safety questions. |
| 92 | + |
| 93 | +### `## Related Concepts` |
| 94 | +An unordered list of Markdown links to related pages. Format each as: |
| 95 | +`- [Link text](relative-path-from-this-file-to-target.md)` |
| 96 | + |
| 97 | +Always link the section index (e.g. `[OS-CONNECT knowledge base](index.md)`). Add two to four additional links to adjacent pages in `docs/assistant/dispatch.md` that are thematically related. |
| 98 | + |
| 99 | +## Step 4 — Validate before writing |
| 100 | + |
| 101 | +Before writing the file, check: |
| 102 | + |
| 103 | +1. All nine headings are present and in order. |
| 104 | +2. Every required frontmatter field is populated (no empty strings, no `null`). |
| 105 | +3. `review_status` is `draft`. |
| 106 | +4. `last_reviewed` is today's date. |
| 107 | +5. `do_not_claim` items (if any) are complete declarative sentences. |
| 108 | +6. `related_pages` paths use the `docs/`-relative format, not file-system paths. |
| 109 | +7. The `## Short Answer` does not contradict the user's minimal answer. |
| 110 | +8. No section is omitted, even if its content is brief. |
| 111 | + |
| 112 | +If any check fails, fix it before proceeding. |
| 113 | + |
| 114 | +## Step 5 — Write the file |
| 115 | + |
| 116 | +Write the completed file to the path given by the user. Overwrite the stub entirely. |
| 117 | + |
| 118 | +## Step 6 — Update dispatch.md |
| 119 | + |
| 120 | +Open `docs/assistant/dispatch.md`. Find the row for this file in the appropriate section table and change its `Status` from `stub` to `draft`. Use `replace_string_in_file` — do not rewrite the entire dispatch file. |
| 121 | + |
| 122 | +## Step 7 — Confirm |
| 123 | + |
| 124 | +Tell the user: |
| 125 | +- The file path written. |
| 126 | +- The `doc_type`, `risk_level`, and `retrieval_priority` values chosen and a very brief reasoning for each. |
| 127 | +- Any `do_not_claim` items added, so the user can verify they are accurate. |
| 128 | +- Whether `abstain_if_missing_context` was set to `true` and why. |
| 129 | +- The dispatch status updated from `stub` → `draft`. |
| 130 | + |
| 131 | +If the user's minimal answer left any factual gap that would require TCAT staff knowledge to fill (e.g. a specific correction timeline, a named contact, a URL), flag it explicitly so the user can supply it in a follow-up review and editing phase. |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +## Quality Rules (apply throughout) |
| 136 | + |
| 137 | +- **Never invent facts.** If the minimal answer does not state something, do not add it as though it were true. Use hedged language ("typically," "generally") only when the schema and product context genuinely support the hedge. |
| 138 | +- **Never contradict the minimal answer.** The user's seed content is authoritative. |
| 139 | +- **Preserve domain accuracy.** Do not rename, merge, or redefine TCAT products (TDEI, OS-CONNECT, Workspaces, AccessMap, Walksheds, OpenSidewalks, and AVIV ScoutRoute are each distinct). |
| 140 | +- **Keep the Short Answer self-contained.** A retrieval system may surface only that section. |
| 141 | +- **Match link paths to dispatch.md.** Only link to files that exist in the dispatch registry; do not invent file paths. |
| 142 | +- **Do not add extra headings** that duplicate or replace any of the nine required sections. |
0 commit comments