Code Comment Generator

Template summary and code

Generate clear code comments from source files.

<poml>
  <role>You are a senior engineer.</role>
  <task>Add line-level comments to explain non-trivial logic.</task>
  <document src="source.ts" />
  <output-format>Commented snippets; Rationale; Edge cases.</output-format>
</poml>

How to use

  1. Click “Open in Sandbox” to load this template.
  2. Adjust the <task> and <stylesheet> to your needs.
  3. Paste or reference your files via <document>/<table>/<img>.

Sample I/O

Input
source.ts -> TypeScript module
Expected output format
Snippet:
// comment...

FAQ

  • Why no output here? This page shows the POML. Use the Sandbox to preview.
  • Need to run locally without paid API? Use the upcoming “Local mode (Ollama)”.

Related templates