
LLM Prompt Generation
Writes application prompts and generation calls with model selection and tracing.
Install
npx skills add lobehub/lobehub --skill llm-generation -g -a claude-code -y- Repository
- lobehub/lobehub83.7k
- Category
- AI and agents
- Updated
- 3d ago
- License
- See repository
- Context cost
- Lightabout 1,040 tokens
- Runs scripts
- No, instructions only
What it does
Use for application prompts, generateObject/generateText, model selection and generation tracing. Excludes provider adapters and agent snapshots.
LLM Generation
Implement business-facing LLM calls as explicit, independently observable workflows. Keep prompt identity, model policy, structured output, and tracing responsibilities separate.
Locate the Existing Boundary
Before editing a call, inspect:
packages/promptsfor reusable application prompts;apps/server/src/services/aiGenerationfor the server-side structured generation wrapper;packages/const/src/llmGenerationTracing.tsfor scenario names;packages/llm-generation-tracingfor tracing option and registry behavior;- the owning service for model configuration and business-specific schemas.
Use agent-tracing for execution-snapshot diagnosis and agent-runtime-hooks for lifecycle hook behavior. Neither owns application LLM generation conventions.
Prompt Ownership and Versioning
- Put a reusable generation contract in
packages/prompts/src/chains: the message builder, JSON schema, schema name, and prompt version should be exported together. Do not leave substantial system prompts or model-facing input serialization embedded in a service. - Keep execution concerns in the owning server service: model configuration,
AiGenerationService, tracing entity IDs, Zod validation, persistence, and business error handling do not belong in the prompt chain. - Keep each
*_PROMPT_VERSIONbeside the prompt it versions and export both from the same module. - Format versions as
v<major>orv<major>.<minor>, for examplev1orv1.2. - Store only the version in
promptVersion. Do not include a feature or scenario prefix such asexpertise-ingestion-v1;scenariocarries workflow identity. - Bump the version whenever a prompt or output contract changes in a way that should create a separate evaluation or tracing cohort.
export const EXAMPLE_PROMPT_VERSION = 'v1';
export const EXAMPLE_SYSTEM_PROMPT = `...`;

