llm-generation

Implements application-level LLM generation workflows with prompt versioning, structured output, and tracing.

74|11|Updated Jul 4, 2024
One-click install
npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill llm-generation-opensourceagi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-generation
Source: https://github.com/OpenSourceAGI/qwksearch-research-agent/tree/main/apps/qwk-in-lobe/.agents/skills/llm-generation
Command: npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill llm-generation-opensourceagi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Application LLM calls often end up with prompts buried in services, inconsistent model choices, and reused tracing scenarios that corrupt latency, cost, and quality metrics. This Skill enforces conventions that keep prompt identity, model policy, structured output, and tracing cleanly separated. ## Core Features & Use Cases - Prompt Ownership and Versioning: Places reusable generation contracts in packages/prompts with co-located version constants formatted as v<major> or v<major>.<minor>. - Scenario and Tracing Discipline: Ensures each business workflow maps to a distinct tracing scenario so metrics are never contaminated by borrowed placeholders. - Structured Generation: Aligns JSON schemas with prompt instructions, validates output at the service boundary, and preserves fallback behavior. - Use Case: When adding a new AI-generated content feature, use this Skill to create the prompt chain, assign a scenario, configure the model policy, and write tests asserting scenario, promptVersion, and schemaName. ## Quick Start Use the llm-generation skill to implement a new structured generation workflow with a versioned prompt, correct tracing scenario, and validation tests.

Frequently Asked Questions about llm-generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new LLM generation call with structured output?

Create a prompt chain in packages/prompts exporting the message builder, JSON schema, schema name, and prompt version together. Then wire it through the owning server service using AiGenerationService, passing the correct scenario, schemaName, and entity IDs.

How should I version prompts for LLM generation workflows?

Keep each PROMPT_VERSION constant beside the prompt it versions and export both from the same module. Format versions as v<major> or v<major>.<minor>, store only the version in promptVersion, and bump it whenever the prompt or output contract changes.

When should I create a new tracing scenario instead of reusing one?

Add a new scenario whenever the business action differs, even if another call shares the same prompt or JSON schema. Reusing a nearby scenario as a placeholder contaminates latency, cost, success-rate, and quality metrics.

Does this Skill cover provider adapter internals or agent execution snapshots?

No. Provider adapter internals and agent execution snapshots are out of scope; use the agent-tracing skill for execution-snapshot diagnosis and agent-runtime-hooks for lifecycle hook behavior. This Skill only covers application-level generation conventions.

What tests are required for a new generation workflow?

Assert the emitted scenario, promptVersion, and schemaName, test the prompt's key behavioral constraints without snapshotting full prose, and validate structured-output failure behavior. Also search for stale inline prompts and run bun run check on changed files.