.agents/skills/llm-generation/SKILL.md
Implement business-facing LLM calls as explicit, independently observable workflows. Keep prompt identity, model policy, structured output, and tracing responsibilities separate.
Before editing a call, inspect:
packages/prompts for reusable application prompts;apps/server/src/services/aiGeneration for the server-side structured generation wrapper;packages/const/src/llmGenerationTracing.ts for scenario names;packages/llm-generation-tracing for tracing option and registry behavior;Use agent-tracing for execution-snapshot diagnosis and agent-runtime-hooks for lifecycle hook behavior. Neither owns application LLM generation conventions.
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.AiGenerationService, tracing entity IDs, Zod validation, persistence, and business error handling do not belong in the prompt chain.*_PROMPT_VERSION beside the prompt it versions and export both from the same module.v<major> or v<major>.<minor>, for example v1 or v1.2.promptVersion. Do not include a feature or scenario prefix such as expertise-ingestion-v1; scenario carries workflow identity.export const EXAMPLE_PROMPT_VERSION = 'v1';
export const EXAMPLE_SYSTEM_PROMPT = `...`;
Treat scenario as the stable product workflow and lifecycle-stage partition, not as a label for a prompt, schema, model, or helper.
TRACING_SCENARIOS before adding a call.schemaName for structured generation and relevant entity IDs when available.For every new or corrected generation workflow:
scenario, promptVersion, and schemaName where applicable.bun run check <changed-files...> and bun run check --type for cross-package changes.Use the testing skill for test mechanics and the typescript skill for TypeScript changes.