Project Path: {{ absolute_code_path }}

Source Tree: 
```
{{ source_tree }}
```

{{#each files}}
{{#if code}}
`{{path}}`:

{{code}}  

{{/if}}
{{/each}}

I'd like you to add documentation comments to all public functions, methods, classes and modules in this codebase.

For each one, the comment should include:
1. A brief description of what it does
2. Explanations of all parameters including types/constraints 
3. Description of the return value (if applicable)
4. Any notable error or edge cases handled
5. Links to any related code entities

Try to keep comments concise but informative. Use the function/parameter names as clues to infer their purpose. Analyze the implementation carefully to determine behavior.

Comments should use the idiomatic style for the language, e.g. /// for Rust, """ for Python, /** */ for TypeScript, etc. Place them directly above the function/class/module definition.

Let me know if you have any questions! And be sure to review your work for accuracy before submitting.