mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
feat: Introduce @automaker/prompts package for AI prompt templates
Changes: - Added a new package, @automaker/prompts, containing AI prompt templates for enhancing user-written task descriptions. - Implemented four enhancement modes: improve, technical, simplify, and acceptance, each with corresponding system prompts and examples. - Updated relevant packages to utilize the new prompts package, ensuring backward compatibility with existing imports. - Enhanced documentation to include usage examples and integration details for the new prompts. Benefits: ✅ Streamlined AI prompt management across the codebase ✅ Improved clarity and usability for AI-powered features ✅ Comprehensive documentation for developers All tests passing.
This commit is contained in:
@@ -108,3 +108,27 @@ export function getUserFriendlyErrorMessage(error: unknown): string {
|
||||
|
||||
return info.message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract error message from an unknown error value
|
||||
*
|
||||
* Simple utility for getting a string error message from any error type.
|
||||
* Returns the error's message property if it's an Error, otherwise
|
||||
* converts to string. Used throughout the codebase for consistent
|
||||
* error message extraction.
|
||||
*
|
||||
* @param error - The error value (Error object, string, or unknown)
|
||||
* @returns Error message string
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* try {
|
||||
* throw new Error("Something went wrong");
|
||||
* } catch (error) {
|
||||
* const message = getErrorMessage(error); // "Something went wrong"
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export function getErrorMessage(error: unknown): string {
|
||||
return error instanceof Error ? error.message : "Unknown error";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user