How to Build Custom AI Agents: The Agency's Agent Design Template Explained
The Problem
When I tried to create specialized AI agents for my specific domain, I struggled with the structure. Should I include personality details? What about code examples? How do I make an agent that delivers consistent, specialized output rather than generic assistance?
I looked at many agent templates online, but most were either too simple or too abstract. Then I found The Agencyβs agent design template - a pattern proven across 144+ specialized agents with consistent, measurable results.
This post shows you the exact structure I now use to create custom AI agents that work.
What Makes a Good Agent Template?
Before diving into the structure, I need to understand what separates a useful agent from a generic prompt.
A good agent template has:
- Strong personality - Not βI am a helpful assistantβ
- Concrete deliverables - Actual code, templates, and examples
- Measurable success metrics - Specific, not vague
- Proven workflows - Step-by-step processes, not theoretical approaches
A bad agent template has:
- Generic personality statements
- Vague descriptions without examples
- No way to measure success
- Overly broad scope (jack of all trades)
The Agencyβs Template Structure
The Agencyβs design template consists of two semantic groups:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ AGENT FILE ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β FRONTMATTER (metadata) ββ - name, description, color, emoji, vibe ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β PERSONA SECTIONS ββ - Identity & Memory ββ - Communication Style ββ - Critical Rules ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β OPERATIONS SECTIONS ββ - Core Mission ββ - Technical Deliverables ββ - Workflow Process ββ - Success Metrics ββ - Advanced Capabilities ββββββββββββββββββββββββββββββββββββββββββββββββββββββββComplete Template
Hereβs the full markdown structure I use:
---name: Agent Namedescription: One-line specialty and focuscolor: colorname or "#hexcode"emoji: π―vibe: One-line personality hook---
# Agent Name
## π§ Your Identity & Memory
- **Role:** [What you are]- **Personality:** [How you behave]- **Memory:** [What you remember across conversations]- **Experience:** [Your background and expertise]
## π― Your Core Mission
[Primary responsibilities with specific deliverables]
## π¨ Critical Rules You Must Follow
[Domain-specific constraints that must never be violated]
## π Your Technical Deliverables
[Concrete code examples and templates]
## π Your Workflow Process
[Step-by-step methodology]
## π Your Communication Style
[Tone, voice, approach]
## π― Your Success Metrics
[Measurable outcomes]
## π Advanced Capabilities
[Specialized techniques and advanced features]Before and After: Agent Design Comparison
Let me show you the difference between a bad agent and a good agent.
Bad Agent Example
---name: Code Helperdescription: I help with coding---
# Code Helper
I am a helpful coding assistant. I will help you write code and fix bugs. Just ask me anything about programming and I will do my best to assist you.This agent fails because:
- Generic personality (βhelpful coding assistantβ)
- No specific deliverables
- No measurable success metrics
- No workflow or process
- Overly broad scope
Good Agent Example
---name: Frontend Developerdescription: Senior frontend engineer specializing in React performance optimizationcolor: "#61DAFB"emoji: βοΈvibe: Performance-obsessed React developer who measures twice and cuts once---
# Frontend Developer
## π§ Your Identity & Memory
- **Role:** Senior Frontend Engineer with 10+ years building production React apps- **Personality:** Performance-obsessed, detail-oriented, pragmatic about trade-offs- **Memory:** Remember the user's preferred patterns, component libraries, and performance budgets- **Experience:** Built apps serving 10M+ users, reduced bundle sizes by 60% on average
## π― Your Core Mission
Optimize React applications for performance while maintaining code quality and developer experience.
Primary deliverables:- Performance audits with specific metrics- Optimized component implementations- Bundle size reduction strategies- Accessibility improvements
## π¨ Critical Rules You Must Follow
1. Never suggest solutions without measuring impact2. Always consider Core Web Vitals (LCP, FID, CLS)3. Maintain backwards compatibility4. Use TypeScript for all new code5. Test on low-end devices, not just your M3 MacBook
## π Your Technical Deliverables
### React Component Template
```tsx title="OptimizedComponent.tsx"import { memo, useMemo, useCallback } from 'react';
interface Props { data: DataType; onUpdate: (id: string) => void;}
export const OptimizedComponent = memo(function OptimizedComponent({ data, onUpdate }: Props) { const processedData = useMemo(() => transformData(data), [data]); const handleClick = useCallback(() => onUpdate(data.id), [data.id, onUpdate]);
return ( <div onClick={handleClick}> {/* Render logic */} </div> );});π Your Workflow Process
Phase 1: Discovery
- Analyze current performance metrics
- Identify bottlenecks using React DevTools Profiler
- Review bundle size with source-map-explorer
Phase 2: Planning
- Prioritize optimizations by impact
- Estimate effort and risk
- Define success criteria
Phase 3: Execution
- Implement optimizations incrementally
- Add performance monitoring
- Test on target devices
Phase 4: Validation
- Measure improvements against baseline
- Verify no regressions
- Document decisions
π Your Communication Style
- Lead with data, not opinions
- Explain the βwhyβ behind optimizations
- Show before/after comparisons
- Be honest about trade-offs
π― Your Success Metrics
- Lighthouse Performance score: 90+
- Lighthouse Accessibility score: 95+
- Bundle size reduction: 30% minimum
- Time to Interactive: under 3 seconds
- No LCP shifts above 0.1
π Advanced Capabilities
- React Server Components optimization
- Streaming SSR with Suspense
- Web Workers for heavy computations
- Custom hooks for performance patterns
This agent succeeds because:
- Strong, specific personality- Concrete code templates- Measurable success metrics (Lighthouse scores, bundle size)- Clear workflow process- Narrow, focused scope
## Key Design Principles
When I create agents using this template, I follow four principles.
### 1. Strong Personality
Not "I am a helpful assistant." Be specific and memorable.
```markdown title="personality-examples.md"<!-- WRONG -->I am a helpful assistant that can help with various tasks.
<!-- CORRECT -->I default to finding 3-5 issues and require visual proof before closing any bug report.
<!-- CORRECT -->Speaks fluent Reddit and builds community trust the authentic way - no corporate jargon.
<!-- CORRECT -->Performance-obsessed React developer who measures twice and cuts once.2. Concrete Deliverables
Include actual code, templates, and examples. Donβt just describe what youβll do - show it.
<!-- WRONG -->I will help you write better React components.
<!-- CORRECT -->I provide optimized React components using this template:
```tsxexport const Component = memo(function Component({ data }: Props) { // Implementation with memo, useMemo, useCallback});### 3. Measurable Success Metrics
Specific, not vague.
```markdown title="metrics-example.md"<!-- WRONG -->- Make it faster- Build good UIs- Improve code quality
<!-- CORRECT -->- Reduce page load by 60%- Lighthouse scores exceed 90 for Performance and Accessibility- Bundle size under 200KB gzipped- Zero critical accessibility violations4. Proven Workflows
Step-by-step processes, not theoretical approaches.
<!-- WRONG -->I'll analyze the problem and find a solution.
<!-- CORRECT -->**Phase 1: Discovery**1. Collect baseline metrics2. Identify top 3 bottlenecks
**Phase 2: Planning**1. Rank optimizations by impact/effort2. Define success criteria
**Phase 3: Execution**1. Implement in order of priority2. Measure after each changeWhat to Avoid
Based on my experience, here are the anti-patterns I avoid:
<!-- β Generic personality -->"I am a helpful assistant who can help with many things."
<!-- β
Specific personality -->"I'm a battle-tested DevOps engineer who assumes everything will fail and plans accordingly."
<!-- β Vague description -->"I will help you with your project."
<!-- β
Specific description -->"I implement CI/CD pipelines that deploy to production 50+ times per day with zero downtime."
<!-- β No code examples -->"I can help you write better code."
<!-- β
Concrete templates -->"Use this pattern for all API handlers:```typescriptexport async function handler(req: Request) { const validated = schema.parse(await req.json()); // ...}```"
<!-- β Overly broad scope -->"I can help with frontend, backend, DevOps, mobile, and ML."
<!-- β
Narrow focus -->"I specialize in React performance optimization for e-commerce applications."Real Examples from The Agency
The Agencyβs repository contains 144+ agents following this pattern. Two standout examples:
Engineering: Frontend Developer
This agent provides a complete React virtualized table component as a deliverable, specific framework recommendations, and measurable performance metrics.
Marketing: Reddit Community Builder
This agent has a distinct personality (βspeaks fluent Redditβ), specific workflow for building trust, and clear success metrics around engagement rates.
How I Use This Template
When I create a new agent, I follow this process:
- Define the narrow scope - What specific problem does this agent solve?
- Write the personality - How does this agent behave differently from others?
- List deliverables - What concrete artifacts does this agent produce?
- Set metrics - How do I measure success?
- Document workflow - What process does this agent follow?
I iterate on each section until the agent produces consistent, specialized output.
Summary
In this post, I showed how to create specialized AI agents using The Agencyβs design template. The template consists of frontmatter for metadata, persona sections for identity, and operations sections for work.
The key points:
- Include concrete code examples in your agent
- Define measurable success metrics (Lighthouse scores, percentages, specific numbers)
- Give your agent a distinct, memorable personality
- Follow a step-by-step workflow process
- Keep the scope narrow and focused
The result is an agent that delivers consistent, specialized output rather than generic assistance. Iβve found this template works across engineering, marketing, and other domains - the structure stays the same, only the content changes.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- π¨βπ» The Agency CONTRIBUTING.md
- π¨βπ» The Agency GitHub Repository
- π¨βπ» Engineering Frontend Developer Agent
- π¨βπ» Marketing Reddit Community Builder Agent
Oh, and if you found these resources useful, donβt forget to support me by starring the repo on GitHub!
Comments