azure/foundry-route-doc-check
Validates that all TypeSpec route operations in the AI Foundry data-plane (Foundry) domain have documentation comments and @summary decorators with correct voice, replaces documentation-required suppressions with generated documentation, and uses description override extensions when TypeSpec would concatenate noisy descriptions. USE FOR: reviewing or authoring routes.tsp and routes.generated.tsp files under specification/ai-foundry/data-plane/Foundry/src/, including nested OpenAI routes under src/openai/. DO NOT USE FOR: files outside the Foundry data-plane area, model-only .tsp files, or SDK client customization files (client.tsp).
npx skills add https://github.com/Azure/azure-rest-api-specs --skill foundry-route-doc-check
Ensures every TypeSpec route operation in the AI Foundry data-plane (Foundry) area has
proper documentation comments and @summary decorator tags, using the correct grammatical
voice for each.
This skill applies only to files matching:
specification/ai-foundry/data-plane/Foundry/src/**/routes.tsp
specification/ai-foundry/data-plane/Foundry/src/**/routes.generated.tsp
OpenAI route files are nested under specification/ai-foundry/data-plane/Foundry/src/openai/<area>/.
It does not apply to:
models.tsp, client.tsp, client.*.tsp, or main.tsp files.tsp files outside specification/ai-foundry/data-plane/Foundry/openapi3/Do not modify documentation that is already substantially correct. Only flag and fix
operations that have an explicit, significant rule violation:
@summary() or doc comment entirely → fix@summary using third-person, or doc comment using imperative) → fix@doc() instead of a TSDoc /** ... */ comment → fix#suppress "@azure-tools/typespec-azure-core/documentation-required" ... hides missing route or parameter documentation → remove the suppression and add documentationWhen in doubt, leave the existing text alone.
For routes.generated.tsp files, it is acceptable to apply this skill's automated
rewrite directly to the generated file. The intended workflow is to run route
generation first and then run this rewrite immediately afterward, so the generated
route documentation changes are consistently reapplied and not lost overall.
Every operation defined inside an interface block in a routes.tsp or routes.generated.tsp file must satisfy
all of the following requirements. See route-documentation-rules.md
for the full rule definitions, examples, and remediation guidance.
| Rule ID | Requirement |
| ---------------- | ---------------------------------------------------------------------------------------------- |
| FDOC-001 | Every operation must have a TSDoc /** ... */ comment. Prefer TSDoc over @doc(). |
| FDOC-002 | Every operation must have a @summary() decorator — no exceptions |
| FDOC-003 | The TSDoc description must use third-person indicative voice ("Creates an agent"), must add meaningful detail beyond the summary, and must not be near-identical to the summary. |
| FDOC-004 | @summary() must be a maximally concise, single-line imperative phrase ("Create an agent"). No multiline strings. No trailing period. No filler ("all", "by ID", "info about"). Must not be truncated. Always include articles. |
| FDOC-005 | Each @path, @query, @header, and @body parameter must have a doc comment or @doc() |
| FDOC-006 | Do not leave multiple adjacent TSDoc comment blocks on the same operation or parameter. TypeSpec concatenates adjacent docs into one OpenAPI description, which can produce malformed text. |
| FDOC-007 | Remove documentation-required suppressions on routes and parameters, including auto-generated import suppressions, and replace them with generated TSDoc documentation. |
| FDOC-008 | When TypeSpec would concatenate operation summaries/descriptions, request body descriptions, or parameter descriptions for shared routes, multiple content types, or adjacent imported docs, add the appropriate override extension with the desired final text. |
documentation-required suppressionsWhen a route file contains a suppression for missing documentation, treat it as a fixable
documentation violation, not as an accepted exception. This includes suppressions such as:
#suppress "@azure-tools/typespec-azure-core/documentation-required" "Auto-suppressed warnings non-applicable rules during import."
For each matching suppression in a scoped routes.tsp or routes.generated.tsp file:
#suppress directive.route-related declaration the suppression was shielding.
FDOC-001 through FDOC-005.For @path, @query, and real @header parameters, apply the parameter-level extension:
@extension("x-ms-description-override", "The intended final OpenAPI description.")
For @body and @multipartBody, apply an operation-level request-body override because
TypeSpec does not emit parameter-level extensions onto the OpenAPI requestBody object:
@extension("x-ms-request-body-description-override", "The intended final request body description.")
Put this operation-level extension with the operation decorators (near @summary, @route,
and @post). Import and use TypeSpec.OpenAPI if the file does not already do so.
documentation-required still needs to be suppressed.Use description override extensions when the source must retain documentation for TypeSpec
linting but the emitted OpenAPI description would otherwise be noisy because TypeSpec
concatenates multiple source descriptions.
Use:
x-ms-summary-override and x-ms-description-override on each shared-routeoperation variant when TypeSpec would merge multiple operations into one OpenAPI
operation and concatenate their summaries/descriptions
x-ms-description-override on @path, @query, and real @header parametersx-ms-request-body-description-override on the operation for @body and@multipartBody request bodies
Common examples:
one OpenAPI operation, causing summaries such as
"Create a video edit multipart Create a video edit json"
requestBody"The request body.The request body." or "The file id path parameter.The ID of the file."Prefer one concise TSDoc comment for the source declaration and one override extension with
the exact final OpenAPI text. Do not add adjacent TSDoc comments as a workaround. Do not add
x-ms-description-override directly to @body or @multipartBody declarations because the
OpenAPI emitter does not preserve those extensions on requestBody.
After applying fixes to any routes.tsp or routes.generated.tsp file, always run the following steps in order:
Run tsp format on the changed files to ensure consistent formatting:
npx tsp format specification/ai-foundry/data-plane/Foundry/src/**/routes.tsp specification/ai-foundry/data-plane/Foundry/src/**/routes.generated.tsp
Recompile the project to regenerate both JSON and YAML OpenAPI outputs under openapi3/.
Do not modify tspconfig.yaml — it already emits both file types via file-type: [yaml, json].
cd specification/ai-foundry/data-plane/Foundry
npx tsp compile .
Verify that the files under openapi3/{version}/ are updated for every versioned output.
routes.tsp and routes.generated.tsp files under specification/ai-foundry/data-plane/Foundry/src/interface block and enumerate its operationsFDOC-001 through FDOC-008tsp format on all modified filestsp compile . to regenerate JSON and YAML OpenAPI artifactsReport results as a markdown table:
| File | Operation | Rule | Finding |
| ---- | --------- | ---- | ------- |
| src/connections/routes.tsp | get | FDOC-002 | Missing `@summary()` decorator |
| src/openai/chat/routes.generated.tsp | createChatCompletion | FDOC-004 | `@summary()` uses third-person voice |
If all operations pass, report: ✅ All Foundry route operations are fully documented.
Take azure/foundry-route-doc-check from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.