system-prompt-builder
System prompt assembly for blah.chat AI backend. Multi-layer prompt construction with priority ordering, parallel context loading, memory truncation, budget awareness. Use when working with "system prompt", "base prompt", "identity memories", "custom instructions", "knowledge bank", "budget state", prompt ordering, or message assembly in Convex generation actions.
npx skills add majiayu000/claude-skill-registry --skill system-prompt-builder --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# System Prompt Builder Backend system for assembling multi-layer AI system prompts with order-dependent priority. Located in `packages/backend/convex/lib/prompts/`. ## Priority Order (Critical) **Later messages = higher priority** due to LLM recency bias. Structure: 1. Base prompt (foundation) 2. Identity memories (10% context budget) 3. Contextual memories (prefetched for non-tool models) 4. Project context 5. Knowledge bank prompt 6. Budget awareness prompts 7. Document mode prompt 8. Conversation-level system prompt 9. **Custom instructions (HIGHEST - last)** From `systemBuilder.ts`: ```typescript // === 1. BASE IDENTITY (foundation) === systemMessages.push({ role: "system", content: basePrompt, }); // === 2. IDENTITY MEMORIES === systemMessages.push({ role: "system", content: `## Identity & Preferences\n\n${memoryContentForTracking}`, }); // ... 3-5 project/KB/budget prompts ... // === 6. USER CUSTOM INSTRUCTIONS (HIGHEST PRIORITY - LAST) === const userPreferencesContent = `<user_preferences priority="highest"> ## User Personalization Settings **IMPORTANT**: These take absolute priority over default behavior. ${sections.join("\n\n")} </user_preferences>`; systemMessages.push({
- Priority Order (Critical)
- Parallel Context Loading
- Base Prompt Structure
- Conditional Tone Section
- Identity Memories
- Memory Truncation
- Custom Instructions Override
- Knowledge Bank Prompt
- Budget State Awareness
- Document Mode (Canvas)
- Key Files
- Anti-Patterns
What does the system-prompt-builder skill do?
System prompt assembly for blah.chat AI backend. Multi-layer prompt construction with priority ordering, parallel context loading, memory truncation, budget awareness. Use when working with "system prompt", "base prompt", "identity memories", "custom instructions", "knowledge bank", "budget state", prompt ordering, or message assembly in Convex generation actions.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill system-prompt-builder --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
