Creating Custom Prompts
This guide walks you through creating your own custom prompts in Nexus.
Prompt Structure
A prompt consists of several components:
interface Prompt {
name: string; // Display name
slug: string; // URL-friendly identifier
description: string; // What this prompt does
systemPrompt: string; // AI instructions
parentPromptId?: string; // Optional parent to extend
libraries: string[]; // Documentation to include
skills: string[]; // Skills to enable
mcpServers: string[]; // MCP servers to suggest
preferences: {
verbosity: "concise" | "balanced" | "detailed";
codeStyle: "minimal" | "documented" | "verbose";
responseFormat: "full" | "compact" | "code-only" | "summary";
useEmojis: boolean;
preferredLanguage?: string;
};
category: string; // For organization
tags: string[]; // Searchable tags
}Creating via Dashboard
- Navigate to Prompts Dashboard
- Click "Create Prompt"
- Fill in the form:
- Name: Human-readable name
- Slug: URL-safe identifier (auto-generated from name)
- Description: What the prompt is for
- System Prompt: Instructions for the AI
- Parent Prompt: Optional prompt to extend
- Configure libraries, skills, and preferences
- Click "Create"
Creating via CLI
Interactive Mode
nexus prompt create --interactiveThis guides you through each option with prompts.
Direct Creation
nexus prompt create \
--name "React Testing Expert" \
--slug "react-testing" \
--description "Focused on React component and integration testing" \
--parent testing-qa-engineer \
--libraries react,vitest,testing-library \
--prompt "You are an expert in React testing..."Writing Effective System Prompts
Structure
A good system prompt includes:
- Role Definition: Who the AI is
- Expertise Areas: What it knows well
- Behavioral Guidelines: How it should respond
- Constraints: What to avoid
- Examples: Sample interactions (optional)
Example System Prompt
You are an expert React and TypeScript developer with deep knowledge of:
- React 18+ features (hooks, suspense, concurrent rendering)
- TypeScript 5+ with strict type checking
- Modern state management (Zustand, Jotai, React Query)
- Testing with Vitest and React Testing Library
## Guidelines
- Prefer functional components with hooks over class components
- Always use TypeScript with explicit return types for exported functions
- Suggest appropriate error boundaries for production code
- Include accessibility attributes (aria-\*, role) in UI components
## Code Style
- Use named exports over default exports
- Destructure props in function parameters
- Prefer early returns for guard clauses
- Add JSDoc comments for public APIs
## Constraints
- Do not suggest deprecated patterns (componentWillMount, etc.)
- Avoid inline styles; prefer CSS modules or Tailwind
- Do not use `any` type; prefer `unknown` with type guardsExtending Existing Prompts
Using Inheritance
Extend a prompt to add or override configuration:
nexus prompt create \
--name "React E2E Testing" \
--parent react-testing \
--libraries playwright \
--prompt "Additional focus on end-to-end testing with Playwright..."Inheritance Rules
- System Prompts: Child prompt appended to parent
- Libraries: Merged (union of both)
- Skills: Merged (union of both)
- Preferences: Child overrides parent
- Max Depth: 3 levels of inheritance
Example Inheritance Chain
base-developer (Level 0)
└── typescript-expert (Level 1)
└── react-typescript (Level 2)
└── react-testing (Level 3) ← Maximum depthConfiguring Preferences
Verbosity
| Level | Description |
|---|---|
concise | Minimal explanations, focus on code |
balanced | Moderate explanations with code |
detailed | Thorough explanations and context |
Code Style
| Style | Description |
|---|---|
minimal | Just the essential code |
documented | Code with inline comments |
verbose | Extensive comments and examples |
Response Format
| Format | Description |
|---|---|
full | Complete response with metadata |
compact | Essential information only |
code-only | Just code blocks |
summary | Brief overview |
Including Libraries
Add documentation libraries to your prompt:
# Find available libraries
nexus docs list
# Add to prompt
nexus prompt create \
--libraries react,typescript,tailwindcss,prismaLibraries provide pre-indexed documentation that the AI can query.
Including Skills
Add specialized skills:
# Find available skills
nexus skills list
# Add to prompt
nexus prompt create \
--skills code-review,security-audit,performance-optimizationBest Practices
1. Start Specific
Create focused prompts rather than trying to cover everything:
Good: "React Form Validation Expert"
└── Focused on forms, validation, error handling
Bad: "Full-Stack Everything Expert"
└── Too broad to be useful2. Use Inheritance Wisely
Build a hierarchy of prompts:
frontend-base
├── react-expert
│ ├── react-forms
│ └── react-data-fetching
└── vue-expert
└── vue-composition3. Test Your Prompts
After creating a prompt:
- Activate it:
nexus prompt activate my-prompt - Try various queries
- Verify the AI behavior matches expectations
- Refine the system prompt as needed
4. Document Your Prompts
Add clear descriptions so others (or future you) understand:
nexus prompt create \
--description "For greenfield React projects using TypeScript 5+,
React Query for data, and Tailwind for styling.
Assumes Vite as build tool."Sharing Prompts
You can make prompts public for others to use:
- Set
isPublic: truewhen creating - Others can search and fork your prompt
- Forked prompts can be customized
To share a prompt configuration:
- Download the prompt:
nexus prompt download my-prompt - Share the PROMPT.md file
- Others can import or recreate the prompt
Troubleshooting
Prompt Not Activating
Check that you're authenticated:
nexus auth statusInheritance Not Working
Verify parent prompt exists:
nexus prompt get parent-prompt-slugSystem Prompt Too Long
Keep prompts focused. If you need extensive instructions, consider:
- Using inheritance to split into layers
- Linking to external documentation
- Using skills for specialized knowledge