llm-app-patterns

Implements schema-valid JSON output, dashboard cards, and tool-calling agentic loops for LLM applications.

1|Updated Mar 15, 2025
One-click install
npx skills add https://github.com/adikpb/dotfiles --skill llm-app-patterns-adikpb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: llm-app-patterns
Source: https://github.com/adikpb/dotfiles/tree/main/.hermes/skills/software-development/llm-app-patterns
Command: npx skills add https://github.com/adikpb/dotfiles --skill llm-app-patterns-adikpb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? LLM features fail in production for predictable reasons: hand-assembled JSON breaks schema validators, raw JSON dumps render as unreadable <pre> blobs in dashboards, single-shot prompts cannot use tools, and inline JavaScript in Python-served dashboards fails silently. This Skill provides tested patterns for each of these failure modes. ## Core Features & Use Cases - Machine-validated JSON output: Write the payload to a file, serialize with json.dumps, and validate with json.loads before emitting, eliminating 'Expecting , delimiter' errors. - Structured dashboard cards: Replace raw JSON <pre> blocks with an IIFE that renders verdict badges, evidence lists, recommended actions, and MITRE tags, with correct template-literal escaping. - Static-to-agentic upgrade: A three-phase pattern (ledger, deterministic enrichment, function-calling loop) for converting a single LLM call into a tool-using agent with full audit trail. - Web UI debugging: Diagnose silent JS failures in FastAPI/Flask dashboards using new Function compile checks, browser console inspection, and binary search. - Use Case: You are adding an LLM investigation feature to a security alert dashboard. Use this Skill to emit schema-valid verdict JSON, render it as a readable card, upgrade the prompt to an agentic tool-calling loop, and debug the modal that stopped opening. ## Quick Start Use the llm-app-patterns skill to convert my single-shot LLM analysis endpoint into a tool-calling agentic loop with an investigation ledger.

Frequently Asked Questions about llm-app-patterns

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

FAQPage Schema
How do I make an LLM reply with JSON that passes schema validation?▼

Write the markdown payload to a file first, then serialize it with json.dumps using ensure_ascii=False, and validate with json.loads before emitting. Never hand-assemble JSON around markdown, since quotes, backticks, and newlines break the object.

How to convert a single-shot LLM prompt into an agentic tool-calling loop?▼

Follow three phases: first build a write-only ledger logging every LLM call and tool execution, then add deterministic tool enrichment via a TOOL_REGISTRY, and finally let the LLM choose tools via OpenAI-style function calling with an iteration limit and stop condition.

Why does my dashboard modal do nothing when clicked?▼

Silent JavaScript parse errors are the usual cause. Compile-check each script block with new Function(script.textContent); a ${...} expression outside a template literal is invalid syntax and discards the entire script block, unregistering all its functions.

Can I test agentic loops against a local LLM like LM Studio concurrently?▼

No. Local LLM servers process requests sequentially in a single queue, so concurrent deep-analysis calls pile up and each waits for all previous ones. Fire one analysis at a time and probe readiness with a short max_tokens chat completion request.

When should I not use these LLM application patterns?▼

Do not use this Skill for generic code review or for researching third-party security tool architectures. It targets building and debugging LLM features inside your own product, not evaluating external SOC platforms.