Document your AI in one prompt.
Suture checks every trace against what each AI feature should do. This prompt has your own coding agent write that down from your code, so you don't have to.
- Copy the prompt and paste it into Claude Code, Cursor, Codex or any coding agent, opened in your repo.
- Add any features you plan to build at the bottom, or leave it blank.
- It writes SUTURE_AI_FEATURES.md at the root of your repo: every AI feature, where its prompts live, what good output looks like, and the agent names and prompt ids your traces use.
- In Suture, open AI features, choose Add docs, upload the file and press Draft checks.
- Shipped new AI features? Run the same prompt again. It reads the existing file, adds what is new, updates what changed and marks what is gone, without duplicates.
Each feature name doubles as its trace slug. To send traces under those names, set the suture.prompt_id attribute to the slug on the span that calls the model (see tracing). A two-line helper, suture-trace, is coming soon; it is not on npm or PyPI yet.
The prompt
You are documenting the AI features in this codebase for Suture, a tool that checks every AI trace against what each feature is supposed to do. Your output is one Markdown file, SUTURE_AI_FEATURES.md, at the repository root. I will paste it into Suture, so it has to be accurate, specific and grounded in the code.
## 1. Pick the mode
- If SUTURE_AI_FEATURES.md already exists, this is an UPDATE. Read it first. Keep every feature that still exists, using the same name (Suture tracks features by name and trace identifiers, so renaming creates a duplicate). Update fields that changed, add features that are new, and mark features you can no longer find as "Status: removed" instead of deleting them. Never list the same feature twice: two entries with the same agent name, prompt id or entry point are one feature.
- If it does not exist, this is a FIRST DRAFT. Write it from scratch.
- In both modes, if I named features I plan to build, add them with "Status: planned" and fill in what I told you. Do not invent details for them.
## 2. Find every AI feature
Search the whole repo, not just the obvious folders. Look for:
- Model calls: OpenAI, Anthropic, Google/Gemini/Vertex, Bedrock, Mistral, Groq, OpenRouter, Ollama, Vercel AI SDK (generateText, streamText, generateObject, streamObject), LangChain, LlamaIndex, Mastra, CrewAI, raw fetches to /chat/completions or /messages.
- Prompts: system prompts in code, template strings, .prompt/.md/.txt/.yaml/.json prompt files, prompt folders, Langfuse getPrompt or other prompt registries, few-shot examples.
- Agents and tools: agent loops, tool or function definitions, MCP servers and clients, sub-agents, routers that pick a model or prompt.
- Retrieval: embeddings, vector stores, search over docs or a knowledge base, anything that feeds context into a prompt.
- Guardrails and evals: output validators, schemas, moderation, retries on bad output, eval suites, test fixtures with expected outputs.
- Telemetry: OpenTelemetry setup, Langfuse, experimental_telemetry, functionId, span or trace names, metadata and tags attached to calls.
- Feature flags or stubs for AI features that are not finished.
One feature is one job the AI does for a user (for example "Post writer" or "Support reply drafter"), not one file. Several model calls that serve the same job belong to one feature; list them under it.
## 3. Write the file in this shape
# AI features: <product name>
Last updated: <today's date>. Mode: <first draft | update>.
## Changes in this update
(UPDATE mode only.) Bullets under Added, Changed and Removed, one line each, naming the feature and what changed.
## The product
Two to four sentences: what the product does, who uses it, and where AI fits.
## Rules for the whole product
Bullets of things that must never happen anywhere (for example "never invent prices", "never reveal another customer's data", "always answer in the user's language"). Only rules the code, prompts or docs support.
## Feature: <short, stable name, under 80 characters>
- Status: live | planned | removed
- What it does: one sentence, under 300 characters.
- Who triggers it and how: the user action, endpoint, job or event, with file:line.
- Task: what the model is asked to do, in plain words (under 150 words).
- Expected behaviour: what a good answer looks like: content, format, length, tone, structure, language. Be concrete (under 300 words).
- Must never: things this feature must never do.
- Critical when: up to 5 situations where a failure is serious (for example "the reply quotes a price", "the user is asking to cancel").
- Inputs: what goes into the prompt (user text, documents, history, retrieved context).
- Output: the format (free text, JSON schema, markdown, tool calls) and where it goes.
- Grounding: the sources it must stay faithful to, and facts it must never invent (numbers, names, quotes, links, prices).
- Tools it can call: name and one-line purpose each.
- Model: provider, model id and settings (temperature, max tokens) as set in code.
- Prompt location: path#Lstart-Lend for each prompt, or the registry name and version.
- Trace identifiers, exactly as they appear in traces:
- Agent name (gen_ai.agent.name or the agent/span name): <value or "not set">
- Prompt id (suture.prompt_id, gen_ai.prompt.name or Langfuse prompt name): <value or "not set">
- Tags (Langfuse trace tags or suture.tags): <values or "none">
- Telemetry function id or span name: <value or "not set">
- Existing checks: evals, validators or tests that already cover it, with paths.
- Suggested checks: up to 6 yes/no questions a reviewer could ask of one output (for example "Does the post keep the client's call to action?").
- Gaps: anything unknown or missing, especially trace identifiers that are not set.
Repeat the Feature section for every feature.
## Tracing gaps
A short list of features whose traces Suture cannot match yet because no agent name, prompt id or tag is set. For each, give the file:line of the AI call and the one-line change that would fix it, using the feature's name as the slug. Recommend plain OpenTelemetry (https://trysuture.com/docs/tracing), no Suture package needed: on the span around the AI call, set the attribute suture.prompt_id to the slug (in TypeScript span.setAttribute('suture.prompt_id', 'post-writer'); in Python span.set_attribute("suture.prompt_id", "post-writer")). For the Vercel AI SDK, pass experimental_telemetry: { isEnabled: true, functionId: 'post-writer', metadata: { 'suture.prompt_id': 'post-writer' } }. If the code uses Langfuse prompts, the Langfuse prompt name already works. Suggest only. Do not change code.
## 4. Rules
- Ground every statement in the code, prompts, tests or docs in this repo, and give file paths. If you cannot find something, write "unknown". Do not guess.
- Copy identifiers exactly, including case.
- Do not include secrets, API keys, tokens, connection strings, customer data, real emails or phone numbers. Describe them instead ("the OpenAI key from env").
- Quote a prompt only if it is short. Otherwise summarise it and give its location.
- Keep the whole file under 150,000 characters.
- Only create or edit SUTURE_AI_FEATURES.md. Do not change any other file.
## 5. When you finish
Reply with: the mode, how many features you found (live, planned, removed), what changed if this was an update, and the tracing gaps. Then remind me to add the file in Suture: AI features → Add documents → Upload (or Paste text), then Draft checks.
Features I plan to build (leave blank if none):