Creating a Prompt Glyph
This guide walks you through creating your first Prompt glyph.
What is a Prompt Glyph?
A Prompt glyph uses large language models (LLMs) to generate text based on user inputs and a prompt template.
Prerequisites
- Glyphrun account
- Understanding of prompt engineering
- Ideas for valuable AI capabilities
Step 1: Define Your Glyph
Basic Information
- Name - Clear, descriptive title (e.g., “Smart Contract Analyzer”)
- Slug - URL-friendly identifier (e.g., “smart-contract-analyzer”)
- Description - What the glyph does (1-2 sentences)
- Long Description - Detailed explanation (optional)
Category
Choose the outcome category:
- LAUNCH - For builders and creators
- SECURE - For security and auditing
- OPTIMIZE - For trading and optimization
Tags
Add relevant tags for discoverability:
- Technology tags: “solidity”, “defi”, “nft”
- Function tags: “analysis”, “generation”, “planning”
Step 2: Design Your Input Schema
Define what users need to provide:
const inputSchema = [
{
name: 'contractAddress',
label: 'Contract Address',
type: 'text',
required: true,
placeholder: '0x...',
description: 'The smart contract to analyze'
},
{
name: 'analysisDepth',
label: 'Analysis Depth',
type: 'select',
required: true,
options: ['basic', 'detailed', 'comprehensive']
},
{
name: 'focusAreas',
label: 'Focus Areas',
type: 'text',
required: false,
placeholder: 'security, gas optimization'
}
]Field Types
| Type | Description | Use For |
|---|---|---|
text | Single-line input | Short text, addresses |
textarea | Multi-line input | Long text, code |
number | Numeric input | Quantities, limits |
select | Dropdown | Fixed options |
checkbox | Boolean toggle | Flags, options |
url | URL input | Links, endpoints |
file | File upload | Documents |
Step 3: Write Your Prompt Template
Create the prompt that will be sent to the LLM:
You are an expert smart contract security auditor.
Analyze the smart contract at {{contractAddress}} with {{analysisDepth}} depth.
{{#if focusAreas}}
Focus particularly on: {{focusAreas}}
{{/if}}
Provide:
1. Executive summary
2. Security vulnerabilities found
3. Gas optimization opportunities
4. Code quality assessment
5. Actionable recommendations
Format your response in clear markdown with headers and bullet points.Template Syntax
{{variable}}- Insert variable value{{#if var}}...{{/if}}- Conditional sections{{#each items}}...{{/each}}- Loop over arrays
System Prompt (Optional)
Add a system prompt for consistent behavior:
You are a security expert with deep knowledge of Solidity, EVM, and common smart contract vulnerabilities including reentrancy, overflow, and access control issues.Step 4: Configure Models
Select which models users can choose from:
const allowedModels = [
{
id: 'gpt-4o-mini',
name: 'GPT-4o Mini',
tier: 'fast',
pricePerRun: 0.02
},
{
id: 'claude-3.5-sonnet',
name: 'Claude 3.5 Sonnet',
tier: 'balanced',
pricePerRun: 0.05
},
{
id: 'o1-preview',
name: 'o1 Preview',
tier: 'reasoning',
pricePerRun: 0.10
}
]Available Models
Fast Tier ($0.02)
- GPT-4o Mini
- Claude 3 Haiku
- Llama 3.1 8B
- Gemini Flash
Balanced Tier ($0.05)
- GPT-4o
- Claude 3.5 Sonnet
- Llama 3.1 70B
- Gemini Pro
Reasoning Tier ($0.10)
- o1-preview
- Claude 3 Opus
- Llama 3.1 405B
Step 5: Add Examples
Create pre-generated examples to showcase your glyph:
const examples = [
{
id: 'ex_001',
title: 'ERC-20 Token Analysis',
inputs: {
contractAddress: '0x...',
analysisDepth: 'detailed',
focusAreas: 'security'
},
output: '## Security Analysis\n\n...',
model: 'claude-3.5-sonnet'
}
]Step 6: Set Pricing
Per-Run Price
Included in model tier pricing above.
Source Code Price (Optional)
Allow users to buy your prompt template:
const promptSourcePrice = 4.99 // USDCStep 7: Submit for Review
Before publishing:
- Test thoroughly - Run with various inputs
- Check output quality - Ensure consistent results
- Review pricing - Compare to similar glyphs
- Add examples - Show best use cases
Submit your glyph for verification review.
Best Practices
Prompt Quality
- Be specific about output format
- Include examples in the prompt
- Handle edge cases gracefully
User Experience
- Use clear field labels
- Provide helpful descriptions
- Show placeholder examples
Pricing
- Start competitive
- Consider your costs
- Offer value vs alternatives
Next Steps
Last updated on: