About this tool
Build a docstring prompt in JSDoc, TSDoc, Google or NumPy Python, Javadoc, Doxygen, XML doc, rustdoc or Go doc style with the right tags and line limit.
The Code Comment Prompt Builder turns a documentation convention into a ready-to-paste AI prompt that carries that convention's exact skeleton, tag spelling and column limit. It covers ten published standards — JSDoc 3 block tags, TSDoc, Google-style and numpydoc Python docstrings, Sphinx reST field lists, Javadoc, Doxygen, C# XML documentation comments, rustdoc and Go doc comments — and pins each to its own line width, such as PEP 8's 72-column docstring limit or rustfmt's 100. It is for developers who want ChatGPT, Claude or Copilot to emit comments their linter and doc generator accept on the first pass.
Open Code Comment Prompt Builder on AltFTool — it loads instantly in your browser.
Paste your code or data sample into the workspace.
Pick the format, conversion, or analysis you need.
Copy the polished result straight back into your project.
The prompt embeds the literal comment block — delimiters, indentation and tag order — so the model fills it in instead of inventing a house style.
Javadoc gets @return, JSDoc gets @returns, Sphinx gets :raises ValueError:, and Go gets no tags at all because Go doc comments are prose.
If the pasted snippet looks like Python but a Javadoc convention is selected, the tool says so before you send a prompt that produces comments the compiler rejects.
JSDoc puts the type in braces — @param {string} name - description — while TSDoc omits types entirely, writing @param name - description, because the TypeScript signature already declares them. TSDoc is the standard consumed by Microsoft's API Extractor; JSDoc 3 is the older JavaScript convention that doubles as a type source for plain JS.
72 characters. PEP 8 limits flowing text in docstrings and comments to 72 columns even though code may run to 79, because docstrings are re-indented when rendered. This tool writes that 72-column instruction into every Python prompt, whether you pick Google style, numpydoc or Sphinx field lists.
With the name of the declaration it documents — "DoThing reports whether the request succeeded." Go doc comments have no @param or @return tags at all; arguments, results and errors are described in ordinary sentences. The generated prompt enforces both rules, so gofmt and pkg.go.dev render the comment correctly.
It will if the prompt names the convention and its column limit, which is what this tool does. The common failures are the wrong tag (@return instead of @returns under JSDoc), missing section underlines in numpydoc, and lines past the limit — all three are specified explicitly in the generated prompt. Always re-run your doc linter, since the model can still miss a parameter.