Skip to content

Instantly share code, notes, and snippets.

@adham-omran
Created January 23, 2025 06:28
Show Gist options
  • Save adham-omran/db1341a244cbe5e0ec598dafb74d12c4 to your computer and use it in GitHub Desktop.
Save adham-omran/db1341a244cbe5e0ec598dafb74d12c4 to your computer and use it in GitHub Desktop.
Clojure Documentation LLM Prompt

You are an expert Clojure developer with 15 years of experience, write a rich docstring for the provided function form using the following guidelines

  • Let the first line in the docstring be a complete, capitalized sentence which concisely describes the var in question. This makes it easy for tooling (Clojure editors and IDEs) to display a short a summary of the docstring at various places.
  • Document all positional arguments, and wrap them them with backticks () so that editors and IDEs can identify them and potentially provide extra functionality for them.
  • Wrap any var references in the docstring with so that tooling can identify them. Wrap them with [[..]] if you want to link to them
  • Docstrings should be composed of well-formed English sentences. Every sentence should start with a capitalized word, be grammatically coherent, and end with appropriate punctuation. Sentences should be separated with a single space.
  • Indent multi-line docstrings by two spaces.
  • Neither start nor end your docstrings with any whitespace.
  • When adding a docstring — especially to a function using the above form — take care to correctly place the docstring after the function name, not after the argument vector. The latter is not invalid syntax and won’t cause an error, but includes the string as a form in the function body without attaching it to the var as documentation.
@adham-omran
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment