skills/ariegoldkin/ai-native-development/SKILL.md
Build AI-first applications with RAG pipelines, embeddings, vector databases, agentic workflows, and LLM integration. Master prompt engineering, function calling, streaming responses, and cost optimization for 2025+ AI development.
npx skillsauth add aiskillstore/marketplace ai-native-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
AI-Native Development focuses on building applications where AI is a first-class citizen, not an afterthought. This skill provides comprehensive patterns for integrating LLMs, implementing RAG (Retrieval-Augmented Generation), using vector databases, building agentic workflows, and optimizing AI application performance and cost.
When to use this skill:
Traditional software is deterministic; AI-native applications are probabilistic:
Embeddings are vector representations of text that capture semantic meaning. Similar concepts have similar vectors.
Key Capabilities:
Detailed Implementation: See references/vector-databases.md for:
Store and retrieve embeddings efficiently at scale.
Popular Options:
Detailed Implementation: See references/vector-databases.md for:
RAG combines retrieval systems with LLMs to provide accurate, grounded answers.
Core Pattern:
Advanced Patterns:
Detailed Implementation: See references/rag-patterns.md for:
Enable LLMs to use external tools and APIs reliably.
Capabilities:
Detailed Implementation: See references/function-calling.md for:
Enable LLMs to reason, plan, and take autonomous actions.
Patterns:
Detailed Implementation: See references/agentic-workflows.md for:
Advanced multi-agent patterns leveraging Opus 4.5's extended thinking capabilities.
When to Use Extended Thinking:
Orchestrator Pattern:
interface AgentTask {
id: string;
type: 'research' | 'code' | 'review' | 'design';
input: unknown;
dependencies: string[]; // Task IDs that must complete first
}
interface AgentResult {
taskId: string;
output: unknown;
confidence: number;
reasoning: string;
}
async function orchestrateAgents(
goal: string,
availableAgents: Agent[]
): Promise<AgentResult[]> {
// Step 1: Use extended thinking to decompose goal into tasks
const taskPlan = await planTasks(goal, availableAgents);
// Step 2: Build dependency graph
const dependencyGraph = buildDependencyGraph(taskPlan.tasks);
// Step 3: Execute tasks respecting dependencies
const results: AgentResult[] = [];
const completed = new Set<string>();
while (completed.size < taskPlan.tasks.length) {
// Find tasks with satisfied dependencies
const ready = taskPlan.tasks.filter(task =>
!completed.has(task.id) &&
task.dependencies.every(dep => completed.has(dep))
);
// Execute ready tasks in parallel
const batchResults = await Promise.all(
ready.map(task => executeAgentTask(task, availableAgents))
);
// Validate results - use extended thinking for conflicts
const validatedResults = await validateAndResolveConflicts(
batchResults,
results
);
results.push(...validatedResults);
ready.forEach(task => completed.add(task.id));
}
return results;
}
Task Planning with Extended Thinking:
Based on Anthropic's Extended Thinking documentation:
import Anthropic from '@anthropic-ai/sdk';
const anthropic = new Anthropic();
async function planTasks(
goal: string,
agents: Agent[]
): Promise<{ tasks: AgentTask[]; rationale: string }> {
// Extended thinking requires budget_tokens < max_tokens
// Minimum budget: 1,024 tokens
const response = await anthropic.messages.create({
model: 'claude-opus-4-5-20251101', // Or claude-sonnet-4-5-20250929
max_tokens: 16000,
thinking: {
type: 'enabled',
budget_tokens: 10000 // Extended thinking for complex planning
},
messages: [{
role: 'user',
content: `
Goal: ${goal}
Available agents and their capabilities:
${agents.map(a => `- ${a.name}: ${a.capabilities.join(', ')}`).join('\n')}
Decompose this goal into tasks. For each task, specify:
1. Which agent should handle it
2. What input it needs
3. Which other tasks it depends on
4. Expected output format
Think carefully about:
- Optimal parallelization opportunities
- Potential conflicts between agent outputs
- Information that needs to flow between tasks
`
}]
});
// Response contains thinking blocks followed by text blocks
// content: [{ type: 'thinking', thinking: '...' }, { type: 'text', text: '...' }]
return parseTaskPlan(response);
}
Conflict Resolution:
async function validateAndResolveConflicts(
newResults: AgentResult[],
existingResults: AgentResult[]
): Promise<AgentResult[]> {
// Check for conflicts with existing results
const conflicts = detectConflicts(newResults, existingResults);
if (conflicts.length === 0) {
return newResults;
}
// Use extended thinking to resolve conflicts
const resolution = await anthropic.messages.create({
model: 'claude-opus-4-5-20251101',
max_tokens: 8000,
thinking: {
type: 'enabled',
budget_tokens: 5000
},
messages: [{
role: 'user',
content: `
The following agent outputs conflict:
${conflicts.map(c => `
Conflict: ${c.description}
Agent A (${c.agentA.name}): ${JSON.stringify(c.resultA)}
Agent B (${c.agentB.name}): ${JSON.stringify(c.resultB)}
`).join('\n\n')}
Analyze each conflict and determine:
1. Which output is more likely correct and why
2. If both have merit, how to synthesize them
3. What additional verification might be needed
`
}]
});
return applyResolutions(newResults, resolution);
}
Adaptive Agent Selection:
async function selectOptimalAgent(
task: AgentTask,
agents: Agent[],
context: ExecutionContext
): Promise<Agent> {
// Score each agent based on:
// - Capability match
// - Current load
// - Historical performance on similar tasks
// - Cost (model tier)
const scores = agents.map(agent => ({
agent,
score: calculateAgentScore(agent, task, context)
}));
// For complex tasks, use Opus; for simple tasks, use Haiku
const complexity = assessTaskComplexity(task);
if (complexity > 0.7) {
// Filter to agents that can use Opus
const opusCapable = scores.filter(s => s.agent.supportsOpus);
return opusCapable.sort((a, b) => b.score - a.score)[0].agent;
}
return scores.sort((a, b) => b.score - a.score)[0].agent;
}
Agent Communication Protocol:
interface AgentMessage {
from: string;
to: string | 'broadcast';
type: 'request' | 'response' | 'update' | 'conflict';
payload: unknown;
timestamp: Date;
}
class AgentCommunicationBus {
private messages: AgentMessage[] = [];
private subscribers: Map<string, (msg: AgentMessage) => void> = new Map();
send(message: AgentMessage): void {
this.messages.push(message);
if (message.to === 'broadcast') {
this.subscribers.forEach(callback => callback(message));
} else {
this.subscribers.get(message.to)?.(message);
}
}
subscribe(agentId: string, callback: (msg: AgentMessage) => void): void {
this.subscribers.set(agentId, callback);
}
getHistory(agentId: string): AgentMessage[] {
return this.messages.filter(
m => m.from === agentId || m.to === agentId || m.to === 'broadcast'
);
}
}
Deliver real-time AI responses for better UX.
Capabilities:
Detailed Implementation: See ../streaming-api-patterns/SKILL.md for streaming patterns
Strategies:
Token Counting:
import { encoding_for_model } from 'tiktoken'
function countTokens(text: string, model = 'gpt-4'): number {
const encoder = encoding_for_model(model)
const tokens = encoder.encode(text)
encoder.free()
return tokens.length
}
Detailed Implementation: See references/observability.md for:
Track LLM performance, costs, and quality in production.
Tools:
Key Metrics:
Detailed Implementation: See references/observability.md for:
This skill includes detailed reference material. Use grep to find specific patterns:
# Find RAG patterns
grep -r "RAG" references/
# Search for specific vector database
grep -A 10 "Pinecone Setup" references/vector-databases.md
# Find agentic workflow examples
grep -B 5 "ReAct Pattern" references/agentic-workflows.md
# Locate function calling patterns
grep -n "parallel.*tool" references/function-calling.md
# Search for cost optimization
grep -i "cost\|pricing\|budget" references/observability.md
# Find all code examples for embeddings
grep -A 20 "async function.*embedding" references/
Use the provided templates for common AI patterns:
templates/rag-pipeline.ts - Basic RAG implementationtemplates/agentic-workflow.ts - ReAct agent patternSee examples/chatbot-with-rag/ for a full-stack implementation:
See checklists/ai-implementation.md for comprehensive validation covering:
Reduce costs by caching similar queries:
const cache = new Map<string, { embedding: number[]; response: string }>()
async function cachedRAG(query: string) {
const queryEmbedding = await createEmbedding(query)
// Check if similar query exists in cache
for (const [cachedQuery, cached] of cache.entries()) {
const similarity = cosineSimilarity(queryEmbedding, cached.embedding)
if (similarity > 0.95) {
return cached.response
}
}
// Not cached, perform RAG
const response = await ragQuery(query)
cache.set(query, { embedding: queryEmbedding, response })
return response
}
Maintain context across multiple turns:
interface ConversationMemory {
messages: Message[] // Last 10 messages
summary?: string // Summary of older messages
}
async function getConversationContext(userId: string): Promise<Message[]> {
const memory = await db.memory.findUnique({ where: { userId } })
return [
{ role: 'system', content: `Previous conversation summary: ${memory.summary}` },
...memory.messages.slice(-5) // Last 5 messages
]
}
Provide examples to guide LLM behavior:
const fewShotExamples = `
Example 1:
Input: "I love this product!"
Sentiment: Positive
Example 2:
Input: "It's okay, nothing special"
Sentiment: Neutral
`
// Include in system prompt
Ask LLM to show reasoning:
const prompt = `${problem}\n\nLet's think step by step:`
After mastering AI-Native Development:
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.