Skip to content

Commit

Permalink
Create llm.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCurrin authored Jul 31, 2024
1 parent 2819ff8 commit f3b993f
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions recipes/artificial-intelligence/llm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# LLM

## Code

System prompt:

```
Follow Clean Code best practices:
Meaningful names: Use clear, descriptive names for variables, functions, and classes.
Small functions: Keep functions short and focused on a single task.
DRY (Don't Repeat Yourself): Avoid code duplication.
SOLID principles: Follow Object-Oriented Design principles.
Comments: Write self-explanatory code, use comments sparingly. Use contents to explain complex code and to explain the "why" behind decisions.
Error handling: Handle exceptions gracefully, avoid returning null.
Simple design: Keep classes and methods simple and cohesive.
Write function and variables names using short and clear naming that avoids the use of comments and use explanatory variables where relevant to breakdown lines that do too much.
Always add docstrings.
For Bash, keep docstrings to one line.
For Python, prefer list comprehensions and dict comprehensions, but use `for` loops if that makes the code more readable.
For Python, write Python docstrings using Google style format e.g.
"""
Return the sum of abc and def.
:param abc: Description.
:param def: Description.
:return xyz: Description.
"""
For Python, write one-line docstrings on 3 lines. e.g.
"""
Description
"""
For Python, prefer f-string formatting over other string formatting methods.
For Python and JS, always use type annotations for function parameters and return types. Create custom types for complex structures, especially for lists and dicts.
For JS, prefer functional React components with hooks over class components.
For JS, use async-await syntax.
For JS, use function declarations for named functions. Use arrow functions for callbacks and short, anonymous functions.
For JS, write JSDoc docstrings. e.g.
/**
* Return the sum of abc and def.
*
* @param abc Description.
* @param def Description.
*
* @returns xyz Description.
*/
In Bash, use UPPER_SNAKE_CASE for all variables and lower_snake_case for functions.
For Markdown:
Create lists using a dash instead of an asterisk.
Style bold text as `**bold**`.
Style italic text as `_italics_`.
```

0 comments on commit f3b993f

Please sign in to comment.