trinhhaox/ag-kit/ai-patterns
Claude Code and agent skill by trinhhaox/ag-kit
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
AI agent architecture, prompt engineering, function calling, and LLM integration patterns. ReAct loops, RTFC framework, streaming, structured outputs.
Install
npx vskill@latest install trinhhaox/ag-kit/ai-patternsSKILL.md
AI Patterns
Production patterns for AI agents, prompt engineering, and LLM integration.
Agent Architecture
ReAct Pattern (Reasoning + Acting)
Plan-and-Execute
- Break complex tasks into subtasks upfront
- Execute each subtask with ReAct loop
- Re-plan if execution reveals new information
Multi-Agent Orchestration
- Router agent → dispatches to specialist agents
- Supervisor → monitors agent progress, handles failures
- Handoff protocol → structured context passing between agents
Safety Framework
- Input sanitization before tool execution
- Iteration caps (prevent infinite loops)
- Token budgeting per operation
- Audit logging for all tool calls
Prompt Engineering (RTFC Framework)
Structure
Chain-of-Thought
Few-Shot Templates
- Provide 2-3 examples of input → output pairs
- Include edge cases in examples
- Use XML tags for structured sections
Anti-Patterns
- Vague roles ("be helpful") → Be specific ("Senior TypeScript engineer")
- Missing constraints → Always specify what NOT to do
- No output format → Define JSON schema or template
- Single mega-prompt → Break into multi-stage pipeline
- No error handling → Include fallback instructions
- Ignoring context window → Budget tokens across sections
- No validation → Add schema validation for structured output
- Hardcoded examples → Use parameterized templates
Function Calling
Tool Schema Design
Registry-Based Dispatcher
Safety
- Sandbox tool execution
- Set per-call timeouts
- Log all inputs and outputs
- Limit parallel calls
Context Engineering
Budget Allocation
| Zone | % of Context | Purpose | |
|---|---|---|---|
| System | 10-15% | Role, rules, format | |
| Task | 20-30% | Current request, history | |
| Reference | 30-40% | Code, docs, examples | |
| Working Memory | 15-25% | Intermediate results | |
| Output | 10-15% | Reserved for response |
Compression Techniques
- Code: Remove comments, collapse imports, summarize unchanged functions
- Docs: Extract key sections, progressive summarization
- History: Summarize older turns, keep recent 3-5 turns verbatim
Progressive Loading
- Load minimal context first
- Expand relevant sections on demand
- Evict stale context as new info arrives
Streaming & Structured Output
Streaming Responses
Structured Output with Zod
Multi-Provider Support
- Abstract provider behind unified interface
- Use Vercel AI SDK for cross-provider compatibility
- Test with multiple providers to avoid vendor lock-in
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ai-patterns/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/trinhhaox/ag-kit/ai-patterns)