llm-project-development
Build LLM-powered applications and pipelines using proven methodology - task-model fit analysis, pipeline architecture, structured outputs, file-based state, and cost estimation. Use when building AI features, data processing pipelines, agents, or any LLM-integrated system. Inspired by Karpathy's methodology and production case studies.
What this skill does
# LLM Project Development Skill
Build **production LLM applications** using proven methodology from Karpathy's HN Time Capsule, Vercel d0, Manus, and Anthropic's research.
**Core principle**: Validate manually first, then build deterministic pipelines around the non-deterministic LLM core.
## Supporting Documentation
All files under 500 lines per Anthropic best practices:
- **[references/](references/)** - Methodology foundations
- [case-studies.md](references/case-studies.md) - Karpathy, Vercel d0, Manus patterns
- [pipeline-patterns.md](references/pipeline-patterns.md) - Python/TypeScript code patterns
- [INDEX.md](references/INDEX.md) - Reference navigation
- **[examples/](examples/)** - Grey Haven implementations
- [tanstack-pipeline.md](examples/tanstack-pipeline.md) - TanStack Start example
- [fastapi-pipeline.md](examples/fastapi-pipeline.md) - FastAPI backend example
- [INDEX.md](examples/INDEX.md) - Examples navigation
- **[templates/](templates/)** - Copy-paste starters
- [pipeline-template.ts](templates/pipeline-template.ts) - TypeScript pipeline
- [pipeline-template.py](templates/pipeline-template.py) - Python pipeline
- **[checklists/](checklists/)** - Validation
- [llm-project-checklist.md](checklists/llm-project-checklist.md) - Pre-launch checklist
## The Methodology
### Phase 1: Task-Model Fit Analysis
**Before writing any code, determine if LLMs are the right tool.**
#### LLM-Suited Tasks
| Characteristic | Why LLMs Excel | Grey Haven Example |
|----------------|----------------|-------------------|
| **Synthesis over precision** | Combining context, not calculating | Summarizing tenant activity |
| **Subjective judgment** | No single correct answer | Categorizing support tickets |
| **Error tolerance** | Graceful degradation acceptable | Content recommendations |
| **Human-like processing** | Natural language understanding | Chat-based tenant onboarding |
| **Creative output** | Novel combinations required | Generating marketing copy |
#### LLM-Unsuited Tasks (Use Traditional Code)
| Characteristic | Why LLMs Fail | Better Approach |
|----------------|---------------|-----------------|
| **Precise computation** | Math errors, hallucinations | SQL queries, Python math |
| **Real-time requirements** | Latency too high | Pre-computed indices |
| **Deterministic output** | Need exact same result | Database lookups |
| **Structured data lookup** | LLMs guess, don't retrieve | Drizzle/SQLModel queries |
| **High-frequency calls** | Cost explodes | Caching, batching |
#### The Manual Prototype Step
**CRITICAL**: Before building automation, validate with the target model manually.
```markdown
## Manual Validation Checklist
- [ ] Copy ONE real example into the LLM UI
- [ ] Test with the EXACT model you'll use in production
- [ ] Verify output quality meets requirements
- [ ] Note edge cases and failure modes
- [ ] Estimate cost per operation
## Example: Karpathy's Approach
1. Took ONE Hacker News thread
2. Pasted into ChatGPT with analysis prompt
3. Confirmed Opus 4.5 could do the task
4. THEN built automation pipeline
```
### Phase 2: Pipeline Architecture
**Design principle**: Deterministic stages wrapping one non-deterministic core.
```
┌─────────────────────────────────────────────────────────────────┐
│ DETERMINISTIC │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ ACQUIRE │ → │ PREPARE │ → │ PROCESS │ → │ RENDER │ │
│ │ (fetch) │ │ (format) │ │ (LLM) │ │ (output) │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ↑ ↑ ↑ ↑ │
│ Deterministic Deterministic NON-DETERMINISTIC Deterministic│
│ (retry safe) (retry safe) (cache results) (retry safe) │
└─────────────────────────────────────────────────────────────────┘
```
#### Stage Details
| Stage | Purpose | Grey Haven Implementation |
|-------|---------|--------------------------|
| **Acquire** | Get raw data | Drizzle queries, Firecrawl scraping, API calls |
| **Prepare** | Format for LLM | Jinja templates, TypeScript string builders |
| **Process** | LLM inference | Anthropic SDK, structured outputs |
| **Parse** | Extract from response | Zod schemas, Pydantic models |
| **Render** | Final output | React components, markdown, JSON |
#### TypeScript Pipeline Example (TanStack Start)
```typescript
// lib/pipelines/content-analyzer.ts
import Anthropic from "@anthropic-ai/sdk";
import { z } from "zod";
import { existsSync, mkdirSync, writeFileSync, readFileSync } from "fs";
import { join } from "path";
// Stage 1: Schema definition
const AnalysisSchema = z.object({
summary: z.string(),
sentiment: z.enum(["positive", "neutral", "negative"]),
topics: z.array(z.string()),
action_items: z.array(z.string()),
});
type Analysis = z.infer<typeof AnalysisSchema>;
// Stage 2: Acquire - Get data from database
async function acquire(tenant_id: string, content_id: string) {
const content = await db.query.contents.findFirst({
where: and(
eq(contents.tenant_id, tenant_id),
eq(contents.id, content_id)
),
});
if (!content) throw new Error(`Content ${content_id} not found`);
return content;
}
// Stage 3: Prepare - Format prompt
function prepare(content: Content): string {
return `Analyze this content and provide structured output.
CONTENT:
${content.body}
Respond with JSON matching this schema:
{
"summary": "2-3 sentence summary",
"sentiment": "positive" | "neutral" | "negative",
"topics": ["topic1", "topic2"],
"action_items": ["action1", "action2"]
}`;
}
// Stage 4: Process - LLM call with caching
async function process(
prompt: string,
cacheDir: string,
cacheKey: string
): Promise<string> {
const cachePath = join(cacheDir, `${cacheKey}.json`);
// Check cache first
if (existsSync(cachePath)) {
return JSON.parse(readFileSync(cachePath, "utf-8")).response;
}
const client = new Anthropic();
const response = await client.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: prompt }],
});
const text = response.content[0].type === "text"
? response.content[0].text
: "";
// Cache result
mkdirSync(cacheDir, { recursive: true });
writeFileSync(cachePath, JSON.stringify({
response: text,
timestamp: new Date().toISOString()
}));
return text;
}
// Stage 5: Parse - Validate with Zod
function parse(response: string): Analysis {
const jsonMatch = response.match(/\{[\s\S]*\}/);
if (!jsonMatch) throw new Error("No JSON found in response");
const parsed = JSON.parse(jsonMatch[0]);
return AnalysisSchema.parse(parsed);
}
// Stage 6: Render - Save to database
async function render(
tenant_id: string,
content_id: string,
analysis: Analysis
) {
await db.update(contents)
.set({
analysis_summary: analysis.summary,
analysis_sentiment: analysis.sentiment,
analysis_topics: analysis.topics,
updated_at: new Date(),
})
.where(and(
eq(contents.tenant_id, tenant_id),
eq(contents.id, content_id)
));
return analysis;
}
// Main pipeline function
export async function analyzeContent(
tenant_id: string,
content_id: string
): Promise<Analysis> {
const cacheDir = join(process.cwd(), ".cache", "analyses", tenant_id);
const content = await acquire(tenant_id, content_id);
const prompt = prepare(content);
const response = await process(prompt, cacheDir, content_id);
const analysis = parse(response);
await render(tenant_id, content_id, analysis);
return analysis;
}
```
#### Python Pipeline Example (FastAPI)
```python
# app/pipelines/content_analyzer.py
from pathlib import Path
from pydantic import BaseModel
from anthropic import Anthropic
import json
class Analysis(BaseModel):
summary: str
sentiment: str # positive | neutral | negative
topicRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.