Repository navigation
Closed
Labels
refactorRefactoring task
Description
Summary
Apply the Code Readability guidelines in AGENTS.md to the existing source. This is a no-behavior-change cleanup: generated docs output, site rendering, and the bun test regression suite must stay identical. Findings are grouped by guideline. Generated regions and CHANGELOG.md were skipped.
No comments above modules or files
scripts/generate-provider-docs.mjs:2-29- file header block (purpose, usage, env vars). Move the usage and env-var facts intoAGENTS.mdor the Taskfile description, then delete the header.scripts/generate-provider-docs.test.mjs:1-5- file header describing the regression net.
No inline comments inside function bodies
scripts/generate-provider-docs.mjs:277-279- comment insideinjectRegionexplaining the duplicate-marker check. Extract the check into a named function (for exampleassertSingleRegion).scripts/generate-provider-docs.mjs:45-47,90-92,173-175,266-268,305-307- section banner comments (// ----- Schema loading -----and similar). Remove them, or split the script into smaller modules if the grouping matters.scripts/generate-provider-docs.mjs:359- comment above theimport.meta.mainguard. The guard is self-explanatory, so delete it.
Doc comments at most 5 lines
scripts/generate-provider-docs.mjs:198-203- therenderAdkProviderTabledoc comment is 6 lines.
Named constants over magic numbers and strings
scripts/generate-provider-docs.mjs:148,217,247- the auth type'none'is repeated. Use a named constant (for exampleAUTH_TYPE_NONE).scripts/generate-provider-docs.mjs:181- the minimum column width3informatTable. Name it (the markdown separator's minimum dash count).scripts/generate-provider-docs.mjs:51-name.length + 3(the length of--plus=). Name it or slice by the prefix string's length.scripts/generate-provider-docs.mjs:272-273andscripts/generate-provider-docs.test.mjs:34-35- theGENERATED:${key} START/ENDmarker format is built in two places. Share one helper or constant.scripts/generate-provider-docs.test.mjs:39- thestart + 2/end - 1offsets, which mirror the blank-line padding added ininjectRegion. Name the padding..vitepress/theme/components/QuickStartTerminal.vue:19,25- the-1"nothing copied" sentinel and the2000ms reset delay. Use named constants..vitepress/config.ts:66-titleTemplatehardcodesInference Gatewayinstead of usingSITE_NAME..vitepress/config.ts:111,373- the brand color#7c3aedappears in boththeme-colorand the mermaidprimaryBorderColor. Use one named constant..vitepress/config.ts:130-131- the OG image size1200/630. Name it next toOG_IMAGE.
No semicolons in documentation prose
scripts/generate-provider-docs.mjs:28- "Requires Bun (for Bun.YAML.parse); no packages to install." (goes away with the file header).- Markdown pages - these files have lines matching
[a-z)\]; [a-zA-Z`], which flags semicolon-joined sentences (some hits are inside code blocks and are fine):cli.md(120),typescript-adk.md(94),sdks.md(62),adk.md(43),api-reference.md(40),rust-adk.md(39),adl-cli.md(27),github-action.md(22),desktop.md(20),configuration.md(16),cli-speech-to-text.md(14),operator.md(14),cli-skills.md(12),cli-text-to-video.md(12),authentication.md(11),opentask.md(11),observability.md(9),cli-judge-mode.md(8),mcp.md(8),troubleshooting.md(7),browser-agent.md(6),n8n-agent.md(6),mock-agent.md(5),cli-hooks.md(4),documentation-agent.md(4),grafana-agent.md(4),a2a.md(3),cli-channels.md(3),cli-text-to-speech.md(3), plus 1-2 lines each ina2a-debugger.md,adl.md,architecture-overview.md,cli-scheduling.md,model-routing.md,registry.md,skills.md,supported-providers.md. Reproduce withgit grep -n -E "[a-z)`]; [a-zA-Z`]" -- ".md" ":!CHANGELOG.md". Text insideGENERATED:regions must be fixed inscripts/provider-overrides.json` or the generator, not by hand.
Other
.vitepress/config.ts:78-srcExcludestill listsCLAUDE.md, but the repository has noCLAUDE.md(agent instructions live only inAGENTS.md). Drop the entry..vitepress/theme/components/FlowDiagram.vue:241,352- CSS comments explaining layout. Keep them only if a class name cannot carry the intent.
Not checked
- The repository has no
examples/directory. The code snippets in the docs pages were not run against thetokenlessmock gateway in this audit, so a separate pass should check that every snippet runs as written.
Acceptance Criteria
- Every finding above is fixed or explicitly kept with a reason
-
bun test,bun run lint:md,bun run format:check, andbun run buildpass - Generated docs output and rendered pages are unchanged (no behavior change)
Activity
edenreich commentedon Nov 17, 2026
@claude can you work on this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Nov 17, 2026
Claude finished @edenreich's task in 3m 56s —— View job •
refactor/issue-1270-20261117-2100• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...refactor/issue-1270-20261117-2100?quick_pull=1&title=Issue%20%231270%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%231270%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Applied the code readability guidelines - PR #1271
.vitepressconfig + componentsbun test,lint:md,format:check,buildall passGenerator: removed the file headers, section banners, and guard comment. The schema env vars are now documented in
AGENTS.md. The duplicate-marker check is now its own function,assertSingleRegion. TherenderAdkProviderTabledoc comment is down to 4 lines. Magic values are now named constants:AUTH_TYPE_NONE,MIN_SEPARATOR_DASHESandREGION_PADDING.argValueslices by the prefix length. The generator and the test now share onestartMarker/endMarkerhelper.bun teststill compares every generated region byte-for-byte, so generated output is unchanged.Site:
titleTemplateandauthornow useSITE_NAME. New constants:BRAND_COLOR,OG_IMAGE_WIDTH/OG_IMAGE_HEIGHT, and inQuickStartTerminal.vuethe copy-state sentinel and the reset delay. DroppedCLAUDE.mdfromsrcExclude.Kept with reason: the two CSS comments in
FlowDiagram.vue. They explain layout choices that a class name can't carry.Markdown: split every semicolon-joined sentence in prose (outside code, inline code and
GENERATED:*regions) into two sentences. A semicolon inside parentheses became-instead, since a period there would break the parenthetical. Thegit grephits that remain are all inside YAML/shell code comments or a literal CLI output string. This was a scripted pass over about 570 lines, and I only spot-checked it, so it's worth skimming the diff for awkward capitalisation, for example an identifier without backticks starting a sentence.Not done: running the doc snippets against the
tokenlessmock gateway. The issue scopes that as a separate pass.· Branch