ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

prompt-assemble

Token-safe prompt assembly with memory orchestration. Use for any agent that needs to construct LLM prompts with memory retrieval. Guarantees no API failure due to token overflow. Implements two-phase context construction, memory safety valve, and hard limits on memory injection.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/alexunitario-sketch/prompt-assemble
Or

What This Skill Does

The prompt-assemble skill provides a robust, standardized framework for constructing LLM prompts while guaranteeing token safety. By utilizing a sophisticated Two-Phase Context Construction model, it ensures that your agents never hit hard API limits. The system separates the base context (system instructions, recent chat history, and current user intent) from optional memory injections. It features a critical 'Memory Safety Valve' that dynamically prunes retrieved information if the estimated token count exceeds a 75% safety threshold, ensuring your agent remains stable and responsive.

Installation

To integrate this skill into your local OpenClaw environment, run the following command in your terminal:

clawhub install openclaw/skills/skills/alexunitario-sketch/prompt-assemble

Use Cases

This skill is essential for developers building long-term memory systems for their agents. It is particularly valuable for:

  1. Chatbots that need to maintain context over long, multi-session interactions without causing token overflow.
  2. Complex automated workflows where prompts grow dynamically based on retrieved documents or database records.
  3. Systems that require high uptime, where API call failures due to token limits must be strictly avoided.

Example Prompts

  1. "Assemble the prompt for the current context, prioritizing the system instructions and the last 3 user turns, then inject relevant memory if token count permits."
  2. "Construct a new prompt session using the prompt-assemble framework, ensuring the safety margin is set at 75% of the total capacity."
  3. "Evaluate the current conversation context and prepare a prompt that retrieves memory regarding my previous project requirements without exceeding the safety valve."

Tips & Limitations

The prompt-assemble skill follows a 'safety-first' design philosophy. It is important to remember that the system prompt and current user input are immutable and will never be truncated or sacrificed to fit memory, as these are critical for agent identity and intent. Memory is treated as a discardable enhancement; if the safety valve detects a potential overflow, it will simply omit the memory component. Ensure your model's MAX_TOKENS constant is correctly configured to match the specific LLM you are using to maintain the accuracy of the token estimation phase.

Metadata

Stars4473
Views1
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-alexunitario-sketch-prompt-assemble": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#llm#token-management#prompt-engineering#memory-orchestration#stability
Safety Score: 5/5