{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":635,"path":"api-reference/scripts/general-guidelines-code-generation.md","title":"General guidelines for code generation","bundle":null,"doc_type":null,"release":"australia","body":"\n# General guidelines for code generation\n\nUse these general guidelines for code generation to get better code suggestions and create useful and accurate scripts.\n\n## Writing prompts\n\n-   **Write clear and specific but concise prompts**\n\n    Specify the expected outcome and context clearly. Include important details like task requirements, specific APIs if you know them, and any limitations.\n\n-   **Experiment with different prompts**\n    -   Consider adjusting your task instructions and incorporating examples. Observe how the code suggestions change with different prompt styles and levels of detail.\n    -   Keep track of your prompts, along with any modifications and instructions for generating prompts that meet your specifications.\n-   **Character limit of the prompts**\n\n    Short and concise prompts generate better outcomes.\n\n    On reaching 200 characters, a message appears to inform you that short, focused, task-oriented directions yield the best results.\n\n    Input beyond 300 characters isn’t allowed.\n\n\n<table id=\"table_ryd_22l_yxb\"><thead><tr><th>\n\nWeak prompt\n\n</th><th>\n\nStrong prompt\n\n</th><th>\n\nNotes\n\n</th></tr></thead><tbody><tr><td>\n\nGet incidents with tasks\n\n</td><td>\n\nGet incidents with related tasks\n\n</td><td>\n\nIncludes sufficient detail.\n\n</td></tr><tr><td>\n\nCount P1 incidents between 3-3 and 4-13\n\n</td><td>\n\nUse Glide aggregate to count number of P1 incidents closed between March 3 to April 13 assigned to admin\n\n</td><td>\n\nIncludes the API name and more specific language.\n\n</td></tr><tr><td>\n\nDon’t allow changing P1 change requests\n\n</td><td>\n\nIf open change request is P1, don’t allow reducing the severity unless it's the creator\n\n</td><td>\n\nIncludes more specific instructions on what shouldn't change.\n\n</td></tr><tr><td>\n\nLatest change\n\n</td><td>\n\nGlide record of the most recent change\n\n</td><td>\n\nIncludes the API name and more specific language.\n\n</td></tr></tbody>\n</table>## Reviewing code\n\n-   **Review code**\n\n    Implement strict and detailed reviews of the AI-generated code to determine its accuracy, efficiency, and how well it adheres to your coding standards.\n\n-   **Test code**\n\n    Validate the code by running it against test cases in controlled environments to verify that it functions according to your requirements.\n\n\n"}}